:root {
  --ink: #14201e;
  --muted: #5f6d69;
  --line: #d9e2de;
  --paper: #ffffff;
  --wash: #f3f7f5;
  --deep: #0b1736;
  --blue: #3b82f6;
  --blue-dark: #1d4ed8;
  --red: #e64d45;
  --shadow: 0 24px 60px rgba(18, 42, 34, 0.12);
  --max: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

img, video { display: block; max-width: 100%; }
a { color: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 32px;
  border-bottom: 1px solid rgba(217, 226, 222, 0.8);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
}

.brand {
  text-decoration: none;
  font-weight: 850;
  letter-spacing: -0.04em;
  font-size: 1.35rem;
}

nav { display: flex; gap: 26px; }
nav a { color: var(--muted); text-decoration: none; font-size: 0.9rem; font-weight: 650; }
nav a:hover, nav a:focus-visible { color: var(--blue-dark); }

.section-shell { width: min(var(--max), calc(100% - 40px)); margin: 0 auto; }
.section-shell.narrow { max-width: 980px; }

.hero { padding: 94px 0 72px; text-align: center; }
.eyebrow {
  margin: 0 0 10px;
  color: var(--blue-dark);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1, h2, h3 { margin-top: 0; line-height: 1.12; letter-spacing: -0.035em; }
h1 { max-width: 1100px; margin: 0 auto 28px; font-size: clamp(2.35rem, 5vw, 4.75rem); }
h2 { margin-bottom: 16px; font-size: clamp(2rem, 3.8vw, 3.3rem); }
h3 { margin-bottom: 10px; font-size: 1.35rem; }

.authors { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; max-width: 1000px; margin: 0 auto 10px; font-weight: 650; }
.authors span { white-space: nowrap; }
sup { color: var(--blue-dark); font-size: 0.64em; }
.affiliations { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 16px; max-width: 1060px; margin: auto; color: var(--muted); font-size: 0.9rem; }
.author-note { margin: 7px 0 0; color: var(--muted); font-size: 0.8rem; }

.project-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 28px 0 52px; }
.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 43px;
  padding: 0 18px;
  border: 1px solid #c8d3cf;
  border-radius: 999px;
  color: var(--ink);
  background: #fff;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 760;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}
.button:hover { transform: translateY(-2px); border-color: var(--blue); box-shadow: 0 8px 20px rgba(59, 130, 246, 0.16); }
.button.primary { color: #fff; border-color: var(--deep); background: var(--deep); }
.button.disabled { color: #8a9692; background: #f4f6f5; cursor: default; }
.button.disabled:hover { transform: none; border-color: #c8d3cf; box-shadow: none; }

.media-frame { overflow: hidden; margin: 38px 0; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: var(--shadow); }
.media-frame img { width: 100%; height: auto; }
.media-frame figcaption { padding: 14px 20px 16px; color: var(--muted); background: #fff; font-size: 0.9rem; text-align: center; }
.teaser-frame { border-color: #dbe5f4; background: #f7faff; }
.teaser-frame figcaption { color: #53637a; background: #f7faff; }
.hero-figure { margin-top: 0; }
.lede { max-width: 900px; margin: 28px auto 0; color: #3f514c; font-size: clamp(1.08rem, 2vw, 1.35rem); }

.video-band { padding: 92px 0; color: #f3fbf8; background: var(--deep); }
.video-band .eyebrow { color: #79b2ff; }
.video-shell { overflow: hidden; margin-top: 36px; border: 1px solid #31443e; border-radius: 18px; background: #030605; box-shadow: 0 30px 70px rgba(0,0,0,0.35); }
.video-shell video { width: 100%; max-height: 640px; background: #000; }

.section-heading { max-width: 860px; margin: 0 auto 42px; }
.section-heading.centered { text-align: center; }
.section-heading > p:last-child { margin: 0; color: var(--muted); }
.video-band .section-heading > p:last-child { color: #b9c8c3; }

.text-section { padding: 108px 0; }
.abstract-copy { max-width: 940px; margin: auto; color: #334641; font-size: 1.08rem; text-align: justify; }
.method-section { padding: 108px 0; background: var(--wash); }
.method-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 54px; }
.method-card { position: relative; overflow: hidden; min-height: 230px; padding: 30px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.method-card::after { content: ""; position: absolute; right: -50px; bottom: -60px; width: 150px; height: 150px; border-radius: 50%; background: radial-gradient(circle, rgba(59,130,246,0.18), transparent 70%); }
.step { display: inline-grid; place-items: center; width: 42px; height: 42px; margin-bottom: 28px; border-radius: 50%; color: #fff; background: var(--blue-dark); font-size: 0.78rem; font-weight: 850; }
.method-card p { margin: 0; color: var(--muted); font-size: 0.94rem; }
.paper-frame { background: #fff; }
.pipeline-frame { margin-top: 28px; }

.results-section { padding: 108px 0; }
.metric-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 0 0 54px; }
.metric-strip article { display: flex; flex-direction: column; min-height: 155px; padding: 24px; border-top: 3px solid var(--blue); background: var(--wash); }
.metric-strip span { color: var(--blue-dark); font-size: 2.2rem; font-weight: 850; letter-spacing: -0.04em; }
.metric-strip strong { font-size: 0.93rem; }
.metric-strip small { margin-top: auto; color: var(--muted); }

.comparison-frame { margin-bottom: 70px; }
.result-block { display: grid; grid-template-columns: minmax(190px, 0.34fr) minmax(0, 1fr); gap: 40px; align-items: start; margin: 66px 0; }
.result-copy { position: sticky; top: 92px; }
.result-copy p:last-child { color: var(--muted); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 30px rgba(18, 42, 34, 0.06); }
table { width: 100%; min-width: 650px; border-collapse: collapse; font-size: 0.88rem; font-variant-numeric: tabular-nums; }
th, td { padding: 12px 15px; border-bottom: 1px solid #e5ebe8; text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
thead th { color: #385049; background: #eef4f1; font-size: 0.76rem; letter-spacing: 0.04em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f7faf8; }
tr.ours { color: #173f8f; background: #eaf2ff; font-weight: 780; }
.structural-table { min-width: 780px; }
.data-note { padding: 16px 20px; border-left: 3px solid var(--blue); color: var(--muted); background: var(--wash); font-size: 0.86rem; }

.citation-section { padding: 100px 0; color: #eef8f5; background: var(--deep); }
.citation-section .eyebrow { color: #79b2ff; }
.citation-section .section-heading > p:last-child { color: #b6c5c0; }
.citation-box { position: relative; overflow: hidden; border: 1px solid #334740; border-radius: 16px; background: #07100e; }
.citation-box pre { overflow-x: auto; margin: 0; padding: 30px; color: #d9f4ea; font: 0.85rem/1.7 ui-monospace, SFMono-Regular, Consolas, monospace; }
.copy-button { position: absolute; top: 14px; right: 14px; padding: 8px 12px; border: 1px solid #45645a; border-radius: 8px; color: #dff7ef; background: #172a24; font-weight: 700; cursor: pointer; }
.copy-button:hover { background: #203a32; }

footer { border-top: 1px solid var(--line); background: #fff; }
.footer-inner { display: flex; justify-content: space-between; gap: 18px; padding: 28px 0; color: var(--muted); font-size: 0.86rem; }
.footer-inner p { margin: 0; }
.footer-inner a { color: var(--blue-dark); font-weight: 700; }

:focus-visible { outline: 3px solid rgba(59, 130, 246, 0.45); outline-offset: 3px; }

@media (max-width: 900px) {
  .site-header { padding: 0 20px; }
  nav { gap: 16px; }
  .hero { padding-top: 72px; }
  .method-grid { grid-template-columns: 1fr; }
  .metric-strip { grid-template-columns: repeat(2, 1fr); }
  .result-block { grid-template-columns: 1fr; gap: 18px; }
  .result-copy { position: static; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .site-header { position: static; }
  nav { display: none; }
  .section-shell { width: min(100% - 28px, var(--max)); }
  .hero { padding: 54px 0 58px; }
  h1 { font-size: 2.25rem; }
  .project-links { margin-bottom: 34px; }
  .button { padding: 0 14px; }
  .text-section, .method-section, .results-section, .citation-section, .video-band { padding: 72px 0; }
  .abstract-copy { text-align: left; }
  .metric-strip { grid-template-columns: 1fr 1fr; }
  .metric-strip article { min-height: 140px; padding: 18px; }
  .metric-strip span { font-size: 1.75rem; }
  .media-frame { margin-left: -6px; margin-right: -6px; border-radius: 12px; }
  .footer-inner { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
