/* the ∇ in running text and chart labels: one-glyph font drawn like the logo mark (outlined triangle, same proportions) */
@font-face { font-family: "NablaMark"; src: url("assets/nablamark.ttf") format("truetype"); unicode-range: U+2207; font-display: block; }
:root {
  --bg: #000;
  --ink: #f5f5f7;
  --ink2: #a1a1a6;
  --muted: #6e6e73;
  --line: #2a2a2d;
  --card: #111113;
  --bar: #3a3a3d;
  --accent: #2997ff;
  --pink: #ff6ec7;
  --green: #30d158;
  --red: #ff453a;
  --grad: linear-gradient(90deg, #2997ff 0%, #8f6bff 55%, #ff6ec7 100%);
  --maxw: 1000px;
  --nav: 48px;
  --g: clamp(18px, 2.2vw, 32px);   /* the lab site's page gutter */
  --display: "NablaMark", "Inter Tight", "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; background: var(--bg); }
html.locked { overflow: hidden; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.5 "NablaMark", "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
sup a { color: var(--muted); font-size: 0.62em; margin-left: 2px; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: 0.06em; }
.w { color: var(--ink); font-weight: 600; }
.x { color: var(--red); font-weight: 700; }
.ne { color: var(--accent); font-weight: 600; }
.nb { color: var(--accent); }
.fine svg.nab, .notes svg.nab, figcaption small svg.nab { color: currentColor; }
.fine .ne, .notes .ne, figcaption small .ne { color: inherit; font-weight: inherit; }
.nm { white-space: nowrap; }
svg.nab { width: 0.86em; height: 0.79em; color: var(--accent); vertical-align: -0.04em; margin-right: 0.03em; overflow: visible; }

/* nav: fixed, so the first scene pins from the very first pixel of scroll */
.topnav { position: fixed; top: 0; left: 0; right: 0; z-index: 30; height: var(--nav); display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--g); border-bottom: 1px solid #1d1d1f; }
.topnav::before { content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(0, 0, 0, 0.72);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); }
.brand { font-family: var(--display); font-weight: 700; font-size: 19px; color: var(--ink); display: flex; align-items: center; }
.brand:hover { text-decoration: none; }
.brandrow { display: flex; align-items: center; gap: 12px; }
.lab { font-family: "Archivo", "NablaMark", "Inter", sans-serif; font-weight: 600; font-stretch: 118%; letter-spacing: -0.01em; font-size: 13px; color: var(--ink2); transition: color 0.25s ease; }
.lab:hover { color: var(--ink); text-decoration: none; }
.bdiv { width: 1px; height: 18px; background: #48484a; }
.navright { display: flex; align-items: center; gap: 36px; height: 100%; }
.navlinks { display: flex; gap: 28px; align-items: center; font-size: 13px; line-height: 1; }
.navlinks a { color: var(--ink2); transition: color 0.25s ease; padding: 6px 0; }
.navlinks a:hover, .navlinks a.on { color: var(--ink); text-decoration: none; }
.navlinks a svg.nab { vertical-align: -0.06em; }
.navlinks .ne, .code-panel .ne { font-weight: inherit; }
.navcta { display: flex; align-items: center; gap: 10px; }
.pill { display: inline-flex; align-items: center; height: 28px; padding: 0 14px; border: 1px solid #48484a; border-radius: 980px; font: 500 13px/1 "NablaMark", "Inter", sans-serif; color: var(--ink) !important; cursor: pointer; transition: background 0.2s ease, border-color 0.2s ease; }
.pill:hover { text-decoration: none; border-color: #6e6e73; }
.pill.solid { background: var(--accent); border-color: var(--accent); }
.pill.soon { cursor: default; color: #a1a1a6 !important; border-color: #3a3a3c; }
.pill.soon:hover { border-color: #3a3a3c; }
.soon-cta { color: #a1a1a6; }
.pill.solid:hover, .code-menu.open .pill.solid { background: #3aa0ff; border-color: #3aa0ff; }
/* the Code dropdown: frosted like the nav; opens on hover, pins on click */
.code-menu { position: relative; display: flex; align-items: center; }
.code-panel { position: absolute; right: 0; top: calc(100% + 10px); min-width: 252px; padding: 6px; border-radius: 15px; background: rgba(22, 22, 24, 0.78);
  backdrop-filter: saturate(180%) blur(22px); -webkit-backdrop-filter: saturate(180%) blur(22px); border: 1px solid rgba(255, 255, 255, 0.12); box-shadow: 0 14px 44px rgba(0, 0, 0, 0.55);
  opacity: 0; transform: translateY(-6px); pointer-events: none; transition: opacity 0.15s ease, transform 0.15s ease; }
.code-menu.open .code-panel { opacity: 1; transform: none; pointer-events: auto; }
.code-panel a { display: block; padding: 9px 12px; border-radius: 10px; color: var(--ink); white-space: nowrap; }
.code-panel a:hover, .code-panel a:focus-visible { background: rgba(255, 255, 255, 0.07); text-decoration: none; outline: 0; }
.code-panel .t { display: block; font: 600 14px/1.3 "NablaMark", "Inter", sans-serif; }
.code-panel .d { display: block; font-size: 12px; color: var(--ink2); margin-top: 1px; }

/* pinned scenes: a tall container with a sticky full-height screen inside */
.scene { position: relative; }
.scene-inner { position: sticky; top: 0; height: 100vh; overflow: hidden; display: flex; flex-direction: column;
  padding: calc(var(--nav) + 18px) 22px 18px; max-width: calc(var(--maxw) + 44px); margin: 0 auto; }
.hero { height: 360vh; }
.results { height: 560vh; }
.bridge { height: 300vh; }
.equiv { height: 260vh; }
.stall, .stable, .bwd { height: 100vh; }   /* these pin by locking the page while they play */

/* hero */
.hero .scene-inner { align-items: center; justify-content: center; text-align: center; max-width: none; }
.hero-line { position: relative; width: 100%; height: 1.25em; margin: 0; font-family: var(--display); font-size: clamp(40px, 8vw, 104px);
  font-weight: 800; line-height: 1.25; letter-spacing: -0.04em; white-space: nowrap; }
.hero-line .w { position: absolute; top: 0; left: 50%; display: block; white-space: nowrap; opacity: 0;
  transition: transform 0.3s cubic-bezier(.25,.8,.25,1), opacity 0.25s ease; will-change: transform, opacity; }
.hero-line .w-slot { position: absolute; }
.hero-line .v { position: absolute; left: 0; top: 0; white-space: nowrap; opacity: 0; transform: translateY(0.12em);
  transition: opacity 0.25s ease, transform 0.3s cubic-bezier(.25,.8,.25,1); pointer-events: none; }
.hero-line .v.on { opacity: 1; transform: none; }
.hero-line .v-nabla { color: var(--accent); }
.hero-line .v-grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: 0.08em; }
.hero-line svg.nab { width: 0.9em; height: 0.83em; margin: 0; vertical-align: -0.03em; }
.sub { font-size: clamp(17px, 2vw, 24px); color: var(--ink2); margin: 26px 0 0; max-width: 760px; opacity: 0; }

/* section scaffolding and the two heading tiers: big white claims, smaller white subheads */
.sec { max-width: var(--maxw); margin: 0 auto; padding: 150px 22px 0; }
.sec.after-scene { padding-top: 70px; }
.claim { font-family: var(--display); font-size: clamp(40px, 6.2vw, 78px); font-weight: 800; line-height: 1.06; letter-spacing: -0.035em; margin: 0 0 24px; }
.claim.spaced { margin-top: 150px; }
.claim.mid { font-size: clamp(34px, 5vw, 60px); margin-bottom: 14px; }
.subhead { font-family: var(--display); font-size: clamp(22px, 2.6vw, 30px); font-weight: 700; color: var(--ink); letter-spacing: -0.015em; margin: 0 0 22px; }
.subhead.spaced { margin-top: 110px; }
.subhead.thin { font-weight: 600; font-size: clamp(18px, 2vw, 22px); color: var(--ink); margin-bottom: 10px; }
.lede { font-size: clamp(18px, 2vw, 22px); color: var(--ink2); max-width: 780px; margin: 0 0 44px; }
.lede.mid { margin-bottom: 10px; font-size: clamp(16px, 1.7vw, 19px); }
.against { font-size: 16px; color: var(--ink2); margin: 0 0 24px; max-width: 820px; }
.against strong { color: var(--ink); font-weight: 600; }
.fine { font-size: 13px; color: var(--muted); margin: 18px 0 0; max-width: 820px; }
.cta { margin-top: 30px; font-size: 19px; }
.slow { font-family: "Comic Sans MS", "Comic Neue", cursive; font-weight: 700; font-size: 0.92em; letter-spacing: 0; color: var(--ink2); }

.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.8s ease, transform 0.8s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }

/* results scene: it overlaps the hero's last screen and fades in where the hero fades out */
.results { margin-top: -100vh; z-index: 2; }
.results .scene-inner { width: 100%; background: var(--bg); opacity: 0; }
.res-chart { flex: 1 1 auto; min-height: 0; position: relative; }
.res-chart svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; }
.res-lower { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: start; margin-top: 14px; flex: 0 0 auto; }
.res-claim { font-size: clamp(34px, min(4.4vw, 6.2vh), 60px); margin: 0 0 10px; }
.stage-tag { font-size: 14px; color: var(--ink2); margin: 0 0 6px; min-height: 21px; transition: opacity 0.3s; }
.mx { font-family: var(--display); font-size: clamp(40px, min(5.4vw, 7vh), 72px); font-weight: 800; letter-spacing: -0.04em; line-height: 1; margin: 0; }
.mx-sub { font-size: 15px; color: var(--ink2); margin: 6px 0 0; max-width: 420px; }
#mx { min-height: 1em; white-space: nowrap; }
#mx-sub { min-height: 1.5em; white-space: nowrap; max-width: none; }
.mx-min { font-family: var(--display); font-size: clamp(22px, 2.6vw, 30px); font-weight: 700; color: var(--ink); letter-spacing: -0.02em; margin: 4px 0 0; }
#mx-min { font-size: clamp(17px, min(1.6vw, 2.5vh), 19px); margin-top: 8px; min-height: 1.3em; white-space: nowrap; }
.mx-note { font-size: 13px; color: var(--muted); margin: 2px 0 6px; }
/* throughput line under the NablaEngine bar */
.tp { margin: 14px 0 0; }
.tpline { margin: 0; font-size: clamp(16px, 1.4vw, 19px); color: var(--ink2); white-space: nowrap; opacity: 0; transition: opacity 0.5s ease 1.1s; }
.tpline b { font-weight: 700; color: var(--ink); font-size: 1.12em; letter-spacing: -0.01em; }
.bars.in .tpline { opacity: 1; }
.bars.fast.in .tpline { transition-delay: 0.45s; }
.bars.nofx .tpline { transition: none !important; }
.chart-note { margin: 0 0 18px; }
.sub2 { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 4px; }
.sub2 + .sbars { margin-bottom: 12px; }
.sbars { position: relative; height: calc(var(--n, 3) * 30px); }
.sbars .brow { position: absolute; left: 0; right: 0; top: calc(var(--i, 0) * 30px); padding: 0; height: 30px; grid-template-columns: 292px 1fr; gap: 14px; }
.sbars .brow .name { white-space: nowrap; }
.sbars .brow .na { top: 5px; font-size: 13px; transition: opacity 0.4s ease; }
.sbars .brow.none .fill, .sbars .brow.none .val { opacity: 0 !important; }
.sbars .brow:not(.none) .na { opacity: 0; }
.sbars .brow .lane { height: 30px; }
.sbars .brow .fill { top: 8px; height: 14px; border-radius: 7px; transition: width 0.7s cubic-bezier(.2,.7,.2,1); }
.sbars .brow .val { top: 4px; font-size: 14px; transition: left 0.7s cubic-bezier(.2,.7,.2,1), opacity 0.4s ease; }
.sbars .brow .name { font-size: 13px; }
.sbars .brow.none .name { color: var(--ink2); }
.sbars .brow.ours.none .name { color: var(--ink); }
.res-foot { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin-top: 8px; }
.res-foot .stages { white-space: nowrap; }
.res-foot .fine { margin: 0; font-size: 11.5px; max-width: none; }
.chart svg line.lead { transition: opacity 0.3s ease; }
.stages { display: inline-flex; gap: 4px; background: #1d1d1f; padding: 4px; border-radius: 980px; }
.stages button { background: none; border: 0; color: var(--ink2); font: 500 12px "NablaMark", "Inter", sans-serif; padding: 6px 12px; border-radius: 980px; cursor: pointer; white-space: nowrap; transition: background 0.3s, color 0.3s; }
.stages button[aria-selected="true"] { background: #f5f5f7; color: #000; }
.res-chart .mv { transition: transform 0.7s cubic-bezier(.2,.7,.2,1), opacity 0.4s ease; }
.res-chart .mark { transition: opacity 0.4s ease; }
.res-chart .mark text { transition: opacity 0.4s ease; }
.res-chart text.mk { font-size: 12px; font-weight: 600; }
.res-chart .mark .nm { font-weight: 700; }
.res-chart text.lbl { transition: opacity 0.3s ease; }
.res-legend { display: flex; flex-direction: column; gap: 4px; margin: 0 0 10px; font-size: 13px; line-height: 1.3; color: var(--ink2); }
.res-legend .lk { display: inline-flex; align-items: center; gap: 7px; opacity: 0.28; transition: opacity 0.4s ease; }
.res-legend .lk.on { opacity: 1; }
.res-legend .lk i { width: 18px; border-top: 2.5px solid var(--c); }
.res-legend .lk.dash i { border-top-style: dashed; }
.res-legend .ne { color: var(--accent); }
.res-legend b { font-weight: 600; color: var(--ink); }

/* bars: slowest on top, ours at the bottom; values always just past the bar end */
.bhead { margin: 0 0 18px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink2); margin: 0 0 6px; }
.bhead .mx { font-size: clamp(44px, 5.4vw, 72px); }
.brow { display: grid; grid-template-columns: minmax(140px, 290px) 1fr; gap: 20px; align-items: center; padding: 8px 0; }
.brow .name { font-size: 16px; color: var(--ink2); line-height: 1.3; }
.brow.ours .name { color: var(--ink); font-weight: 600; }
.brow.ref .name { color: var(--muted); font-style: italic; }
.brow .lane { position: relative; height: 30px; }
.brow .fill { position: absolute; left: 0; top: 6px; height: 18px; width: 0; border-radius: 9px; background: var(--bar);
  transition: width 1s cubic-bezier(.2,.7,.2,1); }
.brow.ours .fill { background: var(--grad); }
.brow.ref .fill { background: none; border: 1px dashed #5a5a5e; }
.brow .val { position: absolute; top: 3px; font-size: 16px; color: var(--ink2); white-space: nowrap; opacity: 0; transition: opacity 0.4s ease;
  font-variant-numeric: tabular-nums; }
.brow.ours .val { color: var(--ink); font-weight: 600; }
.brow .na { position: absolute; top: 3px; left: 0; font-size: 14px; color: var(--muted); font-style: italic; white-space: nowrap; }
.brow.none .name { color: var(--muted); }
.bars.in .brow .fill, .sbars.in .brow .fill { width: var(--w); transition-delay: calc(0.4s + var(--i) * 0.22s); }
.bars.in .brow .val, .sbars.in .brow .val { opacity: 1; transition-delay: calc(0.5s + var(--i) * 0.22s); }
.sbars.in.live .brow .fill, .sbars.in.live .brow .val { transition-delay: 0s; }
/* GPU switches: quick grow-in for a card seen for the first time, no replay afterwards */
.bars.fast .brow .fill { transition-duration: 0.45s; }
.bars.fast.in .brow .fill { transition-delay: calc(var(--i) * 0.04s); }
.bars.fast.in .brow .val { transition-delay: calc(0.1s + var(--i) * 0.04s); }
.bars.nofx .brow .fill, .bars.nofx .brow .val, .bars.nofx .seg, .bars.nofx .seglbl { transition: none !important; }
.grad-tabs { margin: 0 0 18px; }
/* the gradient-step bars split into forward and backward parts */
.bwd .brow.has-split .lane, .bwd .brow.other .lane { height: 62px; }
.bwd .brow .fill, .bwd .brow .val { transition: width 0.6s cubic-bezier(.2,.7,.2,1), opacity 0.35s ease; }
.bwd .seg { position: absolute; top: 6px; height: 18px; left: var(--l); width: var(--w); -webkit-mask-size: 240% 100%; mask-size: 240% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  transition: -webkit-mask-position 0.45s cubic-bezier(.4,.1,.2,1), mask-position 0.45s cubic-bezier(.4,.1,.2,1); }
.bwd .seg.fwd { background: var(--accent); border-radius: 9px 0 0 9px; -webkit-mask-image: linear-gradient(90deg, #000 50%, transparent 60%); mask-image: linear-gradient(90deg, #000 50%, transparent 60%); -webkit-mask-position: 100% 0; mask-position: 100% 0; }
.bwd .seg.bwd { background: var(--pink); border-radius: 0 9px 9px 0; -webkit-mask-image: linear-gradient(90deg, transparent 40%, #000 50%); mask-image: linear-gradient(90deg, transparent 40%, #000 50%); -webkit-mask-position: 0 0; mask-position: 0 0; }
.bwd .seglbl { position: absolute; left: 0; top: 30px; font-size: 12.5px; color: var(--ink2); white-space: nowrap; opacity: 0; transition: opacity 0.35s ease 0.4s; }
.bwd .seglbl.b { top: 46px; }
.bwd .seglbl.n { top: 30px; color: var(--muted); }
.bwd .seglbl i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 7px; vertical-align: -1px; }
.bwd .seglbl.f i { background: var(--accent); } .bwd .seglbl.b i { background: var(--pink); }
.bwd .bars.split .brow.has-split .fill { opacity: 0.35; }
.bwd .bars.split .seg.fwd { -webkit-mask-position: 0 0; mask-position: 0 0; }
.bwd .bars.split .seg.bwd { -webkit-mask-position: 100% 0; mask-position: 100% 0; }
.bwd .bars.split .seglbl { opacity: 1; }
.bwd .scene-inner { justify-content: center; }
.bwd .claim { margin-bottom: 8px; }
.bwd .eyebrow { margin-bottom: 10px; }
.bwd .claim + .claim { margin-bottom: 0; }
.bwd .tabs { margin: 18px 0 20px; align-self: flex-start; }
.bwd .brow { padding: 5px 0; }

/* line charts */
.line svg { width: 100%; height: auto; display: block; overflow: visible; }
.line.grow { flex: 1 1 auto; min-height: 0; position: relative; }
.line.grow svg { position: absolute; inset: 0; height: 100%; }
.chart svg text { fill: var(--muted); font-size: 12px; font-family: "NablaMark", "Inter", sans-serif; }
.chart svg .axis { stroke: #3a3a3d; stroke-width: 1; }
.chart svg .grid { stroke: #1a1a1c; stroke-width: 1; }
.chart svg text.lbl { fill: var(--ink2); font-size: 13px; font-weight: 500; }
.chart svg text.lbl.ours { font-weight: 700; }
.chart svg text.lg { fill: var(--ink2); font-size: 12px; }
.chart svg text.ttl { fill: var(--ink2); font-size: 13px; font-weight: 500; }
.chart svg text.thr { fill: var(--ink2); font-size: 12px; font-weight: 500; }
.chart svg path.c { fill: none; stroke-linejoin: round; stroke-linecap: round; }
.line path.draw { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); transition: stroke-dashoffset 2.2s cubic-bezier(.3,.6,.2,1); }
.line.in path.draw { stroke-dashoffset: 0; }
.stall .lbl, .stall .ring { transition: opacity 0.3s ease; }
.stable .eb { opacity: 0; transition: opacity 0.5s ease; }
.stable .on .eb { opacity: 1; }
.stable text.ebl { fill: var(--ink); font-size: 12px; font-weight: 600; }

/* bridge: three layers held in place */
.bridge .scene-inner { justify-content: center; }
.layer { position: absolute; left: 22px; right: 22px; top: 50%; transform: translateY(-50%); opacity: 0; }
.layer.l1, .layer.l2 { text-align: center; }
.layer.l1 .claim { margin: 0; }
.layer.l1 .subhead { margin: 28px 0; color: var(--ink); }
.layer.l2 .intro-sub { margin: 28px auto 0; opacity: 0; }
.intro-title { font-family: var(--display); font-size: clamp(44px, 7vw, 96px); font-weight: 800; letter-spacing: -0.04em; margin: 0; line-height: 1.1; }
.sweep { --sx: -60%; color: transparent; -webkit-background-clip: text; background-clip: text; padding-bottom: 0.06em;
  background-image: linear-gradient(105deg, rgba(255,255,255,0) 42%, rgba(255,255,255,0.95) 50%, rgba(255,255,255,0) 58%), var(--grad);
  background-size: 180% 100%, 100% 100%; background-repeat: no-repeat; background-position: var(--sx) 0, 0 0; }
.layer.l3 { top: calc(var(--nav) + 26px); bottom: 10px; transform: none; display: flex; flex-direction: column; justify-content: center; }
.layer.l3 .subhead { margin: 18px 0 12px; font-size: clamp(19px, 2.2vw, 24px); }
.layer.l3 #fwd-head .bhead { margin-bottom: 0; }
.layer.l3 .tabs { margin-bottom: 16px; align-self: flex-start; }
.layer.l3 .brow { padding: 4px 0; grid-template-columns: minmax(140px, 330px) 1fr; }
.layer.l3 .bhead { margin-bottom: 10px; }
.layer.l3 .bhead .mx { font-size: clamp(40px, 6.6vh, 72px); }
.layer.l3 .fine { margin-top: 14px; }
@media (max-height: 820px) {   /* short laptop screens: a slightly tighter speed-chart screen, so the title stays under the nav */
  .layer.l3 { top: calc(var(--nav) + 14px); }
  .layer.l3 .brow { padding: 2px 0; }
  .layer.l3 .bhead .mx { font-size: clamp(34px, 6vh, 56px); }
  .layer.l3 .subhead { margin-bottom: 8px; }
  .layer.l3 .tabs { margin-bottom: 10px; }
  .layer.l3 .fine { font-size: 11.5px; margin-top: 8px; }
}
/* the bridge after its one play: a static stack */
/* finished pinned scenes: one static screen that scrolls like normal content */
.results.done, .equiv.done { height: auto; }
.results.done .scene-inner, .equiv.done .scene-inner { position: static; opacity: 1; }
.bridge.done { height: auto; }
.bridge.done .scene-inner { position: static; height: auto; overflow: visible; padding-bottom: 30px; }
.bridge.done .layer { position: static; transform: none !important; opacity: 1 !important; display: block; }
.bridge.done .layer.l1 { padding-top: 30px; }
.bridge.done .layer.l2 { margin: 130px 0; }
.bridge.done .layer.l2 .intro-sub { opacity: 1 !important; }

.tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; background: #1d1d1f; padding: 4px; border-radius: 980px; }
.tabs button { background: none; border: 0; color: var(--ink2); font: 500 14px "NablaMark", "Inter", sans-serif; padding: 8px 16px; border-radius: 980px; cursor: pointer; }
.tabs button[aria-selected="true"] { background: #f5f5f7; color: #000; }
.hw { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin: 0 0 24px; }

.feat { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 90px; }
.feat > div { background: var(--card); border-radius: 22px; padding: 22px 24px; }
.feat h4 { font-size: 17px; font-weight: 600; margin: 0 0 6px; }
.feat p { margin: 0; font-size: 14px; color: var(--ink2); }
.feat .soon { background: none; border: 1px dashed #3a3a3d; }
.feat .soon h4 { color: var(--ink2); }
.feat .soon p { color: var(--muted); }
.feat .soon-tag { font-weight: 500; color: var(--muted); }
.noise { display: grid; gap: 20px; grid-template-columns: 1fr 1fr; }
.noise > div, .trio > div { background: var(--card); border-radius: 26px; padding: 30px 28px; }
.k { font-family: var(--display); font-size: 40px; font-weight: 800; letter-spacing: -0.03em; margin: 0 0 8px; }
.cap { margin: 0; font-size: 16px; color: var(--ink2); }
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 10px; }
.trio h4 { font-size: 18px; font-weight: 600; margin: 0 0 8px; }
.trio p { margin: 0; font-size: 15px; color: var(--ink2); }
pre { background: var(--card); color: var(--ink2); border-radius: 18px; padding: 22px 24px; font-size: 13.5px; overflow-x: auto; }
pre.code { color: var(--ink); font-size: 14px; line-height: 1.7; }
pre .kw { color: #ff7ab2; } pre .cm { color: var(--muted); }
.videos { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.videos.three { grid-template-columns: repeat(3, 1fr); }
.videos.four { grid-template-columns: 1fr 1fr; }
.videos figure[hidden] { display: none; }
.videos figure { margin: 0; }
.videos video { width: 100%; display: block; border-radius: 20px; background: var(--card); aspect-ratio: 16 / 9; }
.videos figcaption { font-size: 14px; color: var(--ink2); margin-top: 8px; }
.videos figcaption small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
/* the falls cards under the results scene */
.noise.four { grid-template-columns: repeat(4, 1fr); gap: 16px; }
.noise.four > div { padding: 26px 22px; }
.noise.four .cap { font-size: 14px; }
.falls-sec .noise.four .cap { font-family: var(--display); font-size: 19px; font-weight: 800; color: var(--ink);
  letter-spacing: -0.01em; }
.falls-sec .noise.four .cap small { display: block; font-family: inherit; font-size: 13px; font-weight: 500;
  color: var(--ink2); letter-spacing: 0; margin-top: 2px; }
.falls-len { margin-top: -6px; }
.k .of { font-size: 0.55em; font-weight: 700; color: var(--ink2); margin-left: 2px; }
.k .zero { color: var(--accent); }
.falls-sec { padding-top: 90px; }
.falls-sec .fine { margin-top: 16px; }
.scaling { padding: 150px 22px 90px; text-align: center; }
.montage { position: relative; aspect-ratio: 16 / 9; max-width: 820px; margin: 0 auto 48px; border-radius: 20px; overflow: hidden; background: var(--card); }
.montage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.3s ease; }
.montage video.on { opacity: 1; }
.scaling .claim { margin: 0 auto 18px; }
.scaling .lede { margin: 0 auto 54px; max-width: none; }
.scaling .scaling-sub { font-weight: 600; color: var(--ink2); margin: 0 auto; max-width: 760px; }
.compare-tabs { margin: 0 0 24px; }
details { border-bottom: 1px solid var(--line); padding: 20px 0; }
summary { font-size: 19px; font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--ink2); font-weight: 400; }
details[open] summary::after { content: "−"; }
details p { font-size: 16px; color: var(--ink2); max-width: 820px; margin: 12px 0 0; }
.title-cite { font-family: var(--display); font-size: 26px; font-weight: 700; margin: 0 0 8px; }
.authors { margin: 0; font-size: 17px; }
.affil { margin: 2px 0 22px; font-size: 15px; color: var(--ink2); }
.notes { max-width: var(--maxw); margin: 150px auto 0; padding: 26px 22px 60px; border-top: 1px solid var(--line); }
.notes ol { padding-left: 18px; margin: 0; }
.notes li { font-size: 12px; color: var(--muted); margin-bottom: 8px; line-height: 1.5; }
.legal { font-size: 12px; color: var(--muted); margin-top: 18px; }

/* equivalence scene */
.equiv .claim { margin-bottom: 0; font-size: clamp(34px, 5vw, 60px); }
.eq-but { opacity: 0; transition: opacity 0.4s ease; }
.equiv .subhead.thin { margin-top: 14px; }

/* feature matrix: plain glyphs, no text cursor, no hover */
.matrix { overflow-x: auto; border-top: 1px solid var(--line); }
.matrix table { border-collapse: collapse; width: 100%; min-width: 760px; font-size: 14px; }
.matrix th, .matrix td { padding: 12px 8px; border-bottom: 1px solid var(--line); text-align: center; color: var(--ink2); }
.matrix th { font-size: 12px; font-weight: 600; color: var(--muted); vertical-align: bottom; line-height: 1.3; }
.matrix th:first-child, .matrix td:first-child { text-align: left; color: var(--ink); font-weight: 500; padding-left: 0; min-width: 190px; }
.matrix { pointer-events: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.matrix td { font-size: 18px; }
/* no visual change on hover, whatever the browser: hover states repeat the resting styles */
.matrix tr:hover, .matrix tr:hover td, .matrix td:hover, .matrix th:hover { background: transparent; color: var(--ink2); outline: 0; box-shadow: none; }
.matrix tr:hover td:first-child, .matrix td:first-child:hover { color: var(--ink); }
.matrix tr:hover td.y, .matrix td.y:hover { color: var(--green); }
.matrix tr:hover td.p, .matrix td.p:hover { color: var(--ink); }
.matrix tr:hover td.n, .matrix td.n:hover { color: var(--muted); }
.matrix tr:hover td.ours, .matrix td.ours:hover { background: rgba(41, 151, 255, 0.08); }
.matrix td.y, .mk.y { color: var(--green); }
.matrix td.p, .mk.p { color: var(--ink); font-size: 20px; }
.matrix td.n { color: var(--muted); }
.matrix .ours { background: rgba(41, 151, 255, 0.08); }
.matrix th.ours { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 700; font-size: 13px; }
.matrix td.ours { background: rgba(41, 151, 255, 0.08); }
.mk { color: var(--ink2); font-weight: 600; }

/* static mode: reduced motion or narrow screens; pinned scenes become stacked, final states shown */
body.static .scene { height: auto; margin-top: 0; }
body.static .scene-inner { position: static; height: auto; overflow: visible; padding-top: 110px; padding-bottom: 0; opacity: 1; }
body.static .hero .scene-inner { min-height: 0; padding: 70px 22px 10px; }
body.static .results .scene-inner { padding-top: 70px; }
body.static:not(.manim) .hero-line { position: static; height: auto; white-space: normal; line-height: 1.1; }
body.static:not(.manim) .hero-line .w { position: static; display: inline; opacity: 1 !important; transform: none; }
body.static:not(.manim) .hero-line .w-slot { display: inline-block; position: relative; left: auto; width: auto !important; }
body.static:not(.manim) .hero-line .v { position: static; display: none; }
body.static:not(.manim) .hero-line .v-grad { display: inline; opacity: 1; transform: none; }
body.static:not(.manim) .hero-line .w-mimic { display: none; }
body.static:not(.manim) .hero-line .w-the { margin-right: 0.2em; } body.static:not(.manim) .hero-line .w-tail { margin-left: 0.2em; }
body.static:not(.manim) .sub { opacity: 1; }
body.static .res-chart { height: auto; }
body.static .res-chart svg, body.static .line.grow svg { position: static; height: auto; }
body.static .layer { position: static; transform: none; opacity: 1 !important; }
body.static .layer.l2 { margin: 120px 0; }
body.static:not(.manim) .layer.l2 .intro-sub { opacity: 1; }
body.static:not(.manim) .sweep { --sx: 200%; }
body.static:not(.manim) .reveal { opacity: 1; transform: none; transition: none; }
body.static:not(.manim) .eq-but { opacity: 1; }
body.static:not(.manim) .stable .eb { opacity: 1; }
/* phones with motion: the static stack, but the opening and each chart play once when they come into view (no pinning, no scrubbing) */
body.manim .hero .scene-inner { min-height: calc(100svh - 40px); justify-content: center; padding: var(--nav) 22px 24px; }
body.manim .hero-line { height: 2.5em; font-size: clamp(34px, 10.5vw, 46px); transform: translateY(0.625em); transition: transform 0.45s cubic-bezier(.25,.8,.25,1); }
body.manim .hero-line.two { transform: none; }
body.manim .hero-line .w-tail { top: 1.25em; }
body.manim .sub { margin-top: 18px; transition: opacity 0.8s ease; }
body.manim .sub.in { opacity: 1; }
body.manim .reveal { transform: translateY(18px); transition-duration: 0.7s; }
body.manim .reveal.in { transform: none; }

@media (max-width: 760px) {
  .navlinks { display: none; }
  .navright { gap: 0; }
  .code-panel { right: -4px; min-width: 232px; }
  .sec { padding-top: 110px; }
  .claim.spaced { margin-top: 100px; }
  .brow, .layer.l3 .brow, .sbars .brow { grid-template-columns: 1fr; gap: 2px; padding: 6px 0; }
  .brow .name { font-size: 14px; }
  .tpline { white-space: normal; }
  .trio, .videos, .noise, .noise.four, .feat { grid-template-columns: 1fr; }
  .res-lower { grid-template-columns: 1fr; gap: 24px; margin-top: 24px; }
  .res-foot { gap: 14px; margin-top: 20px; }
  .sbars { height: calc(var(--n, 3) * 46px); }
  .sbars .brow { height: 46px; top: calc(var(--i, 0) * 46px); grid-template-columns: 1fr; }
  .sbars .brow .name { white-space: normal; }
  .videos.three, .videos.four { grid-template-columns: 1fr; }
  .sbars .brow .name { font-size: 13px; }
  .sbars .brow .lane { height: 24px; }
  .sbars .brow .fill { top: 5px; height: 14px; }
  .sbars .brow .val { top: 1px; font-size: 13px; }
  .stages { flex-wrap: wrap; border-radius: 18px; }
  #mx-min { white-space: normal; }
  /* toggles that do not fit one row become a grid (2 × 2, 3 × 2): every option visible, nothing to scroll */
  .tabs.grid, .stages.grid { display: grid; width: 100%; border-radius: 20px; white-space: normal; }
  .tabs.grid button, .stages.grid button { padding: 9px 6px; border-radius: 16px; white-space: normal; line-height: 1.2; }
  .tabs.grid .glass, .stages.grid .glass { border-radius: 16px; }
  .bwd .tabs.grid, .layer.l3 .tabs.grid, .acc .stop > .tabs.grid { align-self: stretch; }
  .hero-line { font-size: clamp(36px, 11vw, 48px); }
  .layer.l2 .intro-sub { font-size: 17px; }
  .chart svg text { font-size: 15px; } .chart svg text.lbl { font-size: 12.5px; } .chart svg text.lg { font-size: 14px; } .chart svg text.ttl, .chart svg text.thr { font-size: 15px; } .res-chart text.mk { font-size: 16px; }
  .matrix table { min-width: 640px; }
  .bwd .brow.has-split .lane, .bwd .brow.other .lane { height: 66px; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal, .brow .fill, .brow .val, .line path.draw, .res-chart .mv, .sbars .brow, .hero-line .w, .hero-line .v, .bwd .seg, .bwd .seglbl, .stable .eb { transition: none !important; }
}

/* gradient accuracy: the derivative formula follows the block toggle; the component chart */
.grad-tabs { margin: 0 0 10px; }
.grad-lead { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin: 34px 0 10px; font-size: 16px; color: var(--ink2); }
.formula { display: inline-block; min-height: 2.6em; color: var(--ink); font-size: 16px; line-height: 2.6em; }
.formula .f { display: none; }
.formula .f.on { display: inline-block; }
.formula .katex { color: var(--ink); font-size: 1.12em; }
.formula.small { min-height: 0; line-height: inherit; color: var(--ink2); }
.formula.small .katex { color: var(--ink2); font-size: 1em; }
.grad-lead .where { font-size: 15px; color: var(--muted); }
.formula-note { margin: 0 0 26px; }
/* accuracy: each block is a full-screen stop */
.acc .stop { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 40px 0; }
.acc .stop + .stop { margin-top: 20px; }
.acc .stop > .tabs { align-self: flex-start; }
.formula-note .katex { font-size: 1em; color: inherit; }
.acc .claim.spaced { margin-top: 0; }
.subhead.thin.spaced { margin-top: 90px; }
#grad-vec svg { width: 100%; height: auto; display: block; overflow: visible; }
#grad-vec text.grp { fill: var(--muted); font-size: 11px; }
#grad-vec .gline { stroke: #3a3a3d; stroke-width: 1; }
#grad-vec .hit { fill: transparent; }
#grad-vec .hit:hover { fill: rgba(255,255,255,0.05); }
#grad-vec text.ytitle { fill: var(--ink); font-size: 12.5px; font-weight: 500; }
.bars.morph .brow .fill { transition: width 0.6s cubic-bezier(.2,.7,.2,1) !important; transition-delay: 0s !important; }
.bars.morph .brow .val { transition: left 0.6s cubic-bezier(.2,.7,.2,1), opacity 0.3s ease !important; transition-delay: 0s !important; }

.bwd .subhead.mk { margin: 6px 0 18px; color: var(--ink); }
.intro-sub strong { color: var(--ink); font-weight: 700; }

/* training-time toggle under the montage */
.montage .mont-label { position: absolute; left: 16px; bottom: 14px; z-index: 2; font: 600 14px "NablaMark", "Inter", sans-serif; color: #fff;
  background: rgba(0, 0, 0, 0.55); padding: 6px 12px; border-radius: 980px; }
.mont-ctl { display: flex; align-items: center; justify-content: center; gap: 14px; margin: -30px auto 44px; }
.mont-k { font-size: 14px; color: var(--ink2); }
/* 8 min vs 2 h: column heads, then four rows of pairs */
.cmp-head { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 18px 0 10px; }
.cmp-head p { margin: 0; font: 700 17px var(--display); color: var(--ink2); }
.cmp-head p.ours, .ov-grid figcaption.ours { color: var(--ink); }
.cmp-head .est { font-weight: 500; color: var(--muted); }
.cmp-grid { gap: 14px 18px; }
.cmp-grid video { border-radius: 14px; }
/* converged or not: overlay trio and the drift trace */
.ov-lede { margin-bottom: 18px; }
.ov-grid { margin-top: 16px; }
.ov-grid figcaption { font-weight: 600; }
.drift { margin: 14px 0 6px; }
.drift svg { width: 100%; display: block; }
.drift .dg { stroke: #2a2a2d; stroke-width: 1; }
.drift .dt { fill: var(--muted); font: 12px "NablaMark", "Inter", sans-serif; }
.drift .dl { font: 600 13px "NablaMark", "Inter", sans-serif; }
.drift .dm { stroke: #f5f5f7; stroke-width: 1; opacity: 0.6; }
@media (max-width: 760px) { .cmp-head { gap: 10px; } .cmp-head p { font-size: 14px; } .cmp-grid { grid-template-columns: 1fr 1fr; } .mont-ctl { flex-direction: column; gap: 8px; } }

/* demo: sweet-spot pair and the converged pair with live error bars */
#demo .claim { margin-bottom: 26px; }
#demo .spaced-claim { margin-top: 110px; }
.sw-grid figcaption, .ov-grid figcaption { font-weight: 600; font-size: 15px; }
.sw-grid figcaption.ours, .ov-grid figcaption.ours { color: var(--ink); }
.ov-grid { grid-template-columns: 1fr 1fr; }
.ebars { margin-top: 12px; display: grid; gap: 8px; }
.eb { display: grid; grid-template-columns: 132px 1fr 104px; align-items: center; gap: 10px; font-size: 13px; color: var(--ink2); }
.et { height: 8px; border-radius: 980px; background: #1d1d1f; overflow: hidden; }
.et i { display: block; height: 100%; width: 0; border-radius: 980px; background: #d1477f; transition: width 0.12s linear; }
.ov-grid figure:first-child .et i { background: var(--accent); }
.ev { font-variant-numeric: tabular-nums; color: var(--ink); text-align: right; }
@media (max-width: 760px) { .ov-grid { grid-template-columns: 1fr; } .eb { grid-template-columns: 110px 1fr 90px; } }
.sw-grid figcaption, .ov-grid figcaption { min-height: 42px; }

/* converged demo: the overlay setup, stated up front */
.callout { display: inline-block; margin: 0 0 18px; padding: 10px 16px; border-radius: 14px; background: rgba(41, 151, 255, 0.12); border: 1px solid rgba(41, 151, 255, 0.45); color: var(--ink); font-size: 16px; font-weight: 600; }

/* legends above charts (phones) */
.res-legend.wrap { flex-direction: row; flex-wrap: wrap; gap: 4px 14px; }
.res-legend .lk.x b { color: var(--red, #ff453a); font-weight: 800; width: 18px; text-align: center; }

/* phones: every block fits one screen; less vertical padding, fewer lines */
@media (max-width: 760px) {
  .notes li .fine { display: inline; margin: 0; font-size: inherit; color: inherit; }
  sup.fnm { font-size: 0.42em; font-weight: 600; margin-left: 2px; letter-spacing: 0; vertical-align: super; }
  sup.fnm a { color: var(--ink2); }
  .sec { padding-top: 130px; }
  .claim { font-size: clamp(32px, 9vw, 40px); margin-bottom: 14px; }
  .claim.mid { font-size: clamp(28px, 8vw, 34px); }
  .subhead { font-size: 20px; margin-bottom: 12px; }
  .lede { font-size: 16px; margin-bottom: 20px; }
  .against { font-size: 14px; margin-bottom: 14px; }
  body.static .scene-inner { padding-top: 130px; }
  /* opening: shorter, so the first chart peeks in */
  body.manim .hero .scene-inner { min-height: 100svh; padding: var(--nav) 22px 0; will-change: transform, opacity; }
  body.manim .results .scene-inner { will-change: transform, opacity; }
  body.static .results .scene-inner { padding-top: 8px; }
  .res-right { display: none; }
  .res-lower { margin-top: 10px; }
  .res-claim { margin-bottom: 6px; }
  /* falls: 2 × 2 */
  .falls-sec { padding-top: 110px; }
  .noise.four { grid-template-columns: 1fr 1fr; gap: 10px; }
  .noise.four > div { padding: 14px 16px; border-radius: 18px; }
  .noise.four .k { font-size: 30px; margin-bottom: 2px; }
  .falls-sec .noise.four .cap { font-size: 16px; }
  .noise { gap: 10px; }
  .noise > div { padding: 16px 18px; border-radius: 18px; }
  .k { font-size: 30px; margin-bottom: 4px; }
  .cap { font-size: 14px; }
  /* cards: compact */
  .trio, .feat { gap: 10px; }
  .trio > div, .feat > div { padding: 16px 18px; border-radius: 18px; }
  .trio h4, .feat h4 { font-size: 16px; margin-bottom: 4px; }
  .trio p, .feat p { font-size: 14px; }
  .feat { margin-top: 120px; }
  .cta { margin-top: 18px; font-size: 17px; }
  .scaling { padding: 120px 22px 20px; }
  .montage { margin-bottom: 30px; border-radius: 14px; }
  .mont-ctl { margin: -16px auto 24px; flex-wrap: wrap; gap: 8px; }
  .scaling .lede { margin-bottom: 20px; }
  /* bridge: the title flies in from both sides and holds the screen alone */
  body.manim .layer.l1 .subhead { margin: 16px 0; }
  body.manim .layer.l2 { margin: 60px 0 0; height: 190svh; }
  body.manim .l2-pin { position: sticky; top: 0; height: 100svh; display: flex; align-items: center; justify-content: center; overflow: hidden; }
  body.manim .layer.l2 .intro-sub { display: none; }
  body.manim .intro-title .fly { display: inline-block; will-change: transform, opacity; }
  body.manim .layer.l3 { margin-top: 0; }
  .intro-title { font-size: clamp(40px, 12vw, 52px); }
  /* speed charts: tighter rows */
  .layer.l3 .bhead .mx, .bhead .mx { font-size: 40px; }
  .layer.l3 .subhead { margin: 8px 0 8px; font-size: 17px; }
  .layer.l3 .tabs, .bwd .tabs { margin: 0 0 8px; }
  .brow, .layer.l3 .brow { padding: 2px 0; gap: 0; }
  .brow .name { font-size: 13px; }
  .brow .lane { height: 22px; }
  .brow .fill { top: 4px; height: 14px; }
  .brow .val { top: 1px; font-size: 13px; }
  .brow .na { top: 1px; font-size: 12px; }
  .tpline { font-size: 13px; margin-top: 6px; }
  .bwd .brow.has-split .lane, .bwd .brow.other .lane { height: 62px; }
  .bwd .seglbl, .bwd .seglbl.n { top: 25px; } .bwd .seglbl.b { top: 42px; }
  .bwd .brow + .brow { margin-top: 10px; }
  .bwd .claim { font-size: clamp(28px, 8vw, 34px); margin-bottom: 4px; }
  .acc .stop { min-height: 0; padding: 0; }
  .acc .stop + .stop { margin-top: 130px; }
  .subhead.spaced, .subhead.thin.spaced { margin-top: 90px; }
  .grad-lead { margin: 16px 0 6px; font-size: 14px; }
  /* comparison table: transposed, everything on screen */
  .matrix table, .matrix table.tr { min-width: 0; font-size: 12px; table-layout: fixed; }
  .matrix th, .matrix td { padding: 8px 2px; }
  .matrix th { font-size: 11px; font-weight: 600; }
  .matrix td { font-size: 15px; }
  .matrix th:first-child, .matrix td:first-child { min-width: 0; width: 34%; font-size: 13px; }
  .matrix th.ours, .matrix td.ours:first-child { font-size: 13px; }
  .matrix tr.ours td:first-child { font-weight: 700; }
  /* demos: both videos and their live bars on one screen */
  #demo .spaced-claim { margin-top: 130px; }
  #demo .claim { font-size: clamp(28px, 8vw, 34px); }
  #ov-videos figcaption small { display: none; }
  #grad-vec svg text.lg { font-size: 17px; }
  .callout { font-size: 14px; padding: 8px 12px; margin-bottom: 10px; border-radius: 12px; }
  .hw.compare-tabs { margin-bottom: 10px; }
  .ov-grid, .sw-grid { gap: 10px; margin-top: 0; }
  .videos video { border-radius: 12px; }
  .sw-grid figcaption, .ov-grid figcaption { min-height: 0; font-size: 13px; margin-top: 4px; }
  .videos figcaption small { display: inline; font-size: 12px; margin-left: 4px; }
  .videos figcaption small::before { content: "· "; }
  .ebars { margin-top: 4px; gap: 2px; }
  .eb { grid-template-columns: 112px 1fr 86px; font-size: 12px; }
  .notes { margin-top: 80px; }
  summary { font-size: 16px; align-items: center; gap: 24px; }
  summary::after { flex: none; font-size: 22px; line-height: 1; width: 22px; text-align: center; }
  details { padding: 16px 0; }
  details p { font-size: 14px; }
  /* comparison table: a gutter before the names */
  .matrix th:first-child, .matrix td:first-child { padding-left: 10px; }
  pre.code { font-size: 11.5px; line-height: 1.6; padding: 16px; white-space: pre-wrap; word-break: break-word; }
}

/* toggles: a glass thumb slides to the chosen option; it can be dragged with a finger and snaps on release */
.tabs, .stages { position: relative; touch-action: pan-y; -webkit-user-select: none; user-select: none; }
.tabs button, .stages button { position: relative; z-index: 1; transition: color 0.25s ease; -webkit-tap-highlight-color: transparent; }
.tabs .glass, .stages .glass { position: absolute; left: 0; top: 0; z-index: 0; border-radius: 980px; background: #f5f5f7; pointer-events: none;
  transition: transform 0.42s cubic-bezier(.3,1.35,.5,1), width 0.42s cubic-bezier(.3,1.35,.5,1), height 0.42s ease, background 0.2s ease, box-shadow 0.2s ease; }
.tabs .glass.nofx, .stages .glass.nofx { transition: none; }
.tabs .glass.drag, .stages .glass.drag { background: rgba(245, 245, 247, 0.9); box-shadow: 0 6px 22px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.6);
  transition: transform 0.1s ease-out, width 0.25s ease, height 0.25s ease, background 0.2s ease, box-shadow 0.2s ease; }
.glass.drag .glass-in { transition: transform 0.1s ease-out; }
.tabs.glassy button[aria-selected="true"], .stages.glassy button[aria-selected="true"] { background: none; color: var(--ink2); }
/* the thumb holds black copies of the labels, moved against it, so a label turns black exactly where the thumb covers it */
.tabs .glass, .stages .glass { overflow: hidden; z-index: 2; }
.glass-in { position: absolute; left: 0; top: 0; transition: inherit; transition-property: transform; }
.glass.nofx .glass-in { transition: none; }
.glass-in > span { position: absolute; box-sizing: border-box; display: flex; align-items: center; justify-content: center; text-align: center; color: #000; white-space: inherit; }
.tabs.grid .glass-in > span, .stages.grid .glass-in > span { white-space: normal; line-height: 1.2; }

/* code: JAX / PyTorch */
.code-tabs { margin: 0 0 12px; }
pre.code[hidden] { display: none; }
.res-legend.dots .lk i { width: 8px; height: 8px; border: 0; border-radius: 50%; background: var(--c); }
@media (max-width: 760px) { #grad-vec text.grp { font-size: 15px; } }

/* throughput line: after its first reveal it stays put; switching the GPU only changes its numbers */
.bars.tpseen .tpline { opacity: 1 !important; transition: none !important; }
/* stage 0 headline: the MuJoCo Warp note sits beside the number */
.mx-note { display: inline-block; vertical-align: middle; margin-left: 10px; font-family: "NablaMark", "Inter", sans-serif; font-size: 13px; font-weight: 500; letter-spacing: 0; line-height: 1.25; color: var(--ink2); white-space: nowrap; }
/* code: both versions share one cell, so switching never changes the height */
.code-wrap { display: grid; }
.code-wrap > pre { grid-area: 1 / 1; margin: 0; }
.code-wrap > pre[hidden] { display: block; visibility: hidden; }
.feat-sec .feat { margin-top: 0; }
.feat-sec .eyebrow { margin-bottom: 8px; }
@media (max-width: 760px) {
  /* results block: one screen on narrow phones */
  .res-legend:not(.wrap) { display: grid; grid-template-columns: auto auto; justify-content: start; gap: 3px 16px; font-size: 12px; margin-bottom: 4px; }
  .res-legend:not(.wrap) .lk { gap: 6px; white-space: nowrap; }
  .res-legend:not(.wrap) .lk i { width: 14px; }
  .res-claim { font-size: clamp(26px, 7.4vw, 32px); margin-bottom: 4px; }
  .res-lower { margin-top: 4px; }
  .stage-tag { font-size: 13px; margin-bottom: 2px; min-height: 0; white-space: nowrap; }
  .res-left .mx { font-size: clamp(34px, 10vw, 42px); }
  #mx-min { font-size: 16px; margin-top: 4px; min-height: 0; white-space: nowrap; }
  #mx-sub { font-size: clamp(13px, 3.9vw, 15px); margin-top: 2px; min-height: 0; }
  .res-foot { margin-top: 10px; gap: 0; }
  .mx-note { font-size: 11.5px; margin-left: 8px; }
  .tpline { min-height: 2.9em; }
  /* component chart: less room around it */
  .acc > .subhead.thin.spaced { margin-top: 70px; }
  body.static .equiv .scene-inner { padding-top: 90px; }
}
@media (max-width: 760px) { .res-foot .stage-tag { margin: 6px 0 0 4px; } }

/* results: "<time> to reach return [level toggle]"; the level's meaning is in the pills (desktop) or under them (phones) */
.reach { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.reach-t { margin: 0; font-family: var(--display); font-size: clamp(20px, 2vw, 26px); font-weight: 700; letter-spacing: -0.02em; color: var(--ink); line-height: 1; display: flex; align-items: baseline; gap: 0.25em; position: relative; top: -0.12em; }   /* optical: centre the caps, not the line box, on the toggle */
.reach-x { font-size: 1.35em; font-weight: 800; letter-spacing: -0.03em; line-height: 1; padding-bottom: 0; }
.res-left .stage-tag { display: none; }
@media (max-width: 760px) {
  .reach { flex-direction: column; align-items: stretch; gap: 8px; width: 100%; margin: 6px 0 14px; }
  .reach .stages { align-self: flex-start; }
  .reach-t { font-size: 20px; }
  .res-left .reach .stage-tag { display: block; margin: 0 0 0 4px; }
}
/* "Exact gradients ... hard to tame." opens the prior-methods block: keep the two claims close */
@media (max-width: 760px) { body.static .exact-sec + .stall .scene-inner { padding-top: 36px; } }
.exact-sec .exact-sub { margin-top: 18px; color: var(--ink2); }
