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

:root {
  --color-bg: #ffffff;
  --color-bg-alt: #f7f8fa;
  --color-text: #1a1a2e;
  --color-text-secondary: #555770;
  --color-accent: #2563eb;
  --color-accent-hover: #1d4ed8;
  --color-accent-light: #dbeafe;
  --color-border: #e2e4e9;
  --color-gain: #16a34a;
  --color-loss: #dc2626;
  --color-code-bg: #f1f3f5;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Source Serif 4', 'Georgia', serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --max-width: 960px;
  --nav-height: 56px;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 16px);
  overflow-x: hidden;
}

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

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.15s;
}

a:hover {
  color: var(--color-accent-hover);
}

img {
  max-width: 100%;
  display: block;
}

/* ===== Layout ===== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 80px 0;
}

.section-alt {
  background: var(--color-bg-alt);
}

.section-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 40px;
  text-align: center;
  color: var(--color-text);
}

.subsection {
  margin-bottom: 56px;
}

.subsection:last-child {
  margin-bottom: 0;
}

.subsection-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--color-text);
}

/* ===== Scroll Reveal ===== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Navigation ===== */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  z-index: 1000;
  transition: box-shadow 0.2s;
}

#navbar.scrolled {
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  height: 100%;
  gap: 32px;
}

.nav-logo {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-text);
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-logo:hover {
  color: var(--color-accent);
}

.nav-links {
  display: flex;
  gap: 24px;
  margin-left: auto;
}

.nav-links a {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  white-space: nowrap;
  position: relative;
  padding: 4px 0;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--color-accent);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-accent);
  border-radius: 1px;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-left: auto;
  flex-direction: column;
  gap: 4px;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-text);
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
}

/* ===== Hero ===== */
.hero-section {
  padding-top: calc(var(--nav-height) + 80px);
  padding-bottom: 80px;
  text-align: center;
  background: linear-gradient(180deg, var(--color-bg) 0%, var(--color-bg-alt) 100%);
}

.hero-title {
  font-family: var(--font-serif);
  font-size: 3.2rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 20px;
  color: var(--color-text);
}

.hero-tagline {
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
  max-width: 680px;
  margin: 0 auto 28px;
}

.hero-logos {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 40px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.hero-logo {
  height: 40px;
  width: auto;
  opacity: 0.85;
  transition: opacity 0.15s;
}

.hero-logo:hover {
  opacity: 1;
}

.hero-logo-tall {
  height: 52px;
}

.hero-logo-wide {
  height: 44px;
}

.hero-diagram {
  margin: 36px auto 28px;
  max-width: 780px;
  text-align: center;
}

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

.hero-bullets {
  list-style: disc;
  max-width: 620px;
  margin: 0 auto 32px;
  padding-left: 24px;
  text-align: left;
}

.hero-bullets li {
  font-size: 1.05rem;
  color: var(--color-text);
  line-height: 1.6;
  margin-bottom: 6px;
}

.hero-authors {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 16px;
  font-size: 0.95rem;
}

.hero-authors .author a {
  color: var(--color-text);
  font-weight: 500;
}

.hero-authors .author a:hover {
  color: var(--color-accent);
}

.hero-authors sup {
  font-size: 0.7em;
  color: var(--color-text-secondary);
}

.hero-affiliations {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 20px;
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  margin-bottom: 32px;
}

.hero-affiliations sup {
  font-size: 0.75em;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-sans);
  border-radius: 8px;
  border: 2px solid var(--color-accent);
  background: var(--color-accent);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.btn:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
  color: #fff;
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--color-accent);
}

.btn-outline:hover {
  background: var(--color-accent);
  color: #fff;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.82rem;
  border-radius: 6px;
}

.btn svg {
  flex-shrink: 0;
}

/* ===== Overview ===== */
.overview-text {
  max-width: 760px;
  margin: 0 auto 48px;
  font-size: 1.05rem;
}

.overview-text p {
  margin-bottom: 16px;
}

.overview-text p:last-child {
  margin-bottom: 0;
}

/* Stat Cards */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.stat-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 28px 20px;
  text-align: center;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  border-color: var(--color-accent-light);
}

.stat-number {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--color-accent);
  line-height: 1.1;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 0.88rem;
  color: var(--color-text-secondary);
  line-height: 1.45;
}

/* ===== Paper Cards ===== */
.paper-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 100%;
  overflow: hidden;
}

.paper-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 32px 28px;
  overflow: hidden;
  min-width: 0;
}

.paper-venue {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

.paper-title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 12px;
  color: var(--color-text);
}

.paper-teaser {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: #fff;
  margin-bottom: 16px;
}

.paper-authors {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
  line-height: 1.6;
}

.paper-note {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  font-style: italic;
  margin-bottom: 14px;
}

.paper-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.talk-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 760px;
  margin: 0 auto;
  padding: 22px 24px;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.06);
}

.talk-card h3 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  line-height: 1.35;
  margin-bottom: 6px;
}

.talk-card p {
  color: var(--color-text-secondary);
  font-size: 0.92rem;
  line-height: 1.55;
  max-width: 620px;
}

.bibtex-block {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, margin 0.35s ease;
  margin-top: 0;
}

.bibtex-block.open {
  max-height: 300px;
  margin-top: 16px;
}

.bibtex-block pre {
  background: var(--color-code-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--color-text);
}

/* ===== Method ===== */
.method-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 24px 0 32px;
}

.method-card {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 24px 20px;
}

.method-card-img {
  width: 100%;
  border-radius: 6px;
  margin-bottom: 14px;
}

.method-card h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--color-text);
}

.method-card p {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
  line-height: 1.55;
}

.method-card p:last-of-type {
  margin-bottom: 0;
}

/* Pipeline diagram */
.pipeline-diagram {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0;
  margin: 32px 0;
}

.pipeline-stage {
  flex: 1;
  max-width: 380px;
  border-radius: 12px;
  padding: 28px 24px;
  text-align: center;
}

.stage-procedural {
  background: linear-gradient(135deg, #ede9fe 0%, #dbeafe 100%);
  border: 1px solid #c4b5fd;
}

.stage-standard {
  background: linear-gradient(135deg, #dbeafe 0%, #d1fae5 100%);
  border: 1px solid #93c5fd;
}

.stage-label {
  font-weight: 700;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 14px;
  color: var(--color-text);
}

.stage-content p {
  font-size: 0.88rem;
  color: var(--color-text-secondary);
  margin-top: 12px;
}

.stage-icon .bracket-anim {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--color-accent);
  display: block;
  letter-spacing: 0.1em;
}

.stage-icon-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.stage-domain {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 4px 14px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 20px;
  color: var(--color-text);
}

.pipeline-arrow {
  display: flex;
  align-items: center;
  padding: 0 12px;
  color: var(--color-text-secondary);
}

.pipeline-details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 8px;
}

.pipeline-detail {
  padding: 20px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-bg);
}

.pipeline-detail h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 8px;
}

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

/* Settings cards */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.setting-card {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 24px 20px;
}

.setting-card h4 {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 8px;
}

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

/* ===== Figures ===== */
.figure {
  margin: 28px 0;
}

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

.llm-charts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-top: 24px;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.llm-chart-panel h4 {
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 10px;
}

.chart-metric-sub {
  font-weight: 400;
  font-size: 0.82rem;
  color: var(--color-text-secondary);
}

.chart-ylabel {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  text-align: center;
  margin-top: 4px;
}

.line-chart-sm {
  max-width: 100%;
}

@media (max-width: 768px) {
  .llm-charts-grid {
    max-width: 100%;
  }
}

.line-chart-wrap {
  max-width: 640px;
  margin: 0 auto;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  position: relative;
  cursor: crosshair;
}

.line-chart-wrap canvas {
  width: 100%;
  height: auto;
  display: block;
}

.lc-tooltip {
  display: none;
  position: absolute;
  background: rgba(255,255,255,0.95);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--color-text);
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  z-index: 10;
  white-space: nowrap;
}

.lc-tooltip .tt-step {
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 2px;
}

.lc-tooltip .tt-proc {
  color: #d62728;
  font-weight: 600;
}

.lc-tooltip .tt-base {
  color: #888;
  font-weight: 600;
}

figcaption {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  text-align: center;
  margin-top: 12px;
  line-height: 1.55;
  padding: 0 16px;
  font-style: italic;
}

/* ===== Tables ===== */
.table-wrap {
  overflow-x: auto;
  margin: 24px 0;
  border-radius: 12px;
  border: 1px solid var(--color-border);
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.results-table caption {
  font-size: 0.82rem;
  color: var(--color-text-secondary);
  text-align: left;
  padding: 14px 16px;
  font-style: italic;
  border-bottom: 1px solid var(--color-border);
  line-height: 1.5;
}

.results-table thead th {
  background: var(--color-bg-alt);
  font-weight: 600;
  text-align: left;
  padding: 12px 14px;
  border-bottom: 2px solid var(--color-border);
  white-space: nowrap;
  font-size: 0.84rem;
}

.results-table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.results-table tbody tr:last-child td {
  border-bottom: none;
}

.results-table tbody tr:hover {
  background: rgba(37, 99, 235, 0.03);
}

.table-group-header {
  background: var(--color-bg-alt);
  text-align: center;
  font-size: 0.88rem;
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-border);
}

.highlight-row {
  background: rgba(37, 99, 235, 0.05) !important;
}

.highlight-row td {
  font-weight: 600;
}

.gain {
  color: var(--color-gain);
  font-size: 0.78rem;
  font-weight: 600;
}

.loss {
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 600;
}

.compact-table {
  max-width: 560px;
  margin: 0 auto;
}

/* ===== Data Efficiency Charts ===== */
.eff-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 28px;
}

.eff-grid-single {
  grid-template-columns: 1fr;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.eff-panel {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 24px 20px 20px;
  text-align: center;
}

.eff-panel-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--color-text);
}

.eff-panel-sub {
  font-weight: 400;
  font-size: 0.82rem;
  color: var(--color-text-secondary);
}

.eff-chart {
  display: flex;
  justify-content: center;
  gap: 16px;
  align-items: flex-end;
  height: 190px;
  margin-bottom: 16px;
  padding: 0 8px;
}

.eff-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  max-width: 80px;
  height: 100%;
}

.eff-top-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.eff-top-label-sub {
  font-weight: 400;
  color: var(--color-text-secondary);
  font-size: 0.68rem;
}

.eff-bar-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  flex: 1;
  border-radius: 5px 5px 0 0;
  overflow: hidden;
}

.eff-fill {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: height 0.5s ease;
}

.eff-fill-data {
  background: linear-gradient(180deg, #6aa3e0 0%, #4a8ad4 100%);
}

.eff-fill-saved {
  background: repeating-linear-gradient(
    45deg,
    #cbd5e1,
    #cbd5e1 3px,
    #f1f5f9 3px,
    #f1f5f9 6px
  );
  border: 1px solid #b0bec5;
  border-bottom: none;
}

.eff-saved-text {
  font-size: 0.62rem;
  font-weight: 600;
  color: #475569;
  line-height: 1.3;
  text-align: center;
  white-space: nowrap;
}

.eff-bot-label {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-top: 8px;
  flex-shrink: 0;
}

.eff-badge {
  display: inline-block;
  background: linear-gradient(135deg, #dbeafe 0%, #ede9fe 100%);
  border: 1px solid #bfdbfe;
  border-radius: 20px;
  padding: 6px 18px;
  font-size: 0.88rem;
  color: var(--color-accent);
  margin-top: 4px;
}

/* ===== Scaling Horizontal Bar Charts ===== */
.scaling-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-top: 24px;
}

.scaling-chart-group {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 24px;
}

.scaling-chart-group h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 20px;
  text-align: center;
}

.chart-metric {
  font-weight: 400;
  color: var(--color-text-secondary);
  font-size: 0.85rem;
}

.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.bar-pair {
  display: flex;
  align-items: center;
  gap: 14px;
}

.bar-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text);
  min-width: 40px;
  text-align: right;
}

.bar-tracks {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.bar-row {
  height: 26px;
  display: flex;
  align-items: center;
}

.bar {
  height: 100%;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 10px;
  transition: width 0.6s ease;
  min-width: 50px;
}

.bar-baseline {
  background: #cbd5e1;
}

.bar-ours {
  background: var(--color-accent);
}

.bar-value {
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}

.bar-baseline .bar-value {
  color: #475569;
}

.bar-legend {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 16px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--color-text-secondary);
}

.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
}

.legend-baseline {
  background: #cbd5e1;
}

.legend-ours {
  background: var(--color-accent);
}

.scaling-note {
  font-size: 0.92rem;
  color: var(--color-text-secondary);
  margin-top: 20px;
  text-align: center;
  font-style: italic;
  line-height: 1.55;
}

/* ===== Structure Evidence Panels ===== */
.structure-evidence {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 24px;
}

.structure-panel {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 24px;
}

.structure-panel h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.structure-panel p {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  line-height: 1.55;
  margin-bottom: 16px;
}

.structure-panel .figure {
  margin: 0;
}

.structure-panel .table-wrap {
  margin: 0;
}

.structure-panel .compact-table {
  max-width: 100%;
}

/* ===== Algorithmic Task Charts ===== */
.algo-charts {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.algo-chart {
  position: relative;
}

.algo-chart h5 {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.algo-bars {
  display: flex;
  flex-direction: column;
  gap: 5px;
  position: relative;
}

.algo-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.algo-bar-name {
  font-size: 0.68rem;
  color: var(--color-text-secondary);
  min-width: 72px;
  text-align: right;
  white-space: nowrap;
}

.algo-bar-track {
  flex: 1;
  height: 20px;
  background: #f1f5f9;
  border-radius: 3px;
  overflow: visible;
  position: relative;
}

.algo-bar-fill {
  height: 100%;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 6px;
  min-width: 32px;
  transition: width 0.5s ease;
}

.algo-bar-best .algo-bar-fill {
  box-shadow: 0 0 0 2px #16a34a;
}

.algo-fill-dyck { background: #C1B5E5; }
.algo-fill-dyck-sh { background: #FFBC80; }
.algo-fill-eca { background: #80CBC4; }
.algo-fill-union { background: #F5A9A9; }
.algo-fill-shuffled { background: #A9A9A9; }
.algo-fill-baseline { background: #D5D5D5; }

.algo-val {
  font-size: 0.68rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}

.algo-fill-shuffled .algo-val,
.algo-fill-baseline .algo-val {
  color: #475569;
}

.algo-val-outside {
  position: relative;
  left: 8px;
  color: #475569;
}

.algo-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
}

.algo-legend .legend-item {
  font-size: 0.72rem;
}

.algo-legend .legend-swatch {
  width: 12px;
  height: 12px;
}

/* ===== Insight Cards ===== */
.insight-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 20px 0;
}

.insight-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 20px;
}

.insight-card h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.insight-card p {
  font-size: 0.88rem;
  color: var(--color-text-secondary);
  line-height: 1.55;
}

.combine-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 16px 0 24px;
}

.combine-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 20px;
}

.combine-card h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.combine-card p {
  font-size: 0.88rem;
  color: var(--color-text-secondary);
  line-height: 1.55;
}

.combine-plots {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin: 24px 0;
}

.combine-plot {
  text-align: center;
}

.combine-plot img {
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: #fff;
}

.combine-plot figcaption {
  font-size: 0.82rem;
  color: var(--color-text-secondary);
  margin-top: 10px;
  line-height: 1.5;
}

/* ===== BibTeX Full ===== */
.bibtex-full h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 12px;
  margin-top: 32px;
}

.bibtex-full h4:first-child {
  margin-top: 0;
}

.bibtex-code {
  background: var(--color-code-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 20px 24px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--color-text);
}

/* ===== Footer ===== */
.footer {
  padding: 32px 0;
  text-align: center;
  border-top: 1px solid var(--color-border);
}

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

/* ===== Mobile ===== */
@media (max-width: 768px) {
  .section {
    padding: 56px 0;
  }

  .hero-section {
    padding-top: calc(var(--nav-height) + 48px);
    padding-bottom: 56px;
  }

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

  .hero-tagline {
    font-size: 1rem;
  }

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

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

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

  .talk-card {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .pipeline-diagram {
    flex-direction: column;
    align-items: center;
  }

  .pipeline-stage {
    max-width: 100%;
    width: 100%;
  }

  .pipeline-arrow {
    transform: rotate(90deg);
    padding: 8px 0;
  }

  .pipeline-details {
    grid-template-columns: 1fr;
  }

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

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

  .eff-chart {
    height: 160px;
  }

  .scaling-charts {
    grid-template-columns: 1fr;
  }

  .structure-evidence {
    grid-template-columns: 1fr;
  }

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

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

  .combine-plots {
    grid-template-columns: 1fr;
  }

  .results-table {
    font-size: 0.78rem;
  }

  .results-table thead th {
    padding: 8px 8px;
    font-size: 0.75rem;
  }

  .results-table tbody td {
    padding: 8px 8px;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 16px 24px;
    gap: 12px;
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-toggle {
    display: flex;
  }
}

@media (max-width: 480px) {
  .stat-cards {
    grid-template-columns: 1fr;
  }

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

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

  .hero-links .btn {
    justify-content: center;
  }
}
