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

/* --- CSS Custom Properties --- */
:root {
  /* Colors */
  --c-bg:          #f6faff;
  --c-bg-alt:      #f5f8fc;
  --c-bg-dark:     #0f1724;
  --c-text:        #0f172a;
  --c-text-light:  #334155;
  --c-text-muted:  #64748b;
  --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(15, 23, 42, 0.08);
  --c-card-shadow-soft: rgba(15, 23, 42, 0.05);
  --c-page-blue: rgba(59, 130, 246, 0.1);
  --c-page-mint: rgba(16, 185, 129, 0.08);

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

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

  /* 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: 18px;
}

body {
  font-family: var(--font-body);
  color: var(--c-text);
  background:
    radial-gradient(1400px 640px at -8% 16%, rgba(96, 165, 250, 0.18), transparent 66%),
    radial-gradient(1380px 620px at 108% 84%, rgba(52, 211, 153, 0.18), transparent 66%),
    linear-gradient(165deg, #fbfdff 0%, #f7fbff 52%, #f7fcfa 100%);
  line-height: 1.7;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: -12% -10%;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(860px 420px at 16% 28%, rgba(59, 130, 246, 0.14), transparent 72%),
    radial-gradient(920px 460px at 84% 74%, rgba(16, 185, 129, 0.14), transparent 72%);
  filter: blur(42px);
  opacity: 0.35;
}

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: 800;
  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.95rem;
  font-weight: 600;
  color: var(--c-text);
  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(2.5rem, 6vw, 4.1rem);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.03em;
  max-width: 1320px;
  margin: 0 auto 1.75rem;
  color: var(--c-text);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.paper-line {
  display: inline-block;
  width: fit-content;
}
.paper-line-1 {
  white-space: nowrap;
}

.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: 1.08rem;
  font-weight: 600;
  white-space: nowrap;
}

.affiliations {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  margin-bottom: 0.5rem;
}
.affiliation-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.15rem 1.25rem;
}
.affiliation {
  font-size: 0.95rem;
  color: var(--c-text-light);
  font-weight: 500;
}

.contact-email {
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
}
.contact-email a {
  color: var(--c-text-light);
  text-decoration: none;
}
.contact-email a:hover { color: var(--c-primary); }

.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: 1rem;
  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: 1.06rem;
  color: var(--c-text-light);
  font-style: normal;
  font-weight: 500;
}

.caption-emphasis {
  max-width: 320px;
  margin: 0.9rem auto 0;
  font-size: 1.18rem;
  line-height: 1.35;
  font-weight: 700;
  color: #1f2937;
}

.experiments-caption-lead {
  text-align: center;
  margin-bottom: 0.9rem;
  font-size: 1.12rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.01em;
}

/* --- Sections --- */
.section {
  padding: var(--section-py) 0;
}
.section:not(.section-demo):not(.section-alt),
.teaser {
  background: transparent;
}
.section-alt {
  background: transparent;
}

.section-title {
  font-size: 2rem;
  font-weight: 800;
  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: 1.08rem;
  font-weight: 500;
}

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

/* --- Abstract --- */
.abstract-content {
  max-width: 1080px;
  margin: 1.5rem auto 0;
  font-size: 1.2rem;
  line-height: 1.9;
  color: var(--c-text);
  font-weight: 500;
}
.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);
  background: transparent;
  font-size: 0.8rem;
  color: var(--c-text-muted);
  font-weight: 500;
}

.footer-counter {
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: #94a3b8;
  letter-spacing: 0.02em;
  opacity: 0.9;
  min-height: 1em;
}

.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.7rem; }
  .paper-line-1 { white-space: normal; }

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

  .affiliation-row { 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;
}

/* ========================================================
   KnowChange — Custom Additions
   ======================================================== */

/* --- Formula blocks --- */
.formula-block {
  max-width: 700px;
  margin: 0.75rem auto;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 10px;
  padding: 14px 24px;
  overflow-x: auto;
}

/* --- Task cards (Supported Tasks) --- */
.task-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.task-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);
  position: relative;
}
.task-card:hover {
  box-shadow: 0 8px 32px var(--c-card-shadow);
  transform: translateY(-2px);
}
.task-card h3 {
  font-size: 1.32rem;
  font-weight: 700;
  margin: 0.82rem 0 0.55rem;
}
.task-card p {
  font-size: 1rem;
  color: var(--c-text-light);
  line-height: 1.65;
  margin: 0;
}
.task-icon {
  width: 48px; height: 48px;
  margin: 0 auto 0.5rem;
  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);
}
.task-tag {
  display: inline-block;
  margin-top: 1rem;
  background: var(--c-bg-alt);
  color: var(--c-text-muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 2px 10px;
  border-radius: 4px;
}

/* --- Experiment cards --- */
.experiment-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.experiment-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);
}
.experiment-card:hover {
  box-shadow: 0 8px 32px var(--c-card-shadow);
  transform: translateY(-2px);
}
.experiment-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0.75rem 0 0.5rem;
}
.experiment-card p {
  font-size: 0.98rem;
  color: var(--c-text-light);
  line-height: 1.6;
  margin: 0;
}
.experiment-icon {
  width: 48px; height: 48px;
  margin: 0 auto 0.5rem;
  background: linear-gradient(135deg, #d1fae5, #e0f2fe);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
  color: #059669;
}

/* --- Ablation charts grid --- */
.ablation-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 1rem;
}
.ablation-item {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
}
.ablation-item .teaser-caption {
  order: -1;
  font-size: 0.96rem;
  font-weight: 700;
  color: #1e293b;
  font-style: normal;
  line-height: 1.55;
  margin: 0 0 0.72rem;
}

/* --- Unified surface system for better visual consistency --- */
.teaser-card,
.highlight-card,
.task-card,
.experiment-card,
.ablation-item,
.result-card,
.citation-block,
.method-mode-card {
  border-radius: 14px;
  border: 1px solid rgba(203, 213, 225, 0.8);
  box-shadow: 0 6px 18px var(--c-card-shadow-soft);
}

.highlight-card,
.task-card,
.experiment-card,
.result-card {
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}

.highlight-card:hover,
.task-card:hover,
.experiment-card:hover,
.result-card:hover {
  box-shadow: 0 10px 22px var(--c-card-shadow);
  transform: translateY(-1px);
  border-color: rgba(148, 163, 184, 0.65);
}

/* --- VLM reasoning mode cards --- */
.method-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 1rem auto;
  max-width: 1120px;
}
.method-mode-card {
  background: var(--c-card);
  border: 1px solid rgba(203, 213, 225, 0.8);
  border-radius: 14px;
  box-shadow: 0 6px 18px var(--c-card-shadow-soft);
  padding: 1.25rem 1.5rem;
  color: var(--c-text);
}
.method-mode-card h4 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0.25rem 0 0.75rem;
  color: var(--c-text);
}
.method-mode-card p {
  font-size: 0.88rem;
  line-height: 1.75;
  color: var(--c-text);
  margin: 0 0 0.75rem;
}
.mode-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}
.mode-icon {
  font-size: 1.4rem;
  line-height: 1;
}
.mode-example {
  font-size: 0.82rem !important;
  color: var(--c-text-light) !important;
  margin-bottom: 0 !important;
  border-top: 1px solid var(--c-border);
  padding-top: 0.75rem;
}

/* --- Demo section — colorful showcase background --- */
.section-demo {
  position: relative;
  overflow: hidden;
  background: transparent;
}
.section-demo::before {
  content: none;
}
.section-demo .container {
  position: relative;
  z-index: 1;
}
.section-demo .section-title { color: #0f172a; }
.section-demo .teaser-caption { color: #334155; }

@media (max-width: 768px) {
  .task-grid { grid-template-columns: 1fr; }
  .experiment-grid { grid-template-columns: 1fr; }
  .ablation-grid { grid-template-columns: 1fr; }
  .method-modes { grid-template-columns: 1fr; }
}

/* ===== Video Carousel ===== */
.video-carousel {
  position: relative;
  max-width: 1260px;
  margin: 1rem auto 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(249, 252, 255, 0.92));
  border: 1px solid rgba(203, 213, 225, 0.75);
  border-radius: 22px;
  padding: 1.2rem;
  box-shadow: 0 8px 24px var(--c-card-shadow-soft);
}

.video-slides {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.16);
}

.video-slide {
  display: none;
  animation: fadeIn 0.4s ease;
}

.video-slide.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.video-slide video {
  width: 100%;
  display: block;
  max-height: 720px;
  object-fit: contain;
  background: #000;
}

.video-info {
  padding: 1.25rem 1.5rem;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(244, 248, 255, 0.94));
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.video-info h3 {
  font-size: 1.24rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.5rem;
}

.video-info p {
  font-size: 1rem;
  color: #334155;
  line-height: 1.6;
  margin: 0;
}

/* Carousel navigation arrows */
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--c-text);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  z-index: 10;
}

.carousel-arrow:hover {
  background: var(--c-primary);
  color: #fff;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
}

.arrow-left {
  left: 1rem;
}

.arrow-right {
  right: 1rem;
}

/* Example buttons */
.example-buttons {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0;
  margin-bottom: 0.8rem;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(203, 213, 225, 0.85);
  border-radius: 14px;
  padding: 0.65rem;
}

.example-btn {
  min-width: 108px;
  padding: 0.62rem 1.15rem;
  border: 1px solid rgba(148, 163, 184, 0.42);
  border-radius: 11px;
  background: #ffffff;
  color: #1e293b;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: all 0.22s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.example-btn::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #94a3b8;
  transition: background 0.22s ease, transform 0.22s ease;
}

.example-btn:hover {
  background: #f8fbff;
  border-color: rgba(37, 99, 235, 0.55);
  color: #0f172a;
  transform: translateY(-1px) scale(1.01);
}

.example-btn.active {
  background: linear-gradient(135deg, #1d4ed8, #0284c7);
  border-color: #2563eb;
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}
.example-btn.active::before {
  background: #dbeafe;
  transform: scale(1.15);
}

/* Hide carousel arrows */
.carousel-arrow {
  display: none;
}

/* Carousel indicators */
.carousel-indicators {
  display: none;
}

.indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c-border);
  cursor: pointer;
  transition: all 0.25s ease;
}

.indicator:hover {
  background: var(--c-text-light);
}

.indicator.active {
  background: var(--c-primary);
  transform: scale(1.2);
}

/* Responsive */
@media (max-width: 768px) {
  .video-carousel {
    max-width: 100%;
    padding: 0.75rem;
    border-radius: 14px;
  }
  
  .carousel-arrow {
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
  }
  
  .video-info {
    padding: 1rem;
  }
  
  .video-info h3 {
    font-size: 1rem;
  }
}
