/* George Palade. Light theme: a stained slide on journal paper (hematoxylin violet, eosin rose).
   Dark theme: the green phosphor screen of a 1950s electron microscope. */
@font-face { font-family: "Source Serif 4"; src: url("fonts/source-serif-4-normal-latin.woff2") format("woff2");
  font-weight: 200 900; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Source Serif 4"; src: url("fonts/source-serif-4-normal-latin-ext.woff2") format("woff2");
  font-weight: 200 900; font-display: swap;
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Source Serif 4"; font-style: italic; src: url("fonts/source-serif-4-italic-latin.woff2") format("woff2");
  font-weight: 200 900; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Source Serif 4"; font-style: italic; src: url("fonts/source-serif-4-italic-latin-ext.woff2") format("woff2");
  font-weight: 200 900; font-display: swap;
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Atkinson Hyperlegible Next"; src: url("fonts/AtkinsonHyperlegibleNext.woff2") format("woff2");
  font-weight: 200 800; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/IBMPlexMono-Regular.woff2") format("woff2");
  font-weight: 400; font-display: swap; }

:root {
  --bg: #f6f1ea;
  --surface: #fffaf3;
  --surface-2: #efe6dc;
  --ink: #1d1424;
  --ink-2: #3b2f45;
  --muted: #4a3f52;
  --rule: #d7c9bb;
  --accent: #5b2a7a;       /* hematoxylin */
  --accent-2: #8e2350;     /* eosin, deep */
  --accent-ink: #fffaf3;
  --right: #1f5c3a;
  --wrong: #8e2350;
  --focus: #5b2a7a;
  /* the stage */
  --st-bg: #fbf3ef;
  --st-cyto: #f2d9df;
  --st-cyto-line: #9b4a67;
  --st-nuc: #cdb8e3;
  --st-nuc-line: #5b2a7a;
  --st-nucleolus: #7c52a3;
  --st-er: #8e2350;
  --st-er-lumen: #e8b9c9;
  --st-ribo: #3a1747;
  --st-mito: #e6c79f;
  --st-mito-line: #7a4d1e;
  --st-golgi: #6b3d8f;
  --st-vac: #e4c3d3;
  --st-gran: #6d1d44;
  --st-lumen: #fffaf3;
  --st-label: #1d1424;
  --st-halo: #fbf3ef;
  --st-pulse: #0b6b4e;
  --st-hl: #0b6b4e;
  --shadow: 0 1px 0 rgba(29, 20, 36, .06);
  --bar-h: 3.25rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #07110c; --surface: #0c1a13; --surface-2: #11241a; --ink: #e3f5e9; --ink-2: #c6e3cf;
    --muted: #b3d1bd; --rule: #24402f; --accent: #8ff0b8; --accent-2: #f2a8c4; --accent-ink: #07110c;
    --right: #8ff0b8; --wrong: #f2a8c4; --focus: #8ff0b8;
    --st-bg: #04100a; --st-cyto: #0d2419; --st-cyto-line: #4fa77a; --st-nuc: #123a28; --st-nuc-line: #7fe0a8;
    --st-nucleolus: #2f7a55; --st-er: #6fd39c; --st-er-lumen: #174a33; --st-ribo: #d6ffe6; --st-mito: #16402d; --st-mito-line: #8fe3b5;
    --st-golgi: #a6f0c6; --st-vac: #1b4a34; --st-gran: #bff5d6; --st-lumen: #07110c; --st-label: #e3f5e9;
    --st-halo: #04100a; --st-pulse: #ffd36b; --st-hl: #ffd36b;
    --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #07110c; --surface: #0c1a13; --surface-2: #11241a; --ink: #e3f5e9; --ink-2: #c6e3cf;
  --muted: #b3d1bd; --rule: #24402f; --accent: #8ff0b8; --accent-2: #f2a8c4; --accent-ink: #07110c;
  --right: #8ff0b8; --wrong: #f2a8c4; --focus: #8ff0b8;
  --st-bg: #04100a; --st-cyto: #0d2419; --st-cyto-line: #4fa77a; --st-nuc: #123a28; --st-nuc-line: #7fe0a8;
  --st-nucleolus: #2f7a55; --st-er: #6fd39c; --st-er-lumen: #174a33; --st-ribo: #d6ffe6; --st-mito: #16402d; --st-mito-line: #8fe3b5;
  --st-golgi: #a6f0c6; --st-vac: #1b4a34; --st-gran: #bff5d6; --st-lumen: #07110c; --st-label: #e3f5e9;
  --st-halo: #04100a; --st-pulse: #ffd36b; --st-hl: #ffd36b;
  --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--bar-h) + env(safe-area-inset-top) + .75rem); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 1.0625rem/1.62 "Atkinson Hyperlegible Next", system-ui, sans-serif;
  overflow-x: clip;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: "Source Serif 4", Georgia, serif; font-weight: 600; line-height: 1.12; letter-spacing: -.01em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: .5rem; background: var(--surface); color: var(--ink); padding: .6rem 1rem; z-index: 50; }
.skip:focus { left: .5rem; }

/* ---------- top bar (templates/topbar.md) ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--bar-h);
  display: flex; align-items: center; gap: .9rem; padding: 0 max(1rem, env(safe-area-inset-left));
  background: var(--bg); border-bottom: 1px solid var(--rule);
}
.home { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: .8rem; color: var(--ink); text-decoration: none; white-space: nowrap; }
.topnav { display: flex; gap: 1rem; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.topnav::-webkit-scrollbar { display: none; }
.topnav a { color: var(--ink-2); text-decoration: none; white-space: nowrap; font-size: .92rem; padding: .7rem 0; }
.topnav a[aria-current] { color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }
.spacer { flex: 1; }
.chip { font-size: .85rem; color: var(--ink); border: 1px solid var(--rule); border-radius: 999px; padding: .35rem .8rem; text-decoration: none; white-space: nowrap; min-height: 44px; display: inline-flex; align-items: center; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--rule); background: transparent; color: var(--ink); display: inline-grid; place-items: center; cursor: pointer; flex: none; }
.icon-btn svg { display: block; }
.icon-btn svg[hidden] { display: none; }

/* ---------- hero ---------- */
.hero { max-width: 76rem; margin: 0 auto; padding: 2.4rem 1rem 1.2rem; }
.hero-img { display: none; }
@media (min-width: 64rem) {
  .hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 3rem; align-items: center; padding-top: 3.2rem; }
  .hero-img { display: block; margin: 0; }
  .hero-img img { width: 100%; }
}
.eyebrow { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 .8rem; }
.hero h1 { font-size: clamp(2.1rem, 6.2vw, 4.1rem); margin: 0 0 1rem; max-width: 18ch; font-weight: 640; font-variation-settings: "opsz" 60; }
.deck { font-size: clamp(1.08rem, 2.2vw, 1.28rem); color: var(--ink-2); max-width: 44rem; margin: 0 0 1.4rem; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; max-width: 44rem; }
.stat { border-top: 2px solid var(--accent); padding-top: .5rem; }
.stat .n { display: block; font-family: "Source Serif 4", serif; font-size: clamp(1.5rem, 4vw, 2.1rem); font-weight: 600; color: var(--accent); line-height: 1.1; }
.stat .l { display: block; font-size: .88rem; color: var(--muted); line-height: 1.35; }

/* ---------- scale ---------- */
.scale { max-width: 76rem; margin: .6rem auto 2rem; padding: 1.1rem 1rem 1.2rem; background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; }
@media (min-width: 66rem) { .scale { padding: 1.4rem 1.6rem; } }
.scale h2 { font-size: 1.45rem; margin: 0 0 .3rem; }
.scale > p { margin: 0 0 .8rem; color: var(--ink-2); max-width: 44rem; }
.ctl { display: inline-flex; flex-direction: column; gap: .25rem; font-size: .9rem; color: var(--muted); }
.ctl input { font: 600 1.4rem "IBM Plex Mono", ui-monospace, monospace; width: 8rem; min-height: 48px; padding: .3rem .6rem; border: 2px solid var(--rule); border-radius: 10px; background: var(--bg); color: var(--ink); }
.scale-out dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: .6rem 1.2rem; margin: 1rem 0 0; }
.scale-out dt { font-size: .9rem; color: var(--muted); }
.scale-out dd { margin: 0; font: 600 1.35rem "Source Serif 4", serif; color: var(--ink); }
.warn { color: var(--wrong); font-weight: 600; }

/* ---------- the story: sticky stage + prose ---------- */
.story { max-width: 76rem; margin: 0 auto; padding: 0 1rem; }
.stage-wrap { position: sticky; top: calc(var(--bar-h) + env(safe-area-inset-top)); z-index: 5; background: var(--bg); padding: .4rem 0 .3rem; }
.stage { position: relative; background: var(--st-bg); border: 1px solid var(--rule); border-radius: 16px; overflow: hidden; }
.cell { display: block; width: 100%; height: 34svh; max-height: 20rem; }
.readout { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .1rem .8rem; min-height: 2.1em; padding: .45rem .75rem .35rem;
  border-bottom: 1px solid var(--rule); background: var(--surface);
  font: .74rem/1.35 "IBM Plex Mono", ui-monospace, monospace; color: var(--ink); }
.ro-count { color: var(--accent); font-weight: 400; }
.stage-cap { margin: 0; padding: .3rem .8rem .5rem; font-size: .76rem; color: var(--muted); line-height: 1.35; }
@media (max-width: 63.99rem) { .stage-cap { display: none; } }
.prose { max-width: 40rem; margin: 0 auto; }
@media (min-width: 64rem) {
  .story { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 3rem; align-items: start; }
  .stage-wrap { top: calc(var(--bar-h) + 1rem); padding: 0; order: 0; }
  .cell { height: min(70svh, 42rem); max-height: none; }
  .prose { margin: 0; }
  .readout { font-size: .82rem; }
}

/* ---------- the cell drawing ---------- */
.cell .l-lumen path { fill: var(--st-lumen); stroke: var(--st-cyto-line); stroke-width: 1.2; }
.cell .l-cyto path { fill: var(--st-cyto); stroke: var(--st-cyto-line); stroke-width: 2; }
.cell .l-micro path { fill: none; stroke: var(--st-cyto-line); stroke-width: 1.2; }
.cell .l-er path { fill: var(--st-er-lumen); stroke: var(--st-er); stroke-width: .9; stroke-linejoin: round; }
.cell .l-ribo circle { fill: var(--st-ribo); }
.cell .l-mito ellipse { fill: var(--st-mito); stroke: var(--st-mito-line); stroke-width: 1.2; }
.cell .l-mito .cristae { fill: none; stroke: var(--st-mito-line); stroke-width: .9; }
.cell .l-golgi path { fill: none; stroke: var(--st-golgi); stroke-width: 3.2; stroke-linecap: round; }
.cell .l-ves circle { fill: var(--st-vac); stroke: var(--st-golgi); stroke-width: 1; }
.cell .l-vac circle { fill: var(--st-vac); stroke: var(--st-golgi); stroke-width: 1.2; }
.cell .l-lyso circle { fill: var(--st-mito-line); opacity: .8; }
.cell .l-nuc ellipse { fill: var(--st-nuc); stroke: var(--st-nuc-line); stroke-width: 2; }
.cell .l-nuc .nucleolus { fill: var(--st-nucleolus); stroke: none; }
.cell .l-gran circle { fill: var(--st-gran); }
.cell .l-route path { fill: none; stroke: var(--st-pulse); stroke-width: 2; stroke-dasharray: 5 5; opacity: 0; transition: opacity .5s; vector-effect: non-scaling-stroke; }
.cell .l-route .stop circle { fill: none; stroke: var(--st-pulse); stroke-width: 2; opacity: 0; transition: opacity .4s; vector-effect: non-scaling-stroke; }
.cell #pulse { opacity: 0; }
.cell #pulse circle { fill: var(--st-pulse); }
.cell .lbl { font: 600 11px "Atkinson Hyperlegible Next", sans-serif; fill: var(--st-label); opacity: 0; transition: opacity .5s;
  paint-order: stroke; stroke: var(--st-halo); stroke-width: 3.2px; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.cell .s-ribo, .cell .s-grains { font-size: 7px; }
.fine { transition: filter .8s, opacity .8s; }

/* scenes: which layers and labels each chapter shows */
.stage[data-scene="blur"] .fine { filter: blur(2.4px); opacity: .5; }
.stage[data-scene="blur"] .l-gran { filter: blur(1.2px); }
.stage[data-scene="blur"] .s-light,
.stage[data-scene="blur"] .s-nuc,
.stage[data-scene="sharp"] .s-nuc, .stage[data-scene="sharp"] .s-er, .stage[data-scene="sharp"] .s-mito,
.stage[data-scene="sharp"] .s-gol, .stage[data-scene="sharp"] .s-gra,
.stage[data-scene="er"] .s-grains,
.stage[data-scene="ribo"] .s-ribo,
.stage[data-scene="route"] .s-er, .stage[data-scene="route"] .s-gol, .stage[data-scene="route"] .s-vac,
.stage[data-scene="route"] .s-gra, .stage[data-scene="route"] .s-lum, .stage[data-scene="route"] .s-ves,
.stage[data-scene="three"] .s-claude, .stage[data-scene="three"] .s-duve, .stage[data-scene="three"] .s-palade,
.stage[data-scene="whole"] .s-nuc, .stage[data-scene="whole"] .s-gra, .stage[data-scene="whole"] .s-gol,
.stage[data-scene="today"] .s-nuc, .stage[data-scene="today"] .s-er, .stage[data-scene="today"] .s-gol,
.stage[data-scene="today"] .s-vac, .stage[data-scene="today"] .s-gra, .stage[data-scene="today"] .s-lum,
.stage[data-scene="today"] .s-mito, .stage[data-scene="today"] .s-lyso, .stage[data-scene="today"] .s-ves { opacity: 1; }
.stage[data-scene="er"] .l-ribo circle, .stage[data-scene="ribo"] .l-ribo circle { fill: var(--st-hl); }
.stage[data-scene="route"] .l-route path, .stage[data-scene="three"] .l-route path { opacity: .9; }
.stage[data-scene="route"] .l-route .stop circle { opacity: .55; }
.stage[data-scene="route"] .l-route .stop.on circle { opacity: 1; stroke-width: 3; }
.stage.pulsing[data-scene="route"] #pulse { opacity: 1; }
.stage[data-scene="three"] .l-lyso circle { fill: var(--st-hl); opacity: 1; }
/* the tube lights the matching part of the cell */
.stage[data-scene="sharp"][data-hl="nuclei"] .l-nuc ellipse,
.stage[data-scene="sharp"][data-hl="mito"] .l-mito ellipse,
.stage[data-scene="sharp"][data-hl="micro"] .l-er path { stroke: var(--st-hl); stroke-width: 3; }
.stage[data-scene="sharp"][data-hl="sap"] .l-cyto path { fill: var(--st-vac); }
/* with scripts: start hidden only once the stage is known to work */
.stage:not(.ready) .lbl { opacity: 1; }
.stage:not(.ready) .l-route path { opacity: .9; }

/* ---------- chapters ---------- */
.chapter { padding: 2.6rem 0 1.4rem; border-top: 1px solid var(--rule); scroll-margin-top: calc(var(--bar-h) + env(safe-area-inset-top) + .5rem); }
.chapter:first-child { border-top: 0; }
@media (max-width: 63.99rem) { .chapter { scroll-margin-top: calc(var(--bar-h) + env(safe-area-inset-top) + min(34svh, 20rem) + 3.4rem); } }
.stamp { font: .78rem/1.3 "IBM Plex Mono", ui-monospace, monospace; letter-spacing: .04em; color: var(--muted); margin: 0 0 .5rem; text-transform: uppercase; }
.chn { display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; border: 1.5px solid var(--accent); color: var(--accent); margin-right: .45rem; }
.chapter h2 { font-size: clamp(1.6rem, 3.6vw, 2.2rem); margin: 0 0 .7rem; font-variation-settings: "opsz" 40; }
.anchor { color: inherit; text-decoration: none; }
.anchor:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.count { margin: 0 0 1rem; font-family: "Source Serif 4", serif; color: var(--accent); }
.count .cv { font-size: 2.2rem; font-weight: 600; }
.count .cu { font-size: 1rem; color: var(--muted); margin-left: .4rem; font-family: "Atkinson Hyperlegible Next", sans-serif; }
.chapter p { margin: 0 0 1rem; }

.plate { margin: 1.4rem 0; }
.plate img { border-radius: 10px; border: 1px solid var(--rule); background: var(--surface-2); }
.plate figcaption { font-size: .88rem; color: var(--muted); margin-top: .5rem; line-height: 1.45; }
.credit { display: block; margin-top: .15rem; font-size: .8rem; color: var(--muted); }
.compare { display: grid; grid-template-columns: 1fr; gap: 1rem; margin: 1.4rem 0; }
@media (min-width: 40rem) { .compare { grid-template-columns: 1fr 1fr; } }
.compare .plate { margin: .4rem 0 0; }
.cmp-h { font-weight: 700; margin: 0; }

/* ---------- beats ---------- */
.beat { margin: 1.6rem 0 .6rem; padding: 1rem 1rem 1.1rem; border-left: 4px solid var(--accent-2); background: var(--surface); border-radius: 0 12px 12px 0; }
.beat-kicker { font: .74rem "IBM Plex Mono", ui-monospace, monospace; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 .3rem !important; }
.beat-q { font-family: "Source Serif 4", serif; font-size: 1.2rem; font-weight: 600; margin: 0 0 .7rem !important; }
.opts, .q-btns, .frac-btns, .stations { display: flex; flex-wrap: wrap; gap: .5rem; }
.opt, .btn {
  font: 600 .98rem "Atkinson Hyperlegible Next", sans-serif; min-height: 44px; padding: .5rem .95rem;
  border: 2px solid var(--accent); border-radius: 999px; background: transparent; color: var(--ink); cursor: pointer; text-align: left;
}
.opt:hover, .btn:hover { background: var(--surface-2); }
.opt[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.opt.is-right { border-color: var(--right); box-shadow: inset 0 0 0 2px var(--right); }
.opt.is-right[aria-pressed="true"] { background: var(--right); color: var(--accent-ink); }
.opt.is-wrong { border-color: var(--wrong); background: transparent; color: var(--ink); text-decoration: line-through; text-decoration-thickness: 2px; }
.opt:disabled { opacity: .45; cursor: default; }
.beat-reveal { margin: .9rem 0 0 !important; padding-top: .8rem; border-top: 1px dashed var(--rule); }

/* ---------- tools inside chapters ---------- */
.tool { margin: 1.6rem 0; padding: 1rem; background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; }
.tool h3 { font-size: 1.2rem; margin: 0 0 .3rem; }
.frac-row { display: flex; gap: 1rem; align-items: center; }
.tube { width: 4.5rem; flex: none; }
.tube .glass { fill: none; stroke: var(--ink-2); stroke-width: 2; }
.tube .band { fill: var(--surface-2); stroke: var(--rule); }
.tube .b-nuclei { fill: var(--st-nuc); } .tube .b-mito { fill: var(--st-mito); } .tube .b-micro { fill: var(--st-vac); } .tube .b-sap { fill: var(--st-cyto); }
.fractions[data-hl="nuclei"] .b-nuclei, .fractions[data-hl="mito"] .b-mito, .fractions[data-hl="micro"] .b-micro, .fractions[data-hl="sap"] .b-sap { stroke: var(--st-hl); stroke-width: 3; }
.frac-out { margin-top: .8rem; }
.frac-out p { margin: .4rem 0 0; }
.frac-fifth { font-weight: 600; color: var(--accent); }
.yours-h { margin: 1rem 0 .3rem !important; font-weight: 700; }
.yours { margin: 0 0 .8rem; padding-left: 1.4rem; min-height: 1.5rem; }
.yours li.is-right::after { content: " ✓"; color: var(--right); font-weight: 700; }
.yours li.is-wrong { color: var(--wrong); }
.yours li.is-wrong::after { content: " ✗"; font-weight: 700; }
.route-answer:focus { outline: none; }
.route-answer:focus-visible { outline: 3px solid var(--focus); }
.route-answer { margin-top: 1rem; border-top: 1px dashed var(--rule); padding-top: .8rem; }
.ra-h { font-weight: 700; }
.route-answer ol { padding-left: 1.4rem; }
.route-answer li { margin-bottom: .45rem; }
.route-answer li span { display: block; color: var(--ink-2); font-size: .95rem; }
.route-answer li .t { display: inline; font-family: "IBM Plex Mono", monospace; font-size: .85rem; color: var(--accent); margin-left: .5rem; }
.ra-note { font-size: .92rem; color: var(--muted); }
.clock { font: 600 1.5rem "IBM Plex Mono", monospace; color: var(--accent); margin: .3rem 0 0 !important; }
.tool:not(.ready) .yours-h, .tool:not(.ready) .yours, .tool:not(.ready) #route-reset, .tool:not(.ready) .clock { display: none; }

/* ---------- timeline, figures, game, limits, sources ---------- */
.timeline, .figures, .game, #limite, #surse { max-width: 50rem; margin: 0 auto; padding: 2.6rem 1rem 1rem; scroll-margin-top: calc(var(--bar-h) + .5rem); }
section h2 { font-size: clamp(1.5rem, 3.2vw, 2rem); margin: 0 0 1rem; }
.timeline ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--accent); }
.timeline li { display: grid; grid-template-columns: 3.4rem 1fr; gap: .1rem .8rem; padding: .45rem 0 .45rem .9rem; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: .95rem; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.timeline .y { font: 600 .95rem "IBM Plex Mono", monospace; color: var(--accent); grid-row: span 2; }
.timeline .who { font-weight: 700; }
.timeline .what { color: var(--ink-2); }
.fig-table { width: 100%; border-collapse: collapse; }
.fig-table th, .fig-table td { text-align: left; vertical-align: top; padding: .55rem .4rem; border-bottom: 1px solid var(--rule); }
.fig-table th { font-weight: 600; color: var(--ink-2); width: 45%; }
.qs { list-style: none; padding: 0; margin: 0; counter-reset: q; }
.q { padding: 1rem 0; border-top: 1px solid var(--rule); counter-increment: q; }
.q-s { font-family: "Source Serif 4", serif; font-size: 1.12rem; font-weight: 600; margin: 0 0 .6rem; }
.q-s::before { content: counter(q) ". "; color: var(--accent); }
.q-why { margin-top: .6rem; }
.q-why p { margin: 0 0 .3rem; }
.q-src { font-size: .88rem; }
.score { font: 600 1.25rem "Source Serif 4", serif; margin: 1rem 0; min-height: 1.6rem; color: var(--accent); }
.game-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
#copy-out { width: 100%; margin-top: .6rem; font: .9rem "IBM Plex Mono", monospace; padding: .5rem; border: 1px solid var(--rule); border-radius: 8px; background: var(--surface); color: var(--ink); }
.limits li, .srcs li { margin-bottom: .55rem; }
.srcs { padding-left: 1.2rem; font-size: .95rem; }
.imgnote { font-size: .92rem; color: var(--muted); }
.foot { max-width: 50rem; margin: 2rem auto 0; padding: 1.4rem 1rem 2.4rem; border-top: 1px solid var(--rule); font-size: .9rem; color: var(--muted); }
.foot a { color: var(--ink-2); }
.nf main { max-width: 40rem; margin: 18vh auto; padding: 0 1rem; }

@media (max-width: 30rem) {
  .stats { grid-template-columns: 1fr 1fr 1fr; gap: .5rem; }
  .stat .l { font-size: .8rem; }
  .topbar { gap: .5rem; padding: 0 .6rem; }
  .home { font-size: .68rem; }
  .topnav { gap: .6rem; }
  .topnav a { font-size: .84rem; }
  .chip { padding: .35rem .55rem; font-size: .8rem; }
  .stats { display: none; }
}

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