:root {
  --bg: #0d0d0f; --ink: #ede9df; --muted: #c4c0b6; --dim: #9a968e;
  --jade: #5aaf96; --jade-strong: #8fd0bc; --sand: #d9c8a0; --rule: rgba(237, 233, 223, .2);
  --card: #1c1c22; --card-hover: #22262b;
  --sans: Geist, Inter, system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --serif: 'EB Garamond', Georgia, serif;
  /* type sizes: at 1440 px wide, the title 64, headings 45, body 20, labels 16 */
  --t-title: clamp(46px, 4.4vw, 74px);
  --t-head: clamp(32px, 3.1vw, 52px);
  --t-body: clamp(18px, 1.4vw, 23px);
  --t-label: clamp(15px, 1.12vw, 18px);
  --cap-r: calc(2.5vw + min(31vw, 540px) + 1.5vw);   /* where the caption ends */
  --bar: 86px;     /* the site header's height */
  --rail: 280px;   /* the room the rail takes on the left: nothing else goes there */
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font-family: var(--sans); -webkit-font-smoothing: antialiased; }

/* top bar: the site and the series, nothing else */
.top { position: fixed; z-index: 30; inset: 0 0 auto 0; height: var(--bar); display: flex; align-items: center; gap: 22px;
  padding: 0 32px; background: var(--bg); border-bottom: 1px solid rgba(237,233,223,.06); }
.brand { color: var(--ink); text-decoration: none; font: 500 17px var(--mono); }
.crumb { color: var(--muted); font-size: 17px; white-space: nowrap; }
.proto { margin-left: auto; font: 600 13px var(--mono); color: #111; background: var(--sand); padding: 4px 8px; border-radius: 4px; }

/* the rail, fixed on the left */
#rail { position: fixed; z-index: 25; left: 0; top: var(--bar); bottom: 0; width: var(--rail); pointer-events: none; }
.rail-full { position: absolute; left: 20px; top: 8px; pointer-events: auto; }
.rail-svg { display: block; height: min(620px, calc(100vh - var(--bar) - 20px)); width: auto; aspect-ratio: 270 / 620; overflow: visible; }
.rail-svg a { cursor: pointer; }
.rail-svg a.stop:hover text { fill: var(--jade-strong); }
.rail-svg a.stop:hover svg { filter: brightness(1.6); }
.rail-svg a.ovr text { transition: fill .15s; }
.rail-svg a.ovr:hover text { fill: var(--jade-strong); text-decoration: underline; }
.rail-edge { display: none; position: absolute; left: 6px; top: 14px; bottom: 14px; width: 20px; }
.rail-chip { display: none; }

/* narrower screens: only the thin line on the edge; the full rail slides out on hover */
@media (max-width: 1199px) {
  :root { --rail: 40px; }
  .rail-edge { display: block; pointer-events: auto; }
  .rail-full { left: 0; top: 0; padding: 10px 18px 10px 24px; background: rgba(13,13,15,.97); border-right: 1px solid var(--rule);
    transform: translateX(-102%); transition: transform .25s ease; }
  #rail:hover .rail-full, #rail:focus-within .rail-full { transform: none; }
  #rail { pointer-events: auto; width: var(--rail); }
  #rail:hover { width: auto; }
}

/* the overview: a tall section and a stage that stays on screen */
.story { position: relative; height: 1288vh; }
.stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
/* everything the story shows lives right of the rail */
.view { position: absolute; left: var(--rail); right: 0; top: 0; bottom: 0; overflow: hidden; }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.scrim { position: absolute; inset: 0; opacity: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(13,13,15,.9) 0%, rgba(13,13,15,.62) 24%, rgba(13,13,15,0) 42%); }

/* captions: one idea per beat */
.caption { position: absolute; left: 2.5vw; top: calc(var(--bar) + 4vh); width: min(31vw, 540px); pointer-events: none;
  text-shadow: 0 0 24px rgba(13,13,15,.95), 0 0 6px rgba(13,13,15,.9); }
.caption .k { margin: 0 0 14px; font: 600 var(--t-label) var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--jade-strong); min-height: 1em; }
.caption .h { margin: 0; font: 400 var(--t-head)/1.1 var(--serif); letter-spacing: -.005em; text-wrap: balance; }
.caption.title { width: min(44vw, 700px); }
.caption.title .h { font-size: var(--t-title); line-height: 1.0; }
/* the title's standfirst: set in the serif, quieter than the title */
.caption.title .p { margin-top: 22px; max-width: 30em; font: 400 clamp(20px, 1.6vw, 25px)/1.42 var(--serif); color: #cfcabf; letter-spacing: .002em; }
.caption .p { margin: 20px 0 0; font: 400 var(--t-body)/1.5 var(--sans); color: var(--muted); text-wrap: pretty; }
.caption .p2 { margin: 14px 0 0; font: 400 var(--t-label)/1.5 var(--sans); color: var(--dim); }
.caption .p:empty, .caption .p2:empty { display: none; }
.caption .go { pointer-events: auto; display: inline-flex; align-items: center; gap: .4em; margin-top: 24px; color: var(--ink); text-decoration: none;
  font-size: var(--t-label); border: 1px solid var(--rule); border-radius: 999px; padding: 10px 18px; text-shadow: none; background: rgba(13,13,15,.6); white-space: nowrap; }
.caption .go:hover { border-color: var(--jade); }
.caption .go[hidden] { display: none; }
.caption .go b { color: var(--jade-strong); font-weight: 500; }
.caption .go span { color: var(--dim); }


/* flat scenes drawn as isometric line art; the overview sizes and moves them */
.iso { position: absolute; left: var(--cap-r); right: 0.5%; top: calc(var(--bar) + 1vh); bottom: 1vh; width: calc(99.5% - var(--cap-r)); height: calc(100% - var(--bar) - 2vh); opacity: 0; pointer-events: none; overflow: visible; }

/* labels on the datacenter, the server and the GPU */
.tags { position: absolute; inset: 0; pointer-events: none; }
.tag { position: absolute; left: 0; top: 0; opacity: 0; white-space: nowrap; transform: translate(-50%, -100%);
  font: 400 var(--t-label) var(--sans); color: var(--ink); background: rgba(13,13,15,.86); border: 1px solid var(--rule); border-radius: 6px; padding: 7px 12px; }
.tag-disks i { display: block; margin-top: 3px; font-size: 13px; font-style: normal; color: var(--muted); }
.tag-llama { color: rgba(237,233,223,.75); border-color: rgba(237,233,223,.3); background: rgba(13,13,15,.78); font-size: 15px; }
.tag-mem, .tag-gpus, .tag-server, .tag-gpu { border-color: rgba(143,208,188,.6); color: var(--jade-strong); }

/* the read: one token at a time to your laptop */
.read { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.read-wire { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.read-wire path { fill: none; stroke: var(--muted); stroke-width: 2; stroke-dasharray: 3 8; stroke-linecap: round; opacity: .6; }
.flying { position: absolute; inset: 0; }
.flying span { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); opacity: 0; white-space: nowrap;
  font: 500 var(--t-label) var(--sans); color: var(--bg); background: var(--jade-strong); padding: 4px 10px; border-radius: 6px; }

/* the last screen: the answer is on the laptop; the four chapters sit under it */
.final { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.final-line { position: absolute; left: 2.5vw; top: calc(var(--bar) + 6vh); width: min(26vw, 400px); margin: 0;
  font: italic 400 clamp(24px, 2.3vw, 36px)/1.25 var(--serif); color: var(--muted); text-wrap: balance; }

.final.on, .final.on .door { pointer-events: auto; }
.doors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.doors { grid-template-columns: repeat(4, 1fr); gap: 16px; }
.door { position: relative; display: flex; flex-direction: column; padding: 8px 20px 18px; color: var(--ink); text-decoration: none;
  background: var(--card); border: 1px solid rgba(237,233,223,.24); border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.5);
  transition: transform .22s ease, border-color .2s, background .2s, box-shadow .22s; }
.door:hover, .door:focus-visible { transform: translateY(-6px); border-color: var(--jade); background: var(--card-hover); box-shadow: 0 16px 38px rgba(0,0,0,.6); outline: none; }
.door.flash { border-color: var(--jade-strong); box-shadow: 0 0 0 3px rgba(143,208,188,.25), 0 0 40px rgba(90,175,150,.25); }
.door .art { display: block; padding: 30px 0 6px; border-bottom: 1px solid rgba(237,233,223,.1); }
.door .art svg { display: block; margin: 0 auto; width: auto; max-width: 100%; height: clamp(70px, 12vh, 120px); }
.door h3 { margin: 12px 0 4px; font: 400 clamp(26px, 2.1vw, 34px)/1.1 var(--serif); }
.door p { margin: 0; padding-right: 36px; font: 400 clamp(17px, 1.3vw, 20px)/1.4 var(--sans); color: var(--muted); }
.door .arrow { position: absolute; right: 16px; bottom: 16px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(143,208,188,.6);
  color: var(--jade-strong); display: grid; place-items: center; font-size: 20px; line-height: 1; transition: background .2s, color .2s, transform .2s; }
.door:hover .arrow { background: var(--jade-strong); color: var(--bg); transform: translateX(3px); }

/* after the overview: the agents aside, quieter than the chapters, and two notes */
.chapters { padding: 4vh 4vw 8vh calc(var(--rail) + 2.5vw); max-width: calc(1240px + var(--rail)); }
.colophon { margin-top: 8px; padding-top: 18px; border-top: 1px solid rgba(237,233,223,.14); max-width: 62em; }
.colophon .row { display: grid; grid-template-columns: 112px 1fr; gap: 14px; margin: 0 0 10px; align-items: baseline; }
.colophon .lab { font: 500 13px var(--mono); letter-spacing: .1em; color: var(--sand); }
.colophon .txt { font: 400 15px/1.5 var(--sans); color: var(--dim); }
.doors-static { margin-bottom: 36px; }
.doors[hidden] { display: none; }

/* the card drawings move gently, while on screen (.play) or when hovered */
@keyframes k-pulse { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }
@keyframes k-flow { 0% { transform: translateY(-14px); opacity: 0; } 20%, 80% { opacity: 1; } 100% { transform: translateY(14px); opacity: 0; } }
@keyframes k-rise { 0% { transform: translateY(14px); opacity: 0; } 20%, 80% { opacity: 1; } 100% { transform: translateY(-14px); opacity: 0; } }
@keyframes k-breathe { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(3px); } }
@keyframes k-march { to { stroke-dashoffset: -28; } }
@keyframes k-lift { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.anim-pulse { animation: k-pulse 2.4s ease-in-out infinite; }
.anim-flow { animation: k-flow 2.4s linear infinite; transform-box: fill-box; }
.anim-rise { animation: k-rise 2.4s linear infinite; transform-box: fill-box; }
.anim-breathe { animation: k-breathe 4s ease-in-out infinite; }
.anim-march { animation: k-march 1.6s linear infinite; }
.anim-lift { animation: k-lift 3.2s ease-in-out infinite; }
.art [class^="anim-"] { animation-play-state: paused; }
.final.on .art [class^="anim-"], .door:hover .art [class^="anim-"], .play .art [class^="anim-"] { animation-play-state: running; }
@media (prefers-reduced-motion: reduce) { .art [class^="anim-"] { animation: none !important; opacity: 1 !important; } }

.nojs { position: absolute; left: calc(var(--rail) + 2vw); top: 30vh; font-size: 20px; }
.nojs a { color: var(--jade-strong); }

/* stills: reduced motion and phones */
.story.is-static { height: auto; }
.story.is-static .stage { display: none; }
.stills { grid-template-columns: minmax(0, 1fr); padding: calc(var(--bar) + 24px) 5vw 40px calc(var(--rail) + 3vw); display: grid; gap: 64px; max-width: calc(1100px + var(--rail)); }
.still { margin: 0; min-width: 0; scroll-margin-top: calc(var(--bar) + 60px); }
.still .k { margin: 0 0 12px; font: 600 14px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--jade-strong); }
.still h2 { margin: 0 0 12px; font: 400 clamp(30px, 6vw, 44px)/1.1 var(--serif); }
.still > p { margin: 0 0 14px; font-size: clamp(17px, 4.4vw, 20px); line-height: 1.5; color: var(--muted); }
.still img, .still .art-still { display: block; width: 100%; border-radius: 10px; background: #0d0d0f; }
.still .go { display: inline-block; margin-top: 16px; color: var(--ink); text-decoration: none; font-size: 16px; border: 1px solid var(--rule); border-radius: 999px; padding: 9px 14px; }
.still .go b { color: var(--jade-strong); font-weight: 500; }
.still pre { margin: 0; padding: 14px 16px; background: #121216; border: 1px solid var(--rule); border-radius: 10px; font: 400 13px/1.55 var(--mono); color: var(--muted); overflow-x: auto; }

/* phones: the thin line on the edge, and a chip naming where you are */
@media (max-width: 760px) {
  :root { --rail: 24px; --bar: 56px; }
  .top { padding: 0 16px 0 24px; gap: 10px; }
  .brand { font-size: 14px; } .crumb { font-size: 14px; } .proto { display: none; }
  .rail-full { display: none; }
  .rail-edge { left: 2px; top: 64px; }
  /* the chip sits in the top bar, so it never covers text */
  .crumb { display: none; }
  #rail { z-index: 31; }
  .rail-chip { display: flex; position: fixed; z-index: 31; left: 118px; right: 12px; top: 8px; height: 40px; align-items: center;
    background: #141418; border: 1px solid rgba(143,208,188,.35); border-radius: 10px; padding: 0 12px; text-decoration: none; pointer-events: auto; }
  .rail-chip strong { color: var(--jade-strong); font-size: 15px; font-weight: 500; }
  .stills { padding-top: calc(var(--bar) + 24px); padding-right: 16px; }
  .chapters { padding: 24px 16px 60px calc(var(--rail) + 4px); }
  .doors { grid-template-columns: 1fr; }
  .colophon .row { grid-template-columns: 1fr; gap: 2px; }
}
@media (max-width: 1100px) and (min-width: 761px) { .doors-static { grid-template-columns: 1fr 1fr; } }

/* two worlds: atoms (things you could touch: warm) and bits (software and data: cool, with a blueprint grid) */
.world { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .5s ease; }
/* a soft pool of light behind the object, so the physical scenes aren't on flat black */
.w-atoms { background:
  radial-gradient(ellipse 42% 48% at 64% 52%, rgba(237, 222, 196, .16), rgba(237, 222, 196, 0) 70%),
  radial-gradient(ellipse 80% 70% at 62% 55%, rgba(200, 160, 105, .14), rgba(13, 13, 15, 0) 72%),
  linear-gradient(180deg, #131317 0%, #0d0d0f 60%, #0b0b0d 100%); }
.w-bits { background: radial-gradient(ellipse 85% 75% at 50% 50%, rgba(0,0,0,0) 50%, rgba(0,0,0,.5) 100%),
  linear-gradient(rgba(90, 175, 150, .13) 1px, transparent 1px) 0 0 / 120px 120px, linear-gradient(90deg, rgba(90, 175, 150, .13) 1px, transparent 1px) 0 0 / 120px 120px,
  linear-gradient(rgba(90, 175, 150, .07) 1px, transparent 1px) 0 0 / 24px 24px, linear-gradient(90deg, rgba(90, 175, 150, .07) 1px, transparent 1px) 0 0 / 24px 24px, #0a1110; }
.view[data-world="atoms"] .w-atoms, .view[data-world="bits"] .w-bits { opacity: 1; }
.view[data-world="atoms"] .caption .k { color: var(--sand); }
.view[data-world="bits"] .caption .k { color: var(--jade-strong); }
/* the crossing: the new world's texture sweeps across once */
.scan { position: absolute; inset: 0; opacity: 0; pointer-events: none; -webkit-mask: linear-gradient(90deg, transparent, #000 45%, #000 55%, transparent) no-repeat; -webkit-mask-size: 45% 100%; mask: linear-gradient(90deg, transparent, #000 45%, #000 55%, transparent) no-repeat; mask-size: 45% 100%; }
.scan[data-to="bits"] { background: linear-gradient(rgba(143, 208, 188, .35) 1px, transparent 1px) 0 0 / 24px 24px, linear-gradient(90deg, rgba(143, 208, 188, .35) 1px, transparent 1px) 0 0 / 24px 24px, rgba(90, 175, 150, .07); }
.scan[data-to="atoms"] { background: radial-gradient(ellipse at 50% 50%, rgba(217, 200, 160, .22), rgba(217, 200, 160, .04) 70%); }
.scan.go { animation: k-wipe .55s ease-in-out; }
@keyframes k-wipe { 0% { opacity: 1; -webkit-mask-position: -45% 0; mask-position: -45% 0; } 100% { opacity: 1; -webkit-mask-position: 145% 0; mask-position: 145% 0; } }
@media (prefers-reduced-motion: reduce) { .scan.go { animation: none; } .world { transition: none; } }

/* the count of passes: an instrument readout; each number is longer than the one before, like a zoom chain */
.passes { position: absolute; left: 2.5vw; right: 2vw; bottom: max(14px, 2vh); padding: 14px 22px 12px; opacity: 0; pointer-events: none;
  display: grid; grid-template-columns: auto 1fr; gap: 6px 22px; align-items: center;
  background: rgba(14, 22, 20, .86); border: 1px solid rgba(143, 208, 188, .24); border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.pass-stack { width: clamp(70px, 6vw, 92px); height: auto; overflow: visible; grid-row: 1; }

/* the chapter cards are not links yet */
.door:hover, .door:focus-visible { transform: none; border-color: rgba(237,233,223,.24); background: var(--card); box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.door .arrow { display: none; }
.leaders { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.leaders line { stroke: rgba(237,233,223,.65); stroke-width: 1.2; }
.leaders circle { fill: var(--jade-strong); }
.bw { position: absolute; left: 2.5vw; bottom: calc(max(14px, 2vh) + 196px); width: min(34em, 40vw); margin: 0; font: 400 14px/1.45 var(--mono); color: var(--muted); opacity: 0; pointer-events: none; }
body.at-end .rail-chip { display: none; }

/* the counter's extras: a log meter, a note, and the dimmed climax */
.passes { z-index: 4; }
/* the footer sits inside the pinned last screen */
.final-bottom { position: absolute; left: 1.8vw; right: 1.8vw; bottom: 18px; }
.final .doors { position: static; }
.final .colophon { max-width: none; margin-top: 12px; padding-top: 9px; }
.final .colophon .row { grid-template-columns: 92px 1fr; margin: 0 0 3px; gap: 12px; }
.final .colophon .lab { font-size: 12px; }
.final .colophon .txt { font-size: 13.5px; line-height: 1.4; }
.chapters[hidden] { display: none; }

.stills[hidden] { display: none; }

.passes { padding-bottom: 10px; }



/* the title screen's line; the "continue" chip */
.caption.title .p3 { margin: 16px 0 0; font: 400 var(--t-body)/1.5 var(--sans); color: var(--muted); }
.resume { display: flex; align-items: center; gap: 2px; margin-top: 16px; pointer-events: auto; }
.resume[hidden] { display: none; }
.resume .go { margin-top: 0; padding: 8px 14px; font-size: 15px; color: var(--jade-strong); border-color: rgba(143,208,188,.45); }
.resume button { font: 20px/1 var(--sans); color: var(--dim); background: none; border: 0; padding: 6px 10px; cursor: pointer; }
.resume button:hover { color: var(--ink); }
.caption .go.deeper { margin-top: 22px; }

/* transitions pass: the flat scenes layer in this order; the counter sits beside the GPU */
#harness { z-index: 2; }
.passes { right: 2vw; gap: 6px 18px; }

/* the memory callout: bigger, with a jade line to the lit stacks */
.tag-mem { font-size: clamp(16px, 1.25vw, 18px); padding: 9px 14px; line-height: 1.35; white-space: normal; width: max-content; max-width: 330px; background: rgba(13,13,15,.92); font-size: 16px; }
.tag-mem b { display: block; font-weight: 500; color: var(--ink); }
.tag-mem i { display: block; margin-top: 4px; font-size: 13px; font-style: italic; color: var(--muted); }
.leaders g.jade line { stroke: var(--jade-strong); stroke-width: 2; }
.leaders g.jade circle { r: 5px; }

/* the closing line: a serif sentence and a quieter sans one under it */
.final-line { width: min(30vw, 470px); font: 400 clamp(26px, 2.4vw, 38px)/1.15 var(--serif); font-style: normal; color: var(--ink); text-wrap: balance; }
.final-line b { display: block; font-weight: 400; }
.final-line span { display: block; margin-top: 14px; font: 400 clamp(16px, 1.2vw, 19px)/1.45 var(--sans); color: var(--muted); }

.proj { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; opacity: 0; }
.proj line { stroke: var(--jade-strong); stroke-width: 1; stroke-dasharray: 5 6; }
.final-line { width: min(32vw, 30em); } .final-line span { font-size: clamp(18px, 1.35vw, 20px); max-width: 30em; }
.tag-chips { border-color: rgba(143,208,188,.6); color: var(--jade-strong); }

/* the spacer label: small and muted */
.tag-thisgpu { border-color: rgba(143,208,188,.6); color: var(--jade-strong); }
.tag-spacer { font-size: 15px; color: var(--muted); border-color: rgba(237,233,223,.3); line-height: 1.35; }
.tag-spacer i { display: block; font-style: italic; color: var(--dim); }
.tag-server { transform: translate(-50%, 0); }
.tag-mem5 { font-size: 16px; border-color: rgba(143,208,188,.6); color: var(--jade-strong); background: rgba(13,13,15,.92); }

/* the counter: one multiplication, then a ladder of orders of magnitude */
.passes { grid-template-columns: auto 1fr; gap: 0 18px; padding: 12px 22px 10px; }
.pass-stack { width: clamp(46px, 4vw, 64px); height: auto; overflow: visible; grid-column: 1; grid-row: 1; align-self: center; }
.demo { grid-column: 1 / -1; grid-row: 1; width: 100%; height: auto; max-height: min(190px, 22vh); overflow: visible; align-self: center; }
.ladder { grid-column: 2; grid-row: 1; }
.ladder { display: grid; align-content: center; gap: 2px; min-height: min(184px, 21vh); }
.rung { display: flex; align-items: baseline; gap: 18px; opacity: 0; }
.rl { margin: 0; flex: 0 0 18.5em; white-space: nowrap; font: 400 clamp(13px, 1vw, 15px) var(--mono); letter-spacing: .04em; color: var(--sand); }
.rn { margin: 0; font: 500 clamp(24px, 2.1vw, 32px)/1.25 var(--mono); color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.r2 .rn { font-size: clamp(28px, 2.5vw, 38px); }
.r3 .rn { font-size: clamp(32px, 3vw, 46px); color: var(--jade-strong); transform-origin: left center; }
.rn .lo { filter: blur(var(--blur, 0px)); }
.pass-note { margin: 4px 0 0; font: 400 14.5px/1.4 var(--mono); color: var(--muted); }
.ladder-still { display: grid; gap: 6px; margin-top: 14px; padding: 14px 18px; background: rgba(14,22,20,.86); border: 1px solid rgba(143,208,188,.24); border-radius: 12px; }
.ladder-still .rung { opacity: 1; flex-wrap: wrap; gap: 4px 16px; }
.ladder-still .rl { flex-basis: 18.5em; }
@media (max-width: 760px) { .passes { grid-template-columns: 1fr; } .ladder { grid-column: 1; } .pass-stack { display: none; } }

/* the ladder is stacked (label over number) so the panel can be narrow and sit left of the big GPU */
.ladder { align-content: start; gap: 4px; min-height: 0; }
.rung { display: block; }
.rl { display: block; margin: 0; flex: none; }
.rn { display: block; }
.rn, .r2 .rn { font-size: clamp(24px, 2.1vw, 30px); }
.r3 .rn { font-size: clamp(30px, 2.8vw, 42px); }
.passes { height: clamp(190px, 24vh, 222px); box-sizing: border-box; }
.pass-stack { position: absolute; right: 22px; top: 18px; width: clamp(40px, 3.6vw, 52px); }
.ladder-still .rung { display: block; }

/* one hero number at a time; the earlier ones shrink into a trail above it */
.passes { height: auto; display: block; position: absolute; }
.demo { display: block; }
.ladder { position: absolute; inset: 12px 22px 10px; display: block; }
.trail { margin: 0; font: 400 15px/1.3 var(--mono); color: var(--dim); height: 20px; white-space: nowrap; }
.trail span { opacity: 0; }
.heroes { position: relative; margin-top: 8px; }
.rung { position: absolute; left: 0; top: 0; display: block; opacity: 0; }
.rn, .r2 .rn, .r3 .rn { font-size: clamp(40px, 3.6vw, 52px); line-height: 1.1; }
.r3 .rn { color: var(--jade-strong); }
.rl { margin: 4px 0 0; font: 400 clamp(14px, 1vw, 15px) var(--mono); letter-spacing: .05em; color: var(--sand); }
.ladder-still .rung { position: static; opacity: 1; display: block; }
.ladder-still .rn { font-size: clamp(26px, 5vw, 36px); }
.r3 .rl { white-space: normal; line-height: 1.35; }   /* the longer notes wrap to two lines */
.passes { box-sizing: border-box; }
.r3 .rn { font-size: min(clamp(26px, 2.4vw, 34px), calc((var(--pw, 2000px) - 48px) / 11)); }   /* 18 characters always fit the panel */


/* the map's frame: while the map zooms, its left part (the caption's column) fades out */
.isowrap { position: absolute; inset: 0; pointer-events: none; --cm: 0;
  /* two layers added together: only what is both left of the text column and above the caption's bottom fades */
  -webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,calc(1 - var(--cm))) calc(2.5vw + min(31vw, 540px) - 1vw), #000 calc(2.5vw + min(31vw, 540px) + 9vw)),
    linear-gradient(180deg, rgba(0,0,0,calc(1 - var(--cm))) calc(var(--capb, 45vh) - 10px), #000 calc(var(--capb, 45vh) + 70px));
  mask-image: linear-gradient(90deg, rgba(0,0,0,calc(1 - var(--cm))) calc(2.5vw + min(31vw, 540px) - 1vw), #000 calc(2.5vw + min(31vw, 540px) + 9vw)),
    linear-gradient(180deg, rgba(0,0,0,calc(1 - var(--cm))) calc(var(--capb, 45vh) - 10px), #000 calc(var(--capb, 45vh) + 70px)); }

/* phones: the real animation. A caption block on top, the scene under it (--ptop is where it starts), the counter as a card at the bottom */
@media (max-width: 760px) {
  :root { --rail: 0px; --bar: 56px; }
  html { -webkit-text-size-adjust: 100%; }
  .top { padding: 0 16px; }
  .rail-edge, #rail:hover .rail-full { display: none; }
  .scrim { background: linear-gradient(180deg, rgba(13,13,15,.92) 0%, rgba(13,13,15,.7) 30%, rgba(13,13,15,0) 44%); }

  .caption, .caption.title { left: 16px; right: 16px; width: auto; top: calc(var(--bar) + 10px); }
  .caption .k { margin: 0 0 6px; font-size: 11px; }
  .caption .h { font-size: clamp(22px, 6.7vw, 28px); line-height: 1.1; }
  .caption .p { margin: 8px 0 0; font-size: clamp(14px, 4vw, 16px); line-height: 1.42; }
  .caption .p2 { display: none; }
  .caption.title .h { font-size: clamp(30px, 9vw, 36px); line-height: 1; }
  .caption.title .p { margin-top: 10px; font-size: clamp(16px, 4.4vw, 18px); line-height: 1.36; }
  .caption.title .p3 { margin-top: 8px; font-size: 14px; line-height: 1.4; }
  .caption .go.deeper { margin-top: 12px; font-size: 14px; padding: 8px 14px; }
  .resume { margin-top: 10px; }

  /* the flat drawings fill the width under the caption */
  .iso { left: 0; right: 0; width: 100%; top: var(--ptop); bottom: auto; height: calc(100% - var(--ptop) - 8px); }
  .isowrap { -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,calc(1 - var(--cm))) calc(var(--ptop) - 20px), #000 calc(var(--ptop) + 40px));
    mask-image: linear-gradient(180deg, rgba(0,0,0,calc(1 - var(--cm))) calc(var(--ptop) - 20px), #000 calc(var(--ptop) + 40px)); }

  /* labels: smaller, only the main ones */
  .tag { font-size: 13px; padding: 4px 8px; }
  .tag-thisgpu, .tag-spacer, .tag-disks i, .tag-mem i { display: none; }
  .tag-mem, .tag-mem5, .tag-gpu, .tag-die, .tag-chips { font-size: 13px; padding: 5px 9px; }
  .tag-mem { max-width: 250px; }
  .flying span { font-size: 13px; padding: 3px 8px; }
  .leaders line { stroke-width: 1; }
  .bw { left: 16px; right: 16px; width: auto; bottom: 168px; font-size: 12px; }

  /* the counter: a card across the bottom */
  .passes { right: auto; bottom: 14px; padding: 10px 12px 8px; border-radius: 12px; }
  .ladder { inset: 10px 14px 8px; }
  .trail { font-size: 12.5px; height: 18px; }
  .heroes { margin-top: 4px; }
  .rn, .r2 .rn, .r3 .rn { font-size: clamp(22px, 8vw, 32px); }
  .rl { font-size: 12px; margin-top: 2px; }
  .demo { max-height: none; }

  /* the last screen: the closing line over the laptop; the cards and the footer follow in the page */
  .final-line { left: 16px; top: calc(var(--bar) + 12px); width: calc(100% - 32px); font-size: clamp(22px, 6.4vw, 26px); }
  .final-line span { margin-top: 8px; font-size: 15px; line-height: 1.4; max-width: none; }
  .final-bottom { display: none; }
  .chapters { padding: 28px 16px 56px; }
  .door p { font-size: 16px; }
}

/* the zoom into the feed-forward slab (drawn in view pixels) */
.zoom { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }

/* ---------- on the site: the site's own header replaces the prototype's top bar ---------- */
:root { --bar-h: 86px; }
#topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 30; display: flex;
          justify-content: space-between; align-items: center; padding: 15px 24px;
          min-height: var(--bar-h); box-sizing: border-box; --muted: #bcb8ae;
          background: color-mix(in srgb, var(--bg) 84%, transparent);
          -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
          border-bottom: 1px solid color-mix(in srgb, var(--jade) 14%, transparent); }
#brand { font-family: 'EB Garamond', Georgia, serif; font-size: 34px; color: var(--ink); text-decoration: none; }
#brand .slash { color: var(--jade); font-style: italic; font-size: 0.74em; position: relative; top: -0.075em;
                margin-left: 0.04em; margin-right: 0.05em; }
#brand .br { color: transparent; font-size: 0.62em; position: relative; top: -0.1em; }
#menu { display: flex; align-items: center; gap: 28px; }
#menu a { font-family: Geist, Inter, system-ui, sans-serif; font-size: 16px; font-weight: 500;
          letter-spacing: 0.005em; color: var(--muted); text-decoration: none;
          -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
#menu a:hover { color: var(--jade); }
.theme-btn { background: none; border: 1px solid color-mix(in srgb, var(--muted) 40%, transparent);
             color: var(--muted); border-radius: 99px; padding: 3px 10px; font: 10px Inter, sans-serif; cursor: pointer; }
.theme-btn svg { display: block; width: 15px; height: 15px; }
#brand, #menu a, .theme-btn { position: relative; }
#brand::after, #menu a::after, .theme-btn::after { content: ''; position: absolute; inset: -10px -8px; }
/* this page is dark only, so the theme button is hidden but keeps its place in the bar */
#theme-tog { visibility: hidden; }
:root { --bar: var(--bar-h); }
@media (max-width: 760px) {
  :root { --bar: var(--bar-h); }
  /* the site header has no room for the chapter chip; each caption names its chapter */
  .rail-chip { display: none !important; }
}
@media (max-width: 700px) {
  :root { --bar-h: 67px; }
  #topbar { padding: 13px 14px 13px 18px; align-items: center; }
  #brand { line-height: 1; font-size: 30px; display: inline-flex; align-items: center; transform: translateY(1px); }
  #brand::after, #menu a::after, .theme-btn::after { content: ''; position: absolute; inset: -8px -4px; }
  #menu a { padding: 8px 0; font-size: 16px; line-height: 1; display: inline-flex; align-items: center; }
  .theme-btn { padding: 6px; display: inline-flex; align-items: center; justify-content: center; }
}
