:root {
  --bg: #f7f8f6;
  --surface: #ffffff;
  --surface-soft: #eef4f1;
  --ink: #16211f;
  --muted: #5f6c68;
  --line: #d9e1dd;
  --teal: #0f766e;
  --teal-dark: #0b514d;
  --cyan: #1f8fa3;
  --amber: #d97706;
  --warm: #9f4f1c;
  --shadow: 0 20px 45px rgba(15, 37, 35, 0.14);
  --radius: 8px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

section {
  scroll-margin-top: 84px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  transform: translateY(-160%);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  padding: 10px 14px;
  box-shadow: var(--shadow);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 248, 246, 0.92);
  color: var(--ink);
  backdrop-filter: blur(14px);
}

.nav-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  flex: 0 0 auto;
  font-weight: 800;
  font-size: 1.05rem;
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-links::-webkit-scrollbar {
  display: none;
}

.nav-links a {
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
  padding: 8px 11px;
  text-decoration: none;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  background: var(--surface-soft);
  color: var(--teal-dark);
  outline: none;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 58px 0 44px;
  background: linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
  color: var(--ink);
}

.hero-content {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  display: grid;
  gap: 32px;
}

.hero-copy {
  width: 100%;
  max-width: 940px;
  min-width: 0;
  margin: 0 auto;
  text-align: center;
}

.paper-tag {
  display: inline-flex;
  align-items: center;
  margin: 0 0 14px;
  border: 1px solid rgba(15, 118, 110, 0.24);
  border-radius: 999px;
  padding: 5px 11px;
  background: var(--surface-soft);
  color: var(--teal-dark);
  font-weight: 750;
  font-size: 0.85rem;
}

.hero h1 {
  margin: 0 auto;
  font-size: 4.8rem;
  line-height: 0.96;
  font-weight: 850;
}

.hero-subtitle {
  max-width: 900px;
  margin: 18px auto 0;
  font-size: 1.55rem;
  line-height: 1.25;
  font-weight: 720;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.hero-subtitle span {
  display: inline;
}

.authors {
  max-width: 900px;
  margin: 14px auto 0;
  color: var(--muted);
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.hero-summary {
  max-width: 760px;
  margin: 22px auto 0;
  color: var(--muted);
  font-size: 1.04rem;
  overflow-wrap: anywhere;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 28px;
}

.hero-figure {
  width: 100%;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-image {
  width: 100%;
  aspect-ratio: 3062 / 1171;
  object-fit: contain;
  background: #ffffff;
}

.hero-figure figcaption {
  padding: 12px 14px 14px;
}

.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 9px 14px;
  font: inherit;
  font-weight: 760;
  line-height: 1.2;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
  outline: none;
}

.button-primary {
  background: var(--teal-dark);
  color: #ffffff;
}

.button-primary:hover,
.button-primary:focus-visible {
  background: var(--teal);
}

.button-secondary {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.button-secondary:hover,
.button-secondary:focus-visible {
  border-color: rgba(15, 118, 110, 0.38);
  background: var(--surface-soft);
  color: var(--teal-dark);
}

.button-disabled {
  border-color: var(--line);
  background: #eef1ee;
  color: #77827e;
  cursor: not-allowed;
}

.button-disabled:hover,
.button-disabled:focus-visible {
  transform: none;
}

.metrics-band {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.metric-grid {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.metric-card {
  min-height: 112px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  background: var(--surface);
  padding: 18px;
}

.metric-value {
  color: var(--teal-dark);
  font-size: 2rem;
  line-height: 1.05;
  font-weight: 850;
}

.metric-label {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.3;
}

.section {
  padding: 92px 0;
}

.section:nth-of-type(odd) {
  background: var(--bg);
}

.section:nth-of-type(even) {
  background: var(--surface);
}

.section-inner {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) minmax(0, 1.15fr);
  gap: 56px;
  align-items: start;
}

.section-kicker {
  margin: 0 0 10px;
  color: var(--warm);
  font-size: 0.86rem;
  font-weight: 820;
  text-transform: uppercase;
}

h2,
h3,
p,
figure {
  margin-top: 0;
}

h2 {
  max-width: 900px;
  margin-bottom: 0;
  font-size: 2.6rem;
  line-height: 1.08;
  font-weight: 820;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.1rem;
  line-height: 1.25;
}

.prose p,
.section-heading p,
.citation-copy {
  color: var(--muted);
}

.prose p:last-child,
.section-heading p:last-child {
  margin-bottom: 0;
}

.section-heading {
  max-width: 850px;
  margin-bottom: 34px;
}

.section-heading h2 + p {
  max-width: 760px;
  margin: 16px 0 0;
}

.section-heading.compact {
  margin-bottom: 28px;
}

.wide-figure,
.image-panel,
.gallery-card {
  margin: 0;
}

.wide-figure {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.wide-figure img {
  width: 100%;
  aspect-ratio: 3811 / 1737;
  object-fit: contain;
  background: #ffffff;
}

figcaption {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.wide-figure figcaption,
.image-panel figcaption,
.gallery-card figcaption {
  padding: 12px 14px 14px;
}

.method-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.info-card,
.gallery-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.info-card {
  min-height: 172px;
  padding: 20px;
}

.info-card p {
  margin-bottom: 0;
  color: var(--muted);
}

.dataset-layout,
.results-layout {
  display: grid;
  gap: 18px;
}

.dataset-layout {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
}

.image-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.image-panel img {
  width: 100%;
  object-fit: contain;
  background: #ffffff;
}

.table-wrap {
  width: 100%;
  margin-top: 24px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 13px 14px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

thead th {
  background: var(--surface-soft);
  color: var(--teal-dark);
  font-size: 0.9rem;
}

tbody tr:last-child th,
tbody tr:last-child td {
  border-bottom: 0;
}

.highlight-row th,
.highlight-row td {
  background: rgba(15, 118, 110, 0.08);
  font-weight: 780;
}

.note {
  max-width: 900px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.variant-summary {
  display: grid;
  grid-template-columns: minmax(220px, 0.45fr) minmax(0, 1.55fr);
  gap: 18px;
  align-items: start;
  margin-top: 28px;
}

.variant-copy {
  border-left: 3px solid rgba(15, 118, 110, 0.38);
  padding-left: 16px;
}

.variant-copy p {
  margin-bottom: 0;
  color: var(--muted);
}

.variant-table {
  margin-top: 0;
}

.results-layout {
  grid-template-columns: minmax(0, 1.4fr) minmax(240px, 0.6fr);
  align-items: stretch;
  margin-top: 28px;
}

.speed-list {
  display: grid;
  gap: 12px;
  align-content: center;
}

.speed-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 18px;
}

.speed-item span {
  color: var(--muted);
  font-weight: 700;
}

.speed-item strong {
  color: var(--ink);
  font-size: 1.3rem;
}

.speed-item-ours {
  border-color: rgba(15, 118, 110, 0.38);
  background: #eef8f6;
}

.speed-item-ours strong {
  color: var(--teal-dark);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.gallery-card {
  overflow: hidden;
}

.gallery-card img {
  width: 100%;
  height: auto;
  object-fit: contain;
  background: #ffffff;
}

.gallery-card figcaption {
  font-weight: 720;
  color: var(--ink);
}

.citation-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.55fr) minmax(0, 1.45fr);
  gap: 42px;
  align-items: start;
}

.citation-box {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #101a19;
  color: #ecf5f2;
  overflow: hidden;
}

.citation-box .copy-button {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

pre {
  margin: 0;
  overflow-x: auto;
  padding: 58px 18px 18px;
  font-size: 0.9rem;
  line-height: 1.55;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.footer-inner {
  width: min(1180px, calc(100% - 40px));
  min-height: 80px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: var(--muted);
}

.footer-inner span:first-child {
  color: var(--ink);
  font-weight: 820;
}

:focus-visible {
  outline: 3px solid rgba(31, 143, 163, 0.55);
  outline-offset: 2px;
}

@media (max-width: 980px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-card:last-child {
    grid-column: span 2;
  }

  .two-column,
  .dataset-layout,
  .results-layout,
  .variant-summary,
  .citation-layout {
    grid-template-columns: 1fr;
  }

  .method-grid,
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .nav-shell {
    width: min(100% - 28px, 1180px);
    min-height: 58px;
    align-items: center;
  }

  .nav-links {
    display: none;
  }

  .hero {
    padding: 38px 0 34px;
  }

  .hero-content {
    width: calc(100% - 28px);
    max-width: 1180px;
    gap: 24px;
  }

  .hero-copy,
  .hero-summary,
  .authors {
    max-width: 100%;
  }

  .hero-subtitle span {
    display: block;
  }

  .hero h1 {
    font-size: 3.1rem;
  }

  .hero-subtitle {
    font-size: 1.25rem;
  }

  .hero-summary {
    font-size: 0.98rem;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .button {
    width: 100%;
  }

  .metric-grid,
  .section-inner,
  .footer-inner {
    width: min(100% - 28px, 1180px);
  }

  .metric-grid,
  .method-grid,
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .metric-card:last-child {
    grid-column: auto;
  }

  .section {
    padding: 64px 0;
  }

  h2 {
    font-size: 2rem;
  }

  th,
  td {
    padding: 11px 12px;
  }

  .footer-inner {
    min-height: 92px;
    align-items: flex-start;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
  }
}

@media (max-width: 420px) {
  .brand {
    font-size: 1rem;
  }

  .nav-links a {
    font-size: 0.84rem;
    padding: 7px 9px;
  }

  .hero h1 {
    font-size: 2.65rem;
  }

  .hero-subtitle {
    font-size: 1.12rem;
  }

  .authors,
  .hero-summary {
    font-size: 0.92rem;
  }

  .metric-value {
    font-size: 1.75rem;
  }

  pre {
    font-size: 0.8rem;
  }
}
