/*
  GAE Project Page — Standalone CSS
  Palette & variables inherited from main portfolio site
*/

/* ======================================
   CSS VARIABLES
   ====================================== */

:root {
  --blue-deep: #003876;
  --blue-mid: #2D6A9F;
  --navy-dark: #0A1628;
  --teal: #1a5276;
  --gold: #C4A661;
  --gold-light: #E8DCC8;
  --bg-primary: #f8f9fa;
  --bg-warm: #faf8f5;
  --bg-white: #ffffff;
  --text-primary: #1a1a2e;
  --text-body: #3d3d4e;
  --text-muted: #6c757d;
  --border-light: rgba(0, 56, 118, 0.08);
  --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.1);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark theme overrides */
html[data-theme="dark"] {
  --bg-primary: #0f1b2e;
  --bg-warm: #0a1628;
  --bg-white: #142847;
  --text-primary: #e8eaed;
  --text-body: #c4cbd4;
  --text-muted: #8b94a3;
  --blue-deep: #5a9fdb;
  --blue-mid: #4a7fb8;
  --teal: #5fae9e;
  --gold: #d4b97a;
  --gold-light: #2a2417;
  --navy-dark: #050d1a;
  --border-light: rgba(196, 166, 97, 0.12);
  --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.55);
}

/* ======================================
   GLOBAL STYLES
   ====================================== */

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

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-warm);
  color: var(--text-body);
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-family: var(--font-display);
  font-weight: 400;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--blue-deep);
  transition: all var(--transition);
}

a:hover {
  color: var(--gold);
  text-decoration: none;
}

/* ======================================
   CONTAINER
   ====================================== */

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ======================================
   SCROLL REVEAL
   ====================================== */

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ======================================
   HEADER
   ====================================== */

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 24px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
}

.back-link:hover {
  color: var(--blue-deep);
}

/* ======================================
   THEME TOGGLE
   ====================================== */

.theme-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  background: var(--border-light);
}

.theme-icon {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  transition: color var(--transition);
}

/* Light mode: show moon, hide sun */
.theme-icon--sun {
  display: none;
}

.theme-icon--moon {
  display: block;
}

/* Dark mode: show sun, hide moon */
html[data-theme="dark"] .theme-icon--sun {
  display: block;
}

html[data-theme="dark"] .theme-icon--moon {
  display: none;
}

/* ======================================
   HERO
   ====================================== */

.hero {
  background: linear-gradient(135deg, var(--blue-deep), var(--teal));
  color: #ffffff;
  text-align: center;
  padding: 64px 24px 56px;
  border-radius: var(--radius-lg);
  margin: 0 auto 48px;
  max-width: 900px;
}

.venue-badge {
  display: inline-block;
  background: var(--gold);
  color: var(--navy-dark);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 5px 16px;
  border-radius: 999px;
  margin-bottom: 20px;
  text-transform: uppercase;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 400;
  color: #ffffff;
  line-height: 1.25;
  margin: 0 0 20px;
}

.authors {
  font-size: 1.05rem;
  margin-bottom: 6px;
  opacity: 0.95;
}


.affiliation {
  font-size: 0.9rem;
  opacity: 0.8;
  margin-bottom: 28px;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  transition: all var(--transition);
}

.hero-btn:hover {
  background: rgba(255, 255, 255, 0.28);
  color: #ffffff;
  transform: translateY(-1px);
}

.hero-btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.58;
  pointer-events: none;
}

.hero-btn svg {
  width: 16px;
  height: 16px;
}

/* ======================================
   SECTIONS
   ====================================== */

.page-section {
  margin-bottom: 56px;
}

.page-section h2 {
  font-size: 1.7rem;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border-light);
}

/* ======================================
   ABSTRACT
   ====================================== */

.abstract-text {
  border-left: 3px solid var(--gold);
  padding: 16px 0 16px 24px;
  font-size: 1rem;
  line-height: 1.85;
  color: var(--text-body);
}

/* ======================================
   PDF VIEWER
   ====================================== */

.pdf-viewer {
  position: relative;
}

.pdf-canvas-wrapper {
  position: relative;
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
}

.pdf-canvas-wrapper:focus-visible {
  box-shadow: var(--shadow-md), 0 0 0 3px var(--gold);
}

.pdf-canvas-wrapper canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

.pdf-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-family: var(--font-mono);
  pointer-events: none;
}

.pdf-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 20px;
}

.pdf-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  background: var(--blue-deep);
  color: #ffffff;
  border: 1px solid var(--blue-deep);
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.pdf-download-btn:hover {
  background: var(--gold);
  color: var(--navy-dark);
  border-color: var(--gold);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.pdf-download-btn svg {
  width: 16px;
  height: 16px;
}

/* ======================================
   METHOD FIGURE
   ====================================== */

.method-carousel {
  position: relative;
}

.method-track {
  position: relative;
}

.method-slide {
  display: none;
  text-align: center;
  margin: 0;
}

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

.method-slide img {
  background: var(--bg-white);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-md);
  max-width: 100%;
}

.algorithm-card {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin: 0 auto;
  max-width: 820px;
  padding: 22px;
  text-align: left;
}

.algorithm-io {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.algorithm-io > div {
  background: color-mix(in srgb, var(--bg-primary) 60%, var(--bg-white));
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.algorithm-io span,
.algorithm-benefit span {
  color: var(--text-muted);
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.algorithm-io strong {
  color: var(--text-primary);
  display: block;
  font-size: 0.95rem;
  line-height: 1.35;
  margin-top: 4px;
}

.algorithm-steps {
  counter-reset: algorithm;
  display: grid;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

.algorithm-steps::before {
  background: linear-gradient(180deg, var(--blue-deep), color-mix(in srgb, var(--blue-deep) 35%, var(--gold)));
  border-radius: 999px;
  bottom: 28px;
  content: "";
  left: 30px;
  opacity: 0.42;
  position: absolute;
  top: 28px;
  width: 2px;
  z-index: 0;
}

.algorithm-steps li {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--bg-white) 85%, var(--bg-primary));
  position: relative;
  z-index: 1;
}

.algorithm-step-index {
  align-items: center;
  background: var(--blue-deep);
  border-radius: 999px;
  color: #fff;
  display: flex;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 800;
  height: 36px;
  justify-content: center;
  margin-top: 2px;
  outline: 5px solid var(--bg-white);
  width: 36px;
}

.algorithm-steps h3 {
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.25;
  margin: 0 0 4px;
}

.algorithm-steps p {
  color: var(--text-body);
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0 0 8px;
}

.algorithm-tagline {
  background: color-mix(in srgb, var(--blue-deep) 7%, var(--bg-white));
  border: 1px solid color-mix(in srgb, var(--blue-deep) 14%, var(--border-light));
  border-radius: var(--radius-sm);
  color: var(--blue-deep);
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.35;
  padding: 6px 9px;
}

.algorithm-benefits {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.algorithm-benefit {
  background: linear-gradient(180deg, color-mix(in srgb, var(--gold) 16%, var(--bg-white)), var(--bg-white));
  border: 1px solid color-mix(in srgb, var(--gold) 38%, var(--border-light));
  border-radius: var(--radius-sm);
  min-height: 86px;
  padding: 14px;
  position: relative;
}

.algorithm-benefit::before {
  background: var(--gold);
  border-radius: 999px;
  content: "";
  height: 4px;
  left: 14px;
  position: absolute;
  right: 14px;
  top: 0;
}

.algorithm-benefit strong {
  color: var(--text-primary);
  display: block;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.25;
  margin-top: 8px;
}

.method-slide figcaption {
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
}

/* ======================================
   KEY RESULTS
   ====================================== */

.results-carousel {
  position: relative;
}

.carousel-track {
  position: relative;
}

.result-slide {
  display: none;
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

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

.result-slide-inner {
  padding: 26px;
}

.result-kicker {
  margin: 0 0 6px;
  color: var(--blue-deep);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.result-slide h3 {
  margin: 0 0 18px;
  font-family: var(--font-body);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.35;
}

.result-figure-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: center;
}

.result-figure-grid img {
  width: 100%;
  display: block;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px;
}

.result-slide figcaption,
.result-caption {
  margin-top: 16px;
  font-size: 0.95rem;
  color: var(--text-body);
  line-height: 1.6;
  text-align: center;
}

.result-slide figcaption strong {
  display: block;
  color: var(--text-primary);
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.training-contrast {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
  margin: 4px 0 22px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.training-contrast > div {
  padding: 18px 20px;
  background: color-mix(in srgb, var(--bg-primary) 65%, var(--bg-white));
}

.training-contrast > div + div {
  border-left: 1px solid var(--border-light);
}

.training-contrast strong {
  display: block;
  margin: 5px 0 2px;
  color: var(--text-primary);
  font-size: 1.6rem;
  line-height: 1.15;
}

.training-contrast span {
  display: block;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.contrast-label {
  color: var(--text-body) !important;
  font-family: var(--font-mono);
  font-size: 0.74rem !important;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.training-contrast .contrast-winner {
  background: color-mix(in srgb, var(--blue-deep) 10%, var(--bg-white));
  border-top: 4px solid var(--blue-deep);
}

.training-contrast .contrast-winner strong {
  color: var(--blue-deep);
}

.benchmark-panel {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 18px;
  background: color-mix(in srgb, var(--bg-primary) 45%, var(--bg-white));
}

.benchmark-controls {
  display: grid;
  grid-template-columns: 1fr 1fr 1.25fr;
  gap: 14px;
  margin-bottom: 16px;
}

.benchmark-control-group > span {
  display: block;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.benchmark-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.benchmark-toggle button {
  appearance: none;
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-body);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  padding: 9px 11px;
  transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
}

.benchmark-toggle button:hover {
  border-color: color-mix(in srgb, var(--blue-deep) 50%, var(--border-light));
}

.benchmark-toggle button.active {
  background: color-mix(in srgb, var(--blue-deep) 12%, var(--bg-white));
  border-color: var(--blue-deep);
  box-shadow: inset 0 0 0 1px var(--blue-deep);
  color: var(--blue-deep);
}

.benchmark-status {
  align-items: center;
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-body);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  padding: 10px 12px;
}

.benchmark-status strong {
  color: var(--text-primary);
}

.benchmark-status span {
  background: color-mix(in srgb, var(--blue-deep) 9%, var(--bg-white));
  border: 1px solid color-mix(in srgb, var(--blue-deep) 18%, var(--border-light));
  border-radius: 999px;
  color: var(--blue-deep);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 8px;
}

.benchmark-metric-grid {
  display: grid;
  gap: 14px;
}

.metric-card {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.metric-card-header {
  align-items: baseline;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.metric-card-header h4 {
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 800;
  margin: 0;
}

.metric-card-header span {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

.metric-bars {
  display: grid;
  gap: 7px;
}

.metric-row {
  align-items: center;
  display: grid;
  grid-template-columns: 104px minmax(140px, 1fr) 70px 54px;
  gap: 8px;
  min-height: 24px;
}

.metric-method {
  color: var(--text-body);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-track {
  background: rgba(108, 117, 125, 0.13);
  border-radius: 999px;
  height: 12px;
  overflow: hidden;
  position: relative;
}

.metric-fill {
  background: #8c98a8;
  border-radius: 999px;
  display: block;
  height: 100%;
  min-width: 2px;
}

.metric-row.is-gae .metric-method,
.metric-row.is-gae .metric-value {
  color: var(--blue-deep);
}

.metric-row.is-gae .metric-fill {
  background: linear-gradient(90deg, var(--blue-mid), var(--blue-deep));
}

.metric-row.is-best .metric-fill {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 55%, transparent);
}

.metric-value {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 800;
  text-align: right;
}

.metric-badge {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 800;
  text-align: right;
}

.metric-row.is-best .metric-badge {
  color: var(--gold);
}

.benchmark-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 16px;
}

.benchmark-summary > div {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  background: color-mix(in srgb, var(--blue-deep) 7%, var(--bg-white));
}

.benchmark-summary strong {
  display: block;
  color: var(--blue-deep);
  font-size: 1.35rem;
  line-height: 1.1;
}

.benchmark-summary span {
  color: var(--text-muted);
  font-size: 0.86rem;
}

.benchmark-plot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.benchmark-plot-card {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 16px;
  background: color-mix(in srgb, var(--bg-primary) 45%, var(--bg-white));
}

.plot-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.plot-card-header h4 {
  margin: 0;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.98rem;
  font-weight: 800;
}

.plot-card-header span,
.plot-axis-labels {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

.plot-axis-labels {
  display: grid;
  grid-template-columns: 34% 66%;
  margin: 0 54px 6px 108px;
}

.plot-axis-labels span:last-child {
  text-align: right;
}

.advantage-plot {
  display: grid;
  gap: 7px;
}

.advantage-row {
  display: grid;
  grid-template-columns: 108px minmax(96px, 1fr) 50px;
  gap: 8px;
  align-items: center;
  min-height: 18px;
}

.advantage-label {
  color: var(--text-body);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.advantage-axis {
  display: grid;
  grid-template-columns: 18% 82%;
  height: 10px;
  position: relative;
}

.advantage-axis::before {
  background: color-mix(in srgb, var(--text-muted) 45%, transparent);
  content: "";
  height: 16px;
  left: 18%;
  position: absolute;
  top: -3px;
  width: 1px;
  z-index: 2;
}

.negative-side,
.positive-side {
  background: rgba(108, 117, 125, 0.12);
  display: block;
  height: 100%;
  position: relative;
}

.negative-side {
  border-radius: 999px 0 0 999px;
}

.positive-side {
  border-radius: 0 999px 999px 0;
}

.advantage-axis i {
  display: block;
  height: 100%;
  min-width: 2px;
  position: absolute;
  top: 0;
}

.positive-side i {
  background: linear-gradient(90deg, var(--blue-mid), var(--blue-deep));
  border-radius: 0 999px 999px 0;
  left: 0;
}

.negative-side i {
  background: #b25555;
  border-radius: 999px 0 0 999px;
  right: 0;
}

.advantage-row.standout .positive-side i {
  background: linear-gradient(90deg, var(--blue-deep), var(--gold));
}

.advantage-value {
  color: var(--blue-deep);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  text-align: right;
}

.advantage-row.negative .advantage-value {
  color: #a43f3f;
}

.benchmark-table-wrap,
.cost-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
}

.benchmark-table,
.cost-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  line-height: 1.45;
}

.benchmark-table th,
.benchmark-table td,
.cost-table th,
.cost-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  text-align: left;
  vertical-align: top;
}

.benchmark-table th,
.cost-table th {
  background: color-mix(in srgb, var(--bg-primary) 70%, var(--bg-white));
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.benchmark-table tr:last-child td,
.cost-table tr:last-child td {
  border-bottom: 0;
}

.benchmark-table strong,
.cost-table .gae-row td {
  color: var(--blue-deep);
  font-weight: 800;
}

.cost-table .gae-row {
  background: color-mix(in srgb, var(--blue-deep) 9%, var(--bg-white));
}

.result-note {
  margin: 16px 0 0;
  color: var(--text-body);
  font-size: 0.95rem;
  line-height: 1.6;
}

.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
}

.carousel-btn {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 1.2rem;
  width: 44px;
  height: 44px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
  box-shadow: var(--shadow-sm);
}

.carousel-btn:hover {
  background: var(--blue-deep);
  color: #fff;
  box-shadow: var(--shadow-md);
}

.carousel-indicator {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  min-width: 50px;
  text-align: center;
}

/* ======================================
   QUALITATIVE ANALYSIS
   ====================================== */

.section-intro {
  max-width: 760px;
  margin: -4px auto 24px;
  color: var(--text-body);
  text-align: center;
}

.qual-explorer {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 22px;
  position: relative;
}

.qual-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.qual-tab {
  border: 1px solid rgba(0, 56, 118, 0.18);
  border-radius: 999px;
  background: var(--bg-primary);
  color: var(--blue-deep);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 14px;
  transition: all var(--transition);
}

.qual-tab:hover,
.qual-tab.active {
  background: var(--blue-deep);
  border-color: var(--blue-deep);
  color: #fff;
}

.qual-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.8fr);
  gap: 18px;
  align-items: stretch;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  padding: 18px 0;
}

.qual-label {
  display: block;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.qual-prompt {
  color: var(--text-primary);
  font-size: 1rem;
  line-height: 1.6;
  margin: 0;
}

.qual-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.qual-metrics > div {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.qual-metrics strong {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 1rem;
}

.qual-feature-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
}

.qual-feature-chip {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  background: rgba(196, 166, 97, 0.13);
  border: 1px solid rgba(196, 166, 97, 0.28);
  border-radius: 999px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 7px 11px;
}

.qual-feature-chip span {
  color: var(--text-muted);
}

.qual-panel {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.qual-panel-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-light);
  padding: 12px 14px;
}

.qual-panel-header h3 {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
}

.qual-panel-header span {
  color: var(--text-muted);
  font-size: 0.84rem;
}

.qual-comparison-scroll {
  overflow-x: auto;
}

.qual-comparison-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}

.qual-comparison-table th,
.qual-comparison-table td {
  border-bottom: 1px solid var(--border-light);
  border-right: 1px solid var(--border-light);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 8px 7px;
  text-align: center;
  white-space: nowrap;
}

.qual-comparison-table th:first-child,
.qual-comparison-table td:first-child {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-weight: 700;
  left: 0;
  min-width: 104px;
  position: sticky;
  text-align: left;
  z-index: 2;
}

.qual-comparison-table thead th {
  background: var(--bg-primary);
  color: var(--text-muted);
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 1;
}

.qual-comparison-table thead tr:first-child th {
  color: var(--text-primary);
}

.qual-comparison-table thead th:first-child {
  z-index: 3;
}

.qual-comparison-table .method-fixed {
  color: var(--blue-deep);
}

.qual-comparison-table .method-gae {
  color: #087f5b;
}

.token-cell {
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.token-badge {
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.68rem;
  font-weight: 700;
  justify-content: center;
  min-width: 58px;
  padding: 3px 7px;
}

.token-badge.class-token {
  color: var(--blue-deep);
  background: rgba(0, 56, 118, 0.09);
}

.token-badge.control-token {
  color: #8f6f2c;
  background: rgba(196, 166, 97, 0.14);
}

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

.qual-cell {
  color: var(--text-primary);
  font-weight: 600;
  min-width: 58px;
}

.qual-cell--fixed {
  box-shadow: inset 0 0 0 1px rgba(0, 56, 118, 0.12);
}

.qual-cell--gae {
  box-shadow: inset 0 0 0 1px rgba(8, 127, 91, 0.16);
}

.qual-delta-cell {
  min-width: 92px;
}

.qual-delta-cell span {
  color: var(--text-primary);
  display: block;
  font-weight: 700;
  margin-bottom: 4px;
}

.qual-delta-track {
  background: rgba(108, 117, 125, 0.16);
  border-radius: 999px;
  height: 5px;
  overflow: hidden;
}

.qual-delta-track i {
  display: block;
  height: 100%;
}

.qual-delta-cell.positive .qual-delta-track i {
  background: #087f5b;
}

.qual-delta-cell.negative .qual-delta-track i {
  background: #a43f3f;
}

.qual-tooltip {
  background: rgba(10, 22, 40, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  color: #fff;
  font-size: 0.82rem;
  line-height: 1.45;
  max-width: 280px;
  opacity: 0;
  padding: 10px 12px;
  pointer-events: none;
  position: fixed;
  transform: translate(12px, 12px);
  transition: opacity 0.12s ease;
  z-index: 1000;
}

.qual-tooltip.visible {
  opacity: 1;
}

.qual-tooltip strong {
  color: #fff;
  display: block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  margin-bottom: 4px;
}

.qual-tooltip span {
  color: rgba(255, 255, 255, 0.78);
  display: block;
}

.qual-tooltip .tooltip-value {
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  margin-top: 4px;
}

html[data-theme="dark"] .qual-tab {
  background: rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .qual-metrics > div,
html[data-theme="dark"] .qual-panel-header,
html[data-theme="dark"] .qual-comparison-table th:first-child,
html[data-theme="dark"] .qual-comparison-table td:first-child,
html[data-theme="dark"] .qual-comparison-table thead th {
  background: rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .training-contrast > div,
html[data-theme="dark"] .benchmark-panel,
html[data-theme="dark"] .benchmark-plot-card,
html[data-theme="dark"] .algorithm-io > div,
html[data-theme="dark"] .algorithm-steps li,
html[data-theme="dark"] .algorithm-benefit,
html[data-theme="dark"] .benchmark-table th,
html[data-theme="dark"] .cost-table th {
  background: rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .algorithm-card,
html[data-theme="dark"] .benchmark-status,
html[data-theme="dark"] .metric-card {
  background: rgba(255, 255, 255, 0.035);
}

html[data-theme="dark"] .algorithm-tagline {
  background: rgba(90, 159, 219, 0.12);
}

html[data-theme="dark"] .benchmark-summary > div,
html[data-theme="dark"] .training-contrast .contrast-winner,
html[data-theme="dark"] .cost-table .gae-row {
  background: rgba(90, 159, 219, 0.14);
}

/* ======================================
   BIBTEX
   ====================================== */

.bibtex-wrapper {
  position: relative;
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.bibtex-wrapper pre {
  margin: 0;
  padding: 20px 24px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.7;
  overflow-x: auto;
  color: var(--text-body);
}

.copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--gold);
  color: var(--navy-dark);
  border: none;
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.copy-btn:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

/* ======================================
   FOOTER
   ====================================== */

.site-footer {
  background: var(--navy-dark);
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  padding: 36px 24px;
  font-size: 0.88rem;
  margin-top: 64px;
}

.site-footer a {
  color: var(--gold);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--gold-light);
  text-decoration: underline;
}

/* ======================================
   RESPONSIVE
   ====================================== */

@media (max-width: 768px) {
  .hero {
    padding: 44px 18px 40px;
    border-radius: var(--radius-md);
  }

  .hero h1 {
    font-size: 1.6rem;
  }

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

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


  .container {
    padding: 0 16px;
  }

  .site-header {
    padding: 16px;
  }

  .page-section h2 {
    font-size: 1.4rem;
  }

  .result-slide-inner {
    padding: 18px;
  }

  .result-slide h3 {
    font-size: 1.12rem;
  }

  .result-figure-grid,
  .training-contrast,
  .algorithm-io,
  .algorithm-benefits,
  .benchmark-controls,
  .benchmark-summary,
  .benchmark-plot-grid {
    grid-template-columns: 1fr;
  }

  .training-contrast > div + div {
    border-left: 0;
    border-top: 1px solid var(--border-light);
  }

  .benchmark-plot-card {
    padding: 14px;
  }

  .benchmark-panel {
    padding: 14px;
  }

  .algorithm-card {
    padding: 16px;
  }

  .algorithm-steps li {
    grid-template-columns: 34px minmax(0, 1fr);
    padding: 12px;
  }

  .algorithm-steps::before {
    left: 28px;
  }

  .algorithm-step-index {
    height: 32px;
    width: 32px;
  }

  .algorithm-benefit {
    min-height: 72px;
  }

  .algorithm-tagline {
    max-width: 100%;
  }

  .metric-row {
    grid-template-columns: 86px minmax(82px, 1fr) 58px 42px;
  }

  .metric-method {
    font-size: 0.66rem;
  }

  .metric-value {
    font-size: 0.68rem;
  }

  .advantage-row {
    grid-template-columns: 96px minmax(84px, 1fr) 48px;
  }

  .advantage-label {
    font-size: 0.64rem;
  }

  .plot-axis-labels {
    margin-left: 96px;
  }

  .benchmark-table,
  .cost-table {
    min-width: 620px;
  }
}
