:root {
  --bg0: #07080c;
  --bg1: #0b1230;
  --card: rgba(255, 255, 255, 0.06);
  --card2: rgba(255, 255, 255, 0.08);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.68);
  --line: rgba(255, 255, 255, 0.12);
  --accent: #68f0ff;
  --accent2: #9b7bff;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji",
    "Segoe UI Emoji";
  color: var(--text);
  background: radial-gradient(1100px 650px at 18% 8%, rgba(104, 240, 255, 0.12), transparent 60%),
    radial-gradient(900px 520px at 86% 14%, rgba(155, 123, 255, 0.13), transparent 55%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
  overflow-x: hidden;
}

.bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.9;
  background-image: radial-gradient(circle at 25% 10%, rgba(104, 240, 255, 0.12), transparent 35%),
    radial-gradient(circle at 78% 30%, rgba(155, 123, 255, 0.12), transparent 40%);
  filter: saturate(1.1);
}

.wrap {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0 12px;
  gap: 18px;
}

.brand .logo {
  font-weight: 800;
  letter-spacing: 0.2px;
  font-size: 20px;
}

.brand .tag {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.03);
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
}

.btn-primary {
  background: linear-gradient(135deg, rgba(104, 240, 255, 0.22), rgba(155, 123, 255, 0.18));
  border-color: rgba(104, 240, 255, 0.35);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.02);
}

.btn-small {
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
}

.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 26px;
  align-items: center;
  padding: 26px 0 10px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(30px, 3.2vw, 46px);
  letter-spacing: -0.6px;
}

.em {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 15px;
  max-width: 52ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.facts {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.fact {
  padding: 14px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
}

.fact .k {
  font-size: 12px;
  color: var(--muted);
}

.fact .v {
  margin-top: 8px;
  font-weight: 650;
  font-size: 14px;
}

.hero-figure {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: var(--shadow);
  padding: 14px;
}

.hero-img {
  width: 100%;
  height: auto;
  border-radius: 14px;
  display: block;
}

.caption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 20px 0 54px;
}

.card {
  border-radius: 18px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.card h2 {
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.2px;
}

.list {
  padding-left: 18px;
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.muted {
  color: var(--muted);
}

.footer {
  padding: 20px 0 34px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

@media (max-width: 920px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .facts {
    grid-template-columns: 1fr;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .footer {
    flex-direction: column;
  }
}

/* Rex-Omni style adaptation (static project page) */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-padding-top: 92px;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  color: #334155;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  overflow-x: hidden;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Navigation */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  z-index: 1000;
  transition: all 0.3s ease;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 78px;
  height: auto;
  padding-top: 10px;
  padding-bottom: 10px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-logo-img {
  height: 64px;
  width: auto;
  max-height: 64px;
  border-radius: 8px;
  display: block;
  object-fit: contain;
}

.logo-text {
  font-size: 22px;
  font-weight: 750;
  color: #1e40af;
  letter-spacing: -0.2px;
}

.nav-links {
  display: flex;
  gap: 24px;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  color: #64748b;
  font-weight: 550;
  transition: color 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
}

.nav-links a:hover {
  color: #1e40af;
  transform: translateY(-1px);
}

.paper-link {
  background: #1e40af;
  color: white !important;
  padding: 8px 16px;
  border-radius: 999px;
}

/* Buttons (override old dark theme) */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 650;
  font-size: 1rem;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

.btn-primary:hover {
  background: #5a67d8;
  border-color: #5a67d8;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.35);
}

.btn-secondary {
  background: rgba(102, 126, 234, 0.1);
  color: #667eea;
  border-color: #667eea;
}

.btn-secondary:hover {
  background: #667eea;
  color: white;
  border-color: #667eea;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.35);
}

/* Hero */
.hero {
  display: block; /* override old grid */
  padding: 120px 0 80px;
  background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 50%, #e2e8f0 100%);
  overflow: hidden;
  position: relative;
}

.hero-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  min-height: auto;
}

.hero-content {
  max-width: 540px;
  text-align: left;
  z-index: 2;
  position: relative;
}

.hero-title {
  font-size: 3.25rem;
  font-weight: 750;
  color: #0f172a;
  margin-bottom: 24px;
  line-height: 1.1;
  letter-spacing: -0.6px;
}

.hero .hero-title {
  /* Override legacy rule `.hero h1` (higher specificity than `.hero-title`). */
  font-size: 3.25rem;
  letter-spacing: -0.6px;
  margin: 0 0 24px;
  line-height: 1.1;
}

.em {
  background: linear-gradient(90deg, #4f46e5, #2563eb);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: #64748b;
  margin-bottom: 40px;
  line-height: 1.65;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-demo-container {
  position: relative;
  width: 100%;
  max-width: min(100%, 760px);
  margin: 0 auto;
  transform: translateY(12px);
  z-index: 1;
}

.hero-demo-container::before {
  content: "";
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  background: linear-gradient(135deg, rgba(30, 64, 175, 0.1), rgba(59, 130, 246, 0.1));
  border-radius: 30px;
  z-index: -1;
  opacity: 0.8;
}

.hero-demo-container::after {
  content: "";
  position: absolute;
  top: -20px;
  left: -20px;
  right: -20px;
  bottom: -20px;
  background: linear-gradient(135deg, rgba(30, 64, 175, 0.05), rgba(59, 130, 246, 0.05));
  border-radius: 40px;
  z-index: -2;
  opacity: 0.6;
}

.hero-img {
  width: 100%;
  max-width: 100%;
  max-height: min(85vh, 820px);
  height: auto;
  object-fit: contain;
  object-position: center;
  border-radius: 14px;
  display: block;
  margin-inline: auto;
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.12);
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.demo-caption {
  margin-top: 16px;
}

.demo-caption p {
  font-size: 0.88rem;
  font-weight: 400;
  color: #475569;
  line-height: 1.7;
  text-align: left;
  margin: 0;
}

/* Capabilities Section */
.capabilities {
  padding: 80px 0;
  background: white;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 750;
  color: #0f172a;
  text-align: center;
  margin-bottom: 16px;
}

.section-subtitle {
  font-size: 1.15rem;
  color: #64748b;
  text-align: center;
  margin-bottom: 64px;
}

.capabilities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 26px;
}

.capability-card {
  background: white;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  transition: all 0.25s ease;
}

.capability-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.capability-content {
  padding: 26px 22px;
}

.capability-content h4 {
  font-size: 1.15rem;
  font-weight: 650;
  color: #0f172a;
  margin-bottom: 12px;
}

.capability-content p {
  color: #64748b;
  line-height: 1.65;
}

/* Performance Section */
.performance {
  padding: 80px 0;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.performance-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  margin-top: 48px;
}

.performance-text h3 {
  font-size: 2rem;
  font-weight: 650;
  color: #0f172a;
  margin-bottom: 24px;
}

.performance-text p {
  font-size: 1.05rem;
  color: #64748b;
  margin-bottom: 32px;
  line-height: 1.75;
}

.highlights {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
}

.highlight-item {
  text-align: center;
  min-width: 120px;
}

.highlight-number {
  display: block;
  font-size: 2.3rem;
  font-weight: 800;
  color: #1e40af;
  line-height: 1;
}

.highlight-text {
  font-size: 0.92rem;
  color: #64748b;
  font-weight: 550;
  margin-top: 10px;
}

.performance-visual {
  display: flex;
  justify-content: center;
}

.architecture-diagram img {
  width: 100%;
  max-width: 560px;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.10);
  border: 1px solid rgba(15, 23, 42, 0.06);
}

/* Quick Start Section */
.quickstart {
  padding: 80px 0;
  background: white;
}

.code-section {
  background: #0f172a;
  border-radius: 16px;
  overflow: hidden;
  margin: 48px 0;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.12);
}

.code-tabs {
  display: flex;
  background: #1f2937;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.code-tab {
  padding: 16px 22px;
  background: none;
  border: none;
  color: #94a3b8;
  font-weight: 550;
  cursor: pointer;
  transition: all 0.2s ease;
}

.code-tab.active {
  background: #0f172a;
  color: white;
}

.code-tab:hover {
  color: white;
}

.code-content {
  position: relative;
}

.code-block {
  display: none;
  padding: 0;
}

.code-block.active {
  display: block;
}

.code-block pre {
  margin: 0;
  padding: 24px;
  background: #0f172a;
  color: #e2e8f0;
  font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
  font-size: 0.9rem;
  line-height: 1.65;
  overflow-x: auto;
}

/* Quick start links */
.quickstart-links {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 48px;
}

.link-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: rgba(102, 126, 234, 0.1);
  color: #667eea;
  text-decoration: none;
  border-radius: 999px;
  font-weight: 650;
  transition: all 0.3s ease;
  border: 2px solid #667eea;
}

.link-button:hover {
  background: #667eea;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

/* Open innovation */
.opensource {
  padding: 80px 0;
  background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 100%);
  color: white;
}

.opensource .section-title,
.opensource .section-subtitle {
  color: white;
}

.opensource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 26px;
  margin: 48px 0;
}

.opensource-item {
  text-align: center;
  padding: 32px 22px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  backdrop-filter: blur(10px);
  transition: all 0.25s ease;
}

.opensource-item:hover {
  transform: translateY(-6px);
  background: rgba(255, 255, 255, 0.14);
}

.opensource-icon {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.opensource-item h4 {
  font-size: 1.2rem;
  font-weight: 650;
  margin-bottom: 12px;
}

.opensource-item p {
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.7;
}

.opensource-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.opensource .btn-primary {
  background: white;
  color: #667eea;
  border-color: white;
}

.opensource .btn-primary:hover {
  background: rgba(255, 255, 255, 0.9);
  color: #5a67d8;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 255, 255, 0.3);
}

.opensource .btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border-color: rgba(255, 255, 255, 0.55);
}

.opensource .btn-secondary:hover {
  background: white;
  color: #667eea;
  border-color: white;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 255, 255, 0.3);
}

/* Footer */
.footer {
  display: block;
  border-top: none;
  background: #0f172a;
  color: white;
  padding: 64px 0 32px;
}

.footer-content {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 64px;
  margin-bottom: 48px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.footer-left p {
  color: #94a3b8;
  margin-bottom: 24px;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}

.footer-section h4 {
  font-size: 1.05rem;
  font-weight: 650;
  margin-bottom: 16px;
  color: white;
}

.footer-section a {
  display: block;
  color: #94a3b8;
  text-decoration: none;
  margin-bottom: 10px;
  transition: color 0.2s ease;
}

.footer-section a:hover {
  color: white;
}

.footer-bottom {
  text-align: center;
  padding-top: 32px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  color: #94a3b8;
}

@media (max-width: 920px) {
  .hero-layout {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }

  .hero-content {
    max-width: 100%;
    text-align: center;
  }

  .hero-demo-container {
    transform: translateY(8px);
    max-width: min(100%, 560px);
    margin: 0 auto;
  }

  .hero-img {
    max-height: min(55vh, 520px);
  }

  .nav-links {
    gap: 14px;
    flex-wrap: wrap;
  }

  .performance-content {
    grid-template-columns: 1fr;
    gap: 32px;
    margin-top: 26px;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-links {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 480px) {
  .nav-container {
    height: auto;
    padding: 12px 20px;
  }

  .nav-links {
    justify-content: center;
  }

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

  .hero-subtitle {
    font-size: 1.05rem;
    margin-bottom: 30px;
  }

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

  .btn {
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }

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

  .link-button {
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }

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

/* ═══════════════════════════════════════════════════════════
   NEW SECTIONS  (Abstract · Method · Visualizations · Results)
═══════════════════════════════════════════════════════════ */

.btn-outline {
  background: transparent;
  color: #334155;
  border: 2px solid #cbd5e1;
  border-radius: 999px;
  padding: 12px 24px;
  font-weight: 650;
  text-decoration: none;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-outline:hover {
  border-color: #667eea;
  color: #667eea;
  transform: translateY(-2px);
}

/* ── Abstract ── */
.abstract-section {
  padding: 40px 0 60px;
  background: #f8fafc;
}
.abstract-box {
  max-width: 100%;
  margin: 0 auto;
  background: white;
  border-left: 4px solid #667eea;
  border-radius: 0 14px 14px 0;
  padding: 28px 32px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  position: relative;
}
.abstract-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #667eea;
  margin-bottom: 12px;
}
.abstract-box p {
  margin: 0;
  color: #475569;
  line-height: 1.8;
  font-size: 0.97rem;
}

/* ── Method ── */
.method-section {
  padding: 80px 0;
  background: white;
}

.framework-figure {
  margin: 48px 0 64px;
  text-align: center;
}
.framework-figure img {
  width: 100%;
  max-width: 100%;
  max-height: none;
  height: auto;
  object-fit: contain;
  object-position: center;
  border-radius: 14px;
  border: 1px solid rgba(15,23,42,0.07);
  box-shadow: 0 10px 40px rgba(0,0,0,0.08);
}
.fig-caption {
  margin-top: 16px;
  font-size: 0.88rem;
  color: #64748b;
  line-height: 1.65;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

/* Pipeline steps */
.pipeline {
  display: flex;
  gap: 0;
  align-items: stretch;
}
.pipeline-arrow {
  display: flex;
  align-items: center;
  font-size: 1.8rem;
  color: #94a3b8;
  padding: 0 10px;
  flex-shrink: 0;
}
.pipeline-step {
  flex: 1;
  border: 1px solid rgba(15,23,42,0.09);
  border-radius: 16px;
  padding: 28px 24px;
  background: #f8fafc;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.pipeline-step:hover {
  box-shadow: 0 10px 35px rgba(0,0,0,0.1);
  transform: translateY(-4px);
}
.pipeline-step--highlight {
  background: linear-gradient(135deg, #f0f4ff 0%, #e8f5ff 100%);
  border-color: rgba(102,126,234,0.3);
}
.step-badge {
  display: inline-block;
  background: #667eea;
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.step-badge--green {
  background: #10b981;
}
.pipeline-step h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 12px;
  line-height: 1.3;
}
.pipeline-step p {
  color: #64748b;
  font-size: 0.92rem;
  line-height: 1.7;
  margin: 0 0 16px;
}
.step-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.step-tags span {
  font-size: 0.75rem;
  background: rgba(102,126,234,0.1);
  color: #4f46e5;
  border: 1px solid rgba(102,126,234,0.25);
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 550;
}

/* ── Visualizations ── */
.viz-section {
  padding: 80px 0;
  background: #f8fafc;
}

.viz-tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 42px;
  flex-wrap: wrap;
}
.viz-tab {
  padding: 10px 22px;
  background: white;
  border: 1.5px solid #e2e8f0;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
}
.viz-tab.active {
  background: #667eea;
  color: white;
  border-color: #667eea;
}
.viz-tab:hover:not(.active) {
  border-color: #667eea;
  color: #667eea;
}

.viz-panel {
  display: none;
}
.viz-panel.active {
  display: block;
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.viz-desc {
  max-width: 780px;
  margin: 0 auto 36px;
  color: #475569;
  line-height: 1.75;
  font-size: 0.95rem;
  text-align: center;
}

.viz-img-wrap {
  background: white;
  border-radius: 16px;
  border: 1px solid rgba(15,23,42,0.07);
  box-shadow: 0 6px 28px rgba(0,0,0,0.07);
  padding: 0;
  margin-bottom: 24px;
  overflow: hidden;
  display: block;
  width: 100%;
}
.viz-img-wrap img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 16px;
}

.viz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.viz-grid .viz-img-wrap {
  margin-bottom: 0;
  max-height: min(72vh, 560px);
}
.viz-grid .viz-img-wrap img {
  max-height: min(64vh, 500px);
}

/* ── Results ── */
.results-section {
  padding: 80px 0;
  background: white;
}
.results-table-wrap {
  overflow-x: auto;
  margin: 48px 0 28px;
  border-radius: 16px;
  border: 1px solid rgba(15,23,42,0.08);
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}
.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.results-table thead tr {
  background: #f1f5f9;
}
.results-table th {
  padding: 14px 20px;
  font-weight: 700;
  color: #0f172a;
  text-align: center;
  white-space: nowrap;
}
.results-table th:first-child {
  text-align: left;
}
.results-table td {
  padding: 13px 20px;
  color: #334155;
  text-align: center;
  border-top: 1px solid #f1f5f9;
}
.results-table td:first-child {
  text-align: left;
  font-weight: 600;
  color: #0f172a;
}
.results-table tbody tr:hover {
  background: #fafbfc;
}
.col-ours {
  background: rgba(102,126,234,0.07);
  color: #4f46e5 !important;
}
.col-gain {
  color: #10b981 !important;
  font-weight: 700;
}
.results-note {
  text-align: center;
  color: #64748b;
  font-size: 0.9rem;
}
.results-note a {
  color: #667eea;
  text-decoration: none;
  font-weight: 600;
}
.results-note a:hover {
  text-decoration: underline;
}

/* ── Responsive additions ── */
@media (max-width: 920px) {
  .pipeline {
    flex-direction: column;
  }
  .pipeline-arrow {
    justify-content: center;
    transform: rotate(90deg);
    padding: 4px 0;
  }
  .abstract-box {
    padding: 22px 20px;
  }
}

@media (max-width: 480px) {
  .framework-figure img {
    border-radius: 8px;
  }
  .viz-tabs {
    gap: 6px;
  }
  .viz-tab {
    padding: 8px 16px;
    font-size: 0.85rem;
  }
}

/* ── Inference Carousel ── */
.carousel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.carousel-track-wrap {
  width: 100%;
  overflow: hidden;
  border-radius: 16px;
  transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-track {
  display: flex;
  align-items: flex-start;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.carousel-slide {
  flex: 0 0 100%;
  width: 100%;
  margin-bottom: 0;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: white;
  border: 1.5px solid #e2e8f0;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 1.5rem;
  line-height: 1;
  color: #334155;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  z-index: 10;
}

.carousel-btn:hover {
  background: #667eea;
  color: white;
  border-color: #667eea;
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.35);
}

.carousel-prev {
  left: -22px;
}

.carousel-next {
  right: -22px;
}

.carousel-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cbd5e1;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.carousel-dot.active {
  background: #667eea;
  transform: scale(1.3);
}

@media (max-width: 600px) {
  .carousel-prev { left: -10px; }
  .carousel-next { right: -10px; }
  .carousel-btn { width: 36px; height: 36px; font-size: 1.2rem; }
}

/* responsive: cap hero-img on small screens */
@media (max-width: 920px) {
  .hero-demo-container {
    max-width: min(100%, 660px);
  }
  .hero-img {
    max-height: min(70vh, 680px);
  }
}
