:root {
  --navy: #22354a;
  --navy-deep: #182839;
  --ink: #2d3136;
  --muted: #66717b;
  --paper: #ffffff;
  --panel: #ffffff;
  --line: #d9e0e4;
  --line-strong: #c4cdd3;
  --accent: #2d8fe3;
  --accent-soft: #edf6fd;
  --shadow: 0 4px 16px rgba(29, 45, 60, 0.09);
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: Arial, Helvetica, sans-serif;
}

html {
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--navy);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
}

a:hover {
  color: var(--accent);
}

.container.is-max-desktop {
  max-width: 1120px;
}

.narrow-copy {
  max-width: 860px !important;
}

.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;
}

.project-hero {
  background: var(--paper);
  border-bottom: 1px solid var(--line-strong);
}

.project-hero .hero-body {
  padding: 6.25rem 1.5rem 4.75rem;
}

.project-title {
  margin: 0 auto 0.6rem !important;
  color: var(--navy-deep) !important;
  font-size: clamp(3.4rem, 8vw, 6.3rem) !important;
  font-weight: 700 !important;
  letter-spacing: -0.055em;
  line-height: 1 !important;
  text-align: center;
}

.project-subtitle {
  margin: 0 0 1rem !important;
  color: var(--accent) !important;
  font-size: clamp(1.15rem, 2.2vw, 1.55rem) !important;
  font-weight: 400 !important;
  text-align: center;
}

.project-byline {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
  text-align: center;
}

.author-name {
  color: var(--accent);
  font-size: 1.08rem;
}

.project-context {
  color: var(--muted);
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 2rem;
}

.button {
  min-height: 2.7rem;
  border-width: 1px !important;
  box-shadow: none !important;
  font-family: var(--sans);
  font-weight: 600;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.project-links .button.is-dark {
  background: var(--navy) !important;
  color: #fff !important;
}

.project-links .button.is-dark:hover {
  background: var(--accent) !important;
  color: #fff !important;
  transform: translateY(-1px);
}

.section {
  padding: 5rem 1.5rem;
}

.section-tight {
  padding-top: 3rem;
  padding-bottom: 3rem;
}

.section-title {
  margin: 0 0 0.8rem;
  color: var(--navy-deep);
  font-size: clamp(1.8rem, 3.2vw, 2.45rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  text-align: center;
}

.section-lede {
  max-width: 780px;
  margin: 0 auto 2rem;
  color: var(--muted);
  font-size: 1.05rem;
  text-align: center;
}

.abstract-copy,
.limitation-list {
  color: var(--ink);
  font-size: 1.08rem;
}

.abstract-copy p {
  margin: 0;
}

.video-frame,
.figure-card,
.table-wrap,
.bibtex-box {
  border: 1px solid var(--line-strong);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.video-frame {
  position: relative;
  overflow: hidden;
}

.video-frame video {
  display: block;
  width: 100%;
  height: auto;
  background: #e2e8f0;
}

.demo-first {
  padding-top: 3.25rem;
  padding-bottom: 3.5rem;
}

.teaser-frame {
  border-left: 1px solid var(--line-strong);
}

.demo-frame {
  max-width: 1120px;
  border-top: 1px solid var(--line-strong);
}

.video-status {
  margin: 0;
  padding: 0.7rem 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
}

.benchmark-section {
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  background: #ffffff;
  color: var(--ink);
}

.benchmark-section .section-title {
  color: var(--navy-deep);
}

.benchmark-section .section-lede {
  color: var(--muted);
}

.benchmark-carousel {
  max-width: 1000px;
  margin: 2.5rem auto 0;
}

.benchmark-stage {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) 3rem;
  align-items: center;
  gap: 0.85rem;
}

.benchmark-slides {
  min-width: 0;
}

.benchmark-slide[hidden] {
  display: none;
}

.figure-card {
  margin: 0;
  color: var(--ink);
}

.figure-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  object-fit: contain;
  background: #fff;
  padding: 1rem;
}

.figure-card figcaption {
  padding: 1rem 1.15rem 1.15rem;
  border-top: 1px solid var(--line);
  font-size: 0.92rem;
  line-height: 1.55;
}

.figure-card figcaption strong {
  color: var(--navy);
}

.benchmark-control {
  width: 2.6rem;
  height: 2.6rem;
  border: 1px solid var(--navy);
  border-radius: 50%;
  background: #fff;
  color: var(--navy);
  cursor: pointer;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 2rem;
  font-weight: 400;
  line-height: 1;
  box-shadow: none;
}

.benchmark-control:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.benchmark-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

.benchmark-dots {
  display: flex;
  gap: 0.45rem;
}

.benchmark-dot {
  width: 0.58rem;
  height: 0.58rem;
  padding: 0;
  border: 1px solid #9aa9b4;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}

.benchmark-dot.is-active,
.benchmark-dot:hover {
  border-color: var(--accent);
  background: var(--accent);
}

.benchmark-counter {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
}

.table-wrap {
  overflow-x: auto;
}

.results-table {
  min-width: 800px;
  margin: 0 !important;
  background: var(--panel);
  color: var(--ink);
  font-size: 0.91rem;
}

.results-table th {
  background: var(--navy);
  color: #fff !important;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.results-table td,
.results-table th {
  border-color: var(--line) !important;
  padding: 0.85rem 0.8rem !important;
  vertical-align: top;
}

.results-table tbody tr:nth-child(even) {
  background: #f1f4f2;
}

.results-table td:nth-child(2) {
  color: var(--navy);
  font-family: var(--mono);
  font-weight: 600;
  white-space: nowrap;
}

.demo-section {
  background: #ffffff;
}

.limitation-list ul {
  margin: 1.25rem 0 0;
  padding-left: 1.35rem;
}

.limitation-list li + li {
  margin-top: 0.8rem;
}

.bibtex-section {
  padding-top: 3.5rem;
  padding-bottom: 5rem;
}

.bibtex-box {
  position: relative;
  overflow: hidden;
}

.bibtex-box pre {
  margin: 0;
  padding: 1.25rem 1.35rem;
  overflow-x: auto;
  background: #f1f4f2;
  color: var(--navy-deep);
  font-family: var(--mono);
  font-size: 0.88rem;
  line-height: 1.6;
}

.copy-button {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  border-color: var(--line-strong) !important;
  background: #fff !important;
  color: var(--navy) !important;
}

.copy-button:hover {
  border-color: var(--accent) !important;
  background: var(--accent-soft) !important;
}

.project-footer {
  padding: 2.25rem 1.5rem;
  border-top: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--muted);
  font-size: 0.88rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr);
  gap: 2rem;
}

.footer-grid p {
  margin: 0;
}

.scroll-to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 20;
  width: 2.7rem;
  height: 2.7rem;
  border: 1px solid var(--navy);
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(0.5rem);
  transition: opacity 160ms ease, transform 160ms ease, background-color 160ms ease;
}

.scroll-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.scroll-to-top:hover {
  background: var(--accent);
  border-color: var(--accent);
}

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

@media (max-width: 768px) {
  .project-hero .hero-body {
    padding: 4.25rem 1.25rem 3.5rem;
  }

  .section {
    padding: 3.5rem 1.25rem;
  }

  .section-tight {
    padding-top: 2rem;
    padding-bottom: 2rem;
  }

  .project-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-links .button {
    width: 100%;
  }

  .benchmark-stage {
    grid-template-columns: 2.2rem minmax(0, 1fr) 2.2rem;
    gap: 0.4rem;
  }

  .benchmark-control {
    width: 2.2rem;
    height: 2.2rem;
  }

  .footer-grid {
    display: block;
  }

  .footer-grid p + p {
    margin-top: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media print {
  .project-links,
  .scroll-to-top,
  .video-status,
  .copy-button {
    display: none;
  }

  .section,
  .project-hero .hero-body {
    padding: 1.5rem 0;
  }

  .benchmark-section,
  .demo-section,
  .bibtex-box pre {
    background: #fff;
    color: #000;
  }
}
