/* CLIMB project page */

:root {
  color-scheme: light;
  --paper: #fefff7;
  --paper-2: #e9f1fa;
  --surface: #fff;
  --ink: #102d5c;
  --ink-2: #315079;
  --muted: #557092;
  --hair: #c9d9eb;
  --accent: #0c43a0;
  --accent-soft: #dcecf9;
  --teal: #68afe7;
  --teal-soft: #e4f3fd;
  --c-blue: #0c43a0;
  --shadow: 0 10px 30px -22px rgba(12, 67, 160, .2);
  --r: 10px;
  --display: "IvyPresto Headline", "Cormorant Garamond", Georgia, serif;
  --sans: "Manrope", -apple-system, "Segoe UI", sans-serif;
  --mono: "Manrope", -apple-system, "Segoe UI", sans-serif;
  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background-color: var(--paper);
  color: var(--ink);
  font: 400 17px/1.62 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; }
[hidden] { display: none !important; }
a { color: inherit; }
p { margin: 0 0 1em; }
h1, h2, h3 { font-family: var(--display); margin: 0; letter-spacing: -0.018em; }
b, strong { font-weight: 600; }
.mono { font-family: var(--mono); font-size: 0.86em; letter-spacing: -0.01em; }
.muted { color: var(--muted); }

.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px var(--gutter);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  border-bottom: 1px solid color-mix(in srgb, var(--hair) 70%, transparent);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 800 20px/1 var(--sans); letter-spacing: -.04em; }
.brand-mark { width: 34px; height: 28px; }
.nav nav { display: flex; gap: clamp(12px, 3vw, 28px); }
.nav nav a { text-decoration: none; font-size: 15px; color: var(--ink-2); position: relative; padding: 4px 0; }
.nav nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .25s ease; }
.nav nav a:hover::after, .nav nav a.is-active::after { transform: scaleX(1); }
.nav nav a.is-active { color: var(--ink); }

/* ---------- hero ---------- */
.hero { position: relative; isolation: isolate; padding: clamp(40px, 8vw, 88px) 0 0; }
.hero::before { content: ""; position: absolute; z-index: -1; inset: 0 0 auto auto; width: min(54vw, 760px); height: min(44vw, 620px); background: linear-gradient(145deg, #68afe728, #68afe700 70%); clip-path: polygon(41% 0, 100% 0, 100% 100%, 0 0); pointer-events: none; }
.hero-head { max-width: 920px; margin: 0 auto; padding: 0 var(--gutter); text-align: center; }
.hero-labs { justify-content: center; margin: 0 0 28px; }
.light-logo { width: 122px; height: auto; }
.clan-logo { width: 48px; height: auto; }
.eyebrow { font: 500 12.5px/1.2 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin: 0 0 14px; }
.hero h1 {
  font: 800 clamp(76px, 12vw, 144px)/1 var(--sans);
  color: var(--accent);
  letter-spacing: -0.02em;
}
.subtitle { font: 600 clamp(22px, 2.6vw, 30px)/1.28 var(--display); color: var(--ink-2); max-width: 27em; margin: 18px auto 26px; }
.subtitle b { color: var(--accent); font-weight: 800; text-decoration: underline; text-decoration-color: var(--teal); text-decoration-thickness: .1em; text-underline-offset: .12em; }
.authors { list-style: none; padding: 0; margin: 0 auto 8px; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; font-size: 16px; max-width: 760px; }
.authors li { white-space: nowrap; }
.authors sup, .affil sup { font-size: 0.66em; color: var(--accent); margin-left: 1px; }
.affil { font-size: 14px; color: var(--muted); margin: 6px 0 26px; }

.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 7px;
  border: 1.4px solid var(--ink); background: transparent; color: var(--ink);
  font: 500 15px/1 var(--sans); text-decoration: none; cursor: pointer;
  transition: background .2s, color .2s, transform .2s, border-color .2s;
}
.btn svg { width: 17px; height: 17px; }
.btn:hover { background: var(--ink); color: var(--paper); transform: translateY(-1px); }
.btn-solid { background: var(--ink); color: var(--paper); }
.btn-solid:hover { background: var(--accent); border-color: var(--accent); }
.btn-ghost { border-color: var(--hair); }
.btn[aria-disabled="true"] { opacity: 0.5; cursor: default; pointer-events: none; }
.btn .soon { font: 500 10.5px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; padding: 3px 6px; border-radius: 999px; background: var(--paper-2); color: var(--ink-2); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn:disabled:hover { background: inherit; color: inherit; }
.btn-solid:disabled:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.panorama {
  position: relative; margin: clamp(36px, 6vw, 64px) auto 0;
  max-width: 1280px; padding: 0 var(--gutter);
}
.hero-animation, .hero-video { position: relative; scroll-margin-top: 8px; }
.overview-watch, .overview-back { position: absolute; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 12px 18px; border: 1px solid var(--hair); border-radius: 999px; background: var(--surface); color: var(--ink); font: 500 15px/1 var(--sans); cursor: pointer; }
.overview-watch { left: 50%; bottom: 22px; transform: translateX(-50%); white-space: nowrap; box-shadow: 0 4px 18px #0c43a024; }
.overview-watch svg { width: 18px; height: 18px; }
.overview-watch span { color: var(--ink-2); }
.overview-watch:hover, .overview-back:hover { background: var(--paper-2); }
.hero-video video { display: block; width: 100%; max-height: calc(100svh - 100px); aspect-ratio: 16 / 9; object-fit: contain; border-radius: 22px; background: var(--ink); box-shadow: var(--shadow); }
.overview-back { top: 14px; right: 14px; font-size: 13px; }
#hero-scene {
  width: 100%; height: clamp(260px, 38vw, 470px);
  border-radius: var(--r); box-shadow: var(--shadow);
  background: #e9f1fa;
}
.svg-chip { font: 500 14px var(--sans); fill: var(--ink); }
.svg-tag { font: 600 15px var(--sans); fill: var(--ink); }
.svg-tag.teal { fill: #245a9d; }
.svg-sub { font: 500 12px var(--mono); fill: var(--muted); letter-spacing: .04em; }
.svg-caption { font: 600 25px var(--display); fill: var(--ink); }
.scene-toggle {
  position: absolute; right: 14px; bottom: 14px;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.6); background: rgba(16,45,92,.75); color: #fff;
  display: grid; place-items: center; cursor: pointer;
}
.scene-toggle svg { width: 16px; height: 16px; }
.scene-cap { display: none; }
.scene-toggle .i-play { display: none; }
.scene-toggle[aria-pressed="true"] .i-play { display: block; }
.scene-toggle[aria-pressed="true"] .i-pause { display: none; }

.tldr { max-width: var(--wrap); margin: 0 auto; padding: clamp(40px, 6vw, 64px) var(--gutter) 0; }
.lede { font: 600 clamp(22px, 2.5vw, 30px)/1.3 var(--display); max-width: 34em; margin: 0 auto 40px; text-align: center; }
.lede em { font-style: italic; color: var(--accent); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); }
.stat { padding: 26px 24px 22px; }
.stat + .stat { border-left: 1px solid var(--hair); }
.stat-value { font: 600 clamp(40px, 5vw, 56px)/1 var(--sans); letter-spacing: -0.03em; margin: 0 0 10px; }
.stat:first-child .stat-value { color: var(--accent); }
.stat-label { font-size: 15px; color: var(--ink-2); margin: 0; max-width: 24em; }

.abstract { max-width: 760px; margin: 28px auto 0; }
.abstract summary { cursor: pointer; font: 500 14px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); text-align: center; list-style: none; }
.abstract summary::-webkit-details-marker { display: none; }
.abstract summary::after { content: " ▾"; color: var(--accent); }
.abstract[open] summary::after { content: " ▴"; }
.abstract p { margin-top: 18px; font-size: 16px; color: var(--ink-2); text-align: justify; hyphens: none; }

/* ---------- sections ---------- */
.section { max-width: var(--wrap); margin: 0 auto; padding: clamp(72px, 11vw, 128px) var(--gutter) 0; }
.section-head { max-width: 720px; margin: 0 0 clamp(32px, 5vw, 52px); }
.section h2 { font-size: clamp(40px, 5vw, 58px); line-height: 1.04; font-weight: 600; text-wrap: balance; }
.section-lede { font-size: 18.5px; color: var(--ink-2); margin: 16px 0 0; }
.card { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r); box-shadow: var(--shadow); }
.fineprint { font-size: 13.5px; color: var(--muted); margin: 18px 0 0; }
.fineprint.center { text-align: center; }
.t-accent { color: var(--accent); }
.t-teal { color: #245a9d; }

/* ---------- story (scrollytelling) ---------- */
.scrolly { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.scrolly-figure { position: sticky; top: max(84px, calc(50vh - 165px)); display: grid; gap: 12px; }
.scrolly-steps { padding: 6vh 0 10vh; }
.step {
  min-height: 50vh; display: flex; flex-direction: column; justify-content: center;
  opacity: .32; transition: opacity .45s ease;
}
.step.is-active { opacity: 1; }
.step p { font-size: 19px; line-height: 1.6; max-width: 26em; }
.step-k { font: 500 12px var(--mono) !important; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px !important; }

.story-scene { width: 100%; height: auto; border-radius: var(--r); border: 1px solid var(--hair); box-shadow: var(--shadow); background: var(--paper-2); }
.st-badge { font: 600 10px var(--sans); fill: #fff; }
.st-say { font: 500 25px var(--sans); fill: var(--ink); }
.st-say.dr { fill: #fefff7; }
.st-mono { font: 500 21px var(--mono); fill: #dcecf9; }
.st-chip { font: 600 20px var(--sans); fill: #0c43a0; }
.st-rv { font: 600 20px var(--sans); fill: var(--ink); }
.st-rv.on { fill: #fff; }
.st-rv.off { fill: #557092; text-decoration: line-through; }
.story-scene :is(.sb, .th, .th-2, .th-3, .rv) { opacity: 0; transform-box: fill-box; transform-origin: 50% 100%; }
.story-scene .th-2, .story-scene .th-3 { transform-origin: 50% 50%; }
@keyframes st-pop { from { opacity: 0; transform: translateY(14px) scale(.86); } to { opacity: 1; transform: none; } }
.scrolly-figure[data-step="1"] .sb-p1 { opacity: 1; animation: st-pop .5s .15s both; }
.scrolly-figure[data-step="2"] .sb-d2 { opacity: 1; animation: st-pop .5s .1s both; }
.scrolly-figure[data-step="2"] .sb-p2 { opacity: 1; animation: st-pop .5s 1.2s both; }
.scrolly-figure[data-step="2"] :is(.th, .th-2) { opacity: 1; animation: st-pop .5s 2.1s both; }
.scrolly-figure[data-step="3"] .sb-d3 { opacity: 1; animation: st-pop .5s .1s both; }
.scrolly-figure[data-step="3"] .sb-p3 { opacity: 1; animation: st-pop .5s 1.2s both; }
.scrolly-figure[data-step="3"] :is(.th, .th-3) { opacity: 1; animation: st-pop .5s 2.3s both; }
.scrolly-figure[data-step="4"] .sb-d4 { opacity: 1; animation: st-pop .5s .1s both; }
.scrolly-figure[data-step="4"] .rv-1 { opacity: 1; animation: st-pop .45s 1.1s both; }
.scrolly-figure[data-step="4"] .rv-2 { opacity: 1; animation: st-pop .45s 1.35s both; }
.scrolly-figure[data-step="4"] .rv-3 { opacity: 1; animation: st-pop .45s 1.6s both; }
.scrolly-figure[data-step="4"] .rv-4 { opacity: 1; animation: st-pop .45s 1.85s both; }
.story-scene .eyes { transform-box: fill-box; transform-origin: 50% 50%; animation: st-blink 5s infinite; }
.story-scene .e-child { animation-delay: 1.7s; }
.story-scene .e-doc { animation-delay: 3.1s; }
@keyframes st-blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.12); } }
.story-scene .cough-anim path { animation: st-puff 1.8s ease-in-out infinite; }
.story-scene .cough-anim path:nth-child(2) { animation-delay: .2s; }
.story-scene .cough-anim path:nth-child(3) { animation-delay: .4s; }
@keyframes st-puff { 0%, 55%, 100% { opacity: 0; transform: translateX(0); } 20% { opacity: 1; } 45% { opacity: 0; transform: translateX(10px); } }

.score { display: none; align-items: center; gap: 14px; padding: 11px 16px; border-radius: var(--r); background: var(--ink); color: var(--paper); font-size: 13.5px; line-height: 1.42; }
.score-num { font: 600 38px/1 var(--display); color: #b9dfff; white-space: nowrap; }
.score-num small { font-size: 22px; color: #dcecf9; }
.score b { color: #fff; }

/* step states */
.scrolly-figure[data-step="4"] .score { display: flex; }


/* ---------- benchmark ---------- */
.builder { position: relative; padding: 0; overflow: hidden; }
#bscene { width: 100%; height: auto; }
.b-dice { position: absolute; top: 14px; right: 14px; z-index: 1; width: 42px; height: 42px; border-radius: 12px; border: 1.2px solid var(--hair); background: var(--surface); color: var(--ink); cursor: pointer; display: grid; place-items: center; transition: transform .2s, border-color .2s; }
.b-dice svg { width: 26px; height: 26px; }
.b-dice:hover { border-color: var(--ink); transform: rotate(-12deg); }
.bs-badge { font: 700 9px var(--sans); fill: #fff; letter-spacing: .04em; }
.bs-card-name { font: 600 16px var(--sans); fill: #fff; }
.bs-opening { font: 600 22px var(--sans); fill: var(--ink); }
.bs-note { font: 500 15px var(--sans); fill: var(--ink-2); }
.bs-note tspan.b { font-weight: 700; fill: var(--ink); }
.bs-title { font: 600 15px var(--sans); fill: var(--ink); }
.bs-line { font: 500 13.5px var(--sans); fill: var(--ink); }
.bs-line.bg { fill: var(--muted); }
.bs-tag { font: 600 14px var(--sans); fill: var(--ink); }
.bs-tag.noise { fill: var(--muted); font-style: italic; }
.bs-noise-label { font: 600 10.5px var(--mono); fill: var(--muted); letter-spacing: .1em; text-transform: uppercase; }
.bs-stamp { font: 800 16px var(--sans); fill: var(--accent); letter-spacing: .06em; }
.bs-stamp-sub { font: 600 10.5px var(--mono); fill: var(--accent); letter-spacing: .06em; }
.bs-sees { font: 600 16px var(--sans); fill: var(--paper); }
.pipe[data-step] { cursor: pointer; transition: border-color .3s, box-shadow .3s, transform .3s; }
.pipe.is-active { border-color: var(--ink); box-shadow: 0 0 0 1.5px var(--ink), var(--shadow); transform: translateY(-3px); }
.pipe.is-active .pipe-n { color: var(--accent); }
.builder + .fineprint { margin: 10px 0 20px; }
.pipeline { list-style: none; padding: 0; margin: 24px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; counter-reset: pipe; }
.pipe { position: relative; padding: 22px 20px 20px; }
.pipe-n { position: absolute; top: 16px; right: 18px; font: 600 13px var(--mono); color: var(--muted); }
.pipe-ic { width: 44px; height: 44px; color: var(--ink); margin-bottom: 14px; }
.pipe h3 { font-size: 21px; font-weight: 600; margin-bottom: 8px; }
.pipe p { font-size: 15px; color: var(--ink-2); margin: 0; }
.pipe:not(:last-child)::after {
  content: ""; position: absolute; right: -18px; top: 42px; width: 10px; height: 10px;
  border-top: 1.6px solid var(--muted); border-right: 1.6px solid var(--muted); transform: rotate(45deg);
}


/* ---------- generation walkthrough ---------- */
.generation-details { margin-top: 28px; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); }
.generation-details > summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 0; cursor: pointer; list-style: none; font-weight: 500; }
.generation-details > summary::-webkit-details-marker { display: none; }
.generation-details > summary svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; transition: transform .25s; }
.generation-details[open] > summary svg { transform: rotate(180deg); }
.generation-body { padding: 0 0 28px; }
.generation-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 8px 0 28px; }
.generation-tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--hair); }
.generation-tabs button { padding: 12px 0; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--ink-2); font: 500 18px var(--sans); cursor: pointer; }
.generation-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
#gen-play { min-width: 82px; justify-content: center; }
.gen-tree-layout { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; }
.gen-tree { margin: 0; }
.gen-tree figcaption, .gen-example-label { font-size: 14px; font-weight: 500; margin: 0 0 18px; }
.gen-tree figcaption span, .gen-example-label span { display: block; color: var(--muted); font-weight: 400; }
.gen-tree svg { width: 100%; max-width: 520px; margin: auto; overflow: visible; }
.gen-tree text { font: 500 16px var(--sans); text-anchor: middle; fill: var(--ink); }
.gen-branches { fill: none; stroke: var(--hair); stroke-width: 2; }
.gen-route { fill: none; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 1; }
.gen-route-a { stroke: var(--c-blue); animation: gen-trace 1.5s both; }
.gen-route-bad { stroke: var(--teal); animation: gen-trace 1.5s .7s both; }
.gen-route-good { stroke: var(--teal); opacity: 0; }
.gen-node rect, .gen-leaf rect { fill: var(--surface); stroke: var(--hair); stroke-width: 1.3; }
.gen-node-a rect, .gen-leaf-a rect { stroke: var(--c-blue); }
.gen-node-bad rect, .gen-leaf-bad rect { stroke: var(--teal); }
.gen-answer rect { fill: var(--paper); }
.gen-answer text, .gen-tree-answer text { font-size: 14px; }
.gen-node-good, .gen-leaf-good { opacity: .4; }
.gen-path-answers { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.gen-source { display: block; margin-bottom: 8px; font: 500 13px var(--mono); }
.gen-source-a { color: var(--c-blue); }
.gen-source-b { color: #245a9d; }
.gen-path-answers p { font-size: 14px; padding: 6px 0; border-bottom: 1px solid var(--hair); margin: 0; }
.gen-path-answers strong { display: block; font-size: 16px; }
.gen-path-answers .gen-answer-after { display: none; }
.gen-verdict { min-height: 26px; font-size: 15px; margin: 20px 0; }
.gen-verdict-reject, .gen-verdict-accept { display: none; }
.gen-verdict-reject { color: #a3311c; }
.gen-verdict-accept { color: #245a9d; }
.gen-record { min-width: 0; background: var(--surface); border: 1px solid var(--hair); border-radius: 4px 20px 4px 4px; padding: 20px; box-shadow: 0 4px 12px rgba(12,67,160,.05); transition: opacity .5s, transform .65s, border-color .5s; }
.gen-record header { display: flex; justify-content: space-between; gap: 12px; font: 500 12px var(--mono); color: var(--muted); margin-bottom: 14px; }
.gen-record-diagnoses { font-weight: 600; font-size: 16px; margin: 0 0 12px; }
.gen-record dl { margin: 0; font: 13px/1.5 var(--mono); }
.gen-record dl div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--hair); }
.gen-record dl div:last-child { border: 0; }
.gen-record dd { margin: 0; text-align: right; white-space: nowrap; }
.gen-record-mark { color: #245a9d; opacity: 0; }
.gen-epoct-record { opacity: .16; transform: translateY(12px); }
.generation-panel[data-stage="1"] .gen-route-bad { stroke: #a3311c; }
.generation-panel[data-stage="1"] :is(.gen-node-bad, .gen-leaf-bad) rect { stroke: #a3311c; }
.generation-panel[data-stage="1"] .gen-check-answer { color: #a3311c; background: #faeae7; }
.generation-panel[data-stage="1"] .gen-verdict-check { display: none; }
.generation-panel[data-stage="1"] .gen-verdict-reject { display: inline; }
.generation-panel:is([data-stage="2"], [data-stage="3"]) :is(.gen-route-bad, .gen-node-bad, .gen-leaf-bad, .gen-absent) { opacity: .2; }
.generation-panel:is([data-stage="2"], [data-stage="3"]) .gen-route-good { opacity: 1; animation: gen-trace 1.5s both; }
.generation-panel:is([data-stage="2"], [data-stage="3"]) :is(.gen-node-good, .gen-leaf-good) { opacity: 1; }
.generation-panel:is([data-stage="2"], [data-stage="3"]) :is(.gen-node-good, .gen-leaf-good) rect { stroke: var(--teal); }
.generation-panel:is([data-stage="2"], [data-stage="3"]) :is(.gen-answer-before, .gen-verdict-check) { display: none; }
.generation-panel:is([data-stage="2"], [data-stage="3"]) .gen-answer-after { display: block; color: #245a9d; }
.generation-panel:is([data-stage="2"], [data-stage="3"]) .gen-verdict-accept { display: inline; }
.generation-panel[data-stage="3"] .gen-epoct-record { opacity: 1; transform: none; border-color: var(--teal); }
.generation-panel[data-stage="3"] .gen-record-mark { opacity: 1; }
.gen-documents { display: grid; grid-template-columns: 1fr 1fr 32px 1.12fr; gap: 16px; align-items: start; }
.gen-demographics { font-size: 14px; margin-bottom: 18px; padding: 5px 0; transition: background .4s; }
.gen-merge-connector { align-self: center; color: var(--teal); opacity: .2; }
.gen-merge-connector svg { width: 100%; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.gen-merge-connector path { stroke-dasharray: 1; }
.gen-ddx-record { opacity: .16; transform: translateX(12px); }
#gen-ddx[data-stage="1"] .gen-demographics { background: var(--teal-soft); }
#gen-ddx:is([data-stage="2"], [data-stage="3"]) .gen-ddx-record { opacity: 1; transform: none; }
#gen-ddx:is([data-stage="2"], [data-stage="3"]) .gen-merge-connector { opacity: 1; }
#gen-ddx[data-stage="2"] .gen-row-scale { color: #245a9d; background: var(--teal-soft); }
#gen-ddx[data-stage="2"] .gen-merge-connector path { animation: gen-trace 1s both; }
#gen-ddx[data-stage="2"] .gen-ddx-record dl div { animation: gen-arrive .6s both; }
#gen-ddx[data-stage="2"] .gen-ddx-record dl div:nth-child(2) { animation-delay: .3s; }
#gen-ddx[data-stage="2"] .gen-ddx-record dl div:nth-child(3) { animation-delay: .6s; }
#gen-ddx[data-stage="2"] .gen-ddx-record dl div:nth-child(4) { animation-delay: .9s; }
#gen-ddx[data-stage="3"] .gen-ddx-record { border-color: var(--teal); }
.gen-controls { margin-top: 28px; border-top: 1px solid var(--hair); padding-top: 22px; }
.gen-steps { display: flex; gap: 8px; }
.gen-steps button { flex: 1; min-width: 0; min-height: 44px; padding: 8px; border: 1px solid var(--hair); border-radius: 6px; background: none; color: var(--ink-2); font: 500 14px var(--sans); cursor: pointer; }
.gen-steps button[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--surface); }
.gen-caption { margin: 16px 0 0; max-width: 70ch; min-height: 3.3em; font-size: 16px; color: var(--ink-2); }
.generation-details[data-playing="false"] * { animation: none !important; }
@keyframes gen-trace { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes gen-arrive { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
@media (max-width: 760px) {
  .gen-tree-layout { grid-template-columns: 1fr; gap: 24px; }
  .gen-tree svg { max-width: 420px; }
  .gen-documents { grid-template-columns: 1fr 1fr; gap: 12px; }
  .gen-input { padding: 14px 12px; }
  .gen-input .gen-record-diagnoses { font-size: 14px; }
  .gen-input dl { font-size: 11px; }
  .gen-input dl div { gap: 5px; }
  .gen-input header { font-size: 11px; }
  .gen-page-number { display: none; }
  .gen-input .gen-demographics { font-size: 12px; }
  .gen-merge-connector { grid-column: 1 / -1; display: grid; place-items: center; height: 36px; }
  .gen-merge-connector svg { width: 36px; height: 80px; transform: rotate(90deg); }
  .gen-ddx-record { grid-column: 1 / -1; transform: translateY(12px); }
  .gen-steps { gap: 5px; }
  .gen-steps button { padding: 8px 3px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .generation-details * { animation: none !important; }
}

/* ---------- climbing-wall leaderboard ---------- */
.leaderboard .section-head { margin-bottom: 28px; }
.lb-tabs { display: flex; gap: 24px; margin-bottom: 20px; border-bottom: 1px solid var(--hair); }
.lb-tabs button { min-height: 44px; padding: 0 0 10px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--ink-2); font: inherit; cursor: pointer; }
.lb-tabs button[aria-selected="true"] { border-bottom-color: var(--accent); color: var(--ink); }
.lb-method { font-size: 15px; color: var(--ink-2); }
.lb-method p { max-width: 72ch; margin: 0 0 18px; }
.lb-table-wrap { overflow-x: auto; margin: 26px 0; }
.lb-table { width: 100%; min-width: 540px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.lb-table caption { text-align: left; padding-bottom: 12px; color: var(--ink); }
.lb-table th, .lb-table td { padding: 16px 12px; text-align: right; border-bottom: 1px solid var(--hair); }
.lb-table th { font-weight: 500; }
.lb-table th:nth-child(2), .lb-table th[scope="row"] { text-align: left; }
.lb-table tbody th, .lb-total { color: var(--ink); }
.lb-total { font-weight: 700; }
.lb-figure { margin: 0; }
.lb-wall { position: relative; padding: 56px 28px 0 56px; border: 1px solid var(--hair); border-radius: var(--r) var(--r) 4px 4px; background-color: #e9f1fa; background-image: radial-gradient(#7aaad540 1.5px, transparent 1.5px), linear-gradient(112deg, transparent 43%, #68afe718 43%, #68afe718 66%, transparent 66%); background-size: 26px 26px, 100% 100%; }
.lb-axis-title { position: absolute; top: 13px; left: 20px; margin: 0; font-size: 13px; color: var(--ink-2); }
.lb-plot { position: relative; height: 350px; }
.lb-grid { position: absolute; left: 0; right: 0; border-top: 1px solid #0c43a030; }
.lb-grid span { position: absolute; right: calc(100% + 12px); top: -10px; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.lb-route { position: absolute; top: 0; bottom: 0; left: var(--x); width: 0; }
.lb-rope { position: absolute; bottom: 0; left: 1px; width: 2px; height: 0; background: var(--route-color); opacity: .26; transition: height 1.4s cubic-bezier(.2,.7,.2,1); }
.lb-wall.is-visible .lb-rope { height: var(--height); }
.lb-hold { position: absolute; width: 13px; height: 8px; background: var(--route-color); opacity: .3; border-radius: 55% 40% 30% 35%; box-shadow: 0 2px 0 #0c43a022; }
.lb-climber { position: absolute; left: 0; bottom: 0; width: 64px; height: 86px; padding: 0; border: 0; background: transparent; color: var(--ink); cursor: pointer; transform: translate(-50%, 81px); transition: bottom 1.4s cubic-bezier(.2,.7,.2,1); z-index: 2; }
.lb-wall.is-visible .lb-climber { bottom: var(--height); }
.lb-climber svg { width: 64px; height: 86px; }
.lb-score { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); padding: 3px 9px; background: var(--surface); border: 1px solid var(--hair); border-radius: 7px; font: 600 20px/1.3 var(--sans); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lb-climber:hover .lb-score, .lb-route.is-selected .lb-score { background: var(--route-color); border-color: var(--route-color); color: #fff; }
.lb-route.is-selected .lb-rope, .lb-route.is-selected .lb-hold { opacity: .8; }
.lb-lanes { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); position: relative; margin-top: 88px; padding: 10px 0 14px; border-top: 4px solid var(--accent); font-size: 13px; font-weight: 600; text-align: center; }
.lb-lane { min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--ink); font: inherit; cursor: pointer; }
.lb-lane:hover, .lb-lane[aria-pressed="true"] { text-decoration: underline; text-underline-offset: 4px; }
.lb-figure figcaption { margin-top: 10px; font-size: 13px; color: var(--ink-2); }
.lb-detail { margin: 22px 0 12px; min-height: 2em; font-size: 15px; color: var(--ink-2); }
@media (max-width: 760px) {
  .lb-wall { padding: 58px 12px 0 34px; }
  .lb-plot { height: 300px; }
  .lb-grid span { right: calc(100% + 8px); }
  .lb-climber { width: 40px; height: 54px; transform: translate(-50%, 51px); }
  .lb-climber svg { width: 40px; height: 54px; }
  .lb-score { font-size: 15px; padding: 3px 5px; }
  .lb-lanes { margin-top: 62px; font-size: 10px; }
  .lb-detail { font-size: 14px; }
}

/* ---------- findings ---------- */
.takeaways { margin: 0; padding: 0; display: grid; gap: 72px; }
.finding-block { min-width: 0; }
.finding-block + .finding-block { border-top: 1px solid var(--hair); padding-top: 64px; }
.finding-block h3 { font-size: clamp(27px, 3vw, 36px); line-height: 1.2; font-weight: 600; margin: 0 0 20px; }
.finding-intro { max-width: 820px; margin-bottom: 28px; }
.finding-intro > p { color: var(--ink-2); font-size: 17px; margin: 0 0 16px; }
.finding-block .finding-ref { color: var(--muted); font: 500 12px var(--mono); margin: 0 0 14px; }
.finding-block .finding-answer { color: var(--ink); font-size: 19px; font-weight: 500; }
.finding-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.finding-question { font: 600 23px/1.3 var(--display); margin: 0 0 14px; }
.evidence-pair > div { display: flex; flex-direction: column; min-width: 0; }
.evidence-pair > div > p { font-size: 16px; color: var(--ink-2); margin: 0 0 22px; }
.evidence-pair figure { margin-top: auto; }
.evidence-reading { margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--hair); }
.chart-title { font: 600 15px/1.4 var(--sans); margin: 0 0 14px; }
.tk { min-width: 0; display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 36px; align-items: center; }
.tk h3 { font-size: clamp(24px, 2.3vw, 30px); line-height: 1.2; font-weight: 600; margin-bottom: 18px; }
.tk-copy p { color: var(--ink-2); font-size: 16px; margin: 0 0 14px; }
.tk-copy p:last-child { margin-bottom: 0; }
.tk-viz { margin: 0; padding: 18px 20px 14px; }
.bars { display: grid; gap: 10px; }
.bars-title { font: 600 14px var(--sans); color: var(--ink); margin: 6px 0 0; }
.bars-title:not(:first-child) { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--hair); }
.bar-row { display: grid; grid-template-columns: 128px 1fr 118px; align-items: center; gap: 12px; }
.bar-name { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); }
.bar-track { position: relative; height: 22px; background: var(--paper-2); border-radius: 0 6px 6px 0; }
.bar-fill { position: absolute; inset: 0 auto 0 0; border-radius: 0 6px 6px 0; }
.bar-val { font: 600 20px/1.1 var(--sans); letter-spacing: -0.02em; color: var(--ink); display: flex; flex-direction: column; }
.bar-val small { font: 500 12px var(--sans); letter-spacing: 0; color: var(--muted); margin-top: 2px; }
.viz-note { font-size: 12.5px; color: var(--muted); margin: 10px 0 0; line-height: 1.45; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { display: inline-block; width: 14px; height: 10px; border-radius: 3px; background: var(--c); }
.legend i.line { height: 2.4px; border-radius: 1px; width: 16px; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--sans); }
.axis text { font-size: 12px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.axis .axis-title { font-size: 11.5px; letter-spacing: .02em; }
.axis line { stroke: #dcecf9; }
.axis .base { stroke: #afcce3; }
.chart-label { font: 600 13px var(--sans); fill: var(--ink); }
.chart-note { font: 500 12px var(--sans); fill: var(--ink-2); }
.key { flex: 0 0 10px; width: 10px; height: 10px; border-radius: 3px; background: var(--c); transform: translateY(1px); display: inline-block; }
.waffle-top { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 14px; }
.wv { font: 600 40px/1 var(--sans); letter-spacing: -0.03em; margin: 0 0 6px; }
.wl { font-size: 13.5px; color: var(--ink-2); margin: 0; display: flex; gap: 8px; align-items: baseline; }
.waffle { display: grid; grid-template-columns: repeat(20, 1fr); gap: 5px 4px; margin-bottom: 12px; }
.person { width: 100%; height: auto; transition: transform .15s; }
.person:hover, .person:focus-visible { transform: translateY(-2px) scale(1.12); outline: none; }

/* ---------- tracking ---------- */
.trackers { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.tracker { margin: 0; padding: 26px; }
.tracker svg { width: 100%; height: auto; margin-bottom: 18px; }
.tracker h3 { font-size: 24px; font-weight: 600; margin-bottom: 8px; }
.tracker p { color: var(--ink-2); margin: 0; font-size: 16px; }

/* ---------- cite / footer ---------- */
.bib { position: relative; padding: 0; overflow: hidden; }
.bib pre { margin: 0; padding: 24px 26px; overflow-x: auto; font: 400 13.5px/1.6 var(--mono); color: var(--ink); }
.copy { position: absolute; top: 12px; right: 12px; padding: 7px 14px; font-size: 13.5px; background: var(--surface); }
.footer { margin-top: clamp(80px, 10vw, 120px); background: var(--paper-2); color: var(--ink); border-top: 1px solid var(--hair); }
.footer-in { max-width: var(--wrap); margin: 0 auto; padding: 40px var(--gutter); display: flex; flex-wrap: wrap; gap: 24px 32px; align-items: center; justify-content: space-between; }
.footer-identity { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px 32px; width: 100%; }
.lab-logos { display: flex; align-items: center; gap: 28px; }
.footer .light-logo { width: 112px; }
.footer .clan-logo { width: 44px; }
.footer p { margin: 0; font-size: 14.5px; }
.footer .muted { color: var(--ink-2); }


/* tooltip */
.tip {
  position: fixed; z-index: 80; pointer-events: none; padding: 8px 11px; border-radius: 10px;
  background: var(--ink); color: var(--paper); font-size: 13px; line-height: 1.35; box-shadow: 0 8px 24px -10px rgba(0,0,0,.4);
  transform: translate(-50%, calc(-100% - 12px));
}
.tip b { display: block; font-size: 16px; font-weight: 600; }

/* entrance */
.reveal { opacity: 0; transform: translateY(14px); animation: rise .8s cubic-bezier(.2,.7,.2,1) forwards; }
.hero-head .reveal:nth-child(1) { animation-delay: .05s; }
.hero-head .reveal:nth-child(2) { animation-delay: .12s; }
.hero-head .reveal:nth-child(3) { animation-delay: .22s; }
.hero-head .reveal:nth-child(4) { animation-delay: .3s; }
.hero-head .reveal:nth-child(5) { animation-delay: .36s; }
.hero-head .reveal:nth-child(6) { animation-delay: .42s; }
.panorama.reveal { animation-delay: .5s; }
.tldr .reveal { animation-delay: .6s; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .pipeline { grid-template-columns: 1fr 1fr; }
  .pipe:nth-child(2)::after { display: none; }
  .tk { grid-template-columns: 1fr; gap: 24px; }
  .trackers { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .finding-pair { grid-template-columns: 1fr; }
  .nav nav a:not(:last-child):not([href="#leaderboard"]) { display: none; }
  .stats { grid-template-columns: 1fr; }
  .stat + .stat { border-left: 0; border-top: 1px solid var(--hair); }
  .scrolly { grid-template-columns: 1fr; }
  .scrolly-figure { top: 58px; z-index: 2; background: var(--paper); padding: 8px 0; gap: 8px; }
  .scrolly-figure .score { font-size: 12.5px; padding: 9px 12px; }
  .score-num { font-size: 34px; }
  .step { min-height: 40vh; }
  .step p { font-size: 17px; background: color-mix(in srgb, var(--paper) 92%, transparent); }
  .pipeline { grid-template-columns: 1fr; }
  .pipe::after { display: none; }
  .b-dice { width: 32px; height: 32px; top: 6px; right: auto; left: 6px; }
  .b-dice svg { width: 20px; height: 20px; }
  .waffle { grid-template-columns: repeat(10, 1fr); }
  .bar-row { grid-template-columns: 96px 1fr 92px; gap: 8px; }
  #hero-scene { height: auto; aspect-ratio: 1200 / 470; border-radius: 16px; }
  #hero-scene text, #chip { display: none; }
  .scene-cap { display: block; font-size: 14px; color: var(--ink-2); margin: 10px 4px 0; }
  .scene-toggle { bottom: auto; top: 10px; right: 10px; width: 30px; height: 30px; }
  .overview-watch { bottom: 12px; font-size: 13px; padding: 10px 14px; gap: 8px; }
  .hero-video video { border-radius: 16px; }
  .overview-back { position: static; display: flex; width: fit-content; margin: 10px 0 0 auto; padding: 10px 12px; }
}
@media (max-width: 360px) {
  .links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .links .btn { justify-content: center; gap: 5px; padding: 11px 4px; font-size: 13px; white-space: nowrap; }
  .links .btn svg { width: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .story-scene * { animation: none !important; }
  html { scroll-behavior: auto; }
  .reveal { animation: none; opacity: 1; transform: none; }
  *, *::before, *::after { transition-duration: 0s !important; }
}
