:root {
  --bg: #faf9f7;
  --bg-alt: #f0ece4;
  --surface: #ffffff;
  --text: #1f2933;
  --muted: #52606d;
  --accent: #0f766e;
  --accent-dark: #0b5f59;
  --border: #d9e2ec;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  --radius: 12px;
  --max-width: 1040px;
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 2.75rem;
  --space-6: 3.5rem;
  --section-gap: 5rem;
  --block-gap: 2.25rem;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

.container {
  width: min(calc(100% - 2.5rem), var(--max-width));
  margin: 0 auto;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--block-gap);
}

.hero {
  background:
    radial-gradient(circle at top right, rgba(15, 118, 110, 0.12), transparent 40%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
  padding: 3.5rem 0 2.75rem;
}

.hero-inner {
  text-align: center;
}

.venue {
  display: inline-block;
  margin: 0 0 var(--space-2);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.1);
  color: var(--accent-dark);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  font-family: "Source Serif 4", Georgia, serif;
  line-height: 1.2;
}

h1 {
  margin: 0 auto var(--space-3);
  max-width: 880px;
  font-size: clamp(1.85rem, 3.8vw, 2.65rem);
}

.authors {
  margin: 0 0 var(--space-2);
  font-size: 1rem;
  line-height: 1.8;
}

.affiliations {
  margin: 0 0 var(--space-4);
  color: var(--muted);
  font-size: 0.95rem;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 6.5rem;
  padding: 0.65rem 1.15rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
}

.btn:hover {
  background: var(--accent-dark);
  color: #fff;
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  color: var(--accent-dark);
  border: 1px solid var(--accent);
}

.btn-outline:hover {
  background: rgba(15, 118, 110, 0.08);
  color: var(--accent-dark);
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
  background: rgba(250, 249, 247, 0.92);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  gap: 2rem;
  justify-content: center;
  padding: 0.85rem 0;
}

.nav-inner a {
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
}

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

.section {
  padding: var(--section-gap) 0;
}

.section-alt {
  background: var(--bg-alt);
}

h2 {
  margin: 0;
  font-size: clamp(1.65rem, 2.8vw, 2rem);
  letter-spacing: -0.01em;
}

.section-opening,
.section-prose {
  max-width: 740px;
  margin-inline: auto;
  text-align: center;
}

.section-opening h2,
.section-prose h2 {
  margin: 0 0 var(--space-3);
}

.section-opening p,
.section-prose p {
  margin: 0 0 var(--space-3);
  font-size: 1.05rem;
  line-height: 1.75;
  text-align: left;
  color: var(--text);
}

.section-prose p:last-child,
.section-opening p:last-child {
  margin-bottom: 0;
}

.figure-card {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.figure-media {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3);
  background: linear-gradient(180deg, #fbfcfd 0%, #f4f6f8 100%);
  border-bottom: 1px solid var(--border);
}

.figure-card img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: contain;
}

.figure-wide {
  max-width: 900px;
  margin-inline: auto;
}

.figure-wide .figure-media {
  padding: var(--space-4) var(--space-3);
}

.figure-wide img {
  max-height: 380px;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.results-grid .figure-media {
  min-height: 220px;
  padding: var(--space-2);
}

.results-grid img {
  max-height: 260px;
}

.figure-card figcaption {
  padding: 0.9rem 1.15rem 1.05rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.method-steps {
  margin: 0;
  padding: 0;
  display: flex;
  align-items: stretch;
  gap: var(--space-2);
}

.method-step {
  flex: 1;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem 1.25rem;
  box-shadow: var(--shadow);
}

.method-step-arrow {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  width: 1.75rem;
  color: var(--accent);
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1;
  user-select: none;
}

.method-step h3 {
  margin: 0 0 0.55rem;
  font-size: 1.05rem;
}

.method-step p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.subsection-title {
  margin: 0;
  font-size: 1.15rem;
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 600;
}

.demo-group + .demo-group {
  margin-top: var(--space-5);
}

#demo .container {
  width: min(calc(100% - 2.5rem), 1120px);
}

.video-gallery {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.video-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.video-caption {
  margin: 0;
  padding: 0.85rem 1rem 1rem;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
}

.video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: var(--video-ratio, 3 / 1);
  background: #0b1018;
}

.video-frame video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #0b1018;
}

.video-card.placeholder .video-frame video {
  opacity: 0;
}

.video-placeholder-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #e5e7eb;
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.35), rgba(17, 24, 39, 0.9)),
    repeating-linear-gradient(
      -45deg,
      rgba(255, 255, 255, 0.05),
      rgba(255, 255, 255, 0.05) 12px,
      transparent 12px,
      transparent 24px
    );
}

.video-card:not(.placeholder) .video-placeholder-label {
  display: none;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--space-5) 0;
  color: var(--muted);
  font-size: 0.92rem;
  text-align: center;
}

.footnote {
  margin-top: var(--space-2);
  font-size: 0.85rem;
}

code {
  padding: 0.12rem 0.35rem;
  border-radius: 0.35rem;
  background: rgba(15, 118, 110, 0.08);
  font-size: 0.88em;
}

@media (max-width: 960px) {
  :root {
    --section-gap: 3.75rem;
    --block-gap: 1.75rem;
  }

  .method-steps {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-2);
  }

  .method-step-arrow {
    width: auto;
    height: 1.5rem;
    transform: rotate(90deg);
  }

  .results-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .container {
    width: min(calc(100% - 1.5rem), var(--max-width));
  }

  .hero {
    padding-top: 2.75rem;
  }

  .nav-inner {
    gap: 1.25rem;
  }

  .figure-wide img,
  .figure-card img {
    max-height: none;
  }
}
