:root {
  --ink: #15131c;
  --ink-soft: #55506a;
  --ink-faint: #8b86a0;
  --paper: #ffffff;
  --paper-2: #f7f5fb;
  --line: #e4e0ee;
  --accent: #6b3fd4;
  --accent-soft: #f0eaff;
  --accent-deep: #40277f;
  --good: #1f8a5b;
  --bad: #c2384a;
  --warn: #b26a12;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(21, 19, 28, .05), 0 8px 28px rgba(21, 19, 28, .06);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 76px; }

body {
  margin: 0;
  font-family: Inter, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

code, pre { font-family: "JetBrains Mono", ui-monospace, Menlo, monospace; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 72px 28px; }
.wrap.narrow { max-width: 820px; }
.band { background: var(--paper-2); border-block: 1px solid var(--line); }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1180px; margin: 0 auto; padding: 0 28px;
  height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.brand {
  font-weight: 700; font-size: 15px; color: var(--ink); text-decoration: none;
  display: inline-flex; align-items: center; gap: 9px; white-space: nowrap;
}
.brand-mark {
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px;
  background: var(--accent); color: #fff; font-size: 14px; line-height: 1;
}
.nav-links { display: flex; gap: 22px; overflow-x: auto; }
.nav-links a {
  color: var(--ink-soft); text-decoration: none; font-size: 14px; font-weight: 500;
  white-space: nowrap; padding: 4px 0; border-bottom: 2px solid transparent;
}
.nav-links a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- hero ---------- */
.hero {
  background:
    radial-gradient(900px 420px at 15% -10%, #ece4ff 0%, transparent 62%),
    radial-gradient(760px 380px at 88% 0%, #e6f0ff 0%, transparent 58%),
    var(--paper);
  border-bottom: 1px solid var(--line);
}
.hero .wrap { padding-block: 84px 68px; }
.venue {
  margin: 0 0 20px; font-size: 12px; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--accent);
}
.hero h1 {
  margin: 0; font-size: clamp(30px, 4.6vw, 54px); line-height: 1.1;
  letter-spacing: -.028em; font-weight: 700;
}
.hero h1 .accent { color: var(--accent); }
.tagline {
  margin: 20px 0 0; font-size: clamp(17px, 2vw, 21px);
  color: var(--ink-soft); font-weight: 500;
}
.authors { margin: 28px 0 0; color: var(--ink-faint); font-size: 14px; }

.buttons { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 30px; }
.btn {
  display: inline-block; padding: 10px 20px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  text-decoration: none; font-size: 14px; font-weight: 600;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); border-color: #cfc6ea; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); }

.stat-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
  gap: 14px; margin-top: 46px;
}
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow);
}
.stat b { display: block; font-size: 26px; letter-spacing: -.02em; color: var(--accent); }
.stat span { display: block; margin-top: 4px; font-size: 13px; color: var(--ink-soft); line-height: 1.45; }

/* ---------- typography ---------- */
.kicker {
  margin: 0 0 14px; font-size: 12px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent);
}
.lead { margin: 0; font-size: 17.5px; color: var(--ink-soft); }
.lead b { color: var(--ink); }
.section-title { margin: 0 0 10px; font-size: clamp(24px, 3vw, 34px); letter-spacing: -.024em; }
.section-sub { margin: 0 0 34px; color: var(--ink-soft); font-size: 16px; max-width: 780px; }
.section-sub.compact { margin-bottom: 18px; }
.section-sub .warn { color: var(--warn); }
h3.sub { margin: 52px 0 14px; font-size: 19px; letter-spacing: -.012em; }
.note { margin: 12px 0 0; font-size: 13.5px; color: var(--ink-faint); max-width: 900px; }

/* ---------- method steps ---------- */
.steps {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(258px, 1fr));
  gap: 18px; margin: 40px 0;
}
.step {
  position: relative; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px 22px 22px; box-shadow: var(--shadow);
}
.step-no {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent);
  font-weight: 700; font-size: 13px; font-family: "JetBrains Mono", monospace;
}
.step h3 { margin: 14px 0 8px; font-size: 16.5px; letter-spacing: -.01em; }
.step p { margin: 0; font-size: 14.5px; color: var(--ink-soft); }
.step code { font-size: 13px; background: var(--accent-soft); padding: 1px 6px; border-radius: 5px; color: var(--accent-deep); }

/* ---------- figures ---------- */
.figure { margin: 34px 0; }
.figure img {
  width: 100%; height: auto; display: block;
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
}
.figure figcaption {
  margin-top: 12px; font-size: 13.5px; color: var(--ink-soft); line-height: 1.55;
}
.figure figcaption b { color: var(--ink); }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 30px; }
.two-col .figure { margin: 18px 0; }

/* ---------- galleries ---------- */
.gallery { margin-top: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.chip {
  padding: 7px 15px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; color: var(--ink-soft); font-size: 13.5px; font-weight: 600;
  cursor: pointer; transition: all .12s ease;
}
.chip:hover { border-color: #cfc6ea; color: var(--ink); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }

.player-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  margin-bottom: 16px; font-size: 13.5px; color: var(--ink-soft);
}
.player-bar button {
  padding: 7px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; font-weight: 600; font-size: 13.5px; cursor: pointer; color: var(--ink);
}
.player-bar button:hover { border-color: var(--accent); color: var(--accent); }
.player-bar .meta { margin-left: auto; font-size: 13px; color: var(--ink-faint); }
.player-bar .scrub {
  flex: 1 1 180px; min-width: 140px; max-width: 320px; height: 4px;
  appearance: none; background: var(--line); border-radius: 999px; cursor: pointer;
}
.player-bar .scrub::-webkit-slider-thumb {
  appearance: none; width: 13px; height: 13px; border-radius: 50%;
  background: var(--accent); border: 2px solid #fff; box-shadow: var(--shadow);
}
.player-bar .scrub::-moz-range-thumb {
  width: 13px; height: 13px; border: 2px solid #fff; border-radius: 50%; background: var(--accent);
}

.grid4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.cell {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
}
.cell.is-ours { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.cell video { width: 100%; display: block; background: #0d0b14; aspect-ratio: 1 / 1; object-fit: contain; }
/* Fixed heights keep the video frames on one baseline when a label wraps. */
.cell-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 8px; min-height: 56px; padding: 11px 14px; border-bottom: 1px solid var(--line);
}
.cell-name { font-size: 13.5px; font-weight: 700; letter-spacing: -.005em; }
.cell-sub { display: block; font-weight: 500; font-size: 11.5px; color: var(--ink-faint); margin-top: 1px; }
.cell.is-ours .cell-name { color: var(--accent); }
.cell-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 44px; padding: 9px 14px; font-size: 12.5px;
  color: var(--ink-faint); border-top: 1px solid var(--line);
}
.cell-foot b { color: var(--ink-soft); font-family: "JetBrains Mono", monospace; }
.foot-text { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.tag {
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  background: var(--paper-2); color: var(--ink-faint); white-space: nowrap;
}
.tag-ours { background: var(--accent-soft); color: var(--accent); }
.tag-ref { background: #e8f3ff; color: #1b5fa8; }
.tag-good { background: #e4f6ed; color: var(--good); }
.tag-bad { background: #fdeaed; color: var(--bad); }

.spk {
  font-family: inherit; font-size: 11px; font-weight: 700; padding: 3px 9px;
  border-radius: 999px; border: 1px solid var(--line); background: #fff;
  color: var(--ink-faint); cursor: pointer; white-space: nowrap;
}
.spk:hover { border-color: var(--accent); color: var(--accent); }
.spk.on { background: var(--accent); border-color: var(--accent); color: #fff; }

.clip-note {
  margin: 16px 0 0; padding: 13px 16px; border-left: 3px solid var(--accent);
  background: var(--accent-soft); border-radius: 0 10px 10px 0;
  font-size: 13.5px; color: var(--ink-soft);
}
.clip-note b { color: var(--ink); }

/* ---------- tables ---------- */
.table-scroll { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: #fff; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; background: #fff; }
table.data caption {
  caption-side: bottom; text-align: left; padding: 12px 2px 0;
  font-size: 13px; color: var(--ink-faint); line-height: 1.5;
}
table.data th, table.data td { padding: 11px 15px; text-align: right; border-bottom: 1px solid var(--line); }
table.data th:first-child, table.data td:first-child { text-align: left; font-weight: 600; }
table.data thead th {
  background: var(--paper-2); font-size: 13px; font-weight: 700;
  color: var(--ink); vertical-align: bottom; white-space: nowrap;
}
table.data .th-sub {
  display: block; font-weight: 500; font-size: 11.5px; color: var(--ink-faint); margin-top: 2px;
}
table.data td { font-variant-numeric: tabular-nums; }
table.data th.ours, table.data td.ours { background: var(--accent-soft); }
table.data th.ours { color: var(--accent-deep); }
table.data tr.group td {
  background: var(--paper-2); font-weight: 700; font-size: 12.5px;
  letter-spacing: .05em; text-transform: uppercase; color: var(--ink-soft); text-align: left;
}
table.data tr.gt td { color: var(--ink-faint); font-style: italic; }
table.data tr.ours-row td { background: var(--accent-soft); }
table.data tr.ours-row td:first-child { color: var(--accent-deep); }
table.data.compact th, table.data.compact td { padding: 9px 13px; font-size: 13.5px; }
table.data:not(.compact) tbody tr:hover td:not(.ours) { background: #fbfaff; }

/* ---------- callouts / findings ---------- */
.callouts, .findings {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  gap: 15px; margin-top: 28px;
}
.callout, .finding {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; font-size: 14px; color: var(--ink-soft); box-shadow: var(--shadow);
}
.callout b { color: var(--ink); }
.finding { border-left: 3px solid var(--line); }
.finding h4 { margin: 0 0 7px; font-size: 14.5px; color: var(--ink); }
.finding p { margin: 0; }
.finding.good { border-left-color: var(--good); }
.finding.warn { border-left-color: var(--warn); }
.finding.bad { border-left-color: var(--bad); }

.cost-cards { display: grid; gap: 14px; align-content: start; margin-top: 18px; }
.cost-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 17px 20px; box-shadow: var(--shadow);
}
.cost-card b { display: block; font-size: 23px; color: var(--accent); letter-spacing: -.02em; }
.cost-card span { display: block; margin-top: 3px; font-size: 13.5px; color: var(--ink-soft); }

.limits { display: grid; gap: 16px; }
.limits p {
  margin: 0; padding: 16px 20px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); font-size: 14.5px; color: var(--ink-soft);
}
.limits b { color: var(--ink); }

/* ---------- citation ---------- */
.cite-box { position: relative; }
.cite-box pre {
  margin: 0; padding: 22px 24px; background: #17141f; color: #e9e4f7;
  border-radius: var(--radius); overflow-x: auto; font-size: 13px; line-height: 1.65;
}
.copy {
  position: absolute; top: 12px; right: 12px; padding: 6px 13px; border-radius: 999px;
  border: 1px solid #3c3450; background: #241f31; color: #cfc6ea;
  font-size: 12px; font-weight: 600; cursor: pointer;
}
.copy:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); background: var(--paper-2); }
.footer .wrap { padding-block: 34px; }
.footer p { margin: 0 0 6px; font-size: 13.5px; color: var(--ink-soft); }
.footer .muted { color: var(--ink-faint); font-size: 12.5px; }

@media (max-width: 720px) {
  .wrap { padding: 52px 20px; }
  .nav-links { gap: 16px; }
  .nav-links a:nth-child(n+5) { display: none; }
  .hero .wrap { padding-block: 56px 48px; }
}
