/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #ffffff;
  --bg-alt:       #f7f7f8;
  --text:         #1a1a2e;
  --text-muted:   #6b7280;
  --accent:       #ea580c;   /* orange — overall method theme */
  --accent-dark:  #c2410c;
  --visual:       #2563eb;   /* blue — visual modality */
  --tactile:      #16a34a;   /* green — tactile modality */
  --border:       #e5e7eb;
  --radius:       10px;
  --font:         'Inter', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', monospace;
  --max-w:        1100px;
  --wide-w:       1300px;
  --narrow-w:     740px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  font-size: 1rem;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--font-mono); font-size: 0.85em; background: #f0f2f5; padding: 0.1em 0.35em; border-radius: 4px; }

/* ── Layout ── */
.container        { max-width: var(--max-w);    margin: 0 auto; padding: 0 1.5rem; }
.container-wide   { max-width: var(--wide-w);   margin: 0 auto; padding: 0 1.5rem; }
.container-narrow { max-width: var(--narrow-w); margin: 0 auto; padding: 0 1.5rem; }

.section     { padding: 5rem 0; }
.section-alt { background: var(--bg-alt); padding: 5rem 0; }

/* ── Site header ── */
.site-header {
  display: flex;
  justify-content: center;
  padding: 1.25rem 1.5rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.venue-badge {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
}

/* ── Hero ── */
.hero {
  padding: 4.5rem 1.5rem 3.5rem;
  text-align: center;
  background: var(--bg);
}

.paper-title {
  font-size: clamp(1.8rem, 4vw, 2.9rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 1.75rem;
}
.paper-title .accent { color: var(--accent); }

.authors {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.15rem 1.25rem;
  font-size: 1.05rem;
  margin-bottom: 0.6rem;
}
.author a { color: var(--text); font-weight: 500; }
.author a:hover { color: var(--accent); text-decoration: none; }
.author sup { font-size: 0.7em; color: var(--text-muted); }
.author.anon { color: var(--text-muted); font-style: italic; font-weight: 400; }

.affiliations {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 1.5rem;
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}
.affiliations sup { font-size: 0.75em; }

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1.2rem;
  background: var(--accent);
  color: #fff;
  font-weight: 500;
  font-size: 0.95rem;
  border-radius: var(--radius);
  transition: background 0.15s;
  border: 2px solid var(--accent);
}
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); text-decoration: none; }
.btn-outline { background: transparent; color: var(--accent); }
.btn-outline:hover { background: var(--accent); color: #fff; }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-soon {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1.2rem;
  background: #9ca3af;
  color: #fff;
  font-weight: 500;
  font-size: 0.95rem;
  border-radius: var(--radius);
  border: 2px solid #9ca3af;
  cursor: default;
  user-select: none;
}
.btn-soon svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.85; }
.btn-soon-tag {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: rgba(255,255,255,0.25);
  border-radius: 4px;
  padding: 0.1em 0.45em;
  text-transform: uppercase;
}

/* ── Section headings ── */
h2 {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  text-align: center;
}
h3 { font-size: 1.15rem; font-weight: 600; }

.section-subtitle {
  text-align: center;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 2.5rem;
}
.subsection-title { margin: 3rem 0 1.25rem; text-align: center; }

/* ── Abstract ── */
#abstract h2 { margin-bottom: 1.25rem; }
#abstract p  { font-size: 1.05rem; color: #374151; }

/* ── Teaser video ── */
#teaser { padding: 2rem 0 3rem; }

.teaser-video-wrap {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
  aspect-ratio: 16 / 9;
  max-width: 820px;
  margin: 0 auto;
}
.teaser-video-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.video-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: var(--text-muted);
  background: #f0f2f5;
  font-size: 0.9rem;
  text-align: center;
  padding: 1.5rem;
  pointer-events: none;
}
.video-placeholder svg { width: 40px; height: 40px; opacity: 0.35; }
.video-caption { font-size: 0.9rem; color: var(--text-muted); margin-top: 0.9rem; }
.video-caption.center { text-align: center; }

/* ── Method / front figure ── */
.front-figure { margin: 0; }
.front-figure img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: block;
}
.front-figure figcaption {
  margin-top: 0.9rem;
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* Widen method subtitle to match the wide figure */
#method .section-subtitle { max-width: 900px; }

/* ── Contributions ── */
.contrib-title {
  text-align: center;
  margin: 3rem 0 1.75rem;
  color: var(--accent);
}
.contrib-list {
  list-style: none;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.contrib-list li {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.9rem;
  background: #fff4ed;
  border: 1px solid #fdba74;
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.5rem 1.4rem;
  line-height: 1.65;
  color: #374151;
}
.contrib-list li strong { color: var(--accent); }
.contrib-num {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 768px) {
  .contrib-list { grid-template-columns: 1fr; }
}

/* ── Task tabs ── */
.task-tabs {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
}
.tab-btn {
  padding: 0.45rem 1.3rem;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font);
}
.tab-btn:hover  { border-color: var(--accent); color: var(--accent); }
.tab-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── 20-Trial grid ── */
.trial-panel { display: none; }
.trial-panel.active { display: block; }

.trial-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
}
/* Dual-video grids: 4 columns so each cell (and each camera view) is larger */
.trial-grid-dual {
  grid-template-columns: repeat(4, 1fr);
}

.trial-cell {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.trial-cell:hover {
  transform: scale(1.04);
  box-shadow: 0 6px 20px rgba(0,0,0,0.18);
  z-index: 2;
}
.trial-cell video {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}
.trial-label {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(rgba(0,0,0,0.60), transparent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.4rem 0.6rem;
  text-align: center;
  z-index: 2;
}

/* ── Dual-camera trial cells ── */
.trial-dual-videos {
  display: flex;
  width: 100%;
  gap: 1px;
  background: #111;
}
.trial-dual-videos video {
  width: 50%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

/* ── Trial group headers (blue/yellow cup instruction labels) ── */
.trial-group-header {
  margin: 1.25rem 0 0.5rem;
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.trial-group-header:first-child { margin-top: 0; }
.trial-group-header.blue-cup  { background: #eff6ff; color: #1d4ed8; border-left: 3px solid var(--visual); }
.trial-group-header.yellow-cup { background: #fefce8; color: #854d0e; border-left: 3px solid #ca8a04; }
.trial-group-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.blue-cup  .trial-group-dot { background: var(--visual); }
.yellow-cup .trial-group-dot { background: #ca8a04; }

/* ── Trial success / fail borders ── */
.trial-cell.trial-success { border: 3px solid #22c55e; }
.trial-cell.trial-fail    { border: 3px solid #ef4444; }

/* ── Trial lightbox ── */
#trial-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
  align-items: center;
  justify-content: center;
}
#trial-lightbox.active { display: flex; }

.lb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(4px);
}
.lb-inner {
  position: relative;
  z-index: 1;
  background: #111;
  border-radius: 14px;
  overflow: hidden;
  width: min(92vw, 960px);
  box-shadow: 0 24px 80px rgba(0,0,0,0.7);
  animation: lb-pop 0.18s ease;
}
@keyframes lb-pop {
  from { transform: scale(0.92); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}
.lb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.9rem;
  background: #1a1a1a;
  border-bottom: 1px solid #333;
}
.lb-title {
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.lb-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.lb-badge.success   { background: #166534; color: #86efac; }
.lb-badge.fail      { background: #7f1d1d; color: #fca5a5; }
.lb-badge.lb-blue   { background: #1e3a8a; color: #bfdbfe; }
.lb-badge.lb-yellow { background: #713f12; color: #fef08a; }
.lb-badge.lb-orange { background: #7c2d12; color: #fed7aa; }
.lb-badge.lb-black  { background: #1e293b; color: #cbd5e1; }
.lb-close {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}
.lb-close:hover { background: rgba(255,255,255,0.25); }
.lb-videos {
  display: flex;
  gap: 2px;
  background: #000;
}
.lb-videos video {
  width: 50%;
  aspect-ratio: 4 / 3;
  display: block;
}

/* ── Reward Visualizer ── */
.rv-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}
.rv-select-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
}
.rv-select-group select {
  padding: 0.35rem 0.75rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  font-family: var(--font);
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
}
.rv-select-group select:focus { outline: none; border-color: var(--accent); }
.rv-step-chip {
  font-size: 0.88rem;
  color: var(--text-muted);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.3rem 0.7rem;
  font-variant-numeric: tabular-nums;
}
.rv-step-chip strong { color: var(--text); }

.rv-widget {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ── 4-panel observation grid ── */
.rv-obs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.rv-obs-group {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.rv-group-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--border);
  color: var(--text);
}
.rv-group-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.visual-bar  { border-color: var(--visual); }
.visual-dot  { background: var(--visual); }
.tactile-bar { border-color: var(--tactile); }
.tactile-dot { background: var(--tactile); }

.rv-obs-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.rv-obs-pane { display: flex; flex-direction: column; gap: 0.35rem; }
.rv-obs-sublabel {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
}

/* shared image wrap */
.rv-img-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border);
}
.rv-img-wrap img,
.rv-img-wrap video {
  width: 100%; height: 100%;
  object-fit: cover;
  display: none;
}
.rv-img-ph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e8eaed;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-align: center;
  padding: 0.4rem;
}

/* ── Two reward plots ── */
.rv-plots-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.rv-plot-pane { display: flex; flex-direction: column; gap: 0.5rem; }

.rv-plot-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  text-align: center;
}
.visual-title  { color: var(--visual); }
.tactile-title { color: var(--tactile); }

.rv-plot-wrap {
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
  cursor: crosshair;
}
.rv-plot-wrap canvas { width: 100%; display: block; }

/* ── Per-plot legends ── */
.rv-legend {
  display: flex;
  gap: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  font-size: 0.8rem;
}
.rv-legend-col {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.65rem 0.85rem;
  flex: 0 0 auto;
}
.rv-legend-col:first-child {
  background: #f9fafb;
  border-right: 1px solid var(--border);
  min-width: 120px;
}
.rv-legend-col:last-child { flex: 1; }
.rv-legend-heading {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}
.rv-legend-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text);
  white-space: nowrap;
}
.rv-legend-swatch {
  display: inline-block;
  width: 12px; height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* ── Failure Modes — real video grid ── */
.fm-baseline-group {
  margin-bottom: 2.5rem;
}
.fm-baseline-header {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.45rem;
  margin-bottom: 1rem;
}
.fm-real-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.1rem;
}
.fm-real-card {
  width: min(100%, 400px);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  cursor: pointer;
}
.fm-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}
.fm-reason {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.fm-instruction {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.blue-instr  { background: #dbeafe; color: #1d4ed8; }
.yellow-instr { background: #fef9c3; color: #854d0e; }
.orange-instr { background: #ffedd5; color: #9a3412; }
.black-instr  { background: #f1f5f9; color: #1e293b; }

/* ── Failure Modes — legacy dropdown (kept for reference) ── */
.fm-controls {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.fm-select-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-muted);
}
.fm-select-group select {
  padding: 0.45rem 1rem 0.45rem 0.75rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  font-family: var(--font);
  font-size: 0.92rem;
  color: var(--text);
  cursor: pointer;
  min-width: 180px;
}
.fm-select-group select:focus { outline: none; border-color: var(--accent); }

.fm-content {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
}
.fm-description {
  font-size: 0.95rem;
  color: #374151;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.fm-description strong { color: var(--text); }

.fm-video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.fm-video-cell {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
}
.fm-video-cell video {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}
.fm-video-label {
  font-size: 0.8rem;
  text-align: center;
  color: var(--text-muted);
  padding: 0.3rem 0.5rem 0.45rem;
  background: var(--bg);
}
.fm-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 180px;
  color: var(--text-muted);
  font-size: 0.88rem;
  background: #f9fafb;
  border-radius: 8px;
  border: 2px dashed var(--border);
  text-align: center;
  padding: 1.5rem;
}

/* ── World Model Imagination ── */
.wm-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
}

.wm-card {
  width: min(100%, 880px);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.wm-card-title {
  padding: 0.55rem 0.8rem;
  background: #f9fafb;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
}

.wm-header-row {
  display: flex;
  padding: 0.4rem 0.5rem 0;
}

.wm-row-gutter {
  width: 2.4rem;
  flex-shrink: 0;
}

.wm-col-headers {
  flex: 1;
  display: flex;
}

.wm-col-label {
  flex: 1;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.wm-body-row {
  display: flex;
  align-items: stretch;
  padding: 0 0.5rem 0.5rem;
}

.wm-row-labels {
  width: 2.4rem;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
}

.wm-row-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.wm-video-wrap {
  flex: 1;
  border-radius: 6px;
  overflow: hidden;
  background: #000;
}

.wm-video-wrap video {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  object-fit: cover;
}

/* Fullscreen styling for World Model cards */
.wm-card:fullscreen,
.wm-card:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  background: #000;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  border-radius: 0;
  border: none;
}
.wm-card:fullscreen .wm-card-title,
.wm-card:-webkit-full-screen .wm-card-title {
  background: transparent;
  border-bottom: 1px solid #333;
  color: #fff;
  font-size: 1.1rem;
  padding: 0.6rem 0.8rem 0.8rem;
}
.wm-card:fullscreen .wm-col-label,
.wm-card:-webkit-full-screen .wm-col-label,
.wm-card:fullscreen .wm-row-label,
.wm-card:-webkit-full-screen .wm-row-label {
  color: #cbd5e1;
}
.wm-card:fullscreen .wm-body-row,
.wm-card:-webkit-full-screen .wm-body-row {
  flex: 1;
  min-height: 0;
}
.wm-card:fullscreen .wm-video-wrap,
.wm-card:-webkit-full-screen .wm-video-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}
.wm-card:fullscreen .wm-video-wrap video,
.wm-card:-webkit-full-screen .wm-video-wrap video {
  width: auto;
  height: 100%;
  max-width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
}

/* ── Scrubber ── */
.rv-scrubber-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.rv-scrubber-edge {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  min-width: 4ch;
}
#rv-scrubber {
  flex: 1;
  -webkit-appearance: none;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  outline: none;
  cursor: pointer;
}
#rv-scrubber::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
  cursor: grab;
}
#rv-scrubber::-webkit-slider-thumb:active { cursor: grabbing; }
#rv-scrubber::-moz-range-thumb {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid #fff;
  cursor: grab;
}

.rv-data-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.25rem;
}

/* ── Results / figures ── */
.results-figure { margin-bottom: 2.5rem; }
.results-figure img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  mix-blend-mode: multiply;
}
.results-figure figcaption {
  margin-top: 0.85rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
}

/* ── Interactive results chart ── */
.results-controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.rc-select-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.rc-select-group label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.rc-select-group select {
  font: inherit;
  font-size: 0.9rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
}
.rc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 0.8rem;
}
@media (max-width: 720px) {
  .rc-grid { grid-template-columns: 1fr; }
}
.rc-panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.5rem 0.4rem 0.4rem;
}
.rc-panel-title {
  text-align: center;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  padding-bottom: 0.2rem;
}
.rc-canvas-wrap { width: 100%; }
.rc-canvas-wrap canvas { display: block; }
.rc-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 0.6rem;
  padding: 0.6rem;
  margin-top: 0.4rem;
}
.rc-legend-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f9fafb;
}
.rc-legend-group-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-bottom: 0.2rem;
  border-bottom: 1px solid var(--border);
}
.rc-legend-group-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.9rem;
}
.rc-legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--text);
}
.rc-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid #0002;
  display: inline-block;
}
.rc-caption {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 1rem;
}
.rc-tooltip {
  position: fixed;
  z-index: 1000;
  pointer-events: none;
  background: rgba(17, 24, 39, 0.96);
  color: #f9fafb;
  font-size: 0.78rem;
  line-height: 1.4;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  max-width: 240px;
}
.rc-tt-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.2rem;
}
.rc-tt-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}
.rc-tt-row { font-size: 0.78rem; }
.rc-tt-strong { font-weight: 700; font-size: 0.85rem; margin-top: 0.15rem; }
.rc-tt-muted { color: #cbd5e1; }

.figure-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}
.figure-card figcaption {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  text-align: center;
}

.figure-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #f0f2f5;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 1rem;
}
.figure-placeholder.small { aspect-ratio: 4 / 3; }

/* ── BibTeX ── */
#bibtex h2 { margin-bottom: 1.25rem; }
.bibtex {
  background: #1e1e2e;
  color: #cdd6f4;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.65;
  padding: 1.5rem;
  border-radius: var(--radius);
  overflow-x: auto;
  white-space: pre;
}

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .trial-grid      { grid-template-columns: repeat(4, 1fr); }
  .trial-grid-dual { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  .rv-obs-grid   { grid-template-columns: 1fr; }
  .rv-plots-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .hero { padding: 3rem 1.25rem 2.5rem; }
  .section, .section-alt { padding: 3.5rem 0; }
  .trial-grid      { grid-template-columns: repeat(3, 1fr); }
  .trial-grid-dual { grid-template-columns: repeat(2, 1fr); }
  .figure-grid { grid-template-columns: 1fr; }
}
@media (max-width: 400px) {
  .trial-grid      { grid-template-columns: repeat(2, 1fr); }
  .trial-grid-dual { grid-template-columns: 1fr; }
}
