/* ========== CSS Variables & Reset ========== */
:root {
  --bg-primary: #0a0a1a;
  --bg-secondary: #0f0f2a;
  --bg-card: rgba(15, 15, 42, 0.6);
  --bg-card-hover: rgba(25, 25, 60, 0.8);
  --text-primary: #e8e8f0;
  --text-secondary: #9d9db8;
  --text-muted: #6b6b8a;
  --blue: #4a90d9;
  --purple: #7c3aed;
  --red: #ef4444;
  --gradient-main: linear-gradient(135deg, #4a90d9, #7c3aed, #ef4444);
  --gradient-blue-purple: linear-gradient(135deg, #4a90d9, #7c3aed);
  --gradient-subtle: linear-gradient(135deg, rgba(74,144,217,0.15), rgba(124,58,237,0.15));
  --border-color: rgba(124, 58, 237, 0.2);
  --glow-blue: 0 0 20px rgba(74, 144, 217, 0.3);
  --glow-purple: 0 0 20px rgba(124, 58, 237, 0.3);
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --max-width: 1200px;
  --nav-height: 64px;
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: var(--font-main);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: rgba(124, 58, 237, 0.4);
  color: #fff;
}

/* ========== Navigation ========== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  background: rgba(10, 10, 26, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.navbar.scrolled {
  background: rgba(10, 10, 26, 0.95);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.nav-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.1rem;
}

.nav-logo-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.nav-links {
  display: flex;
  gap: 1.8rem;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.3s ease;
  position: relative;
}

.nav-links a:hover {
  color: var(--text-primary);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-main);
  transition: width 0.3s ease;
}

.nav-links a:hover::after {
  width: 100%;
}

/* ========== Common ========== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

.section {
  padding: 6rem 0;
  position: relative;
}

.section-dark {
  background: var(--bg-secondary);
}

.section-title {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.section-desc {
  text-align: center;
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 700px;
  margin: 0 auto 3rem;
}

.results-subtitle {
  text-align: center;
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 3.5rem 0 0.7rem;
  color: var(--text-primary);
}

.subsection-desc {
  max-width: 760px;
  margin: 0 auto 1.8rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.98rem;
}

.paper-figures {
  display: grid;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.paper-figure {
  width: min(100%, 980px);
  margin-inline: auto;
  padding: 0.8rem;
  overflow: hidden;
}

.paper-figure img {
  display: block;
  width: min(100%, 960px);
  margin-inline: auto;
  height: auto;
  border-radius: 10px;
  /* The source figures use transparent margins. A light canvas keeps their
     dark axis labels readable against the site's dark background. */
  background: #f5f8fb;
}

.paper-figure figcaption {
  padding: 0.9rem 0.35rem 0.1rem;
  color: var(--text-secondary);
  font-size: 0.86rem;
  line-height: 1.55;
  text-align: center;
}

.gradient-text {
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  transition: all 0.3s ease;
}

.glass-card:hover {
  border-color: rgba(124, 58, 237, 0.4);
  background: var(--bg-card-hover);
}

/* ========== Animations ========== */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========== Hero ========== */
.hero-section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding-top: var(--nav-height);
  background:
    radial-gradient(circle at 18% 20%, rgba(155, 124, 255, 0.16), transparent 28%),
    radial-gradient(circle at 82% 24%, rgba(49, 213, 202, 0.11), transparent 26%),
    radial-gradient(circle at 50% 88%, rgba(255, 155, 114, 0.09), transparent 32%);
}

.hero-section::before {
  content: '';
  position: absolute;
  inset: -24%;
  z-index: 0;
  pointer-events: none;
  background: conic-gradient(
    from 210deg at 50% 50%,
    rgba(155, 124, 255, 0.18),
    rgba(49, 213, 202, 0.13),
    rgba(255, 155, 114, 0.1),
    rgba(155, 124, 255, 0.18)
  );
  filter: blur(90px) saturate(135%);
  opacity: 0.8;
  animation: nebulaDrift 18s ease-in-out infinite alternate;
}

.hero-section::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0 36%, rgba(255, 255, 255, 0.025) 48%, transparent 60%),
    radial-gradient(ellipse at 50% 35%, transparent 0 42%, rgba(7, 8, 22, 0.48) 88%);
  mix-blend-mode: screen;
  opacity: 0.72;
}

#particle-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  opacity: 0.82;
  mix-blend-mode: screen;
}

@keyframes nebulaDrift {
  0% { transform: translate3d(-3%, -2%, 0) rotate(0deg) scale(1); }
  50% { transform: translate3d(2%, 3%, 0) rotate(5deg) scale(1.08); }
  100% { transform: translate3d(5%, -1%, 0) rotate(-4deg) scale(1.03); }
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 2rem;
}

.hero-badge {
  display: inline-block;
  padding: 0.4rem 1.2rem;
  background: var(--gradient-subtle);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--purple);
  margin-bottom: 2rem;
  letter-spacing: 0.05em;
}

.hero-logo {
  width: 220px;
  height: 220px;
  object-fit: contain;
  margin-bottom: 1.5rem;
  filter: drop-shadow(0 0 40px rgba(124, 58, 237, 0.3));
  animation: float 4s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.hero-title {
  font-size: 4.5rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 1.4rem;
  color: var(--text-secondary);
  font-weight: 400;
  margin-bottom: 1rem;
}

.hero-authors {
  display: grid;
  gap: 0.35rem;
  margin: 1.1rem auto 1.45rem;
  color: var(--text-secondary);
  font-size: 0.96rem;
}

.author-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.15rem;
  flex-wrap: wrap;
}

.author-line a,
.author-line .author-name,
.affiliation-line a {
  color: #dce4f7;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.25s ease, border-color 0.25s ease;
}

.author-line a:hover,
.affiliation-line a:hover {
  color: #fff;
  border-bottom-color: var(--teal, #31d5ca);
}

.author-line sup,
.affiliation-line sup {
  color: #8df2e9;
  font-size: 0.66em;
  line-height: 0;
  vertical-align: super;
  margin-left: 0.08em;
}

.author-notes {
  color: var(--text-muted);
  font-size: 0.8rem;
  letter-spacing: 0.01em;
}

.affiliation-line {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 2.5rem;
  line-height: 1.6;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.8rem;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--gradient-blue-purple);
  color: #fff;
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 6px 30px rgba(124, 58, 237, 0.5);
  transform: translateY(-2px);
}

.btn-secondary {
  background: rgba(124, 58, 237, 0.1);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(124, 58, 237, 0.2);
  border-color: rgba(124, 58, 237, 0.4);
  transform: translateY(-2px);
}

.hero-scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.scroll-arrow {
  width: 24px;
  height: 24px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
  animation: scrollBounce 2s infinite;
}

@keyframes scrollBounce {
  0%, 100% { transform: rotate(45deg) translate(0, 0); opacity: 0.3; }
  50% { transform: rotate(45deg) translate(5px, 5px); opacity: 1; }
}

/* ========== Abstract ========== */
.abstract-card {
  padding: 2.5rem;
  max-width: 900px;
  margin: 0 auto 3rem;
}

.abstract-card p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
  font-size: 1.02rem;
  line-height: 1.8;
}

.abstract-card p:last-child {
  margin-bottom: 0;
}

.highlight {
  color: var(--text-primary);
  background: linear-gradient(135deg, rgba(74,144,217,0.2), rgba(124,58,237,0.2));
  padding: 0.1em 0.4em;
  border-radius: 4px;
}

.highlights-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  max-width: 1000px;
  margin: 0 auto;
}

.highlight-item {
  padding: 1.8rem 1.5rem;
  text-align: center;
}

.highlight-icon {
  font-size: 2rem;
  margin-bottom: 0.8rem;
}

.highlight-label {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.highlight-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ========== Method ========== */
.method-diagram {
  text-align: center;
  margin-bottom: 3rem;
}

.method-img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: #fff;
  padding: 1rem;
}

.method-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.method-card {
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.method-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-main);
}

.method-card-number {
  font-size: 3rem;
  font-weight: 900;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 0.3;
  margin-bottom: 0.5rem;
  line-height: 1;
}

.method-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
  color: var(--text-primary);
}

.method-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ========== Results / Tabs ========== */
.tabs {
  max-width: 1000px;
  margin: 0 auto;
}

.tab-buttons {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.tab-btn {
  padding: 0.6rem 1.4rem;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.tab-btn:hover {
  color: var(--text-primary);
  border-color: rgba(124, 58, 237, 0.4);
}

.tab-btn.active {
  background: var(--gradient-blue-purple);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 12px rgba(124, 58, 237, 0.3);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeTab 0.4s ease forwards;
}

@keyframes fadeTab {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.tab-desc {
  text-align: center;
  margin-bottom: 2rem;
}

.tab-desc h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.tab-desc p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 650px;
  margin: 0 auto;
}

.video-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 1rem;
}

.result-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  padding: 0.7rem;
}

/* Keep three cards centered on the first row and four cards centered on the second row. */
.result-card:nth-child(1) { grid-column: 2 / span 2; grid-row: 1; }
.result-card:nth-child(2) { grid-column: 4 / span 2; grid-row: 1; }
.result-card:nth-child(3) { grid-column: 6 / span 2; grid-row: 1; }
.result-card:nth-child(4) { grid-column: 1 / span 2; grid-row: 2; }
.result-card:nth-child(5) { grid-column: 3 / span 2; grid-row: 2; }
.result-card:nth-child(6) { grid-column: 5 / span 2; grid-row: 2; }
.result-card:nth-child(7) { grid-column: 7 / span 2; grid-row: 2; }

.result-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.result-label {
  position: absolute;
  top: 0.95rem;
  left: 0.95rem;
  z-index: 2;
  min-height: 0;
  margin: 0;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: left;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  pointer-events: none;
}

.video-card {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
}

.video-card video {
  width: 100%;
  display: block;
  border-radius: 15px;
}

.video-label {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 0.3rem 0.8rem;
  background: rgba(10, 10, 26, 0.8);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  z-index: 2;
}

/* ========== Streaming ========== */
.streaming-card {
  padding: 2rem;
  max-width: 900px;
  margin: 0 auto;
}

.streaming-badge {
  display: inline-block;
  padding: 0.3rem 1rem;
  background: var(--gradient-subtle);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--purple);
  margin-bottom: 1.5rem;
}

.streaming-video {
  width: 100%;
  border-radius: 12px;
  margin-bottom: 1.5rem;
}

.streaming-info {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.streaming-stat {
  text-align: center;
  padding: 1rem;
  background: rgba(124, 58, 237, 0.08);
  border-radius: 12px;
  border: 1px solid rgba(124, 58, 237, 0.15);
}

.stat-value {
  display: block;
  font-size: 1.8rem;
  font-weight: 800;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.streaming-caption {
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-align: center;
  line-height: 1.6;
}

/* ========== Comparison ========== */
.comparison-block {
  margin-bottom: 4rem;
}

.comparison-block:last-child {
  margin-bottom: 0;
}

.comparison-title {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
  color: var(--text-primary);
}

.comparison-desc {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 650px;
  margin: 0 auto 2rem;
}

.video-compare {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  justify-content: center;
}

.video-compare .video-card {
  flex: 1;
  max-width: 450px;
}

.vs-badge {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--purple);
  background: rgba(124, 58, 237, 0.1);
  padding: 0.5rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

.label-ours {
  background: rgba(74, 144, 217, 0.8) !important;
  border-color: rgba(74, 144, 217, 0.6) !important;
}

.label-baseline {
  background: rgba(239, 68, 68, 0.6) !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
}

/* ========== Table ========== */
.table-caption {
  max-width: 880px;
  margin: -1rem auto 1.5rem;
  color: var(--text-secondary);
  text-align: center;
  font-size: 0.9rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.table-wrapper {
  padding: 1rem;
  overflow-x: auto;
  border-radius: 16px;
}

.results-table {
  width: max-content;
  min-width: 1120px;
  border-collapse: collapse;
  font-size: 0.75rem;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}

.results-table th {
  padding: 0.55rem 0.45rem;
  text-align: center;
  font-weight: 700;
  color: var(--text-primary);
  border-bottom: 1px solid rgba(124, 58, 237, 0.25);
  white-space: nowrap;
  font-size: 0.68rem;
  letter-spacing: 0.01em;
}

.results-table td {
  padding: 0.42rem 0.45rem;
  text-align: center;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(124, 58, 237, 0.08);
  white-space: nowrap;
}

.results-table th:first-child,
.results-table td:first-child {
  min-width: 170px;
  text-align: left;
}

.results-table th:nth-child(2),
.results-table td:nth-child(2) {
  min-width: 92px;
}

.results-table .dataset-group {
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
  font-size: 0.77rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(255,255,255,0.035);
}

.results-table .dataset-group.in-domain { color: #7fd1c9; }
.results-table .dataset-group.out-domain { color: #c7a4ff; }
.results-table .dataset-name {
  font-size: 0.75rem;
  border-bottom: 0;
  color: var(--text-primary);
  background: rgba(255,255,255,0.02);
}

.results-table .model-name {
  display: inline-flex;
  align-items: center;
  gap: 0.36rem;
  color: var(--text-primary);
  font-weight: 500;
}

.results-table .model-name img {
  width: 1.35rem;
  height: 1.35rem;
  object-fit: contain;
}

.results-table .muted { color: rgba(232, 232, 240, 0.48); }
.results-table .second {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.results-table .section-divider td {
  height: 0.55rem;
  padding: 0;
  border-bottom: 1px solid rgba(255,255,255,0.14);
  background: transparent;
}

.results-table .ours-row td {
  background: rgba(124, 58, 237, 0.055);
}

.results-table tbody tr:has(img[src*="gpt-teal"]) td {
  background: rgba(49, 213, 202, 0.035);
}

.results-table tbody tr:has(img[src*="claude-orange"]) td {
  background: rgba(255, 155, 114, 0.035);
}

.results-table tbody tr:has(img[src*="gemini-blue"]) td {
  background: rgba(74, 144, 217, 0.035);
}

.results-table tbody tr:has(img[src*="kimi.png"]) td {
  background: rgba(239, 68, 68, 0.035);
}

.results-table .ours-highlight td {
  background: rgba(124, 58, 237, 0.16);
  color: var(--text-primary);
}

.results-table .kimi-highlight td {
  background: rgba(239, 68, 68, 0.12);
  color: var(--text-primary);
}

.results-table .improvement-row td {
  color: #79d7a3;
  background: rgba(121, 215, 163, 0.045);
  font-size: 0.69rem;
}

.results-table strong { color: #fff; }

@media (max-width: 700px) {
  .table-caption { font-size: 0.82rem; }
  .table-wrapper { margin-inline: -0.75rem; border-radius: 12px; }
  .paper-figure { width: 100%; }
  .paper-figure img { width: 100%; }
}

/* ========== Visualization ========== */
.viz-selector {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.viz-btn {
  padding: 0.5rem 1.2rem;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.viz-btn:hover {
  color: var(--text-primary);
  border-color: rgba(124, 58, 237, 0.4);
}

.viz-btn.active {
  background: var(--gradient-blue-purple);
  color: #fff;
  border-color: transparent;
}

.viz-frame-wrapper {
  padding: 0.5rem;
  overflow: hidden;
}

.viz-iframe {
  width: 100%;
  height: 600px;
  border: none;
  border-radius: 12px;
  background: #111;
}

/* ========== Citation / BibTeX ========== */
.bibtex-card {
  max-width: 700px;
  margin: 0 auto;
  overflow: hidden;
}

.bibtex-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
  font-size: 0.95rem;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  background: rgba(124, 58, 237, 0.15);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.copy-btn:hover {
  background: rgba(124, 58, 237, 0.3);
  color: var(--text-primary);
}

.copy-btn.copied {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.3);
  color: #22c55e;
}

.bibtex-code {
  padding: 1.5rem;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-secondary);
  overflow-x: auto;
}

/* ========== Footer ========== */
.footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border-color);
  background: var(--bg-primary);
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
}

.footer-logo img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.footer-text {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .hero-title {
    font-size: 2.8rem;
  }

  .hero-subtitle {
    font-size: 1.1rem;
  }

  .hero-logo {
    width: 160px;
    height: 160px;
  }

  .section-title {
    font-size: 2rem;
  }

  .highlights-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .method-cards {
    grid-template-columns: 1fr;
  }

  .video-grid-2 {
    grid-template-columns: 1fr;
  }

  .results-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-card:nth-child(n) {
    grid-column: auto;
    grid-row: auto;
  }

  .video-compare {
    flex-direction: column;
  }

  .vs-badge {
    margin: 0.5rem 0;
  }

  .streaming-info {
    grid-template-columns: repeat(2, 1fr);
  }

  .tab-buttons {
    gap: 0.4rem;
  }

  .tab-btn {
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
  }

  .viz-iframe {
    height: 400px;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2.2rem;
  }

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

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

  .container {
    padding: 0 1rem;
  }

  .results-grid {
    gap: 0.75rem;
  }

  .result-card {
    padding: 0.55rem;
  }

  .result-label {
    font-size: 0.7rem;
  }

  .section {
    padding: 4rem 0;
  }
}

/* ========== Media placeholders ========== */
.media-placeholder {
  display: block;
  background: transparent;
}

.logo-placeholder {
  flex: 0 0 auto;
}

.hero-logo.logo-placeholder {
  display: block;
}

.diagram-placeholder {
  width: 100%;
  aspect-ratio: 2000 / 797;
  background: rgba(255, 255, 255, 0.025);
}

.video-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: rgba(255, 255, 255, 0.025);
  border-radius: 15px;
}

.streaming-card .video-placeholder {
  margin-bottom: 1.5rem;
}

.viz-placeholder {
  display: block;
  min-height: 600px;
  background: rgba(255, 255, 255, 0.025);
}

.footer-logo-img {
  width: 24px;
  height: 24px;
}

@media (max-width: 768px) {
  .viz-placeholder {
    min-height: 400px;
  }
}

.image-placeholder {
  display: block;
  width: 100%;
  min-height: 180px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}

/* Title accents matched to the Learning to Code the World reference page. */
:root {
  --title-gradient: linear-gradient(105deg, #fff 10%, #c4b5fd 48%, #31d5ca);
}

.gradient-text {
  background: var(--title-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.method-card::before {
  background: var(--title-gradient);
}

/* Action controls use the same violet / teal / coral language as the reference title. */
:root {
  --action-gradient: linear-gradient(135deg, #9b7cff 0%, #6c5ce7 32%, #31d5ca 72%, #ff9b72 100%);
  --action-gradient-soft: linear-gradient(135deg, rgba(155, 124, 255, 0.2), rgba(49, 213, 202, 0.12) 64%, rgba(255, 155, 114, 0.12));
  --action-border: rgba(196, 181, 253, 0.34);
}

.btn,
.tab-btn,
.viz-btn,
.copy-btn {
  background: var(--action-gradient-soft);
  background-size: 180% 180%;
  border-color: var(--action-border);
}

.btn:hover,
.tab-btn:hover,
.viz-btn:hover,
.copy-btn:hover {
  background: var(--action-gradient);
  background-position: 100% 0;
  border-color: transparent;
  color: #fff;
}

.btn-primary,
.tab-btn.active,
.viz-btn.active {
  background: var(--action-gradient);
  background-size: 180% 180%;
  border-color: transparent;
  box-shadow: 0 8px 28px rgba(108, 92, 231, 0.28);
}

.btn-primary:hover,
.tab-btn.active:hover,
.viz-btn.active:hover {
  background-position: 100% 0;
  box-shadow: 0 10px 34px rgba(49, 213, 202, 0.2);
}

.copy-btn.copied {
  background: linear-gradient(135deg, rgba(49, 213, 202, 0.3), rgba(155, 124, 255, 0.22));
  border-color: rgba(49, 213, 202, 0.42);
  color: #8df2e9;
}

/* Extend the nebula atmosphere across every section of the page. */
html {
  background: #070a16;
}

body {
  isolation: isolate;
  background: transparent;
}

body::before {
  content: '';
  position: fixed;
  inset: -28%;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(circle at 14% 18%, rgba(155, 124, 255, 0.19), transparent 25%),
    radial-gradient(circle at 84% 24%, rgba(49, 213, 202, 0.13), transparent 24%),
    radial-gradient(circle at 68% 82%, rgba(255, 155, 114, 0.1), transparent 27%),
    conic-gradient(from 210deg at 50% 48%, rgba(155, 124, 255, 0.1), rgba(49, 213, 202, 0.08), rgba(255, 155, 114, 0.07), rgba(155, 124, 255, 0.1));
  filter: blur(72px) saturate(150%);
  opacity: 1;
  animation: pageNebulaDrift 28s ease-in-out infinite alternate;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(125deg, rgba(7, 10, 22, 0.18), transparent 36%, rgba(7, 10, 22, 0.12) 72%),
    radial-gradient(ellipse at 50% 48%, transparent 0 42%, rgba(7, 10, 22, 0.45) 92%);
  opacity: 0.5;
}

.section-dark,
.footer {
  background: rgba(15, 15, 42, 0.28);
}

@keyframes pageNebulaDrift {
  0% { transform: translate3d(-3%, -2%, 0) rotate(0deg) scale(1); }
  50% { transform: translate3d(2%, 2%, 0) rotate(4deg) scale(1.06); }
  100% { transform: translate3d(5%, -1%, 0) rotate(-3deg) scale(1.02); }
}

/* Soften the Hero-to-Abstract handoff instead of ending the first-page glow on a hard edge. */
.hero-section {
  background: transparent;
}

.hero-section::before {
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 58%, transparent 84%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 58%, transparent 84%);
}

.hero-section::after {
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 76%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 76%, transparent 100%);
}

@media (max-width: 480px) {
  .hero-authors {
    font-size: 0.84rem;
  }

  .author-line {
    gap: 0.45rem 0.9rem;
  }

  .author-notes,
  .affiliation-line {
    font-size: 0.78rem;
  }
}

/* ========== Interactive scene streaming comparison ========== */
.scene-stream-card { max-width: 1180px; }
.streaming-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 2rem; margin-bottom: 1.5rem; }
.streaming-card-head .comparison-title { text-align: left; margin: 0.25rem 0 0.5rem; }
.streaming-lede { color: var(--text-secondary); max-width: 680px; font-size: 0.93rem; line-height: 1.6; }
.streaming-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.6rem; padding-top: 0.25rem; }
.stream-control, .stream-file-link { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; border-radius: 10px; padding: 0.55rem 0.9rem; font: 600 0.82rem var(--font-main); cursor: pointer; text-decoration: none; transition: transform .2s ease, background .2s ease, border-color .2s ease; }
.stream-control { border: 1px solid rgba(49,213,202,.5); background: rgba(49,213,202,.12); color: #c8fffa; }
.stream-file-link { border: 1px solid var(--border-color); background: rgba(124,58,237,.12); color: var(--text-primary); }
.stream-control:hover, .stream-file-link:hover { transform: translateY(-2px); border-color: rgba(49,213,202,.8); }
.scene-compare { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.9rem; }
.scene-panel { min-width: 0; border: 1px solid rgba(124,58,237,.18); border-radius: 14px; overflow: hidden; background: rgba(6,8,24,.68); transition: border-color .25s ease, transform .25s ease, box-shadow .25s ease; }
.scene-panel:hover, .scene-panel.is-active { border-color: rgba(49,213,202,.65); box-shadow: 0 12px 30px rgba(0,0,0,.22); transform: translateY(-2px); }
.scene-panel-header { display: flex; align-items: center; gap: .45rem; min-height: 44px; padding: .6rem .7rem; font-size: .78rem; font-weight: 700; }
.scene-file { margin-left: auto; max-width: 52%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); font: 500 .65rem var(--font-mono); }
.scene-model-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; box-shadow: 0 0 12px currentColor; }
.dot-astra { color: #9b7cff; background: #9b7cff; } .dot-kimi { color: #ff9b72; background: #ff9b72; } .dot-ours { color: #31d5ca; background: #31d5ca; }
.scene-viewport { position: relative; aspect-ratio: 16 / 10; background: #070916; overflow: hidden; }
.scene-viewport model-viewer { width: 100%; height: 100%; --poster-color: transparent; background: radial-gradient(circle at 50% 45%, rgba(155,124,255,.12), transparent 68%); }
.scene-overlay { position: absolute; right: .65rem; bottom: .55rem; pointer-events: none; padding: .25rem .45rem; border-radius: 6px; color: rgba(255,255,255,.68); background: rgba(7,8,22,.7); font-size: .63rem; }
.scene-preview { background-image: linear-gradient(145deg, rgba(10,10,26,.14), rgba(10,10,26,.8)), var(--scene-image); background-size: cover; background-position: center; filter: saturate(.88); }
.scene-preview::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 15%, rgba(49,213,202,.12) 48%, transparent 80%); transform: translateX(-100%); animation: sceneScan 4.2s ease-in-out infinite; }
.scene-preview-glow { position: absolute; width: 55%; aspect-ratio: 1; left: 20%; top: 7%; border-radius: 50%; background: radial-gradient(circle, rgba(255,155,114,.17), transparent 68%); filter: blur(12px); animation: scenePulse 3.8s ease-in-out infinite; }
.scene-preview-label { position: absolute; left: .7rem; bottom: .6rem; z-index: 1; padding: .28rem .5rem; border: 1px solid rgba(255,255,255,.16); border-radius: 6px; color: rgba(255,255,255,.75); background: rgba(7,8,22,.65); font-size: .64rem; }
@keyframes sceneScan { 0%, 20% { transform: translateX(-100%); } 65%, 100% { transform: translateX(100%); } }
@keyframes scenePulse { 0%, 100% { transform: scale(.86); opacity: .5; } 50% { transform: scale(1.12); opacity: .9; } }
.scene-timeline { margin-top: 1.25rem; padding: .8rem .95rem .65rem; border-radius: 12px; border: 1px solid rgba(124,58,237,.16); background: rgba(124,58,237,.055); }
.scene-timeline-row { display: flex; gap: .45rem; margin-bottom: .75rem; }
.scene-step { width: 34px; height: 28px; border: 1px solid rgba(124,58,237,.3); border-radius: 7px; background: transparent; color: var(--text-muted); font: 700 .7rem var(--font-mono); cursor: pointer; }
.scene-step:hover, .scene-step.active { color: white; border-color: transparent; background: var(--gradient-blue-purple); }
#scene-scrubber { display: block; width: 100%; accent-color: #31d5ca; cursor: pointer; }
.scene-timeline-meta { display: flex; justify-content: space-between; gap: 1rem; margin-top: .45rem; color: var(--text-muted); font-size: .72rem; }
.scene-timeline-meta strong { color: var(--text-primary); font-family: var(--font-mono); }
.scene-stream-card .streaming-info { margin: 1.3rem 0 1.25rem; }
@media (max-width: 820px) { .streaming-card-head { flex-direction: column; } .streaming-actions { justify-content: flex-start; } .scene-compare { grid-template-columns: 1fr; } .scene-panel { max-width: none; } }
@media (prefers-reduced-motion: reduce) { .scene-preview::after, .scene-preview-glow { animation: none; } }

/* Reference + three reconstructions stay aligned in each comparison row. */
.scene-row-title { margin: 1.5rem 0 .75rem; color: var(--text-secondary); font-size: .9rem; font-weight: 600; }
.scene-reference .scene-viewport img { display: block; width: 100%; height: 100%; object-fit: contain; }
[data-sync-camera] .scene-viewport { aspect-ratio: 4 / 3; }
.dot-reference { color: #c5cedf; background: #c5cedf; }
.scene-panel-header > span:nth-child(2) { flex-shrink: 0; }
.scene-compare .scene-file { display: none; }
@media (min-width: 601px) and (max-width: 820px) { .scene-compare { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
