html { -webkit-text-size-adjust: 100%; }
/* Plan. Layout: one pinned scroll story (a stack of pages that merges, splits, rotates, shrinks), then calm full-width bands.
   Boldness lives only in that stack; everything else is quiet type, one blue, status colours for good/warn.
   Type: SF Pro on Apple devices, Inter elsewhere. */
:root {
  --bg: #ffffff; --bg-alt: #f5f5f7; --fg: #1d1d1f; --fg-2: #6e6e73; --line: #d2d2d7;
  --accent: #0071e3; --accent-ink: #ffffff; --good: #1f9d55; --warn: #b25e00; --card: #ffffff; --bar: #e8e8ed;
  --muted-bar: #a1a1a6; --code-bg: #1d1d1f; --code-fg: #f5f5f7; --nav: rgba(255,255,255,.72);
  --sheet: #ffffff; --sheet-line: #d9d9de; --sheet-ink: #c7c7cc; --sheet-shadow: 0 18px 40px -14px rgba(0,0,0,.28), 0 2px 6px rgba(0,0,0,.08);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", Inter, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --gutter: max(16px, env(safe-area-inset-left, 0px));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000; --bg-alt: #161617; --fg: #f5f5f7; --fg-2: #a1a1a6; --line: #38383a; --accent: #2997ff; --accent-ink: #000;
    --good: #30d158; --warn: #ff9f0a; --card: #1c1c1e; --bar: #2c2c2e; --muted-bar: #636366; --code-bg: #1c1c1e; --code-fg: #f5f5f7;
    --nav: rgba(0,0,0,.72); --sheet: #2c2c2e; --sheet-line: #48484a; --sheet-ink: #5a5a5e; --sheet-shadow: 0 18px 40px -14px rgba(0,0,0,.8), 0 0 0 1px rgba(255,255,255,.06); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000; --bg-alt: #161617; --fg: #f5f5f7; --fg-2: #a1a1a6; --line: #38383a; --accent: #2997ff; --accent-ink: #000;
  --good: #30d158; --warn: #ff9f0a; --card: #1c1c1e; --bar: #2c2c2e; --muted-bar: #636366; --code-bg: #1c1c1e; --code-fg: #f5f5f7;
  --nav: rgba(0,0,0,.72); --sheet: #2c2c2e; --sheet-line: #48484a; --sheet-ink: #5a5a5e; --sheet-shadow: 0 18px 40px -14px rgba(0,0,0,.8), 0 0 0 1px rgba(255,255,255,.06); color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font); font-size: 17px; line-height: 1.47;
  letter-spacing: -.01em; -webkit-font-smoothing: antialiased; padding-left: var(--gutter); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.band { margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); }
.band.alt { background: var(--bg-alt); }
.wrap { max-width: 980px; margin: 0 auto; padding-block: 104px; }
.wrap.tight { padding-block: 72px; }
section[id] { scroll-margin-top: 48px; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
h1 { font-size: clamp(44px, 9vw, 92px); line-height: 1.02; font-weight: 700; letter-spacing: -.045em; }
h2 { font-size: clamp(32px, 5.4vw, 56px); line-height: 1.07; font-weight: 700; letter-spacing: -.035em; }
h3 { font-size: 24px; line-height: 1.17; font-weight: 600; letter-spacing: -.02em; }
p { margin: 0; color: var(--fg-2); }
.lede { font-size: clamp(19px, 2.6vw, 28px); line-height: 1.25; font-weight: 500; color: var(--fg-2); letter-spacing: -.02em; max-width: 34ch; text-wrap: balance; margin-top: 20px; }
.kicker { font-size: 21px; font-weight: 600; color: var(--accent); margin: 0 0 8px; }

/* nav + scroll progress */
nav {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; height: 48px; margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter);
  background: var(--nav); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--line);
}
nav > div { max-width: 980px; margin: 0 auto; height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
nav strong { font-size: 19px; font-weight: 600; letter-spacing: -.02em; }
nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; font-size: 12px; }
nav ul a { display: block; color: var(--fg); opacity: .7; padding: 6px 12px; border-radius: 980px; transition: opacity .2s, background .2s; }
nav ul a:hover { opacity: 1; text-decoration: none; }
nav ul a[aria-current="true"] { opacity: 1; background: var(--bg-alt); }
.nav-right { display: flex; align-items: center; gap: 4px; }
.theme { width: 32px; height: 32px; border: 0; border-radius: 50%; background: none; color: var(--fg); cursor: pointer; display: grid; place-items: center; opacity: .75; transition: opacity .2s, background .2s, transform .2s; }
.theme:hover { opacity: 1; background: var(--bg-alt); } .theme:active { transform: scale(.92); }
.theme svg { width: 18px; height: 18px; display: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme[data-mode="auto"] svg[data-i="auto"], .theme[data-mode="light"] svg[data-i="light"], .theme[data-mode="dark"] svg[data-i="dark"] { display: block; }
.progress { position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }
@media (max-width: 640px) { nav ul li:nth-child(n+4) { display: none; } nav ul a { padding: 6px 8px; } }

/* ---------- pinned story ---------- */
.story { position: relative; height: 520vh; margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); }
.stage {
  position: sticky; top: calc(48px + env(safe-area-inset-top, 0px)); height: calc(100svh - 48px); min-height: 560px; max-height: 860px;
  display: grid; grid-template-rows: 1fr auto; overflow: hidden; max-width: 980px; margin: 0 auto;
}
.intro { position: absolute; inset: 0 0 auto 0; padding-top: clamp(28px, 7vh, 72px); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; will-change: transform, opacity; }
.intro .lede { max-width: 26ch; margin-top: 4px; }
.cta { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.btn { display: inline-block; padding: 11px 22px; border-radius: 980px; font-size: 17px; font-weight: 500; cursor: pointer; border: 0; font-family: inherit; }
.btn.primary { background: var(--accent); color: var(--accent-ink); transition: filter .2s, transform .2s; }
.btn.primary:hover { text-decoration: none; filter: brightness(1.1); } .btn.primary:active { transform: scale(.97); }
.btn.ghost { background: none; color: var(--accent); } .btn.ghost::after { content: " ›"; }
.pile { position: absolute; left: 50%; top: 56%; width: 0; height: 0; }
.sheet {
  position: absolute; width: 150px; height: 200px; margin: -100px 0 0 -75px; border-radius: 10px; background: var(--sheet);
  box-shadow: var(--sheet-shadow); will-change: transform; padding: 16px 14px; display: flex; flex-direction: column; gap: 7px;
}
.sheet i { display: block; height: 5px; border-radius: 3px; background: var(--sheet-ink); }
.sheet i:nth-child(1) { width: 55%; height: 8px; background: var(--fg-2); opacity: .55; } .sheet i:nth-child(2) { width: 100%; } .sheet i:nth-child(3) { width: 92%; }
.sheet i:nth-child(4) { width: 100%; } .sheet i:nth-child(5) { width: 70%; } .sheet i:nth-child(6) { width: 100%; margin-top: 8px; } .sheet i:nth-child(7) { width: 84%; }
.sheet b { position: absolute; right: 10px; bottom: 8px; font-size: 11px; font-weight: 600; color: var(--fg-2); font-variant-numeric: tabular-nums; }
.beat { position: absolute; left: 0; right: 0; bottom: clamp(88px, 14vh, 130px); text-align: center; opacity: 0; transform: translateY(14px); transition: opacity .45s, transform .45s; pointer-events: none; padding-inline: 8px; }
.beat.on { opacity: 1; transform: none; }
.beat h2 { font-size: clamp(34px, 6vw, 60px); }
.beat p { margin: 8px auto 0; font-size: clamp(16px, 2vw, 21px); max-width: 38ch; }
.rail { position: absolute; left: 0; right: 0; bottom: clamp(24px, 5vh, 44px); display: flex; justify-content: center; gap: 8px; }
.rail button {
  font: inherit; font-size: 13px; font-weight: 500; color: var(--fg-2); background: var(--bg-alt); border: 0; border-radius: 980px; padding: 7px 14px; cursor: pointer;
  transition: background .25s, color .25s, transform .2s;
}
.rail button:hover { color: var(--fg); } .rail button:active { transform: scale(.96); }
.rail button[aria-current="true"] { background: var(--fg); color: var(--bg); }
.hint { position: absolute; left: 50%; bottom: 4px; transform: translateX(-50%); font-size: 12px; color: var(--fg-2); transition: opacity .3s; }
@media (max-width: 560px) { .rail { gap: 4px; } .rail button { padding: 6px 10px; font-size: 12px; } .sheet { width: 120px; height: 160px; margin: -80px 0 0 -60px; } }

/* ---------- reveal (resting state stays readable) ---------- */
.js .rv { opacity: .22; transform: translateY(20px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); transition-delay: calc(var(--i, 0) * 70ms); }
.js .rv.in { opacity: 1; transform: none; }

/* ---------- content blocks ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; margin-top: 56px; }
.split > * { min-width: 0; } .split h3 { margin-bottom: 12px; }
@media (max-width: 800px) { .split { grid-template-columns: 1fr; gap: 32px; } }
pre { margin: 0; padding: 24px; border-radius: 20px; background: var(--code-bg); color: var(--code-fg); font: 13.5px/1.65 var(--mono); letter-spacing: 0; overflow-x: auto; }
pre .c { opacity: .55; } pre .k { color: #ff9f7a; } pre .s { color: #8fd4a0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 56px; }
.tile { background: var(--card); border-radius: 24px; padding: 28px; min-width: 0; transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s; }
.tile:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -20px rgba(0,0,0,.35); }
.tile h3 { font-size: 21px; margin-bottom: 8px; } .tile p { font-size: 15px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 56px; }
.stat { background: var(--bg-alt); border-radius: 24px; padding: 32px 28px; min-width: 0; }
.alt .stat { background: var(--card); }
.stat b { display: block; font-size: clamp(44px, 6vw, 64px); line-height: 1; font-weight: 700; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.stat span { display: block; margin-top: 12px; font-size: 15px; color: var(--fg-2); }
.stat small { display: block; margin-top: 10px; font-size: 12px; color: var(--fg-2); opacity: .9; }

/* download size, drawn to scale */
.size { margin-top: 56px; background: var(--bg-alt); border-radius: 28px; padding: 36px 32px; display: grid; gap: 22px; }
.size-row { display: grid; grid-template-columns: 92px 1fr; gap: 16px; align-items: center; }
.size-row > span { font-weight: 600; font-size: 15px; }
.size-bar { position: relative; height: 40px; border-radius: 12px; background: var(--bar); overflow: hidden; }
.size-fill { position: absolute; inset: 0 auto 0 0; border-radius: 12px; display: flex; align-items: center; justify-content: flex-end; padding-right: 12px; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; width: 0; transition: width 1.4s cubic-bezier(.2,.7,.2,1); white-space: nowrap; }
.size-fill.q { background: var(--accent); color: var(--accent-ink); } .size-fill.m { background: var(--muted-bar); color: #fff; }
.size-bar { overflow: visible; }
.size-fill.short span { position: absolute; left: calc(100% + 10px); color: var(--fg); }
.size-note { font-size: 13px; color: var(--fg-2); }

/* interactive comparison */
.ctl { display: flex; flex-wrap: wrap; gap: 14px 24px; margin-top: 48px; align-items: center; }
.seg { display: inline-flex; background: var(--bar); border-radius: 980px; padding: 3px; gap: 2px; }
.seg button { font: inherit; font-size: 14px; font-weight: 500; color: var(--fg); background: none; border: 0; border-radius: 980px; padding: 7px 16px; cursor: pointer; transition: background .25s, box-shadow .25s; }
.seg button[aria-pressed="true"] { background: var(--card); box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.seg button:disabled { opacity: .4; cursor: not-allowed; }
.race { margin-top: 28px; background: var(--card); border-radius: 28px; padding: 36px 32px; }
.alt .race { background: var(--card); }
.race-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.race-head p { font-size: 14px; max-width: 52ch; }
.lane-row { display: grid; grid-template-columns: 78px 1fr 84px; gap: 14px; align-items: center; margin-top: 22px; }
.lane-row > span { font-weight: 600; font-size: 15px; } .lane-row output { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; font-size: 17px; }
.lane-track { position: relative; height: 18px; border-radius: 9px; background: var(--bar); overflow: hidden; }
.lane-fill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 9px; }
.lane-fill.q { background: var(--accent); } .lane-fill.m { background: var(--muted-bar); }
.verdict { margin-top: 28px; display: flex; gap: 12px 28px; flex-wrap: wrap; align-items: baseline; }
.verdict b { font-size: clamp(30px, 5vw, 44px); font-weight: 700; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.verdict span { color: var(--fg-2); font-size: 15px; }
.mem { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 15px; color: var(--fg-2); }
.mem b { color: var(--fg); font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .lane-row { grid-template-columns: 1fr 76px; } .lane-row .lane-track { grid-column: 1 / -1; order: 3; } .size-row { grid-template-columns: 1fr; gap: 8px; } }

/* table */
.table-wrap { margin-top: 28px; overflow-x: auto; border-radius: 20px; background: var(--card); }
table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 640px; }
th, td { padding: 16px 20px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { font-size: 12px; font-weight: 600; color: var(--fg-2); }
tr:last-child td { border-bottom: 0; } td:first-child { font-weight: 600; white-space: nowrap; }
tbody tr { transition: background .2s; } tbody tr:hover { background: var(--bg-alt); }
tr.gone { display: none; } tr.pop { animation: pop .5s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 980px; white-space: nowrap; }
.tag.good { color: var(--good); background: color-mix(in srgb, var(--good) 14%, transparent); }
.tag.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 16%, transparent); }
.tag.tie { color: var(--fg-2); background: var(--bg-alt); }
.notes { margin: 40px 0 0; padding: 0; display: grid; gap: 10px; font-size: 14px; color: var(--fg-2); max-width: 70ch; }
.notes li { list-style: disc; margin-left: 18px; }

/* roadmap */
.road { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-top: 56px; }
.lane { background: var(--card); border-radius: 24px; padding: 28px; min-width: 0; }
.lane h3 { font-size: 21px; display: flex; align-items: center; gap: 10px; }
.lane ul { margin: 16px 0 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.lane li { font-size: 15px; color: var(--fg-2); padding-top: 14px; border-top: 1px solid var(--line); }
.lane li b { display: block; color: var(--fg); font-weight: 600; margin-bottom: 2px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; } .dot.a { background: var(--accent); } .dot.b { background: var(--warn); } .dot.c { background: var(--fg-2); }
footer { padding-block: 40px 64px; font-size: 12px; color: var(--fg-2); }
footer div { max-width: 980px; margin: 0 auto; border-top: 1px solid var(--line); padding-top: 20px; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .rv { opacity: 1; transform: none; transition: none; } .size-fill { transition: none; } .beat { transition: none; } tr.pop { animation: none; }
}
