:root {
  --bg: #000;
  --bg-raised: #0c0c0e;
  --panel: #121215;
  --line: #222227;
  --line-strong: #34343b;
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --faint: #71717a;
  --accent: #fbbf24;
  --accent-ink: #1c1405;
  --radius: 14px;
  --wrap: 960px;
  --wrap-wide: 1200px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
sup { font-size: .68em; line-height: 0; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.wrap.wide { max-width: var(--wrap-wide); }

/* Navigation */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: rgba(0, 0, 0, .72);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.nav.is-scrolled { border-bottom-color: var(--line); }
.nav-inner {
  max-width: var(--wrap-wide); margin: 0 auto; padding: 0 24px;
  height: 56px; display: flex; align-items: center; gap: 28px;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; letter-spacing: .2px; text-decoration: none; white-space: nowrap; }
.brand-mark { width: 14px; height: 14px; border-radius: 50%; border: 2.5px solid var(--accent); }
.nav-links { display: flex; gap: 22px; overflow-x: auto; scrollbar-width: none; margin-left: auto; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 14px; white-space: nowrap; padding: 4px 0; transition: color .15s; }
.nav-links a:hover, .nav-links a.is-active { color: var(--text); }
.nav-links a.is-active { box-shadow: inset 0 -2px 0 var(--accent); }

/* Title block */
.hero {
  padding: 96px 0 72px;
  text-align: center;
  background:
    radial-gradient(900px 420px at 50% -10%, rgba(251, 191, 36, .10), transparent 70%),
    var(--bg);
}
.eyebrow { margin: 0 0 18px; color: var(--accent); font-size: 13px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; }
.title {
  margin: 0 auto; max-width: 900px;
  font-size: clamp(30px, 4.6vw, 52px); line-height: 1.12; font-weight: 700; letter-spacing: -.02em;
  text-wrap: balance;
}
.accent { color: var(--accent); }
.nowrap { white-space: nowrap; }
.authors { margin: 34px auto 0; max-width: 820px; font-size: 18px; text-wrap: balance; }
.authors span { display: inline-block; margin: 2px 10px; }
.affils { margin: 14px auto 0; max-width: 860px; display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 20px; color: var(--muted); font-size: 14.5px; }

.links { margin-top: 36px; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--panel);
  font-size: 15px; font-weight: 600; text-decoration: none;
  transition: border-color .15s, background .15s, transform .15s;
}
.btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn:hover { border-color: var(--muted); transform: translateY(-1px); }
.btn.is-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.is-primary svg { fill: currentColor; stroke: none; }
.btn.is-disabled { color: var(--faint); cursor: default; }
.btn.is-disabled:hover { border-color: var(--line-strong); transform: none; }
.btn em { font-style: normal; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: var(--faint); border: 1px solid var(--line-strong); border-radius: 999px; padding: 1px 7px; }

/* Sections */
.section { padding: 72px 0; border-top: 1px solid var(--line); }
.section h2 { margin: 0 0 18px; font-size: clamp(24px, 3vw, 32px); line-height: 1.2; letter-spacing: -.01em; }
.section-head { max-width: 760px; margin: 0 auto 32px; text-align: center; }
.section-head h2 { margin-bottom: 12px; }
.lede { margin: 0; color: var(--muted); font-size: 18px; }

/* Video */
#flight { border-top: none; padding-top: 24px; }
.player { margin: 0; }
.player video {
  display: block; width: 100%; aspect-ratio: 16 / 9; background: #050505;
  border-radius: var(--radius); border: 1px solid var(--line);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .02);
}
.player figcaption { margin: 16px auto 0; max-width: 820px; color: var(--muted); font-size: 15px; text-align: center; }
.instr-text { display: none; }

/* Flight carousel: native horizontal scroll with snap, so touch swipe works everywhere */
.track {
  position: relative; display: flex; align-items: flex-start; gap: 24px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  transition: height .3s ease;
  scrollbar-width: none; overscroll-behavior-x: contain;
}
.track::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; min-width: 0; scroll-snap-align: center; scroll-snap-stop: always; }
.carousel-nav { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 20px; }
.cbtn {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--panel); color: var(--text);
  transition: border-color .15s, opacity .15s;
}
.cbtn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.cbtn:hover:not(:disabled) { border-color: var(--muted); }
.cbtn:disabled { opacity: .35; cursor: default; }
.dots { display: flex; gap: 8px; }
.dots button { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 999px; background: var(--line-strong); cursor: pointer; transition: width .2s, background .2s; }
.dots button[aria-current="true"] { width: 26px; background: var(--accent); }
.count { min-width: 3.2em; text-align: center; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; margin-right: 8px; padding: 2px 10px;
  border: 1px solid var(--line-strong); border-radius: 999px; color: var(--text); font-size: 13px; font-weight: 600; white-space: nowrap;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 3px rgba(74, 222, 128, .2); }

.facts {
  list-style: none; margin: 40px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-raised);
}
.facts li { padding: 22px 20px; text-align: center; }
.facts li + li { border-left: 1px solid var(--line); }
.facts strong { display: block; font-size: 28px; line-height: 1.15; letter-spacing: -.01em; }
.facts span { display: block; margin-top: 4px; color: var(--muted); font-size: 14px; }

/* Abstract */
.abstract { margin: 0; color: #d4d4d8; text-align: justify; hyphens: auto; }

/* Shared building blocks */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.card { background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 14px; }
.card-head h3, .card-head h4 { margin: 0; font-size: 16px; line-height: 1.3; }
.card-head p { margin: 3px 0 12px; color: var(--muted); font-size: 13.5px; }
.card-head strong { color: var(--text); font-weight: 600; }
.card-note { margin: 14px 0 0; color: var(--faint); font-size: 13px; line-height: 1.5; }
.note { margin: 16px 0 0; color: var(--faint); font-size: 14px; }
.tag {
  display: inline-block; padding: 1px 8px; border-radius: 999px; white-space: nowrap;
  font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
  color: var(--accent); border: 1px solid rgba(251, 191, 36, .45);
}
.legend-note { margin: 16px 0 0; color: var(--muted); font-size: 14px; }
.legend-note .tag { margin-right: 6px; }
.legend-note.center { margin: 30px 0 0; text-align: center; }
.env-demo { margin-top: 8px; }
.section-head .links { margin-top: 22px; }

/* Environments */
.env-group { margin-top: 36px; }
.env-group h3 { margin: 0; font-size: 19px; }
.env-group h3 span { margin-left: 8px; color: var(--muted); font-size: 14px; font-weight: 400; }
.env-grid { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.env-card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--bg-raised); }
.env-card img { display: block; width: 100%; height: auto; aspect-ratio: 720 / 391; object-fit: cover; background: #111; }
.env-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; font-size: 14.5px; font-weight: 600; }

/* Dataset: donut charts */
.hint { margin: 0 0 14px; color: var(--faint); font-size: 14px; text-align: center; }
.ds-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: stretch; }
.donut-layout { display: grid; grid-template-columns: minmax(170px, 250px) 1fr; gap: 10px 26px; align-items: center; }
.donut-wrap { position: relative; }
.donut { display: block; width: 100%; height: auto; overflow: visible; }
.slice {
  stroke: var(--bg-raised); stroke-width: 2; stroke-linejoin: round; cursor: pointer; outline: none;
  transform-box: view-box; transform-origin: 0 0;
  transition: transform .28s cubic-bezier(.2, .8, .2, 1), opacity .2s ease, filter .2s ease;
}
.donut.has-active .slice { opacity: .28; }
.donut .slice.is-active { opacity: 1; transform: translate(var(--dx), var(--dy)) scale(1.07); filter: drop-shadow(0 3px 10px rgba(0, 0, 0, .6)) brightness(1.08); }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; padding: 0 22%; }
.donut-center strong { font-size: clamp(20px, 2.4vw, 28px); line-height: 1.1; letter-spacing: -.01em; }
.donut-center span { margin-top: 3px; color: var(--muted); font-size: 13px; line-height: 1.25; }
.donut-center em { margin-top: 2px; color: var(--faint); font-size: 12px; font-style: normal; }
.legend { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1px 10px; }
.legend li { min-width: 0; }
.legend:not(.grouped) { grid-template-columns: 1fr; }
.legend .lg-head { grid-column: 1 / -1; margin: 8px 0 2px; color: var(--faint); font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.legend .lg-head:first-child { margin-top: 0; }
.legend button {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 4px 6px; border: 0; border-radius: 6px;
  background: transparent; color: var(--muted); font: 13.5px/1.3 var(--font); text-align: left; cursor: pointer;
}
.legend button i { flex: none; width: 10px; height: 10px; border-radius: 3px; }
.legend button:hover, .legend button:focus-visible, .legend button.is-active { background: rgba(255, 255, 255, .06); color: var(--text); outline: none; }
.donut-card .card-note { margin-top: 18px; }

/* Results: column charts */
.subsection + .subsection { margin-top: 64px; }
.subsection h3 { margin: 0 0 6px; font-size: 21px; }
.sub-lede { margin: 0 0 20px; max-width: 780px; color: var(--muted); font-size: 15.5px; }
.sub-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 20px; }
.sub-head .sub-lede { margin-bottom: 0; }
.metric-grid { display: grid; gap: 14px; }
.metric-grid.five { grid-template-columns: repeat(6, 1fr); }
.metric-grid.five > :nth-child(-n+3) { grid-column: span 2; }
.metric-grid.five > :nth-child(n+4) { grid-column: span 3; }
.metric-grid.four { grid-template-columns: repeat(2, 1fr); }
.colchart .plot { position: relative; height: 170px; margin: 26px 2px 48px 34px; border-bottom: 1px solid var(--line-strong); }
.gridlines span { position: absolute; left: 0; right: 0; bottom: var(--y); border-top: 1px solid var(--line); }
.gridlines span:first-child { border-top-color: transparent; }
.gridlines b { position: absolute; right: calc(100% + 8px); top: -.7em; color: var(--faint); font: 400 11.5px/1.3 var(--font); font-variant-numeric: tabular-nums; }
.axis-break { position: absolute; left: -7px; bottom: 9px; width: 14px; height: 10px; fill: none; stroke: var(--muted); stroke-width: 1.4; stroke-linecap: round; background: var(--bg-raised); }
.cols { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(var(--n), 1fr); margin: 0; padding: 0; list-style: none; }
.col { position: relative; outline: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.col .bar {
  position: absolute; left: 50%; bottom: 0; width: min(30px, 58%); height: var(--h);
  transform: translateX(-50%); transform-origin: 50% 100%; border-radius: 4px 4px 0 0; background: #6b6b75;
  transition: height .5s cubic-bezier(.2, .8, .2, 1), transform .25s cubic-bezier(.2, .8, .2, 1), opacity .2s ease, filter .2s ease, box-shadow .2s ease;
}
.col.is-ours .bar { background: var(--accent); }
.col .val {
  position: absolute; left: -8px; right: -8px; bottom: calc(var(--h) + 6px); text-align: center;
  color: var(--text); font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums;
  opacity: 0; transform: translateY(4px); transition: opacity .2s ease, transform .2s ease, bottom .5s cubic-bezier(.2, .8, .2, 1);
}
.col.is-ours .val { opacity: 1; transform: none; font-weight: 700; }
.col .lab { position: absolute; top: calc(100% + 8px); left: 2px; right: 2px; text-align: center; color: var(--muted); font-size: 11.5px; line-height: 1.25; transition: color .2s; }
.col.is-ours .lab { color: var(--text); font-weight: 700; }
.cols:hover .col:not(:hover) .bar, .cols:focus-within .col:not(:focus) .bar { opacity: .3; }
.col:hover .bar, .col:focus .bar { transform: translateX(-50%) scale(1.3, 1); filter: brightness(1.15); box-shadow: 0 0 18px rgba(255, 255, 255, .12); }
.col.is-ours:hover .bar, .col.is-ours:focus .bar { box-shadow: 0 0 22px rgba(251, 191, 36, .35); }
.col:hover .val, .col:focus .val { opacity: 1; transform: translateY(-2px); font-size: 13.5px; }
.col:hover .lab, .col:focus .lab { color: var(--text); }
.seg { display: inline-flex; padding: 3px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--bg-raised); }
.seg button { padding: 7px 16px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: 600 14px var(--font); cursor: pointer; }
.seg button span { margin-left: 4px; color: var(--faint); font-size: 12.5px; font-weight: 400; }
.seg button[aria-checked="true"] { background: var(--text); color: #000; }
.seg button[aria-checked="true"] span { color: #52525b; }
.subsection .facts { margin-top: 14px; }

@media (max-width: 1040px) {
  .ds-grid { grid-template-columns: 1fr; }
  .metric-grid.five { grid-template-columns: repeat(2, 1fr); }
  .metric-grid.five > * { grid-column: auto !important; }
  .metric-grid.five > :last-child { grid-column: 1 / -1 !important; }
}

/* Footer */
.footer { padding: 40px 0 56px; border-top: 1px solid var(--line); color: var(--faint); font-size: 14px; text-align: center; }
.footer p { margin: 0; }

/* Small screens */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .wrap, .nav-inner { padding: 0 16px; }
  .nav-inner { gap: 18px; }
  .nav-links { gap: 18px; padding-right: 24px; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .links { gap: 8px; }
  .btn { padding: 8px 14px; font-size: 14px; gap: 6px; }
  .btn em { display: none; }
  .hero { padding: 64px 0 48px; }
  .authors { font-size: 16px; }
  .authors span { margin: 1px 7px; }
  .title .nowrap { white-space: normal; }
  .affils { font-size: 13px; }
  .section { padding: 52px 0; }
  .lede { font-size: 16px; }
  .player video { border-radius: 10px; }
  .instr-text { display: block; margin-top: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-raised); font-size: 15px; line-height: 1.5; }
  .instr-text span { display: block; margin-bottom: 4px; color: #93c5fd; font-size: 11px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; }
  .instr-text p { margin: 0; }
  .instr-text p + p { margin-top: 4px; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .facts li:nth-child(3) { border-left: none; }
  .facts li:nth-child(n+3) { border-top: 1px solid var(--line); }
  .facts strong { font-size: 24px; }
  .abstract { text-align: left; }
  .env-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .env-meta { padding: 8px 10px; font-size: 13px; flex-wrap: wrap; }
  .env-group h3 span { display: block; margin: 2px 0 0; }
  .card { padding: 16px 14px 12px; }
  .seg { width: 100%; }
  .seg button { flex: 1; }
  .seg button span { display: none; }
  .metric-grid.five, .metric-grid.four { grid-template-columns: 1fr; }
  .metric-grid.five > :last-child { grid-column: auto !important; }
  .donut-layout { grid-template-columns: 1fr; justify-items: center; }
  .donut-wrap { width: min(250px, 80%); }
  .legend { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
  .slice, .col .bar, .col .val { transition: none; }
}
