:root {
  --bg-paper: #f7f4ee;
  --bg-paper-alt: #efeae0;
  --surface: #ffffff;
  --surface-soft: #fbf9f5;
  --ink: #14181f;
  --ink-muted: #525967;
  --ink-faint: #7c8391;
  --accent-blue: #1b4dff;
  --accent-blue-soft: rgba(27, 77, 255, 0.08);
  --accent-blue-border: rgba(27, 77, 255, 0.28);
  --accent-red: #d94426;
  --accent-red-soft: rgba(217, 68, 38, 0.09);
  --accent-teal: #0f7b6c;
  --accent-teal-soft: rgba(15, 123, 108, 0.1);
  --grid-line: rgba(20, 24, 31, 0.055);
  --border: #dcd6ca;
  --border-strong: #c7bfb0;
  --shadow-sm: 0 2px 10px rgba(20, 24, 31, 0.045);
  --shadow-md: 0 12px 32px rgba(20, 24, 31, 0.08);
  --shadow-lg: 0 22px 54px rgba(20, 24, 31, 0.13);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --font-display: "Fraunces", Georgia, serif;
  --font-sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 76px;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15.5px;
  line-height: 1.66;
  background-color: var(--bg-paper);
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--accent-blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button,
input,
select {
  font-family: inherit;
}

.container {
  width: min(1240px, 93vw);
  margin: 0 auto;
}

/* ---------- Sticky Navigation ---------- */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(247, 244, 238, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 62px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.62rem;
  color: var(--ink);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.brand-mark:hover {
  text-decoration: none;
}

.brand-crosshair {
  width: 22px;
  height: 22px;
  position: relative;
  border: 1.6px solid var(--accent-blue);
  border-radius: 5px;
  background: var(--surface);
  flex-shrink: 0;
}

.brand-crosshair::before,
.brand-crosshair::after {
  content: "";
  position: absolute;
  background: var(--accent-red);
}

.brand-crosshair::before {
  left: 50%;
  top: 3px;
  bottom: 3px;
  width: 1.5px;
  transform: translateX(-50%);
}

.brand-crosshair::after {
  top: 50%;
  left: 3px;
  right: 3px;
  height: 1.5px;
  transform: translateY(-50%);
}

.brand-pill {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-red);
  background: var(--accent-red-soft);
  border: 1px solid rgba(217, 68, 38, 0.25);
  padding: 0.14rem 0.5rem;
  border-radius: 999px;
}

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

.nav-links a {
  color: var(--ink-muted);
  font-size: 0.87rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s ease;
}

.nav-links a:hover {
  color: var(--ink);
  text-decoration: none;
}

.nav-ext-group {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.nav-ext-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.nav-ext-chip:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  text-decoration: none;
  transform: translateY(-1px);
}

.nav-pill-demo {
  background: var(--accent-teal);
  color: #fff !important;
  padding: 0.36rem 0.82rem;
  border-radius: 999px;
  font-size: 0.81rem !important;
  font-weight: 600 !important;
}

.nav-pill-demo:hover {
  background: #0c685b;
}

/* ---------- Buttons & Pills ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.56rem 0.98rem;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.855rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(20, 24, 31, 0.04);
  transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease, box-shadow 0.14s ease;
}

.btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: var(--ink);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #ffffff;
}

.btn-primary:hover {
  background: #143ed9;
  border-color: #143ed9;
}

.btn-dark {
  background: var(--ink);
  border-color: var(--ink);
  color: #ffffff;
}

.btn-dark:hover {
  background: #252b36;
  border-color: #252b36;
}

.btn-teal {
  background: var(--accent-teal);
  border-color: var(--accent-teal);
  color: #ffffff;
}

.btn-teal:hover {
  background: #0c685b;
  border-color: #0c685b;
}

.btn-sm {
  padding: 0.36rem 0.7rem;
  font-size: 0.78rem;
  border-radius: 7px;
}

/* ---------- Hero Academic Header ---------- */
.hero {
  padding: 2.75rem 0 2.5rem;
  border-bottom: 1px solid var(--border);
  background: radial-gradient(circle at 50% 0%, rgba(27, 77, 255, 0.055), transparent 62%);
}

.hero-masthead {
  text-align: center;
  max-width: 980px;
  margin: 0 auto 2.15rem;
}

.venue-strip {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
  margin-bottom: 1.05rem;
}

.venue-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.78rem;
  border-radius: 999px;
  background: var(--accent-red-soft);
  border: 1px solid rgba(217, 68, 38, 0.28);
  color: var(--accent-red);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.venue-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-red);
}

.venue-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.72rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.venue-meta-chip.doi-link {
  color: var(--accent-blue);
  border-color: var(--accent-blue-border);
  background: var(--accent-blue-soft);
}

.venue-meta-chip.doi-link:hover {
  text-decoration: none;
  border-color: var(--accent-blue);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.15rem, 4.3vw, 3.45rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.024em;
  margin: 0 0 0.85rem;
}

.hero-subtitle {
  font-size: 1.08rem;
  color: var(--ink-muted);
  max-width: 760px;
  margin: 0 auto 1.2rem;
}

.authors {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem 1.4rem;
  font-size: 1.02rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 0.4rem;
}

.authors sup {
  color: var(--accent-blue);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  margin-left: 1px;
}

.affiliations {
  color: var(--ink-muted);
  font-size: 0.87rem;
  line-height: 1.5;
  max-width: 820px;
  margin: 0 auto 1.45rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.58rem;
}

.cta-row.left {
  justify-content: flex-start;
}

/* ---------- Hero Interactive Multi-Case Teaser ---------- */
.hero-teaser-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 305px;
  gap: 1.15rem;
  align-items: stretch;
}

.frame-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.9rem;
  box-shadow: var(--shadow-md);
  position: relative;
}

.frame-card::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 7px;
  width: 9px;
  height: 9px;
  border-top: 1.5px solid var(--border-strong);
  border-left: 1.5px solid var(--border-strong);
  pointer-events: none;
}

.frame-card::after {
  content: "";
  position: absolute;
  bottom: 7px;
  right: 7px;
  width: 9px;
  height: 9px;
  border-bottom: 1.5px solid var(--border-strong);
  border-right: 1.5px solid var(--border-strong);
  pointer-events: none;
}

.frame-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-muted);
  margin-bottom: 0.6rem;
}

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

.cat-badge {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  white-space: nowrap;
  padding: 0.11rem 0.42rem;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
  border: 1px solid var(--accent-blue-border);
}

.cat-badge[data-cat="dir300"] {
  background: rgba(15, 123, 108, 0.1);
  color: var(--accent-teal);
  border-color: rgba(15, 123, 108, 0.28);
}

.cat-badge[data-cat="docreal"] {
  background: var(--accent-red-soft);
  color: var(--accent-red);
  border-color: rgba(217, 68, 38, 0.28);
}

.cat-badge[data-cat="uvdoc"] {
  background: rgba(107, 70, 193, 0.1);
  color: #5b37b7;
  border-color: rgba(107, 70, 193, 0.28);
}

.telemetry-pill {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--accent-teal);
  background: var(--accent-teal-soft);
  border: 1px solid rgba(15, 123, 108, 0.24);
  padding: 0.16rem 0.55rem;
  border-radius: 999px;
}

/* ---------- Compare Slider (aspect-safe contain!) ---------- */
.compare-box {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 540px;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: #ece8df;
  border: 1px solid var(--border);
  user-select: none;
}

.compare-box.hero-compare {
  aspect-ratio: 16 / 11;
  max-height: 460px;
}

.compare-box img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
  pointer-events: none;
}

.compare-after-wrap {
  position: absolute;
  inset: 0;
  clip-path: inset(0 0 0 50%);
  background: #ece8df;
  pointer-events: none;
}

.compare-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(20, 24, 31, 0.28), 0 0 12px rgba(0, 0, 0, 0.22);
  pointer-events: none;
}

.compare-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ink);
  color: #ffffff;
  border: 2px solid #ffffff;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.26);
  pointer-events: none;
}

.compare-tag {
  position: absolute;
  top: 12px;
  padding: 0.22rem 0.6rem;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.71rem;
  font-weight: 500;
  background: rgba(20, 24, 31, 0.82);
  color: #ffffff;
  pointer-events: none;
}

.compare-tag.left {
  left: 12px;
}

.compare-tag.right {
  right: 12px;
  background: rgba(27, 77, 255, 0.9);
}

.compare-range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
  z-index: 5;
}

/* ---------- Sidebar Visual Case Rails ---------- */
.case-rail-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.85rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.72rem;
  min-width: 0;
}

.rail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.rail-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink);
}

.rail-sub {
  font-family: var(--font-mono);
  font-size: 0.71rem;
  color: var(--ink-muted);
}

.case-rail-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  overflow-y: auto;
  max-height: 410px;
  padding-right: 0.2rem;
}

.case-rail-list.tall {
  max-height: 615px;
}

.case-rail-list::-webkit-scrollbar {
  width: 6px;
}

.case-rail-list::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 999px;
}

.rail-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 0.65rem;
  align-items: center;
  padding: 0.5rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: border-color 0.14s ease, background 0.14s ease, transform 0.12s ease, box-shadow 0.14s ease;
}

.rail-card:hover {
  border-color: var(--accent-blue);
  background: #ffffff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.rail-card.active {
  border-color: var(--accent-blue);
  background: var(--accent-blue-soft);
  box-shadow: 0 0 0 1px var(--accent-blue);
}

.rail-thumb {
  width: 64px;
  height: 76px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #e9e4da;
}

.rail-card-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.rail-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}

.rail-card-title {
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rail-card-sub {
  font-size: 0.77rem;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rail-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin-top: 0.15rem;
}

.rail-score {
  font-family: var(--font-mono);
  font-size: 0.69rem;
  color: var(--accent-teal);
  font-weight: 600;
}

.rail-run-btn {
  border: 1px solid var(--accent-blue-border);
  background: #ffffff;
  color: var(--accent-blue);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.14rem 0.42rem;
  border-radius: 5px;
  cursor: pointer;
}

.rail-run-btn:hover {
  background: var(--accent-blue);
  color: #ffffff;
}

.rail-footer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--border);
}

/* ---------- Hero KPI Strip ---------- */
.kpi-strip {
  margin-top: 1.35rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow-sm);
}

.kpi-val {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--accent-blue);
  line-height: 1.15;
}

.kpi-card.teal .kpi-val {
  color: var(--accent-teal);
}

.kpi-card.red .kpi-val {
  color: var(--accent-red);
}

.kpi-card.ink .kpi-val {
  color: var(--ink);
}

.kpi-label {
  font-size: 0.82rem;
  color: var(--ink-muted);
  margin-top: 0.2rem;
}

/* ---------- Content Bands & Headers ---------- */
.band {
  padding: 3.4rem 0;
  border-bottom: 1px solid var(--border);
}

.band.alt {
  background: rgba(255, 255, 255, 0.56);
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.55rem;
}

.section-kicker {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-blue);
  margin-bottom: 0.28rem;
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 2.7vw, 2.15rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0;
}

/* ---------- Abstract + Highlights ---------- */
.abstract-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 1.25rem;
  align-items: start;
}

.abstract-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent-blue);
  border-radius: var(--radius-md);
  padding: 1.45rem 1.65rem;
  box-shadow: var(--shadow-sm);
}

.tldr-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.3rem 1.4rem;
  box-shadow: var(--shadow-sm);
}

.tldr-card h3 {
  margin: 0 0 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-blue);
}

.tldr-list {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 0.91rem;
  color: var(--ink-muted);
}

.tldr-list li + li {
  margin-top: 0.55rem;
}

.tldr-list strong {
  color: var(--ink);
}

/* ---------- Contributions / Method Cards ---------- */
.contrib-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.05rem;
  margin-bottom: 1.75rem;
}

.contrib-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  border-top: 3px solid var(--accent-blue);
  box-shadow: var(--shadow-sm);
}

.contrib-card.accent-red {
  border-top-color: var(--accent-red);
}

.contrib-card.accent-teal {
  border-top-color: var(--accent-teal);
}

.contrib-phase {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  margin-bottom: 0.35rem;
}

.contrib-card h3 {
  margin: 0 0 0.45rem;
  font-size: 1.06rem;
}

.contrib-card p {
  margin: 0 0 0.7rem;
  color: var(--ink-muted);
  font-size: 0.92rem;
}

.math-box {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  font-size: 0.85rem;
  overflow-x: auto;
}

/* ---------- Figures + Lightbox Click ---------- */
.figure-stack {
  display: grid;
  gap: 1.45rem;
}

.figure-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.figure-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.95rem;
  box-shadow: var(--shadow-sm);
}

.zoomable-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #ffffff;
  cursor: zoom-in;
}

.zoomable-wrap img {
  width: 100%;
  transition: transform 0.25s ease;
}

.zoomable-wrap:hover img {
  transform: scale(1.012);
}

.zoom-hint {
  position: absolute;
  right: 10px;
  bottom: 10px;
  background: rgba(20, 24, 31, 0.82);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.69rem;
  padding: 0.2rem 0.52rem;
  border-radius: 5px;
  opacity: 0;
  transition: opacity 0.18s ease;
  pointer-events: none;
}

.zoomable-wrap:hover .zoom-hint {
  opacity: 1;
}

.figure-caption {
  margin-top: 0.72rem;
  font-size: 0.88rem;
  color: var(--ink-muted);
}

.figure-caption strong {
  color: var(--ink);
}

/* ---------- Segmented Filter / Mode Tabs ---------- */
.showcase-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.15rem;
}

.tab-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  background: var(--bg-paper-alt);
  padding: 0.26rem;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.tab-group.compact {
  padding: 0.2rem;
  gap: 0.15rem;
  flex-wrap: nowrap;
}

.tab-btn {
  border: 0;
  background: transparent;
  padding: 0.4rem 0.78rem;
  border-radius: 7px;
  font-family: var(--font-mono);
  font-size: 0.77rem;
  font-weight: 500;
  color: var(--ink-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.14s ease, color 0.14s ease;
}

.tab-group.compact .tab-btn {
  padding: 0.24rem 0.42rem;
  font-size: 0.67rem;
}

.tab-btn.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.09);
  font-weight: 600;
}

/* ---------- Qualitative Inspection 2-Column Stage ---------- */
.showcase-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1.2rem;
  align-items: start;
}

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

.three-up-card {
  background: #ece8df;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.three-up-card header {
  padding: 0.42rem 0.65rem;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.71rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.three-up-card img {
  width: 100%;
  height: 360px;
  object-fit: contain;
  padding: 6px;
  cursor: zoom-in;
}

.metric-bar {
  margin-top: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: space-between;
  gap: 0.65rem;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
  flex: 1;
  min-width: 420px;
}

.metric-tile {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 0.52rem 0.68rem;
}

.metric-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--ink-muted);
  text-transform: uppercase;
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--ink);
  margin-top: 0.1rem;
}

.metric-value.highlight {
  color: var(--accent-teal);
}

/* ---------- Live Inference Studio (2-Column with 12-Sample Rail) ---------- */
.studio-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-md);
}

.status-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.72rem 0.95rem;
  background: var(--bg-paper-alt);
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-bottom: 1.1rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.79rem;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #b88b19;
  flex-shrink: 0;
}

.status-dot.online {
  background: var(--accent-teal);
  box-shadow: 0 0 0 3px rgba(15, 123, 108, 0.16);
}

.status-dot.offline {
  background: var(--accent-red);
}

.endpoint-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.input-text,
.input-select {
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 0.42rem 0.65rem;
  font-size: 0.82rem;
  background: var(--surface);
  color: var(--ink);
}

.studio-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1.2rem;
  align-items: start;
}

.studio-workspace {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  min-width: 0;
}

.studio-controls-row {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr;
  gap: 0.75rem;
  align-items: stretch;
}

.drop-zone {
  border: 2px dashed var(--border-strong);
  border-radius: 11px;
  padding: 0.78rem 0.95rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  background: var(--surface-soft);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--accent-blue);
  background: var(--accent-blue-soft);
}

.control-box {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 0.62rem 0.78rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.control-box label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.71rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  margin-bottom: 0.3rem;
}

.studio-action-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.studio-run-cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

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

.preview-pane {
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #ece8df;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.preview-pane header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.48rem 0.78rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-muted);
  background: var(--surface-soft);
  border-bottom: 1px solid var(--border);
}

.preview-pane .pane-body {
  height: 410px;
  display: grid;
  place-items: center;
  padding: 0.5rem;
}

.preview-pane img {
  max-height: 392px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  cursor: zoom-in;
}

.placeholder-text {
  color: var(--ink-muted);
  font-size: 0.86rem;
  text-align: center;
  padding: 1rem;
}

.infer-meta-bar {
  font-family: var(--font-mono);
  font-size: 0.77rem;
  color: var(--ink-muted);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.48rem 0.75rem;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ---------- Benchmark Tables ---------- */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}

table.quant-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.845rem;
  font-variant-numeric: tabular-nums;
}

.quant-table th,
.quant-table td {
  padding: 0.56rem 0.58rem;
  text-align: center;
  border-bottom: 1px solid #ede8de;
  white-space: nowrap;
}

.quant-table th:first-child,
.quant-table td:first-child {
  text-align: left;
  padding-left: 1rem;
  font-weight: 500;
}

.quant-table thead th {
  background: #f5f1e8;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--ink-muted);
  border-bottom: 1px solid var(--border);
}

.quant-table .group-sep {
  border-left: 1px solid var(--border);
}

.quant-table tr.section-divider td {
  border-top: 2px solid var(--border-strong);
}

.quant-table tr.row-ours {
  background: rgba(27, 77, 255, 0.065);
  font-weight: 600;
}

.quant-table tr.row-impr {
  background: rgba(15, 123, 108, 0.065);
  font-family: var(--font-mono);
  font-size: 0.79rem;
  color: var(--accent-teal);
  font-weight: 600;
}

.best {
  font-weight: 700;
  color: var(--accent-blue);
}

.second {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hidden-col {
  display: none;
}

.repro-banner {
  margin-top: 1rem;
  background: var(--surface);
  border: 1px solid rgba(15, 123, 108, 0.3);
  border-left: 4px solid var(--accent-teal);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.15rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.87rem;
}

.repro-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
}

.repro-chip {
  background: var(--accent-teal-soft);
  color: var(--accent-teal);
  padding: 0.24rem 0.55rem;
  border-radius: 6px;
  font-weight: 600;
}

/* ---------- Citation, Resources & Acknowledgments ---------- */
.bib-block {
  position: relative;
  background: #14181f;
  color: #edf1f7;
  border-radius: var(--radius-md);
  padding: 1.2rem 1.35rem;
  font-family: var(--font-mono);
  font-size: 0.83rem;
  line-height: 1.55;
  overflow-x: auto;
}

.copy-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(255, 255, 255, 0.13);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 7px;
  padding: 0.32rem 0.72rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  cursor: pointer;
}

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

.resources-grid {
  margin-top: 1.4rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}

.resource-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.95rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}

.resource-card:hover {
  border-color: var(--accent-blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}

.resource-card .res-tag {
  font-family: var(--font-mono);
  font-size: 0.69rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-blue);
  font-weight: 600;
}

.resource-card .res-title {
  font-weight: 600;
  font-size: 0.94rem;
}

.resource-card .res-desc {
  font-size: 0.81rem;
  color: var(--ink-muted);
}

.ack-box {
  margin-top: 1.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  font-size: 0.88rem;
  color: var(--ink-muted);
}

footer {
  padding: 2rem 0;
  font-size: 0.84rem;
  color: var(--ink-muted);
}

/* ---------- Lightbox Modal ---------- */
.lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(15, 19, 26, 0.86);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.lightbox-modal.open {
  display: flex;
}

.lightbox-inner {
  position: relative;
  max-width: min(1160px, 94vw);
  max-height: 92vh;
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 0.9rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.lightbox-inner img {
  max-height: 79vh;
  max-width: 100%;
  width: auto;
  object-fit: contain;
  margin: 0 auto;
  border-radius: 6px;
}

.lightbox-caption {
  font-size: 0.86rem;
  color: var(--ink-muted);
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.lightbox-close:hover {
  background: var(--ink);
  color: #ffffff;
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .hero-teaser-stage,
  .showcase-stage,
  .studio-main-grid {
    grid-template-columns: 1fr;
  }

  .case-rail-list,
  .case-rail-list.tall {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    max-height: 360px;
  }

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

@media (max-width: 900px) {
  .abstract-grid,
  .contrib-grid,
  .figure-two-col,
  .studio-controls-row,
  .kpi-strip {
    grid-template-columns: 1fr;
  }

  .metric-strip {
    min-width: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .three-up-grid,
  .studio-output-grid {
    grid-template-columns: 1fr;
  }

  .nav-ext-group {
    display: none;
  }
}
