/*
 * mastery-tutor home. Editorial and soft: a serif that reads like a good textbook, chapters as
 * tinted rounded slabs, and motion that settles on a spring or follows the reader's scroll.
 * Mono type is for literal commands only.
 */
:root {
  /* Ink & Ember: warm paper and near-black ink, one ember accent, green for right, amber for unsure,
     blue for what you already hold. Chapters alternate a warm stone and a cool mist. */
  --bg: #f7f5f1; --surface: #ffffff; --surface-2: #f1eee8;
  --ink: #15171c; --muted: #50545e; --faint: #62666f;
  --line: rgba(21, 23, 28, 0.1); --line-2: rgba(21, 23, 28, 0.2);
  --accent: #b5391f; --accent-soft: #fae6df; --on-color: #ffffff;
  --green: #18794e; --green-soft: #dcefe4;
  --amber: #8f5b00; --amber-soft: #f6ebd1;
  --blue: #2f558f; --blue-soft: #e3eaf4;
  --gold: #e9a93a;
  --tint-warm: #f0ece4; --tint-cool: #eaedf0;
  --slab: #15171c; --on-slab: #f1efea; --on-slab-muted: #a9acb4; --accent-on-slab: #f38b6e;
  --shadow: 0 0 0 1px rgba(21, 23, 28, 0.06), 0 1px 2px rgba(21, 23, 28, 0.05), 0 12px 32px -12px rgba(21, 23, 28, 0.14), 0 40px 80px -48px rgba(21, 23, 28, 0.2);
  --shadow-sm: 0 0 0 1px rgba(21, 23, 28, 0.06), 0 1px 2px rgba(21, 23, 28, 0.05), 0 4px 12px -6px rgba(21, 23, 28, 0.12);
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Geist", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.2, 0.8, 0.2, 1);
  --gutter: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0f12; --surface: #16181c; --surface-2: #1e2126;
    --ink: #eceae5; --muted: #a9acb4; --faint: #8e929b;
    --line: rgba(236, 234, 229, 0.1); --line-2: rgba(236, 234, 229, 0.2);
    --accent: #f07a5b; --accent-soft: #3a1d15; --on-color: #0e0f12;
    --green: #52c18e; --green-soft: #12291d;
    --amber: #e2b04f; --amber-soft: #2d2310;
    --blue: #8db0e8; --blue-soft: #18233a;
    --gold: #e9b04a;
    --tint-warm: #151412; --tint-cool: #111418;
    --slab: #1c1f24; --on-slab: #f1efea; --on-slab-muted: #a9acb4; --accent-on-slab: #f38b6e;
    --shadow: 0 0 0 1px rgba(255, 255, 255, 0.05), 0 1px 2px rgba(0, 0, 0, 0.4), 0 14px 34px -10px rgba(0, 0, 0, 0.5), 0 44px 90px -40px rgba(0, 0, 0, 0.6);
    --shadow-sm: 0 0 0 1px rgba(255, 255, 255, 0.05), 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 16px -6px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e0f12; --surface: #16181c; --surface-2: #1e2126;
  --ink: #eceae5; --muted: #a9acb4; --faint: #8e929b;
  --line: rgba(236, 234, 229, 0.1); --line-2: rgba(236, 234, 229, 0.2);
  --accent: #f07a5b; --accent-soft: #3a1d15; --on-color: #0e0f12;
  --green: #52c18e; --green-soft: #12291d;
  --amber: #e2b04f; --amber-soft: #2d2310;
  --blue: #8db0e8; --blue-soft: #18233a;
  --gold: #e9b04a;
  --tint-warm: #151412; --tint-cool: #111418;
  --slab: #1c1f24; --on-slab: #f1efea; --on-slab-muted: #a9acb4; --accent-on-slab: #f38b6e;
  --shadow: 0 0 0 1px rgba(255, 255, 255, 0.05), 0 1px 2px rgba(0, 0, 0, 0.4), 0 14px 34px -10px rgba(0, 0, 0, 0.5), 0 44px 90px -40px rgba(0, 0, 0, 0.6);
  --shadow-sm: 0 0 0 1px rgba(255, 255, 255, 0.05), 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 16px -6px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; overflow-x: clip; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 17px/1.6 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: clip;
}
a { color: inherit; }
img, svg, iframe { max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
code { font-family: var(--mono); font-size: 0.86em; }
/* Phosphor icons, inlined as a sprite and drawn with currentColor */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 1.1em; height: 1.1em; fill: currentColor; flex: none; vertical-align: -0.15em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 50; background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 10px; }
.skip:focus { top: 12px; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; text-wrap: balance; font-variation-settings: "SOFT" 0, "opsz" 144; }
h1 em, h2 em { font-style: italic; font-weight: 380; color: var(--accent); position: relative; white-space: nowrap; }
h2 em::after {
  display: none; content: ""; position: absolute; left: 0; right: 0; bottom: -0.08em; height: 0.2em; background: currentColor; opacity: 0.55;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'%3E%3Cpath d='M2 8c30-6 60-6 98-2s70 4 98-3' fill='none' stroke='black' stroke-width='3.2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 0 0 / 100% 100%;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'%3E%3Cpath d='M2 8c30-6 60-6 98-2s70 4 98-3' fill='none' stroke='black' stroke-width='3.2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 0 0 / 100% 100%;
  clip-path: inset(0 100% 0 0); transition: clip-path 1.1s var(--ease) 0.2s;
}
.seen h2 em::after, h2 em.seen::after { clip-path: inset(0 0 0 0); }

/* ---------- header ---------- */
.nav { position: fixed; inset: 0 0 auto; z-index: 20; padding: calc(12px + env(safe-area-inset-top, 0px)) var(--gutter-r) 0 var(--gutter); pointer-events: none; }
.nav-in {
  pointer-events: auto; max-width: 1120px; margin: 0 auto; display: flex; align-items: center; gap: 20px;
  padding: 8px 8px 8px 18px; border-radius: 14px; background: color-mix(in srgb, var(--surface) 78%, transparent);
  backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: var(--shadow-sm); border: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; text-decoration: none; letter-spacing: -0.01em; }
.brand svg { width: 28px; height: 28px; }
.b-bg { fill: var(--ink); }
.b-ring { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 64 36; transform: rotate(-90deg); transform-origin: 16px 16px; animation: ring 9s linear infinite; }
.b-dot { fill: var(--gold); }
@keyframes ring { to { transform: rotate(270deg); } }
.links { display: flex; gap: 4px; margin-left: 8px; }
.links a { text-decoration: none; color: var(--muted); font-size: 15px; padding: 6px 12px; border-radius: 8px; transition: background 0.2s, color 0.2s; }
.links a:hover { color: var(--ink); background: var(--surface-2); }
.tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; transition: background 0.2s; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn .ic { width: 20px; height: 20px; }
.i-play { display: none; }
:root[data-paused] .i-play { display: block; }
:root[data-paused] .i-pause { display: none; }
.i-moon { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .i-moon { display: block; } :root:not([data-theme="light"]) .i-sun { display: none; } }
:root[data-theme="dark"] .i-moon { display: block; }
:root[data-theme="dark"] .i-sun { display: none; }
.gh { text-decoration: none; font-weight: 600; font-size: 15px; padding: 9px 16px; border-radius: 8px; background: var(--ink); color: var(--bg); }

/* ---------- buttons, commands ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 52px; padding: 0 26px;
  border-radius: 8px; border: 0; font-weight: 600; text-decoration: none; font-size: 16px;
  transition: transform 0.5s var(--spring), box-shadow 0.3s, background 0.2s, opacity 0.2s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(1px) scale(0.98); }
.btn.solid { background: var(--ink); color: var(--bg); box-shadow: var(--shadow-sm); }
.btn.accent { background: var(--accent); color: var(--on-color); }
.btn.ghost { background: transparent; color: var(--on-slab); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.25); }
.btn.sm { height: 44px; padding: 0 20px; font-size: 15px; }
.btn:disabled { opacity: 0.35; cursor: default; transform: none; }
.cmd {
  display: inline-flex; align-items: center; gap: 4px; min-width: 0; max-width: 100%;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px 6px 6px 20px; box-shadow: var(--shadow-sm);
}
.cmd code { white-space: nowrap; overflow-x: auto; scrollbar-width: none; min-width: 0; color: var(--ink); }
.copy { border: 0; background: var(--surface-2); border-radius: 8px; padding: 8px 14px; font-size: 13px; font-weight: 600; flex: none; transition: background 0.2s; }
.copy:hover { background: var(--line-2); }
.copy.done { background: var(--green-soft); color: var(--green); }

/* icon placement */
.gh, .copy, .b-open, .chip, .ptc-l, .col h3, .steps li > span, .subj-tabs button { display: inline-flex; align-items: center; gap: 7px; }
.gh .ic { width: 18px; height: 18px; }
.copy .ic { width: 15px; height: 15px; }
.b-open .ic { width: 15px; height: 15px; }
.chip .ic, .ptc-l .ic { width: 15px; height: 15px; }
.subj-tabs .ic { width: 17px; height: 17px; opacity: 0.7; }
.subj-tabs button[aria-selected="true"] .ic { opacity: 1; }
.col h3 { gap: 9px; }
.col h3 .ic { width: 22px; height: 22px; }
.col.good h3 .ic { color: var(--green); }
.col.new h3 .ic { color: var(--accent); }
.col.yet h3 .ic { color: var(--faint); }
.steps li > span .ic { width: 15px; height: 15px; color: var(--accent-on-slab); }
.btn .ic { width: 18px; height: 18px; }
.btn.accent .ic { transition: transform 0.35s var(--spring); }
.btn.accent:hover .ic { transform: translateX(3px); }
.link { background: none; border: 0; padding: 0; font-weight: 600; color: var(--accent); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1.5px; }

/* ---------- layout ---------- */
main { padding: 0 var(--gutter-r) 16px var(--gutter); }
.chapter {
  max-width: 1360px; margin: 16px auto 0; border-radius: clamp(14px, 1.8vw, 22px); background: var(--tint, var(--surface)); box-shadow: inset 0 0 0 1px var(--line);
  padding-block: clamp(64px, 9vw, 128px); padding-inline: clamp(20px, 5.5vw, 80px);
}
.tint-warm { --tint: var(--tint-warm); }
.tint-cool { --tint: var(--tint-cool); }
.tint-plain { --tint: transparent; box-shadow: none; padding-block: clamp(56px, 7vw, 96px); }
.ch-head { max-width: 640px; display: grid; gap: 18px; }
.ch-head.center { margin: 0 auto; text-align: center; justify-items: center; }
.ch-head h2 { font-size: clamp(38px, 5.4vw, 68px); line-height: 1.02; letter-spacing: -0.03em; }
.ch-head p { margin: 0; color: var(--muted); font-size: 18px; }
.ch-num { font-size: 14px !important; font-weight: 600; letter-spacing: 0.04em; color: var(--ink) !important; display: flex; align-items: center; gap: 10px; }
.ch-num::before { content: ""; width: 22px; height: 2px; background: var(--accent); border-radius: 2px; }
.ch-num:has(.ic)::before { display: none; }
.ch-num .ic { width: 18px; height: 18px; color: var(--accent); }
.fine { font-size: 15px !important; }
.card { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); }
.split { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 88px); align-items: center; }
.split.rev { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); }

/* reveal on view */
[data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity 0.9s var(--ease), transform 1.1s var(--ease); }
[data-reveal].seen { opacity: 1; transform: none; }

/* ---------- hero ---------- */
.hero { max-width: 1120px; margin: 0 auto; padding: calc(150px + env(safe-area-inset-top, 0px)) 0 40px; text-align: center; display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 26px; }
.eyebrow { margin: 0; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 15px; flex-wrap: wrap; justify-content: center; }
.pill { background: var(--accent-soft); color: var(--accent); font-weight: 650; padding: 3px 10px; border-radius: 8px; font-size: 13px; }
.hero h1 { font-size: clamp(46px, 8vw, 112px); line-height: 0.98; letter-spacing: -0.04em; font-weight: 400; }
.hero h1 em { display: inline-block; }
.hero h1 em::after {
  display: none; content: ""; position: absolute; left: -2%; right: -2%; bottom: 0.02em; height: 0.16em; background: currentColor; opacity: 0.5;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'%3E%3Cpath d='M2 8c30-6 60-6 98-2s70 4 98-3' fill='none' stroke='black' stroke-width='3.2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 0 0 / 100% 100%;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'%3E%3Cpath d='M2 8c30-6 60-6 98-2s70 4 98-3' fill='none' stroke='black' stroke-width='3.2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 0 0 / 100% 100%;
  clip-path: inset(0 100% 0 0); animation: draw-under 1.2s var(--ease) 0.6s forwards;
}
@keyframes draw-under { to { clip-path: inset(0 0 0 0); } }
.hero .lede { margin: 0; max-width: 620px; font-size: clamp(18px, 1.6vw, 20px); color: var(--muted); }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; align-items: center; max-width: 100%; }
.cta-row.left { justify-content: flex-start; }
.works { margin: -8px 0 0; color: var(--faint); font-size: 14px; }
.hero > * { animation: rise 1s var(--ease) backwards; }
.hero > :nth-child(2) { animation-delay: 0.08s; } .hero > :nth-child(3) { animation-delay: 0.16s; }
.hero > :nth-child(4) { animation-delay: 0.24s; } .hero > :nth-child(5) { animation-delay: 0.3s; } .hero > :nth-child(6) { animation-delay: 0.4s; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } }

/* the question card */
.q-wrap { position: relative; width: 100%; max-width: 760px; margin-top: 36px; text-align: left; }
.halo { position: absolute; inset: -12% -18%; z-index: -1; filter: blur(70px); opacity: 0.35; pointer-events: none; }
.halo::before, .halo::after { content: ""; position: absolute; border-radius: 50%; animation: drift 18s ease-in-out infinite alternate; }
.halo::before { width: 55%; height: 70%; left: 0; top: 10%; background: var(--accent-soft); }
.halo::after { width: 55%; height: 70%; right: 0; top: 20%; background: var(--blue-soft); animation-delay: -9s; }
@keyframes drift { to { transform: translate(8%, -10%) scale(1.12); } }
.q { background: var(--surface); border-radius: 10px; box-shadow: var(--shadow); padding: clamp(22px, 4vw, 40px); display: grid; gap: 20px; border: 1px solid var(--line); }
.q-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.q-tag { font-size: 13px; font-weight: 650; background: var(--surface-2); padding: 5px 12px; border-radius: 8px; }
.q-auto { font-size: 13px; color: var(--faint); transition: opacity 0.4s; }
.q[data-user] .q-auto { opacity: 0; }
.q-ask { margin: 0; color: var(--muted); }
.q-sentence { margin: 0; font-family: var(--serif); font-size: clamp(30px, 4.2vw, 44px); line-height: 1.2; letter-spacing: -0.02em; font-variation-settings: "SOFT" 0, "opsz" 72; }
.gap { display: inline-grid; min-width: 4.4ch; height: 1.15em; overflow: hidden; vertical-align: -0.18em; border-bottom: 2.5px solid var(--line-2); text-align: center; transition: border-color 0.3s, color 0.3s; }
.gap > span { grid-area: 1 / 1; font-style: italic; animation: word-in 0.55s var(--spring); }
.gap > span.out { animation: word-out 0.3s var(--ease) forwards; }
@keyframes word-in { from { transform: translateY(100%); opacity: 0; } }
@keyframes word-out { to { transform: translateY(-100%); opacity: 0; } }
.gap.right { color: var(--green); border-color: var(--green); }
.gap.wrong { color: var(--accent); border-color: var(--accent); }
.gap.wrong > span { text-decoration: line-through; text-decoration-thickness: 2px; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opt {
  text-align: left; display: grid; gap: 0; padding: 14px 18px; border-radius: 10px; background: var(--surface);
  border: 1.5px solid var(--line); grid-template-rows: auto 0fr;
  transition: border-color 0.25s, background 0.25s, transform 0.5s var(--spring), grid-template-rows 0.6s var(--ease), gap 0.6s var(--ease);
}
.opt:hover:not(:disabled) { border-color: var(--line-2); transform: translateY(-2px); }
.opt b { font-weight: 600; font-size: 18px; display: flex; align-items: center; gap: 10px; }
.letter { font: 600 12px var(--sans); width: 22px; height: 22px; border-radius: 5px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.opt[aria-checked="true"] .letter { background: var(--ink); color: var(--bg); }
.opt small { overflow: hidden; color: var(--muted); font-size: 14px; line-height: 1.45; min-height: 0; }
.opt[aria-checked="true"] { border-color: var(--ink); background: var(--surface-2); }
.q[data-locked] .opt { grid-template-rows: auto 1fr; gap: 4px; cursor: default; }
.opt.is-right { border-color: var(--green); background: var(--green-soft); }
.opt.is-wrong { border-color: var(--accent); background: var(--accent-soft); }
.q[data-locked] .opt:not(.is-right):not(.is-wrong) { opacity: 0.7; }
.conf { display: grid; gap: 10px; }
.conf-label { margin: 0; font-size: 15px; color: var(--muted); }
.conf-track { --k: 0; position: relative; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface-2); border-radius: 8px; padding: 4px; }
.conf-track button { position: relative; z-index: 1; border: 0; background: none; height: 42px; border-radius: 8px; font-size: 15px; font-weight: 500; color: var(--muted); transition: color 0.3s; }
.conf-track button[aria-checked="true"] { color: var(--bg); font-weight: 600; }
.conf-knob {
  position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / 4); border-radius: 8px; background: var(--ink);
  transform: translateX(calc(var(--k) * 100%)) scale(0.6); opacity: 0; transition: transform 0.7s var(--spring), opacity 0.25s;
}
.conf-track[data-set] .conf-knob { opacity: 1; transform: translateX(calc(var(--k) * 100%)); }
.q[data-locked] .conf-track button { cursor: default; }
.q-foot { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.q-hint { color: var(--faint); font-size: 14px; }
.verdict { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.7s var(--ease); }
.verdict-in { overflow: hidden; min-height: 0; display: grid; gap: 10px; align-content: start; }
.q[data-locked] .verdict { grid-template-rows: 1fr; }
.q[data-locked] .verdict-in { padding-top: 6px; }
.v-badge { margin: 0; justify-self: start; font-weight: 650; font-size: 14px; padding: 6px 14px; border-radius: 8px; background: var(--green-soft); color: var(--green); }
.v-badge.bad { background: var(--accent-soft); color: var(--accent); }
.q[data-locked] .v-badge { animation: badge 0.7s var(--spring) 0.15s backwards; }
@keyframes badge { from { transform: scale(0.5); opacity: 0; } }
#q-why, .v-log { margin: 0; }
.v-log { font-size: 14px; color: var(--muted); padding-left: 14px; border-left: 2px solid var(--line-2); }
#q-again { justify-self: start; }

/* ---------- scrolly ---------- */
.scrolly { position: relative; height: calc(var(--n) * 70svh + 100svh); margin-top: 24px; }
.stage { position: sticky; top: 0; height: 100svh; display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(28px, 5vw, 72px); align-items: center; padding-top: 72px; }
.captions { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; counter-reset: cap; }
.captions li { counter-increment: cap; padding: 14px 0 14px 52px; position: relative; opacity: 0.55; transition: opacity 0.5s var(--ease); }
.captions li::before {
  content: counter(cap); position: absolute; left: 0; top: 14px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  font: 600 14px var(--sans); background: var(--surface); box-shadow: var(--shadow-sm); transition: background 0.4s, color 0.4s, transform 0.6s var(--spring);
}
.captions li.is-past::before { background: var(--ink); color: var(--bg); }
.captions li.is-cur { opacity: 1; }
.captions li.is-cur::before { background: var(--accent); color: var(--on-color); transform: scale(1.12); }
.captions h3 { font-size: 26px; letter-spacing: -0.02em; line-height: 1.2; padding-top: 2px; }
.captions p { margin: 6px 0 0; color: var(--muted); display: grid; }
.captions li:not(.is-cur) p { display: none; }

/* loop figure */
.loop-fig { margin: 0; background: var(--surface); border-radius: 10px; box-shadow: var(--shadow); padding: clamp(18px, 3vw, 32px); display: grid; gap: 24px; min-height: min(560px, 70svh); grid-template-rows: auto 1fr; }
.track { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); position: relative; }
.track::before, .track::after { content: ""; position: absolute; left: calc(100% / 12); right: calc(100% / 12); top: 7px; height: 2px; border-radius: 2px; background: var(--line); }
.track::after { background: var(--accent); transform-origin: left; transform: scaleX(var(--tp, 0)); transition: transform 0.7s var(--ease); }
.track li { display: grid; justify-items: center; gap: 8px; font-size: 13px; color: var(--faint); font-weight: 500; position: relative; z-index: 1; transition: color 0.3s; }
.track li::before { content: ""; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 2px var(--line-2); transition: box-shadow 0.3s, background 0.3s, transform 0.6s var(--spring); }
.track li.is-past::before { background: var(--accent); box-shadow: none; }
.track li.is-cur { color: var(--ink); font-weight: 650; }
.track li.is-cur::before { background: var(--surface); box-shadow: inset 0 0 0 4px var(--accent); transform: scale(1.3); }
.vigs { display: grid; place-items: center; }
.vig { grid-area: 1 / 1; width: 100%; max-width: 440px; display: grid; gap: 12px; opacity: 0; transform: translateY(30px) scale(0.97); transition: opacity 0.45s var(--ease), transform 0.8s var(--ease); pointer-events: none; }
.vig.is-cur { opacity: 1; transform: none; transition-delay: 0.12s; }
.vig.is-past { transform: translateY(-30px) scale(0.97); }
.v-kicker { margin: 0; font-size: 13px; font-weight: 650; letter-spacing: 0.04em; color: var(--faint); text-transform: uppercase; }
.v-note { margin: 4px 0 0; font-size: 14px; color: var(--muted); text-align: center; }
/* inner beats run when a vignette becomes current */
.vig > *, .vig .closes > * { transition: opacity 0.6s var(--ease), transform 0.8s var(--spring); }
.vig:not(.is-cur) > :not(.v-kicker), .vig:not(.is-cur) .closes > * { opacity: 0; transform: translateY(16px); }
.vig.is-cur > :nth-child(2) { transition-delay: 0.25s; } .vig.is-cur > :nth-child(3) { transition-delay: 0.45s; }
.vig.is-cur > :nth-child(4) { transition-delay: 0.65s; } .vig.is-cur > :nth-child(5) { transition-delay: 0.9s; }
.due { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 10px; background: var(--surface-2); font-size: 15px; }
.due-mod { font-weight: 650; font-size: 13px; background: var(--surface); padding: 3px 9px; border-radius: 8px; }
.due-chk { margin-left: auto; width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--line-2); transition: background 0.4s 1.2s, box-shadow 0.4s 1.2s; }
.vig.is-cur .due-chk { background: var(--green); box-shadow: none; }
.vig.is-cur .due:nth-of-type(3) .due-chk { transition-delay: 1.6s; }
.due-when { margin-left: auto; font-size: 13px; color: var(--muted); }
.due.later { background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); color: var(--muted); }
.due.later .due-mod { background: var(--surface-2); }
.mail { background: var(--surface-2); border-radius: 10px; padding: 18px 20px; font-family: var(--serif); font-size: 21px; line-height: 1.45; font-variation-settings: "SOFT" 0, "opsz" 24; }
.mail p { margin: 0; }
.mail-to { font: 500 13px var(--sans) !important; color: var(--faint); margin-bottom: 8px !important; }
.spot { position: relative; padding: 0 2px; }
.spot::before { content: ""; position: absolute; inset: -4px -8px; border: 2.5px solid var(--accent); border-radius: 50%; transform: rotate(-4deg) scale(0.4); opacity: 0; transition: transform 0.7s var(--spring) 0.6s, opacity 0.3s 0.6s; }
.vig.is-cur .spot::before { transform: rotate(-4deg); opacity: 1; }
.spot-note { margin: 0; color: var(--accent); font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 10px; }
.arrow { width: 26px; height: 2px; background: currentColor; position: relative; }
.arrow::after { content: ""; position: absolute; left: -1px; top: -4px; width: 9px; height: 9px; border-left: 2px solid; border-top: 2px solid; transform: rotate(-45deg); }
.probe { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-radius: 10px; background: var(--surface-2); font-size: 15px; }
.mk { width: 24px; height: 24px; border-radius: 50%; flex: none; display: grid; place-items: center; color: var(--on-color); font-size: 14px; font-weight: 700; transform: scale(0); transition: transform 0.6s var(--spring) 0.9s; }
.vig.is-cur .mk { transform: none; }
.probe.ok .mk { background: var(--green); } .probe.ok .mk::after { content: "✓"; }
.probe.no .mk { background: var(--accent); } .probe.no .mk::after { content: "×"; }
.probe.no { box-shadow: inset 0 0 0 1.5px var(--accent); }
.edge { margin: 2px 0 0; justify-self: center; font-weight: 650; font-size: 14px; color: var(--accent); background: var(--accent-soft); padding: 6px 14px; border-radius: 8px; }
.vig.is-cur .edge { transition-delay: 1.4s; }
.mini-map { width: 100%; height: auto; }
.mini-map path { fill: none; stroke: var(--line-2); stroke-width: 2; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 0.9s var(--ease) 0.5s; }
.vig.is-cur .mini-map path { stroke-dashoffset: 0; }
.mini-map rect { fill: var(--surface-2); stroke: var(--line-2); stroke-width: 1.5; }
.mini-map rect.held { fill: var(--blue-soft); stroke: none; }
.mini-map .goal { fill: var(--accent); }
.ring { position: relative; width: min(300px, 80%); aspect-ratio: 1; margin: 0 auto; max-width: 100%; }
.ring svg { width: 100%; height: 100%; }
.ring-bg { fill: none; stroke: var(--surface-2); stroke-width: 14; }
.ring-run { fill: none; stroke: var(--accent); stroke-width: 14; stroke-linecap: round; stroke-dasharray: 22 78; stroke-dashoffset: 11; transform: rotate(-90deg); transform-origin: 110px 110px; opacity: 0.85; }
.vig.is-cur .ring-run { animation: ring-run 7.5s var(--ease) infinite; }
/* the arc rests on each stage, then moves on; each label lights while the arc rests on it */
@keyframes ring-run { 0%, 25% { stroke-dashoffset: 11; } 33.3%, 58.3% { stroke-dashoffset: -22.33; } 66.7%, 91.7% { stroke-dashoffset: -55.67; } 100% { stroke-dashoffset: -89; } }
.node { position: absolute; transform: translate(-50%, -50%); background: var(--surface); box-shadow: var(--shadow-sm); padding: 8px 14px; border-radius: 8px; font-weight: 650; font-size: 14px; white-space: nowrap; transition: background 0.3s, color 0.3s; }
.vig.is-cur .node { animation: node-on 7.5s var(--ease) infinite; }
.node.n1 { left: 50%; top: 13.6%; }
.node.n2 { left: 81.5%; top: 68%; }
.node.n3 { left: 18.5%; top: 68%; }
.vig.is-cur .node.n2 { animation-delay: 2.5s; }
.vig.is-cur .node.n3 { animation-delay: 5s; }
@keyframes node-on { 0%, 27% { background: var(--ink); color: var(--bg); transform: translate(-50%, -50%) scale(1.08); } 33%, 100% { background: var(--surface); color: var(--ink); transform: translate(-50%, -50%); } }
.orbit { display: none; }
.closes { display: grid; gap: 10px; }
.close { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-items: center; padding: 14px 16px; border-radius: 10px; background: var(--surface-2); }
.close small { grid-column: 2; color: var(--muted); font-size: 14px; }
.c-dot { grid-row: span 2; width: 26px; height: 26px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--line-2); display: grid; place-items: center; color: var(--on-color); font-size: 14px; font-weight: 700; transition: background 0.4s, box-shadow 0.4s; }
.vig.is-cur .c-dot { background: var(--green); box-shadow: none; }
.vig.is-cur .c-dot::after { content: "✓"; }
.vig.is-cur .close:nth-child(1) .c-dot { transition-delay: 0.7s; }
.vig.is-cur .close:nth-child(2) .c-dot { transition-delay: 1.1s; }
.vig.is-cur .close:nth-child(3) .c-dot { transition-delay: 1.5s; }
.vig.is-cur .closes > :nth-child(2) { transition-delay: 0.35s; } .vig.is-cur .closes > :nth-child(3) { transition-delay: 0.5s; }

/* map figure */
.map-fig { margin: 0; background: var(--surface); border-radius: 10px; box-shadow: var(--shadow); padding: clamp(14px, 2.5vw, 28px); display: grid; gap: 14px; }
.map-svg { width: 100%; height: auto; max-height: calc(100svh - 230px); }
.map-svg text { font: 500 14px var(--sans); letter-spacing: -0.01em; text-anchor: middle; fill: var(--ink); transition: fill 0.4s; }
.edges path { fill: none; stroke: var(--line-2); stroke-width: 2.2; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1s var(--ease), stroke 0.4s; }
.mn { transition: opacity 0.6s var(--ease); }
.mn rect { fill: var(--surface-2); stroke: var(--line-2); stroke-width: 1.5; transition: fill 0.45s, stroke 0.45s, stroke-width 0.3s; }
.mn.held rect { fill: var(--blue-soft); stroke: transparent; }
.mn.held text { fill: var(--blue); }
.mn.goal text { font-weight: 650; }
.redraw path { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0.85; transition: stroke-dashoffset 1.4s var(--ease); }
.probe-qs circle { fill: none; stroke: var(--green); stroke-width: 2.5; opacity: 0; transform-box: fill-box; transform-origin: center; }
.miss { opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(0.3); transition: opacity 0.3s 1.3s, transform 0.6s var(--spring) 1.3s; }
.miss circle { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 2; }
.miss path { stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; }
.you { fill: var(--accent); stroke: var(--surface); stroke-width: 3; opacity: 0; cx: 0; cy: 0; transform: translate(260px, 174px); transition: transform 1.1s var(--ease), opacity 0.4s; }
/* step 0: probe, only held ideas */
[data-scrolly="map"] .mn:not(.held) { opacity: 0.18; }
[data-scrolly="map"][data-step="0"] .probe-qs circle { animation: ping 2.2s var(--ease) infinite; }
[data-scrolly="map"][data-step="0"] .probe-qs g + g circle { animation-delay: 0.6s; }
@keyframes ping { 0% { opacity: 0.9; transform: scale(0.6); } 80%, 100% { opacity: 0; transform: scale(3.2); } }
/* step 1+: the map */
[data-scrolly="map"]:not([data-step="0"]) .mn { opacity: 1; }
[data-scrolly="map"]:not([data-step="0"]) .edges path { stroke-dashoffset: 0; }
[data-scrolly="map"]:not([data-step="0"]) .edges path:nth-child(n+3) { transition-delay: 0.25s; }
[data-scrolly="map"]:not([data-step="0"]) .edges path:nth-child(n+6) { transition-delay: 0.5s; }
[data-scrolly="map"]:not([data-step="0"]) .mn.held { opacity: 0.8; }
/* step 2: walking */
[data-scrolly="map"][data-step="2"] .you, [data-scrolly="map"][data-step="3"] .you { opacity: 1; }
[data-scrolly="map"][data-step="2"] .you { transform: translate(30px, 372px); }
[data-scrolly="map"][data-step="2"] [data-n="s1"] rect, [data-scrolly="map"][data-step="2"] [data-n="s2"] rect,
[data-scrolly="map"][data-step="3"] .mn:not(.held) rect { fill: var(--green); stroke: transparent; }
[data-scrolly="map"][data-step="2"] [data-n="s1"] text, [data-scrolly="map"][data-step="2"] [data-n="s2"] text,
[data-scrolly="map"][data-step="3"] .mn:not(.held) text { fill: var(--on-color); }
[data-scrolly="map"][data-step="2"] [data-n="s3"] rect { stroke: var(--accent); stroke-width: 2.5; fill: var(--surface); }
[data-scrolly="map"][data-step="2"] .edges path[data-e="2"], [data-scrolly="map"][data-step="2"] .edges path[data-e="3"] { stroke: var(--green); }
/* step 3: closed, redrawn from memory */
[data-scrolly="map"][data-step="3"] .you { transform: translate(260px, 478px); opacity: 0; }
[data-scrolly="map"][data-step="3"] .edges path { stroke: var(--line); }
[data-scrolly="map"][data-step="3"] .redraw path { stroke-dashoffset: 0; }
[data-scrolly="map"][data-step="3"] .miss { opacity: 1; transform: none; }
.map-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; font-size: 14px; color: var(--muted); }
.map-legend span { display: flex; align-items: center; gap: 7px; }
.lg { width: 14px; height: 14px; border-radius: 5px; display: inline-block; }
.lg.held { background: var(--blue-soft); box-shadow: inset 0 0 0 1px var(--line-2); }
.lg.done { background: var(--green); }
.lg.here { background: var(--surface); box-shadow: inset 0 0 0 2px var(--accent); }
.lg.todo { background: var(--surface-2); box-shadow: inset 0 0 0 1.5px var(--line-2); }

/* ---------- calibration ---------- */
.cal { padding: clamp(20px, 3vw, 32px); display: grid; gap: 12px; margin: 0; }
.cal-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.cal-title { margin: 0; font-family: var(--serif); font-size: 22px; letter-spacing: -0.01em; }
.cal-read { margin: 0; font-size: 14px; font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; }
.cal-svg { width: 100%; height: auto; overflow: visible; }
.grid line { stroke: var(--line); stroke-width: 1; }
.grid text, .xl text { font: 500 12.5px var(--sans); fill: var(--faint); }
.grid text { text-anchor: end; }
.xl text { text-anchor: middle; }
.ideal { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 5 6; opacity: 0.45; }
.ideal-l { font: italic 500 13px var(--serif); fill: var(--muted); text-anchor: end; }
.cal-line { fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linejoin: round; }
.gaps line { stroke: var(--accent); stroke-width: 6; stroke-linecap: round; opacity: 0.35; }
.dots circle { fill: var(--surface); stroke: var(--ink); stroke-width: 3; }
.dots circle.over { stroke: var(--accent); fill: var(--accent); }
.cal-ctl { display: flex; align-items: center; gap: 16px; font-size: 14px; color: var(--muted); }
.cal-ctl label { white-space: nowrap; font-variant-numeric: tabular-nums; }
.cal-ctl output { font-weight: 650; color: var(--ink); }
input[type="range"] { flex: 1; min-width: 0; accent-color: var(--accent); }

/* ---------- forgetting curve ---------- */
.forget { padding: clamp(20px, 3vw, 32px); margin: 0; display: grid; gap: 10px; }
.forget svg { width: 100%; height: auto; overflow: visible; }
.forget .grid text.x { text-anchor: start; }
.forget .grid text.end { text-anchor: end; }
.forget figcaption { font-size: 14px; color: var(--muted); }
.curve { fill: none; stroke: var(--blue); stroke-width: 3; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.nore { fill: none; stroke: var(--faint); stroke-width: 2; stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0.6; }
.forget.seen .curve { stroke-dashoffset: 0; transition: stroke-dashoffset 3.2s cubic-bezier(0.45, 0, 0.4, 1) 0.3s; }
.forget.seen .nore { stroke-dashoffset: 0; transition: stroke-dashoffset 1.6s var(--ease) 0.1s; }
.lab-none { font: italic 500 13px var(--serif); fill: var(--faint); opacity: 0; transition: opacity 0.6s 1.4s; }
.forget.seen .lab-none { opacity: 1; }
.rv circle { fill: var(--surface); stroke: var(--blue); stroke-width: 3; }
.rv text { font: 600 12.5px var(--sans); fill: var(--ink); text-anchor: middle; }
.rv { opacity: 0; transform-box: fill-box; transform-origin: center bottom; transform: translateY(8px); transition: opacity 0.4s, transform 0.6s var(--spring); }
.forget.seen .rv { opacity: 1; transform: none; }

/* ---------- ledger ---------- */
.ledger { margin-top: clamp(36px, 5vw, 56px); display: grid; gap: 14px; }
.ledger-cap, .ledger-foot { margin: 0; color: var(--muted); font-size: 15px; }
.ledger-foot { margin-top: 8px; font-family: var(--serif); font-style: italic; font-size: 20px; color: var(--ink); }
.claim-row { display: grid; grid-template-columns: minmax(0, 1fr) 56px minmax(0, 1.05fr) 132px; align-items: center; gap: 0 14px; }
.claim { background: var(--surface); padding: 18px 20px; border-radius: 10px; box-shadow: var(--shadow-sm); font-size: 16px; }
.wire { height: 2px; position: relative; }
.wire i { position: absolute; inset: 0; background: var(--line-2); transform-origin: left; transform: scaleX(0); transition: transform 0.6s var(--ease); }
.wire::after { content: ""; position: absolute; right: -3px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); transform: scale(0); transition: transform 0.4s var(--spring); }
.src { margin: 0; padding: 14px 18px; border-radius: 10px; border: 1.5px dashed var(--line-2); font-family: var(--serif); font-style: italic; font-size: 18px; line-height: 1.4; opacity: 0; transform: translateX(-16px); transition: opacity 0.5s, transform 0.7s var(--ease); }
.src cite { display: block; font: normal 600 13px var(--sans); color: var(--muted); margin-bottom: 4px; }
.src.empty { font-family: var(--sans); font-style: normal; color: var(--faint); font-size: 15px; }
.chip { justify-self: start; font-weight: 650; font-size: 13.5px; padding: 7px 14px; border-radius: 8px; transform: scale(0.4); opacity: 0; transition: transform 0.7s var(--spring), opacity 0.3s; }
[data-v="bad"] .chip { background: var(--accent-soft); color: var(--accent); }
[data-v="good"] .chip { background: var(--green-soft); color: var(--green); }
[data-v="none"] .chip { background: var(--amber-soft); color: var(--amber); }
.claim-row.on .wire i { transform: none; }
.claim-row.on .wire::after { transform: none; transition-delay: 0.45s; }
.claim-row.on .src { opacity: 1; transform: none; transition-delay: 0.4s; }
.claim-row.on .chip { opacity: 1; transform: none; transition-delay: 0.95s; }

/* ---------- subjects ---------- */
.subj { margin-top: clamp(32px, 5vw, 52px); display: grid; gap: 22px; }
.subj-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.subj-tabs button { position: relative; overflow: hidden; border: 0; background: var(--surface); padding: 10px 18px; border-radius: 8px; font-weight: 600; font-size: 15px; box-shadow: var(--shadow-sm); transition: background 0.3s, color 0.3s, transform 0.5s var(--spring); }
.subj-tabs button:hover { transform: translateY(-2px); }
.subj-tabs button[aria-selected="true"] { background: var(--ink); color: var(--bg); }
.subj-tabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); }
.subj[data-auto] .subj-tabs button[aria-selected="true"]::after { animation: tab-run 6.5s linear forwards; }
@keyframes tab-run { to { transform: scaleX(1); } }
.ptc { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.ptc-card { background: var(--surface); border-radius: 12px; padding: 24px; box-shadow: var(--shadow-sm); display: grid; gap: 12px; align-content: start; position: relative; }
.ptc-card + .ptc-card::before { content: ""; position: absolute; left: -12px; top: 34px; width: 10px; height: 10px; border-top: 2px solid var(--line-2); border-right: 2px solid var(--line-2); transform: rotate(45deg); }
.ptc-l { font-size: 13px; font-weight: 650; justify-self: start; padding: 4px 12px; border-radius: 8px; }
.ptc-card.p .ptc-l { background: var(--blue-soft); color: var(--blue); }
.ptc-card.t .ptc-l { background: var(--amber-soft); color: var(--amber); }
.ptc-card.c .ptc-l { background: var(--green-soft); color: var(--green); }
.ptc-card p { margin: 0; font-family: var(--serif); font-size: 20px; line-height: 1.4; font-variation-settings: "SOFT" 0, "opsz" 24; }
.ptc.swap .ptc-card p { animation: swap 0.7s var(--ease) backwards; }
.ptc.swap .t p { animation-delay: 0.08s; } .ptc.swap .c p { animation-delay: 0.16s; }
@keyframes swap { from { opacity: 0; transform: translateY(14px); filter: blur(4px); } }

/* ---------- live pages ---------- */
.browser { margin: clamp(32px, 5vw, 52px) auto 0; max-width: 1180px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; border: 1px solid var(--line); }
.b-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.seg { display: flex; background: var(--surface-2); padding: 4px; border-radius: 8px; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.seg button { border: 0; background: none; padding: 8px 16px; border-radius: 8px; font-weight: 600; font-size: 14px; color: var(--muted); white-space: nowrap; transition: background 0.3s, color 0.3s; }
.seg button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.b-open { font-size: 14px; font-weight: 600; text-decoration: none; color: var(--muted); padding: 8px 12px; }
.b-body { height: min(720px, 78svh); background: var(--bg); }
.b-body iframe { width: 100%; height: 100%; border: 0; display: block; }
.b-body iframe[hidden] { display: none; }
.b-cap { margin: 0; padding: 14px 20px; font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); }

/* ---------- today ---------- */
.today { margin-top: clamp(32px, 5vw, 52px); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.col { background: var(--surface); border-radius: 14px; padding: 28px; box-shadow: var(--shadow-sm); display: grid; gap: 10px; align-content: start; border: 1px solid var(--line); }
.big { margin: 0; font-family: var(--serif); font-size: 72px; line-height: 1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.col.good .big { color: var(--green); } .col.new .big { color: var(--accent); } .col.yet .big { color: var(--faint); }
.col h3 { font-size: 22px; }
.col ul { margin: 4px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.col li { padding-left: 20px; position: relative; color: var(--muted); font-size: 15.5px; }
.col li::before { content: ""; position: absolute; left: 0; top: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); }
.col.good li::before { background: var(--green); } .col.new li::before { background: var(--accent); }
.col .link { justify-self: start; margin-top: 6px; }

/* ---------- final ---------- */
.final { max-width: 1360px; margin: 16px auto 0; border-radius: clamp(14px, 1.8vw, 22px); background: var(--slab); color: var(--on-slab); padding-block: clamp(64px, 9vw, 120px) 28px; padding-inline: clamp(20px, 5.5vw, 80px); position: relative; overflow: hidden; }
.final::before { content: ""; position: absolute; width: 60%; aspect-ratio: 1; right: -18%; top: -30%; border-radius: 50%; background: radial-gradient(closest-side, rgba(240, 122, 91, 0.22), transparent); pointer-events: none; animation: drift 20s ease-in-out infinite alternate; }
.final-in { position: relative; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: clamp(32px, 6vw, 80px); align-items: center; }
.final h2 { font-size: clamp(40px, 5.6vw, 76px); line-height: 1; letter-spacing: -0.035em; }
.final h2 em { color: var(--accent-on-slab); }
.final-copy { display: grid; gap: 24px; }
.final-copy > p { margin: 0; color: var(--on-slab-muted); font-size: 18px; max-width: 560px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.steps li { display: grid; gap: 8px; justify-items: start; }
.steps li > span { font-size: 13px; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; color: var(--on-slab-muted); }
.steps p { margin: 0; color: var(--on-slab-muted); }
.steps p code { color: var(--on-slab); background: rgba(255, 255, 255, 0.08); padding: 2px 7px; border-radius: 6px; }
.cmd.dark { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.12); box-shadow: none; }
.cmd.dark code { color: var(--on-slab); }
.cmd.dark .copy { background: rgba(255, 255, 255, 0.1); color: var(--on-slab); }
.chat { display: grid; gap: 14px; align-content: center; }
.bubble { max-width: 92%; padding: 16px 20px; border-radius: 12px; font-size: 17px; opacity: 0; transform: translateY(20px) scale(0.96); transition: opacity 0.5s var(--ease), transform 0.8s var(--spring); }
.bubble p { margin: 0; }
.bubble.me { justify-self: end; background: var(--accent-on-slab); color: #15171c; border-bottom-right-radius: 8px; font-family: var(--serif); font-size: 21px; line-height: 1.35; font-variation-settings: "SOFT" 0, "opsz" 24; }
.bubble.bot { background: rgba(255, 255, 255, 0.08); color: var(--on-slab); border-bottom-left-radius: 8px; display: grid; }
.bubble.bot > * { grid-area: 1 / 1; }
.bubble.bot p { opacity: 0; transition: opacity 0.4s 1.9s; }
.dots { display: flex; gap: 5px; align-items: center; transition: opacity 0.3s 1.8s; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--on-slab-muted); animation: blink 1.2s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: 0.15s; } .dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes blink { 0%, 60%, 100% { opacity: 0.3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
.bubble.slim { font-size: 15px; color: var(--on-slab-muted); }
.chat.seen .bubble { opacity: 1; transform: none; }
.chat.seen .bubble:nth-child(2) { transition-delay: 0.7s; }
.chat.seen .bubble:nth-child(3) { transition-delay: 2.6s; }
.chat.seen .bubble.bot p { opacity: 1; }
.chat.seen .dots { opacity: 0; }
.slim p { transition: none !important; opacity: 1 !important; }
.final { border-end-start-radius: 0; border-end-end-radius: 0; padding-bottom: clamp(56px, 8vw, 96px); }
.final :focus-visible { outline-color: var(--accent-on-slab); }
/* the footer continues the slab, outside <main> so it stays the page's contentinfo landmark */
.foot { max-width: 1360px; margin: 0 auto 16px; background: var(--slab); color: var(--on-slab-muted); border-radius: 0 0 clamp(14px, 1.8vw, 22px) clamp(14px, 1.8vw, 22px); padding-inline: clamp(20px, 5.5vw, 80px); padding-bottom: 28px; font-size: 14px; }
.foot :focus-visible { outline-color: var(--accent-on-slab); }
.foot-in { padding-top: 22px; border-top: 1px solid rgba(241, 239, 234, 0.1); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.foot p { margin: 0; }

/* ---------- theme switch: a circle grows from the button ---------- */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { animation: reveal 0.7s var(--ease); }
@keyframes reveal { from { clip-path: circle(0 at var(--vx, 90%) var(--vy, 30px)); } to { clip-path: circle(150vmax at var(--vx, 90%) var(--vy, 30px)); } }

/* ---------- pause and reduced motion ---------- */
:root[data-paused] *, :root[data-paused] *::before, :root[data-paused] *::after { animation-play-state: paused !important; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .hero h1 em::after, h2 em::after { clip-path: none; }
}

.scene-nav { display: none; }

/* ---------- narrow ---------- */
@media (max-width: 920px) {
  .links { display: none; }
  .split, .split.rev, .final-in { grid-template-columns: minmax(0, 1fr); }
  .split.rev .forget { order: 2; }
  /* phones: scenes play on a timer instead of following the scroll */
  .scrolly { height: auto; margin-top: 28px; }
  .stage { position: relative; height: auto; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto; align-items: start; gap: 18px; padding: 0; }
  .scene-nav { order: 2; display: flex; align-items: center; gap: 6px; }
  .scene-nav button { flex: 1; height: 32px; border: 0; background: none; padding: 0; position: relative; }
  .scene-nav button::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 3px; margin-top: -1.5px; border-radius: 2px; background: var(--line-2); }
  .scene-nav button::after { content: ""; position: absolute; left: 0; top: 50%; height: 3px; margin-top: -1.5px; border-radius: 2px; background: var(--ink); width: 0; }
  .scene-nav button.is-past::after { width: 100%; }
  .scene-nav button.is-cur::after { width: 100%; background: var(--accent); }
  .scene-nav button.is-cur.run::after { width: 0; animation: seg-fill var(--dur, 4s) linear forwards; }
  [data-paused] .scene-nav button.is-cur.run::after { animation-play-state: paused; }
  @keyframes seg-fill { to { width: 100%; } }
  .captions { order: 3; display: grid; }
  .captions li { grid-area: 1 / 1; padding: 0 0 0 46px; opacity: 0; transform: translateY(10px); transition: opacity 0.4s, transform 0.5s var(--ease); }
  .captions li::before { top: 0; }
  .captions li.is-cur { opacity: 1; transform: none; }
  .captions h3 { font-size: 22px; }
  .loop-fig { order: 1; min-height: 0; gap: 16px; }
  .map-fig { order: 1; }
  .map-svg { max-height: 52svh; }
  .claim-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "claim chip" "src src"; gap: 10px; padding-left: 0; }
  .claim { grid-area: claim; } .chip { grid-area: chip; align-self: start; margin-top: 14px; } .src { grid-area: src; margin-left: 24px; }
  .wire { display: none; }
  .ptc, .today { grid-template-columns: minmax(0, 1fr); }
  .ptc-card + .ptc-card::before { display: none; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .nav-in { padding-left: 14px; gap: 8px; }
  .gh { display: none; }
  .hero { padding-top: 120px; }
  .opts { grid-template-columns: minmax(0, 1fr); }
  .conf-track button { font-size: 13px; height: 38px; }
  .cmd { padding-left: 14px; }
  .track li { font-size: 11px; white-space: nowrap; letter-spacing: -0.01em; }
  .vig { gap: 10px; }
  .due, .probe, .close { padding: 11px 13px; font-size: 14px; }
  .mail { font-size: 18px; }
  .node { font-size: 12.5px; padding: 6px 10px; }
  .ring { width: min(240px, 72%); }
  .map-legend { font-size: 13px; gap: 6px 12px; }
  .claim-row { grid-template-columns: minmax(0, 1fr); grid-template-areas: "claim" "src" "chip"; }
  .chip { margin: 0 0 0 24px; }
  .b-body { height: 70svh; }
  .grid text, .xl text, .rv text { font-size: 20px; }
  .ideal-l, .lab-none { font-size: 21px; }
  .cal-svg .grid text { font-size: 22px; }
  .map-svg text { font-size: 14px; font-weight: 600; letter-spacing: -0.02em; }
}
