:root {
  color-scheme: light;
  --paper: #fff;
  --ink: #000;
  --secondary: #5e5e5e;
  --rule: #d4d4d4;
  --well: #f2f2f2;
  --preview-width: 390px;
  --preview-height: 844px;
  --face: "LL Cormorant", Georgia, serif;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  background: var(--paper);
  color: var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; padding: 0 clamp(16px, 3vw, 48px) 40px; }
a { color: inherit; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
.skip-link { position: absolute; top: 8px; left: 16px; z-index: 3; background: var(--paper); padding: 12px 16px; transform: translateY(-160%); }
.skip-link:focus { transform: none; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 28px 0 24px; border-bottom: 1px solid var(--ink); }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-family: var(--face); font-weight: 500; font-size: clamp(2.125rem, 4.4vw, 3.25rem); line-height: 1.05; font-feature-settings: "lnum"; }
.brief-link { flex: none; font-size: .875rem; padding: 8px 0; }
.gallery { display: grid; grid-template-columns: minmax(180px, 240px) minmax(0, 1fr); column-gap: clamp(24px, 4vw, 64px); padding-top: 28px; }
.study-index { min-width: 0; }
.study-index h2 { font-size: .875rem; font-weight: 600; margin: 0 0 12px; }
.study-list { list-style: none; margin: 0; padding: 0; }
.study-list li { border-top: 1px solid var(--rule); }
.study-list li:last-child { border-bottom: 1px solid var(--rule); }
.study-list a { display: flex; flex-direction: column; justify-content: center; min-height: 52px; padding: 9px 8px 9px 0; text-decoration: none; overflow-wrap: anywhere; }
.study-name { font-family: var(--face); font-size: 1.3125rem; line-height: 1.15; }
.study-verdict { font-size: .8125rem; line-height: 1.35; color: var(--secondary); }
.study-list a[aria-current="page"] .study-name { text-decoration: underline; text-decoration-thickness: 2px; text-decoration-color: #d55e00; text-underline-offset: .18em; }
.study-list a:hover .study-name { text-decoration: underline; }
.index-note { color: var(--secondary); margin: 16px 0 0; max-width: 28ch; font-size: .8125rem; }
noscript p { margin-top: 16px; font-size: .875rem; }
.study-detail { min-width: 0; }
.study-header { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px; }
.study-header h2 { font-family: var(--face); font-size: 2.125rem; font-weight: 500; line-height: 1.2; margin: 0; overflow-wrap: anywhere; }
.full-size-link { padding: 8px 0; flex: none; font-size: .875rem; }
.study-idea { max-width: 72ch; margin: 12px 0; }
.study-notes { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 16px; margin: 16px 0 24px; max-width: 82ch; font-size: .875rem; }
.study-notes dt { font-weight: 600; }
.study-notes dd { margin: 0; color: var(--secondary); overflow-wrap: anywhere; }
.preview-tools { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; border-top: 1px solid var(--rule); padding-top: 14px; }
.sizes { margin: 0; padding: 0; border: 0; min-width: 0; }
.sizes legend { font-size: .8125rem; padding: 0; margin-bottom: 8px; }
.size-options, .preview-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.preview-tools button { min-height: 44px; background: var(--paper); border: 1px solid var(--rule); padding: 8px 12px; cursor: pointer; font-size: .8125rem; line-height: 1.35; }
.size-options button { text-align: left; }
.size-options span { display: block; color: var(--secondary); font-size: .75rem; font-variant-numeric: tabular-nums; }
.preview-tools button:hover { border-color: var(--ink); }
.preview-tools button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); font-weight: 600; }
.preview-tools button[aria-pressed="true"] span { color: var(--paper); }
.status { margin: 16px 0 4px; font-size: .875rem; color: var(--secondary); }
.size-note { margin: 0 0 12px; font-size: .75rem; color: var(--secondary); }
.preview-scroll { width: 100%; max-width: 100%; overflow: auto; padding: 20px; background: var(--well); border: 1px solid var(--rule); }
#study-preview { display: block; width: var(--preview-width); height: var(--preview-height); max-width: none; border: 0; background: white; outline: 1px solid var(--rule); }
#study-preview:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

@media (min-width: 1100px) {
  /* One sticky column, not one per section: separate sticky lists slid over each other on scroll. */
  .study-index { position: sticky; top: 24px; align-self: start; max-height: calc(100vh - 48px); overflow-y: auto; overscroll-behavior: contain; padding-right: 4px; }
}

@media (max-width: 760px) {
  .page-header { padding-top: 24px; gap: 16px; }
  .gallery { grid-template-columns: minmax(0, 1fr); padding-top: 20px; row-gap: 24px; }
  .study-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 20px; }
  .study-list li:last-child { border-bottom: 0; }
  .study-list a { min-height: 48px; padding-top: 10px; padding-bottom: 10px; font-size: .875rem; }
  .index-note { max-width: none; margin-top: 10px; }
  .study-header h2 { font-size: 1.5rem; }
  .preview-scroll { padding: 12px; }
}

@media (max-width: 380px) {
  .page-header { align-items: flex-start; flex-direction: column; gap: 8px; }
  .study-list { column-gap: 12px; }
  .study-notes { grid-template-columns: minmax(0, 1fr); row-gap: 2px; }
  .study-notes dd { margin-bottom: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}

@media (forced-colors: active) {
  :root { --paper: Canvas; --ink: CanvasText; --secondary: CanvasText; --rule: ButtonText; --well: Canvas; }
  .preview-tools button[aria-pressed="true"] { color: HighlightText; background: Highlight; border: 2px solid ButtonText; }
  .preview-tools button[aria-pressed="true"] span { color: HighlightText; }
  .study-list a[aria-current="page"] { border-inline-start: 3px solid LinkText; padding-inline-start: 6px; }
}

.study-index nav + nav { margin-top: 28px; }
#app-list { counter-reset: studies; }
#sets-list, #retired-list { counter-reset: studies; }
