/* G-Skill Project Page — Unified with Paper 5-Hue x 3-Level + Neutral Slate Palette */
:root {
  /* Neutral Slate */
  --bg: #ffffff;
  --surface: #fafbfd;
  --surface-alt: #f8fafc;
  --border: #cbd5e1;
  --border-soft: #e2e8f0;
  --muted: #64748b;
  --text-sub: #475569;
  --text: #1e293b;

  /* 5 Paper Hues x 3 Levels */
  --blue-tint: #eff6ff;
  --blue: #2e87ee;
  --blue-deep: #1d4ed8;

  --orange-tint: #fff3e8;
  --orange: #f56301;
  --orange-deep: #9a3412;

  --purple-tint: #f5eeff;
  --purple: #6801ca;
  --purple-deep: #581c87;

  --teal-tint: #ecfdf5;
  --teal: #0d9488;
  --teal-deep: #065f46;

  --red-tint: #fef2f2;
  --red: #f87171;
  --red-deep: #b91c1c;

  /* Typography */
  --font-display: "Fredoka", "Comic Neue", "Comic Sans MS", system-ui, sans-serif;
  --font-serif: "Newsreader", "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius: 14px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 8px 28px rgba(15, 23, 42, 0.06);
}

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

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0.75rem;
  z-index: 100;
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  background: var(--purple-deep);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  left: 0.75rem;
}

:where(a, button, [role="button"], input[type="range"]):focus:not(:focus-visible) {
  outline: none;
}

:where(a, button, [role="button"], input[type="range"]):focus-visible {
  outline: 2.5px solid var(--purple);
  outline-offset: 2px;
}

#svg-framework .stage-group:focus,
#svg-framework .stage-group:focus-visible {
  outline: none;
}

/* Top Sticky Navigation */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
}

.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.7rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.brand-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  box-shadow: 0 0 0 3px var(--purple-tint);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.35rem;
  flex-wrap: wrap;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-sub);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.25rem 0.55rem;
  border-radius: 7px;
  transition: color 0.18s ease, background 0.18s ease;
}

.nav-links a:hover {
  color: var(--purple);
  background: var(--purple-tint);
}

.nav-links a.active {
  color: var(--purple-deep);
  background: var(--purple-tint);
  font-weight: 600;
}

/* Container & Editorial Layout */
.container {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Hero Section */
.hero {
  position: relative;
  overflow: hidden;
  padding: 3.4rem 0 2.9rem;
  background:
    radial-gradient(circle at 14% 16%, rgba(46, 135, 238, 0.10), transparent 42%),
    radial-gradient(circle at 86% 14%, rgba(104, 1, 202, 0.10), transparent 44%),
    radial-gradient(circle at 52% 92%, rgba(13, 148, 136, 0.07), transparent 40%),
    linear-gradient(180deg, #f8fafd 0%, #ffffff 100%);
  border-bottom: 1px solid var(--border-soft);
}

.hero-grid-bg {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(148, 163, 184, 0.24) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 86%);
  pointer-events: none;
}

.hero-ambient-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.9;
}

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

.hero h1 {
  margin: 0 auto 0.95rem;
  max-width: 880px;
  font-family: var(--font-display);
  font-size: clamp(2.05rem, 4.2vw, 3.1rem);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.022em;
  color: var(--text);
}

.hero h1 .accent {
  background: linear-gradient(92deg, var(--blue-deep) 0%, var(--purple) 52%, var(--orange) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-subtitle {
  margin: 0 auto 1.35rem;
  max-width: 720px;
  font-family: var(--font-serif);
  font-size: 1.14rem;
  color: var(--text-sub);
  line-height: 1.56;
}

/* Authors & Affiliations */
.authors-block {
  margin: 0 auto 1.45rem;
  max-width: 860px;
}

.authors {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  margin-bottom: 0.6rem;
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--text);
  font-weight: 500;
}

.author-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.15rem 0.65rem;
}

.authors sup {
  color: var(--purple);
  font-weight: 700;
  font-size: 0.7em;
  margin-left: 1.5px;
}

.affiliations {
  display: flex;
  flex-direction: column;
  gap: 0.16rem;
  margin-bottom: 0.5rem;
  font-size: 0.83rem;
  color: var(--muted);
  line-height: 1.5;
}

.affil-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.1rem 0.35rem;
}

.affil-gap {
  display: inline-block;
  width: 1.1rem;
}

.author-notes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.15rem 1.25rem;
  font-size: 0.76rem;
  color: var(--muted);
}

/* Institution Logos Strip */
.logo-strip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1.65rem;
  flex-wrap: wrap;
  padding: 0.62rem 1.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-soft);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
  margin-bottom: 1.35rem;
}

.logo-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-sub);
  font-size: 0.83rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.18s ease, transform 0.18s ease;
}

.logo-item:hover {
  color: var(--purple);
  transform: translateY(-1px);
}

.logo-item img {
  height: 29px;
  width: auto;
  display: block;
  object-fit: contain;
}

.logo-item.deeplit img {
  height: 26px;
}

.logo-item.unisound img {
  height: 27px;
}

.logo-sep {
  width: 1px;
  height: 20px;
  background: var(--border-soft);
}

/* Action Buttons */
.cta-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-bottom: 2.1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 42px;
  padding: 0.62rem 1.25rem;
  border-radius: 11px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
  cursor: pointer;
}

.btn-icon {
  height: 19px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.btn:hover {
  transform: translateY(-1.5px);
  box-shadow: var(--shadow-md);
  border-color: var(--purple);
}

.btn-compact {
  min-height: 32px;
  padding: 0.34rem 0.76rem;
  font-size: 0.8rem;
  border-radius: 8px;
}

/* KPI Highlights */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.95rem;
  text-align: left;
}

.kpi-card {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1rem 1.15rem 1.05rem;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3.5px;
}

.kpi-card.purple::before { background: var(--purple); }
.kpi-card.blue::before { background: var(--blue); }
.kpi-card.teal::before { background: var(--teal); }
.kpi-card.orange::before { background: var(--orange); }

.kpi-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.kpi-num {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  font-size: 1.95rem;
  font-weight: 700;
  line-height: 1.12;
  margin-bottom: 0.25rem;
}

.kpi-card.purple .kpi-num { color: var(--purple); }
.kpi-card.blue .kpi-num { color: var(--blue-deep); }
.kpi-card.teal .kpi-num { color: var(--teal-deep); }
.kpi-card.orange .kpi-num { color: var(--orange-deep); }

.kpi-label {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.2rem;
}

.kpi-sub {
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.42;
}

/* Sections */
section {
  padding: 3.1rem 0;
  border-bottom: 1px solid var(--border-soft);
}

section[id] {
  scroll-margin-top: 66px;
}

section.hero {
  padding: 3.4rem 0 2.9rem;
}

section:last-of-type {
  border-bottom: none;
}

.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--purple);
  margin-bottom: 0.45rem;
}

.section-title {
  margin: 0 0 0.7rem;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2.5vw, 1.95rem);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.015em;
}

.section-lead {
  margin: 0 0 1.65rem;
  font-family: var(--font-serif);
  font-size: 1.07rem;
  color: var(--text-sub);
  max-width: 820px;
}

/* Figure Cards (Paper-matched aesthetic) */
.fig-card {
  background: var(--surface);
  border: 1.25px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-md);
  max-width: 100%;
  min-width: 0;
}

.fig-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--border-soft);
  min-width: 0;
}

.fig-title-inline {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.live-dot {
  width: 8px;
  height: 8px;
  min-width: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 0 rgba(13, 148, 136, 0.55);
  animation: livePulse 1.8s infinite;
}

.live-dot.paused {
  animation: none;
  background: var(--muted);
  box-shadow: none;
}

@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(13, 148, 136, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(13, 148, 136, 0); }
  100% { box-shadow: 0 0 0 0 rgba(13, 148, 136, 0); }
}

.seg-group {
  display: inline-flex;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 2px;
  gap: 2px;
  flex-wrap: wrap;
}

.seg-btn {
  border: none;
  background: transparent;
  color: var(--text-sub);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.36rem 0.72rem;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

.seg-btn:hover {
  color: var(--text);
  background: var(--surface-alt);
}

.seg-btn.active {
  background: var(--purple);
  color: #fff;
}

.seg-btn.active.blue { background: var(--blue); }
.seg-btn.active.orange { background: var(--orange); }
.seg-btn.active.teal { background: var(--teal); }
.seg-btn.active.red { background: var(--red-deep); }

.fig-caption {
  margin: 0.95rem 0 0;
  font-family: var(--font-serif);
  font-size: 0.93rem;
  color: var(--text-sub);
  line-height: 1.55;
}

.fig-caption strong {
  color: var(--text);
}

.svg-stage {
  width: 100%;
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  overflow: hidden;
}

.svg-stage svg {
  display: block;
  width: 100%;
  height: auto;
}

/* SVG Typography & Animation Helpers */
.svg-display { font-family: var(--font-display); font-weight: 700; }
.svg-serif { font-family: var(--font-serif); }
.svg-mono { font-family: var(--font-mono); }

.stage-group {
  transition: opacity 0.3s ease, filter 0.3s ease;
}

.stage-group.dimmed {
  opacity: 0.22;
}

.fw-conn-item.dimmed {
  opacity: 0.08 !important;
}

#fw-legend {
  transition: opacity 0.3s ease;
}

#fw-legend.dimmed {
  opacity: 0.45;
}

/* Interactive Motivation Side Cards */
.mot-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: center;
}

.mot-cards {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.mot-card {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-left: 4px solid var(--purple);
  border-radius: 10px;
  padding: 0.95rem 1.05rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.25s ease, border-color 0.2s ease;
}

.mot-card:hover {
  transform: translateX(2px);
  box-shadow: var(--shadow-md);
}

.mot-card.active-focus {
  box-shadow: 0 6px 20px rgba(104, 1, 202, 0.13);
  transform: translateX(3px);
}

.mot-card.dimmed {
  opacity: 0.42;
}

.mot-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.mot-card-title {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text);
}

.mot-card-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.14rem 0.5rem;
  border-radius: 999px;
}

.mot-card-body {
  font-size: 0.82rem;
  color: var(--text-sub);
  line-height: 1.5;
  margin: 0;
}

.stage-narrative {
  margin-top: 0.85rem;
  padding: 0.78rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.stage-narrative-text {
  font-size: 0.88rem;
  color: var(--text);
}

.stage-tag {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.78rem;
  padding: 0.16rem 0.58rem;
  border-radius: 6px;
  margin-right: 0.45rem;
}

/* Two-Column Grid */
.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  align-items: start;
}

.two-col > *,
.mot-layout > *,
.mech-grid > *,
.kpi-grid > * {
  min-width: 0;
  max-width: 100%;
}

.pct-hint-bar {
  margin-top: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  background: #fff;
  padding: 0.5rem 0.85rem;
  border-radius: 9px;
  border: 1px solid var(--border-soft);
  font-size: 0.8rem;
  color: var(--text-sub);
  line-height: 1.4;
}

.pct-slider-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-sub);
  white-space: nowrap;
}

.pct-slider {
  flex: 1 1 auto;
  min-width: 90px;
  accent-color: var(--purple);
  cursor: pointer;
  margin: 0;
}

.pct-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  margin-top: 0.6rem;
}

.pct-cards-grid > * {
  min-width: 0;
}

/* Results Bar Chart */
.chart-wrap {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 1.15rem 1.25rem;
  max-width: 100%;
  min-width: 0;
}

.bar-row {
  display: grid;
  grid-template-columns: 175px minmax(0, 1fr) 98px;
  align-items: center;
  gap: 0.85rem;
  padding: 0.48rem 0;
  border-bottom: 1px dashed #eef2f7;
}

.bar-row:last-child {
  border-bottom: none;
}

.bar-row.group-header {
  grid-template-columns: minmax(0, 1fr);
  padding: 0.65rem 0 0.25rem;
  border-bottom: 1px solid var(--border-soft);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.bar-name {
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-sub);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.bar-name.ours {
  font-weight: 700;
  color: var(--purple-deep);
}

.bar-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.bar-track {
  position: relative;
  height: 24px;
  background: #f1f5f9;
  border-radius: 7px;
  overflow: visible;
}

.bar-fill {
  height: 100%;
  border-radius: 7px;
  transition: width 0.65s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
}

.bar-whisker {
  position: absolute;
  top: 50%;
  height: 2px;
  background: #1e293b;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.8);
  transform: translateY(-50%);
  pointer-events: none;
  transition: left 0.65s cubic-bezier(0.22, 1, 0.36, 1), width 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.bar-whisker::before,
.bar-whisker::after {
  content: "";
  position: absolute;
  top: -4px;
  width: 2px;
  height: 10px;
  background: #1e293b;
  box-shadow: 0 0 0 0.8px rgba(255, 255, 255, 0.75);
}

.bar-whisker::before { left: 0; }
.bar-whisker::after { right: 0; }

.bar-val {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  text-align: right;
  color: var(--text);
  white-space: nowrap;
}

.bar-val .sd {
  font-size: 0.72rem;
  color: var(--muted);
}

.bar-val.ours {
  font-weight: 700;
  color: var(--purple-deep);
}

/* Aligned multi-bar subtask rows (desktop & mobile) */
.bar-row.subtask-row {
  grid-template-columns: 110px minmax(0, 1fr);
  align-items: center;
}

.subtask-bars {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.subtask-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: center;
  gap: 0.5rem;
}

.subtask-item .bar-track {
  height: 11px;
}

.subtask-num {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  text-align: right;
  line-height: 1.1;
  white-space: nowrap;
}

.subtask-legend {
  margin-top: 0.7rem;
  font-size: 0.78rem;
  color: var(--muted);
  display: flex;
  gap: 0.55rem 1rem;
  flex-wrap: wrap;
}

.subtask-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* Tables */
.data-table-wrap {
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  margin-top: 1rem;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
}

table.data-table th,
table.data-table td {
  padding: 0.56rem 0.7rem;
  text-align: right;
  border-bottom: 1px solid #eef2f7;
  white-space: nowrap;
}

table.data-table th:first-child,
table.data-table td:first-child {
  text-align: left;
  position: sticky;
  left: 0;
  z-index: 1;
  background: #fff;
  box-shadow: 1px 0 0 #eef2f7;
}

table.data-table thead th {
  background: var(--surface-alt);
  color: var(--text);
  font-weight: 700;
  border-bottom: 1.5px solid var(--border);
}

table.data-table thead th:first-child {
  z-index: 2;
  background: var(--surface-alt);
  box-shadow: 1px 0 0 var(--border-soft);
}

table.data-table tbody tr:not(.subhead):hover td {
  background: #f8fafc;
}

table.data-table tr.ours-row:hover td {
  background: #efe2ff;
}

table.data-table.text-table th,
table.data-table.text-table td {
  text-align: left;
}

table.data-table tr.ours-row td {
  background: var(--purple-tint);
  color: var(--purple-deep);
  font-weight: 600;
}

table.data-table tr.subhead td {
  background: #f1f5f9;
  font-weight: 700;
  color: var(--text-sub);
  font-size: 0.78rem;
  text-align: left;
  position: static;
  box-shadow: none;
}

/* Attribute Match Case Table (Table 3) */
.attr-chip {
  display: inline-block;
  padding: 0.14rem 0.5rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
}

.attr-chip.match {
  background: var(--teal-tint);
  color: var(--teal-deep);
  border: 1px solid rgba(13, 148, 136, 0.35);
}

.attr-chip.miss {
  background: var(--surface-alt);
  color: var(--muted);
  border: 1px solid var(--border-soft);
}

/* Evolution Mechanism Bars */
.mech-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.mech-card {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 0.95rem 1.05rem;
  min-width: 0;
  max-width: 100%;
}

.mech-card.ec-clickable {
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease, opacity 0.22s ease, border-color 0.22s ease;
}

.mech-card.ec-clickable:hover {
  transform: translateX(3px);
  box-shadow: var(--shadow-md);
}

.mech-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  margin-bottom: 0.45rem;
  gap: 0.25rem 0.65rem;
}

.mech-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text);
}

.mech-stat {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.mech-bar {
  height: 10px;
  border-radius: 999px;
  background: #eef2f7;
  overflow: hidden;
  margin-bottom: 0.4rem;
}

.mech-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.mech-bar-fill.nonzero {
  min-width: 5px;
}

.mech-desc {
  font-size: 0.77rem;
  color: var(--muted);
  line-height: 1.42;
}

.mobile-scroll-hint {
  display: none;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 0.45rem;
  text-align: right;
}

/* Citation Block (non-overlapping header + horizontal scroll body) */
.citation-wrap {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.citation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.95rem;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.citation-lang {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #94a3b8;
}

.citation-box {
  padding: 1rem 1.25rem 1.15rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.6;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.citation-box pre {
  margin: 0;
}

.copy-bib-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 7px;
  padding: 0.28rem 0.72rem;
  font-size: 0.75rem;
  font-family: var(--font-sans);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.copy-bib-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Fullscreen Lightbox Modal (Figure 2) */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-card {
  width: min(1440px, 96vw);
  max-height: 92vh;
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border-soft);
}

.lightbox-title {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text);
}

.lightbox-body {
  padding: 0.9rem;
  overflow: auto;
  background: #fff;
}

.lightbox-body svg {
  display: block;
  width: 100%;
  height: auto;
  min-width: 920px;
}

/* Interactive Figure 4 — Shared-PCA 3-Panel Scatter */
.pca-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.45rem 1rem;
  margin-bottom: 0.75rem;
  padding: 0.45rem 0.75rem;
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 9px;
}

.pca-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem 1rem;
  font-size: 0.78rem;
  color: var(--text-sub);
  font-weight: 500;
}

.pca-leg-item {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
}

.pca-dot-sample {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #94a3b8;
  display: inline-block;
}

.pca-diamond-sample {
  width: 8px;
  height: 8px;
  border: 1.6px solid #1e293b;
  transform: rotate(45deg);
  display: inline-block;
  background: transparent;
}

.pca-tether-sample {
  width: 16px;
  height: 0;
  border-top: 2px dashed var(--purple);
  display: inline-block;
}

.pca-axes-label {
  font-size: 0.75rem;
  color: var(--muted);
}

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

.pca-panel {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 0.65rem 0.7rem 0.7rem;
  min-width: 0;
  max-width: 100%;
}

.pca-panel.ours {
  border-color: rgba(104, 1, 202, 0.32);
  box-shadow: 0 3px 14px rgba(104, 1, 202, 0.06);
}

.pca-panel-head {
  text-align: center;
  margin-bottom: 0.45rem;
}

.pca-panel-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
}

.pca-panel-sub {
  font-family: var(--font-serif);
  font-size: 0.78rem;
  color: var(--text-sub);
}

.pca-canvas-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1.48 / 1;
  background: #fcfdff;
  border: 1px solid #d7e0eb;
  border-radius: 7px;
  overflow: hidden;
}

.pca-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: pan-y;
}

.pca-inspector {
  margin-top: 0.85rem;
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
}

.pca-test-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.4rem 0.65rem;
  margin-bottom: 0.5rem;
}

.pca-test-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pca-test-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.14rem 0.48rem;
  flex-shrink: 0;
}

.pca-test-tag.pinned {
  color: var(--purple-deep);
  background: var(--purple-tint);
  border-color: rgba(104, 1, 202, 0.35);
}

.pca-test-counter {
  font-size: 0.72rem;
  color: var(--muted);
}

.pca-ctrl-group {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.pca-ctrl-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-sub);
  font-family: var(--font-sans);
  font-size: 0.73rem;
  font-weight: 600;
  padding: 0.22rem 0.54rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.pca-ctrl-btn:hover {
  color: var(--text);
  background: var(--surface-alt);
  border-color: var(--purple);
}

.pca-ctrl-btn.active {
  background: var(--purple);
  color: #fff;
  border-color: var(--purple);
}

.pca-test-text {
  font-family: var(--font-serif);
  font-size: 0.86rem;
  color: var(--text);
  line-height: 1.45;
  min-width: 0;
  word-break: break-word;
  margin-bottom: 0.65rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px dashed var(--border-soft);
}

.pca-nn-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.pca-nn-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-top: 3px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  min-width: 0;
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.pca-nn-card:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.pca-nn-card.ours {
  background: var(--purple-tint);
  border-color: rgba(104, 1, 202, 0.25);
}

.pca-nn-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.3rem;
}

.pca-nn-name {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
}

.pca-nn-sim {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.08rem 0.4rem;
  border-radius: 5px;
  background: #fff;
  border: 1px solid var(--border-soft);
}

.pca-nn-text {
  font-size: 0.75rem;
  color: var(--text-sub);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.pca-nn-card.expanded .pca-nn-text {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}

/* Touch-friendly quantile plot */
#svg-quantile {
  touch-action: pan-y;
}

/* Footer */
footer {
  background: var(--surface);
  border-top: 1px solid var(--border-soft);
  padding: 2.1rem 0 2.2rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

footer .logo-strip {
  margin-bottom: 1.05rem;
}

/* Responsive — Tablet & Mobile */
@media (max-width: 960px) {
  .hero-ambient-svg { display: none; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col, .mech-grid, .mot-layout, .pca-grid, .pca-nn-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 720px) {
  .topbar-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
    padding: 0.55rem 0.9rem;
  }
  .brand { justify-content: center; }
  .nav-links {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0.35rem;
    padding-bottom: 2px;
    justify-content: flex-start;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a {
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 0.82rem;
    padding: 0.28rem 0.62rem;
    background: var(--surface-alt);
    border: 1px solid var(--border-soft);
  }
  .nav-links a.active {
    background: var(--purple-tint);
    border-color: rgba(104, 1, 202, 0.28);
  }

  .container { padding: 0 0.9rem; }
  section { padding: 2.2rem 0; }
  section[id] { scroll-margin-top: 96px; }
  section.hero { padding: 2.2rem 0 2.0rem; }

  .hero h1 { font-size: clamp(1.65rem, 6.2vw, 2.3rem); }
  .hero-subtitle { font-size: 0.98rem; margin-bottom: 1.1rem; }
  .authors { font-size: 0.88rem; }
  .affiliations { font-size: 0.76rem; }
  .affil-gap { display: none; }
  .affil-row { gap: 0.12rem 0.55rem; }

  .logo-strip {
    gap: 0.8rem 1.05rem;
    padding: 0.55rem 0.95rem;
    border-radius: 16px;
  }
  .logo-sep { display: none; }
  .logo-item img { height: 23px; }
  .logo-item.deeplit img { height: 21px; }
  .logo-item.unisound img { height: 22px; }
  .logo-item span { font-size: 0.77rem; }

  .fig-card { padding: 0.85rem; border-radius: 12px; }
  .fig-toolbar { gap: 0.6rem; flex-direction: column; align-items: stretch; }
  .fig-title-inline { font-size: 0.94rem; line-height: 1.35; }
  .seg-group { width: 100%; max-width: 100%; }
  .seg-btn { flex: 1 1 auto; text-align: center; font-size: 0.75rem; padding: 0.36rem 0.52rem; }
  #res-sub-controls { width: 100%; flex-direction: column; }

  /* Pan-able wide diagrams contained strictly inside .fig-card */
  .mobile-scroll-hint { display: block; }
  .svg-stage { max-width: 100%; }
  .svg-stage.scroll-x {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .fw-stage-wrap svg { width: 780px; min-width: 780px; }
  .ov-stage-wrap svg { width: 640px; min-width: 640px; }

  .pct-hint-bar { font-size: 0.74rem; padding: 0.45rem 0.7rem; }
  .pct-cards-grid { gap: 0.4rem; }

  /* Readable stacked result bars on phones */
  .chart-wrap { padding: 0.8rem 0.85rem; }
  .bar-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "name val"
      "track track";
    gap: 0.3rem 0.5rem;
    padding: 0.55rem 0;
  }
  .bar-name { grid-area: name; font-size: 0.82rem; }
  .bar-val { grid-area: val; font-size: 0.8rem; }
  .bar-row > .bar-track,
  .bar-row > div:nth-child(2) { grid-area: track; }
  .bar-row.subtask-row {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "name"
      "track";
  }
  .bar-row.group-header {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "name";
  }

  .data-table-wrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table.data-table th, table.data-table td { padding: 0.46rem 0.52rem; font-size: 0.76rem; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: minmax(0, 1fr); gap: 0.75rem; }
  .cta-row { gap: 0.6rem; }
  .cta-row .btn { flex: 1 1 auto; min-width: 132px; padding: 0.58rem 0.85rem; font-size: 0.85rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .live-dot { animation: none !important; }
  .bar-fill, .bar-whisker, .mech-bar-fill { transition: none !important; }
}
