/* ==========================================================================
   VB-ANBS — shared stylesheet
   Palette: deep night, luminous text, ember orange (agent i / the AI side)
   vs electric cyan (agent j / the human side) — two glowing forces meeting
   at a spark, after the site's key image.
   Type: Fraunces (display) · IBM Plex Sans (body) · IBM Plex Mono (formulas)
   ========================================================================== */

:root {
  --paper: #0b1220;
  --card: #121c2e;
  --ink: #e8eef4;
  --muted: #8fa3b4;
  --line: #2a3a52;
  --line-soft: #1b2940;
  --agent-i: #24c4ff;      /* electric cyan — agent j (B / the human in question 2) */
  --agent-i-soft: rgba(36, 196, 255, 0.14);
  --agent-j: #ff6a2b;      /* ember orange — agent i (A / the AI in question 2) */
  --agent-j-soft: rgba(255, 106, 43, 0.14);
  --spark: #ffffff;
  --focus: #e8eef4;
  --radius: 10px;
  --content-width: 1080px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  padding-top: 5px; /* clears the fixed force rail */
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* --- Signature: the force rail — two forces meeting at an equilibrium.
       JS (side-panel.js) moves the meeting point with scroll progress,
       so the site's own metaphor doubles as the scroll indicator. --- */
.force-rail {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  z-index: 60;
  background: linear-gradient(90deg,
    var(--agent-i) 0%, var(--agent-i) 42%,
    var(--spark) 49%, var(--spark) 51%,
    var(--agent-j) 58%, var(--agent-j) 100%);
  box-shadow: 0 1px 12px rgba(255, 106, 43, 0.35), 0 1px 12px rgba(36, 196, 255, 0.35);
}

/* --- Layout shells --- */
.wrap {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line-soft);
}

.site-header .wordmark {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--ink);
}

.site-header .wordmark strong { font-weight: 600; }

.site-nav a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
  margin-left: 1.1rem;
}

.site-nav a[aria-current="page"],
.site-nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* --- Type --- */
h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.12;
  margin: 0 0 0.5em;
  font-weight: 600;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.3rem, 5.5vw, 3.6rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1em; }

a { color: inherit; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.9rem;
}

.eyebrow .fi { color: var(--agent-i); }
.eyebrow .fj { color: var(--agent-j); }

.standfirst {
  font-size: 1.2rem;
  color: var(--muted);
  max-width: 42em;
}

/* --- Hero --- */
.hero { padding: 3.5rem 0 2.5rem; }

.hero .arrows {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  letter-spacing: -0.2em;
  margin-bottom: 0.6rem;
}

.hero .arrows .a-i { color: var(--agent-i); }
.hero .arrows .a-j { color: var(--agent-j); }

/* --- Formula cards --- */
.formula {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.55rem 0.85rem;
  margin: 0.2rem 0.4rem 0.2rem 0;
  white-space: nowrap;
}

.formula sub { font-size: 0.7em; }

/* --- Glossary strip (index) --- */
.glossary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 2rem 0;
  padding: 0;
  list-style: none;
}

.glossary li {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}

.glossary .term {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.glossary li:nth-child(1) .term { color: var(--agent-i); }
.glossary li:nth-child(2) .term { color: var(--agent-j); }
.glossary li:nth-child(3) .term { color: var(--ink); }

.glossary p { margin: 0; font-size: 0.95rem; color: var(--muted); }

/* --- Scenario cards (index) --- */
.scenario-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin: 2.25rem 0 3.5rem;
}

.card-link {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 4px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.5rem 1.4rem;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.card-link.card-i { border-top-color: var(--agent-i); }
.card-link.card-j { border-top-color: var(--agent-j); }

.card-link:hover,
.card-link:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
}

.card-link .card-kicker {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.5rem;
}

.card-link h3 { margin-bottom: 0.5rem; }

.card-link p { color: var(--muted); font-size: 0.98rem; margin: 0 0 0.9rem; }

.card-link .card-cta {
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.card-link.card-s { border-top-color: var(--spark); }

.card-i .card-cta { color: var(--agent-i); }
.card-s .card-cta { color: var(--ink); }
.card-j .card-cta { color: var(--agent-j); }

/* --- Scenario page layout: narrative + sticky panel --- */
.scenario-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 3rem;
  align-items: start;
  padding-bottom: 4rem;
}

.narrative { max-width: 40em; }

.step { margin: 0 0 3.25rem; }

.step h2 { margin-top: 0; }

.step-kicker {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.5rem;
}

/* Open-question callout */
.open-question {
  background: var(--card);
  border-left: 4px solid var(--agent-i);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.25rem 1.4rem;
  margin: 1.5rem 0;
}

.open-question .oq-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--agent-i);
  margin: 0 0 0.5rem;
}

.open-question p {
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1.4;
  margin: 0;
}

.open-question.oq-teal { border-left-color: var(--agent-j); }
.open-question.oq-teal .oq-label { color: var(--agent-j); }

/* Evidence / caveat notes */
.note {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  font-size: 0.95rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

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

/* --- Interactive side panel --- */
.panel {
  position: sticky;
  top: 1.25rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.4rem 1.5rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.panel h2 {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.panel .panel-sub {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1.1rem;
}

.panel-hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0.9rem 0 0;
}

/* Sliders */
.slider-row { margin-bottom: 1.1rem; }

.slider-row label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.3rem;
}

.slider-row .slider-value {
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.slider-row.side-i .slider-value { color: var(--agent-i); }
.slider-row.side-j .slider-value { color: var(--agent-j); }

input[type="range"] {
  width: 100%;
  height: 4px;
  appearance: none;
  -webkit-appearance: none;
  background: var(--line);
  border-radius: 2px;
  outline: none;
  margin: 0.4rem 0;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ink);
  border: 3px solid var(--card);
  box-shadow: 0 0 0 1px var(--line);
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ink);
  border: 3px solid var(--card);
  box-shadow: 0 0 0 1px var(--line);
  cursor: pointer;
}

.side-i input[type="range"]::-webkit-slider-thumb { background: var(--agent-i); }
.side-i input[type="range"]::-moz-range-thumb { background: var(--agent-i); }
.side-j input[type="range"]::-webkit-slider-thumb { background: var(--agent-j); }
.side-j input[type="range"]::-moz-range-thumb { background: var(--agent-j); }

input[type="range"]:focus-visible {
  box-shadow: 0 0 0 3px rgba(232, 238, 244, 0.35);
}

/* Tug-of-war bar */
.tug {
  position: relative;
  box-shadow: 0 0 16px rgba(255, 106, 43, 0.15), 0 0 16px rgba(36, 196, 255, 0.15);
  height: 34px;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  margin: 1.1rem 0 0.4rem;
  border: 1px solid var(--line);
}

.tug-side {
  display: flex;
  align-items: center;
  min-width: 0;
  transition: flex-basis 240ms ease;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--paper);
  font-weight: 500;
}

.tug-side.tug-i { background: var(--agent-i); justify-content: flex-end; padding-right: 0.5rem; }
.tug-side.tug-j { background: var(--agent-j); justify-content: flex-start; padding-left: 0.5rem; }

.tug-marker {
  width: 3px;
  background: var(--spark);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
  flex: 0 0 3px;
}

.tug-caption {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.9rem;
}

/* Readouts */
.readouts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.readout {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
}

.readout .r-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: 0.15rem;
}

.readout .r-value {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 500;
}

.advantage {
  margin-top: 0.9rem;
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  background: var(--paper);
}

.advantage[data-side="i"] { background: var(--agent-i-soft); color: var(--agent-i); }
.advantage[data-side="j"] { background: var(--agent-j-soft); color: var(--agent-j); }

/* Simulator */
.sim-status {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.sim-forces {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.sim-force {
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
}

.sim-force.side-i { background: var(--agent-i-soft); }
.sim-force.side-j { background: var(--agent-j-soft); }

.sim-force .r-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: block;
  color: var(--muted);
  margin-bottom: 0.1rem;
}

.sim-force .r-value {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 500;
}

.sim-force.side-i .r-value { color: var(--agent-i); }
.sim-force.side-j .r-value { color: var(--agent-j); }

.sim-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 0.25rem 0 1rem;
}

.btn {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.65rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  transition: background 140ms ease, transform 140ms ease;
}

.btn:hover:not(:disabled) { transform: translateY(-1px); }

.btn:focus-visible { outline: 3px solid rgba(232, 238, 244, 0.45); outline-offset: 2px; }

.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn.btn-along { border-color: var(--agent-i); color: var(--agent-i); }
.btn.btn-along:hover:not(:disabled) { background: var(--agent-i-soft); }

.btn.btn-push { border-color: var(--agent-j); color: var(--agent-j); }
.btn.btn-push:hover:not(:disabled) { background: var(--agent-j-soft); }

.btn.btn-reset {
  width: 100%;
  font-weight: 500;
  color: var(--muted);
}

.sim-chart { margin: 0.25rem 0 1rem; }

.sim-chart svg { display: block; width: 100%; height: auto; }

.chart-line-human {
  fill: none;
  stroke: var(--agent-j);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-line-ai {
  fill: none;
  stroke: var(--agent-i);
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
}

.chart-dot-along { fill: var(--agent-i); }
.chart-dot-push { fill: var(--agent-j); }
.chart-axis { stroke: var(--line); stroke-width: 1; }
.chart-label {
  font-family: var(--font-mono);
  font-size: 9px;
  fill: var(--muted);
}

/* --- Scrollytelling: pinned force stage + scrolling step cards (homepage) --- */
.scrolly { position: relative; margin: 0 0 2rem; }

/* Mobile-first: graphic pins to the top of the screen, step cards slide over it */
.scrolly-graphic {
  position: sticky;
  top: 5px; /* sits just under the fixed force rail */
  z-index: 1;
  height: 46vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  border-bottom: 1px solid var(--line-soft);
}

.stage-wrap {
  width: min(560px, 94%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* HTML captions: stacked in one slot, cross-fading per state, wrapping freely */
.stage-captions {
  position: relative;
  width: 100%;
  min-height: 3.4em;
  margin-top: 0.5rem;
  text-align: center;
}

.stage-captions p {
  position: absolute;
  inset: 0;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--ink);
  opacity: 0;
  transition: opacity 500ms ease;
}

.scrolly-graphic svg {
  width: 100%;
  height: auto;
  min-height: 0;
}

.scrolly-steps { position: relative; z-index: 2; padding: 8vh 0 2vh; }

.scrolly-step {
  max-width: 34em;
  margin: 0 auto 62vh;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55);
  opacity: 0.55;
  transition: opacity 300ms ease, border-color 300ms ease;
}

.scrolly-step:last-child { margin-bottom: 16vh; }

.scrolly-step.is-active { opacity: 1; border-color: var(--ink); }

.scrolly-step h2 { font-size: 1.35rem; }

.scrolly-step p:last-child { margin-bottom: 0; }

/* Desktop: steps scroll on the left, graphic pins on the right */
@media (min-width: 900px) {
  .scrolly {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: 3rem;
    align-items: start;
  }
  .scrolly-graphic {
    order: 2;
    top: 12vh;
    height: 74vh;
    background: transparent;
    border-bottom: 0;
  }
  .scrolly-steps { order: 1; padding: 14vh 0 4vh; }
  .scrolly-step { margin: 0 0 55vh; }
}

/* Epigraph — the chapter's quote */
.epigraph { margin: 0 0 1.1rem; padding: 0; border: 0; }

.epigraph p {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.35rem;
  line-height: 1.35;
  margin: 0 0 0.45rem;
}

.epigraph footer {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Stage SVG: state machine driven by data-state="1"–"5" */
.stage text { user-select: none; }

.stage .stage-agent {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 500;
  fill: var(--paper);
  text-anchor: middle;
}

.stage .stage-label {
  font-family: var(--font-mono);
  font-size: 10px;
  fill: var(--muted);
}


.stage .st-fij,
.stage .st-fji,
.stage .st-balance,
.stage .st-water {
  opacity: 0;
  transition: opacity 500ms ease;
}

.stage .st-fij line,
.stage .st-fji line { transition: stroke-width 500ms ease; }

.stage .st-fji { filter: drop-shadow(0 0 5px rgba(255, 106, 43, 0.6)); }
.stage .st-fij { filter: drop-shadow(0 0 5px rgba(36, 196, 255, 0.6)); }
.stage .st-spark { opacity: 0; transition: opacity 500ms ease; filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.9)); }
.stage-wrap[data-state="4"] .st-spark,
.stage-wrap[data-state="5"] .st-spark { opacity: 1; }

.stage .st-alpha {
  transform-box: fill-box;
  transform-origin: left center;
  transform: scaleX(0.5);
  transition: transform 600ms ease;
}

.stage-wrap[data-state="2"] .st-fij,
.stage-wrap[data-state="3"] .st-fij,
.stage-wrap[data-state="4"] .st-fij,
.stage-wrap[data-state="5"] .st-fij { opacity: 1; }

.stage-wrap[data-state="3"] .st-fji,
.stage-wrap[data-state="4"] .st-fji,
.stage-wrap[data-state="5"] .st-fji { opacity: 1; }

.stage-wrap[data-state="4"] .st-balance,
.stage-wrap[data-state="5"] .st-balance { opacity: 1; }

.stage-wrap[data-state="5"] .st-water { opacity: 1; }

.stage-wrap[data-state="4"] .st-alpha,
.stage-wrap[data-state="5"] .st-alpha { transform: scaleX(0.667); }

.stage-wrap[data-state="4"] .st-fij line,
.stage-wrap[data-state="5"] .st-fij line { stroke-width: 7; }

.stage-wrap[data-state="4"] .st-fji line,
.stage-wrap[data-state="5"] .st-fji line { stroke-width: 3.5; }

.stage-wrap[data-state="1"] .st-cap-1,
.stage-wrap[data-state="2"] .st-cap-2,
.stage-wrap[data-state="3"] .st-cap-3,
.stage-wrap[data-state="4"] .st-cap-4,
.stage-wrap[data-state="5"] .st-cap-5 { opacity: 1; }

/* --- "Test the theory" block: centered, non-sticky panel --- */
.test-block { max-width: 580px; margin: 0 auto 2rem; }
.test-block .panel { position: static; }

/* --- Application cards (playable applications from the chapter) --- */
.app-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin: 2rem 0 1.5rem;
  align-items: stretch;
}

.app-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.3rem 1.3rem 1.4rem;
  display: flex;
  flex-direction: column;
}

.app-card h3 { margin-bottom: 0.4rem; }

.app-card .app-sub {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.app-card .tug { height: 26px; margin-top: 0.9rem; }

.app-card .tug-side { font-size: 0.8rem; }

.app-phi {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  margin: 0.6rem 0 0;
}

.app-result {
  font-size: 0.92rem;
  margin: 0.6rem 0 0;
  min-height: 4.6em;
}

.toggle-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.toggle-group .btn { font-size: 0.88rem; padding: 0.55rem 0.5rem; }

.btn.is-on {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.app-slider { margin-bottom: 0.8rem; }

/* --- Final open-question cards (questions only) --- */
.oq-final {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin: 2rem 0 3.5rem;
}

.oq-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 4px solid var(--agent-i);
  border-radius: var(--radius);
  padding: 1.6rem 1.6rem 1.7rem;
}

.oq-card.oq-card-j { border-top-color: var(--agent-j); }

.oq-card p {
  font-family: var(--font-display);
  font-size: 1.3rem;
  line-height: 1.42;
  margin: 0;
}

/* --- Open-question sections (single-page: questions replace scenario pages) --- */
.question-block {
  border-top: 1px solid var(--line-soft);
  padding-top: 3rem;
  margin-top: 1rem;
}

.question-title {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  max-width: 22em;
}

.question-title .q-mark { color: var(--agent-i); }
.question-block.q-cyan .question-title .q-mark { color: var(--agent-j); }

/* --- Scroll reveal --- */
[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 500ms ease, transform 500ms ease;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* --- Footer --- */
.site-footer {
  border-top: 1px solid var(--line-soft);
  padding: 1.75rem 0 2.5rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.site-footer a { color: var(--muted); }

.footer-links {
  flex-basis: 100%;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.03em;
}

.footer-links a { text-decoration-color: var(--line); text-underline-offset: 3px; }
.footer-links a:hover { color: var(--ink); }

/* --- Accessibility & motion --- */
:focus-visible {
  outline: 3px solid rgba(232, 238, 244, 0.5);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.5rem 0.9rem;
  border-radius: 0 0 8px 0;
  z-index: 10;
}

.skip-link:focus { left: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .tug-side { transition: none; }
  .card-link, .btn { transition: none; }
  .stage *, .stage-captions p, .scrolly-step { transition: none !important; }
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .scenario-grid { grid-template-columns: 1fr; gap: 2rem; }
  .panel { position: static; }
  .glossary { grid-template-columns: 1fr; }
  .scenario-cards { grid-template-columns: 1fr; }
  .app-grid { grid-template-columns: 1fr; }
  .oq-final { grid-template-columns: 1fr; }
  .scenario-cards { grid-template-columns: 1fr !important; }
  .hero { padding: 2.5rem 0 1.75rem; }
}
