/* ========================================================
   Uni-ViGU Project Page — Academic Stylesheet
   ======================================================== */

/* --- CSS Custom Properties --- */
:root {
  /* Colors */
  --c-bg:          #ffffff;
  --c-bg-alt:      #f7f8fa;
  --c-bg-dark:     #0f1724;
  --c-text:        #1a1a2e;
  --c-text-light:  #5a5f7a;
  --c-text-muted:  #9ca3af;
  --c-primary:     #2563eb;
  --c-primary-dark:#1d4ed8;
  --c-accent:      #7c3aed;
  --c-accent-light:#a78bfa;
  --c-video:       #059669;
  --c-video-light: #34d399;
  --c-text-gen:    #d97706;
  --c-text-gen-light:#fbbf24;
  --c-border:      #e5e7eb;
  --c-border-light:#f0f1f3;
  --c-card:        #ffffff;
  --c-card-shadow: rgba(0,0,0,0.06);

  /* Typography */
  --font-body:  'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:  'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing */
  --section-py:  5rem;
  --container-w: 1100px;

  /* Transitions */
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  color: var(--c-text);
  background: var(--c-bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img, video, object { max-width: 100%; display: block; }
a { color: var(--c-primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--c-primary-dark); }

.container {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* --- Navbar --- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--c-border-light);
  transition: box-shadow var(--transition);
}
.navbar.scrolled { box-shadow: 0 2px 20px rgba(0,0,0,0.06); }

.nav-container {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.nav-logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--c-text);
  letter-spacing: -0.02em;
}
.nav-logo:hover { color: var(--c-primary); }

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.75rem;
}
.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--c-text-light);
  transition: color var(--transition);
}
.nav-links a:hover { color: var(--c-primary); }

/* --- Hero --- */
.hero {
  padding: 8rem 0 3rem;
  text-align: center;
  background: linear-gradient(180deg, #f0f4ff 0%, var(--c-bg) 100%);
}

.paper-title {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.03em;
  max-width: 900px;
  margin: 0 auto 1.75rem;
  color: var(--c-text);
}

.title-highlight {
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.authors {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 1rem;
  margin-bottom: 0.75rem;
}
.author {
  font-size: 1rem;
  font-weight: 500;
  white-space: nowrap;
}

.affiliations {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.15rem 1.25rem;
  margin-bottom: 0.5rem;
}
.affiliation {
  font-size: 0.875rem;
  color: var(--c-text-light);
}

.footnotes {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  font-size: 0.8rem;
  color: var(--c-text-muted);
  margin-bottom: 2rem;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1.5px solid transparent;
  transition: all var(--transition);
  cursor: pointer;
}
.btn-primary {
  background: var(--c-primary);
  color: #fff;
  border-color: var(--c-primary);
}
.btn-primary:hover { background: var(--c-primary-dark); color: #fff; }
.btn-secondary {
  background: var(--c-bg);
  color: var(--c-text);
  border-color: var(--c-border);
}
.btn-secondary:hover { border-color: var(--c-primary); color: var(--c-primary); }
.btn-accent {
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
  color: #fff;
}
.btn-accent:hover { opacity: 0.9; color: #fff; }

/* --- Teaser --- */
.teaser { padding: 2rem 0 1rem; }

.teaser-card {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--c-border);
  background: var(--c-bg);
  box-shadow: 0 4px 24px var(--c-card-shadow);
}

.teaser-placeholder {
  padding: 3rem 2rem;
  background: linear-gradient(135deg, #f0f4ff, #faf5ff);
}

.teaser-diagram { text-align: center; }

.teaser-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.teaser-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
}
.teaser-prompt { background: #e0e7ff; color: #3730a3; }
.teaser-model  { background: linear-gradient(135deg, var(--c-primary), var(--c-accent)); color: #fff; padding: 1.25rem 2rem; }
.teaser-video  { background: #d1fae5; color: #065f46; }
.teaser-text   { background: #fef3c7; color: #92400e; }

.teaser-node i { font-size: 1.5rem; }
.teaser-arrow { color: var(--c-text-muted); font-size: 1.25rem; }

.teaser-outputs {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.teaser-plus {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--c-text-muted);
}

.teaser-caption {
  font-size: 0.9rem;
  color: var(--c-text-light);
  font-style: italic;
}

/* --- Sections --- */
.section {
  padding: var(--section-py) 0;
}
.section-alt {
  background: var(--c-bg-alt);
}

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.section-subtitle {
  text-align: center;
  color: var(--c-text-light);
  max-width: 700px;
  margin: 0 auto 2.5rem;
  font-size: 1rem;
}

.subsection-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 2.5rem 0 1.25rem;
}

/* --- Abstract --- */
.abstract-content {
  max-width: 800px;
  margin: 1.5rem auto 0;
  font-size: 1.02rem;
  line-height: 1.8;
  color: var(--c-text);
}
.abstract-content p + p { margin-top: 1rem; }

/* --- Method / Pipeline --- */
.pipeline-figure {
  margin: 0 auto 2.5rem;
  text-align: center;
}

.pipeline-img {
  width: 100%;
  border: 1px solid var(--c-border);
  border-radius: 12px;
  background: #fff;
}

.pipeline-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--c-text-muted);
}
.pipeline-link:hover { color: var(--c-primary); }

.method-highlights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.highlight-card {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: 12px;
  padding: 1.75rem;
  text-align: center;
  transition: box-shadow var(--transition), transform var(--transition);
}
.highlight-card:hover {
  box-shadow: 0 8px 32px var(--c-card-shadow);
  transform: translateY(-2px);
}
.highlight-icon {
  width: 48px; height: 48px;
  margin: 0 auto 1rem;
  background: linear-gradient(135deg, #ede9fe, #e0e7ff);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
  color: var(--c-accent);
}
.highlight-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.highlight-card p {
  font-size: 0.9rem;
  color: var(--c-text-light);
  line-height: 1.6;
}

/* ========================================================
   DEMO SECTION — Unified Generation Visualization
   ======================================================== */
.demo-section {
  background: var(--c-bg-dark);
  color: #e2e8f0;
  position: relative;
  overflow: hidden;
  padding: var(--section-py) 0;
}
.demo-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(37,99,235,0.08), transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(124,58,237,0.08), transparent 50%);
  pointer-events: none;
}
.demo-section .section-title { color: #fff; }
.demo-section .section-subtitle { color: #94a3b8; max-width: 720px; }

/* Demo container — wider than standard for landscape video */
.demo-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Demo selector tabs */
.demo-selector {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.demo-tab {
  padding: 0.5rem 1.25rem;
  border-radius: 8px;
  border: 1.5px solid rgba(255,255,255,0.15);
  background: transparent;
  color: #94a3b8;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all var(--transition);
}
.demo-tab:hover { border-color: rgba(255,255,255,0.3); color: #e2e8f0; }
.demo-tab.active {
  background: rgba(255,255,255,0.1);
  border-color: var(--c-primary);
  color: #fff;
}

/* Demo loading and error states */
.loading-demos {
  color: #94a3b8;
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
}
.loading-demos i {
  margin-right: 0.5rem;
}
.no-demos-msg,
.manifest-error {
  color: #f87171;
  font-size: 0.875rem;
  padding: 0.75rem 1rem;
  background: rgba(248, 113, 113, 0.1);
  border-radius: 8px;
  border: 1px solid rgba(248, 113, 113, 0.2);
}
.no-demos-msg code {
  background: rgba(255,255,255,0.1);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.8em;
}

/* Demo viewer card */
.demo-viewer {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 1.75rem;
  position: relative;
}

/* Prompt bar */
.demo-prompt-bar {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  margin-bottom: 1.5rem;
}
.prompt-label {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-accent-light);
  padding-top: 0.2rem;
}
.prompt-text {
  font-size: 0.95rem;
  color: #f1f5f9;
  line-height: 1.55;
}

/* ═══════════════════════════════════════════════════════
   PART 1: Denoising Trajectory Section
   ═══════════════════════════════════════════════════════ */
.traj-section {
  margin-bottom: 0;
}

.traj-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.traj-title-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.traj-icon {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: rgba(124,58,237,0.15);
  color: var(--c-accent-light);
  font-size: 0.9rem;
  flex-shrink: 0;
}

.traj-section h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #e2e8f0;
  margin: 0;
}

.traj-step-badge {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: #94a3b8;
  background: rgba(255,255,255,0.06);
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
}
.traj-step-badge strong {
  color: #e2e8f0;
}

/* --- Step slider controls --- */
.step-controls {
  margin-bottom: 1.25rem;
}

.step-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.ctrl-btn {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid rgba(255,255,255,0.18);
  background: transparent;
  color: #94a3b8;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  transition: all var(--transition);
  flex-shrink: 0;
}
.ctrl-btn-sm {
  width: auto;
  padding: 0 0.55rem;
  font-size: 0.75rem;
}
.ctrl-btn:hover { border-color: var(--c-primary); color: #fff; }
.ctrl-btn.playing {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: #fff;
}

.slider-wrap {
  flex: 1;
  min-width: 150px;
}

.step-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(124,58,237,0.35), rgba(37,99,235,0.35), rgba(5,150,105,0.35));
  outline: none;
  cursor: pointer;
}
.step-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 3px var(--c-primary), 0 2px 6px rgba(0,0,0,0.25);
  cursor: grab;
  transition: box-shadow var(--transition);
}
.step-slider::-webkit-slider-thumb:hover {
  box-shadow: 0 0 0 4px var(--c-accent), 0 2px 10px rgba(0,0,0,0.35);
}
.step-slider::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 3px var(--c-primary), 0 2px 6px rgba(0,0,0,0.25);
  cursor: grab;
  border: none;
}

.step-endpoints {
  display: flex;
  justify-content: space-between;
  padding-left: calc(34px + 34px + 1rem + 0.5rem);
}
.ep {
  font-size: 0.68rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* ═══════════════════════════════════════════════════════
   State Panels — Visual + Text side by side (desktop)
   ═══════════════════════════════════════════════════════ */
.state-panels {
  display: grid;
  grid-template-columns: 1.2fr auto 0.8fr;
  gap: 0.75rem;
  align-items: stretch;
}

.panel {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
}

.panel-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.badge-visual {
  background: rgba(5,150,105,0.18);
  color: var(--c-video-light);
}
.badge-text {
  background: rgba(217,119,6,0.18);
  color: var(--c-text-gen-light);
}

.panel-tag {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: #64748b;
}

/* --- Montage (3 temporal frames) --- */
.panel-visual .montage {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.montage {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: repeat(3, auto);
  gap: 8px;
  width: 100%;
}

.montage-frame {
  text-align: center;
  width: 66.67%;
  margin: 0 auto;
}

.frame-box {
  aspect-ratio: 832 / 480;
  border-radius: 6px;
  overflow: hidden;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.05);
  width: 100%;
}

/* Noise texture overlay */
.frame-noise {
  position: absolute;
  inset: 0;
  opacity: 1;
  transition: opacity 0.3s ease;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.5'/%3E%3C/svg%3E");
  background-size: 100px 100px;
  mix-blend-mode: screen;
  pointer-events: none;
}

.frame-ph {
  color: #475569;
  font-size: 1.25rem;
  z-index: 1;
  position: relative;
}

/* Real frame image (when loaded) */
.frame-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
  z-index: 2;
}

.frame-label {
  display: block;
  margin-top: 0.3rem;
  margin-bottom: 0.5rem;
  font-size: 0.65rem;
  color: #64748b;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.montage-note {
  font-size: 0.7rem;
  color: #475569;
  padding: 0.4rem 0.75rem 0.6rem;
  text-align: center;
  font-style: italic;
}

/* --- Panel connector (Unified badge) --- */
.panel-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0;
  min-width: 50px;
}

.conn-line {
  flex: 1;
  width: 2px;
  min-height: 20px;
  background: linear-gradient(180deg, transparent, rgba(124,58,237,0.35), transparent);
}

.conn-badge {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--c-accent-light);
  background: rgba(124,58,237,0.12);
  border: 1px solid rgba(124,58,237,0.25);
  border-radius: 6px;
  padding: 0.4rem 0.5rem;
  text-align: center;
  line-height: 1.3;
}
.conn-badge i {
  font-size: 0.8rem;
  display: block;
  margin-bottom: 0.15rem;
}

/* --- Text state panel --- */
.panel-text {
  display: flex;
  flex-direction: column;
}

.text-state-box {
  flex: 1;
  padding: 0.9rem 1rem;
  background: rgba(0,0,0,0.25);
  margin: 0.75rem;
  margin-top: 0;
  border-radius: 6px;
  min-height: 100px;
  border: 1px solid rgba(255,255,255,0.04);
  display: flex;
  align-items: flex-start;
}

.text-state {
  font-size: 0.88rem;
  line-height: 1.7;
  color: #e2e8f0;
}

/* Noise characters get a distinct muted style */
.text-state .noise-char {
  color: #475569;
  opacity: 0.6;
  font-family: var(--font-mono);
}

/* ═══════════════════════════════════════════════════════
   Section Separator
   ═══════════════════════════════════════════════════════ */
.section-sep {
  padding: 1.5rem 0;
}
.sep-line {
  height: 1px;
  background: linear-gradient(90deg, transparent 5%, rgba(255,255,255,0.1) 50%, transparent 95%);
}

/* ═══════════════════════════════════════════════════════
   PART 2: Final Generated Video (Result Section)
   ═══════════════════════════════════════════════════════ */
.result-section {
  margin-top: 0;
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.result-icon {
  background: rgba(5,150,105,0.15);
  color: var(--c-video-light);
}

.result-dim {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: #64748b;
  background: rgba(255,255,255,0.05);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
}

.final-video-wrap {
  aspect-ratio: 832 / 480;
  border-radius: 10px;
  overflow: hidden;
  background: #0a0a0a;
  position: relative;
  border: 1px solid rgba(255,255,255,0.08);
}

.final-video-ph {
  width: 100%; height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: #475569;
  background: linear-gradient(135deg, #0f172a, #1e293b);
}
.final-video-ph i { font-size: 2.5rem; opacity: 0.5; }
.final-video-ph p { font-size: 0.85rem; margin: 0; }
.final-video-ph small { font-size: 0.7rem; color: #334155; }

.final-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #000;
}

/* --- Demo explanation --- */
.demo-explanation {
  margin-top: 1.5rem;
}

.explanation-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: rgba(37,99,235,0.08);
  border: 1px solid rgba(37,99,235,0.2);
  border-radius: 10px;
  font-size: 0.875rem;
  color: #94a3b8;
  line-height: 1.6;
}
.explanation-card i { color: var(--c-primary); font-size: 1.1rem; margin-top: 0.15rem; flex-shrink: 0; }
.explanation-card strong { color: #cbd5e1; }
.explanation-card em { color: var(--c-accent-light); font-style: normal; font-family: var(--font-mono); font-size: 0.85em; }

/* --- Demo responsive --- */
@media (max-width: 900px) {
  /* Stack state panels vertically on tablet/mobile */
  .state-panels {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  .panel-connector {
    flex-direction: row;
    padding: 0.4rem 0;
    min-width: auto;
  }
  .conn-line {
    flex: 1;
    height: 2px;
    width: auto;
    min-height: auto;
    background: linear-gradient(90deg, transparent, rgba(124,58,237,0.35), transparent);
  }
}

@media (max-width: 768px) {
  .demo-container { padding: 0 1rem; }
  .demo-viewer { padding: 1rem; }
  .demo-prompt-bar { flex-direction: column; gap: 0.35rem; }
  .step-row { flex-wrap: wrap; }
  .slider-wrap { width: 100%; order: 3; }
  .step-endpoints { padding-left: 0; }
  .traj-header { flex-direction: column; align-items: flex-start; }
  .montage { gap: 6px; }
  .frame-ph { font-size: 1rem; }
  .text-state-box { margin: 0.5rem; min-height: 80px; }
  .explanation-card { flex-direction: column; gap: 0.5rem; }
}

@media (max-width: 480px) {
  /* Already using single-column montage */
  .montage-frame { width: 100%; max-width: 100%; }
  .frame-box { max-width: 100%; }
}

/* ========================================================
   RESULTS SECTION
   ======================================================== */
.results-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.result-card {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--c-border);
  background: var(--c-card);
  transition: box-shadow var(--transition), transform var(--transition);
}
.result-card:hover {
  box-shadow: 0 8px 32px var(--c-card-shadow);
  transform: translateY(-2px);
}

.result-video-placeholder {
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #e0e7ff, #ede9fe);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--c-accent);
  font-size: 0.9rem;
  font-weight: 600;
}
.result-video-placeholder i { font-size: 2rem; opacity: 0.6; }

.result-caption { padding: 1.25rem; }
.result-prompt {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--c-text);
  margin-bottom: 0.5rem;
  font-style: italic;
}
.result-description {
  font-size: 0.85rem;
  color: var(--c-text-light);
  line-height: 1.5;
}

/* Results table */
.table-container {
  overflow-x: auto;
  margin-top: 1rem;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.results-table th, .results-table td {
  padding: 0.75rem 1rem;
  text-align: center;
  border-bottom: 1px solid var(--c-border);
}
.results-table th {
  background: var(--c-bg);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--c-text-light);
}
.results-table td:first-child,
.results-table th:first-child { text-align: left; }

.highlight-row {
  background: rgba(37,99,235,0.04);
}
.highlight-row td { font-weight: 500; }

.text-muted { color: var(--c-text-muted); }
.text-accent { color: var(--c-video); }

.table-note {
  font-size: 0.8rem;
  color: var(--c-text-muted);
  margin-top: 0.75rem;
  font-style: italic;
}

/* ========================================================
   CITATION
   ======================================================== */
.citation-block {
  position: relative;
  background: var(--c-bg-alt);
  border: 1px solid var(--c-border);
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 750px;
  margin: 1.5rem auto 0;
}

.citation-block pre {
  overflow-x: auto;
  margin: 0;
}

.citation-block code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--c-text);
}

.copy-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-body);
  color: var(--c-text-light);
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.copy-btn:hover { border-color: var(--c-primary); color: var(--c-primary); }
.copy-btn.copied { color: var(--c-video); border-color: var(--c-video); }

/* ========================================================
   ACKNOWLEDGEMENTS & FOOTER
   ======================================================== */
.ack-text {
  max-width: 700px;
  margin: 1rem auto 0;
  text-align: center;
  color: var(--c-text-light);
  font-size: 0.95rem;
  line-height: 1.7;
}

.footer {
  padding: 2rem 0;
  text-align: center;
  border-top: 1px solid var(--c-border);
  font-size: 0.8rem;
  color: var(--c-text-muted);
}

.footer-links {
  margin-top: 0.4rem;
}
.footer-links a {
  color: var(--c-text-muted);
  transition: color var(--transition);
}
.footer-links a:hover { color: var(--c-primary); }

/* ========================================================
   RESPONSIVE
   ======================================================== */
@media (max-width: 768px) {
  :root { --section-py: 3rem; }

  .nav-links { display: none; }

  .paper-title { font-size: 1.5rem; }

  .authors { gap: 0.15rem 0.6rem; }
  .author { font-size: 0.9rem; }

  .affiliations { flex-direction: column; align-items: center; gap: 0.15rem; }

  .hero-links { flex-direction: column; align-items: center; }

  .teaser-flow { flex-direction: column; }
  .teaser-arrow { transform: rotate(90deg); }
  .teaser-outputs { flex-direction: column; }

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

/* --- Animations --- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.section-title {
  animation: fadeInUp 0.6s ease-out;
}
