@font-face {
  font-family: "JetBrains Mono";
  src: url("https://fonts.gstatic.com/s/jetbrainsmono/v24/tDbV2o-flEEny0FZhsfKu5WU4xD2OwGtT0rU3BE.woff2") format("woff2");
  font-display: swap;
}

:root {
  --bg: #07111d;
  --bg-elevated: rgba(7, 17, 29, 0.86);
  --panel: rgba(10, 22, 40, 0.82);
  --panel-strong: rgba(10, 23, 42, 0.96);
  --text: #edf3fb;
  --muted: #9cade0;
  --muted-strong: #c5d2ea;
  --accent: #52f7ff;
  --accent-2: #b68cff;
  --accent-3: #ff4fd8;
  --accent-4: #79e2b0;
  --danger: #ff8f70;
  --border: rgba(255, 255, 255, 0.12);
  --border-soft: rgba(255, 255, 255, 0.08);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  --glow: 0 0 0 1px rgba(255, 255, 255, 0.05), 0 28px 80px rgba(0, 0, 0, 0.42);
  --max-width: 1500px;
  --viz-transition: 260ms;
  --font-body: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-heading: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

h1,
h2,
h3 {
  font-family: var(--font-heading);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(circle at 12% 18%, rgba(127, 214, 255, 0.18), transparent 24%),
    radial-gradient(circle at 82% 16%, rgba(182, 140, 255, 0.16), transparent 18%),
    radial-gradient(circle at 50% 86%, rgba(255, 210, 127, 0.11), transparent 24%),
    linear-gradient(180deg, #050b14 0%, #08111f 38%, #0b1630 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: 0.85;

  background:
    radial-gradient(2px 2px at 18% 24%, rgba(255,255,255,.95), transparent 60%),
    radial-gradient(2px 2px at 72% 38%, rgba(255,255,255,.9), transparent 60%),
    radial-gradient(2px 2px at 84% 68%, rgba(255,255,255,.88), transparent 60%),

    radial-gradient(2px 2px, rgba(255,255,255,.30) 60%, transparent 61%) 0 0 / 160px 160px,
    radial-gradient(2px 2px, rgba(255,255,255,.20) 60%, transparent 61%) 0 0 / 110px 110px,
    radial-gradient(1.5px 1.5px, rgba(255,255,255,.16) 60%, transparent 61%) 0 0 / 80px 80px;
}
@media (prefers-reduced-motion: no-preference) {
  body::before { animation: sky-drift 28s ease-in-out infinite alternate; }
}
@media (prefers-reduced-motion: reduce) {
  body::before { animation: none !important; }
}

body::after {
  background:
    linear-gradient(180deg, rgba(5, 9, 16, 0.1), rgba(5, 9, 16, 0.46)),
    radial-gradient(circle at center, transparent 0%, rgba(5, 9, 16, 0.22) 100%);
}

a {
  color: inherit;
}

.app-shell {
  width: min(100%, var(--max-width));
  margin: 0 auto;
  padding: 24px;
}

.page {
  width: min(100%, var(--max-width));
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas: "story";
  gap: 24px;
}

.masthead {
  min-height: 100svh; /* full screen*/
  width: 100%;
  margin: 0;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  padding: clamp(12px, 3vw, 28px);
   position: relative; 
   overflow: hidden; 
  }
.astro-sky { 
  position: absolute; 
  inset: -18%; z-index: 0; 
  pointer-events: none; 
}
/* Bright starfield */
.astro-sky::after {
  content: "";
  position: absolute;
  inset: 0;
  /* Dense tiled stars + a few bright stars */
  background:
    /* a few bright stars */
    radial-gradient(2px 2px at 18% 24%, rgba(255,255,255,.95), transparent 60%),
    radial-gradient(2px 2px at 72% 38%, rgba(255,255,255,.9), transparent 60%),
    radial-gradient(2px 2px at 84% 68%, rgba(255,255,255,.88), transparent 60%),
    radial-gradient(3px 3px, rgba(255,255,255,.30) 60%, transparent 61%) 0 0 / 160px 160px,
    /* dense star tile layers */
    radial-gradient(2px 2px, rgba(255,255,255,.34) 60%, transparent 61%) 0 0 / 140px 140px,
    radial-gradient(2px 2px, rgba(255,255,255,.22) 60%, transparent 61%) 0 0 / 90px 90px,
    radial-gradient(1.5px 1.5px, rgba(255,255,255,.18) 60%, transparent 61%) 0 0 / 60px 60px,
    /* faint color dust */
    radial-gradient(180px 180px at 22% 30%, rgba(82,247,255,.06), transparent 65%),
    radial-gradient(220px 220px at 78% 22%, rgba(182,140,255,.06), transparent 65%),
    radial-gradient(260px 260px at 58% 80%, rgba(255,79,216,.04), transparent 65%);
  opacity: 0.9;
  filter: drop-shadow(0 0 3px rgba(255,255,255,0.18));
  animation: sky-drift 22s ease-in-out infinite alternate, sky-twinkle 7s ease-in-out infinite;
}

/* Stronger “zodiac wheel” ring */
.astro-sky::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 52%;
  width: min(1200px, 130vmin);
  height: min(1200px, 130vmin);
  transform: translate(-50%, -50%);
  border-radius: 999px;

  background:
    radial-gradient(circle, rgba(82,247,255,.14), transparent 55%),
    conic-gradient(
      from 0deg,
      rgba(182,140,255,.28),
      rgba(82,247,255,.28),
      rgba(255,79,216,.22),
      rgba(121,226,176,.22),
      rgba(182,140,255,.28)
    );

  /* ring cutouts */
  mask:
    radial-gradient(circle, transparent 54%, #000 55% 56%, transparent 57%),
    radial-gradient(circle, transparent 66%, #000 67% 68%, transparent 69%),
    radial-gradient(circle, transparent 78%, #000 79% 80%, transparent 81%);

  opacity: 0.38;
  filter: blur(0px);
  animation: zodiac-rotate 38s linear infinite;
}

@keyframes zodiac-rotate {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}
@keyframes sky-twinkle {
  0%, 100% { opacity: 0.75; }
  50% { opacity: 0.98; }
}
@keyframes sky-drift {
  from { transform: translate3d(-1.2%, -0.8%, 0); }
  to   { transform: translate3d(1.2%, 0.8%, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .astro-sky::before, .astro-sky::after { animation: none !important; }
}

.masthead__inner {
  width: min(1400px, calc(100% - clamp(16px, 4vw, 48px)));
  min-height: min(820px, 78svh);
  margin: 0 auto;
  padding: clamp(22px, 4vw, 46px);
  border-radius: 26px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  box-shadow: var(--glow);
  position: relative; 
  z-index: 1; 
  display: flex;
  flex-direction: column;
  justify-content: center; /* vertical */
  align-items: stretch;     /* horizontal */
  text-align: left;
  gap: clamp(14px, 2.2vw, 22px);
}

.masthead__skip {
  display: inline-flex;
  margin-top: 18px;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-strong);
  text-decoration: none;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.22);
  padding-bottom: 2px;
}
.masthead__skip:hover {
  color: var(--text);
  border-bottom-color: rgba(127, 214, 255, 0.65);
}
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

.masthead__inner .eyebrow {
  font-size: clamp(0.72rem, 0.95vw, 0.82rem);
}
.masthead__inner h1,
.masthead__inner p.lede {
  max-width: none;
}
.masthead__skip {
  margin-top: clamp(10px, 2vw, 18px);
}
.masthead__btn {
  margin-top: clamp(10px, 2vw, 18px);
  display: inline-flex;
  align-items: left;
  justify-content: left;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid rgba(127, 214, 255, 0.45);
  background: rgba(127, 214, 255, 0.08);
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 700;
  width: fit-content;
  max-width: 100%;
  font-family: inherit;
  cursor: pointer;
}
.masthead__btn:hover {
  border-color: rgba(127, 214, 255, 0.85);
  background: rgba(127, 214, 255, 0.14);
}
.masthead__btn:focus-visible {
  outline: 2px solid rgba(127, 214, 255, 0.85);
  outline-offset: 3px;
}

.zodiac-wheel {
  position: absolute;
  left: 50%;
  top: 52%;
  width: min(1200px, 130vmin);
  height: min(1200px, 130vmin);
  transform: translate(-50%, -50%);
  transform-origin: 50% 50%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.42;
}

.zodiac-wheel__text {
  fill: rgba(255, 255, 255, 0.42);
  font-family: "JetBrains Mono", "Segoe UI Symbol", "Apple Symbols", "Noto Sans Symbols2", sans-serif;
  font-size: 34px;
  letter-spacing: 10px;
}

@media (prefers-reduced-motion: no-preference) {
  .zodiac-wheel { animation: zodiac-rotate 38s linear infinite; }
}

.story-shell {
  min-width: 0;
  grid-area: story;
  position: relative;
  top: auto;
  align-self: stretch;
  height: auto;
  overflow: visible;
}

.sticky-panel {
  width: 100%;
  position: relative;
  height: auto;
  overflow: visible;
}

.loading {
  min-height: 100vh;
  display: grid;
  place-items: center;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.85rem;
  color: var(--muted);
}

.loading-card {
  padding: 24px 28px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.page-header {
  position: relative;
  margin-bottom: 24px;
  padding: 24px 28px 26px;
  border: 1px solid var(--border);
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  box-shadow: var(--glow);
  overflow: hidden;
}

.page-header::after {
  content: "";
  position: absolute;
  inset: auto -10% -55% auto;
  width: 420px;
  height: 420px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(127, 214, 255, 0.18), transparent 68%);
  filter: blur(14px);
}

.eyebrow {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 18px;
  align-items: end;
}

.hero-copy h1 {
  margin: 0 0 16px;
  font-size: clamp(2.8rem, 6vw, 5.3rem);
  line-height: 0.94;
  letter-spacing: -0.04em;
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.hero-copy p {
  max-width: 64ch;
  margin: 0;
  color: var(--muted-strong);
  font-size: 1.02rem;
  line-height: 1.8;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 12px;
}

.hero-stat {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(12px);
}

.hero-stat strong,
.metric strong {
  display: block;
  font-size: 1.55rem;
  line-height: 1.1;
  color: var(--text);
}

.hero-stat span,
.metric span {
  display: block;
  margin-top: 8px;
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--muted);
}

.story-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(380px, 1.08fr);
  gap: 24px;
  align-items: start;
}

.story {
  padding-bottom: 35vh;
}
/* --- Static per-section vizzes layout --- */

/* Story steps currently use flex; stack content vertically */
.story-step {
  min-height: 105vh;     /* scene height */
  padding: 10vh 0;       /* scene breathing room */
  display: flex;
  align-items: center;
  padding: 10vh 0;
  flex-direction: column;
  align-items: stretch;
  gap: 22px;
}

.story-step + .story-step {
  margin-top: 8vh;
}

.step-viz {
  width: 100%;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top center, rgba(127, 214, 255, 0.08), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015));
}

.step-viz__svg {
  width: 100%;
  aspect-ratio: 860 / 820; /* matches SVG viewBox so charts render at full intended scale */
  height: auto;
}
.step-controls .toggle-group {
  gap: 14px;              /* more space between buttons */
}

.step-controls .panel-toggles {
  gap: 14px;              /* more space between the two toggle rows */
  margin-top: 10px;       /* optional */
}

.story-card {
  width: min(100%, 700px);
  padding: 28px;
  border-radius: 26px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(9, 20, 38, 0.86), rgba(9, 20, 38, 0.78));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.story-card h2 {
  margin: 0 0 14px;
  font-size: clamp(1.75rem, 2.4vw, 2.5rem);
  line-height: 1.08;
  font-family: var(--font-heading);
  letter-spacing: 0.02em;
}

.story-card p,
.story-card li {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.8;
}

.lede {
  color: var(--text);
  font-size: 1.08rem;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.metric {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.035);
}

.insight-list {
  margin: 18px 0 0;
  padding-left: 18px;
}

.story-meta {
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.9rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.cta:hover,
.cta:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(127, 214, 255, 0.5);
  background: rgba(127, 214, 255, 0.1);
}

/* merged story+panel: let the PAGE scroll, not the panel */
.sticky-panel,
.panel-content {
  height: auto;
  max-height: none;
  overflow: visible;
}

/* while debugging, also make sure it isn't sticky */
.sticky-panel {
  position: relative;
  top: auto;
}


.viz-frame {
  position: sticky;
  top: 0;
  z-index: 2;
}

.panel-topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.panel-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.78rem;
  color: var(--muted);
}

.panel-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 16px rgba(127, 214, 255, 0.7);
}

.viz-header {
  display: grid;
  gap: 6px;
}

.viz-header h3 {
  margin: 0;
  font-size: 1.5rem;
}

.viz-header p {
  margin: 0;
  max-width: 52ch;
  color: var(--muted);
  line-height: 1.65;
  font-size: 0.95rem;
}

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

.panel-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
}

.control,
.control-group {
  display: grid;
  gap: 6px;
}

.control-label {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.control-select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font: inherit;
  appearance: none;
}

.control-select:focus {
  outline: 1px solid rgba(127, 214, 255, 0.6);
  border-color: rgba(127, 214, 255, 0.5);
}

.control-reset {
  align-self: end;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.control-reset:hover,
.control-reset:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(127, 214, 255, 0.48);
  background: rgba(127, 214, 255, 0.09);
}

.toggle-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.toggle {
  appearance: none;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted-strong);
  padding: 9px 12px;
  border-radius: 999px;
  font: inherit;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.toggle:hover,
.toggle:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(127, 214, 255, 0.45);
  background: rgba(127, 214, 255, 0.1);
  color: var(--text);
}

.toggle.is-active {
  border-color: rgba(127, 214, 255, 0.65);
  background: rgba(127, 214, 255, 0.14);
  color: var(--text);
}

.panel-controls__row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.detail-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.04);
}

.detail-card__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.detail-card__eyebrow {
  display: inline-block;
  margin-bottom: 5px;
  color: var(--accent);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.detail-card h4 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.35;
}

.detail-card h3 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.35;
}

.detail-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-soft);
  color: var(--muted);
  font-size: 0.78rem;
}

.detail-card__copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

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

.detail-grid div {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.03);
}

.detail-grid dt {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.detail-grid dd {
  margin: 0;
  color: var(--text);
  font-size: 0.96rem;
  font-weight: 600;
}

.object-card {
  border-radius: 18px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.object-card__link {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  padding: 12px;
  text-decoration: none;
  color: inherit;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.object-card__media {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top left, rgba(127, 214, 255, 0.16), transparent 60%),
    rgba(255, 255, 255, 0.02);
}

.object-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.object-card__media-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 12px;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}

.object-card__body {
  display: grid;
  gap: 6px;
  align-content: start;
}

.object-card__kicker {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

.object-card__title {
  color: var(--text);
  font-weight: 700;
  line-height: 1.25;
  font-size: 0.98rem;
}

.object-card__meta {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.object-card__link:hover,
.object-card__link:focus-visible {
  transform: translateY(-1px);
}

.object-card a[aria-disabled="true"] {
  pointer-events: none;
}

.legend-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.8rem;
}

.swatch {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.viz-frame {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-height: 420px;
  background:
    radial-gradient(circle at top center, rgba(127, 214, 255, 0.08), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015));
}

.viz-layer {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: auto;
  min-height: 420px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--viz-transition) ease;
}

.viz-layer.is-active {
  opacity: 1;
  pointer-events: auto;
}

.viz-frame--transitioning .viz-layer {
  pointer-events: none;
}

.collage-tile {
  opacity: 0.92;
}

.collage-tile-image {
  opacity: 0.92;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .viz-layer {
    transition: none;
  }

  .cta,
  .control-reset {
    transition: none;
  }
}

.panel-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-top: 4px;
}

.panel-note {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.panel-progress {
  min-width: 116px;
  text-align: right;
}

.panel-progress-label {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.panel-progress-value {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
}

.methodology {
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.methodology summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  user-select: none;
}

.methodology summary::-webkit-details-marker {
  display: none;
}

.methodology__title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 0.95rem;
}

.methodology__badge {
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.74rem;
}

.methodology__body {
  padding: 12px 14px 14px;
  display: grid;
  gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.methodology__section h4 {
  margin: 0 0 8px;
  font-size: 0.9rem;
}

.methodology__section p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

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

.dq-metric {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.03);
}

.dq-metric dt {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.dq-metric dd {
  margin: 0;
  color: var(--text);
  font-weight: 700;
  font-size: 0.95rem;
}

.slider-row {
  display: grid;
  gap: 8px;
}

.slider-row label {
  color: var(--muted);
  font-size: 0.84rem;
}

.slider-row input[type="range"] {
  width: 100%;
}

.slider-row__value {
  color: var(--text);
  font-weight: 700;
}

.tooltip {
  position: fixed;
  z-index: 10;
  pointer-events: none;
  padding: 10px 12px;
  max-width: 260px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(5, 11, 20, 0.94);
  color: var(--text);
  font-size: 0.84rem;
  line-height: 1.5;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 120ms ease, transform 120ms ease;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

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

body.glossary-modal-open {
  overflow: hidden;
}

.glossary-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 32px);
}

.glossary-modal[hidden] {
  display: none;
}

.glossary-modal__backdrop {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(5, 9, 16, 0.72);
  backdrop-filter: blur(8px);
  cursor: pointer;
}

.glossary-modal__panel {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  max-height: min(86vh, 920px);
  overflow: auto;
  padding: clamp(22px, 4vw, 36px);
  border-radius: 26px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  box-shadow: var(--glow);
}

.glossary-modal__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.glossary-modal__header h2 {
  margin: 0 0 10px;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  line-height: 1.2;
}

.glossary-modal__lede {
  margin: 0;
  max-width: 52ch;
  color: var(--muted-strong);
  font-size: 0.98rem;
  line-height: 1.7;
}

.glossary-modal__close {
  flex-shrink: 0;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(127, 214, 255, 0.45);
  background: rgba(127, 214, 255, 0.08);
  color: var(--text);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

.glossary-modal__close:hover,
.glossary-modal__close:focus-visible {
  border-color: rgba(127, 214, 255, 0.85);
  background: rgba(127, 214, 255, 0.14);
  outline: none;
}

.glossary-modal__close:focus-visible {
  outline: 2px solid rgba(127, 214, 255, 0.85);
  outline-offset: 3px;
}

.glossary-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.glossary-entry {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.03);
}

.glossary-entry dt {
  margin: 0 0 8px;
  color: var(--accent);
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.glossary-entry dd {
  margin: 0;
  color: var(--muted-strong);
  font-size: 0.96rem;
  line-height: 1.65;
}

.page-footer {
  margin-top: 24px;
  padding: 16px 4px 30px;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

code {
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.88em;
}

@media (max-width: 1180px) {
  .page {
    grid-template-columns: 1fr;
    grid-template-areas:
      "story"
      "panel";
  }

  .story-shell {
    position: relative;
    top: auto;
    height: auto;
    overflow: visible;
    padding-right: 0;
  }

  .sticky-panel {
    position: relative;
    top: auto;
    height: auto;
    overflow: visible;
    margin-bottom: 18px;
  }

  .hero-step,
  .step,
  .closing {
    min-height: auto;
    padding: 36px 0;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 14px;
  }

  .page-header,
  .story-card,
  .sticky-panel {
    border-radius: 22px;
  }

  .page-header,
  .story-card,
  .panel-content {
    padding: 18px;
  }

  .hero-stats {
    grid-template-columns: 1fr 1fr;
  }

  .panel-footer {
    flex-direction: column;
  }

  .panel-progress {
    text-align: left;
  }

  .panel-controls {
    grid-template-columns: 1fr;
  }

  .control-reset {
    width: 100%;
  }

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

  .object-card {
    grid-template-columns: 1fr;
  }

  .object-card__media {
    aspect-ratio: 4 / 3;
  }
}
