/* Codesign Gym — project page. Editorial "lab notebook" layout: warm paper, serif type, handwritten margin notes. */

:root {
  --paper: #f6f1e7;
  --paper-2: #efe7d7;
  --card: #fffdf8;
  --ink: #1f1d1a;
  --ink-2: #45413a;
  --muted: #766f62;
  --line: #e2d8c5;
  --line-2: #d3c7b0;
  --accent: #c4502f;
  --accent-soft: #f3d9cc;
  --teal: #1f6f68;
  --teal-soft: #d6ebe7;
  --hi: rgba(255, 207, 84, 0.55);
  --code-bg: #1d1b18;
  --code-ink: #efe9dc;
  --shadow: 0 1px 2px rgba(60, 45, 20, 0.06), 0 8px 28px rgba(60, 45, 20, 0.08);
  --serif: 'Source Serif 4', 'Source Serif Pro', Georgia, serif;
  --display: 'Fraunces', 'Source Serif 4', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --hand: 'Caveat', 'Bradley Hand', cursive;
  --wrap: 1120px;
  /* method palette: the paper figures' validated categorical slots */
  --m-cmaes: #2a78d6; --m-fasttd3: #eb6834; --m-ppo_ngopt: #1baf7a; --m-loki: #4a3aa7;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
html, body { overflow-x: hidden; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--serif); font-size: 18.5px; line-height: 1.65; -webkit-font-smoothing: antialiased; }
img, video, svg { max-width: 100%; display: block; }
figure { margin: 0; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }
button { font: inherit; color: inherit; }
code, kbd { font-family: var(--mono); font-size: 0.82em; background: var(--paper-2); border: 1px solid var(--line); border-radius: 5px; padding: 0.05em 0.35em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 720px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hand { font-family: var(--hand); font-weight: 600; color: var(--accent); line-height: 1.1; }
.mark { padding: 0 2px; }
.muted { color: var(--muted); }

/* ---------------------------------------------------------------- nav */
.nav { position: sticky; top: 0; z-index: 40; background: rgba(246, 241, 231, 0.86); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.nav.scrolled { border-bottom-color: var(--line); }
.nav .wrap { display: flex; align-items: center; gap: 22px; height: 60px; }
.brand { font-family: var(--display); font-weight: 600; font-size: 1.12rem; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 9px; white-space: nowrap; }
.brand .logo { width: 26px; height: 26px; }
.nav-links { display: flex; gap: 20px; margin-left: auto; font-family: var(--sans); font-size: 0.86rem; font-weight: 500; }
.nav-links a { color: var(--ink-2); text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; }
.nav-links a:hover, .nav-links a.on { color: var(--ink); border-bottom-color: var(--accent); }
.nav-gh { font-family: var(--sans); font-size: 0.84rem; font-weight: 600; color: var(--paper); background: var(--ink); text-decoration: none; padding: 7px 13px; border-radius: 999px; display: inline-flex; gap: 7px; align-items: center; white-space: nowrap; }
.nav-gh:hover { color: var(--paper); background: var(--accent); }

/* ---------------------------------------------------------------- hero */
.hero { padding: 56px 0 30px; position: relative; }
.hero-grid { display: grid; grid-template-columns: 1.02fr 1fr; gap: 48px; align-items: center; }
.kicker { font-family: var(--sans); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--teal); display: inline-flex; align-items: center; gap: 8px; }
.kicker::before { content: ''; width: 22px; height: 2px; background: var(--teal); display: inline-block; }
h1.title { font-family: var(--display); font-weight: 600; font-size: clamp(3rem, 6.4vw, 5.4rem); line-height: 0.98; letter-spacing: -0.02em; margin: 14px 0 20px; font-variation-settings: 'SOFT' 100, 'opsz' 144; }
h1.title em { font-style: italic; font-weight: 500; color: var(--accent); }
.lede { font-size: 1.22rem; line-height: 1.55; color: var(--ink-2); margin: 0 0 22px; max-width: 34em; }
.authors { font-family: var(--sans); font-size: 0.98rem; line-height: 1.9; margin: 0; }
.authors a { color: var(--ink); font-weight: 600; text-decoration: none; border-bottom: 1.5px solid var(--line-2); }
.authors a:hover { border-color: var(--accent); }
.authors .au { white-space: nowrap; }
.affils { list-style: none; margin: 6px 0 0; padding: 0; font-family: var(--sans); font-size: 0.86rem; color: var(--muted); line-height: 1.55; }
.authors sup, .affils sup { font-size: 0.68em; font-weight: 600; color: var(--accent); margin-left: 1px; }
.affil { font-family: var(--sans); font-size: 0.88rem; color: var(--muted); margin: 4px 0 0; }
.btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.btn { font-family: var(--sans); font-size: 0.9rem; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; text-decoration: none; border: 1.5px solid var(--ink); color: var(--ink); background: transparent; cursor: pointer; transition: transform .12s, background .12s, color .12s; }
.btn:hover { transform: translateY(-1px); background: var(--ink); color: var(--paper); }
.btn[hidden] { display: none; }
.btn.solid { background: var(--ink); color: var(--paper); }
.btn.solid:hover { background: var(--accent); border-color: var(--accent); }
.btn.soon { border-style: dashed; color: var(--muted); border-color: var(--line-2); cursor: default; }
.btn.soon:hover { transform: none; background: transparent; color: var(--muted); }
.pip { margin-top: 18px; display: inline-flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 0.88rem; background: var(--code-bg); color: var(--code-ink); padding: 9px 12px 9px 14px; border-radius: 10px; }
.pip .d { color: #8d8676; }
.icon-btn { background: transparent; border: 0; color: #aca493; cursor: pointer; padding: 2px 4px; border-radius: 5px; font-size: 0.85rem; }
.icon-btn:hover { color: #fff; background: rgba(255,255,255,.08); }

/* polaroid wall */
.wall { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 6px; }
.polaroid { margin: 0; background: var(--card); padding: 7px 7px 6px; border-radius: 3px; box-shadow: var(--shadow); transform: rotate(var(--r, 0deg)); transition: transform .25s ease, box-shadow .25s; position: relative; }
.polaroid:hover { transform: rotate(0deg) scale(1.04); z-index: 3; box-shadow: 0 14px 40px rgba(60,45,20,.18); }
.polaroid video { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: #222; border-radius: 1px; }
.polaroid figcaption { font-family: var(--hand); font-size: 1.12rem; color: var(--ink-2); text-align: center; line-height: 1.1; padding-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.polaroid .tape { position: absolute; top: -9px; left: 50%; width: 58px; height: 18px; transform: translateX(-50%) rotate(-3deg); background: rgba(236, 222, 190, .78); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.wall-note { grid-column: 1 / -1; position: relative; margin: 6px 4px 0 0; font-size: 1.3rem; transform: rotate(-2deg); text-align: right; padding-right: 4px; }
.wall-note svg { display: inline-block; width: 34px; height: 30px; vertical-align: -4px; margin-right: 6px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 70px 0 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat { padding: 20px 18px; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; padding-left: 0; }
.stat b { display: block; font-family: var(--display); font-size: 2.5rem; font-weight: 600; line-height: 1; color: var(--ink); font-variation-settings: 'SOFT' 100; }
.stat span { font-family: var(--sans); font-size: 0.86rem; color: var(--muted); display: block; margin-top: 6px; line-height: 1.4; }

/* one API branching into the three headline numbers */
.apitree { margin: 64px auto 0; max-width: 900px; text-align: center; }
.apitree a { text-decoration: none; color: var(--ink); }
.apitree a.at-hub { color: var(--paper); }
.at-hub { display: inline-flex; flex-direction: column; align-items: center; background: var(--ink); color: var(--paper); border-radius: 22px; padding: 18px 40px 20px; box-shadow: 0 14px 40px rgba(31,29,26,.22); transition: transform .15s; position: relative; z-index: 1; }
.at-hub:hover { transform: translateY(-2px); }
.at-hub b { font-family: var(--display); font-size: 5.6rem; font-weight: 600; line-height: .9; color: #f3a07e; font-variation-settings: 'SOFT' 100; }
.at-hub-t { font-family: var(--display); font-size: 2rem; font-weight: 600; line-height: 1; margin-top: -2px; }
.at-hub-s { font-family: var(--sans); font-size: 0.86rem; color: #cfc7b6; margin-top: 6px; }
.at-hub code { margin-top: 10px; background: rgba(255,255,255,.09); border: 0; color: #fff; font-size: 0.8rem; padding: 4px 10px; }
.at-lines { display: block; width: 100%; height: 70px; overflow: visible; }
.at-lines path { fill: none; stroke: var(--line-2); stroke-width: 2.5; stroke-linecap: round; vector-effect: non-scaling-stroke; stroke-dasharray: 400; stroke-dashoffset: 400; transition: stroke-dashoffset 1s ease .25s; }
.apitree.in .at-lines path { stroke-dashoffset: 0; }
.at-leaves { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.at-leaf { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px 16px 16px; display: flex; flex-direction: column; align-items: center; transition: transform .15s, box-shadow .15s, border-color .15s; opacity: 0; transform: translateY(10px); }
.apitree.in .at-leaf { opacity: 1; transform: none; transition: opacity .5s ease, transform .5s ease; }
.apitree.in .at-leaf:nth-child(1) { transition-delay: .9s; } .apitree.in .at-leaf:nth-child(2) { transition-delay: 1.02s; } .apitree.in .at-leaf:nth-child(3) { transition-delay: 1.14s; }
.apitree.in .at-leaf:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-2); transition-delay: 0s; }
.at-leaf b { font-family: var(--display); font-size: 3.4rem; font-weight: 600; line-height: 1; color: var(--ink); font-variation-settings: 'SOFT' 100; }
.at-leaf.at-win b { color: var(--accent); }
.at-l { font-family: var(--sans); font-size: 0.98rem; font-weight: 600; color: var(--ink); margin-top: 6px; }
.at-s { font-family: var(--sans); font-size: 0.8rem; color: var(--muted); margin-top: 3px; }
@media (prefers-reduced-motion: reduce) { .at-lines path { stroke-dashoffset: 0; transition: none; } .at-leaf { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- sections */
section.block { padding: 84px 0; }
section.block.alt { background: var(--paper-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sec-head { display: grid; grid-template-columns: 90px 1fr; gap: 18px; margin-bottom: 34px; align-items: baseline; }
.sec-num { font-family: var(--display); font-style: italic; font-size: 1.5rem; color: var(--accent); font-variation-settings: 'SOFT' 100; }
.sec-head h2 { font-family: var(--display); font-weight: 600; font-size: clamp(2rem, 3.6vw, 2.9rem); line-height: 1.08; letter-spacing: -0.015em; margin: 0 0 10px; font-variation-settings: 'SOFT' 60, 'opsz' 96; }
.sec-head p { margin: 0; color: var(--ink-2); font-size: 1.12rem; max-width: 40em; }
.prose p { margin: 0 0 1.05em; }
.prose p:last-child { margin-bottom: 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.two > *, .hero-grid > *, .res-top > * { min-width: 0; }
.aside-note { font-size: 1.35rem; transform: rotate(-1.5deg); margin: 14px 0 0; max-width: 20em; }

.paper-fig { background: var(--card); border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow); padding: 18px; }
.paper-fig img { width: 100%; height: auto; }
.zoom { display: block; cursor: zoom-in; }
.cap { font-family: var(--sans); font-size: 0.86rem; color: var(--muted); line-height: 1.55; margin-top: 12px; }
.cap b { color: var(--ink-2); }

/* ---------------------------------------------------------------- paper visuals */
.hero-fig { padding: 14px; margin-bottom: 26px; }
.envs-fig { padding: 14px; margin-bottom: 28px; }
.designs-fig { max-width: 560px; margin: 44px auto 0; }
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 40px; }
.pillar { background: var(--card); border: 1px solid var(--line); border-top: 5px solid var(--c); border-radius: 10px; padding: 14px 16px; font-family: var(--sans); }
.pillar b { display: block; font-family: var(--display); font-size: 1.35rem; font-weight: 600; color: var(--c); margin-bottom: 4px; }
.pillar .pl-hook { display: inline; font-family: var(--sans); font-size: inherit; color: var(--ink); margin: 0; }
.pillar span { font-size: 0.92rem; color: var(--ink-2); line-height: 1.5; }
.p-native { --c: #3b7fd4; } .p-extended { --c: #d0617a; } .p-reframed { --c: #4fae55; }
.slice { display: grid; grid-template-columns: 380px 1fr; gap: 34px; align-items: center; max-width: 820px; margin: 0 auto; }
.landscape canvas { width: 100%; height: auto; aspect-ratio: 560 / 440; display: block; }
.slice li { cursor: pointer; opacity: .5; transition: opacity .3s; border-radius: 6px; }
.slice li.on { opacity: 1; }
.slice li.on::before { background: var(--accent); }
.slice li:hover { opacity: .85; }
.slice ol { list-style: none; counter-reset: s; margin: 0; padding: 0; }
.slice li { counter-increment: s; font-size: 1.12rem; line-height: 1.5; padding: 10px 0 10px 44px; position: relative; border-bottom: 1px solid var(--line); }
.slice li::before { content: counter(s); position: absolute; left: 0; top: 9px; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--paper); font-family: var(--sans); font-size: 0.85rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.bignums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 26px; }
.bignums div { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; }
.bignums b { display: block; font-family: var(--display); font-size: 3.2rem; font-weight: 600; line-height: 1; color: var(--accent); font-variation-settings: 'SOFT' 100; }
.bignums b small { font-size: 0.45em; color: var(--muted); margin-left: 2px; }
.bignums span { display: block; font-family: var(--sans); font-size: 0.9rem; color: var(--ink-2); margin-top: 8px; line-height: 1.45; }
.take { display: grid; grid-template-columns: 1fr 1.15fr; gap: 16px; margin-bottom: 16px; }
.take > * { min-width: 0; }
.take-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px; box-shadow: var(--shadow); }
.take-k { font-family: var(--sans); font-size: 0.74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--teal); margin: 0 0 6px; }
.take-n { display: block; font-family: var(--display); font-size: 5.2rem; font-weight: 600; line-height: .95; color: var(--accent); font-variation-settings: 'SOFT' 100; letter-spacing: -0.02em; }
.take-n small { font-size: 0.34em; color: var(--muted); letter-spacing: 0; }
.take-l { font-family: var(--sans); font-size: 1rem; color: var(--ink-2); margin: 8px 0 18px; }
.take-s { font-family: var(--sans); font-size: 0.8rem; color: var(--muted); margin: 8px 0 0; }
.lbar { display: flex; gap: 3px; height: 44px; border-radius: 8px; overflow: hidden; }
.lkey { display: flex; gap: 3px; margin-top: 6px; font-family: var(--sans); font-size: 0.74rem; color: var(--ink-2); }
.lkey span { flex: var(--w) 1 0; line-height: 1.25; }
.lkey i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 4px; }
.lbar i { font-size: 1.05rem !important; flex: var(--w) 1 0; background: var(--c); color: #fff; font-style: normal; font-family: var(--sans); font-size: 0.8rem; font-weight: 700; display: flex; align-items: center; justify-content: center; white-space: nowrap; overflow: hidden; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.take-facts { list-style: none; margin: 18px 0 0; padding: 0; font-family: var(--sans); font-size: 0.9rem; color: var(--ink-2); }
.take-facts li { padding: 9px 0; border-top: 1px solid var(--line); display: flex; gap: 12px; align-items: baseline; }
.take-facts b { font-family: var(--display); font-size: 1.35rem; color: var(--ink); min-width: 74px; white-space: nowrap; }
.headroom { display: grid; gap: 7px; margin-top: 4px; }
.hr-row { display: grid; grid-template-columns: 150px 1fr 44px; gap: 10px; align-items: center; font-family: var(--sans); font-size: 0.8rem; }
.hr-name { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hr-name sup { color: var(--muted); }
.hr-track { position: relative; height: 14px; background: var(--paper-2); border-radius: 0 4px 4px 0; }
.hr-track::after { content: ''; position: absolute; right: 0; top: -3px; bottom: -3px; border-right: 2px dashed var(--line-2); }
.hr-track i { display: block; height: 100%; border-radius: 0 4px 4px 0; }
.hr-v { text-align: right; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.hr-key { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-family: var(--sans); font-size: 0.74rem; color: var(--ink-2); }
.hr-key i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; }
.cta { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; margin-top: 30px; padding: 26px 30px; border-radius: 16px; background: var(--ink); color: var(--paper); }
.cta h3 { font-family: var(--display); font-size: 2rem; font-weight: 600; margin: 0; color: var(--paper); }
.cta p { margin: 4px 0 0; font-family: var(--sans); color: #cfc7b6; }
.cta .hand { color: #f3a07e; font-size: 1.4rem; margin: 0 0 2px; }
.cta code { background: rgba(255,255,255,.1); border-color: transparent; color: #fff; }
.cta .btn { border-color: var(--paper); color: var(--paper); }
.cta .btn.solid { background: var(--paper); color: var(--ink); }
.cta .btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.sub-h { font-family: var(--display); font-size: 1.6rem; font-weight: 600; margin: 52px 0 18px; }
.more-wrap { text-align: center; margin-top: 22px; }
.more-wrap[hidden] { display: none; }
.credits-box { margin-top: 26px; font-family: var(--sans); }
.credits-box summary { cursor: pointer; font-weight: 600; font-size: 0.92rem; color: var(--ink-2); padding: 6px 0; }
.credits-box summary:hover { color: var(--accent); }
.credits-box .tbl-scroll { margin-top: 10px; }

/* ---------------------------------------------------------------- playground demos */
.demo-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); margin-bottom: 18px; }
.demo-tabs button { font-family: var(--sans); font-size: 0.9rem; font-weight: 600; border: 0; background: transparent; color: var(--ink-2); padding: 9px 16px; border-radius: 999px; cursor: pointer; display: inline-flex; gap: 8px; align-items: center; }
.demo-tabs button[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.demo { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.demo-side { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.demo-side .col { min-width: 0; }
.demo-side .knobs.col { margin: 0; }
.demo-side .span2 { grid-column: span 2; }
.wide-verdict { grid-column: 1 / -1; }
.demo[hidden] { display: none; }
.demo > * { min-width: 0; }
.demo-stage { background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; }
.demo-stage canvas { width: 100%; height: auto; display: block; touch-action: none; }
.demo.busy .demo-stage { box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow); }
.demo-cap { grid-column: 1 / -1; margin-top: 0; }
.scorecard { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px 14px; margin-bottom: 12px; }
.score-row { display: flex; align-items: center; gap: 16px; }
.score-row > div:first-child { min-width: 86px; }
.scorecard b { font-family: var(--display); font-size: 2.6rem; font-weight: 600; line-height: 1; display: block; font-variation-settings: 'SOFT' 100; font-variant-numeric: tabular-nums; }
.scorecard b.empty { color: var(--line-2); }
.card-h { font-family: var(--sans); font-size: 0.72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--teal); line-height: 1.2; margin: 0 0 10px; }
.card-h em { font-style: normal; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted); font-size: 0.8rem; margin-left: 6px; }
.scorecard span { font-family: var(--sans); font-size: 0.8rem; color: var(--muted); white-space: nowrap; }
.dots { display: grid; grid-template-columns: repeat(10, 1fr); gap: 5px; flex: 1; }
.dots i { aspect-ratio: 1; border-radius: 50%; background: var(--paper-2); border: 1.5px solid var(--line-2); }
.dots i.hit { background: #16a34a; border-color: #16a34a; }
.dots i.miss { background: transparent; border-color: #dc2626; position: relative; }
.dots i.miss::after { content: ''; position: absolute; inset: 42% 12%; background: #dc2626; transform: rotate(45deg); border-radius: 2px; }
.gen-bar { flex: 1; height: 8px; border-radius: 4px; background: var(--paper-2); overflow: hidden; }
.gen-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.knobs { border: 1px solid var(--line); border-radius: 10px; background: var(--card); padding: 12px 14px 14px; margin: 0 0 12px; }
.knobs label { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-family: var(--sans); font-size: 0.86rem; line-height: 1.3; color: var(--ink-2); margin-top: 10px; }
.knobs .card-h + label, .knobs .card-h + .chips-row { margin-top: 0; }
.knobs label b { font-family: var(--sans); font-size: 0.84rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.knobs input[type=range] { width: 100%; accent-color: var(--accent); margin: 2px 0 0; }
.meter { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--sans); font-size: 0.8rem; color: var(--muted); margin-top: 12px; }
.meter b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.bar { height: 7px; border-radius: 4px; background: var(--paper-2); overflow: hidden; margin-top: 5px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, #93b8f5, #2563eb); transition: width .15s; }
.demo-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.demo-btns .btn { font-size: 0.84rem; padding: 9px 14px; line-height: 1.2; }
.demo-btns.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.demo-btns.grid2 .btn { justify-content: center; text-align: center; }
.demo-btns .full { grid-column: 1 / -1; }
.demo.two-col .demo-side { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }
.demo.two-col .demo-btns { align-items: center; }
.demo.two-col .lb { margin-top: 12px; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.accent:hover { background: var(--ink); border-color: var(--ink); }
.btn.ghost { border-color: var(--line-2); }
.btn:disabled { opacity: .45; cursor: wait; transform: none; }
.verdict { font-family: var(--sans); font-size: 0.92rem; padding: 12px 16px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 8px 8px 0; color: var(--ink); min-height: 3.2em; line-height: 1.5; }
.board { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; font-family: var(--sans); }
.board { margin-top: 0; }
.board li { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; }
.board li span { display: block; font-size: 0.74rem; color: var(--muted); margin-bottom: 3px; }
.board li b.none { font-size: 0.8rem; font-weight: 500; color: var(--line-2); }
.board li b { font-family: var(--sans); font-size: 1rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.chips-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 6px; }
.chips-row .chip { font-size: 0.76rem; padding: 4px 10px; }
.gen-note { font-family: var(--sans); font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.lb { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; max-height: 330px; overflow: auto; }
.lb table { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 0.8rem; }
.lb th { font-size: 0.68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); text-align: right; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.lb th:first-child { text-align: left; }
.lb td { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: right; font-family: var(--sans); font-size: 0.82rem; font-variant-numeric: tabular-nums; white-space: nowrap; vertical-align: middle; }
.lb td:first-child { text-align: left; font-family: var(--sans); font-size: 0.8rem; display: flex; align-items: center; gap: 8px; }
.lb td em { color: var(--muted); font-style: normal; }
.lb tr[data-k] { cursor: pointer; }
.lb tr[data-k]:hover td { background: var(--paper); }
.lb tr.best td { background: var(--teal-soft); }
.lb tr.best td:first-child span::after { content: ' ★'; color: var(--accent); }
.chart-mini { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 10px 4px; margin-bottom: 12px; }
.chart-mini svg { width: 100%; height: auto; overflow: visible; font-family: var(--sans); }

/* ---------------------------------------------------------------- environment explorer */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 26px; }
.chip { font-family: var(--sans); font-size: 0.84rem; font-weight: 600; padding: 7px 13px; border-radius: 999px; border: 1.5px solid var(--line-2); background: transparent; color: var(--ink-2); cursor: pointer; transition: all .12s; }
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip .n { opacity: .6; font-weight: 500; margin-left: 4px; }
.env-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.env-group { margin-bottom: 34px; }
.env-group[hidden] { display: none; }
.grp-h { display: flex; align-items: baseline; gap: 12px; margin: 0 0 14px; padding-left: 12px; border-left: 5px solid var(--gc); }
.grp-h span { font-family: var(--display); font-size: 1.6rem; font-weight: 600; color: var(--gc); }
.grp-h em { font-style: normal; font-family: var(--sans); font-size: 0.88rem; color: var(--muted); }
.g-native { --gc: #3b7fd4; } .g-extended { --gc: #d0617a; } .g-reframed { --gc: #4fae55; }
.env .play-hint.still { background: rgba(20,18,15,.45); }
.env { background: var(--card); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; cursor: pointer; text-align: left; padding: 0; transition: transform .18s, box-shadow .18s; box-shadow: 0 1px 2px rgba(60,45,20,.05); }
.env:hover, .env:focus-visible { transform: translateY(-3px); box-shadow: var(--shadow); outline: none; }
.env:focus-visible { box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow); }
.env[hidden] { display: none; }
.env .media { position: relative; aspect-ratio: 16 / 10; background: #1c1b19; overflow: hidden; }
.env .media img, .env .media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.env .media video { opacity: 0; transition: opacity .25s; }
.env.playing .media video { opacity: 1; }
.env .play-hint { position: absolute; left: 10px; bottom: 10px; font-family: var(--sans); font-size: 0.72rem; font-weight: 600; color: #fff; background: rgba(20,18,15,.62); padding: 3px 8px; border-radius: 999px; display: inline-flex; gap: 6px; align-items: center; }
.env .ids { position: absolute; right: 10px; top: 10px; font-family: var(--mono); font-size: 0.7rem; color: #fff; background: rgba(20,18,15,.62); padding: 2px 7px; border-radius: 999px; }
.env .body { padding: 15px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.env h3 { font-family: var(--display); font-size: 1.12rem; font-weight: 600; margin: 0; line-height: 1.2; font-variation-settings: 'SOFT' 60; }
.env .sim { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); background: none; border: 0; padding: 0; margin: 3px 0 8px; }
.env p { font-size: 0.88rem; line-height: 1.5; color: var(--ink-2); margin: 0 0 12px; flex: 1; }
.dp { font-family: var(--sans); font-size: 0.8rem; line-height: 1.45; display: grid; grid-template-columns: auto 1fr; gap: 3px 8px; }
.dp dt { font-weight: 700; }
.dp dt.d { color: var(--teal); } .dp dt.p { color: var(--accent); }
.dp dd { margin: 0; color: var(--ink-2); }
.badge { font-family: var(--sans); font-size: 0.7rem; font-weight: 700; letter-spacing: .02em; padding: 2px 7px; border-radius: 4px; background: var(--teal-soft); color: var(--teal); display: inline-block; margin-top: 10px; align-self: flex-start; }

/* modal */
dialog.modal { border: 0; padding: 0; border-radius: 10px; max-width: min(980px, calc(100vw - 32px)); width: 100%; background: var(--card); color: var(--ink); box-shadow: 0 30px 80px rgba(20,15,5,.35); }
dialog.modal::backdrop { background: rgba(31, 29, 26, .55); backdrop-filter: blur(3px); }
.modal-grid { display: grid; grid-template-columns: 1.1fr 1fr; }
.modal-media { background: #1c1b19; display: flex; align-items: center; justify-content: center; min-height: 320px; }
.modal-media video, .modal-media img { width: 100%; height: 100%; object-fit: contain; max-height: 70vh; }
.modal-body { padding: 24px 26px 24px; max-height: 80vh; overflow: auto; }
.modal-body h3 { font-family: var(--display); font-size: 1.9rem; margin: 0 0 2px; font-weight: 600; line-height: 1.1; }
.modal-body .sim { margin-bottom: 14px; }
.modal-body p { font-size: 1rem; line-height: 1.6; color: var(--ink-2); }
.modal-body h4 { font-family: var(--sans); font-size: 0.74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 18px 0 6px; }
.presets { list-style: none; margin: 0; padding: 0; font-family: var(--sans); font-size: 0.86rem; }
.presets li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.presets li span:last-child { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); white-space: nowrap; }
.modal-close { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(255,253,248,.92); cursor: pointer; font-size: 1rem; z-index: 2; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.snippet { font-family: var(--mono); font-size: 0.8rem; background: var(--code-bg); color: var(--code-ink); padding: 10px 12px; border-radius: 6px; overflow-x: auto; white-space: pre; }
.credit { font-family: var(--sans); font-size: 0.8rem; color: var(--muted); margin-top: 14px; }
.media-note { font-family: var(--sans); font-size: 0.76rem; color: var(--muted); margin-top: 6px; font-style: italic; }

/* battle replays (Showdown client in an iframe, rendered at native width and scaled to fit) */
.replay-frame { position: relative; overflow: hidden; background: #3b3b3b; border-radius: 6px; }
.replay-frame iframe { border: 0; width: 800px; height: 458px; transform-origin: 0 0; display: block; }
dialog.replay-modal { max-width: min(900px, calc(100vw - 32px)); padding: 20px 22px 16px; }
.replay-head h3 { font-family: var(--display); font-size: 1.5rem; margin: 0 40px 2px 0; font-weight: 600; }
.replay-meta { font-family: var(--sans); font-size: 0.86rem; color: var(--muted); margin: 0 0 12px; }
.replay-note { margin-top: 10px; }
.modal.wide .modal-grid { grid-template-columns: 1fr; }
.modal.wide .modal-media { display: block; min-height: 0; background: var(--card); padding: 18px 18px 0; }
.rollout.replay { display: flex; flex-direction: column; }
.rollout.replay .team { aspect-ratio: auto; flex: 1; padding: 12px 12px 8px; background: var(--paper); display: flex; flex-direction: column; gap: 8px; }
.res { font-family: var(--sans); font-size: 0.74rem; font-weight: 700; align-self: flex-start; padding: 2px 8px; border-radius: 999px; background: var(--teal-soft); color: var(--teal); }
.res.lost { background: var(--accent-soft); color: var(--accent); }
.mons { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.mons li { font-family: var(--sans); font-size: 0.72rem; background: var(--card); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }
.team small { font-family: var(--sans); font-size: 0.7rem; color: var(--muted); }
.replay-btns { display: flex; gap: 6px; padding: 0 10px 10px; flex-wrap: wrap; }
.replay-btns button { font-family: var(--sans); font-size: 0.76rem; font-weight: 600; border: 1.5px solid var(--ink); background: var(--ink); color: var(--paper); border-radius: 999px; padding: 4px 10px; cursor: pointer; }
.replay-btns button.alt { background: transparent; color: var(--ink); border-color: var(--line-2); }
.replay-btns button:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------------------------------------------------------------- results */
.res-top { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; align-items: start; }
.picker { font-family: var(--sans); position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow: auto; padding-right: 6px; }
.picker h4 { font-size: 0.72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 14px 0 6px; }
.picker h4:first-child { margin-top: 0; }
.picker button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 5px 10px; border-radius: 6px; font-size: 0.88rem; color: var(--ink-2); cursor: pointer; }
.picker button:hover { background: var(--paper); color: var(--ink); }
.picker button[aria-pressed="true"] { background: var(--ink); color: var(--paper); font-weight: 600; }
.picker button small { opacity: .6; }
.picker small.new { opacity: 1; font-size: .66rem; font-weight: 700; color: #fff; background: var(--accent); border-radius: 999px; padding: 1px 6px; margin-left: 4px; vertical-align: 1px; }
.picker select { display: none; width: 100%; font: inherit; padding: 9px 10px; border-radius: 8px; border: 1.5px solid var(--line-2); background: var(--card); }
.chart-card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 18px 18px 14px; }
.chart-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.chart-head h3 { font-family: var(--display); font-size: 1.55rem; font-weight: 600; margin: 0; }
.chart-head .grp { font-family: var(--sans); font-size: 0.8rem; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.legend button { font-family: var(--sans); font-size: 0.82rem; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; border: 1.5px solid var(--line); background: var(--card); padding: 5px 11px 5px 9px; border-radius: 999px; cursor: pointer; color: var(--ink); }
.legend button svg { width: 26px; height: 10px; }
.legend button[aria-pressed="false"] { opacity: .42; }
.legend button[aria-pressed="false"] span { text-decoration: line-through; }
.chart { position: relative; }
.chart svg { width: 100%; height: auto; overflow: visible; font-family: var(--sans); }
.chart .tip { position: absolute; pointer-events: none; background: var(--card); border: 1px solid var(--line-2); border-radius: 8px; box-shadow: var(--shadow); padding: 8px 10px; font-family: var(--sans); font-size: 0.78rem; line-height: 1.5; min-width: 170px; opacity: 0; transition: opacity .1s; z-index: 5; }
.chart .tip.on { opacity: 1; }
.chart .tip b { font-weight: 700; }
.chart .tip .row { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.chart .tip .row i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.chart .tip .v { font-family: var(--mono); font-size: 0.75rem; color: var(--ink-2); }
.chart-foot { font-family: var(--sans); font-size: 0.78rem; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.tbl-toggle { font-family: var(--sans); font-size: 0.8rem; font-weight: 600; background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; }
table.final { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 0.86rem; margin-top: 12px; }
table.final th, table.final td { text-align: right; padding: 7px 8px; border-bottom: 1px solid var(--line); }
table.final th:first-child, table.final td:first-child { text-align: left; }
table.final th { font-size: 0.72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
table.final td { font-family: var(--mono); font-size: 0.8rem; white-space: nowrap; }
table.final td:first-child { font-family: var(--sans); font-weight: 600; font-size: 0.86rem; }
table.final tr.best td { font-weight: 700; }
table.final tr.best td:first-child::after { content: ' ★'; color: var(--accent); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; vertical-align: 0; }
.rollouts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 18px; }
.rollout { background: var(--card); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.rollout video { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: #1c1b19; }
.rollout.wide-roll { grid-column: 1 / -1; max-width: 520px; }
.rollout.wide-roll video { aspect-ratio: 16 / 10; }
.rollout .none { aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; text-align: center; padding: 14px; font-family: var(--sans); font-size: 0.78rem; color: var(--muted); background: var(--paper); }
.rollout .lab { font-family: var(--sans); font-size: 0.8rem; padding: 7px 10px 8px; display: flex; flex-direction: column; gap: 1px; border-top: 3px solid var(--c, var(--line)); }
.rollout .lab b { font-weight: 700; }
.rollout .lab span { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); }
.roll-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 26px; flex-wrap: wrap; }
.roll-bar h4 { font-family: var(--display); font-size: 1.2rem; margin: 0; font-weight: 600; }
.wins { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 30px; }
.win { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; border-top: 4px solid var(--c); }
.win b { font-family: var(--display); font-size: 2rem; font-weight: 600; line-height: 1; display: block; }
.win span { font-family: var(--sans); font-size: 0.82rem; color: var(--muted); }
.win strong { font-family: var(--sans); font-size: 0.92rem; display: block; margin-bottom: 6px; color: var(--ink); }

/* ---------------------------------------------------------------- API */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid #3a362f; background: var(--code-bg); border-radius: 10px 10px 0 0; padding: 8px 8px 0; overflow-x: auto; }
.tabs button { font-family: var(--sans); font-size: 0.82rem; font-weight: 600; color: #aca493; background: transparent; border: 0; padding: 8px 12px; border-radius: 7px 7px 0 0; cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--code-ink); background: #2a2723; }
.code { position: relative; background: #2a2723; color: var(--code-ink); border-radius: 0 0 10px 10px; padding: 18px 20px; font-family: var(--mono); font-size: 0.84rem; line-height: 1.7; overflow-x: auto; }
.code pre { margin: 0; white-space: pre; }
.code[hidden] { display: none; }
.code .copy { position: absolute; top: 10px; right: 10px; font-family: var(--sans); font-size: 0.74rem; background: rgba(255,255,255,.08); color: #cfc7b6; border: 0; border-radius: 6px; padding: 4px 9px; cursor: pointer; }
.code .copy:hover { background: rgba(255,255,255,.16); color: #fff; }
.k { color: #f2a07b; } .s { color: #b5d68d; } .c { color: #8d8676; font-style: italic; } .f { color: #89c4e1; } .n { color: #e6c07b; }
.facts { list-style: none; padding: 0; margin: 0; }
.facts li { padding: 12px 0 12px 34px; border-bottom: 1px solid var(--line); position: relative; font-size: 1rem; }
.facts li::before { content: attr(data-n); position: absolute; left: 0; top: 12px; font-family: var(--display); font-style: italic; color: var(--accent); font-size: 1.1rem; }
.facts b { font-weight: 600; }

.figs-stack { display: grid; gap: 28px; max-width: 980px; margin: 52px auto 0; }

/* ---------------------------------------------------------------- team */
.people { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 34px; }
.person { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
.person .av { width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 600; font-size: 1.1rem; color: #fff; margin-bottom: 10px; }
.person b { font-family: var(--sans); font-size: 0.98rem; display: block; }
.person span { font-family: var(--sans); font-size: 0.8rem; color: var(--muted); line-height: 1.45; display: block; margin-top: 3px; }
table.credits { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 0.86rem; }
table.credits th, table.credits td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.credits th { font-size: 0.72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
table.credits td:first-child { font-weight: 600; white-space: nowrap; }
.tbl-scroll { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; }

/* bibtex + footer */
.bib { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 18px 20px; font-family: var(--mono); font-size: 0.84rem; line-height: 1.7; overflow-x: auto; }
.bib pre { margin: 0; white-space: pre-wrap; padding-right: 110px; }
.bib .copy { position: absolute; top: 10px; right: 10px; font-family: var(--sans); font-size: 0.76rem; font-weight: 600; border: 1.5px solid var(--line-2); background: var(--paper); border-radius: 999px; padding: 4px 11px; cursor: pointer; }
footer { padding: 46px 0 60px; font-family: var(--sans); font-size: 0.84rem; color: var(--muted); border-top: 1px solid var(--line); }
footer .cols { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; }
footer a { color: var(--ink-2); }
footer p { margin: 0 0 10px; line-height: 1.6; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease var(--d, 0ms), transform .6s cubic-bezier(.2,.7,.2,1) var(--d, 0ms); }
.reveal.in { opacity: 1; transform: none; }
html:not(.motion) .reveal { opacity: 1; transform: none; }

/* ---------------------------------------------------------------- transitions (only with .motion) */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); z-index: 60; pointer-events: none; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes drop { 0% { opacity: 0; transform: translateY(-26px) rotate(calc(var(--r, 0deg) * -2.5)) scale(.96); } 70% { opacity: 1; } 100% { opacity: 1; transform: rotate(var(--r, 0deg)); } }
.motion .hero .kicker, .motion .hero .title, .motion .hero .lede, .motion .hero .authors, .motion .hero .affils, .motion .hero .btns, .motion .hero .pip { animation: rise .8s cubic-bezier(.2,.7,.2,1) both; }
.motion .hero .title { animation-delay: .08s; } .motion .hero .lede { animation-delay: .2s; } .motion .hero .authors { animation-delay: .3s; }
.motion .hero .affils { animation-delay: .36s; } .motion .hero .btns { animation-delay: .44s; } .motion .hero .pip { animation-delay: .52s; }
.motion .polaroid { animation: drop .9s cubic-bezier(.2,.7,.2,1) both; }
.motion .polaroid:nth-child(1) { animation-delay: .35s; } .motion .polaroid:nth-child(2) { animation-delay: .45s; } .motion .polaroid:nth-child(3) { animation-delay: .55s; }
.motion .polaroid:nth-child(4) { animation-delay: .65s; } .motion .polaroid:nth-child(5) { animation-delay: .75s; } .motion .polaroid:nth-child(6) { animation-delay: .85s; }
.motion .wall-note { animation: rise .8s ease 1.1s both; }
/* section headings: number slides in, title rises, highlight sweeps */
.motion .sec-head .sec-num { opacity: 0; transform: translateX(-16px); transition: opacity .6s ease .05s, transform .7s cubic-bezier(.2,.7,.2,1) .05s; }
.motion .sec-head h2 { opacity: 0; transform: translateY(16px); transition: opacity .7s ease .12s, transform .8s cubic-bezier(.2,.7,.2,1) .12s; }
.motion .sec-head p { opacity: 0; transition: opacity .8s ease .3s; }
.motion .sec-head.in .sec-num, .motion .sec-head.in h2, .motion .sec-head.in p { opacity: 1; transform: none; }
.motion .mark { background-size: 0% 100%; background-repeat: no-repeat; background-image: linear-gradient(transparent 58%, var(--hi) 58%, var(--hi) 92%, transparent 92%); background-color: transparent; transition: background-size 1s cubic-bezier(.2,.7,.2,1) .7s; }
.motion .in .mark, .motion .hero .mark { background-size: 100% 100%; }
.motion .hero .mark { transition-delay: .9s; }
.mark { background: linear-gradient(transparent 58%, var(--hi) 58%, var(--hi) 92%, transparent 92%); }
/* containers whose children enter one by one */
.motion .stagger > * { opacity: 0; transform: translateY(16px); transition: opacity .55s ease calc(var(--i, 0) * 90ms + .1s), transform .65s cubic-bezier(.2,.7,.2,1) calc(var(--i, 0) * 90ms + .1s); }
.motion .stagger.in > * { opacity: 1; transform: none; }
/* paper figures: soft zoom in */
.motion .paper-fig.reveal img { transform: scale(1.035); transition: transform 1.4s cubic-bezier(.2,.7,.2,1) .1s; }
.motion .paper-fig.reveal.in img { transform: none; }
.paper-fig { overflow: hidden; }
/* bars grow from zero */
.motion .headroom .hr-track i { transform: scaleX(0); transform-origin: 0 50%; transition: transform 1s cubic-bezier(.2,.7,.2,1); }
.motion .headroom.in .hr-track i { transform: scaleX(1); }
.motion .headroom .hr-row:nth-child(1) i { transition-delay: .1s; } .motion .headroom .hr-row:nth-child(2) i { transition-delay: .16s; } .motion .headroom .hr-row:nth-child(3) i { transition-delay: .22s; }
.motion .headroom .hr-row:nth-child(4) i { transition-delay: .28s; } .motion .headroom .hr-row:nth-child(5) i { transition-delay: .34s; } .motion .headroom .hr-row:nth-child(6) i { transition-delay: .4s; }
.motion .headroom .hr-row:nth-child(7) i { transition-delay: .46s; } .motion .headroom .hr-row:nth-child(8) i { transition-delay: .52s; } .motion .headroom .hr-row:nth-child(9) i { transition-delay: .58s; } .motion .headroom .hr-row:nth-child(10) i { transition-delay: .64s; }
.motion .leaders .lbar i { transform: scaleY(0); transform-origin: 50% 100%; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.motion .leaders.in .lbar i { transform: none; }
.motion .leaders .lbar i:nth-child(2) { transition-delay: .1s; } .motion .leaders .lbar i:nth-child(3) { transition-delay: .2s; } .motion .leaders .lbar i:nth-child(4) { transition-delay: .3s; }
/* the API hub pops, then its branches draw (see .apitree rules) */
.motion .apitree .at-hub { transform: scale(.92); opacity: 0; transition: transform .7s cubic-bezier(.2,1.4,.4,1), opacity .5s ease; }
.motion .apitree.in .at-hub { transform: none; opacity: 1; }
.motion .apitree.in .at-hub:hover { transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } .polaroid, .env { transition: none; } html { scroll-behavior: auto; } }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1000px) {
  .hero-grid, .two { grid-template-columns: 1fr; }
  .demo-side { grid-template-columns: 1fr 1fr; }
  .demo-side > .col:last-child:nth-child(3) { grid-column: 1 / -1; }
  .demo-side .span2 { grid-column: 1 / -1; }
  .wall { max-width: 560px; margin: 10px auto 40px; }
  .env-grid { grid-template-columns: repeat(2, 1fr); }
  .res-top { grid-template-columns: 1fr; }
  .picker { position: static; max-height: none; }
  .picker .list { display: none; }
  .picker select { display: block; }
  .people { grid-template-columns: repeat(2, 1fr); }
  .pillars, .bignums, .take { grid-template-columns: 1fr; }
  .at-lines { display: none; }
  .at-leaves { grid-template-columns: 1fr; gap: 10px; position: relative; padding-top: 18px; }
  .at-leaves::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 20px; border-left: 2.5px solid var(--line-2); z-index: 0; }
  .at-leaf { position: relative; z-index: 1; flex-direction: row; gap: 14px; text-align: left; padding: 12px 16px; }
  .at-leaf b { font-size: 2.4rem; min-width: 56px; text-align: center; }
  .at-leaf .at-l { margin-top: 0; } .at-leaf .at-s { display: none; }
  .at-hub { padding: 14px 30px 16px; } .at-hub b { font-size: 4.2rem; }
  .take-n { font-size: 4rem; }
  .hr-row { grid-template-columns: 112px 1fr 40px; font-size: 0.74rem; }
  .slice { grid-template-columns: 1fr; justify-items: center; }
  .landscape { width: 100%; max-width: 420px; }
  .nav-links { display: none; }
  .nav-gh { margin-left: auto; }
}
@media (max-width: 640px) {
  body { font-size: 17px; }
  .wrap { padding: 0 16px; }
  .hero { padding-top: 32px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: 0; padding-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .sec-head { grid-template-columns: 1fr; gap: 2px; }
  section.block { padding: 60px 0; }
  .env-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .env .sim, .env .ids { display: none; }
  .env .body { padding: 10px 11px 12px; }
  .env h3 { font-size: 1rem; }
  .env p { font-size: 0.8rem; }
  .grp-h { flex-direction: column; gap: 2px; }
  .wall { gap: 10px; }
  .polaroid figcaption { font-size: 0.95rem; }
  .wall-note { text-align: center; font-size: 1.15rem; }
  .modal-grid { grid-template-columns: 1fr; }
  .modal-media { min-height: 200px; }
  .demo-tabs button { padding: 8px 11px; font-size: 0.84rem; }
  .demo-side, .demo.two-col .demo-side { grid-template-columns: 1fr; }
  .demo-side .span2 { grid-column: auto; }
  .rollouts, .wins { grid-template-columns: repeat(2, 1fr); }
  .people { grid-template-columns: 1fr; }
  footer .cols { grid-template-columns: 1fr; }
  .pip { font-size: 0.78rem; }
  table.final th, table.final td { padding: 7px 5px; }
  .chart-card { padding: 14px 12px 12px; }
}
