/* ============================================================
   ExStereo project page
   Accent pulled from the paper's pink→blue "ExStereo" wordmark
   ============================================================ */

:root {
  color-scheme: light;

  --bg: #f5f4ef;
  --bg-soft: #edece4;
  --bg-card: #fbfaf7;
  --ink: #23231f;
  --ink-soft: #55544c;
  --ink-deep: #121210;
  --line: rgba(18, 18, 16, 0.12);
  --muted: 85, 84, 76;

  --accent: #1b86b8;        /* stereo blue */
  --accent-deep: #146790;
  --accent-light: #b9dcec;
  --accent-tint: rgba(27, 134, 184, 0.09);
  --pink: #d8267c;          /* stereo magenta */
  --stripe: 27, 134, 184;

  --bar-base: #c9c7bb;
  --bar-vla: #9a988c;

  --radius: 14px;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-head: "Space Grotesk", var(--font-body);
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

sub { line-height: 0; }

/* ---------------- layout ---------------- */

main { padding: 0 20px; }

.prose, .hero {
  max-width: 720px;
  margin: 0 auto;
}

.wide { max-width: 1000px; margin-left: auto; margin-right: auto; }

section { margin-top: 88px; }

/* ---------------- hero ---------------- */

.hero {
  text-align: center;
  padding: 88px 0 12px;
}

.hero h1 {
  font-family: var(--font-head);
  font-size: clamp(2.6rem, 7vw, 4.2rem);
  line-height: 1.1;
  margin: 0 0 22px;
  color: var(--ink-deep);
  letter-spacing: -0.015em;
}

.wordmark {
  display: block;
  margin-bottom: 10px;
  background: linear-gradient(90deg, var(--pink) 0%, #8b4fc0 45%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  display: block;
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.005em;
  max-width: 640px;
  margin: 0 auto;
}

.authors { font-size: 1rem; color: var(--ink-soft); margin: 0; font-weight: 500; }
.authors-note { font-size: 0.8rem; color: rgba(var(--muted), 0.6); margin: 4px 0 0; }

/* ---------------- typography ---------------- */

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-deep);
  margin: 0 0 6px;
}

h2 {
  font-family: var(--font-head);
  font-size: 1.85rem;
  line-height: 1.2;
  margin: 0 0 18px;
  color: var(--ink-deep);
  letter-spacing: -0.01em;
}

h3 {
  font-family: var(--font-head);
  font-size: 1.2rem;
  margin: 34px 0 10px;
  color: var(--ink-deep);
}

.prose p { margin: 0 0 18px; text-align: justify; text-justify: inter-word; hyphens: auto; }
.prose strong { color: var(--ink-deep); }
.prose a { color: var(--accent-deep); }

.hl { color: var(--accent-deep); font-weight: 600; }

/* ---------------- media ---------------- */

figure.media { margin: 36px auto; }

.media-frame {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-soft);
  border: 1px solid var(--line);
}

.media-frame.white { background: #fff; padding: 18px; }

.media-frame video,
.media-frame img {
  display: block;
  width: 100%;
  height: auto;
}

figcaption {
  margin: 12px auto 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--ink-soft);
  text-align: center;
  max-width: 680px;
}

figcaption b { color: var(--ink-deep); }

/* click-to-load overview video */
.video-launch {
  display: block;
  position: relative;
  width: 100%;
  padding: 0;
  border: 0;
  background: #fff;
  cursor: pointer;
  aspect-ratio: 16 / 9;
}

.video-launch img { width: 100%; height: 100%; object-fit: cover; }

.play-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 76px;
  height: 76px;
  margin: -38px 0 0 -38px;
  border-radius: 50%;
  background: rgba(18, 18, 16, 0.82);
  box-shadow: 0 6px 24px rgba(18, 18, 16, 0.25);
  transition: transform 0.15s ease, background 0.15s ease;
}

.play-icon::after {
  content: "";
  position: absolute;
  left: 31px;
  top: 24px;
  border-style: solid;
  border-width: 14px 0 14px 22px;
  border-color: transparent transparent transparent #fff;
}

.video-launch:hover .play-icon,
.video-launch:focus-visible .play-icon { transform: scale(1.08); background: var(--accent-deep); }

#video .media-frame > video { aspect-ratio: 16 / 9; background: #000; }

/* ---------------- method steps ---------------- */

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 8px 0 0;
}

.step {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 22px 18px;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ink-deep);
  color: #fff;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 10px;
}

.step h3 { margin: 0 0 8px; font-size: 1.08rem; line-height: 1.3; }
.step p { margin: 0; font-size: 0.93rem; line-height: 1.6; color: var(--ink-soft); }

/* callout with figure beside text */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: center;
  margin-top: 56px;
}

.split figure.media { margin: 0; }
.split h3 { margin-top: 0; }
.split p { margin: 0; font-size: 0.97rem; color: var(--ink-soft); }

/* ---------------- stat tiles ---------------- */

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 28px 0 8px;
}

.stat {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

.stat-value {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 2rem;
  line-height: 1.15;
  color: var(--ink-deep);
  margin: 6px 0 2px;
}

.stat-value .up { color: var(--accent-deep); }
.stat-detail { font-size: 0.85rem; color: var(--ink-soft); }

/* ---------------- results chart ---------------- */

.chart-card {
  margin: 28px auto;
  padding: 24px 28px 20px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 20px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 22px;
  justify-content: center;
}

.tab {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.15s ease;
}

.tab:hover { border-color: var(--accent); color: var(--accent-deep); }

.tab.active {
  background: var(--ink-deep);
  border-color: var(--ink-deep);
  color: #fff;
}

.bar-group + .bar-group {
  border-top: 1px dashed var(--line);
  margin-top: 10px;
  padding-top: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: 190px 1fr 48px;
  align-items: center;
  gap: 12px;
  margin: 5px 0;
  font-size: 0.88rem;
}

.bar-label { color: var(--ink-soft); text-align: right; white-space: nowrap; }

.bar-track {
  background: rgba(18, 18, 16, 0.06);
  border-radius: 999px;
  height: 16px;
  overflow: hidden;
}

.bar {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: var(--bar-base);
  transition: width 0.6s cubic-bezier(0.3, 0.7, 0.2, 1);
}

.bar.vla   { background: var(--bar-vla); }
.bar.nomt  { background: var(--accent-light); }
.bar.ours  { background: linear-gradient(90deg, var(--accent) 0%, #4aa6d2 100%); }

.bar-row.ours .bar-label,
.bar-row.ours .bar-val { font-weight: 700; color: var(--ink-deep); }

.bar-val { font-family: var(--font-mono); font-size: 0.8rem; }

.chart-card figcaption { margin-top: 16px; }

/* ---------------- sub-sections ---------------- */

.sub-head { margin: 56px 0 4px; font-size: 1.3rem; }
.sub-note { margin: 0 0 18px; font-size: 0.93rem; color: var(--ink-soft); }

/* ---------------- sim rollout clips ---------------- */

.clip-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.clip { margin: 0; }

.clip .media-frame { aspect-ratio: 4 / 3; background: var(--bg-soft); }

.clip video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.clip figcaption { margin-top: 6px; font-family: var(--font-mono); font-size: 0.72rem; }

.more-row { text-align: center; margin-top: 20px; }

.more-btn {
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 9px 20px;
  border-radius: 999px;
  border: 0;
  background: var(--ink-deep);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.more-btn:hover { background: var(--accent-deep); transform: translateY(-1px); }
.more-btn[hidden] { display: none; }

/* ---------------- rollout placeholders ---------------- */

.task-block + .task-block { margin-top: 40px; }

.task-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-bottom: 12px;
}

.task-head h3 { margin: 0; }
.task-head p { margin: 2px 0 0; font-size: 0.92rem; color: var(--ink-soft); }

.rollout-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.rollout-grid figure { margin: 0; }
.rollout-grid figcaption { margin-top: 6px; font-family: var(--font-mono); font-size: 0.72rem; }

.slot { aspect-ratio: 16 / 9; }

.slot video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* dashed slot shown until the video file exists */
.media-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  padding: 16px;
  font-size: 0.85rem;
  color: var(--ink-soft);
  background:
    linear-gradient(rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.55)),
    repeating-linear-gradient(-45deg, transparent 0 12px, rgba(var(--stripe), 0.1) 12px 24px);
  border: 2px dashed var(--accent-light);
  border-radius: var(--radius);
}

.media-placeholder code {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--accent-deep);
  word-break: break-all;
}

.media-frame.loaded .media-placeholder { display: none; }

/* ---------------- bibtex ---------------- */

.bib {
  position: relative;
  background: var(--ink-deep);
  color: #e9ecef;
  border-radius: var(--radius);
  padding: 20px 24px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.7;
  overflow-x: auto;
  margin: 0;
}

.copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease;
}

.copy-btn:hover { background: rgba(255, 255, 255, 0.18); }

/* ---------------- footer ---------------- */

.site-footer {
  margin-top: 96px;
  padding: 28px;
  text-align: center;
  font-size: 0.82rem;
  color: rgba(var(--muted), 0.6);
}

/* ---------------- responsive ---------------- */

@media (max-width: 820px) {
  .steps, .stats { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; gap: 20px; }
  .rollout-grid, .clip-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  main { padding: 0 16px; }
  .hero { padding-top: 56px; }
  section { margin-top: 64px; }
  .prose p { text-align: left; }
  .chart-card { padding: 18px 14px 16px; }
  .bar-row { grid-template-columns: 118px 1fr 40px; gap: 8px; font-size: 0.78rem; }
  .bar-label { white-space: normal; line-height: 1.25; }
  .rollout-grid { grid-template-columns: 1fr; }
  .clip-grid { gap: 8px; }
  .play-icon { width: 60px; height: 60px; margin: -30px 0 0 -30px; }
  .play-icon::after { left: 24px; top: 18px; border-width: 12px 0 12px 18px; }
  .media-frame.white { padding: 8px; }
}

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