:root {
  --bg: #fff9f4;
  --bg-soft: #fff3e8;
  --paper: #fffaf6;
  --ink: #2c1a0e;
  --muted: #7a5640;
  --line: rgba(44, 26, 14, 0.1);
  --accent: #e07820;
  --accent-soft: rgba(224, 120, 32, 0.14);
  --find: #2b6cb0;
  --guide: #2f855a;
  --hide: #c05621;
  --shadow: 0 12px 32px rgba(31, 41, 55, 0.06);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 1.1rem;
  color: var(--ink);
  background: linear-gradient(160deg, #fff4e6 0%, #ffe8cc 40%, #fff9f4 100%);
  background-attachment: fixed;
}

/* ── Academic paper section titles ───────────────── */
.paper-section-title {
  text-align: center;
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 2rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  margin: 56px 0 20px;
  color: var(--ink);
}

.paper-section-intro {
  max-width: 720px;
  margin: 0 auto 32px;
  text-align: justify;
  line-height: 1.8;
  color: var(--muted);
  font-size: 1.05rem;
}

.page-shell {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.topbar {
  position: sticky;
  top: 12px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 22px;
  margin-bottom: 22px;
  border: 1px solid rgba(29, 47, 45, 0.08);
  border-radius: 20px;
  background: rgba(249, 251, 253, 0.96);
  box-shadow: 0 4px 14px rgba(31, 41, 55, 0.04);
}

.brand,
.nav a,
.button {
  text-decoration: none;
}

.brand {
  color: var(--ink);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.nav a {
  color: var(--muted);
  font-size: 0.95rem;
  transition: color 180ms ease;
}

.nav a:hover,
.nav a.is-active {
  color: var(--ink);
}

section,
.footer {
  background: transparent;
}

.footer {
  border-radius: var(--radius-lg);
}

.hero,
.inputs-section,
.modes-section,
.framework-section,
.results-section,
.study-section,
.impact-section {
  padding: 32px;
  margin-bottom: 18px;
}

.hero {
  display: block;
  padding-top: 28px;
  padding-bottom: 28px;
}

.eyebrow,
.section-label,
.stage-label,
.mode-kicker,
.stat-label {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.73rem;
  font-weight: 700;
  color: var(--muted);
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: -0.02em;
  font-family: 'EB Garamond', Georgia, serif;
  font-weight: 600;
}

h1 {
  max-width: 640px;
  margin: 12px 0 0;
  font-size: clamp(1.55rem, 3.3vw, 2.45rem);
  line-height: 1.08;
}

h1 span {
  display: block;
}

h2 {
  font-size: clamp(1.45rem, 2.8vw, 2.05rem);
  line-height: 1.12;
}

h3 {
  font-size: clamp(1.05rem, 1.8vw, 1.35rem);
  line-height: 1.2;
}

.hero-mark-inline {
  display: inline;
  font-style: normal;
  font-size: 0.85em;
  vertical-align: middle;
}

.hero-tagline {
  max-width: 680px;
  margin: 14px auto 0;
  color: var(--muted);
  font-size: clamp(0.95rem, 1.5vw, 1.05rem);
  line-height: 1.6;
  font-style: italic;
}

.hero-authors {
  max-width: 820px;
  margin: 18px auto 0;
  color: #4b7a67;
  font-size: clamp(0.95rem, 1.5vw, 1.05rem);
  line-height: 2;
  text-align: center;
}

.author-link {
  display: inline-block;
  color: #4b7a67;
  text-decoration: none;
  white-space: nowrap;
}

a.author-link:hover {
  color: #e07820;
  text-decoration: underline;
}

.hero-affiliations {
  margin-top: 14px;
  text-align: center;
}

.affiliation-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 36px;
  flex-wrap: wrap;
}

.affiliation-logo-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.affiliation-logo {
  width: auto;
  object-fit: contain;
  opacity: 0.85;
}

.affiliation-logo-auburn {
  height: 40px;
}

.affiliation-logo-uva {
  height: 120px;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 170px;
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 700;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  color: white;
  background: linear-gradient(135deg, #e07820, #c95c10);
  box-shadow: 0 14px 32px rgba(224, 120, 32, 0.28);
}

.button-secondary {
  color: var(--ink);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.5);
}

.hero-link {
  min-width: 0;
  color: #22282d;
  border: 1px solid rgba(29, 47, 45, 0.16);
  border-radius: 12px;
  background: #f5f8fb;
  letter-spacing: 0.02em;
  font-size: 0.92rem;
}

.hero-link-emphasis {
  border-width: 2px;
  box-shadow: inset 0 0 0 1px rgba(29, 47, 45, 0.12);
}

.hero-teaser {
  max-width: 620px;
  margin: 18px 0 0;
  color: #44504e;
  font-size: 1rem;
  line-height: 1.75;
}

.hero-copy {
  max-width: 860px;
  margin: 0 auto;
  text-align: left;
}

.hero-centered .hero-copy {
  text-align: center;
}


.hero-centered h1 {
  margin-left: auto;
  margin-right: auto;
}

.hero-links-centered {
  justify-content: center;
}


.callout-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-bottom: 22px;
  background: transparent;
  box-shadow: none;
  border: 0;
}

.callout-grid .paper-section-title {
  grid-column: 1 / -1;
  margin-top: 12px;
}

.abstract-card-full {
  grid-column: 1 / -1;
}

.abstract-list {
  margin: 10px 0 0 1.2em;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.section-heading-wide {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

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

.callout {
  padding: 24px;
  border-radius: 18px;
  border: 1px solid rgba(36, 50, 58, 0.08);
  background: var(--paper);
  box-shadow: none;
}

.callout p:last-child {
  margin-bottom: 0;
  line-height: 1.8;
}

.section-heading {
  margin-bottom: 22px;
}

.section-heading h2 {
  margin-top: 8px;
  max-width: 800px;
}

.section-intro {
  max-width: 700px;
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.takeaway-list {
  margin: 0;
  padding-left: 18px;
  line-height: 1.8;
  color: var(--ink);
}

.mode-switch {
  display: inline-flex;
  gap: 10px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
}

.mode-pill {
  border: 0;
  border-radius: 10px;
  padding: 9px 14px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease;
}

.mode-pill.is-active {
  background: var(--ink);
  color: white;
}

.mode-pill-icon {
  width: 15px;
  height: 15px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 5px;
  margin-top: -2px;
  flex-shrink: 0;
}

.mode-pill-pdf   { border-left: 3px solid #e55a2b; }
.mode-pill-vqa   { border-left: 3px solid #0D5BDC; }
.mode-pill-pageoff { border-left: 3px solid #7950F2; }

/* ── Video Demonstrations ─────────────────────────────────── */
.video-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0 16px;
}

.video-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 999px;
  border: 1.5px solid currentColor;
  background: transparent;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.video-pill-find    { border-color: #FFAB40; color: #b45309; }
.video-pill-find.is-active,
.video-pill-find:hover    { background: #FFAB40; color: #fff; }

.video-pill-guide   { border-color: #0D5BDC; color: #0D5BDC; }
.video-pill-guide.is-active,
.video-pill-guide:hover   { background: #0D5BDC; color: #fff; }

.video-pill-hide    { border-color: #7950F2; color: #7950F2; }
.video-pill-hide.is-active,
.video-pill-hide:hover    { background: #7950F2; color: #fff; }

.video-pill-pdf     { border-color: #e55a2b; color: #c0431a; }
.video-pill-pdf.is-active,
.video-pill-pdf:hover     { background: #e55a2b; color: #fff; }

.video-pill-vqa     { border-color: #0ea5e9; color: #0369a1; }
.video-pill-vqa.is-active,
.video-pill-vqa:hover     { background: #0ea5e9; color: #fff; }

.video-stage {
  margin-bottom: 40px;
}

.video-player {
  display: none;
  width: 75%;
  border-radius: 8px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.10);
}

.video-player.is-active {
  display: block;
  margin: 0 auto;
}

/* ─────────────────────────────────────────────────────────── */

.mode-stage {
  margin-top: 20px;
}

.mode-panel {
  display: none;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 28px;
  align-items: center;
}

.mode-panel.is-active {
  display: grid;
}

.mode-copy h3 {
  margin-top: 10px;
}

.mode-copy p {
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.85;
}

.feature-list {
  margin: 20px 0 0;
  padding-left: 18px;
  color: var(--ink);
  line-height: 1.9;
}

.browser-card {
  min-height: 340px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(24, 41, 39, 0.12);
  background: #f5f9fc;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.browser-top {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.browser-top span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(29, 47, 45, 0.2);
}

.browser-body {
  position: relative;
  height: 280px;
  padding: 20px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  overflow: hidden;
}

.fake-heading,
.fake-line,
.fake-highlight,
.fake-callout,
.guide-rail,
.guide-target,
.suppressed-block,
.blur-tile {
  border-radius: 12px;
}

.fake-heading {
  width: 58%;
  height: 18px;
  background: rgba(29, 47, 45, 0.12);
  margin-bottom: 14px;
}

.fake-heading.short {
  width: 42%;
}

.fake-line {
  height: 11px;
  margin-bottom: 12px;
  background: rgba(29, 47, 45, 0.09);
}

.w-90 { width: 90%; }
.w-85 { width: 85%; }
.w-80 { width: 80%; }
.w-75 { width: 75%; }
.w-70 { width: 70%; }

.fake-highlight {
  width: 64%;
  height: 44px;
  margin: 18px 0 16px;
  background:
    linear-gradient(0deg, rgba(250, 204, 21, 0.24), rgba(250, 204, 21, 0.24)),
    rgba(59, 130, 246, 0.1);
  outline: 2px solid rgba(43, 108, 176, 0.32);
}

.fake-callout {
  position: absolute;
  right: 18px;
  top: 96px;
  padding: 10px 12px;
  border: 1px solid rgba(43, 108, 176, 0.2);
  background: rgba(243, 249, 255, 0.98);
  color: #1e4b80;
  font-size: 0.85rem;
  font-weight: 600;
}

.guide-rail {
  width: 50%;
  padding: 14px;
  border: 1px solid rgba(47, 133, 90, 0.18);
  background: rgba(240, 248, 244, 0.96);
}

.guide-step {
  padding: 10px 12px;
  border-radius: 10px;
  color: #2f5544;
  font-size: 0.92rem;
}

.guide-step.active {
  background: rgba(47, 133, 90, 0.14);
  font-weight: 700;
}

.guide-target {
  position: absolute;
  right: 44px;
  top: 124px;
  width: 118px;
  height: 46px;
  border: 2px solid rgba(47, 133, 90, 0.4);
  background: rgba(47, 133, 90, 0.12);
}

.guide-pointer {
  position: absolute;
  inset: 0;
}

.guide-pointer::before,
.guide-pointer::after {
  content: "";
  position: absolute;
}

.guide-pointer::before {
  width: 120px;
  height: 2px;
  left: 48%;
  top: 145px;
  background: rgba(47, 133, 90, 0.6);
}

.guide-pointer::after {
  right: 148px;
  top: 139px;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 11px solid rgba(47, 133, 90, 0.6);
}

.browser-hide .browser-body {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 18px;
}

.suppressed-block {
  display: flex;
  align-items: center;
  min-height: 74px;
  padding: 16px;
  margin: 18px 0 16px;
  border: 1px dashed rgba(192, 86, 33, 0.35);
  background: rgba(255, 244, 237, 0.96);
  color: #9a4318;
  font-weight: 600;
}

.noise-column {
  display: grid;
  gap: 14px;
}

.blur-tile {
  height: 120px;
  background: rgba(29, 47, 45, 0.1);
  filter: blur(1px);
  opacity: 0.55;
}

.pipeline {
  display: grid;
  grid-template-columns: 1fr 0.9fr 1.2fr;
  gap: 18px;
  align-items: stretch;
}

.pipeline-stage,
.pipeline-router,
.pipeline-actions,
.action-card,
.stat-card,
.chart-block,
.delta-card,
.note,
.impact-card {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.pipeline-stage,
.pipeline-router,
.pipeline-actions {
  padding: 20px;
  border-radius: 18px;
}

.source-badge {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(244, 248, 251, 0.96);
}

.source-badge-large {
  min-height: 140px;
  align-content: start;
  padding: 18px 18px;
}

.source-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(29, 47, 45, 0.08);
  font-weight: 800;
}

.source-badge-large p {
  font-size: 1.05rem;
  font-weight: 700;
}

.source-badge-large small {
  display: block;
  margin-top: 8px;
  max-width: 240px;
  line-height: 1.55;
}

.source-badge p,
.router-metric span,
.stat-text,
.note p,
.impact-card p,
.framework-caption,
.chart-header p {
  color: var(--muted);
}

.source-badge p,
.router-metric,
.bar-row,
.delta-values,
.stat-card {
  margin: 0;
}

.pipeline-stage ul {
  margin: 16px 0 0;
  padding-left: 18px;
  line-height: 1.85;
}

.pipeline-router p {
  line-height: 1.75;
}

.router-metric {
  margin-top: 22px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.router-metric strong {
  font-size: 2.1rem;
  font-family: Arial, Helvetica, sans-serif;
}

.pipeline-actions {
  display: grid;
  gap: 14px;
}

.action-card {
  padding: 18px;
  border-radius: 18px;
}

.action-card p {
  margin: 12px 0 0;
  line-height: 1.65;
}

.action-tag {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
}

.find-card .action-tag {
  color: var(--find);
  background: rgba(43, 108, 176, 0.12);
}

.guide-card .action-tag {
  color: var(--guide);
  background: rgba(47, 133, 90, 0.12);
}

.hide-card .action-tag {
  color: var(--hide);
  background: rgba(192, 86, 33, 0.12);
}

.framework-caption {
  margin-top: 18px;
  text-align: center;
  font-size: 0.96rem;
}

.stats-grid,
.study-grid,
.impact-layout,
.study-notes {
  display: grid;
  gap: 18px;
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-card {
  padding: 20px;
  border-radius: 18px;
}

.stat-value {
  display: block;
  margin-top: 12px;
  font-size: 2rem;
  line-height: 1;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 700;
}

.stat-unit {
  display: inline-block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.95rem;
}

.stat-text {
  margin-top: 18px;
  line-height: 1.7;
}

.chart-block {
  margin-top: 18px;
  padding: 22px;
  border-radius: 18px;
}

.chart-header h3 {
  font-size: 1.2rem;
}

.bars {
  margin-top: 24px;
  display: grid;
  gap: 16px;
}

.bar-row {
  display: grid;
  grid-template-columns: 220px 1fr 70px;
  align-items: center;
  gap: 16px;
}

.bar-track {
  position: relative;
  height: 14px;
  border-radius: 999px;
  background: rgba(29, 47, 45, 0.08);
  overflow: hidden;
}

.bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--fill);
  border-radius: inherit;
  background: linear-gradient(90deg, #1d6a4b, #d98e52);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 850ms cubic-bezier(0.16, 1, 0.3, 1);
}

.bar-fill.is-visible {
  transform: scaleX(1);
}

.study-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.delta-card,
.note,
.impact-card {
  padding: 24px;
  border-radius: 24px;
}

.delta-card p {
  margin: 0;
  color: var(--muted);
}

.delta-values {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  font-size: 1.2rem;
}

.delta-values strong {
  font-size: 2rem;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 700;
}

.arrow {
  color: var(--muted);
}

.study-notes,
.impact-layout {
  margin-top: 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.note h3,
.impact-card h3 {
  font-size: 1.2rem;
}

.note p,
.impact-card p {
  line-height: 1.75;
}

.footer {
  padding: 24px 30px;
  text-align: center;
  color: var(--muted);
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 650ms ease,
    transform 650ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1080px) {
  .pipeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats-grid,
  .study-grid,
  .study-notes,
  .impact-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 800px) {
  .page-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 12px;
  }

  .topbar {
    position: static;
    border-radius: 28px;
    padding: 16px 18px;
  }

  .nav {
    gap: 12px;
  }

  .hero,
  .modes-section,
  .framework-section,
  .results-section,
  .study-section,
  .impact-section {
    padding: 28px 22px;
  }

  .callout-grid,
  .inputs-grid,
  .mode-panel,
  .pipeline,
  .stats-grid,
  .study-grid,
  .study-notes,
  .impact-layout {
    grid-template-columns: 1fr;
  }

  .hero-link {
    min-width: min(100%, 260px);
  }

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

  .hero-mark {
    margin-left: auto;
    margin-right: auto;
  }

  h1,
  .hero-teaser {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-links {
    justify-content: center;
  }

  .bar-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

/* ── Paper figures ────────────────────────────────── */
.paper-figure {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--paper);
}

.paper-figure-wide {
  width: 100%;
}

.figure-caption {
  margin-top: 10px;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
}

.caption-icon {
  display: inline-block;
  width: 1.1em;
  height: 1.1em;
  vertical-align: middle;
  margin-right: 3px;
  margin-top: -2px;
  border-radius: 3px;
  object-fit: contain;
}

sc {
  font-variant: small-caps;
  font-style: normal;
}

/* ── BibTeX section ───────────────────────────────── */
.bibtex-section {
  margin-top: 0;
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
}

.bibtex-card {
  position: relative;
  background: #1e2130;
  border-radius: var(--radius-md);
  padding: 28px 32px;
  max-width: 720px;
  margin: 0 auto;
}

.bibtex-pre {
  margin: 0;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.9rem;
  line-height: 1.75;
  color: #c9d1d9;
  white-space: pre;
  overflow-x: auto;
}

.bibtex-copy-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 6px 16px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.08);
  color: #c9d1d9;
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.bibtex-copy-btn:hover {
  background: rgba(255,255,255,0.16);
  color: #fff;
}

.bibtex-copy-btn.copied {
  background: #2ea043;
  border-color: #2ea043;
  color: #fff;
}

.figure-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--muted);
  font-size: 0.9rem;
  font-style: italic;
}

.framework-figure {
  margin-top: 32px;
}

/* ── Method workflow figure ───────────────────────── */
.method-workflow {
  margin-bottom: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.method-workflow-img {
  width: 75%;
  height: auto;
}

.caption-arrow {
  font-family: monospace;
  font-size: 0.85em;
  font-weight: 700;
}

.caption-arrow-find  { color: #FFAB40; }
.caption-arrow-guide { color: #0D5BDC; }
.caption-arrow-hide  { color: #7950F2; }

.caption-highlight-yellow {
  display: inline-block;
  background: #FFD700;
  width: 2.5em;
  height: 0.9em;
  vertical-align: middle;
  border-radius: 2px;
}

/* ── Prompt tabs ──────────────────────────────────── */
.prompt-tabs {
  width: 100%;
  margin: 24px 0 32px;
}

.prompt-switch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.prompt-paper-link {
  margin-left: 6px;
  font-size: 0.88rem;
  color: var(--muted);
  font-style: italic;
  text-decoration: none;
  border-bottom: 1px dashed var(--muted);
  transition: color 150ms, border-color 150ms;
}

.prompt-paper-link:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.prompt-pill {
  padding: 6px 18px;
  border-radius: 8px;
  border: 2px solid transparent;
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 1rem;
  cursor: pointer;
  background: transparent;
  transition: background 160ms, color 160ms, border-color 160ms;
}

/* Router — gray */
.prompt-pill-router               { border-color: #9ca3af; color: #4b5563; }
.prompt-pill-router.is-active,
.prompt-pill-router:hover         { background: #9ca3af; color: #fff; }

/* Find — yellow/amber */
.prompt-pill-find                 { border-color: #FFAB40; color: #b45309; }
.prompt-pill-find.is-active,
.prompt-pill-find:hover           { background: #FFAB40; color: #fff; }

/* Guide — blue */
.prompt-pill-guide                { border-color: #0D5BDC; color: #0D5BDC; }
.prompt-pill-guide.is-active,
.prompt-pill-guide:hover          { background: #0D5BDC; color: #fff; }

/* Hide — violet */
.prompt-pill-hide                 { border-color: #7950F2; color: #7950F2; }
.prompt-pill-hide.is-active,
.prompt-pill-hide:hover           { background: #7950F2; color: #fff; }

.prompt-panel {
  display: none;
}

.prompt-panel.is-active {
  display: block;
}

.prompt-box {
  border-radius: var(--radius-sm);
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.95rem;
  line-height: 1.7;
}

.prompt-box p { margin: 0; }

.prompt-role {
  font-weight: 700;
  margin-right: 4px;
}

.prompt-box-router { background: #f3f4f6; border: 1px solid #d1d5db; }
.prompt-box-find   { background: #fffbeb; border: 1px solid #fcd34d; }
.prompt-box-guide  { background: #eff6ff; border: 1px solid #93c5fd; }
.prompt-box-hide   { background: #f5f3ff; border: 1px solid #c4b5fd; }

.prompt-example {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.88rem;
  line-height: 1.6;
}

.prompt-example p { margin: 0; }

.prompt-example code {
  display: inline-block;
  font-size: 0.82rem;
  word-break: break-all;
}

.prompt-example-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 4px;
  opacity: 0.6;
}

.prompt-example-router { background: #e5e7eb; }
.prompt-example-find   { background: #fef3c7; }
.prompt-example-guide  { background: #dbeafe; }
.prompt-example-hide   { background: #ede9fe; }

/* ── Mode blocks (text + full-width image) ───────── */
.mode-block {
  display: none;
  flex-direction: column;
  gap: 20px;
  margin-top: 24px;
}

.mode-block.is-active {
  display: flex;
}

.mode-block-copy {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mode-block-copy h3 {
  margin-top: 4px;
  font-size: 1.2rem;
  line-height: 1.4;
}

.mode-block-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.mode-block-figure {
  width: 100%;
}

/* ── Failure cases carousel ───────────────────────── */
.carousel {
  margin-top: 28px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
}

.carousel-viewport {
  overflow: hidden;
  width: 100%;
  border-radius: var(--radius-sm);
}

.carousel-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  transition: transform 400ms cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.carousel-slide {
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.carousel-img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  display: block;
}

.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 18px;
}

.carousel-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 150ms, border-color 150ms;
  flex-shrink: 0;
}

.carousel-btn:hover:not(:disabled) {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.carousel-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.carousel-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  flex: 1;
}

.carousel-label-btn {
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 160ms, color 160ms, border-color 160ms;
  line-height: 1.3;
}

.carousel-label-btn:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.carousel-label-btn.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.carousel-label-sub {
  display: block;
  font-size: 0.75rem;
  opacity: 0.75;
  font-style: italic;
}

.motivation-figure {
  margin-top: 32px;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--paper);
  border: 1px solid var(--line);
}

.caption-highlight-pink {
  background: #f9a8d4;
  padding: 1px 4px;
  border-radius: 3px;
  font-family: inherit;
}

.caption-highlight-dark {
  background: #1a1d2d;
  color: #7eb8e0;
  padding: 1px 5px;
  border-radius: 3px;
  font-family: inherit;
}

.caption-highlight-green {
  border: 1.5px solid #2ed573;
  background: rgba(46, 213, 115, 0.12);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: monospace;
  font-size: 0.88em;
}

.caption-highlight-red {
  border: 1.5px solid #ff4757;
  background: rgba(255, 71, 87, 0.1);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: monospace;
  font-size: 0.88em;
}

.caption-btn-next {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 4px;
  background: #2ed573;
  color: #1a1d2d;
  font-family: monospace;
  font-size: 0.85em;
  font-weight: 700;
}

.caption-btn-stop {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 4px;
  background: #ff4757;
  color: #fff;
  font-family: monospace;
  font-size: 0.85em;
  font-weight: 700;
}

.caption-code-red {
  border: 1.5px solid #c0392b;
  padding: 1px 5px;
  border-radius: 3px;
  font-family: monospace;
  font-size: 0.88em;
}

.mode-figure {
  flex: 1 1 0;
  min-width: 0;
}

/* ── Results figures grid ─────────────────────────── */
.results-figures {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.results-figure-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.results-figure-wide {
  grid-column: 1 / -1;
}

.results-figure-item {
  display: flex;
  flex-direction: column;
}

@media (max-width: 680px) {
  .results-figure-row {
    grid-template-columns: 1fr;
  }
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
