/* ==========================================================================
   Low-Saturation Academic Editorial Design System
   Harmonized with RA GWAS & Post-GWAS Manuscript Figures
   ========================================================================== */

:root {
  --bg: #f5f6f3;
  --bg-alt: #edf0ec;
  --card: #ffffff;
  --card-soft: #f9faf8;
  --line: #d9e0e3;
  --line-strong: #c2ccd2;

  --ink: #223542;
  --ink-strong: #17252f;
  --ink-soft: #4b5e6b;
  --ink-muted: #70818d;

  --steel: #346387;
  --steel-light: #5f87a6;
  --steel-tint: #ecf2f7;

  --sage: #357054;
  --sage-light: #5c9176;
  --sage-tint: #ebf4ef;

  --terra: #a24e47;
  --terra-light: #c1736c;
  --terra-tint: #f7eeed;

  --ochre: #b0843f;
  --ochre-light: #caa362;
  --ochre-tint: #f7f2e8;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;

  --shadow-subtle: 0 1px 2px rgba(23, 37, 47, 0.04), 0 8px 24px -12px rgba(23, 37, 47, 0.08);
  --shadow-hover: 0 4px 12px rgba(23, 37, 47, 0.06), 0 18px 36px -14px rgba(23, 37, 47, 0.12);

  --font-serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", Georgia, serif;
  --font-sans: "PingFang SC", "Hiragino Sans GB", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", ui-monospace, Menlo, Monaco, Consolas, monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-silk: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.72;
  max-width: 100%;
  overflow-x: clip;
}

/* Subtle dot-grid paper grain on canvas */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image: radial-gradient(rgba(34, 53, 66, 0.045) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.7;
}

/* Top Reading Progress Bar */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 1000;
  background: rgba(34, 53, 66, 0.06);
}
.reading-progress__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--steel), var(--ochre), var(--sage));
  transition: width 80ms linear;
}

/* Sticky Top Navigation */
.topbar {
  position: sticky;
  top: 0;
  z-index: 900;
  background: rgba(245, 246, 243, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar__inner {
  max-width: 1260px;
  margin: 0 auto;
  padding: 0.72rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--ink-strong);
  font-weight: 600;
  font-size: 0.94rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.brand__mark {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.stage-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.stage-nav::-webkit-scrollbar { display: none; }
.stage-nav__link {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.82rem;
  padding: 0.36rem 0.68rem;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: color 220ms var(--ease), background-color 220ms var(--ease), border-color 220ms var(--ease);
}
.stage-nav__link span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  opacity: 0.65;
  margin-right: 0.3rem;
}
.stage-nav__link:hover {
  color: var(--ink-strong);
  background: rgba(34, 53, 66, 0.05);
}
.stage-nav__link.is-active {
  color: var(--ink-strong);
  background: var(--card);
  border-color: var(--line-strong);
  box-shadow: 0 1px 4px rgba(23, 37, 47, 0.06);
  font-weight: 600;
}
.topbar__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.btn-ghost {
  appearance: none;
  background: var(--card);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition: all 220ms var(--ease);
  white-space: nowrap;
}
.btn-ghost:hover {
  border-color: var(--steel);
  color: var(--steel);
  transform: translateY(-1px);
}

/* ==========================================================================
   Hero Section with Ambient Genomic Canvas
   ========================================================================== */
.hero {
  position: relative;
  overflow: hidden;
  padding: 4.5rem 1.5rem 3.8rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #f0f3f0 0%, var(--bg) 100%);
}
.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.88;
}
.hero__inner {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--steel);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  margin-bottom: 1.4rem;
}
.eyebrow__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sage);
  box-shadow: 0 0 0 3px rgba(53, 112, 84, 0.18);
  animation: gentlePulse 3.2s infinite ease-in-out;
}
@keyframes gentlePulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.65; }
}
.hero__title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 3.8vw, 3.25rem);
  font-weight: 700;
  line-height: 1.24;
  color: var(--ink-strong);
  margin: 0 0 1rem;
  max-width: 980px;
  letter-spacing: -0.01em;
}
.hero__subtitle {
  font-size: clamp(1rem, 1.35vw, 1.16rem);
  color: var(--ink-soft);
  max-width: 820px;
  margin: 0 0 1.6rem;
}
.hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem 1.8rem;
  font-size: 0.88rem;
  color: var(--ink-muted);
  margin-bottom: 2.5rem;
}
.hero__meta strong {
  color: var(--ink);
  font-weight: 600;
}

/* KPI Ribbon */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.9rem;
  margin-bottom: 2.6rem;
}
.kpi-card {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-top: 2.5px solid var(--steel);
  border-radius: var(--radius-md);
  padding: 1rem 1.05rem;
  transition: transform 280ms var(--ease), box-shadow 280ms var(--ease), border-color 280ms var(--ease);
}
.kpi-card:nth-child(3) { border-top-color: var(--terra); }
.kpi-card:nth-child(4) { border-top-color: var(--ochre); }
.kpi-card:nth-child(5) { border-top-color: var(--steel-light); }
.kpi-card:nth-child(6) { border-top-color: var(--sage); }
.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}
.kpi-card__value {
  font-family: var(--font-mono);
  font-size: 1.42rem;
  font-weight: 700;
  color: var(--ink-strong);
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}
.kpi-card__label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  margin-top: 0.25rem;
}
.kpi-card__detail {
  font-size: 0.74rem;
  color: var(--ink-muted);
  margin-top: 0.2rem;
  line-height: 1.4;
}

/* Interactive 6-Stage Progression Pipeline Strip */
.pipeline-map {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.4rem;
  box-shadow: var(--shadow-subtle);
}
.pipeline-map__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: 0.45rem 1rem;
}
.pipeline-map__label {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.pipeline-map__hint {
  font-size: 0.78rem;
  color: var(--steel);
}
.pipeline-steps {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.65rem;
  position: relative;
}
.pipeline-step {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  padding: 0.85rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--card-soft);
  text-decoration: none;
  color: inherit;
  transition: all 260ms var(--ease);
}
.pipeline-step:hover {
  background: var(--card);
  border-color: var(--steel);
  transform: translateY(-2px);
  box-shadow: var(--shadow-subtle);
}
.pipeline-step__num {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--steel);
}
.pipeline-step__arrow {
  color: var(--ink-muted);
  transition: transform 220ms var(--ease);
}
.pipeline-step:hover .pipeline-step__arrow {
  transform: translateX(3px);
  color: var(--steel);
}
.pipeline-step__title {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-strong);
  line-height: 1.32;
}
.pipeline-step__metric {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-muted);
  margin-top: auto;
  padding-top: 0.3rem;
}

/* ==========================================================================
   Main Container & Stage Sections
   ========================================================================== */
.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem 5rem;
}

.stage {
  position: relative;
  padding: 2.0rem 0 2.4rem;
  scroll-margin-top: 132px;
  transition: opacity 540ms var(--ease-silk), transform 620ms var(--ease-silk);
}
.stage:last-of-type {
  padding-bottom: 1.5rem;
}

/* Soft focus elevation as user transitions between modules on desktop */
@media (min-width: 821px) {
  .stage.is-entered:not(.is-current) {
    opacity: 0.88;
    transform: translate3d(0, 4px, 0);
  }
  .stage.is-entered.is-current {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes badgeArrive {
  0%   { box-shadow: 0 0 0 0 rgba(52, 99, 135, 0.28); transform: scale(0.95); }
  55%  { box-shadow: 0 0 0 11px rgba(52, 99, 135, 0.08); transform: scale(1.03); }
  100% { box-shadow: 0 0 0 6px rgba(52, 99, 135, 0.12); transform: scale(1); }
}
.stage.is-arriving .stage__badge {
  animation: badgeArrive 720ms var(--ease-silk) both;
}

/* Animated Stage Transition Bridge between modules */
.stage-bridge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 0;
  gap: 0.45rem;
  user-select: none;
}
.stage-bridge__line {
  width: 1.5px;
  height: 26px;
  background: linear-gradient(180deg, rgba(34, 53, 66, 0.08), rgba(52, 99, 135, 0.42));
  transform-origin: top center;
  transform: scaleY(0);
  opacity: 0;
  transition: transform 640ms var(--ease-silk), opacity 500ms var(--ease-silk);
}
.stage-bridge__line--bot {
  background: linear-gradient(180deg, rgba(52, 99, 135, 0.42), rgba(34, 53, 66, 0.08));
  transition-delay: 240ms;
}
.stage-bridge__pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.32rem 0.92rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.73rem;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
  box-shadow: 0 2px 10px -4px rgba(23, 37, 47, 0.08);
  opacity: 0;
  transform: translate3d(0, 12px, 0) scale(0.95);
  transition: opacity 620ms var(--ease-silk) 120ms, transform 720ms var(--ease-silk) 120ms, border-color 350ms var(--ease), box-shadow 350ms var(--ease);
}
.stage-bridge__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink);
  display: inline-block;
  flex-shrink: 0;
}
.stage-bridge.is-active .stage-bridge__line {
  transform: scaleY(1);
  opacity: 1;
}
.stage-bridge.is-active .stage-bridge__pill {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}
.stage-bridge.is-current-bridge .stage-bridge__pill {
  border-color: var(--steel-light);
  color: var(--ink-strong);
  box-shadow: 0 4px 16px -6px rgba(52, 99, 135, 0.24);
}

.stage__header {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1.1rem 1.4rem;
  align-items: start;
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
}
.stage__header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--steel-light), var(--line) 48%, transparent);
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 920ms var(--ease-silk) 160ms;
}
.stage__header.is-visible::after {
  transform: scaleX(1);
}
.stage__badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.stage__badge--steel { background: var(--steel); }
.stage__badge--terra { background: var(--terra); }
.stage__badge--ochre { background: var(--ochre); }
.stage__badge--sage  { background: var(--sage); }

.stage__kicker {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.25rem;
}
.stage__title {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 2.3vw, 2.05rem);
  font-weight: 700;
  color: var(--ink-strong);
  margin: 0 0 0.5rem;
  line-height: 1.3;
}
.stage__lead {
  color: var(--ink-soft);
  max-width: 820px;
  margin: 0;
  font-size: 0.98rem;
}

/* Editorial Layouts & Cards */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.4rem;
  margin-bottom: 1.5rem;
}
.grid-12 {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 1.4rem;
  margin-bottom: 1.5rem;
}
.grid-21 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 1.4rem;
  margin-bottom: 1.5rem;
}

.panel, .stage > *, .figure-plate > * {
  min-width: 0;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.65rem;
  box-shadow: var(--shadow-subtle);
}
.panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.9rem;
  margin-bottom: 1.15rem;
  border-bottom: 1px solid var(--line);
}
.panel__title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink-strong);
  margin: 0;
}
.panel__sub {
  font-size: 0.82rem;
  color: var(--ink-muted);
}

/* Insight Callouts */
.callout {
  background: var(--steel-tint);
  border: 1px solid rgba(52, 99, 135, 0.2);
  border-left: 3.5px solid var(--steel);
  border-radius: var(--radius-md);
  padding: 1rem 1.2rem;
  font-size: 0.9rem;
  color: var(--ink);
  margin-top: 1.1rem;
}
.callout--sage {
  background: var(--sage-tint);
  border-color: rgba(53, 112, 84, 0.22);
  border-left-color: var(--sage);
}
.callout--terra {
  background: var(--terra-tint);
  border-color: rgba(162, 78, 71, 0.22);
  border-left-color: var(--terra);
}
.callout--ochre {
  background: var(--ochre-tint);
  border-color: rgba(176, 132, 63, 0.24);
  border-left-color: var(--ochre);
}
.callout strong { color: var(--ink-strong); }

/* Pills & Segmented Controls */
.tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  background: var(--bg-alt);
  padding: 0.28rem;
  border-radius: 10px;
  border: 1px solid var(--line);
}
.tab-btn {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--font-sans);
  font-size: 0.81rem;
  font-weight: 500;
  padding: 0.42rem 0.82rem;
  border-radius: 7px;
  cursor: pointer;
  transition: all 200ms var(--ease);
}
.tab-btn:hover {
  color: var(--ink-strong);
}
.tab-btn.is-active {
  background: var(--card);
  color: var(--ink-strong);
  border-color: var(--line);
  box-shadow: 0 1px 3px rgba(23, 37, 47, 0.08);
  font-weight: 600;
}

/* ==========================================================================
   Stage 01: Interactive QC Funnel & Phenotype Card
   ========================================================================== */
.funnel-list {
  display: flex;
  flex-direction: column;
  gap: 0.72rem;
}
.funnel-row {
  padding: 0.65rem 0.8rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: var(--card-soft);
  cursor: pointer;
  transition: all 220ms var(--ease);
}
.funnel-row:hover, .funnel-row.is-active {
  background: var(--steel-tint);
  border-color: rgba(52, 99, 135, 0.25);
}
.funnel-row__top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  font-size: 0.86rem;
  margin-bottom: 0.38rem;
}
.funnel-row__step { font-weight: 600; color: var(--ink-strong); }
.funnel-row__nums {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--steel);
  white-space: nowrap;
}
.funnel-row__excl {
  color: var(--terra);
  font-size: 0.74rem;
  margin-right: 0.45rem;
}
.bar-track {
  height: 9px;
  background: var(--bg-alt);
  border-radius: 999px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--ink), var(--steel));
  width: 0%;
  transition: width 950ms var(--ease);
}
.funnel-note {
  margin-top: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--ink-soft);
  min-height: 54px;
}

.pheno-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}
.mini-stat {
  background: var(--card-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.72rem 0.85rem;
}
.mini-stat__label {
  font-size: 0.74rem;
  color: var(--ink-muted);
}
.mini-stat__val {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink-strong);
  margin-top: 0.15rem;
}

/* ==========================================================================
   Annotated Figure Plate Viewer
   ========================================================================== */
.figure-plate {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-subtle);
  margin-top: 1.4rem;
}
.figure-plate__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1.35rem;
  background: var(--card-soft);
  border-bottom: 1px solid var(--line);
}
.figure-plate__body {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 0.9fr);
  align-items: stretch;
}
.figure-plate__media {
  position: relative;
  background: #ffffff;
  padding: 1.35rem 1.35rem 2.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-in;
  border-right: 1px solid var(--line);
  min-height: 340px;
}
.figure-plate__img {
  max-width: 100%;
  max-height: 540px;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: opacity 240ms var(--ease), transform 340ms var(--ease);
}
.figure-plate__media:hover .figure-plate__img {
  transform: scale(1.012);
}
.figure-plate__zoom-hint {
  position: absolute;
  bottom: 0.55rem;
  right: 0.9rem;
  background: rgba(34, 53, 66, 0.86);
  color: #fff;
  font-size: 0.72rem;
  padding: 0.24rem 0.65rem;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms var(--ease);
}
.figure-plate__media:hover .figure-plate__zoom-hint {
  opacity: 1;
}
.figure-plate__info {
  padding: 1.45rem 1.55rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  background: var(--card-soft);
}
.figure-plate__tag {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--steel);
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}
.figure-plate__title {
  font-family: var(--font-serif);
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--ink-strong);
  margin: 0 0 0.65rem;
  line-height: 1.4;
}
.figure-plate__caption {
  font-size: 0.87rem;
  color: var(--ink-soft);
  margin: 0 0 0.9rem;
  line-height: 1.68;
}
.takeaway-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.takeaway-list li {
  position: relative;
  padding-left: 1.1rem;
  font-size: 0.84rem;
  color: var(--ink);
  line-height: 1.55;
}
.takeaway-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.56em;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--sage);
}

/* ==========================================================================
   Data Tables & Lead Cards
   ========================================================================== */
.data-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  background: var(--card);
}
.data-table th {
  text-align: left;
  font-weight: 600;
  color: var(--ink);
  background: var(--bg-alt);
  padding: 0.68rem 0.85rem;
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}
.data-table td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr {
  transition: background-color 180ms var(--ease);
}
.data-table tbody tr:hover {
  background: var(--steel-tint);
}
.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.16rem 0.56rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge--sage  { background: var(--sage-tint);  color: var(--sage); }
.badge--steel { background: var(--steel-tint); color: var(--steel); }
.badge--terra { background: var(--terra-tint); color: var(--terra); }
.badge--ochre { background: var(--ochre-tint); color: var(--ochre); }
.badge--muted { background: var(--bg-alt);     color: var(--ink-muted); }

/* ==========================================================================
   Stage 03: Dynamic SVG Forest Plot & SE Gradient
   ========================================================================== */
.forest-svg-wrap {
  width: 100%;
  overflow-x: auto;
}
.forest-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-bottom: 0.6rem;
}
.forest-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.forest-legend__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.se-gradient {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.se-row__head {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}
.se-row__val {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--terra);
}
.se-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--ochre), var(--terra));
  width: 0%;
  transition: width 950ms var(--ease);
}

/* ==========================================================================
   Stage 04: Interactive Multi-Method PIP Bars
   ========================================================================== */
.pip-bars {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin: 1rem 0;
}
.pip-bar-row {
  display: grid;
  grid-template-columns: 155px 1fr 56px;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.84rem;
}
.pip-bar-row__track {
  height: 12px;
  background: var(--bg-alt);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.pip-bar-row__fill {
  height: 100%;
  border-radius: 999px;
  background: var(--steel);
  transition: width 650ms var(--ease), background-color 300ms var(--ease);
}
.pip-bar-row__fill--highlight {
  background: var(--sage);
}
.pip-bar-row__fill--ochre {
  background: var(--ochre);
}
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.5rem;
}
.chip {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  padding: 0.22rem 0.62rem;
  border-radius: 6px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  color: var(--ink);
}
.chip--lead {
  background: var(--steel-tint);
  border-color: rgba(52, 99, 135, 0.35);
  color: var(--steel);
  font-weight: 600;
}

/* ==========================================================================
   Stage 05: cTWAS Forensic Sensitivity Audit Morphing Widget
   ========================================================================== */
.audit-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 1.1rem;
}
.audit-list {
  display: flex;
  flex-direction: column;
  gap: 0.72rem;
}
.audit-row {
  display: grid;
  grid-template-columns: 112px 1fr 78px 136px;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  background: var(--card-soft);
  border: 1px solid var(--line);
  transition: border-color 220ms var(--ease), background-color 220ms var(--ease);
}
.audit-row:hover {
  border-color: var(--line-strong);
  background: var(--card);
}
.audit-row__gene {
  font-weight: 700;
  color: var(--ink-strong);
  font-size: 0.92rem;
}
.audit-row__sub {
  font-size: 0.73rem;
  color: var(--ink-muted);
  margin-top: 0.12rem;
}
.audit-track {
  position: relative;
  height: 14px;
  background: var(--bg-alt);
  border-radius: 999px;
  overflow: hidden;
}
.audit-ghost {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: rgba(34, 53, 66, 0.13);
  border-radius: 999px;
  transition: width 600ms var(--ease);
}
.audit-fill {
  position: relative;
  height: 100%;
  border-radius: 999px;
  transition: width 700ms var(--ease), background-color 350ms var(--ease);
}
.audit-fill--retained  { background: var(--sage); }
.audit-fill--downgraded { background: var(--terra); }
.audit-fill--baseline  { background: var(--steel); }
.audit-val {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 700;
  text-align: right;
  color: var(--ink-strong);
}

/* ==========================================================================
   Synthesis & Footer
   ========================================================================== */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.1rem;
  margin-top: 1.5rem;
}
.summary-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 3px solid var(--ink);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-subtle);
}
.summary-card:nth-child(2) { border-top-color: var(--terra); }
.summary-card:nth-child(3) { border-top-color: var(--ochre); }
.summary-card:nth-child(4) { border-top-color: var(--sage); }
.summary-card__num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-muted);
  margin-bottom: 0.4rem;
}
.summary-card__title {
  font-family: var(--font-serif);
  font-size: 1.04rem;
  font-weight: 700;
  color: var(--ink-strong);
  margin: 0 0 0.5rem;
}
.summary-card__body {
  font-size: 0.86rem;
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.62;
}

.footer {
  background: var(--ink);
  color: rgba(255, 255, 255, 0.82);
  padding: 3rem 1.5rem;
  margin-top: 2rem;
}
.footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 2rem;
  font-size: 0.86rem;
}
.footer h3 {
  font-family: var(--font-serif);
  color: #fff;
  margin: 0 0 0.7rem;
  font-size: 1.1rem;
}
.footer p { margin: 0 0 0.6rem; line-height: 1.65; }
.footer__refs {
  font-size: 0.79rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.75;
}

/* ==========================================================================
   Silky Choreographed Scroll Reveal & Module Switch Motion
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translate3d(0, 30px, 0) scale(0.988);
  transition: opacity 780ms var(--ease-silk), transform 880ms var(--ease-silk);
  will-change: transform, opacity;
}
.reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

/* Choreographed Stage Header internal cascade */
.stage__header.reveal {
  transform: none;
  opacity: 1;
}
.stage__header.reveal .stage__badge {
  opacity: 0;
  transform: translate3d(0, 18px, 0) scale(0.84);
  transition: opacity 640ms var(--ease-silk), transform 780ms var(--ease-silk), box-shadow 480ms var(--ease);
}
.stage__header.reveal .stage__kicker {
  opacity: 0;
  transform: translate3d(0, 14px, 0);
  transition: opacity 620ms var(--ease-silk) 70ms, transform 740ms var(--ease-silk) 70ms;
}
.stage__header.reveal .stage__title {
  opacity: 0;
  transform: translate3d(0, 22px, 0);
  filter: blur(3px);
  transition: opacity 740ms var(--ease-silk) 130ms, transform 840ms var(--ease-silk) 130ms, filter 720ms var(--ease-silk) 130ms;
}
.stage__header.reveal .stage__lead {
  opacity: 0;
  transform: translate3d(0, 18px, 0);
  transition: opacity 740ms var(--ease-silk) 210ms, transform 840ms var(--ease-silk) 210ms;
}
.stage__header.is-visible .stage__badge,
.stage__header.is-visible .stage__kicker,
.stage__header.is-visible .stage__title,
.stage__header.is-visible .stage__lead {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  filter: blur(0);
}
.stage.is-current .stage__badge {
  box-shadow: 0 0 0 6px rgba(52, 99, 135, 0.13);
}

/* Staggered child panels inside 2-column grids and summary grids */
.grid-2.reveal,
.grid-12.reveal,
.summary-grid.reveal {
  opacity: 1;
  transform: none;
}
.grid-2.reveal > .panel,
.grid-12.reveal > .panel,
.summary-grid.reveal > .summary-card {
  opacity: 0;
  transform: translate3d(0, 32px, 0) scale(0.985);
  transition: opacity 780ms var(--ease-silk), transform 880ms var(--ease-silk);
}
.grid-2.reveal > .panel:nth-child(2),
.grid-12.reveal > .panel:nth-child(2) {
  transition-delay: 130ms;
}
.summary-grid.reveal > .summary-card:nth-child(2) { transition-delay: 95ms; }
.summary-grid.reveal > .summary-card:nth-child(3) { transition-delay: 190ms; }
.summary-grid.reveal > .summary-card:nth-child(4) { transition-delay: 285ms; }

.grid-2.is-visible > .panel,
.grid-12.is-visible > .panel,
.summary-grid.is-visible > .summary-card {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

/* Silky Figure Plate image settle + caption cascade */
.figure-plate.reveal .figure-plate__img {
  opacity: 0;
  transform: scale(1.035);
  transition: opacity 820ms var(--ease-silk) 110ms, transform 1050ms var(--ease-silk) 110ms;
}
.figure-plate.reveal .figure-plate__info {
  opacity: 0;
  transform: translate3d(18px, 0, 0);
  transition: opacity 760ms var(--ease-silk) 190ms, transform 880ms var(--ease-silk) 190ms;
}
.figure-plate.is-visible .figure-plate__img {
  opacity: 1;
  transform: scale(1);
}
.figure-plate.is-visible .figure-plate__media:hover .figure-plate__img {
  transform: scale(1.014);
  transition-duration: 320ms;
  transition-delay: 0ms;
}
.figure-plate.is-visible .figure-plate__info {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* Smooth cross-fade when switching interactive tabs & figures */
@keyframes panelSwap {
  from { opacity: 0; transform: translate3d(0, 8px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}
.is-swapping {
  animation: panelSwap 360ms var(--ease-silk) both;
}

/* Floating Stage Transition Dock (bottom-right) */
.stage-dock {
  position: fixed;
  right: 1.4rem;
  bottom: 1.4rem;
  z-index: 880;
  display: flex;
  align-items: center;
  gap: 0.72rem;
  padding: 0.5rem 0.7rem 0.5rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line-strong);
  box-shadow: 0 8px 28px -8px rgba(23, 37, 47, 0.16);
  opacity: 0;
  transform: translate3d(0, 18px, 0) scale(0.96);
  pointer-events: none;
  transition: opacity 420ms var(--ease-silk), transform 520ms var(--ease-silk);
}
.stage-dock.is-shown {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  pointer-events: auto;
}
.stage-dock__ring {
  position: relative;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.stage-dock__ring svg { display: block; }
#dockRingFill {
  transition: stroke-dashoffset 140ms linear;
}
.stage-dock__num {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--ink-strong);
}
.stage-dock__meta {
  min-width: 138px;
  max-width: 185px;
  overflow: hidden;
}
.stage-dock__kicker {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  line-height: 1.1;
}
.stage-dock__title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
}
.stage-dock__nav {
  display: flex;
  gap: 0.28rem;
}
.stage-dock__btn {
  appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card-soft);
  color: var(--ink);
  font-size: 0.82rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 200ms var(--ease);
}
.stage-dock__btn:hover:not(:disabled) {
  background: var(--steel);
  border-color: var(--steel);
  color: #fff;
  transform: translateY(-1px);
}
.stage-dock__btn:disabled {
  opacity: 0.35;
  cursor: default;
}

@media (max-width: 820px) {
  .stage-bridge {
    padding: 0.7rem 0.6rem;
  }
  .stage-bridge__pill {
    max-width: 100%;
    padding: 0.28rem 0.74rem;
    font-size: 0.68rem;
    line-height: 1.4;
    text-align: center;
  }
  .stage-dock {
    right: 0.85rem;
    bottom: 0.85rem;
    padding: 0.42rem 0.55rem 0.42rem 0.48rem;
  }
  .stage-dock__meta { display: none; }
}

/* ==========================================================================
   Zoomable Lightbox Modal
   ========================================================================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(20, 31, 39, 0.88);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms var(--ease);
}
.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}
.lightbox__dialog {
  background: var(--card);
  border-radius: var(--radius-lg);
  width: min(1240px, 96vw);
  max-height: 92vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  transform: scale(0.97);
  transition: transform 280ms var(--ease);
}
.lightbox.is-open .lightbox__dialog {
  transform: scale(1);
}
.lightbox__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.35rem;
  border-bottom: 1px solid var(--line);
  background: var(--card-soft);
}
.lightbox__controls {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.lightbox__stage {
  background: #fff;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}
.lightbox__img {
  max-width: 100%;
  max-height: 66vh;
  transition: transform 260ms var(--ease);
  transform-origin: center center;
}
.lightbox__img.is-zoomed {
  max-width: none;
  max-height: none;
  width: 155%;
  cursor: zoom-out;
}
.lightbox__footer {
  padding: 1rem 1.35rem;
  border-top: 1px solid var(--line);
  background: var(--card-soft);
  font-size: 0.86rem;
  color: var(--ink-soft);
  line-height: 1.6;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1080px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pipeline-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .figure-plate__body { grid-template-columns: minmax(0, 1fr); }
  .figure-plate__media { border-right: none; border-bottom: 1px solid var(--line); }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .grid-2, .grid-12, .grid-21, .footer__inner { grid-template-columns: minmax(0, 1fr); }
  .stage-nav { display: none; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pipeline-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .audit-row { grid-template-columns: minmax(0, 1fr); gap: 0.45rem; }
  .audit-val { text-align: left; }
  .pip-bar-row { grid-template-columns: 112px minmax(0, 1fr) 48px; }
}
@media (max-width: 560px) {
  .topbar__inner { padding: 0.58rem 0.9rem; gap: 0.5rem; }
  .brand { font-size: 0.84rem; gap: 0.45rem; min-width: 0; }
  .brand > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .brand__mark { width: 22px; height: 22px; font-size: 0.68rem; flex-shrink: 0; }
  .btn-ghost { padding: 0.34rem 0.62rem; font-size: 0.74rem; }
  .hero { padding: 2.2rem 1rem 2rem; }
  .hero__title { font-size: clamp(1.5rem, 6.2vw, 2.2rem); }
  .eyebrow { max-width: 100%; font-size: 0.66rem; letter-spacing: 0.03em; padding: 0.28rem 0.72rem; flex-wrap: wrap; }
  .main { padding: 0.5rem 1rem 3.5rem; }
  .panel { padding: 1.15rem 1.1rem; }
  .figure-plate__info { padding: 1.15rem 1.1rem; }
  .kpi-grid, .pipeline-steps, .summary-grid, .pheno-stats { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .stage__header.reveal *, .grid-2.reveal > .panel, .grid-12.reveal > .panel, .summary-grid.reveal > .summary-card, .figure-plate.reveal .figure-plate__img, .figure-plate.reveal .figure-plate__info, .stage-bridge__line, .stage-bridge__pill {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
  }
  .eyebrow__dot { animation: none; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
