/* ───── Reset & base ───── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 24px; }
body {
  margin: 0;
  font-family: 'Inter', ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: #111827;
  background: #f7f9fc;
  -webkit-font-smoothing: antialiased;
}

:root {
  --accent: #2563eb;
  --accent-soft: #eff6ff;
  --accent-row: #dbeafe;
  --ours: #059669;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --surface: #ffffff;
  --code-bg: #f1f5f9;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.05);
  --max: 1040px;
  --narrow: 820px;
  --figure: 860px;
}

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

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}
.container.narrow { max-width: var(--narrow); }

h1, h2, h3 { font-weight: 700; letter-spacing: -0.02em; color: var(--text); }

/* ───── Hero ───── */
.hero {
  padding: 80px 0 64px;
  text-align: center;
  background: linear-gradient(180deg, var(--accent-soft) 0%, #f7f9fc 100%);
}
.venue-tag {
  display: inline-block;
  padding: 4px 12px;
  background: var(--accent);
  color: white;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 999px;
  margin-bottom: 20px;
}
.title {
  font-size: clamp(26px, 3.8vw, 40px);
  line-height: 1.2;
  margin: 0 auto 24px;
  max-width: 880px;
}
.title-emph { color: var(--accent); }

.authors {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 20px;
  margin-bottom: 6px;
  font-size: 15px;
}
.author {
  color: var(--text);
  font-weight: 500;
}
.author:hover { color: var(--accent); text-decoration: none; }
.author sup { color: var(--muted); font-weight: 400; margin-left: 1px; }

.affils {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 28px;
}

/* ───── Buttons ───── */
.buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 32px;
}
.btn, .btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background: #111827;
  color: white;
  border: 1px solid #111827;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover:not(.disabled) {
  background: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
}
.btn.disabled {
  background: #f3f4f6;
  color: #9ca3af;
  border-color: #e5e7eb;
  cursor: not-allowed;
}
.btn .soon {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.7;
}
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

/* ───── TL;DR ───── */
.tldr {
  max-width: 720px;
  margin: 0 auto;
  padding: 18px 22px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: 14px;
  text-align: left;
  color: #1f2937;
}
.tldr strong:first-child {
  color: var(--accent);
  font-weight: 600;
}
.tldr-stat {
  display: inline-block;
  padding: 1px 7px;
  margin: 0 1px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 5px;
  font-weight: 600;
  font-size: 12.5px;
  font-family: 'JetBrains Mono', monospace;
}

/* ───── Teaser ───── */
.teaser {
  padding: 56px 0;
}
.teaser-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  max-width: 860px;
  margin: 0 auto;
}
.teaser-item {
  margin: 0;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  aspect-ratio: 16/9;
  box-shadow: var(--shadow-sm);
}
.teaser-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.teaser-item figcaption {
  position: absolute;
  top: 10px;
  left: 10px;
}
.label {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  color: white;
  backdrop-filter: blur(8px);
  letter-spacing: 0.02em;
}
.label-base { background: rgba(17, 24, 39, 0.7); }
.label-ours { background: rgba(5, 150, 105, 0.85); }

.teaser-caption {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin: 20px auto 0;
  max-width: 720px;
}

/* ───── Sections ───── */
.section {
  padding: 64px 0;
}
.section + .section { border-top: 1px solid var(--border); }
.section h2 {
  font-size: clamp(22px, 2.4vw, 28px);
  margin: 0 0 12px;
}
.section p { margin: 0 0 14px; }
.section-intro {
  color: var(--muted);
  font-size: 15px;
  margin: 0 0 28px;
}
.muted { color: var(--muted); font-size: 13px; }

/* ───── Figure blocks ───── */
.fig-block {
  margin: 20px 0 8px;
  text-align: center;
}
.fig-block img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.fig-block figcaption {
  margin-top: 14px;
  font-size: 13.5px;
  line-height: 1.6;
  color: #4b5563;
  text-align: left;
  padding: 0 4px;
}
.fig-block figcaption strong { color: var(--text); font-weight: 600; }
.fig-block figcaption em { color: var(--text); font-style: normal; font-weight: 500; }
.fig-block figcaption code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  background: var(--code-bg);
  padding: 1px 5px;
  border-radius: 4px;
}

/* ───── Sub-heading ───── */
.sub {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 40px 0 4px;
}
.sub:first-child { margin-top: 0; }

/* ───── Stat row (Key Insight) ───── */
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 32px 0 0;
}
.stat {
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  padding: 18px 14px;
  text-align: center;
}
.stat-num {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: -0.03em;
  line-height: 1;
}
.stat-label {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.45;
}

/* ───── Method steps ───── */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 28px 0 0;
}
.step {
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  padding: 18px 18px 16px;
  position: relative;
}
.step-num {
  width: 24px;
  height: 24px;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 10px;
}
.step h3 {
  margin: 0 0 6px;
  font-size: 15px;
}
.step p {
  font-size: 13px;
  color: #4b5563;
  margin: 0;
  line-height: 1.55;
}
.step code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  background: var(--code-bg);
  padding: 1px 5px;
  border-radius: 4px;
}

/* ───── Two-column (efficiency + ablation) ───── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}
.two-col .fig-block { margin: 12px 0 0; }
.two-col .sub { margin-top: 20px; }

/* ───── Key numbers ───── */
.key-numbers {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 48px 0 0;
}
.kn {
  background: var(--accent-soft);
  border-radius: 12px;
  padding: 18px 14px;
  text-align: center;
}
.kn-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--ours);
  font-family: 'JetBrains Mono', monospace;
  line-height: 1;
}
.kn-label {
  font-size: 11.5px;
  color: #4b5563;
  margin-top: 8px;
  line-height: 1.45;
}

/* ───── Method simulation ───── */
.sim {
  margin-top: 8px;
  padding: 22px 22px 20px;
  background: linear-gradient(180deg, #ffffff 0%, #fafbfd 100%);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  position: relative;
}
.sim-phase-tag {
  position: absolute;
  top: 16px;
  right: 18px;
  padding: 4px 11px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 0.3s, border-color 0.3s, background 0.3s;
}
.sim-phase-tag.extract { color: var(--accent); border-color: #bfdbfe; background: #eff6ff; }
.sim-phase-tag.lock    { color: var(--ours);   border-color: #a7f3d0; background: #ecfdf5; }
.sim-phase-tag.guide   { color: var(--ours);   border-color: #a7f3d0; background: #ecfdf5; }
.sim-phase-tag.done    { color: var(--ours);   border-color: #a7f3d0; background: #ecfdf5; }

.sim-stage {
  width: 100%;
  height: auto;
  display: block;
  margin: 4px 0 16px;
}

/* Latent-step blocks: smooth fill + accent ring on activation */
.sim-latent rect {
  transition: fill 0.35s ease, stroke 0.35s ease, filter 0.35s ease;
}
.sim-latent.active rect {
  fill: #dbeafe;
  stroke: var(--accent);
  stroke-width: 2;
  filter: drop-shadow(0 0 6px rgba(37, 99, 235, 0.35));
}
.sim-latent.focus rect {
  filter: drop-shadow(0 0 10px rgba(37, 99, 235, 0.55));
  animation: pulseRing 1.4s ease-in-out infinite;
}
@keyframes pulseRing {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(37, 99, 235, 0.35)); }
  50%      { filter: drop-shadow(0 0 14px rgba(37, 99, 235, 0.7));  }
}

/* Motion prior (Δ_phys) */
#motion-prior { transition: opacity 0.4s ease; }
#motion-prior.dim { opacity: 0.35; }
#motion-prior.ready rect {
  animation: priorPulse 2s ease-in-out infinite;
}
@keyframes priorPulse {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(5, 150, 105, 0.25)); }
  50%      { filter: drop-shadow(0 0 12px rgba(5, 150, 105, 0.55)); }
}

/* Injection arrow: animated flowing dashes when active */
#inject-arrow {
  transition: opacity 0.5s ease;
}
#inject-arrow.flowing {
  animation: flowDash 1.2s linear infinite;
}
@keyframes flowDash {
  to { stroke-dashoffset: -20; }
}
#inject-label { transition: opacity 0.5s ease; }

/* Metrics */
.sim-metrics {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}
.metric-head {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  margin-bottom: 5px;
  color: #475569;
}
.metric-label strong { color: var(--text); font-weight: 600; }
.metric-val {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  color: #64748b;
  transition: color 0.25s;
}
.metric-val-ours { color: var(--ours); }
.meter {
  height: 5px;
  background: #f1f5f9;
  border-radius: 3px;
  overflow: hidden;
}
.meter-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.22s cubic-bezier(.4,0,.2,1);
}
.meter-fill-base { background: linear-gradient(90deg, #94a3b8, #cbd5e1); }
.meter-fill-ours { background: linear-gradient(90deg, var(--ours), #34d399); }

/* Minimal progress line with step 1/2 markers */
.sim-progress {
  position: relative;
  height: 10px;
  margin: 4px 2px 14px;
  cursor: pointer;
}
.sim-progress::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 0;
  right: 0;
  height: 2px;
  background: #e2e8f0;
  border-radius: 2px;
}
.sim-progress-fill {
  position: absolute;
  top: 4px;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--ours));
  border-radius: 2px;
  width: 0;
  transition: width 0.12s linear;
}
.sim-marker {
  position: absolute;
  top: 1px;
  width: 8px;
  height: 8px;
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.08);
}
.sim-marker-1 { left: 2%; }   /* step 1 of 50 */
.sim-marker-2 { left: 4%; }   /* step 2 of 50 */

.sim-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  color: var(--muted);
}
.sim-note { flex: 1; }
.sim-replay {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.sim-replay:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

@media (max-width: 640px) {
  .sim { padding: 16px 14px; }
  .sim-phase-tag { top: 12px; right: 12px; padding: 3px 9px; font-size: 10px; }
}

/* ───── Try-PhaseLock demo (4-card sequential autoplay) ───── */
.section-demo { padding: 48px 0 40px; }

.demo-prompt-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  background: linear-gradient(90deg, #f8fafc, #ffffff);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin: 8px 0 20px;
}
.demo-prompt-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--accent);
  color: white;
  flex-shrink: 0;
  margin-top: 2px;
}
.demo-prompt-text {
  font-size: 13px;
  line-height: 1.55;
  color: #4b5563;
  font-style: italic;
}

/* 4-card horizontal pipeline with arrows */
.demo {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  gap: 8px;
  align-items: stretch;
}

.demo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 12px 10px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 0.45;
  transition: opacity 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease, transform 0.4s ease;
  position: relative;
}
.demo-card.is-active {
  opacity: 1;
  border-color: #bfdbfe;
  box-shadow: var(--shadow);
}
.demo-card.is-done { opacity: 1; }
.demo-card[data-stage="baseline"].is-done { border-color: #cbd5e1; }
.demo-card[data-stage="step2"].is-done    { border-color: #a7f3d0; }
.demo-card[data-stage="ours"].is-done     { border-color: #a7f3d0; }

/* Compare-highlight: when both baseline and ours are done, glow them */
.demo-card.is-compare-ref {
  box-shadow: 0 0 0 2px rgba(100, 116, 139, 0.35), 0 1px 3px rgba(0,0,0,0.04);
}
.demo-card.is-compare-ours {
  box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.45), 0 1px 3px rgba(0,0,0,0.04);
}

.demo-card-head {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.demo-card-title {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.demo-card-title sub { font-size: 8.5px; }
.demo-card-caption {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  line-height: 1.4;
  margin-top: auto;
}
.demo-em-warn { font-style: normal; color: #b45309; font-weight: 600; }
.demo-em-ok   { font-style: normal; color: var(--ours); font-weight: 600; }
.demo-em-same { font-style: normal; color: var(--accent); font-weight: 600; }

/* Pill variants */
.demo-pill {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  min-width: 22px;
  text-align: center;
}
.demo-pill-gray { background: #f1f5f9; color: #64748b; }
.demo-pill-lock, .demo-pill-guide {
  background: #ecfdf5;
  color: var(--ours);
}

.demo-status {
  margin-left: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.demo-status[data-state="running"] { color: var(--accent); }
.demo-status[data-state="done"]    { color: var(--ours); }
.demo-card[data-stage="baseline"] .demo-status[data-state="done"] { color: #64748b; }

/* Card-surprise (③): subtle highlight on the counter-intuitive reveal */
.demo-card-surprise.is-active {
  border-color: #a7f3d0;
  box-shadow: 0 0 0 3px rgba(5,150,105,0.12), var(--shadow);
}

/* Horizontal arrows between cards */
.demo-arrow-h {
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #cbd5e1;
  font-size: 22px;
  line-height: 1;
  font-weight: 300;
  min-width: 60px;
  padding: 0 4px;
  transition: color 0.4s ease;
}
.demo-arrow-h em {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-style: normal;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  line-height: 1.3;
  letter-spacing: 0.02em;
}
.demo-arrow-h em sub { font-size: 7.5px; }

.demo-arrow-same em { color: var(--accent); }

.demo-arrow-inject { color: var(--ours); }
.demo-arrow-inject em { color: var(--ours); }
.demo-arrow-inject.is-flowing span {
  animation: demoArrowPulse 0.9s ease-in-out infinite;
}
@keyframes demoArrowPulse {
  0%, 100% { opacity: 0.5; transform: translateX(0); }
  50%      { opacity: 1;   transform: translateX(3px); }
}

/* Video cards */
.demo-video-card {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: #0f172a;
  aspect-ratio: 16/9;
  box-shadow: var(--shadow-sm);
  width: 100%;
}
.demo-video-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.demo-video-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #e2e8f0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.demo-video-overlay.is-hidden { opacity: 0; }
.demo-overlay-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.04em;
  text-align: center;
  padding: 0 6px;
}
.demo-spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255,255,255,0.18);
  border-top-color: #60a5fa;
  border-radius: 50%;
  animation: demoSpin 0.8s linear infinite;
}
@keyframes demoSpin { to { transform: rotate(360deg); } }

.demo-video-label {
  position: absolute;
  top: 5px;
  left: 5px;
  padding: 2px 6px;
  background: rgba(15, 23, 42, 0.7);
  color: white;
  border-radius: 4px;
  font-size: 9.5px;
  font-weight: 600;
  backdrop-filter: blur(6px);
}
.demo-video-label code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  background: none;
  padding: 0;
}
.demo-label-base { background: rgba(17, 24, 39, 0.78); }
.demo-label-ours { background: rgba(5, 150, 105, 0.88); }

/* Δphys chip (inside card ③) */
.demo-delta-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 3px 10px;
  margin: 4px auto 0;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 999px;
  font-size: 10.5px;
  color: var(--ours);
  opacity: 0;
  transform: scale(0.88);
  transition: opacity 0.4s ease, transform 0.4s ease;
  white-space: nowrap;
}
.demo-delta-inline.is-ready {
  opacity: 1;
  transform: scale(1);
  animation: demoDeltaPulse 2.2s ease-in-out infinite;
}
@keyframes demoDeltaPulse {
  0%, 100% { box-shadow: 0 0 0 rgba(5,150,105,0); }
  50%      { box-shadow: 0 0 14px rgba(5,150,105,0.35); }
}
.demo-delta-icon {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
}
.demo-delta-icon sub { font-size: 8px; }
.demo-delta-text { font-weight: 500; }

/* Comparison hint that appears after all stages done */
.demo-compare-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 14px 0 0;
  padding: 10px 16px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px dashed var(--border);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  font-size: 12px;
}
.demo-compare-hint.is-ready {
  opacity: 1;
  transform: translateY(0);
}
.demo-compare-marker {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 12px;
}
.demo-compare-left  { background: #f1f5f9; color: #64748b; border: 1.5px solid #cbd5e1; }
.demo-compare-right { background: #ecfdf5; color: var(--ours); border: 1.5px solid #a7f3d0; }
.demo-compare-text {
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.02em;
}
.demo-compare-sub {
  color: var(--muted);
  font-size: 11.5px;
  font-style: italic;
}

/* Caption + replay below pipeline */
.demo-caption {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
  padding: 12px 16px;
  background: #f8fafc;
  border-radius: 10px;
}
.demo-caption p {
  margin: 0;
  font-size: 12.5px;
  color: #4b5563;
  line-height: 1.6;
  flex: 1;
}
.demo-caption strong { color: var(--text); font-weight: 600; }
.demo-caption em { font-style: normal; color: var(--accent); font-weight: 500; }
.demo-caption sub { font-size: 9.5px; }
.demo-reset {
  font-size: 11.5px;
  padding: 6px 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Responsive — stack vertically on narrow screens */
@media (max-width: 1000px) {
  .demo {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .demo-arrow-h {
    transform: rotate(90deg);
    min-width: unset;
    padding: 4px 0;
  }
  .demo-arrow-h em { transform: rotate(-90deg); white-space: nowrap; }
}
@media (max-width: 600px) {
  .demo-prompt-text { font-size: 12px; }
  .demo-caption { flex-direction: column; align-items: flex-start; }
  .demo-compare-hint { flex-direction: column; gap: 6px; }
}

/* ───── Tabs ───── */
.tabs {
  display: flex;
  gap: 6px;
  margin: 0 0 24px;
  border-bottom: 1px solid var(--border);
}
.tab {
  padding: 10px 18px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: -1px;
  font-family: inherit;
}
.tab:hover { color: var(--text); }
.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ───── Gallery grid ───── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 18px;
}
.pair-card {
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}
.pair-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.pair-videos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #000;
}
.pair-video-wrap {
  position: relative;
  aspect-ratio: 16/9;
}
.pair-video-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pair-video-wrap .label {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 10.5px;
  padding: 2px 7px;
}
.pair-meta {
  padding: 11px 14px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
}
.pair-meta .pair-id {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  padding: 2px 7px;
  background: var(--code-bg);
  border-radius: 4px;
  margin-right: 6px;
  color: var(--text);
  font-weight: 500;
}

.gallery-footer {
  text-align: center;
  margin-top: 28px;
}

/* ───── BibTeX ───── */
.bibtex {
  background: #0f172a;
  color: #e2e8f0;
  padding: 18px 22px;
  border-radius: var(--radius);
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  line-height: 1.65;
  margin: 0 0 14px;
}
.bibtex code { color: inherit; }

/* ───── Footer ───── */
.footer {
  padding: 36px 0 48px;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  border-top: 1px solid var(--border);
}

/* ───── Responsive ───── */
@media (max-width: 900px) {
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .key-numbers { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; gap: 8px; }
}
@media (max-width: 700px) {
  body { font-size: 14.5px; }
  .hero { padding: 56px 0 40px; }
  .teaser { padding: 40px 0; }
  .teaser-grid { grid-template-columns: 1fr; }
  .pair-videos { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr; }
  .section { padding: 48px 0; }
  .stat-num { font-size: 20px; }
  .kn-value { font-size: 19px; }
}
