/* =========================================================
   Modality Interference — Project Page
   Clean, modern, academic. Single-page static site.
   ========================================================= */

:root {
  /* palette */
  --text:        #111827;
  --text-soft:   #4B5563;
  --text-muted:  #6B7280;
  --bg:          #F8FAFC;
  --bg-alt:      #F1F5F9;
  --card:        #FFFFFF;
  --border:      #E5E7EB;
  --border-strong: #D1D5DB;

  /* accents */
  --indigo:      #4F46E5;
  --indigo-50:   #EEF2FF;
  --indigo-100:  #E0E7FF;
  --orange:      #F97316;
  --orange-50:   #FFF7ED;
  --red:         #DC2626;
  --red-50:      #FEE2E2;
  --green:       #059669;
  --green-50:    #ECFDF5;
  --violet:      #7C3AED;

  /* shadows */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow:    0 4px 14px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(15, 23, 42, 0.04);

  --radius-sm: 8px;
  --radius:    14px;
  --radius-lg: 20px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

a {
  color: var(--indigo);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover { color: var(--violet); }

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

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 28px;
}

/* =========================================================
   Top Nav
   ========================================================= */
.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(248, 250, 252, 0.85);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.nav-brand:hover { color: var(--indigo); }

.brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--indigo), var(--red));
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.10);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}
.nav-links a {
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 500;
}
.nav-links a:hover { color: var(--indigo); }
.nav-links a.active {
  color: var(--indigo);
  font-weight: 600;
  position: relative;
}
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 2px;
  background: var(--indigo);
  border-radius: 2px;
}

/* =========================================================
   Hero
   ========================================================= */
.hero {
  position: relative;
  padding: 64px 0 56px;
  background:
    radial-gradient(1000px 480px at 80% -10%, rgba(79, 70, 229, 0.08), transparent 60%),
    radial-gradient(900px 420px at 5% 110%, rgba(220, 38, 38, 0.06), transparent 60%),
    var(--bg);
}

.hero-grid {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  flex-direction: column;
  gap: 44px;
  align-items: stretch;
}
.hero-left { text-align: left; max-width: 920px; }

.venue-pill {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--indigo-50);
  color: var(--indigo);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 20px;
  border: 1px solid var(--indigo-100);
}

/* TITLE — multi-line, multi-color highlights */
.hero-title {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.08;
  font-size: clamp(34px, 4.6vw, 56px);
  margin: 0 0 18px;
  color: var(--text);
}

.hero-title .t-row {
  display: block;
}

.hero-title .word {
  display: inline-block;
  margin-right: 0.18em;
}

.hero-title .word.verb    { color: var(--green); }
.hero-title .word.problem { color: var(--red); position: relative; }
.hero-title .word.problem::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 4%;
  height: 8%;
  background: rgba(220, 38, 38, 0.18);
  z-index: -1;
  border-radius: 4px;
}
.hero-title .word.domain  { color: var(--indigo); }
.hero-title .word.neutral { color: var(--text); font-weight: 700; }

.hero-tagline {
  font-size: 18px;
  color: var(--text-soft);
  max-width: 560px;
  margin: 0 0 22px;
}

/* Authors */
.authors {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 18px 0 6px;
  font-size: 16px;
  color: var(--text);
}
.authors .author { font-weight: 500; }
.authors .author a { color: var(--text); border-bottom: 1px solid transparent; }
.authors .author a:hover { color: var(--indigo); border-bottom-color: var(--indigo); }
.authors sup { color: var(--indigo); font-weight: 700; margin-left: 2px; }

.affiliations {
  margin: 4px 0 22px;
  font-size: 14px;
  color: var(--text-soft);
}
.aff {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.aff sup { color: var(--indigo); font-weight: 700; }
.aff-mark {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  background: #FEF3C7;
  color: #92400E;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: 1px solid #FDE68A;
}

/* Buttons */
.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }

.btn-primary {
  background: var(--indigo);
  color: #fff;
  border-color: var(--indigo);
}
.btn-primary:hover { background: #4338CA; color: #fff; }

.btn-dark {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}
.btn-dark:hover { background: #000; color: #fff; }

.btn-outline {
  background: var(--card);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-outline:hover { color: var(--indigo); border-color: var(--indigo); }

.btn-ico { font-size: 14px; }

/* Hero visual: real Figure 1 — full row beneath the title block */
.hero-right { display: flex; justify-content: center; width: 100%; }
.hero-figure {
  margin: 0;
  width: 100%;
  max-width: 1080px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-lg);
}
.hero-figure img {
  width: 100%;
  border-radius: var(--radius);
}
.hero-figure figcaption {
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-soft);
  text-align: center;
}

/* (Legacy hero-card kept for any future reuse) */
.hero-card {
  width: 100%;
  max-width: 480px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hc-row {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--bg);
  position: relative;
}
.hc-row.image-heavy { border-color: rgba(220, 38, 38, 0.25); background: #FFF5F5; }
.hc-row.text-heavy  { border-color: rgba(249, 115, 22, 0.25); background: #FFFAF0; }
.hc-row.hc-fixed    { border-color: rgba(5, 150, 105, 0.30); background: #F0FDF4; }

.hc-tag {
  position: absolute;
  top: -10px;
  left: 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border-radius: 999px;
  text-transform: uppercase;
}
.tag-red    { background: #FEE2E2; color: #B91C1C; }
.tag-orange { background: #FFEDD5; color: #C2410C; }
.tag-green  { background: #D1FAE5; color: #047857; }
.tag-indigo { background: #E0E7FF; color: #4338CA; }

.hc-body {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.hc-img {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 18px;
}
.hc-img.muted { opacity: 0.55; filter: grayscale(40%); }
.hc-arrow { color: var(--text-soft); font-weight: 700; }
.hc-text  { font-size: 13px; color: var(--text); }
.hc-text .bad  { color: var(--red); font-style: italic; }
.hc-text .good { color: var(--green); font-weight: 600; }
.hc-text .muted { color: var(--text-muted); font-style: italic; }
.hc-pred {
  margin-left: auto;
  font-size: 13px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
}
.bad-pred  { background: #FEE2E2; color: #B91C1C; }
.good-pred { background: #D1FAE5; color: #047857; }

.hc-divider {
  text-align: center;
  font-size: 12px;
  color: var(--indigo);
  font-weight: 600;
  padding: 6px 0;
  position: relative;
}
.hc-divider::before, .hc-divider::after {
  content: ""; position: absolute; top: 50%; width: 25%; height: 1px;
  background: linear-gradient(to right, transparent, var(--indigo-100), transparent);
}
.hc-divider::before { left: 0; }
.hc-divider::after  { right: 0; }

/* =========================================================
   Sections
   ========================================================= */
.section {
  padding: 78px 0;
}
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.section-head {
  max-width: 820px;
  margin: 0 auto 40px;
  text-align: center;
}
.kicker {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--indigo);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--indigo-50);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.section-head h2 {
  margin: 0 0 12px;
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}
.section-sub {
  margin: 0;
  font-size: 16px;
  color: var(--text-soft);
}

.hl-red    { color: var(--red); }
.hl-indigo { color: var(--indigo); }
.hl-green  { color: var(--green); }
.hl-orange { color: var(--orange); }

/* Abstract */
.abstract-card {
  max-width: 880px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px 36px;
  box-shadow: var(--shadow);
  font-size: 17px;
  line-height: 1.75;
  color: var(--text);
}

/* Case grid (problem) — one card per row, text on top, image on bottom */
.case-grid {
  display: flex;
  flex-direction: column;
  gap: 28px;
  max-width: 1080px;
  margin: 0 auto;
}
.case-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.case-card .case-figure {
  margin-top: 18px;
}
.case-card.case-image { border-top: 4px solid var(--red); }
.case-card.case-text  { border-top: 4px solid var(--orange); }

.case-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
  letter-spacing: 0.04em;
}
.case-card h3 {
  margin: 6px 0 8px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.case-card p {
  color: var(--text-soft);
  font-size: 15px;
  margin: 0 0 14px;
}
.case-figure {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-alt);
  border: 1px solid var(--border);
}
.case-figure img { width: 100%; }

/* Findings */
.finding-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.finding-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.finding-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.fc-icon {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px;
  font-weight: 800;
  margin-bottom: 12px;
  font-size: 18px;
}
.icon-red    { background: var(--red-50);   color: var(--red); }
.icon-orange { background: var(--orange-50);color: var(--orange); }
.icon-green  { background: var(--green-50); color: var(--green); }
.finding-card h4 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.finding-card p {
  margin: 0;
  font-size: 14.5px;
  color: var(--text-soft);
}

/* Diagnosis — stacked: figure full row, equations full row */
.diag-grid {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.diag-graph {
  margin: 0 auto;
  width: 100%;
  max-width: 1080px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.diag-graph img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
}
.diag-graph figcaption {
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-soft);
  text-align: center;
}
.diag-text {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  max-width: 1080px;
  margin: 0 auto;
  width: 100%;
}
.diag-text .eq-block { margin-bottom: 0; }

.eq-block {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.eq-label {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--indigo);
  font-weight: 700;
  margin-bottom: 6px;
}
.eq {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 18px;
  color: var(--text);
  margin-bottom: 6px;
}
.eq .bracket { font-style: normal; }
.eq-note {
  font-size: 14px;
  color: var(--text-soft);
}

/* Perturbation Protocol */
.proto-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.proto-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.proto-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.proto-row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dashed var(--border);
  padding: 8px 0;
  font-size: 14px;
}
.proto-row:last-of-type { border-bottom: 0; }
.proto-row span { color: var(--text-soft); }
.proto-row b { color: var(--text); }
.proto-list {
  margin: 12px 0 0;
  padding-left: 18px;
  font-size: 14px;
  color: var(--text-soft);
}
.proto-list li { margin-bottom: 4px; }
.ood-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--violet);
  color: #fff;
  letter-spacing: 0.04em;
  margin-left: 4px;
  vertical-align: middle;
}

/* Method pipeline */
.pipeline {
  display: grid;
  grid-template-columns: 1fr 24px 1fr 24px 1fr;
  align-items: stretch;
  gap: 12px;
  margin-bottom: 24px;
}
.pipe-step {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.pipe-num {
  position: absolute;
  top: -16px; left: 20px;
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--indigo);
  color: #fff;
  font-weight: 800;
  border-radius: 10px;
  font-size: 14px;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.30);
}
.pipe-step h3 {
  margin: 4px 0 8px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.pipe-step p {
  margin: 0;
  color: var(--text-soft);
  font-size: 14.5px;
}
.pipe-step .mono {
  display: block;
  margin-top: 10px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text);
  word-break: break-word;
}
.pipe-arrow {
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  color: var(--indigo);
  font-weight: 700;
}

/* Framework figure (Figure 3 from paper) */
.framework-figure {
  margin: 36px auto 36px;
  max-width: 1080px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  text-align: center;
}
.framework-figure img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin: 0 auto;
}
.framework-figure figcaption {
  margin: 16px auto 0;
  max-width: 820px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-soft);
}

.loss-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  text-align: center;
}
.loss-label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--indigo);
  font-weight: 700;
  margin-bottom: 12px;
}
.loss-eq {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(18px, 2.4vw, 24px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.loss-term { font-weight: 700; }
.loss-eq-eq, .loss-eq-plus { color: var(--text-soft); }
.loss-note {
  max-width: 760px;
  margin: 0 auto;
  color: var(--text-soft);
  font-size: 14.5px;
}

/* Results — figures stacked, each full row */
.result-figs {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 36px;
  max-width: 1080px;
  margin-left: auto;
  margin-right: auto;
}
.result-figs figure {
  margin: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.result-figs figure img {
  border-radius: var(--radius);
  width: 100%;
  display: block;
  margin: 0 auto;
}
.result-figs figcaption {
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-soft);
  text-align: center;
}

.result-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.result-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.result-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.rc-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
  margin-bottom: 12px;
}
.rc-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.rc-tag {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-alt);
  padding: 2px 8px;
  border-radius: 999px;
}
.rc-rows { display: flex; flex-direction: column; gap: 8px; }
.rc-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  align-items: center;
}
.rc-row span { color: var(--text-soft); }
.rc-row b    { font-family: 'JetBrains Mono', monospace; font-weight: 600; }

.num-bad  { color: var(--red); }
.num-mid  { color: var(--text-soft); }
.num-good { color: var(--green); }

.footnote {
  margin-top: 18px;
  font-size: 12.5px;
  color: var(--text-muted);
  text-align: center;
  font-style: italic;
}

/* Ablation */
.ablation-figure {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 26px;
}
.ablation-figure img { border-radius: var(--radius); margin: 0 auto; }

.ablation-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.abl-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.abl-step {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  color: var(--indigo);
  background: var(--indigo-50);
  border: 1px solid var(--indigo-100);
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  margin-bottom: 10px;
  font-weight: 700;
}
.abl-card p { margin: 0; font-size: 14px; color: var(--text-soft); }

/* OOD */
.ood-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 28px;
}
.ood-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.ood-card h4 {
  margin: 0 0 10px;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-soft);
  font-weight: 700;
}
.ood-card ul {
  margin: 0;
  padding-left: 18px;
  font-size: 15px;
  color: var(--text);
}
.ood-card-emph {
  border-color: var(--violet);
  border-top: 3px solid var(--violet);
}

.figs-2col {
  display: flex;
  flex-direction: column;
  gap: 22px;
  max-width: 1080px;
  margin: 0 auto;
}
.figs-2col figure {
  margin: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.figs-2col figure img {
  border-radius: var(--radius);
  width: 100%;
  display: block;
  margin: 0 auto;
}
.figs-2col figcaption {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-soft);
  text-align: center;
}

/* Comparison Table */
.cmp-table {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.cmp-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1.6fr;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 14.5px;
}
.cmp-row:last-of-type { border-bottom: 0; }
.cmp-row.cmp-head {
  background: var(--bg-alt);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.cmp-row.cmp-ours {
  background: linear-gradient(90deg, rgba(79, 70, 229, 0.06), transparent);
  border-left: 4px solid var(--indigo);
}
.cmp-no  { color: var(--red); }
.cmp-mid { color: var(--orange); }
.cmp-yes { color: var(--green); font-weight: 600; }

/* Why — stacked */
.why-grid {
  display: flex;
  flex-direction: column;
  gap: 22px;
  max-width: 880px;
  margin: 0 auto;
}
.why-text {
  font-size: 17px;
  line-height: 1.8;
  color: var(--text);
  margin: 0;
}
.ib-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--violet);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.ib-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--violet);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.ib-box p {
  margin: 0;
  font-size: 14.5px;
  color: var(--text-soft);
}

/* Citation */
.bib-card {
  position: relative;
  background: #0F172A;
  color: #E2E8F0;
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  box-shadow: var(--shadow-lg);
  font-family: 'JetBrains Mono', monospace;
  overflow: auto;
}
.bib-card pre {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre;
  color: #E2E8F0;
}
.bib-copy {
  position: absolute;
  top: 14px; right: 14px;
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
  font-family: 'Inter', sans-serif;
}
.bib-copy:hover { background: rgba(255, 255, 255, 0.20); }
.bib-copy.copied { background: var(--green); border-color: var(--green); }

/* Footer */
.footer {
  background: var(--text);
  color: #CBD5E1;
  padding: 48px 0 22px;
  margin-top: 0;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 36px;
  align-items: start;
}
.foot-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 700;
  font-size: 17px;
}
.foot-tag {
  margin: 8px 0 0;
  font-size: 14px;
  color: #94A3B8;
}
.foot-col h5 {
  color: #fff;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 12px;
}
.foot-col a {
  display: block;
  color: #CBD5E1;
  font-size: 14px;
  margin-bottom: 6px;
}
.foot-col a:hover { color: #fff; }
.foot-col .muted { color: #94A3B8; font-size: 14px; }
.foot-bottom {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  font-size: 13px;
  color: #94A3B8;
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1024px) {
  .finding-grid { grid-template-columns: repeat(2, 1fr); }
  .proto-grid { grid-template-columns: 1fr; }
  .pipeline { grid-template-columns: 1fr; }
  .pipe-arrow { transform: rotate(90deg); padding: 4px 0; }
  .result-cards { grid-template-columns: 1fr; }
  .ablation-grid { grid-template-columns: repeat(2, 1fr); }
  .ood-grid { grid-template-columns: 1fr; }
  .diag-text { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .cmp-row { grid-template-columns: 1fr; gap: 4px; padding: 14px; }
  .cmp-row.cmp-head { display: none; }
}

@media (max-width: 640px) {
  .nav-links { display: none; }
  .section { padding: 56px 0; }
  .finding-grid { grid-template-columns: 1fr; }
  .ablation-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .abstract-card { padding: 22px 20px; font-size: 16px; }
  .hero { padding: 36px 0; }
  .hero-title { font-size: 32px; }
}

/* Scroll offset for sticky nav anchors */
section[id], header[id] {
  scroll-margin-top: 78px;
}
