/* Turbo-dLLM project page.
   Forked from the LLM-as-a-Verifier page (itself adapted from PolaRiS), re-themed to Stanford cardinal red. */

:root {
  --accent: #B1040E;
  --accent-deep: #8C1515;
  --accent-bright: #E2545C;
  --accent-06: rgba(177, 4, 14, 0.06);
  --accent-10: rgba(177, 4, 14, 0.10);
  --accent-22: rgba(177, 4, 14, 0.22);
  --slate: #7D848B;
  --slate-08: rgba(125, 132, 139, 0.08);
  --ink: #1C1C1C;
  --body: #4a4a4a;
  --muted: #7a7a7a;
  --line: rgba(0, 0, 0, 0.08);
  --display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --text: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'Fira Code', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

html { scroll-behavior: smooth; }
/* a little wider than the reference's 960px so the charts stay legible */
.container.is-max-desktop { max-width: 1040px; }
@media (min-width: 1300px) {
  .card-surface.wide { margin-left: -70px; margin-right: -70px; }
}
body { font-family: var(--text); color: var(--ink); background: #fff; }
[id] { scroll-margin-top: 28px; }
::selection { background: var(--accent-22); }

/* ---- Hero ---- */
.hero-flow {
  position: relative; overflow: hidden;
  padding: 56px 48px 44px;
  border-radius: 28px; margin-bottom: 34px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.10);
}
.hero-flow::before {
  content: ""; position: absolute; width: 620px; height: 620px; top: -260px; left: -160px;
  background: radial-gradient(circle, rgba(177, 4, 14, 0.13) 0%, rgba(177, 4, 14, 0) 70%);
  animation: orbFlow1 25s ease-in-out infinite; z-index: 0; pointer-events: none;
}
.hero-flow::after {
  content: ""; position: absolute; width: 520px; height: 520px; bottom: -210px; right: -110px;
  background: radial-gradient(circle, rgba(125, 132, 139, 0.12) 0%, rgba(125, 132, 139, 0) 70%);
  animation: orbFlow2 30s ease-in-out infinite; z-index: 0; pointer-events: none;
}
.hero-flow > * { position: relative; z-index: 1; }
.hero-flow .hero-orb {
  position: absolute; width: 460px; height: 460px; top: 40%; right: 8%; transform: translateY(-50%);
  background: radial-gradient(circle, rgba(226, 84, 92, 0.08) 0%, rgba(226, 84, 92, 0) 70%);
  animation: orbFlow3 28s ease-in-out infinite; z-index: 0; pointer-events: none;
}
.hero-text {
  font-family: var(--display); font-size: 46px; font-weight: 700; color: var(--ink);
  letter-spacing: -0.03em; line-height: 1.1; margin: 0 auto 22px; text-align: center; max-width: 860px; text-wrap: balance;
  animation: heroFadeUp .6s cubic-bezier(.2, .7, .2, 1) both;
}
.hero-text .accent {
  background: linear-gradient(120deg, var(--accent-deep) 0%, var(--accent) 45%, var(--accent-bright) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: var(--accent);
}
.hero-lead {
  font-family: var(--display); font-size: 22px; font-weight: 400; line-height: 1.5; color: #2a2a2a;
  max-width: 720px; margin: 0 auto 14px; text-align: center; text-wrap: balance;
  animation: heroFadeUp .6s cubic-bezier(.2, .7, .2, 1) both .08s;
}
.hero-lead .name { color: var(--accent-deep); font-weight: 700; }
@media (min-width: 769px) { .hero-lead .name { white-space: nowrap; } }
.hero-lead b { color: var(--ink); font-weight: 600; }
.nowrap { white-space: nowrap; }
.hero-support {
  font-family: var(--text); font-size: 16.5px; line-height: 1.6; color: #6b6b6b;
  max-width: 640px; margin: 0 auto 28px; text-align: center; text-wrap: balance;
  animation: heroFadeUp .6s cubic-bezier(.2, .7, .2, 1) both .14s;
}
.hero-support b { color: var(--ink); font-weight: 600; white-space: nowrap; }
.authors {
  font-size: 16px; color: var(--body); line-height: 2; margin: 0 0 22px; text-align: center;
  animation: heroFadeUp .6s cubic-bezier(.2, .7, .2, 1) both .2s;
}
.authors sup { font-size: 10px; color: var(--muted); margin-left: 1px; }
.authors .author { display: inline-block; white-space: nowrap; margin: 0 2px; }
.authors .author:not(:last-child)::after { content: ','; color: #9a9a9a; }
.authors .affiliation { display: block; font-size: 15px; color: var(--muted); margin-top: 10px; line-height: 1.6; }
.authors .affiliation .note { display: block; font-size: 13px; color: #9a9a9a; }

.hero-actions {
  display: flex; justify-content: center; gap: 14px; flex-wrap: wrap;
  animation: heroFadeUp .6s cubic-bezier(.2, .7, .2, 1) both .3s;
}
.cta {
  font-family: var(--text); font-weight: 600; font-size: 14px; text-decoration: none; padding: 12px 24px;
  border-radius: 12px; border: 1px solid rgba(0, 0, 0, 0.1); color: var(--ink); background: transparent;
  transition: transform .25s ease, box-shadow .25s ease, background .25s ease;
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; line-height: 1.2;
}
.cta:hover { transform: translateY(-2px); }
.cta:focus-visible { outline: 3px solid var(--accent-22); outline-offset: 2px; }
.cta.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.cta.primary:hover { box-shadow: 0 12px 32px rgba(177, 4, 14, 0.32); color: #fff; }
.cta.dark { background: #1a1a1a; border-color: #1a1a1a; color: #fff; }
.cta.dark:hover { background: #000; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22); color: #fff; }
.cta.install { font-family: var(--mono); font-weight: 500; background: #fff; border-color: var(--accent); color: var(--accent-deep); }
.cta.install:hover { background: #fff6f6; box-shadow: 0 12px 32px rgba(177, 4, 14, 0.18); }
.cta.install .prompt { color: var(--accent); font-weight: 700; }
.cta.install .copy-icon { opacity: .7; }
.cta.install .copied-label { display: none; font-family: var(--text); font-weight: 600; }
.cta.install.copied .copy-icon { display: none; }
.cta.install.copied .copied-label { display: inline; }


/* waves */
.hero-waves { position: relative; width: calc(100% + 96px); height: 72px; margin: 34px -48px -44px; overflow: hidden; opacity: 0.8; }
.waves-svg { width: 100%; height: 100%; display: block; }
.wave-parallax use { animation: waveShift 16s cubic-bezier(0.55, 0.5, 0.45, 0.5) infinite; }
.wave-parallax use:nth-child(1) { animation-delay: -2s; animation-duration: 16s; }
.wave-parallax use:nth-child(2) { animation-delay: -4s; animation-duration: 14s; }
.wave-parallax use:nth-child(3) { animation-delay: -6s; animation-duration: 20s; }
.wave-parallax use:nth-child(4) { animation-delay: -8s; animation-duration: 18s; }

@keyframes heroFadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes orbFlow1 { 0%, 100% { transform: translate(0, 0); } 25% { transform: translate(80px, 40px); } 50% { transform: translate(120px, -20px); } 75% { transform: translate(40px, 60px); } }
@keyframes orbFlow2 { 0%, 100% { transform: translate(0, 0); } 25% { transform: translate(-60px, -50px); } 50% { transform: translate(-100px, 30px); } 75% { transform: translate(-30px, -40px); } }
@keyframes orbFlow3 { 0%, 100% { transform: translateY(-50%) translate(0, 0); } 33% { transform: translateY(-50%) translate(-50px, 70px); } 66% { transform: translateY(-50%) translate(40px, -50px); } }
@keyframes waveShift { 0% { transform: translate3d(-90px, 0, 0); } 50% { transform: translate3d(20px, 0, 0); } 100% { transform: translate3d(-90px, 0, 0); } }

/* ---- Sections ---- */
.page-section { padding: 1.9rem 1.5rem; }
.page-section.tight { padding-top: 0.2rem; padding-bottom: 0.2rem; }
.sec-eyebrow {
  display: inline-block; font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--accent-deep); background: var(--accent-10); border: 1px solid var(--accent-22);
  border-radius: 999px; padding: 4px 12px; margin-bottom: 12px;
}
.tagline {
  font-family: var(--display); font-size: 28px; font-weight: 600; letter-spacing: -0.02em; color: var(--ink);
  display: block; margin: 0 0 20px; line-height: 1.2;
}
.tagline::after {
  content: ''; display: block; width: 100%; height: 3px; border-radius: 2px; margin-top: 14px;
  background: linear-gradient(90deg, var(--accent) 0%, rgba(177, 4, 14, 0.15) 40%, transparent 100%);
}
.tagline.tagline-sm { font-size: 24px; }
.tagline .num { color: var(--accent); }
.card-surface {
  background: #fff; border: 1px solid rgba(0, 0, 0, 0.06); border-radius: 24px; padding: 30px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08); transition: box-shadow .3s ease;
}
.card-surface:hover { box-shadow: 0 16px 48px rgba(0, 0, 0, 0.10); }
.card-surface img, .card-surface picture { width: 100%; display: block; margin: 0 auto; }
.card-surface + .card-surface { margin-top: 18px; }
.tldr-caption {
  font-family: var(--text); color: var(--muted); font-size: 14.5px; line-height: 1.7; max-width: 860px;
  margin: 18px auto 0; text-align: center;
}
.tldr-caption strong { color: var(--body); }
.tldr-caption .g { color: var(--accent-deep); font-weight: 700; }
.fig-label { font-family: var(--display); font-weight: 600; font-size: 15px; color: var(--ink); margin: 0 0 14px; display: flex; gap: 10px; align-items: center; }
.fig-label::before { content: ''; width: 22px; height: 3px; border-radius: 2px; background: linear-gradient(90deg, var(--accent), rgba(177, 4, 14, 0.35)); }
.fig-caption { font-family: var(--text); font-size: 13.5px; color: var(--muted); line-height: 1.6; margin: 14px 0 0; text-align: left; }

/* "How does it work?" band */
.how-band {
  position: relative; overflow: hidden; text-align: center; padding: 48px 34px; border-radius: 24px;
  background: linear-gradient(135deg, #fff 0%, #fbf1f2 100%); border: 1px solid var(--accent-22);
  box-shadow: 0 10px 30px rgba(177, 4, 14, 0.07); margin-bottom: 22px;
}
.how-band > * { position: relative; z-index: 1; }
.how-orb { position: absolute; border-radius: 50%; pointer-events: none; z-index: 0; }
.how-orb-1 { width: 300px; height: 300px; top: -140px; left: -90px; background: radial-gradient(circle, rgba(177, 4, 14, 0.13) 0%, rgba(177, 4, 14, 0) 70%); animation: orbFlow1 24s ease-in-out infinite; }
.how-orb-2 { width: 320px; height: 320px; bottom: -160px; right: -100px; background: radial-gradient(circle, rgba(125, 132, 139, 0.12) 0%, rgba(125, 132, 139, 0) 70%); animation: orbFlow2 28s ease-in-out infinite; }
.how-title { font-family: var(--display); font-size: 34px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); margin: 0; line-height: 1.15; }
.how-title span { color: var(--accent); }
.how-intro { font-size: 15.5px; color: #666; max-width: 700px; margin: 14px auto 0; line-height: 1.65; }
.how-list { list-style: none; max-width: 800px; margin: 22px auto 0; padding: 0; text-align: left; }
.how-list li { font-size: 15px; color: #333; line-height: 1.6; padding: 12px 0 12px 34px; position: relative; border-bottom: 1px solid rgba(0, 0, 0, 0.06); }
.how-list li:last-child { border-bottom: none; }
.how-list li::before { content: '\2192'; position: absolute; left: 4px; top: 11px; color: var(--accent); font-weight: 700; font-size: 16px; }
.how-list b { color: var(--ink); }

/* tables */
.mini-table-wrap { overflow-x: auto; margin: 4px auto 0; -webkit-overflow-scrolling: touch; }
.mini-table { width: 100%; margin: 0 auto; border-collapse: collapse; font-size: 13.5px; color: #333; font-variant-numeric: tabular-nums; }
.mini-table th, .mini-table td { border-bottom: 1px solid rgba(0, 0, 0, 0.08); padding: 10px 14px; text-align: right; white-space: nowrap; }
.mini-table th:first-child, .mini-table td:first-child { text-align: left; }
.mini-table thead th { color: var(--ink); font-weight: 600; font-size: 12.5px; border-bottom: 2px solid rgba(0, 0, 0, 0.14); vertical-align: bottom; }
.mini-table .group td { font-family: var(--mono); font-size: 10.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-deep); background: #fcf5f5; padding: 7px 14px; }
.mini-table tbody tr:not(.group):hover td { background: #fafafa; }
.mini-table .hl { color: var(--accent-deep); font-weight: 700; }
.mini-table .speed { display: inline-block; min-width: 58px; text-align: center; font-weight: 700; color: var(--accent-deep); background: var(--accent-10); border-radius: 999px; padding: 2px 10px; }
.mini-table .dim { color: var(--muted); }
.mini-table .oom { color: #3a3a3a; font-weight: 600; }
.mini-table .topo { font-family: var(--mono); font-size: 12px; color: #666; }
.mini-table .topo.ours { color: var(--accent-deep); }
.mini-table thead th.span { text-align: center; border-bottom: 1px solid rgba(0, 0, 0, 0.14); }
.mini-table thead th.span.ours { color: var(--accent-deep); }
.results-table thead tr:first-child th[rowspan] { vertical-align: bottom; }
.results-table td:nth-child(3), .results-table th:nth-child(3) { padding-right: 22px; }
.stack-subhead { font-family: var(--display); font-size: 17px; font-weight: 700; color: var(--ink); margin: 26px 0 10px; }
.stack-subhead:first-of-type { margin-top: 6px; }
.why-table td { white-space: normal; vertical-align: top; line-height: 1.5; }
.why-table td:first-child { white-space: nowrap; }
.why-table th:nth-child(2), .why-table td:nth-child(2) { color: var(--ink); }
.lib-table td, .lib-table th { white-space: nowrap; }
.table-note { font-size: 12.5px; color: var(--muted); margin: 12px 0 0; }

/* accordions */
.sub-accordion { border: 1px solid rgba(0, 0, 0, 0.09); border-radius: 14px; background: #fff; margin: 12px 0; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03); overflow: hidden; }
.sub-accordion > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 11px; padding: 17px 20px;
  font-family: var(--display); font-size: 16px; font-weight: 600; color: var(--ink); transition: background .15s;
}
.sub-accordion > summary:hover { background: var(--accent-06); }
.sub-accordion > summary::-webkit-details-marker { display: none; }
.sub-accordion > summary::before { content: ''; width: 22px; height: 3px; border-radius: 2px; background: linear-gradient(90deg, var(--accent), rgba(177, 4, 14, 0.35)); flex: 0 0 auto; }
.sub-accordion > summary::after { content: '\25B8'; margin-left: auto; color: var(--accent); transition: transform .2s ease; }
.sub-accordion[open] > summary::after { transform: rotate(90deg); }
.sub-accordion .acc-body { padding: 2px 20px 20px; }
.sub-accordion .acc-body p { font-size: 14px; color: #555; line-height: 1.7; margin: 0 0 12px; }

/* BibTeX */
.bibtex-wrap { position: relative; }
.bibtex {
  font-family: var(--mono); font-size: 12.5px; line-height: 1.7; color: #e6e6e6; background: #0f1115;
  border-radius: 14px; padding: 20px 22px; overflow-x: auto; white-space: pre; margin: 0;
}
.copy-bib {
  position: absolute; top: 12px; right: 12px; font-family: var(--text); font-size: 12px; font-weight: 600;
  color: #cfd3d8; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px; padding: 5px 10px; cursor: pointer;
}
.copy-bib:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }

/* footer */
.site-footer { padding: 2.2rem 1.5rem 2.6rem; text-align: center; font-size: 14px; color: #555; }
.site-footer a { color: var(--ink); }
.site-footer a:hover { color: var(--accent-deep); }
.site-footer .credit { font-size: 12.5px; color: #9a9a9a; margin-top: .6rem; }
.site-footer .credit a { color: inherit; text-decoration: underline; }

/* left section-progress nav */
.side-nav {
  position: fixed; left: 26px; top: 50%; transform: translateY(-50%); z-index: 25; display: flex; flex-direction: column;
  gap: 17px; padding-left: 6px; opacity: 0; pointer-events: none; transition: opacity .4s ease;
}
.side-nav.visible { opacity: 1; pointer-events: auto; }
.side-nav::before { content: ''; position: absolute; left: 11px; top: 5px; bottom: 5px; width: 2px; background: #e8e8e8; border-radius: 2px; }
.side-nav a { position: relative; display: flex; align-items: center; gap: 13px; text-decoration: none; color: #a6a6a6; font-size: 11.5px; font-weight: 600; letter-spacing: 0.02em; transition: color .2s; }
.side-nav a .dot { width: 9px; height: 9px; border-radius: 50%; background: #fff; border: 2px solid #cfcfcf; transition: all .22s ease; flex: 0 0 auto; z-index: 1; }
.side-nav a .lbl { white-space: nowrap; opacity: 0.5; transition: opacity .2s; }
.side-nav a:hover, .side-nav a.active { color: var(--accent-deep); }
.side-nav a:hover .lbl, .side-nav a.active .lbl { opacity: 1; }
.side-nav a:hover .dot { border-color: var(--accent); }
.side-nav a.active .dot { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px rgba(177, 4, 14, 0.16); }
@media (max-width: 1180px) { .side-nav { display: none; } }

/* scroll reveal (enabled by JS so content is visible without it) */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s cubic-bezier(.2, .7, .2, 1), transform .7s cubic-bezier(.2, .7, .2, 1); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---- Background: two workload cards ---- */
:root { --clean: #356F9F; --clean-fill: #E3ECF4; --corrupt: #B66718; --corrupt-fill: #F7EADB; }
.bg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.bg-card {
  background: #fff; border: 1px solid rgba(0, 0, 0, 0.07); border-radius: 22px; padding: 24px 24px 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.07); display: flex; flex-direction: column;
}
.bg-title { font-family: var(--display); font-size: 21px; font-weight: 700; letter-spacing: -0.015em; color: var(--ink); margin: 0 0 6px; line-height: 1.2; }
.bg-lede { font-size: 14px; color: #555; line-height: 1.55; margin: 0 0 14px; min-height: 2.9em; }
.bg-sub { font-family: var(--mono); font-size: 10.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: #9a9a9a; margin: 14px 0 2px; }
.bg-svg { width: 100%; height: auto; display: block; overflow: visible; }
.bg-svg.ruler { margin-top: 10px; }
.bg-foot { font-size: 13px; color: #666; line-height: 1.6; margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--line); margin-top: auto; }
.bg-foot b { color: var(--ink); font-weight: 600; }
.bg-bridge {
  font-family: var(--display); font-size: 18px; line-height: 1.55; color: #444; text-align: center; max-width: 820px;
  margin: 22px auto 0; padding: 16px 22px; border-radius: 16px; background: var(--accent-06); border: 1px solid var(--accent-22);
}
.bg-bridge strong { color: var(--ink); }
.bg-bridge .g { color: var(--accent-deep); font-weight: 700; }

.bg-svg text { font-family: var(--text); }
.bg-svg .lbl { font-size: 11px; fill: #777; }
.bg-svg .lbl.red { fill: var(--accent); }
.bg-svg .lbl.strong { font-weight: 700; }
.bg-svg .tok { fill: #efefef; stroke: #d4d4d4; }
.bg-svg .tok-bar, .bg-svg .anchor-bar { fill: #8a8a8a; }
.bg-svg .mask { fill: #fff; stroke: #b9b9b9; stroke-dasharray: 3 2; }
.bg-svg .mask-t { font-size: 10px; font-weight: 600; fill: #aaa; text-anchor: middle; font-family: var(--mono); }
.bg-svg .new { fill: #fbe6e8; stroke: var(--accent); stroke-width: 1.2; }
.bg-svg .new-bar { fill: var(--accent); }
.bg-svg .anchor { fill: #efefef; stroke: #9a9a9a; }
.bg-svg .clean { fill: var(--clean-fill); stroke: var(--clean); stroke-width: 1.2; }
.bg-svg .corrupt { fill: var(--corrupt-fill); stroke: var(--corrupt); stroke-width: 1.2; stroke-dasharray: 4 2; }
.bg-svg .feat rect { fill: var(--clean-fill); stroke: var(--clean); stroke-width: 1; }
.bg-svg .num-clean, .bg-svg .num-corrupt { font-size: 11.5px; font-weight: 700; text-anchor: middle; }
.bg-svg .num-clean { fill: var(--clean); }
.bg-svg .num-corrupt { fill: var(--corrupt); }
.bg-svg .dim { opacity: 0.42; }
.bg-svg .hi { stroke: var(--accent); stroke-width: 2; }
.bg-svg .target { stroke: var(--accent); stroke-width: 2.2; stroke-dasharray: none; }
.bg-svg .target-outline { fill: none; stroke: var(--accent); stroke-width: 2; }
.bg-svg .prefix-hi { fill: rgba(177, 4, 14, 0.05); stroke: var(--accent); stroke-width: 1.6; }
.bg-svg .flow { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-dasharray: 5 4; animation: dashFlow 1.1s linear infinite; }
.bg-svg .brace { fill: none; stroke: #777; stroke-width: 1.3; }
.bg-svg .arrow { stroke: #6b6b6b; stroke-width: 1.4; }
.bg-svg .box-dark { fill: #2b2b2b; }
.bg-svg .box-red { fill: var(--accent); }
.bg-svg .box-t { font-size: 11px; font-weight: 600; fill: #fff; text-anchor: middle; }
.bg-svg .check { font-size: 12px; font-weight: 700; fill: #2a7a45; text-anchor: middle; animation: bgCheck 4.8s ease-in-out infinite; }
.bg-svg .axis { stroke: #6b6b6b; stroke-width: 1.6; }
.bg-svg .pt { fill: #fff; stroke: #1C1C1C; stroke-width: 2; }
.bg-svg .reveal-a { animation: bgReveal 4.8s ease-in-out infinite; }
.bg-svg .reveal-b { animation: bgReveal 4.8s ease-in-out .45s infinite; }
.bg-svg .reveal-c { animation: bgRevealOnce 4.8s ease-in-out infinite; }
@keyframes dashFlow { to { stroke-dashoffset: -18; } }
@keyframes bgReveal { 0%, 28% { opacity: 0; } 38%, 86% { opacity: 1; } 96%, 100% { opacity: 0; } }
@keyframes bgRevealOnce { 0%, 22% { opacity: 0; } 30%, 86% { opacity: 1; } 96%, 100% { opacity: 0; } }
@keyframes bgCheck { 0%, 48% { opacity: 0; } 56%, 86% { opacity: 1; } 96%, 100% { opacity: 0; } }

/* ---- CSBP animation ---- */
.anim-card { margin-top: 22px; }
.anim-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.anim-head .fig-label { margin: 0; }
.anim-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: #555; }
.anim-legend span { display: inline-flex; align-items: center; gap: 6px; }
.anim-legend .sw { width: 18px; height: 11px; border-radius: 3px; display: inline-block; }
.sw-clean { background: var(--clean); }
.sw-corrupt { background: var(--corrupt); }
.sw-grad { background: transparent; border: 1.5px dashed #666; }
.sw-done { background: linear-gradient(90deg, #9aa0a6 50%, var(--accent) 50%); }
.sw-idle { background: repeating-linear-gradient(45deg, #f3f3f3 0 3px, #c9c9c9 3px 5px); border: 1px solid #d0d0d0; }
.anim-stage svg { width: 100%; height: auto; display: block; }
.anim-stage text { font-family: var(--text); }
.anim-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.anim-play {
  width: 38px; height: 34px; border-radius: 10px; border: 1px solid var(--accent-22); background: var(--accent-06);
  color: var(--accent); display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.anim-play svg { fill: currentColor; }
.anim-play:hover { background: var(--accent-10); }
.anim-play .i-play { display: none; }
.anim-play.paused .i-play { display: block; }
.anim-play.paused .i-pause { display: none; }
.anim-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.anim-chip {
  font-family: var(--text); font-size: 12.5px; font-weight: 600; color: #666; background: #f5f5f4; border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 999px; padding: 6px 12px; cursor: pointer; transition: all .2s ease;
}
.anim-chip b { display: inline-block; width: 17px; height: 17px; line-height: 17px; text-align: center; border-radius: 50%; background: #ddd; color: #fff; font-size: 10.5px; margin-right: 4px; }
.anim-chip:hover { color: var(--accent-deep); }
.anim-chip.active { color: var(--accent-deep); background: var(--accent-06); border-color: var(--accent-22); }
.anim-chip.active b { background: var(--accent); }
.anim-progress { flex: 1 1 120px; height: 4px; border-radius: 4px; background: #eee; overflow: hidden; min-width: 80px; }
.anim-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent-deep), var(--accent-bright)); }
.anim-caption { font-size: 14.5px; line-height: 1.6; color: #444; margin: 12px 0 0; min-height: 3.2em; }
.anim-caption b { color: var(--ink); }


@media (max-width: 768px) {
  .bg-grid { grid-template-columns: 1fr; }
  .bg-card { padding: 20px 16px 16px; }
  .bg-lede { min-height: 0; }
  .bg-bridge { font-size: 16px; text-align: left; }
  .anim-caption { font-size: 14px; min-height: 4.8em; }
  .anim-legend { gap: 12px; font-size: 12px; }
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .hero-flow { padding: 38px 22px 28px; border-radius: 22px; }
  .hero-text { font-size: 31px; }
  .hero-lead { font-size: 18px; }
  .hero-support { font-size: 15px; }
  .authors { font-size: 15px; line-height: 1.8; }
  .hero-waves { width: calc(100% + 44px); margin: 24px -22px -28px; height: 56px; }
  .page-section { padding: 1.4rem 1rem; }
  .tagline { font-size: 23px; }
  .tagline.tagline-sm { font-size: 20px; }
  .card-surface { padding: 16px; border-radius: 18px; }
  .how-band { padding: 34px 20px; }
  .how-title { font-size: 26px; }
  .tldr-caption { font-size: 14px; text-align: left; }
  .mini-table { font-size: 12.5px; }
  .mini-table th, .mini-table td { padding: 8px 9px; }
  .why-table th:not(:first-child), .why-table td:not(:first-child) { min-width: 190px; }
  .why-table tbody td:first-child, .why-table thead th:first-child,
  .results-table tbody tr:not(.group) > td:first-child, .results-table thead tr:first-child > th:first-child { position: sticky; left: 0; z-index: 1; background: #fff; box-shadow: 1px 0 0 rgba(0, 0, 0, 0.08); }
  .sub-accordion .acc-body { padding: 2px 14px 16px; }
}
@media (max-width: 480px) {
  .hero-text { font-size: 28px; }
  .cta { padding: 11px 18px; }
}

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