/* DiscoLoop scroll blog: one long dark page; the animations are pinned while their captions scroll */
:root {
  --bg: #0e1116;                 /* = the animations' background, so the videos sit seamlessly in the page */
  --blue: #4aa8ff;
  --amber: #ffb454;
  --purple: #c589e8;
  --green: #5ad19a;
  --edge: #c9d1dc;
  --mute: #8b98ad;
  --panel: #161b23;
  --line: #2a313c;
  --text: #ffffff;
  --chip-dis: #5a4630; --chip-co: #474b52; --chip-lp: #22486f;
  --track: #232a35;              /* empty probability bars */
  --bad: #5a4630;                /* border of the failed two-hop card */
  --mark: rgba(197, 137, 232, 0.28);
  --navbg: rgba(14, 17, 22, 0.78);
  --hair: rgba(255, 255, 255, 0.06);
  --fade: #9aa8bd;               /* bottom of the chapter-title gradient */
  --done: #56627a;               /* finished steps in the progress bar */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  --mono: Menlo, "SF Mono", Consolas, monospace;
  --nav-h: 52px;
  --cap-h: 176px;                /* caption area under a pinned animation */
  --hl: rgba(255, 180, 84, 0.2);   /* highlighter behind the sentence of the step on screen */
  --ink: #c9d1dc; --ink-on: #ffffff; /* paragraph text, and the sentence of the step on screen */
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }
html, body { margin: 0; background: var(--bg); }
body { color: var(--text); font-family: var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: inherit; }
.para a.cite { color: var(--blue); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
em { font-style: normal; color: var(--amber); }
.blue { color: var(--blue); } .purple { color: var(--purple); } .green { color: var(--green); } .mute { color: var(--mute); } .edge { color: var(--edge); }
sub, sup { line-height: 0; }
.ss { display: inline-flex; flex-direction: column; vertical-align: 0.4em; line-height: 1; margin: 0 0.05em 0 0.02em; }
.ss sup, .ss sub { font-size: 0.66em; line-height: 1.02; vertical-align: baseline; position: static; }
.tl { position: relative; display: inline-block; }
.tl::after { content: "~"; position: absolute; left: 0; right: 0; top: -0.6em; text-align: center; font-size: 0.85em; line-height: 1; }
.big { text-wrap: balance; }
.small { text-wrap: pretty; }

/* ---------------------------------------------------------------- name chips */
.name { display: inline-flex; }
.name span { padding: 0 0.06em; border-radius: 0.12em; }
.dis { background: var(--chip-dis); } .co { background: var(--chip-co); } .lp { background: var(--chip-lp); }

/* ---------------------------------------------------------------- nav */
#nav {
  position: fixed; inset: 0 0 auto 0; height: var(--nav-h); z-index: 50; display: flex; align-items: center; gap: 28px;
  padding: 0 28px; background: var(--navbg); backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px); border-bottom: 1px solid var(--hair);
}
#nav .brand { font-weight: 600; font-size: 17px; text-decoration: none; display: inline-flex; }
#nav .chapters { display: flex; gap: 22px; overflow-x: auto; scrollbar-width: none; font-size: 13px; }
#nav .chapters::-webkit-scrollbar { display: none; }
#nav .chapters a { color: var(--mute); text-decoration: none; white-space: nowrap; transition: color 0.2s; }
#nav .chapters a:hover, #nav .chapters a.on { color: var(--text); }
#nav .chapters a b { font-weight: 600; color: inherit; }
#nav .chapters a span { display: inline-block; max-width: 0; overflow: hidden; vertical-align: bottom; opacity: 0; transition: max-width 0.4s ease, opacity 0.3s ease, margin 0.4s ease; }
#nav .chapters a.on span, #nav .chapters a:hover span { max-width: 420px; opacity: 1; margin-left: 7px; }
@media (min-width: 1400px) {                 /* room for the whole table of contents */
  #nav .chapters { gap: 15px; font-size: 12px; }
  #nav .chapters a span { max-width: 420px; opacity: 1; margin-left: 5px; }
}
@media (min-width: 1400px) and (max-width: 1599px) { #nav .brand { display: none; } }
@media (min-width: 1600px) { #nav .chapters { gap: 20px; font-size: 12.5px; } }
#nav .bar { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; }
#nav .bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--blue), var(--purple), var(--amber)); }

#theme {
  margin-left: auto; flex: none; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line);
  background: transparent; color: var(--edge); display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
#theme:hover { color: var(--text); border-color: var(--mute); }
#theme svg { width: 17px; height: 17px; }
#theme .ic-sun { display: none; }
body.light #theme .ic-moon { display: none; }
body.light #theme .ic-sun { display: block; }

/* light mode: the deck's light palette (the dark colours with lightness mapped through a falling curve,
   hue kept); the animation videos go through the same mapping (#luma-invert in index.html) */
body.light {
  --bg: #ffffff; --text: #282828; --blue: #1e8ff7; --amber: #b95f00; --purple: #964ec0; --green: #14a260;
  --edge: #535c69; --mute: #6b7a93; --panel: #f3f9ff; --line: #e0e8f5;
  --chip-dis: #e7cfb4; --chip-co: #ced2db; --chip-lp: #b4e2ff; --track: #e5eefb; --bad: #efc187;
  --mark: rgba(150, 78, 192, 0.18); --navbg: rgba(255, 255, 255, 0.82); --hair: rgba(0, 0, 0, 0.08);
  --fade: #5b6678; --done: #a9b4c6; --hl: rgba(255, 166, 61, 0.34); --ink: #141a22; --ink-on: #141a22;
}
body.light .screen video { filter: url(#luma-invert); mix-blend-mode: darken; }
body.light .cot .model img { filter: invert(1); }
body.light .hop .bar i { background: var(--mute); }
body.light .hop .bar i.gold { background: var(--green); }
body.light .hop.bad .bar i.gold { background: var(--amber); }

/* ---------------------------------------------------------------- hero */
.hero { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 80px 24px; position: relative; }
.hero-in { transform: scale(calc(1 - 0.12 * var(--hp, 0))); opacity: calc(1 - var(--hp, 0)); will-change: transform, opacity; }
.hero .venue { font-size: 15px; letter-spacing: 4px; color: var(--mute); margin-bottom: 34px; }
.hero h1.title { font-size: clamp(64px, 13vw, 196px); font-weight: 700; letter-spacing: -0.02em; margin: 0; line-height: 1.05; }
.hero .sub { font-size: clamp(19px, 2.3vw, 32px); color: var(--edge); line-height: 1.35; margin: 34px 0 0; font-weight: 500; }
.hero .authors { margin: 46px auto 0; max-width: 900px; font-size: clamp(14px, 1.2vw, 17px); line-height: 1.7; color: var(--edge); }
.hero .affil { font-size: 14px; color: var(--mute); margin-top: 8px; }
.hero sup { font-size: 0.65em; }
.cue { position: absolute; bottom: 34px; left: 50%; transform: translateX(-50%); font-size: 12px; letter-spacing: 3px; text-transform: uppercase; color: var(--mute); display: flex; flex-direction: column; align-items: center; gap: 10px; opacity: calc(1 - 2 * var(--hp, 0)); }
.cue span { width: 1px; height: 38px; background: linear-gradient(var(--mute), transparent); animation: cue 1.8s ease-in-out infinite; }
@keyframes cue { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* ---------------------------------------------------------------- text blocks */
.rv { opacity: 0; transform: translateY(42px); transition: opacity 0.9s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1); transition-delay: var(--d, 0s); }
.rv.in { opacity: 1; transform: none; }
.anchor { height: 0; }
.statement { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 90px 24px; }
.statement .big, .question .big { hyphens: manual; }
.statement .big { font-size: clamp(30px, 4.3vw, 62px); font-weight: 600; line-height: 1.14; letter-spacing: -0.015em; max-width: 19em; margin: 0; }
.statement .small { font-size: clamp(17px, 1.35vw, 20px); line-height: 1.6; color: var(--mute); max-width: 720px; margin: 28px 0 0; }
.question { min-height: 100vh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 90px 24px; }
.question .big { font-size: clamp(40px, 6.6vw, 104px); font-weight: 700; line-height: 1.06; letter-spacing: -0.025em; max-width: 13em; margin: 0; }

/* ---------------------------------------------------------------- pinned animations */
.scrolly { position: relative; height: 100vh; }            /* every page is one screen */
/* a page: its paragraph, then the animation (as large as the room left allows) and its progress bar */
.stage { position: relative; height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: calc(var(--nav-h) + 26px) 32px 22px; gap: 22px; }
.stage { background: var(--bg); }            /* the backdrop the videos blend with */
.para { flex: none; width: min(100%, 900px); margin: 0; font-size: clamp(19px, 1.6vw, 28px); font-weight: 500; line-height: 1.5; letter-spacing: -0.006em; color: var(--ink); text-wrap: pretty; hyphens: manual; }
.para .pt { transition: color 0.4s ease, background-size 0.6s ease; background-image: linear-gradient(var(--hl), var(--hl)); background-repeat: no-repeat; background-position: 0 80%; background-size: 0% 0.5em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.para.steps .pt { cursor: pointer; }
.para .pt.on { color: var(--ink-on); background-size: 100% 0.5em; }
.para.steps .pt:not(.on):hover { text-decoration: underline dotted var(--mute); text-decoration-thickness: 2px; text-underline-offset: 0.22em; }
.fig { flex: none; min-width: 0; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.screen { position: relative; width: min(100%, 960px); aspect-ratio: 16 / 9; flex: none; cursor: pointer; }
.nw { white-space: nowrap; }
.caption { display: none; }                  /* the per-step captions now live in the paragraph */
/* wide screens: the paragraph beside the animation, like a figure with its text */
@media (min-width: 1100px) and (min-aspect-ratio: 13/10) {
  .stage { flex-direction: row; align-items: center; gap: clamp(32px, 3.4vw, 64px); padding: calc(var(--nav-h) + 16px) clamp(32px, 3.6vw, 72px) 18px; }
  .para { width: clamp(360px, 31vw, 560px); }
  .fig { flex: 1 1 0; height: 100%; }
}
/* no frame: the animation sits in the page. The browser's video colours differ slightly from the CSS
   background (GPU colour conversion), so blend: nothing in the animations is darker than their
   background, so "lighten" turns the video background into exactly the page colour and keeps the rest */
.screen video { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; mix-blend-mode: lighten; }
.screen video.front { opacity: 1; }
.prog { display: flex; gap: 5px; width: min(100%, 560px); flex: none; margin: -7px 0; }
/* each segment is a button with a taller hit area around the thin visible bar */
.prog .seg { flex: 1; height: 17px; padding: 0; border: 0; background: transparent; cursor: pointer; display: flex; align-items: center; }
.prog .seg i { display: block; width: 100%; height: 3px; border-radius: 2px; background: var(--line); transition: background 0.3s, height 0.15s; }
.prog .seg.done i { background: var(--done); }
.prog .seg.cur i { background: var(--edge); }
.prog .seg:hover i { height: 5px; background: var(--mute); }
.prog .seg.cur:hover i { background: var(--text); }
.prog .seg:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
/* autoplay: play / pause / play-again, in front of the progress segments */
.prog .auto { flex: none; width: 22px; height: 17px; padding: 0; margin-right: 4px; border: 0; background: transparent; color: var(--mute); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.prog .auto:hover { color: var(--text); }
.prog .auto svg { width: 14px; height: 14px; display: none; }
.prog .auto[data-state="pause"] .i-pause, .prog .auto[data-state="play"] .i-play, .prog .auto[data-state="again"] .i-again { display: block; }
.caption { position: relative; width: min(100%, 980px); height: var(--cap-h); flex: none; }
.cap { position: absolute; left: 0; right: 0; top: 0; text-align: center; opacity: 0; transform: translateY(14px); transition: opacity 0.45s ease, transform 0.45s ease; pointer-events: none; }
.cap.on { opacity: 1; transform: none; }
.cap .big { font-size: clamp(21px, 2.15vw, 33px); font-weight: 600; line-height: 1.22; letter-spacing: -0.01em; margin: 6px auto 0; max-width: 30em; }
.cap .small { font-size: clamp(15px, 1.1vw, 17.5px); line-height: 1.55; color: var(--mute); margin: 12px auto 0; max-width: 760px; }

/* html visuals drawn on a 1920x1080 canvas, scaled into the screen (the slide designs) */
.canvas { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; transform-origin: 0 0; transform: scale(var(--k, 0.5)); padding: 70px 130px; display: flex; flex-direction: column; justify-content: center; }
.canvas .fx { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s ease; }

/* GPT-6 Astra */
.qcard { background: var(--panel); border: 2px solid var(--line); border-radius: 18px; padding: 22px 32px; font-size: 36px; line-height: 1.35; margin: 0 0 26px; }
.qcard .instr { margin-top: 8px; font-size: 29px; color: var(--mute); }
.qcard .instr i { color: var(--edge); }
.cot { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 26px; }
.cot .col { background: var(--panel); border: 2px solid var(--line); border-radius: 18px; padding: 20px 26px; display: flex; flex-direction: column; transition: border-color 0.5s, box-shadow 0.5s; }
.cot .model { display: flex; align-items: center; gap: 14px; font-size: 31px; font-weight: 600; margin-bottom: 12px; }
.cot .model img { width: 46px; height: 46px; }
.cot .lab { font-size: 22px; color: var(--mute); letter-spacing: 1px; margin-bottom: 10px; }
.cot .text { font-family: var(--mono); font-size: 25px; line-height: 1.5; color: var(--edge); flex: 1; min-height: 300px; }
.cot mark { background: transparent; color: inherit; border-radius: 4px; padding: 0 2px; transition: background 0.5s, color 0.5s; }
.cot .verdict { margin-top: 12px; display: flex; justify-content: space-between; font-size: 26px; border-top: 2px solid var(--line); padding-top: 12px; }
.cot .verdict .k { color: var(--mute); }
.astra.g0 .qcard, .astra.g0 .cot { opacity: 1; transform: none; }
.astra.g1 .cot mark { background: var(--mark); color: var(--text); }
.astra.g2 .col.ast { border-color: var(--green); box-shadow: 0 0 0 1px var(--green) inset; }

/* Jev */
.hops { display: grid; gap: 22px; }
.hop { display: grid; grid-template-columns: 170px 1fr 520px 90px; align-items: center; column-gap: 40px; background: var(--panel); border: 2px solid var(--line); border-radius: 18px; padding: 22px 30px; }
.hop .tag { font-size: 27px; color: var(--mute); letter-spacing: 1px; }
.hop .qtext { font-size: 33px; line-height: 1.3; text-wrap: balance; }
.hop .bars { display: grid; grid-template-columns: 120px 1fr 80px; row-gap: 7px; column-gap: 16px; align-items: center; font-size: 26px; }
.hop .bar { height: 22px; background: var(--track); border-radius: 6px; overflow: hidden; }
.hop .bar i { display: block; height: 100%; width: 0; background: var(--edge); border-radius: 6px; transition: width 1s ease 0.2s; }
.hop .bar i.gold { background: var(--green); }
.hop.bad .bar i.gold { background: var(--amber); }
.hop .p { font-family: var(--mono); font-size: 25px; color: var(--edge); text-align: right; }
.hop .mark { font-size: 60px; text-align: center; }
.hop .note { grid-column: 2 / 5; font-size: 26px; color: var(--mute); margin-top: 8px; }
.hop.bad { border-color: var(--bad); }
.jhead { display: flex; align-items: center; gap: 28px; margin-bottom: 40px; }
.jhead img { width: 92px; height: 92px; border-radius: 50%; }
.jhead b { display: block; font-size: 58px; font-weight: 600; line-height: 1.1; }
.jhead span { display: block; font-size: 30px; color: var(--mute); margin-top: 6px; }
.jev.g0 .jhead, .jev.g0 .h1, .jev.g0 .h2, .jev.g1 .h3 { opacity: 1; transform: none; }
.jev.g0 .h1 .bar i, .jev.g0 .h2 .bar i, .jev.g1 .h3 .bar i { width: var(--p); }

/* results table */
.acc { width: 100%; border-collapse: collapse; font-size: 68px; }
.acc caption { text-align: left; font-size: 38px; color: var(--mute); padding-bottom: 26px; }
.acc th { font-family: var(--mono); font-weight: 400; font-size: 46px; color: var(--edge); padding: 16px 10px; border-bottom: 2px solid var(--edge); text-align: center; }
.acc th:first-child { text-align: left; }
.acc td { padding: 44px 10px; text-align: center; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.acc td:first-child { text-align: left; color: var(--mute); font-size: 48px; }
.acc td span.v { display: inline-block; padding: 4px 16px; border-radius: 12px; border: 4px solid transparent; transition: border-color 0.5s; }
.acc .tagline td { border: 0; padding-top: 16px; font-size: 40px; }
.acc .tagline .t { opacity: 0; transition: opacity 0.5s; }
.results.g0 .acc { opacity: 1; transform: none; }
.results.g1 .v.id { border-color: var(--amber); }
.results.g1 .t.id { opacity: 1; }
.results.g2 .v.ood { border-color: var(--purple); }
.results.g2 .t.ood { opacity: 1; }

/* takeaways */
.takeaways { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: calc(var(--nav-h) + 40px) max(24px, 8vw) 60px; }
.takeaways .item { display: grid; grid-template-columns: clamp(50px, 6vw, 90px) 1fr; gap: 10px; max-width: 1100px; width: 100%; margin: 0 auto 7vh; }
.takeaways .item:last-child { margin-bottom: 0; }
.takeaways .n { font-size: clamp(30px, 3.4vw, 52px); font-weight: 700; color: var(--mute); line-height: 1.15; }
.takeaways .big { font-size: clamp(28px, 3.5vw, 52px); font-weight: 600; line-height: 1.16; letter-spacing: -0.012em; margin: 0; }
.takeaways .small { font-size: clamp(17px, 1.35vw, 20px); line-height: 1.6; color: var(--mute); margin: 20px 0 0; max-width: 760px; }

/* ---------------------------------------------------------------- footer */
.foot { text-align: center; padding: 120px 24px 90px; border-top: 1px solid var(--line); color: var(--edge); font-size: 16px; line-height: 1.7; }
.foot .small-name { font-size: 34px; font-weight: 700; margin-bottom: 18px; }
.foot .mute a { color: var(--edge); }

/* ---------------------------------------------------------------- small screens */
@media (max-width: 760px) {
  :root { --cap-h: 214px; }
  .takeaways { padding-top: calc(var(--nav-h) + 24px); padding-bottom: 32px; }
  .takeaways .item { margin-bottom: 4vh; }
  .takeaways .big { font-size: 23px; }
  .takeaways .small { font-size: 15px; margin-top: 12px; }
  #nav { gap: 14px; padding: 0 14px; }
  #nav .chapters { gap: 11px; }
  .scrolly, .stage { height: auto; min-height: 100vh; }   /* a long paragraph makes the page taller, not the animation smaller */
  .stage { padding: calc(var(--nav-h) + 14px) 14px 14px; gap: 14px; }
  .para { width: 100%; font-size: 18px; line-height: 1.5; }
}
@media (max-height: 760px) and (min-width: 761px) {
  :root { --cap-h: 150px; }
  .cap .small { font-size: 15px; }
}
