:root {
  --ink: #181a20;
  --muted: #5f6875;
  --subtle: #7b8490;
  --page: #fbfbfa;
  --surface: #ffffff;
  --soft: #f4f6f5;
  --soft-2: #f7f7f4;
  --line: #e1e5e2;
  --line-strong: #cfd7d2;
  --teal: #0f766e;
  --teal-dark: #115e59;
  --teal-soft: #e8f4f1;
  --blue: #315f9a;
  --gold: #9a6a10;
  --rose: #a43f59;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

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

body {
  background: var(--page);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--teal-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

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

img {
  display: block;
  height: auto;
  max-width: 100%;
}

.top-nav {
  align-items: center;
  backdrop-filter: blur(16px);
  background: rgba(251, 251, 250, 0.9);
  border-bottom: 1px solid rgba(225, 229, 226, 0.88);
  display: flex;
  gap: 24px;
  justify-content: space-between;
  left: 0;
  padding: 13px clamp(18px, 4vw, 48px);
  position: sticky;
  right: 0;
  top: 0;
  z-index: 20;
}

.brand {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0;
  text-decoration: none;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: flex-end;
}

.nav-links a {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 650;
  text-decoration: none;
}

.nav-links a:hover {
  color: var(--teal-dark);
}

.hero-section {
  border-bottom: 1px solid var(--line);
  padding: 64px 1.5rem 54px;
}

.hero-shell {
  align-items: center;
  display: flex;
  flex-direction: column;
}

.hero-copy {
  max-width: 1030px;
  text-align: center;
}

.venue-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 24px;
}

.venue-pill,
.venue-note {
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  padding: 9px 12px;
}

.venue-pill {
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.venue-note {
  background: #eef3f8;
  color: var(--blue);
}

.hero-copy h1 {
  color: var(--ink);
  font-size: 5.25rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 0.96;
  margin: 0 0 18px;
}

.paper-title {
  color: var(--ink);
  font-size: 1.9rem;
  font-weight: 760;
  letter-spacing: 0;
  line-height: 1.2;
  margin: 0 auto 18px;
  max-width: 900px;
}

.hero-subtitle {
  color: var(--muted);
  font-size: 1.08rem;
  margin: 0 auto 24px;
  max-width: 760px;
}

.publication-authors {
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.78;
  margin: 0 auto 14px;
  max-width: 980px;
}

.author-block {
  display: inline;
}

.author-block:not(:last-child)::after {
  color: #9aa3ae;
  content: ",";
  margin-right: 4px;
}

.publication-authors a {
  font-weight: 650;
  text-decoration: none;
}

.affiliations {
  color: var(--subtle);
  font-size: 0.93rem;
  margin: 0 auto 24px;
  max-width: 820px;
}

.publication-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.button.project-button {
  border: 0;
  border-radius: var(--radius) !important;
  box-shadow: none;
  font-weight: 750;
  height: 42px;
  letter-spacing: 0;
  padding: 0 15px;
  transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.button.project-button.is-dark {
  background: var(--ink);
}

.button.project-button.is-dark:hover {
  background: var(--teal-dark);
  color: white;
  transform: translateY(-1px);
}

.hero-visual,
.paper-figure,
.wide-figure,
.results-figure,
.gallery-item {
  margin: 0;
}

.hero-visual {
  margin-top: 42px;
  max-width: 1040px;
  width: 100%;
}

.hero-visual img {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 0 auto;
  max-height: 620px;
  object-fit: contain;
  width: auto;
}

figcaption {
  color: var(--subtle);
  font-size: 0.9rem;
  line-height: 1.48;
  margin-top: 11px;
}

.hero-visual figcaption {
  margin-left: auto;
  margin-right: auto;
  max-width: 780px;
  text-align: center;
}

.section-band {
  padding: 78px 1.5rem;
}

.section-band.quiet,
.section-band.contrast {
  background: var(--soft);
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
}

.section-band.contrast {
  background: var(--soft-2);
  color: var(--ink);
}

.section-band.contrast .section-kicker,
.section-band.contrast h2,
.section-band.contrast p {
  color: inherit;
}

.section-band.contrast .section-heading p {
  color: var(--muted);
}

.section-heading {
  margin: 0 auto 34px;
  max-width: 820px;
  text-align: center;
}

.section-heading-left {
  margin-left: 0;
  margin-right: 0;
  max-width: 760px;
  text-align: left;
}

.section-heading.compact {
  margin-bottom: 28px;
}

.section-kicker {
  color: var(--teal-dark);
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 10px;
  text-transform: none;
}

h2 {
  color: var(--ink);
  font-size: 2.35rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.14;
  margin: 0 0 16px;
}

h3 {
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.28;
  margin: 8px 0 10px;
}

.narrative {
  text-align: left;
}

.narrative p:not(.section-kicker),
.section-heading p {
  color: var(--muted);
  font-size: 1.04rem;
  margin-left: auto;
  margin-right: auto;
  max-width: 780px;
}

.narrative p:not(.section-kicker) {
  margin-left: 0;
  max-width: none;
}

.wide-figure img,
.paper-figure img,
.results-figure img,
.gallery-item img {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 0 auto;
}

.method-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 32px;
}

.method-item {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}

.method-item:first-child {
  border-top: 3px solid var(--teal);
}

.method-item:nth-child(2) {
  border-top: 3px solid var(--gold);
}

.method-item p {
  color: var(--muted);
  margin: 0;
}

.step-number {
  color: var(--rose);
  font-size: 0.84rem;
  font-weight: 800;
}

.two-figures {
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.diagram-figure img {
  padding: 8px;
}

.motivation-layout {
  display: block;
}

.motivation-content {
  margin-bottom: 30px;
}

.motivation-copy {
  align-items: start;
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 390px);
}

.motivation-text p {
  color: var(--muted);
  font-size: 1.04rem;
  margin: 0 0 16px;
}

.motivation-text p:last-child {
  margin-bottom: 0;
}

.insight-list {
  border-left: 1px solid var(--line-strong);
  display: grid;
  gap: 11px;
  padding-left: 22px;
}

.insight-list span {
  align-items: center;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  display: flex;
  font-size: 0.94rem;
  font-weight: 720;
  min-height: 48px;
  padding: 10px 14px;
}

.insight-list span::before {
  background: var(--teal);
  border-radius: 999px;
  content: "";
  flex: 0 0 auto;
  height: 8px;
  margin-right: 10px;
  width: 8px;
}

.insight-list span:nth-child(2)::before {
  background: var(--rose);
}

.insight-list span:nth-child(3)::before {
  background: var(--gold);
}

.motivation-figure {
  margin-left: auto;
  margin-right: auto;
  max-width: 820px;
  width: 100%;
}

.metric-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 124px;
  padding: 18px;
}

.metric-value {
  color: var(--ink);
  display: block;
  font-size: 1.42rem;
  font-weight: 800;
  line-height: 1.18;
  margin-bottom: 9px;
}

.metric-label {
  color: var(--muted);
  display: block;
  font-size: 0.92rem;
  line-height: 1.45;
}

.results-layout {
  align-items: center;
  display: grid;
  gap: 44px;
  grid-template-columns: minmax(300px, 430px) minmax(320px, 520px);
  justify-content: center;
}

.results-panel {
  display: grid;
  gap: 16px;
}

.results-note {
  border-left: 2px solid var(--teal);
  color: var(--muted) !important;
  font-size: 0.95rem;
  line-height: 1.58;
  margin: 0;
  padding: 2px 0 2px 16px;
}

.results-figure {
  justify-self: center;
  max-width: 520px;
  width: 100%;
}

.results-figure img {
  width: 100%;
}

.gallery-grid {
  align-items: start;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
}

.gallery-item:first-child {
  grid-row: span 2;
}

.gallery-item img {
  object-fit: contain;
  width: 100%;
}

.gallery-item:first-child img {
  aspect-ratio: 1800 / 1198;
}

.gallery-item:nth-child(2) img {
  aspect-ratio: 1724 / 816;
}

.gallery-item:nth-child(3) img {
  aspect-ratio: 1790 / 732;
}

.bibtex-header {
  align-items: flex-end;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.bibtex-header h2 {
  margin-bottom: 0;
}

.copy-bibtex-btn {
  align-items: center;
  background: var(--teal-dark);
  border: 0;
  border-radius: var(--radius);
  color: white;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 750;
  gap: 8px;
  letter-spacing: 0;
  min-height: 40px;
  padding: 0 14px;
}

.copy-bibtex-btn:hover,
.copy-bibtex-btn.copied {
  background: var(--ink);
}

pre {
  background: #141820 !important;
  border: 1px solid #252b35;
  border-radius: var(--radius);
  color: #e5e7eb;
  font-size: 0.9rem;
  line-height: 1.55;
  overflow-x: auto;
  padding: 22px;
}

code {
  background: transparent !important;
  color: inherit !important;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.footer {
  background: #15171d;
  color: rgba(255, 255, 255, 0.72);
  padding: 34px 1.5rem;
}

.footer p {
  margin: 0 0 8px;
}

.footer a {
  color: #a7f3d0;
}

.scroll-to-top {
  align-items: center;
  background: var(--teal-dark);
  border: 0;
  border-radius: 999px;
  bottom: 22px;
  box-shadow: none;
  color: white;
  cursor: pointer;
  display: flex;
  height: 44px;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  right: 22px;
  transition: opacity 160ms ease, transform 160ms ease;
  width: 44px;
  z-index: 30;
}

.scroll-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

.scroll-to-top:hover {
  transform: translateY(-2px);
}

@media screen and (max-width: 1080px) {
  .hero-copy h1 {
    font-size: 4.3rem;
  }

  .paper-title {
    font-size: 1.65rem;
  }

  .motivation-copy,
  .two-figures,
  .results-layout,
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .section-heading-left {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
  }

  .motivation-text {
    margin-left: auto;
    margin-right: auto;
    max-width: 820px;
    text-align: center;
  }

  .insight-list {
    border-left: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding-left: 0;
  }

  .motivation-figure {
    max-width: 760px;
  }

  .results-panel {
    margin-left: auto;
    margin-right: auto;
    max-width: 760px;
    width: 100%;
  }

  .gallery-item:first-child {
    grid-row: auto;
  }
}

@media screen and (max-width: 760px) {
  .top-nav {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 12px 16px;
  }

  .nav-links {
    gap: 12px;
    justify-content: flex-start;
  }

  .hero-section,
  .section-band {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .hero-section {
    padding-bottom: 42px;
    padding-top: 34px;
  }

  .hero-copy h1 {
    font-size: 3.25rem;
  }

  .paper-title {
    font-size: 1.28rem;
  }

  .hero-subtitle,
  .narrative p:not(.section-kicker),
  .section-heading p,
  .motivation-text p {
    font-size: 1rem;
  }

  .hero-visual {
    margin-top: 30px;
  }

  .hero-visual img {
    width: 100%;
  }

  .section-band {
    padding-bottom: 58px;
    padding-top: 58px;
  }

  h2 {
    font-size: 1.82rem;
  }

  .method-grid,
  .metric-grid,
  .insight-list {
    grid-template-columns: 1fr;
  }

  .motivation-text {
    text-align: left;
  }

  .metric {
    min-height: 112px;
  }

  .bibtex-header {
    align-items: flex-start;
    flex-direction: column;
  }

  pre {
    font-size: 0.78rem;
    padding: 16px;
  }

  .scroll-to-top {
    display: none;
  }
}

@media screen and (max-width: 420px) {
  .hero-copy h1 {
    font-size: 2.85rem;
  }

  .publication-links .button {
    flex: 1 1 calc(50% - 10px);
  }
}

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

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