/* ============================================================
   How LLMs Actually Work — scrollytelling prototype
   Dark, editorial, built for astronomers.
   ============================================================ */

:root {
  /* surfaces */
  --bg: #0b0e14;
  --bg-deep: #070a0f;
  --elev: #12161f;
  --chart: #151a23;

  /* ink */
  --ink: #e8e6df;
  --ink-2: #aeaca2;
  --ink-3: #757a80;
  --hairline: rgba(232, 230, 223, 0.13);
  --hairline-soft: rgba(232, 230, 223, 0.07);

  /* accents */
  --gold: #d9a54a;          /* key ideas */
  --gold-dim: rgba(217, 165, 74, 0.14);
  --blue: #3987e5;          /* actionable + series-1 */
  --blue-dim: rgba(57, 135, 229, 0.14);

  /* validated categorical (dark) — charts only */
  --s1: #3987e5;
  --s2: #008300;
  --s3: #d55181;
  --s4: #c98500;

  /* status-ish inks for true/false annotation text */
  --good-ink: #4cc36a;
  --bad-ink: #e66767;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;

  --maxw: 68rem;
  --step-w: 24rem;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: rgba(217, 165, 74, 0.28); }

svg text { font-family: var(--sans); }

/* ---------- reveal machinery ---------- */

.js .fx,
.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s cubic-bezier(0.22, 0.7, 0.3, 1),
              transform 0.7s cubic-bezier(0.22, 0.7, 0.3, 1);
  transition-delay: var(--d, 0s);
}
.js .fx.on,
.js .reveal.is-visible { opacity: 1; transform: none; }

/* draw-in strokes */
.js .draw { stroke-dashoffset: var(--len, 300); transition: stroke-dashoffset 1.1s ease var(--d, 0s); }
.js .draw.on, .js .is-visible .draw { stroke-dashoffset: 0; }

@media (prefers-reduced-motion: reduce) {
  .js .fx, .js .reveal, .js .draw { transition: none !important; opacity: 1 !important; transform: none !important; stroke-dashoffset: 0 !important; }
  html { scroll-behavior: auto; }
}

/* ---------- HUD ---------- */

.progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60;
  background: transparent;
}
.progress .bar {
  height: 100%; width: 100%;
  background: linear-gradient(90deg, var(--gold), #b8813a);
  transform-origin: 0 50%;
  transform: scaleX(0);
}

.hud {
  position: fixed; left: 1.4rem; bottom: 1.25rem; z-index: 60;
  font-family: var(--sans); font-size: 0.7rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-3);
  display: flex; gap: 0.6em; align-items: baseline;
  opacity: 0; transition: opacity 0.5s;
  pointer-events: none;
}
.hud.show { opacity: 1; }
.hud .hud-beat { color: var(--gold); font-variant-numeric: tabular-nums; }

/* ---------- generic layout ---------- */

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 2rem; }

section.beat { padding: 9rem 0 7rem; position: relative; }
section.beat.compact { padding: 5.5rem 0 4.5rem; }
section.beat + section.beat::before {
  content: ""; position: absolute; top: 0; left: 50%;
  width: 1px; height: 4.5rem; background: var(--hairline);
  transform: translateX(-50%);
}

.beat-head { max-width: 46rem; }
.beat-no {
  font-family: var(--sans); font-size: 0.72rem; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--ink-3);
  display: flex; align-items: center; gap: 0.9em; margin-bottom: 1.1rem;
}
.beat-no b { color: var(--gold); font-weight: 600; font-variant-numeric: tabular-nums; }
.beat-no::after { content: ""; flex: 0 0 3.5rem; height: 1px; background: var(--hairline); }

h2 {
  font-size: clamp(1.7rem, 3.4vw, 2.5rem);
  font-weight: 500; line-height: 1.16; letter-spacing: -0.01em;
  text-wrap: balance;
}
h2 em { font-style: italic; color: var(--gold); }

.ground {
  margin-top: 0.9rem; color: var(--ink-2); font-size: 1.05rem;
  max-width: 40rem; text-wrap: pretty;
}

.beat-body { margin-top: 3rem; }

/* ---------- key idea / actionable marks ---------- */

.marks {
  margin-top: 3rem; display: flex; flex-wrap: wrap; gap: 1rem;
}
.mark {
  flex: 1 1 20rem; max-width: 30rem;
  border: 1px solid var(--hairline); border-radius: 14px;
  padding: 1rem 1.2rem 1.05rem;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0));
}
.mark-key { border-color: rgba(217, 165, 74, 0.35); background: linear-gradient(180deg, var(--gold-dim), rgba(217,165,74,0.03)); }
.mark-act { border-color: rgba(57, 135, 229, 0.35); background: linear-gradient(180deg, var(--blue-dim), rgba(57,135,229,0.03)); }
.mark-tag {
  display: inline-flex; align-items: center; gap: 0.5em;
  font-family: var(--sans); font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.mark-key .mark-tag { color: var(--gold); }
.mark-act .mark-tag { color: #6fa9ea; }
.mark p { font-size: 1.02rem; line-height: 1.45; color: var(--ink); text-wrap: pretty; }
.mark-tag svg { flex: 0 0 auto; }

/* ---------- small chips & asides ---------- */

.chip {
  display: inline-flex; align-items: baseline; gap: 0.5em;
  font-family: var(--sans); font-size: 0.82rem;
  border: 1px solid var(--hairline); border-radius: 999px;
  padding: 0.34em 0.95em; color: var(--ink-2);
  background: rgba(255,255,255,0.02);
}
.chip b { color: var(--ink); font-weight: 600; }
.chip-row { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.6rem; }

.aside {
  margin-top: 1.8rem; padding-left: 1.1rem;
  border-left: 2px solid var(--hairline);
  color: var(--ink-3); font-size: 0.94rem; max-width: 38rem;
  font-style: italic;
}

.cite { font-family: var(--sans); font-size: 0.72rem; color: var(--ink-3); letter-spacing: 0.03em; }

/* honesty / correction strip */
.honest {
  margin-top: 1.8rem; max-width: 44rem;
  border: 1px solid var(--hairline); border-left: 3px solid var(--gold);
  border-radius: 0 10px 10px 0;
  padding: 0.85rem 1.1rem;
  font-size: 0.95rem; color: var(--ink-2);
  background: rgba(255,255,255,0.02);
}
.honest b { color: var(--ink); }

/* ---------- hero ---------- */

.hero {
  min-height: 100svh; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  background: radial-gradient(1200px 700px at 50% 120%, #131a28 0%, var(--bg-deep) 70%);
}
.stars { position: absolute; inset: 0; pointer-events: none; }
.stars span {
  position: absolute; border-radius: 50%; background: #cfd8e6;
  animation: twinkle 5s ease-in-out infinite;
}
@keyframes twinkle { 0%,100% { opacity: var(--o, 0.5); } 50% { opacity: calc(var(--o, 0.5) * 0.3); } }
@media (prefers-reduced-motion: reduce) { .stars span { animation: none; } }

.hero-inner { position: relative; z-index: 1; padding: 3rem 2rem; max-width: 54rem; }
.hero-kicker {
  font-family: var(--sans); font-size: 0.75rem; letter-spacing: 0.3em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 1.6rem;
}
.hero h1 {
  font-size: clamp(2.6rem, 6.4vw, 4.6rem); font-weight: 500;
  line-height: 1.06; letter-spacing: -0.015em; text-wrap: balance;
}
.hero h1 em { font-style: italic; color: var(--gold); }
.hero-sub { margin-top: 1.5rem; color: var(--ink-2); font-size: 1.12rem; }
.hero-contents {
  margin-top: 3rem; display: inline-flex; flex-direction: column; gap: 0.7rem;
  font-family: var(--sans); font-size: 0.85rem; color: var(--ink-2);
}
.hero-contents span b { color: var(--ink); font-weight: 600; }
.scroll-cue {
  position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
  color: var(--ink-3); font-family: var(--sans); font-size: 0.7rem;
  letter-spacing: 0.22em; text-transform: uppercase;
  display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
}
.scroll-cue::after {
  content: ""; width: 1px; height: 2.6rem;
  background: linear-gradient(180deg, var(--ink-3), transparent);
  animation: cue 2.2s ease-in-out infinite;
}
@keyframes cue { 0% { transform: scaleY(0); transform-origin: top; } 55% { transform: scaleY(1); transform-origin: top; } 56% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }
@media (prefers-reduced-motion: reduce) { .scroll-cue::after { animation: none; } }

/* ---------- act dividers ---------- */

.act {
  min-height: 88svh; display: flex; align-items: center;
  position: relative;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 50%, var(--bg) 100%);
}
.act .wrap { width: 100%; }
.act-label {
  font-family: var(--sans); font-size: 0.78rem; letter-spacing: 0.32em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 1.4rem;
}
.act h2 { font-size: clamp(2.2rem, 5vw, 3.6rem); max-width: 44rem; }
.act-thesis {
  margin-top: 2rem; font-size: 1.25rem; color: var(--ink-2);
  max-width: 40rem; line-height: 1.5; text-wrap: pretty;
}
.act-thesis strong { color: var(--ink); font-weight: 600; }
.act-range { margin-top: 2.6rem; font-family: var(--sans); font-size: 0.75rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-3); }

/* ---------- figures / panels ---------- */

.panel {
  background: var(--elev); border: 1px solid var(--hairline);
  border-radius: 16px; padding: 1.6rem 1.7rem;
}
.panel-title {
  font-family: var(--sans); font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-3);
  margin-bottom: 1.1rem; display: flex; justify-content: space-between; gap: 1rem; align-items: baseline;
}
.panel-title .cite { text-transform: none; letter-spacing: 0.03em; font-weight: 400; }

.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
@media (max-width: 860px) { .duo { grid-template-columns: 1fr; } }

/* ---------- 010 matrix ---------- */

.matrix { font-family: var(--sans); border-collapse: collapse; width: 100%; max-width: 34rem; }
.matrix th, .matrix td {
  border: 1px solid var(--hairline); padding: 0.55em 0.9em;
  text-align: center; font-size: 0.95rem;
}
.matrix th { color: var(--ink-3); font-weight: 500; font-size: 0.78rem; letter-spacing: 0.06em; }
.matrix td:first-child, .matrix th:first-child { text-align: left; }
.matrix td:first-child { font-family: var(--serif); font-style: italic; color: var(--ink); }
.matrix .b1 { color: var(--gold); font-weight: 600; }
.matrix .b0 { color: var(--ink-3); }
.matrix tr.fade-1 { opacity: 0.55; }
.matrix tr.fade-2 { opacity: 0.3; }
.matrix tr.fade-3 { opacity: 0.15; }
.matrix-more { margin-top: 1rem; font-family: var(--sans); font-size: 0.85rem; color: var(--ink-3); font-style: italic; }

/* ---------- 020 sentiment ---------- */

.sent { display: flex; flex-direction: column; gap: 1rem; max-width: 40rem; }
.sent-card {
  border: 1px solid var(--hairline); border-radius: 12px; padding: 1rem 1.2rem;
  display: flex; justify-content: space-between; gap: 1.2rem; align-items: center;
  background: var(--elev);
}
.sent-card q { quotes: "\201C" "\201D"; font-size: 1.05rem; }
.sent-card .kw { color: var(--good-ink); font-weight: 600; }
.sent-score { font-family: var(--sans); font-size: 0.8rem; white-space: nowrap; text-align: right; }
.sent-score b { display: block; font-size: 1.05rem; }
.sent-ok b { color: var(--good-ink); }
.sent-bad b { color: var(--bad-ink); }
.sent-score span { color: var(--ink-3); }

/* ---------- 030 word2vec vs glove ---------- */

.w2v-sentence {
  font-family: var(--sans); font-size: 0.92rem; color: var(--ink-2);
  display: flex; flex-wrap: wrap; gap: 0.35em 0.5em; align-items: center; line-height: 2;
}
.w2v-sentence .win {
  border: 1px solid rgba(57,135,229,0.55); border-radius: 8px;
  padding: 0.1em 0.45em; display: inline-flex; gap: 0.5em;
  background: rgba(57,135,229,0.10);
}
.w2v-sentence .ctr { color: var(--ink); font-weight: 700; background: rgba(57,135,229,0.25); border-radius: 5px; padding: 0 0.3em; }
.mini-flow { margin-top: 1.1rem; font-family: var(--sans); font-size: 0.85rem; color: var(--ink-2); display: flex; align-items: center; flex-wrap: wrap; gap: 0.55em; }
.mini-flow .arr { color: var(--ink-3); }

.cooc { display: grid; grid-template-columns: repeat(6, 1.35rem); gap: 3px; }
.cooc i { width: 1.35rem; height: 1.35rem; border-radius: 3px; background: var(--blue); display: block; }
.glove-eq { display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; }
.glove-eq .eq { font-family: var(--sans); color: var(--ink-3); font-size: 1.3rem; }
.thin-mat { display: grid; gap: 3px; }
.thin-mat i { border-radius: 3px; background: rgba(217,165,74,0.75); display: block; }
.tm-col { grid-template-columns: repeat(2, 0.85rem); grid-auto-rows: 0.85rem; }
.tm-row { grid-template-columns: repeat(6, 0.85rem); grid-auto-rows: 0.85rem; }
.mat-label { font-family: var(--sans); font-size: 0.72rem; color: var(--ink-3); margin-top: 0.5rem; }

.punchline {
  margin-top: 1.4rem; text-align: center; font-size: 1.15rem; color: var(--ink);
  border: 1px solid var(--hairline); border-radius: 12px; padding: 1rem 1.4rem;
  background: linear-gradient(90deg, rgba(57,135,229,0.07), rgba(217,165,74,0.07));
}
.punchline .cite { display: block; margin-top: 0.35rem; }

/* ---------- 040 vector space ---------- */

.vector-fig { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 2rem; align-items: center; }
@media (max-width: 860px) { .vector-fig { grid-template-columns: 1fr; } }
.formula {
  font-size: clamp(1.4rem, 3vw, 2rem); font-style: italic;
  color: var(--ink); line-height: 1.3;
}
.formula b { color: var(--gold); font-weight: 600; }

/* ---------- 050 bank ---------- */

.bank-sent { font-size: 1.18rem; line-height: 1.9; max-width: 42rem; }
.bank {
  font-weight: 700; font-style: normal; border-radius: 6px; padding: 0.04em 0.32em;
  white-space: nowrap;
}
.bank-1 { color: #7db4f0; background: rgba(57,135,229,0.16); }
.bank-2 { color: #58c97e; background: rgba(0,131,0,0.18); }
.bank-3 { color: #eb8fae; background: rgba(213,81,129,0.16); }
.bank-4 { color: #e6b566; background: rgba(201,133,0,0.16); }
.bank-collapse { margin-top: 2rem; display: flex; flex-direction: column; align-items: center; }
.bank-collapse svg { max-width: 100%; height: auto; }
.one-vec {
  margin-top: -0.4rem;
  font-family: var(--sans); font-size: 0.9rem; color: var(--ink-2);
  border: 1px dashed rgba(232,230,223,0.3); border-radius: 10px;
  padding: 0.6em 1.2em; background: rgba(232,230,223,0.05);
}

/* ---------- 060 attention ---------- */

.attn-fig { max-width: 40rem; }
.attn-fig svg { width: 100%; height: auto; display: block; }
.prob-bars { display: flex; flex-direction: column; gap: 0.55rem; max-width: 26rem; margin-top: 1.4rem; font-family: var(--sans); }
.pb-row { display: grid; grid-template-columns: 6.5rem 1fr 3.2rem; align-items: center; gap: 0.8rem; font-size: 0.9rem; }
.pb-row .pb-word { text-align: right; color: var(--ink); }
.pb-track { height: 14px; border-radius: 4px 4px 4px 4px; background: rgba(232,230,223,0.06); overflow: visible; position: relative; }
.pb-fill { position: absolute; inset: 0 auto 0 0; width: var(--w, 50%); border-radius: 0 4px 4px 0; background: var(--blue); transition: width 0.6s cubic-bezier(0.22,0.7,0.3,1); }
.pb-val { color: var(--ink-2); font-variant-numeric: tabular-nums; font-size: 0.82rem; }
.pb-note { font-size: 0.74rem; letter-spacing: 0.02em; margin-left: 0.4em; }
.pb-note.bad { color: var(--bad-ink); }
.pb-note.good { color: var(--good-ink); }

.lineage { display: flex; flex-wrap: wrap; gap: 0; margin-top: 1.6rem; font-family: var(--sans); align-items: stretch; }
.lin-step {
  flex: 1 1 10rem; border: 1px solid var(--hairline); padding: 0.8rem 1rem;
  font-size: 0.82rem; color: var(--ink-2); position: relative; background: var(--elev);
}
.lin-step:first-child { border-radius: 10px 0 0 10px; }
.lin-step:last-child { border-radius: 0 10px 10px 0; }
.lin-step + .lin-step { border-left: none; }
.lin-step b { display: block; color: var(--ink); font-weight: 600; margin-bottom: 0.2rem; font-size: 0.88rem; }
.lin-step .cite { display: block; margin-top: 0.25rem; }

/* ---------- 070 scaling ---------- */

.gpt-row { display: flex; align-items: flex-end; gap: 0; flex-wrap: wrap; row-gap: 2rem; }
.gpt-box {
  border: 1px solid rgba(57,135,229,0.5); border-radius: 12px;
  background: linear-gradient(180deg, rgba(57,135,229,0.16), rgba(57,135,229,0.05));
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: var(--sans);
}
.gpt-box b { font-size: 1.02rem; font-weight: 600; }
.gpt-box span { font-size: 0.75rem; color: var(--ink-2); font-style: italic; margin-top: 0.2rem; }
.gpt-1 { width: 7rem; height: 5rem; }
.gpt-2 { width: 9.5rem; height: 7.4rem; }
.gpt-3 { width: 12.5rem; height: 10.2rem; }
.gpt-arrow {
  align-self: center; font-family: var(--sans); font-size: 0.72rem; color: var(--ink-3);
  display: flex; flex-direction: column; align-items: center; padding: 0 1rem; gap: 0.3rem;
}
.gpt-arrow::after { content: "\2192"; font-size: 1.3rem; color: var(--ink-2); }

/* ---------- 080 post-training stack ---------- */

.stack-fig { max-width: 34rem; display: flex; flex-direction: column; gap: 0.9rem; font-family: var(--sans); }
.layer {
  border-radius: 12px; padding: 1rem 1.3rem; border: 1px solid var(--hairline);
  background: var(--elev);
}
.layer b { display: block; font-size: 0.95rem; }
.layer span { font-size: 0.82rem; color: var(--ink-2); }
.layer-base { border-color: rgba(57,135,229,0.45); background: linear-gradient(180deg, rgba(57,135,229,0.12), rgba(57,135,229,0.03)); }
.layer-post { border-color: rgba(217,165,74,0.45); background: linear-gradient(180deg, rgba(217,165,74,0.10), rgba(217,165,74,0.02)); }
.layer-out { text-align: center; border-style: dashed; }
.stack-plus { text-align: center; color: var(--ink-3); font-size: 1.1rem; margin: -0.3rem 0; }
.recipe { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.7rem; }
.recipe .chip { font-size: 0.75rem; padding: 0.28em 0.8em; }

/* ---------- 090 thesis ---------- */

.thesis { background: var(--bg-deep); }
.bigline {
  font-size: clamp(1.9rem, 4.4vw, 3.1rem); line-height: 1.18; font-weight: 500;
  max-width: 46rem; text-wrap: balance;
}
.bigline em { color: var(--gold); font-style: italic; }
.naked-chip {
  display: inline-flex; align-items: baseline; gap: 0.6em;
  border: 1px solid rgba(217,165,74,0.5); border-radius: 999px;
  padding: 0.45em 1.2em; font-family: var(--sans); font-size: 0.9rem;
  color: var(--gold); background: var(--gold-dim); margin-top: 1.6rem;
}
.naked-chip small { color: var(--ink-3); font-size: 0.75rem; }

/* ---------- 100 temperature ---------- */

.temp-fig { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 2.4rem; align-items: start; }
@media (max-width: 900px) { .temp-fig { grid-template-columns: 1fr; } }
.temp-controls { font-family: var(--sans); margin-top: 1.4rem; max-width: 26rem; }
.temp-controls label { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--ink-2); margin-bottom: 0.5rem; }
.temp-controls output { color: var(--gold); font-variant-numeric: tabular-nums; font-weight: 600; }
input[type="range"] {
  width: 100%; appearance: none; -webkit-appearance: none; height: 4px; border-radius: 2px;
  background: linear-gradient(90deg, #6fa9ea, var(--gold)); outline-offset: 4px;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: var(--ink); border: 3px solid var(--bg); box-shadow: 0 0 0 1px var(--hairline);
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--ink); border: 3px solid var(--bg); cursor: pointer;
}
.temp-ticks { display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--ink-3); margin-top: 0.4rem; }

/* ---------- 110 hinge ---------- */

.hinge { background: linear-gradient(180deg, var(--bg), var(--bg-deep) 60%, var(--bg)); }
.procon { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; margin-top: 2.6rem; max-width: 52rem; }
@media (max-width: 760px) { .procon { grid-template-columns: 1fr; } }
.pc-col { border: 1px solid var(--hairline); border-radius: 14px; padding: 1.3rem 1.5rem; background: var(--elev); }
.pc-col h3 { font-family: var(--sans); font-size: 0.75rem; letter-spacing: 0.18em; text-transform: uppercase; margin-bottom: 0.9rem; font-weight: 600; }
.pc-amazing h3 { color: var(--good-ink); }
.pc-frustrating h3 { color: var(--bad-ink); }
.pc-col ul { list-style: none; }
.pc-col li { padding: 0.35em 0; color: var(--ink-2); font-size: 1rem; }
.pc-col li::before { content: "\2014\00a0"; color: var(--ink-3); }
.todo-chips { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 2.4rem; }
.todo-chip {
  border: 1px solid rgba(230,103,103,0.4); border-radius: 12px;
  padding: 0.8em 1.2em; font-family: var(--sans); font-size: 0.9rem;
  background: rgba(230,103,103,0.07); display: flex; gap: 0.8em; align-items: baseline;
}
.todo-chip b { color: var(--bad-ink); font-variant-numeric: tabular-nums; }
.todo-chip.done { border-color: rgba(76,195,106,0.4); background: rgba(76,195,106,0.07); }
.todo-chip.done b { color: var(--good-ink); }

/* ---------- 120 tokens ---------- */

.token-fig { display: flex; flex-direction: column; gap: 1.6rem; align-items: flex-start; }
.token-split { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; font-size: 1.5rem; }
.token-word { font-style: italic; color: var(--ink); }
.token-split .arr { color: var(--ink-3); font-family: var(--sans); font-size: 1.1rem; }
.tok {
  font-family: var(--sans); font-size: 1.1rem; font-weight: 600;
  border-radius: 9px; padding: 0.22em 0.6em;
}
.tok-a { background: rgba(57,135,229,0.2); color: #8db9ee; border: 1px solid rgba(57,135,229,0.45); }
.tok-b { background: rgba(217,165,74,0.16); color: #e2b96e; border: 1px solid rgba(217,165,74,0.45); }

/* ---------- scrolly machinery ---------- */

.scrolly { display: grid; grid-template-columns: minmax(0, 1fr) var(--step-w); gap: 4rem; align-items: start; }
.scrolly.flip { grid-template-columns: var(--step-w) minmax(0, 1fr); }
.scrolly-figure { position: sticky; top: 0; height: 100svh; display: flex; align-items: center; }
.scrolly.flip .scrolly-figure { order: 2; }
.figure-stage { width: 100%; }
.scrolly-steps { display: flex; flex-direction: column; }
.step { min-height: 85svh; display: flex; align-items: center; }
.step:first-child { min-height: 70svh; }
.step:last-child { min-height: 75svh; }
.step-card {
  border-left: 2px solid var(--hairline); padding: 0.4rem 0 0.4rem 1.4rem;
  color: var(--ink-3); transition: color 0.4s, border-color 0.4s;
  font-size: 1.12rem; line-height: 1.55; text-wrap: pretty;
}
.step.is-active .step-card { color: var(--ink); border-color: var(--gold); }
.step-card b { font-weight: 600; }
.step-card .cite { display: block; margin-top: 0.5rem; }

@media (max-width: 900px) {
  .scrolly, .scrolly.flip { display: block; }
  .scrolly-figure, .scrolly.flip .scrolly-figure {
    position: sticky; top: 0; height: auto; min-height: 46svh; max-height: 56svh;
    background: var(--bg); z-index: 2; border-bottom: 1px solid var(--hairline);
    padding: 1rem 0; order: 0; overflow: hidden;
  }
  .step { min-height: 55svh; }
  .step-card { background: var(--bg); }
}

/* ---------- 130 message stacking figure ---------- */

.convo { font-family: var(--sans); display: flex; flex-direction: column; gap: 1.1rem; }
.convo-top { display: grid; }
.convo-top > * { grid-area: 1 / 1; align-self: end; }
.model-out { display: grid; justify-items: center; }
.model-out > span { grid-area: 1 / 1; }
.scrolly-figure svg { max-height: 92svh; }
@media (max-width: 900px) {
  .scrolly-figure svg { max-height: 46svh; }
  .convo-stack { min-height: 8rem; }
  .convo { font-size: 0.85rem; }
}
.convo-stack {
  min-height: 13.5rem; display: flex; flex-direction: column; justify-content: flex-end;
  gap: 0.45rem;
}
.msg {
  border-radius: 10px; padding: 0.5em 0.95em; font-size: 0.9rem;
  display: flex; gap: 0.8em; align-items: baseline; border: 1px solid var(--hairline);
  max-width: 24rem;
}
.msg b { font-variant-numeric: tabular-nums; font-size: 0.78rem; }
.msg-user { background: rgba(57,135,229,0.13); border-color: rgba(57,135,229,0.4); }
.msg-user b { color: #7db4f0; }
.msg-model { background: rgba(232,230,223,0.05); align-self: flex-end; }
.msg-model b { color: var(--ink-3); }
.convo-arrow { text-align: center; color: var(--ink-3); font-size: 1.15rem; line-height: 1; }
.model-box {
  border: 1px solid rgba(217,165,74,0.5); border-radius: 14px;
  padding: 1rem 1.3rem; text-align: center; background: var(--gold-dim);
  transition: box-shadow 0.6s;
}
.model-box b { display: block; font-size: 0.95rem; color: var(--ink); }
.model-box span { font-size: 0.8rem; color: var(--gold); font-style: italic; }
.model-out {
  align-self: center; margin-top: 0.4rem;
  font-size: 0.9rem; color: var(--ink-2); font-family: var(--sans);
}
.model-out b { color: var(--ink); }

.swamp { display: flex; flex-direction: column; gap: 0.4rem; }
.swamp-old {
  height: 9.5rem; border-radius: 10px; border: 1px solid rgba(57,135,229,0.4);
  background: repeating-linear-gradient(-45deg, rgba(57,135,229,0.16) 0 8px, rgba(57,135,229,0.08) 8px 16px);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.88rem; color: var(--ink-2); text-align: center; padding: 0 1rem;
}
.swamp-new {
  height: 2rem; border-radius: 8px; border: 1px solid rgba(217,165,74,0.55);
  background: var(--gold-dim); display: flex; align-items: center; justify-content: center;
  font-size: 0.82rem; color: var(--gold); font-weight: 600;
}

/* ---------- 140 charts ---------- */

.chart-fig svg { width: 100%; height: auto; display: block; }
.chart-card { background: var(--chart); border: 1px solid var(--hairline); border-radius: 14px; padding: 1.2rem 1.3rem 1rem; }
.chart-card h4 { font-family: var(--sans); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 0.2rem; }
.chart-card .cite { display: block; margin-bottom: 0.8rem; }
.window-scale { display: flex; align-items: center; gap: 1rem; font-family: var(--sans); font-size: 0.85rem; color: var(--ink-2); margin-bottom: 1.6rem; }
.window-scale .rail { flex: 1; height: 1px; background: linear-gradient(90deg, var(--ink-3), var(--gold)); position: relative; }
.window-scale b { color: var(--ink); }

/* ---------- 150 style ---------- */

.style-sources { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
@media (max-width: 860px) { .style-sources { grid-template-columns: 1fr; } }
.src-card { border: 1px solid var(--hairline); border-radius: 12px; padding: 1.1rem 1.2rem; background: var(--elev); font-family: var(--sans); }
.src-card b { display: block; font-size: 0.92rem; margin-bottom: 0.3rem; }
.src-card span { font-size: 0.82rem; color: var(--ink-2); line-height: 1.45; display: block; }
.src-card.overlooked { border-color: rgba(217,165,74,0.5); background: linear-gradient(180deg, var(--gold-dim), transparent); }
.src-card .src-num { font-size: 0.7rem; color: var(--ink-3); letter-spacing: 0.15em; display: block; margin-bottom: 0.5rem; }
.pipeline { display: flex; align-items: center; flex-wrap: wrap; gap: 0.7rem; font-family: var(--sans); font-size: 0.85rem; margin-top: 1.4rem; }
.pipe-step { border: 1px solid var(--hairline); border-radius: 10px; padding: 0.6em 1em; background: var(--elev); color: var(--ink-2); }
.pipe-step b { color: var(--ink); display: block; font-size: 0.8rem; }
.pipeline .arr { color: var(--ink-3); }

.fewshot { display: flex; gap: 0.8rem; align-items: center; flex-wrap: wrap; margin-top: 1.6rem; font-family: var(--sans); }
.doc {
  width: 3.6rem; height: 4.6rem; border: 1px solid var(--hairline); border-radius: 6px;
  background: linear-gradient(180deg, rgba(232,230,223,0.07), rgba(232,230,223,0.02));
  position: relative; flex: 0 0 auto;
}
.doc::before, .doc::after {
  content: ""; position: absolute; left: 0.6rem; right: 0.6rem; height: 2px;
  background: var(--hairline); border-radius: 1px;
}
.doc::before { top: 0.9rem; box-shadow: 0 7px 0 var(--hairline), 0 14px 0 var(--hairline); }
.doc::after { top: 2.9rem; right: 1.6rem; }
.fewshot .arr { color: var(--ink-3); font-size: 1.2rem; }
.fewshot .result { font-size: 0.9rem; color: var(--ink-2); border: 1px solid rgba(217,165,74,0.45); background: var(--gold-dim); border-radius: 10px; padding: 0.7em 1em; }
.fewshot .result b { color: var(--gold); }

/* ---------- 160 grounding ---------- */

.ground-moment { background: var(--bg-deep); text-align: center; }
.ground-moment .bigline { margin: 0 auto; }
.paths { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; max-width: 52rem; margin: 3rem auto 0; text-align: left; }
@media (max-width: 760px) { .paths { grid-template-columns: 1fr; } }
.path-card { border-radius: 14px; padding: 1.3rem 1.4rem; font-family: var(--sans); border: 1px solid var(--hairline); }
.path-bad { background: rgba(230,103,103,0.05); border-color: rgba(230,103,103,0.3); }
.path-good { background: rgba(76,195,106,0.05); border-color: rgba(76,195,106,0.35); }
.path-card h3 { font-size: 0.95rem; display: flex; align-items: center; gap: 0.55em; margin-bottom: 0.7rem; }
.path-bad h3 { color: var(--bad-ink); }
.path-good h3 { color: var(--good-ink); }
.path-card p { font-size: 0.88rem; color: var(--ink-2); line-height: 1.5; }
.path-flow { margin-top: 0.9rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.45em; font-size: 0.8rem; color: var(--ink-2); }
.path-flow .arr { color: var(--ink-3); }
.path-flow .node { border: 1px solid var(--hairline); border-radius: 7px; padding: 0.25em 0.6em; background: rgba(255,255,255,0.03); }

/* ---------- 170 orchestrator figure ---------- */

.orc { font-family: var(--sans); display: grid; grid-template-columns: 1fr; gap: 0.9rem; position: relative; }
.orc-row { display: flex; align-items: center; gap: 0.9rem; justify-content: center; }
.orc-node {
  border: 1px solid var(--hairline); border-radius: 12px; padding: 0.75rem 1.1rem;
  background: var(--elev); text-align: center; transition: border-color 0.5s, background 0.5s, box-shadow 0.5s;
}
.orc-node b { display: block; font-size: 0.9rem; }
.orc-node span { font-size: 0.76rem; color: var(--ink-2); }
.orc-user { background: rgba(57,135,229,0.12); border-color: rgba(57,135,229,0.4); }
.orc-llm { border-color: rgba(217,165,74,0.5); background: var(--gold-dim); }
.orc-tool { border-color: rgba(76,195,106,0.45); background: rgba(76,195,106,0.07); }
.orc-mid { border-color: rgba(213,81,129,0.5); background: rgba(213,81,129,0.08); }
.orc-node.lit { box-shadow: 0 0 0 2px rgba(232,230,223,0.14), 0 0 26px rgba(217,165,74,0.12); }
.orc-wrong { font-size: 0.82rem; color: var(--bad-ink); font-style: italic; }
.orc-flow-svg { width: 100%; height: auto; display: block; }
.orc-payload {
  font-size: 0.78rem; border-radius: 8px; padding: 0.3em 0.8em;
  border: 1px solid var(--hairline); color: var(--ink-2); background: var(--bg);
  position: absolute; white-space: nowrap; transition: opacity 0.5s, transform 0.7s;
}
.orc-roles { display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; }
.role-chip { font-size: 0.78rem; border-radius: 999px; padding: 0.3em 0.9em; font-weight: 600; }
.role-naked { color: var(--gold); background: var(--gold-dim); border: 1px solid rgba(217,165,74,0.4); }
.role-tool { color: var(--good-ink); background: rgba(76,195,106,0.08); border: 1px solid rgba(76,195,106,0.4); }
.role-orc { color: #eb8fae; background: rgba(213,81,129,0.08); border: 1px solid rgba(213,81,129,0.4); }

.flavors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
@media (max-width: 860px) { .flavors { grid-template-columns: 1fr; } }
.flavor { border: 1px solid var(--hairline); border-radius: 12px; padding: 1rem 1.1rem; font-family: var(--sans); background: var(--elev); }
.flavor b { font-size: 0.88rem; display: block; margin-bottom: 0.25rem; }
.flavor span { font-size: 0.8rem; color: var(--ink-2); line-height: 1.45; }

/* ---------- 180 rag ---------- */

.rag-flow {
  display: flex; align-items: stretch; gap: 0.6rem; flex-wrap: wrap; font-family: var(--sans);
}
.rag-node {
  flex: 1 1 8rem; border: 1px solid var(--hairline); border-radius: 12px;
  padding: 0.85rem 0.95rem; background: var(--elev); min-width: 8.5rem;
}
.rag-node b { display: block; font-size: 0.85rem; margin-bottom: 0.2rem; }
.rag-node span { font-size: 0.76rem; color: var(--ink-2); line-height: 1.4; display: block; }
.rag-arr { align-self: center; color: var(--ink-3); font-size: 1.1rem; flex: 0 0 auto; }
.rag-node.hot { border-color: rgba(217,165,74,0.5); background: linear-gradient(180deg, var(--gold-dim), transparent); }

/* ---------- 190 strawberry ---------- */

.straw { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
@media (max-width: 860px) { .straw { grid-template-columns: 1fr; } }
.straw-card { border-radius: 14px; border: 1px solid var(--hairline); padding: 1.3rem 1.4rem; font-family: var(--sans); }
.straw-bad { border-color: rgba(230,103,103,0.35); background: rgba(230,103,103,0.05); }
.straw-good { border-color: rgba(76,195,106,0.35); background: rgba(76,195,106,0.05); }
.straw-card h3 { font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 0.9rem; font-weight: 600; }
.straw-bad h3 { color: var(--bad-ink); }
.straw-good h3 { color: var(--good-ink); }
.straw-q { font-family: var(--serif); font-style: italic; font-size: 1.05rem; color: var(--ink); margin-bottom: 0.8rem; }
.straw-a { font-size: 1.4rem; font-weight: 600; }
.straw-bad .straw-a { color: var(--bad-ink); }
.straw-good .straw-a { color: var(--good-ink); }
.straw-note { font-size: 0.82rem; color: var(--ink-2); margin-top: 0.5rem; line-height: 1.5; }
.code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.82rem;
  background: var(--bg-deep); border: 1px solid var(--hairline); border-radius: 8px;
  padding: 0.7rem 0.9rem; color: var(--ink-2); margin: 0.7rem 0; overflow-x: auto;
}
.code b { color: #8db9ee; font-weight: 500; }
.vocab-compare { display: flex; gap: 2.5rem; flex-wrap: wrap; margin-top: 1.8rem; font-family: var(--sans); }
.vocab { display: flex; flex-direction: column; gap: 0.3rem; }
.vocab b { font-size: 1.7rem; font-weight: 600; }
.vocab span { font-size: 0.8rem; color: var(--ink-2); }

/* ---------- 200 model shopping ---------- */

.mem-chart { max-width: 40rem; }
.mem-chart svg { width: 100%; height: auto; display: block; }
.bus-fig { display: flex; align-items: center; gap: 0; font-family: var(--sans); margin-top: 0.4rem; flex-wrap: wrap; row-gap: 1rem; }
.bus-node { border: 1px solid var(--hairline); border-radius: 12px; padding: 0.9rem 1.2rem; background: var(--elev); text-align: center; }
.bus-node b { display: block; font-size: 0.9rem; }
.bus-node span { font-size: 0.76rem; color: var(--ink-2); }
.bus-pipe { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; padding: 0 0.9rem; font-size: 0.7rem; color: var(--ink-3); }
.pipe-wide { width: 5.5rem; height: 14px; border-radius: 7px; background: rgba(76,195,106,0.35); border: 1px solid rgba(76,195,106,0.5); }
.pipe-thin { width: 5.5rem; height: 4px; border-radius: 2px; background: rgba(230,103,103,0.5); border: 1px solid rgba(230,103,103,0.5); }
.quant-strip { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.4rem; font-family: var(--sans); font-size: 0.8rem; align-items: center; color: var(--ink-3); }
.quant-strip .q { border: 1px solid var(--hairline); border-radius: 7px; padding: 0.28em 0.7em; color: var(--ink-2); background: var(--elev); }
.quant-strip .q.sweet { border-color: rgba(217,165,74,0.55); color: var(--gold); background: var(--gold-dim); }

/* ---------- 210 scaling ends ---------- */

.quote {
  border-left: 3px solid var(--gold); padding: 0.4rem 0 0.4rem 1.4rem;
  max-width: 40rem; margin-top: 2rem;
}
.quote p { font-size: 1.3rem; font-style: italic; line-height: 1.45; }
.quote .cite { display: block; margin-top: 0.6rem; }
.data-levers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1.6rem; max-width: 44rem; }
@media (max-width: 760px) { .data-levers { grid-template-columns: 1fr; } }
.lever { border: 1px solid var(--hairline); border-radius: 12px; padding: 0.95rem 1.05rem; font-family: var(--sans); background: var(--elev); }
.lever b { display: block; font-size: 0.86rem; margin-bottom: 0.2rem; }
.lever span { font-size: 0.78rem; color: var(--ink-2); line-height: 1.4; }

/* ---------- 220 chain of thought ---------- */

.puzzle {
  border: 1px solid var(--hairline); border-radius: 14px; padding: 1.2rem 1.4rem;
  background: var(--elev); max-width: 40rem; font-size: 1.05rem; font-style: italic;
  color: var(--ink);
}
.thinking { max-width: 40rem; margin-top: 1.4rem; font-family: var(--sans); }
.thinking-head {
  display: flex; align-items: center; gap: 0.6em; font-size: 0.78rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 0.8rem;
}
.thinking-head .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .thinking-head .dot { animation: none; } }
.think-line {
  font-size: 0.92rem; color: var(--ink-3); font-style: italic; padding: 0.28em 0;
  border-left: 2px solid var(--hairline); padding-left: 1rem; margin-left: 0.2rem;
}
.answer-line {
  margin-top: 0.9rem; font-family: var(--serif); font-size: 1.15rem; color: var(--ink);
  border-left: 2px solid var(--gold); padding-left: 1rem; margin-left: 0.2rem;
}
.answer-line b { color: var(--gold); }
.cot-cost { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.8rem; }

/* knob */
.knob { display: flex; align-items: center; gap: 1rem; font-family: var(--sans); font-size: 0.8rem; color: var(--ink-2); margin-top: 1.8rem; max-width: 26rem; }
.knob .rail { flex: 1; height: 4px; border-radius: 2px; background: linear-gradient(90deg, rgba(57,135,229,0.5), var(--gold)); position: relative; }
.knob .rail i { position: absolute; top: 50%; left: 70%; width: 14px; height: 14px; border-radius: 50%; background: var(--ink); transform: translate(-50%, -50%); box-shadow: 0 0 0 3px var(--bg), 0 0 0 4px var(--hairline); }

/* ---------- closing ---------- */

.closing { background: linear-gradient(180deg, var(--bg), var(--bg-deep)); padding-bottom: 4rem; }
.factsheet { margin-top: 3rem; display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
@media (max-width: 860px) { .factsheet { grid-template-columns: 1fr; } }
.fact {
  border: 1px solid var(--hairline); border-radius: 10px; padding: 0.7rem 0.95rem;
  font-size: 0.88rem; line-height: 1.4; color: var(--ink-2);
  display: flex; gap: 0.7em; align-items: baseline;
}
.fact b { font-family: var(--sans); font-size: 0.68rem; letter-spacing: 0.1em; color: var(--ink-3); font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.fact.f-key { border-left: 3px solid var(--gold); }
.fact.f-act { border-left: 3px solid var(--blue); }
.fact-legend { display: flex; gap: 1.6rem; margin-top: 1.4rem; font-family: var(--sans); font-size: 0.75rem; color: var(--ink-3); }
.fact-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 0.5em; vertical-align: baseline; }
.fact-legend .lk i { background: var(--gold); }
.fact-legend .la i { background: var(--blue); }

footer {
  border-top: 1px solid var(--hairline); padding: 2.5rem 0 3.5rem;
  font-family: var(--sans); font-size: 0.8rem; color: var(--ink-3);
  background: var(--bg-deep);
}
footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }

/* misc */
@media (max-width: 700px) {
  .wrap { padding: 0 1.25rem; }
  section.beat { padding: 6rem 0 5rem; }
  .hud { display: none; }
}
