:root {
  --bg: #050607;
  --bg-2: #0a0c0f;
  --card: #0f1216;
  --card-2: #151920;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #f3f4f6;
  --muted: #a0a4ad;
  --dim: #646873;
  --g1: #30d159;
  --g2: #63d1ff;
  --g3: #0a85ff;
  --tls: #30d159;
  --mls: #59d1ff;
  --uls: #ffb84d;
  --red: #ff6a5f;
  --grad: linear-gradient(90deg, var(--g1), var(--g2) 55%, var(--g3));
  --radius: 18px;
  --wide: 1180px;
  --narrow: 820px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--g2); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img, video { max-width: 100%; display: block; }
figure { margin: 0; }
em { font-style: italic; }
code, pre { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; }

.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.wrap { width: min(var(--wide), 100% - 32px); margin: 0 auto; }
.narrow { width: min(var(--narrow), 100% - 32px); margin: 0 auto; }

/* ------------------------------------------------------------------ nav */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px;
  background: rgba(5, 6, 7, 0.72);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
  transform: translateY(-100%);
  transition: transform 0.35s ease;
}
.topbar.show { transform: none; }
.topbar .brand { color: var(--text); font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.topbar nav { display: flex; gap: 22px; }
.topbar nav a { color: var(--muted); font-size: 14px; }
.topbar nav a:hover { color: var(--text); text-decoration: none; }

/* ------------------------------------------------------------------ hero */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 96px 0 72px;
  overflow: hidden;
  isolation: isolate;
}
.hero::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(60% 50% at 50% 38%, rgba(48, 209, 89, 0.10), transparent 70%),
    radial-gradient(45% 40% at 72% 70%, rgba(10, 133, 255, 0.10), transparent 70%);
}
#hero-canvas {
  position: absolute; inset: 0; z-index: -1;
  width: 100%; height: 100%;
  opacity: 0.42;
  -webkit-mask-image: radial-gradient(70% 70% at 50% 45%, #000 35%, transparent 80%);
  mask-image: radial-gradient(70% 70% at 50% 45%, #000 35%, transparent 80%);
}
.hero-inner { position: relative; text-align: center; width: min(1060px, 100% - 32px); }
.hero-inner::before {   /* a soft shadow behind the text so the tree never fights it */
  content: ""; position: absolute; inset: 8% -6% 4%; z-index: -1;
  background: radial-gradient(closest-side, rgba(5, 6, 7, 0.78), rgba(5, 6, 7, 0.45) 60%, transparent);
  filter: blur(10px);
}
.venue {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 16px 7px 12px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 14px; font-weight: 500;
}
.venue .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--g1); box-shadow: 0 0 12px var(--g1); }
.venue b { font-weight: 600; }
h1 {
  margin: 28px 0 10px;
  font-size: clamp(42px, 7.4vw, 92px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 700;
}
.subtitle {
  margin: 0 auto;
  max-width: 760px;
  color: var(--muted);
  font-size: clamp(19px, 2.3vw, 26px);
  line-height: 1.35;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.authors {
  margin: 34px 0 4px;
  display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 34px;
  font-size: 20px; font-weight: 600;
}
.affil { margin: 0; color: var(--muted); font-size: 16px; }
.buttons {
  margin-top: 34px;
  display: flex; justify-content: center; flex-wrap: wrap; gap: 12px;
}
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 11px 20px 11px 16px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 15px; font-weight: 600;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.btn:hover { text-decoration: none; background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.28); transform: translateY(-1px); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.primary { background: var(--text); color: #050607; border-color: transparent; }
.btn.primary:hover { background: #fff; }
.btn.disabled { opacity: 0.45; cursor: default; pointer-events: none; }
.btn small { font-weight: 500; color: var(--muted); font-size: 12px; }
.scroll-cue {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%);
  width: 26px; height: 42px; border-radius: 14px; border: 1.5px solid var(--line-2);
}
.scroll-cue::after {
  content: ""; position: absolute; left: 50%; top: 9px; width: 4px; height: 8px; margin-left: -2px;
  border-radius: 2px; background: var(--muted); animation: cue 1.8s ease-in-out infinite;
}
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(12px); } }

/* ------------------------------------------------------------------ sections */
section { padding: 110px 0; position: relative; }
section + section { border-top: 1px solid var(--line); }
.eyebrow {
  display: block; margin-bottom: 14px;
  color: var(--g2); font-size: 13px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
}
h2 {
  margin: 0 0 22px;
  font-size: clamp(32px, 4.4vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 700;
}
h3 { margin: 0 0 10px; font-size: 21px; letter-spacing: -0.015em; font-weight: 600; }
.lede { color: var(--muted); font-size: 19px; max-width: 760px; margin: 0 0 40px; }
.center { text-align: center; }
.center .lede { margin-left: auto; margin-right: auto; }

/* ------------------------------------------------------------------ film */
.film { padding-top: 40px; border-top: 0 !important; }
.video-frame {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--line-2);
  background: #000;
  box-shadow: 0 40px 120px -40px rgba(10, 133, 255, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.02);
}
.video-frame video { width: 100%; aspect-ratio: 16 / 9; background: #000; }
.film .caption { margin: 18px 0 0; text-align: center; color: var(--dim); font-size: 14px; }

/* ------------------------------------------------------------------ stats */
.stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
  margin-top: 64px;
}
.stat {
  padding: 30px 28px 28px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--line);
}
.stat .num { font-size: clamp(40px, 4.6vw, 58px); font-weight: 700; letter-spacing: -0.04em; line-height: 1; white-space: nowrap; }
.stat .num .arrow { color: var(--dim); font-weight: 500; }
.stat .num .red { color: var(--red); }
.stat p { margin: 14px 0 0; color: var(--muted); font-size: 15.5px; line-height: 1.5; }

/* ------------------------------------------------------------------ abstract */
.abstract p { font-size: 18.5px; line-height: 1.75; color: #d6d8dd; margin: 0; }

/* ------------------------------------------------------------------ dataset */
.platforms { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 26px; }
.platform {
  position: relative; overflow: hidden;
  padding: 26px 26px 24px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--line);
}
.platform::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--c);
  box-shadow: 0 0 24px var(--c);
}
.platform .tag { color: var(--c); font-weight: 700; font-size: 14px; letter-spacing: 0.08em; }
.platform h3 { margin: 6px 0 2px; font-size: 24px; }
.platform .how { color: var(--muted); font-size: 15px; margin: 0 0 18px; }
.platform .counts { display: flex; gap: 28px; }
.platform .counts b { display: block; font-size: 30px; letter-spacing: -0.03em; line-height: 1.1; }
.platform .counts span { color: var(--dim); font-size: 13.5px; }

.figure {
  margin: 0;
  border-radius: var(--radius);
  background: #fff;
  padding: clamp(14px, 2.4vw, 28px);
  border: 1px solid var(--line);
}
.figure img { width: 100%; height: auto; }
figcaption, .note { color: var(--dim); font-size: 14.5px; line-height: 1.55; margin-top: 14px; }
.figure + figcaption { margin-bottom: 0; }

/* ------------------------------------------------------------------ method */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 34px 0 0; padding: 0; list-style: none; counter-reset: s; }
.steps li { padding: 24px 24px 22px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); counter-increment: s; }
.steps li::before {
  content: counter(s, decimal-leading-zero);
  display: block; margin-bottom: 10px;
  font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 13px; color: var(--g2);
}
.steps p { margin: 0; color: var(--muted); font-size: 15.5px; line-height: 1.6; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }

/* ------------------------------------------------------------------ viewer */
.viewer {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 0;
  border-radius: 24px; overflow: hidden;
  border: 1px solid var(--line-2);
  background: var(--bg-2);
}
.stage { position: relative; min-height: 560px; background: radial-gradient(80% 70% at 50% 45%, #0c1117, #030405 75%); cursor: grab; touch-action: pan-y; }
.stage:active { cursor: grabbing; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage .hint {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
  padding: 6px 12px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.55); border: 1px solid var(--line);
  color: var(--muted); font-size: 12.5px; white-space: nowrap; pointer-events: none;
}
.stage .scale { position: absolute; right: 18px; top: 16px; color: var(--dim); font-size: 12.5px; font-family: "JetBrains Mono", monospace; }
.stage .loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--dim); font-size: 14px; }
.panel { padding: 28px 30px 30px; border-left: 1px solid var(--line); display: flex; flex-direction: column; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line);
  color: var(--muted); font: inherit; font-size: 13.5px; font-style: italic; cursor: pointer;
  transition: all 0.2s;
}
.chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); flex: none; }
.chip:hover { color: var(--text); border-color: var(--line-2); }
.chip[aria-pressed="true"] { color: var(--text); background: rgba(255, 255, 255, 0.10); border-color: rgba(255, 255, 255, 0.3); }
.pred-label { color: var(--dim); font-size: 12.5px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600; }
.pred-name { margin: 4px 0 6px; font-size: clamp(28px, 3vw, 36px); font-style: italic; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
.verdict { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; }
.verdict.ok { color: var(--g1); }
.verdict.bad { color: var(--red); }
.verdict em { font-weight: 500; }
.bars { margin: 22px 0 22px; display: grid; gap: 11px; }
.bar { display: grid; grid-template-columns: minmax(0, 1fr) 62px; gap: 4px 12px; align-items: center; font-size: 14.5px; }
.bar .name { font-style: italic; color: #d9dbe0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar .pct { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.bar .track { grid-column: 1 / -1; height: 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.bar .fill { display: block; height: 100%; width: 0; border-radius: 6px; background: var(--dim); transition: width 0.7s cubic-bezier(0.2, 0.8, 0.2, 1); }
.bar.top .fill { background: var(--grad); }
.bar.top.wrong .fill { background: var(--red); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; margin: 0; padding-top: 18px; border-top: 1px solid var(--line); }
.facts dt { color: var(--dim); font-size: 12.5px; }
.facts dd { margin: 0; font-size: 15px; font-weight: 500; }
.panel .note { margin-top: auto; padding-top: 18px; }

/* ------------------------------------------------------------------ results */
.chart { padding: 30px 30px 24px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.chart h3 { margin-bottom: 4px; }
.chart .sub { color: var(--dim); font-size: 14px; margin: 0 0 22px; }
.hbar { display: grid; grid-template-columns: 210px minmax(0, 1fr) 58px; align-items: center; gap: 14px; padding: 6px 0; font-size: 14.5px; }
.hbar .who { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar .who small { color: var(--dim); font-size: 12px; margin-left: 6px; }
.hbar .track { height: 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); overflow: hidden; }
.hbar .fill { display: block; height: 100%; width: 0; border-radius: 12px; background: #3a3f48; transition: width 1.1s cubic-bezier(0.2, 0.8, 0.2, 1); }
.hbar .val { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.hbar.ours .who { color: var(--text); font-weight: 600; }
.hbar.ours .fill { background: var(--grad); box-shadow: 0 0 18px rgba(99, 209, 255, 0.35); }
.hbar.ours .val { color: var(--g2); }
.axis { display: grid; grid-template-columns: 210px minmax(0, 1fr) 58px; gap: 14px; margin-top: 8px; color: var(--dim); font-size: 12px; }
.axis .ticks { display: flex; justify-content: space-between; }

.gap-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; margin-top: 18px; }
.pair { margin: 4px 0 22px; }
.pair:last-child { margin-bottom: 4px; }
.pair .head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.pair .head b { font-size: 16px; font-weight: 600; }
.pair .head .drop { color: var(--red); font-weight: 600; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.pair .row { display: grid; grid-template-columns: 112px minmax(0, 1fr) 56px; white-space: nowrap; align-items: center; gap: 12px; font-size: 13.5px; color: var(--muted); padding: 3px 0; }
.pair .track { height: 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.05); overflow: hidden; }
.pair .fill { display: block; height: 100%; width: 0; border-radius: 10px; transition: width 1.1s cubic-bezier(0.2, 0.8, 0.2, 1); }
.pair .rand .fill { background: var(--grad); }
.pair .lso .fill { background: var(--red); }
.pair .row .v { text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }
.controls { margin: 18px 0 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.controls li { position: relative; padding-left: 22px; color: var(--muted); font-size: 15.5px; line-height: 1.55; }
.controls li::before { content: ""; position: absolute; left: 2px; top: 10px; width: 7px; height: 7px; border-radius: 50%; background: var(--g2); }
.controls b { color: var(--text); font-weight: 600; }

/* ------------------------------------------------------------------ apps */
.apps { display: grid; grid-template-columns: 0.9fr 1.3fr; gap: 18px; }
.app { border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); padding: 26px; display: flex; flex-direction: column; }
.app p { color: var(--muted); font-size: 15.5px; margin: 0 0 18px; }
.app .shot { margin-top: auto; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.app.wide { grid-column: 1 / -1; }
.terminal { margin-top: auto; border-radius: 12px; background: #000; border: 1px solid var(--line); padding: 18px 20px; font-size: 14px; line-height: 1.75; overflow-x: auto; }
.terminal .p { color: var(--dim); }
.terminal .ok { color: var(--g1); }
.terminal .c { color: var(--muted); }

/* ------------------------------------------------------------------ bibtex */
.bib { position: relative; }
.bib pre {
  margin: 0; padding: 26px 28px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--line);
  color: #d6d8dd; font-size: 14px; line-height: 1.7; overflow-x: auto;
}
.copy {
  position: absolute; top: 14px; right: 14px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line-2);
  color: var(--text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.copy:hover { background: rgba(255, 255, 255, 0.14); }
details { margin-top: 18px; }
summary { cursor: pointer; color: var(--muted); font-size: 15px; }
details pre { margin-top: 14px !important; }

/* ------------------------------------------------------------------ footer */
footer { padding: 46px 0 60px; border-top: 1px solid var(--line); color: var(--dim); font-size: 14px; }
footer .wrap { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
footer a { color: var(--muted); }

/* ------------------------------------------------------------------ reveal */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1); }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 960px) {
  .stats, .platforms, .steps { grid-template-columns: 1fr; }
  .two, .gap-grid, .apps { grid-template-columns: 1fr; }
  .viewer { grid-template-columns: 1fr; }
  .panel { border-left: 0; border-top: 1px solid var(--line); }
  .stage { min-height: 440px; }
  .topbar nav { display: none; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  section { padding: 76px 0; }
  .hbar, .axis { grid-template-columns: 120px minmax(0, 1fr) 46px; gap: 10px; font-size: 13px; }
  .hbar .who small { display: none; }
  .pair .row { grid-template-columns: 100px minmax(0, 1fr) 50px; font-size: 12.5px; }
  .panel { padding: 22px 18px 24px; }
  .chart, .app { padding: 22px 18px; }
  .authors { font-size: 18px; }
  .btn { padding: 10px 16px 10px 13px; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .scroll-cue::after { animation: none; }
}
