/* ---------- fonts (self-hosted, SIL Open Font License) ---------- */

@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/instrument-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/instrument-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Instrument Sans";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/instrument-sans-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Instrument Sans";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/instrument-sans-italic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #fbfbfa;
  --bg-soft: #f3f3f0;
  --fg: #16181d;
  --fg-2: #4b4f58;
  --fg-3: #7a7f8a;
  --line: #e6e6e2;
  --line-strong: #d3d3ce;
  --accent: #2f5fa8;
  --accent-hover: #244d8a;
  --accent-soft: #e9eff9;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-media: 0 1px 2px rgba(22, 24, 29, .06), 0 12px 32px -12px rgba(22, 24, 29, .18);
  --w-prose: 760px;
  --w-media: 1040px;
  --w-site: 1200px;
  --pad: 24px;
  --font: "Instrument Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg-2);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img, video { display: block; max-width: 100%; height: auto; }
p { margin: 0 0 1em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }
a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

h1, h2 {
  color: var(--fg);
  margin: 0;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.5rem, 5.2vw, 4rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.02em;
}

h2 {
  font-size: clamp(1.6rem, 2.4vw, 2rem);
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.2;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 16px; top: -60px;
  z-index: 20;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: top .15s ease;
}
.skip-link:focus { top: 12px; }

/* ---------- layout ---------- */

.wrap {
  width: 100%;
  max-width: calc(var(--w-prose) + var(--pad) * 2);
  margin-inline: auto;
  padding-inline: var(--pad);
}
.wrap-media { max-width: calc(var(--w-media) + var(--pad) * 2); }

.section { padding: 96px 0; }
.defer { content-visibility: auto; contain-intrinsic-size: auto 600px; }

#abstract, #framework, #comparison, #citation { scroll-margin-top: 72px; }

.eyebrow {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--fg-3);
}

.section-head { margin-bottom: 32px; }

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 60px;
  background: rgba(251, 251, 250, .85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.site-header-inner {
  height: 100%;
  max-width: calc(var(--w-site) + var(--pad) * 2);
  margin-inline: auto;
  padding-inline: var(--pad);
  display: flex;
  align-items: center;
  gap: 24px;
}

.site-brand {
  font-weight: 700;
  font-size: 17px;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -.01em;
  flex: none;
}

.site-nav {
  display: flex;
  gap: 24px;
  margin-left: auto;
  white-space: nowrap;
}

.site-nav a {
  font-size: 15px;
  font-weight: 500;
  color: var(--fg-2);
  text-decoration: none;
}
.site-nav a:hover { color: var(--fg); }

.site-cta {
  flex: none;
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
  text-decoration: none;
}
.site-cta:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- hero ---------- */

.hero {
  max-width: calc(860px + var(--pad) * 2);
  margin-inline: auto;
  padding: 88px var(--pad) 56px;
  text-align: center;
}

.hero-sub {
  display: block;
  margin-top: .35em;
  font-size: .5em;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -.01em;
  color: var(--fg-2);
}

.authors {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 18px;
  margin-top: 32px;
  font-size: 16px;
}

.authors a {
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
}
.authors a:hover { border-bottom-color: var(--accent); color: var(--accent); }

.mail-mark {
  width: 14px; height: 14px;
  display: inline-block;
  vertical-align: -2px;
  margin-left: 4px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.affiliations {
  margin: 18px 0 0;
  font-size: 14px;
  color: var(--fg-3);
}
.affiliations span { margin: 0 10px; display: inline-block; }

.corr-note {
  margin: 10px 0 0;
  font-size: 14px;
  color: var(--fg-3);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 32px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
  text-decoration: none;
  background: transparent;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }

.btn svg {
  width: 20px; height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- video + stats ---------- */

.video-section { padding-bottom: 8px; }

.media-frame {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #0f1114;
  box-shadow: var(--shadow-media);
}
.media-frame video { width: 100%; height: 100%; object-fit: contain; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin: 56px 0 0;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.stat { margin: 0; }
.stats dt {
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.1;
  color: var(--fg);
}
.stats dd {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--fg-3);
}

/* ---------- figures ---------- */

.figure { margin: 0; }
.figure img { width: 100%; }

.figure figcaption {
  margin-top: 20px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--fg-2);
}
.figure figcaption strong { color: var(--fg); font-weight: 600; }

.caption-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  line-height: 1.6;
}
.caption-grid p { margin: 0; }

var { font-style: italic; font-family: inherit; }

/* ---------- prose ---------- */

.prose .lede {
  font-size: 18px;
  line-height: 1.7;
  margin: 20px 0 0;
}
.prose .lede strong { color: var(--fg); font-weight: 600; }

/* ---------- table ---------- */

.table-intro {
  font-size: 16px;
  margin-bottom: 24px;
}
.table-intro strong { color: var(--fg); font-weight: 600; }

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.results-table {
  border-collapse: collapse;
  min-width: 880px;
  width: 100%;
  font-size: 15px;
  color: var(--fg-2);
}

.results-table th,
.results-table td {
  padding: 12px 14px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.results-table thead th {
  background: var(--bg-soft);
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-3);
  vertical-align: bottom;
}
.results-table thead th:nth-child(-n+2) { text-transform: uppercase; letter-spacing: .06em; }

.results-table th:first-child,
.results-table td:first-child {
  position: sticky;
  left: 0;
  text-align: left;
  font-weight: 500;
  color: var(--fg);
  background: var(--bg);
}
.results-table thead th:first-child { background: var(--bg-soft); }

.results-table tbody tr + tr td { border-top: 1px solid var(--line); }
.results-table tr.section-start td { border-top: 2px solid var(--line-strong); }

.results-table .ours { background: var(--accent-soft); }
.results-table thead th.ours { font-weight: 700; color: var(--accent); }

.results-table .best-cell strong { font-weight: 700; color: var(--fg); }
.results-table .second-score {
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: .18em;
}

.results-table .total-row td { font-weight: 600; background: var(--bg-soft); }
.results-table .total-row td:first-child { background: var(--bg-soft); }
.results-table .total-row td.ours { background: var(--accent-soft); }

/* ---------- bibtex ---------- */

.bib {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg);
  box-shadow: 0 1px 2px rgba(22, 24, 29, .04);
  overflow: hidden;
}

.bib-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px 10px 20px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
}

.bib-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--fg-3);
}

.bib-code {
  margin: 0;
  padding: 20px 24px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--fg);
}

.bib-code code { font-family: inherit; white-space: pre; }
.bib-code .k { color: var(--accent); }

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font: 600 13px/1 var(--font);
  color: var(--fg);
  cursor: pointer;
  transition: color .15s, border-color .15s;
}

.copy-btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.copy-btn:hover, .copy-btn.is-done { border-color: var(--accent); color: var(--accent); }

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 48px 0;
}

.site-footer-inner {
  max-width: calc(var(--w-site) + var(--pad) * 2);
  margin-inline: auto;
  padding-inline: var(--pad);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  justify-content: space-between;
  font-size: 14px;
  color: var(--fg-3);
}
.site-footer-inner a { color: var(--fg-3); text-decoration: none; }
.site-footer-inner a:hover { color: var(--fg); }

/* ---------- reveal ---------- */

html.js [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .5s ease, transform .5s ease;
}
html.js [data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */

@media (max-width: 820px) {
  .site-cta { display: none; }
  .site-nav { overflow-x: auto; }
  .caption-grid { grid-template-columns: 1fr; gap: 16px; }
}

@media (max-width: 640px) {
  :root { --pad: 18px; }
  .section { padding: 64px 0; }
  .hero { padding: 56px var(--pad) 40px; }
  .stats { grid-template-columns: 1fr; gap: 20px; margin-top: 40px; }
  .affiliations span { margin: 0 6px; }
  .bib-code { padding: 16px; }
  .bib-bar { padding-left: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js [data-reveal] { opacity: 1; transform: none; transition: none; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
