:root {
  color-scheme: dark;
  --bg: #0a0f1a;
  --panel: rgba(15, 23, 42, 0.78);
  --panel2: rgba(12, 20, 36, 0.9);
  --border: rgba(148, 163, 184, 0.18);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --link: #7dd3fc;
  --severe: #ef4444;
  --unstable: #f97316;
  --moderate: #eab308;
  --stable: #22c55e;
  --nodata: #94a3b8;
  --shadow: 0 18px 45px rgba(2, 6, 23, 0.45);
  --glow: 0 0 0 1px rgba(148, 163, 184, 0.06), 0 0 12px rgba(56, 189, 248, 0.12);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(56, 189, 248, 0.12), transparent 55%),
    radial-gradient(circle at 80% 10%, rgba(14, 116, 144, 0.14), transparent 50%),
    radial-gradient(circle at 50% 80%, rgba(59, 130, 246, 0.08), transparent 60%),
    repeating-linear-gradient(0deg, rgba(148, 163, 184, 0.06) 0, rgba(148, 163, 184, 0.06) 1px, transparent 1px, transparent 32px),
    repeating-linear-gradient(90deg, rgba(148, 163, 184, 0.05) 0, rgba(148, 163, 184, 0.05) 1px, transparent 1px, transparent 32px);
  opacity: 0.8;
  pointer-events: none;
  animation: drift 28s ease-in-out infinite alternate;
  z-index: -2;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='1' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E");
  opacity: 0.15;
  mix-blend-mode: soft-light;
  pointer-events: none;
  z-index: -1;
}

@keyframes drift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(10px, -20px, 0) scale(1.02); }
}

a { color: var(--link); text-decoration: none; }
a:hover { color: #bae6fd; }

:focus-visible {
  outline: 2px solid rgba(56, 189, 248, 0.8);
  outline-offset: 2px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

.control-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 16px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 15, 26, 0.75);
  backdrop-filter: blur(18px);
}

.brand-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-title {
  font-weight: 700;
  letter-spacing: 0.3px;
}

.brand-sub {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.2px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
  justify-self: start;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--stable);
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.6);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  font-size: 14px;
}

.nav-links a {
  color: var(--muted);
  padding: 6px 8px;
  border-radius: 999px;
  transition: color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.nav-links a.active,
.nav-links a:hover {
  color: var(--text);
  background: rgba(56, 189, 248, 0.12);
}

.nav-links a.active {
  box-shadow: var(--glow);
}

.open-map {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #bae6fd;
  font-size: 13px;
  text-decoration: none;
  background: rgba(8, 47, 73, 0.3);
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.open-map:hover {
  transform: translateY(-1px);
}

.nav-toggle {
  display: none;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
}

.breadcrumb {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 16px;
}

.page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 32px;
}

.content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.toc-panel {
  position: sticky;
  top: 96px;
  align-self: start;
}

.toc {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  font-size: 13px;
  color: var(--muted);
}

.toc-title {
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text);
}

.toc-progress {
  position: relative;
  height: 120px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  overflow: hidden;
  margin: 8px 0 14px;
}

.toc-progress span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0;
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.8), rgba(34, 197, 94, 0.8));
  transition: height 120ms ease;
}

.toc-group {
  padding-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  margin-top: 10px;
}

.toc-group-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 6px;
}

.toc a {
  color: var(--muted);
  display: block;
  padding: 6px 8px;
  border-radius: 10px;
}

.toc a:hover { color: var(--text); }

.toc a.active {
  color: var(--text);
  background: rgba(8, 47, 73, 0.35);
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: var(--glow);
}

.hero {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.hero-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
}

.hero h1 {
  font-size: 36px;
  margin: 0 0 10px;
  line-height: 1.1;
}

.hero p { margin: 0 0 18px; color: var(--muted); }

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.control-panel {
  display: grid;
  gap: 12px;
}

.panel-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(10, 15, 26, 0.55);
}

.panel-label {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.panel-value {
  font-size: 15px;
  color: var(--text);
}

.panel-hint {
  font-size: 12px;
  color: var(--muted);
}

.legend-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.legend-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  background: rgba(12, 20, 36, 0.6);
}

.legend-title { font-weight: 600; margin-bottom: 6px; }

.pipeline-hero {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(8, 47, 73, 0.25);
}

.pipeline-hero-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  overflow: hidden;
  position: relative;
}

.pipeline-hero-track span {
  position: absolute;
  inset: 0;
  width: 0;
  background: linear-gradient(90deg, #38bdf8, #22c55e);
  transition: width 200ms ease;
}

.pipeline-hero-steps {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.pipeline-hero-step {
  display: grid;
  gap: 6px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(15, 23, 42, 0.45);
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}

.pipeline-hero-step strong { color: var(--text); }

.pipeline-hero-step.active {
  border-color: rgba(56, 189, 248, 0.5);
  background: rgba(8, 47, 73, 0.35);
  box-shadow: var(--glow);
  color: var(--text);
}

.step-list {
  display: grid;
  gap: 10px;
}

.step-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(10, 15, 26, 0.55);
}

.step-icon { font-size: 16px; }

.collapse {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(15, 23, 42, 0.5);
}

.collapse summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  list-style: none;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid rgba(56, 189, 248, 0.45);
  background: rgba(8, 47, 73, 0.4);
  color: #e0f2fe;
  font-size: 13px;
  font-weight: 600;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.btn.ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(56, 189, 248, 0.18);
}

.status-card {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  display: grid;
  gap: 12px;
}

.status-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.status-grid {
  display: grid;
  gap: 12px;
}

.status-metric {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(8, 15, 30, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.status-metric .label { color: var(--muted); }

.tile-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.tile {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  display: grid;
  gap: 8px;
  transition: transform 160ms ease, box-shadow 160ms ease, border 160ms ease;
}

.tile:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.2);
}

.tile .icon {
  font-size: 18px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: none;
}

.card.primary {
  padding: 24px;
  border-radius: 20px;
  background: rgba(12, 20, 36, 0.85);
  box-shadow: var(--shadow);
}

.card.secondary {
  background: rgba(15, 23, 42, 0.55);
}

.card.quiet {
  background: rgba(10, 15, 26, 0.45);
  border-color: rgba(148, 163, 184, 0.12);
}

.section-title {
  margin: 10px 0 4px;
  font-size: 22px;
}

.section-title a { color: inherit; }

.change-item {
  padding: 12px 0;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.change-item:first-of-type { border-top: none; padding-top: 4px; }

.change-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.note {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(8, 47, 73, 0.35);
  color: var(--muted);
}

.callout {
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: rgba(127, 29, 29, 0.2);
  color: #fecaca;
  padding: 14px 16px;
  border-radius: 12px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  overflow: hidden;
  border-radius: 12px;
}

.table th, .table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.table th {
  background: rgba(15, 23, 42, 0.8);
  font-weight: 600;
  color: var(--muted);
}

.diagram {
  background: rgba(8, 15, 30, 0.7);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  overflow-x: auto;
}

.search {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.search input {
  flex: 1;
  min-width: 220px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(10, 15, 26, 0.6);
  color: var(--text);
}

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

.chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.6);
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  transition: all 150ms ease;
}

.chip.active,
.chip:hover {
  color: var(--text);
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

.list {
  display: grid;
  gap: 16px;
}

.source-group {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.7);
  padding: 16px;
  display: grid;
  gap: 8px;
}

.source-group h3 {
  margin: 0;
  font-size: 16px;
}

.source-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.source-item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(8, 15, 30, 0.6);
}

.source-meta {
  display: grid;
  gap: 2px;
}

.source-meta small { color: var(--muted); }

.copy-btn {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  border-radius: 10px;
  padding: 6px 8px;
  cursor: pointer;
  font-size: 12px;
}

.copy-btn:hover { color: var(--text); }

.footer {
  margin-top: 28px;
  color: var(--muted);
  font-size: 13px;
}

.hero {
  display: grid;
  gap: 20px;
}

.hero-card {
  padding: 18px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(10, 15, 26, 0.6);
  box-shadow: var(--shadow);
}

.hero-card-title {
  font-weight: 600;
  margin-bottom: 12px;
}

.metric-grid {
  display: grid;
  gap: 12px;
  font-size: 14px;
}

.metric-label {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.metric-value {
  color: var(--text);
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(8, 47, 73, 0.25);
  font-size: 12px;
  color: #bae6fd;
}

.section-nav {
  position: sticky;
  top: 76px;
  z-index: 10;
  border: 1px solid var(--border);
  background: rgba(10, 15, 26, 0.86);
  border-radius: 16px;
  padding: 14px 16px;
  display: grid;
  gap: 12px;
  box-shadow: none;
}

.section-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.section-link {
  font-size: 12px;
  color: var(--muted);
  border: 1px solid transparent;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.4);
}

.section-link.active {
  color: var(--text);
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(8, 47, 73, 0.35);
  box-shadow: var(--glow);
}

.pipeline {
  display: grid;
  gap: 10px;
}

.pipeline-track {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  overflow: hidden;
}

.pipeline-track span {
  position: absolute;
  inset: 0;
  width: 0;
  background: linear-gradient(90deg, #38bdf8, #22c55e);
  border-radius: 999px;
  transition: width 200ms ease;
}

.pipeline-steps {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pipeline-step {
  text-align: center;
  padding: 6px 4px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.15);
  color: var(--muted);
  background: rgba(15, 23, 42, 0.4);
}

.pipeline-step.active {
  color: var(--text);
  border-color: rgba(56, 189, 248, 0.5);
  background: rgba(8, 47, 73, 0.35);
  box-shadow: var(--glow);
}

.diagram-animate .pulse {
  animation: pulseGlow 2.6s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { stroke: #38bdf8; filter: drop-shadow(0 0 0 rgba(56, 189, 248, 0.0)); }
  50% { stroke: #7dd3fc; filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.4)); }
}

.formula {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border);
  padding: 14px 16px;
  border-radius: 12px;
  margin: 14px 0;
  color: #e2e8f0;
}

.weight-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.weight-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  background: rgba(8, 15, 30, 0.55);
}

.weight-card.strong {
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(8, 47, 73, 0.2);
}

.weight-title {
  font-weight: 600;
  margin-bottom: 6px;
}

.weight-desc {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  font-size: 11px;
  color: var(--text);
  margin: 2px 4px 0 0;
}

.sparkline {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  align-items: end;
  gap: 6px;
  height: 70px;
  margin: 12px 0 8px;
}

.sparkline span {
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.9), rgba(56, 189, 248, 0.1));
  border-radius: 6px 6px 4px 4px;
  animation: rise 2.2s ease-in-out infinite;
}

.sparkline span:nth-child(1) { height: 70px; animation-delay: 0s; }
.sparkline span:nth-child(2) { height: 60px; animation-delay: 0.1s; }
.sparkline span:nth-child(3) { height: 50px; animation-delay: 0.2s; }
.sparkline span:nth-child(4) { height: 40px; animation-delay: 0.3s; }
.sparkline span:nth-child(5) { height: 32px; animation-delay: 0.4s; }
.sparkline span:nth-child(6) { height: 26px; animation-delay: 0.5s; }
.sparkline span:nth-child(7) { height: 22px; animation-delay: 0.6s; }
.sparkline span:nth-child(8) { height: 20px; animation-delay: 0.7s; }

@keyframes rise {
  0%, 100% { transform: translateY(0); opacity: 0.8; }
  50% { transform: translateY(-6px); opacity: 1; }
}

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

.flow-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  background: rgba(8, 15, 30, 0.55);
}

.flow-icon {
  font-size: 18px;
}

.flow-title {
  font-weight: 600;
  margin: 8px 0 6px;
}

.flow-desc {
  color: var(--muted);
  font-size: 13px;
}

.example-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.example-card {
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(12, 20, 36, 0.7);
  padding: 14px;
}

.example-title {
  font-weight: 600;
  margin-bottom: 8px;
}

.example-tags { margin-top: 10px; }

.band-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin: 12px 0 8px;
}

.band-card {
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  font-weight: 600;
  border: 1px solid var(--border);
  background: rgba(8, 15, 30, 0.55);
}

.band-card.stable { color: var(--stable); }
.band-card.moderate { color: var(--moderate); }
.band-card.unstable { color: var(--unstable); }
.band-card.severe { color: var(--severe); }

.timeline {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
  font-size: 12px;
  color: var(--muted);
}

.timeline-track {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  overflow: hidden;
}

.timeline-track span {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 999px;
}

.timeline-now {
  left: 0;
  width: 35%;
  background: linear-gradient(90deg, #38bdf8, #22c55e);
}

.timeline-mid {
  left: 35%;
  width: 35%;
  background: rgba(56, 189, 248, 0.35);
}

.timeline-fade {
  left: 70%;
  width: 30%;
  background: rgba(148, 163, 184, 0.2);
}

.pipeline-steps-list {
  display: grid;
  gap: 10px;
  padding-left: 18px;
}

.pipeline-steps-list li {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(8, 15, 30, 0.55);
}

.stage-events { color: #7dd3fc; }
.stage-signals { color: #38bdf8; }
.stage-pressure { color: #22c55e; }
.stage-decay { color: #94a3b8; }
.stage-score { color: #eab308; }
.stage-band { color: #f97316; }

.cta-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 24px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(8, 47, 73, 0.35));
  border: 1px solid rgba(56, 189, 248, 0.25);
  box-shadow: var(--glow);
}

.cta-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

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

.pulse-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(8, 15, 30, 0.55);
}

.pulse-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.summary-item {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(8, 15, 30, 0.6);
}

.summary-label {
  font-size: 12px;
  color: var(--muted);
}

.summary-value {
  font-size: 22px;
  font-weight: 600;
}

.pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #38bdf8;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.8);
  animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.2); opacity: 1; }
}

.pipeline-hero-step.active {
  background: rgba(56, 189, 248, 0.18);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.3), 0 0 18px rgba(56, 189, 248, 0.35);
}

.score-playground {
  border: 1px solid rgba(56, 189, 248, 0.2);
  background: rgba(15, 23, 42, 0.75);
}

.playground-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  margin-top: 16px;
}

.playground-controls label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
}

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

.playground-output {
  display: grid;
  gap: 10px;
}

.metric-pill {
  display: flex;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(8, 15, 30, 0.6);
  border: 1px solid var(--border);
}

.score-total {
  padding: 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(56, 189, 248, 0.15));
  border: 1px solid rgba(34, 197, 94, 0.35);
  text-align: center;
}

.score-label {
  font-size: 12px;
  color: var(--muted);
}

.score-value {
  font-size: 32px;
  font-weight: 700;
}

.page {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 200ms ease, transform 200ms ease;
}

body.ready .page {
  opacity: 1;
  transform: translateY(0);
}

.is-hidden { display: none !important; }

@media (max-width: 980px) {
  .page-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .toc-panel { display: none; }
  .hero-grid { grid-template-columns: 1fr; }
  .pipeline-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pipeline-hero-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .playground-grid { grid-template-columns: 1fr; }
}

@media (max-width: 840px) {
  .control-bar {
    grid-template-columns: auto auto;
    justify-content: space-between;
  }
  .nav-links {
    display: none;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: rgba(10, 15, 26, 0.92);
    border: 1px solid var(--border);
    border-radius: 12px;
    position: absolute;
    top: 64px;
    right: 20px;
  }
  body.nav-open .nav-links { display: flex; }
  .nav-toggle { display: inline-flex; }
  .open-map { display: none; }
  .status-pill { display: none; }
  .cta-card { flex-direction: column; align-items: flex-start; }
}
