/*
 * The Friction Atlas — styles
 * Design tokens intentionally match minerclass.github.io so the atlas reads as
 * part of the same ecosystem. Gold (#f0bd45) on near-black (#111318) clears
 * WCAG AA at all sizes used here.
 */

:root {
  --bg: #111318;
  --surface: #181b22;
  --surface-2: #20242d;
  --surface-3: #272c37;
  --line: #343945;
  --line-soft: #2a2f39;
  --ink: #f0eee8;
  --muted: #a8adb7;
  --muted-dim: #868c97;

  --gold: #f0bd45;
  --teal: #67b9aa;
  --violet: #aaa1dc;
  --blue: #70aee7;
  --rust: #dc895e;
  --rose: #e5a1b0;

  --held: #67b9aa;
  --strained: #f0bd45;
  --broken: #dc895e;

  --display: "Arial Black", "Arial Bold", Arial, sans-serif;
  --body: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  --shell: min(1180px, calc(100% - 40px));
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px; }

.shell { width: var(--shell); margin-inline: auto; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--gold); color: #111318; padding: 12px 18px;
  font: 700 .75rem/1 var(--mono); letter-spacing: .07em; text-transform: uppercase;
  text-decoration: none;
}
.skip-link:focus { left: 12px; top: 12px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ----------------------------------------------------------- nav */

.nav {
  position: sticky; top: 0; z-index: 40;
  border-bottom: 1px solid var(--line);
  background: rgba(17, 19, 24, .93);
  backdrop-filter: blur(14px);
}
.nav-inner { min-height: 62px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.brand {
  font-family: var(--display); font-size: .95rem; letter-spacing: -.04em;
  text-decoration: none; color: var(--ink); white-space: nowrap;
}
.brand span { color: var(--gold); }

.progress-wrap { flex: 1; min-width: 140px; display: flex; align-items: center; gap: 10px; }
.progress-track {
  flex: 1; height: 6px; background: var(--surface-2);
  border: 1px solid var(--line); position: relative; overflow: hidden;
}
.progress-fill {
  position: absolute; inset: 0 auto 0 0; width: 0%;
  background: linear-gradient(90deg, var(--teal), var(--gold));
  transition: width .5s cubic-bezier(.2, .8, .2, 1);
}
.progress-label {
  font: 700 .75rem/1 var(--mono); letter-spacing: .08em;
  color: var(--muted); white-space: nowrap;
}

.nav-actions { display: flex; gap: 8px; align-items: center; }
.nav-btn {
  background: transparent; border: 1px solid var(--line); cursor: pointer;
  padding: 8px 12px; font: 700 .75rem/1 var(--mono);
  letter-spacing: .07em; text-transform: uppercase; color: var(--muted);
  transition: .18s ease; text-decoration: none; display: inline-flex; align-items: center; gap: 7px;
}
.nav-btn:hover { border-color: var(--gold); color: var(--gold); }
.nav-btn .tally { color: var(--gold); }

/* ----------------------------------------------------------- hero */

.hero { padding: clamp(64px, 9vw, 118px) 0 56px; position: relative; overflow: hidden; }
.hero::after {
  content: ""; position: absolute; width: 460px; height: 460px;
  border: 1px solid rgba(240, 189, 69, .16); border-radius: 50%;
  right: -170px; top: -130px; pointer-events: none;
  box-shadow: 0 0 0 70px rgba(240, 189, 69, .025), 0 0 0 150px rgba(240, 189, 69, .016);
}
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(250px, .6fr);
  gap: clamp(34px, 6vw, 76px); align-items: end; position: relative; z-index: 1;
}
.eyebrow {
  font: 700 .75rem/1.4 var(--mono); letter-spacing: .14em;
  text-transform: uppercase; color: var(--gold); margin: 0 0 18px;
}
.hero h1 {
  font-family: var(--display); font-size: clamp(2.7rem, 7vw, 5.6rem);
  line-height: .96; letter-spacing: -.075em; margin: 0; max-width: 11ch;
}
.hero h1 span { color: var(--gold); }
.hero-intro {
  border-left: 2px solid var(--gold); padding-left: 20px;
  color: var(--muted); margin: 0 0 6px; font-size: 1rem;
}
.hero-intro strong { color: var(--ink); }
.hero-sub { color: var(--muted); max-width: 62ch; margin: 26px 0 0; font-size: 1.02rem; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px; }

.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 0 20px; border: 1px solid var(--line);
  text-decoration: none; cursor: pointer; background: transparent; color: var(--ink);
  font: 700 .75rem/1 var(--mono); letter-spacing: .07em; text-transform: uppercase;
  transition: .2s ease;
}
.button-primary { background: var(--gold); border-color: var(--gold); color: #111318; }
.button:hover { transform: translateY(-2px); border-color: var(--gold); }
.button-primary:hover { background: #f5cb69; }

/* ----------------------------------------------------------- station map */

.map { padding: 10px 0 74px; }
.map-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.map-card {
  border: 1px solid var(--line); background: var(--surface);
  padding: 18px 16px 16px; text-align: left; cursor: pointer;
  display: flex; flex-direction: column; min-height: 152px;
  transition: .2s ease; position: relative;
}
.map-card:hover { background: var(--surface-2); transform: translateY(-3px); border-color: var(--accent, var(--gold)); }
.map-card .m-num {
  font: 700 .75rem/1 var(--mono); letter-spacing: .12em;
  color: var(--accent, var(--gold)); margin-bottom: auto;
}
.map-card .m-title {
  font-family: var(--display); font-size: 1.06rem; line-height: 1.12;
  letter-spacing: -.04em; margin: 26px 0 6px;
}
.map-card .m-kicker { color: var(--muted-dim); font-size: .76rem; line-height: 1.4; }
.map-card .m-state {
  margin-top: 12px; font: 700 .75rem/1 var(--mono);
  letter-spacing: .1em; text-transform: uppercase; color: var(--muted-dim);
}
.map-card.is-done { border-color: var(--teal); }
.map-card.is-done .m-state { color: var(--teal); }
.map-card.is-current { box-shadow: inset 0 -3px var(--gold); }

/* ----------------------------------------------------------- stations */

.station {
  padding: 74px 0; border-top: 1px solid var(--line);
  scroll-margin-top: 70px;
}
.station:nth-child(even) { background: var(--surface); }

.station-head { max-width: 76ch; margin-bottom: 34px; }
.station-num {
  font: 700 .75rem/1 var(--mono); letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent); display: block; margin-bottom: 14px;
}
.station h2 {
  font-family: var(--display); font-size: clamp(1.9rem, 4.4vw, 3.3rem);
  line-height: 1.02; letter-spacing: -.055em; margin: 0 0 6px;
}
.station h2 em { font-style: normal; color: var(--accent); }
.station-kicker {
  color: var(--muted-dim); font: 700 .75rem/1.4 var(--mono);
  letter-spacing: .08em; text-transform: uppercase; margin: 0 0 16px;
}
.station-lede { color: var(--muted); font-size: 1.02rem; margin: 0; max-width: 68ch; }

.station h3 {
  font-family: var(--display); font-size: 1.28rem; letter-spacing: -.04em;
  margin: 0 0 10px; line-height: 1.18;
}
.station h4 {
  font: 700 .75rem/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted-dim); margin: 0 0 10px;
}
.station p { color: var(--muted); }
.station p strong { color: var(--ink); }

.panel { border: 1px solid var(--line); background: var(--bg); padding: 22px; }
.station:nth-child(even) .panel { background: var(--bg); }

.prompt {
  border-left: 2px solid var(--accent); padding: 4px 0 4px 18px;
  margin: 0 0 24px; color: var(--ink); font-size: 1.02rem;
}

/* -------------------------------------------- station 01: artifact test */

.artifact-frame {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .8fr);
  gap: 20px; align-items: start;
}
.artifact-paper {
  border: 1px solid var(--line); background: var(--surface-2);
  padding: 26px 28px; position: relative;
}
.artifact-paper::before {
  content: "STUDENT SUBMISSION"; position: absolute; top: 12px; right: 14px;
  font: 700 .75rem/1 var(--mono); letter-spacing: .12em; color: var(--muted-dim);
}
.artifact-paper p {
  color: var(--ink); font-size: .95rem; line-height: 1.75; margin: 18px 0 0;
}
.artifact-paper p:first-of-type { margin-top: 26px; }
.artifact-title { font-family: var(--display); font-size: 1.1rem; letter-spacing: -.035em; margin: 22px 0 0; }

.verdict-list { display: grid; gap: 9px; }
.verdict {
  border: 1px solid var(--line); background: var(--surface-2);
  padding: 14px 16px; text-align: left; cursor: pointer; transition: .18s ease;
  font-size: .9rem; color: var(--ink); line-height: 1.45;
}
.verdict:hover:not(:disabled) { border-color: var(--gold); background: var(--surface-3); }
.verdict:disabled { cursor: default; }
.verdict.picked { border-color: var(--gold); box-shadow: inset 3px 0 var(--gold); }
.verdict.dimmed { opacity: .45; }

.reveal {
  margin-top: 18px; border: 1px solid var(--accent); background: var(--surface-2);
  padding: 20px 22px;
}
.reveal[hidden] { display: none; }
.reveal h4 { color: var(--accent); }
.reveal p { margin: 0 0 12px; color: var(--ink); font-size: .95rem; }
.reveal p:last-of-type { margin-bottom: 0; }

.stat-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-top: 20px; }
.stat { background: var(--bg); padding: 18px 16px; }
.stat b {
  display: block; font-family: var(--display); font-size: 1.75rem;
  letter-spacing: -.045em; color: var(--accent); line-height: 1;
}
.stat span { display: block; color: var(--muted); font-size: .78rem; line-height: 1.45; margin-top: 8px; }

/* -------------------------------------------- station 02: the arc */

.arc-rail {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid var(--line); margin-bottom: 4px;
}
.arc-stop {
  padding: 16px 12px 18px; border-right: 1px solid var(--line);
  background: var(--bg); cursor: pointer; text-align: left; transition: .18s ease;
  min-height: 118px; display: flex; flex-direction: column;
}
.arc-stop:last-child { border-right: 0; }
.arc-stop:hover { background: var(--surface-2); }
.arc-stop .a-era {
  font: 700 .75rem/1.3 var(--mono); letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 12px;
}
.arc-stop .a-label {
  font-family: var(--display); font-size: .96rem; line-height: 1.12;
  letter-spacing: -.04em; margin-top: auto;
}
.arc-stop.is-new .a-label { color: var(--gold); }
.arc-stop[aria-selected="true"] { background: rgba(240, 189, 69, .1); box-shadow: inset 0 -3px var(--gold); }
.arc-stop .a-dots { display: flex; gap: 4px; margin-top: 10px; }
.arc-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--held); }
.arc-dot.strained { background: var(--strained); }
.arc-dot.broken { background: var(--broken); }

.arc-detail {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, .85fr);
  gap: 20px; border: 1px solid var(--line); border-top: 0; padding: 24px; background: var(--surface-2);
}
.arc-attr {
  font: 700 .75rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase;
  color: var(--gold); margin: 0 0 10px;
}
.arc-detail h3 { margin-bottom: 12px; }
.arc-detail > div > p { margin: 0; font-size: .95rem; }

.cond-list { display: grid; gap: 8px; }
.cond {
  border: 1px solid var(--line); background: var(--bg); padding: 13px 15px;
  display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: 12px; align-items: start;
}
.cond-flag { width: 12px; height: 12px; border-radius: 50%; margin-top: 4px; background: var(--held); }
.cond-flag.strained { background: var(--strained); }
.cond-flag.broken { background: var(--broken); }
.cond-name { font: 700 .75rem/1.3 var(--mono); letter-spacing: .07em; text-transform: uppercase; margin-bottom: 5px; }
.cond-name .cond-state { color: var(--muted-dim); }
.cond.held .cond-name { color: var(--held); }
.cond.strained .cond-name { color: var(--strained); }
.cond.broken .cond-name { color: var(--broken); }
.cond-note { color: var(--muted); font-size: .82rem; line-height: 1.5; margin: 0; }

.legend { display: flex; gap: 18px; flex-wrap: wrap; margin: 16px 0 0; font: .75rem/1.4 var(--mono); color: var(--muted-dim); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; font-style: normal; }

/* -------------------------------------------- station 03: pressures */

.match-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.pressure-card {
  border: 1px solid var(--line); background: var(--surface-2);
  padding: 20px; display: flex; flex-direction: column; min-height: 210px;
}
.pressure-card .p-domain {
  font: 700 .75rem/1 var(--mono); letter-spacing: .1em;
  text-transform: uppercase; color: var(--rust); margin-bottom: auto;
}
.pressure-card h3 { margin: 30px 0 10px; }
.pressure-card .p-def { color: var(--muted); font-size: .85rem; line-height: 1.55; margin: 0 0 16px; }

.match-slot {
  border: 1px dashed var(--line); background: var(--bg); min-height: 46px;
  display: flex; align-items: center; justify-content: center; padding: 8px;
  font: 700 .75rem/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted-dim); text-align: center;
}
.match-slot.filled { border-style: solid; }
.match-slot.correct { border-color: var(--teal); color: var(--teal); background: rgba(103, 185, 170, .09); }
.match-slot.wrong { border-color: var(--broken); color: var(--broken); background: rgba(220, 137, 94, .09); }

.chip-tray { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.chip {
  border: 1px solid var(--line); background: var(--surface-2); cursor: pointer;
  padding: 11px 14px; font: 700 .75rem/1.2 var(--mono); letter-spacing: .05em;
  color: var(--ink); transition: .16s ease;
}
.chip:hover { border-color: var(--gold); }
.chip.is-selected { border-color: var(--gold); background: rgba(240, 189, 69, .14); color: var(--gold); }
.chip.is-used { opacity: .3; pointer-events: none; }

.pressure-more { margin-top: 14px; }
.pressure-more[hidden] { display: none; }
.pressure-more p { font-size: .85rem; margin: 0 0 10px; }
.pressure-more p:last-child { margin-bottom: 0; }
.pressure-more .p-stake { color: var(--ink); border-left: 2px solid var(--rust); padding-left: 12px; }

/* -------------------------------------------- station 04: framework */

.build-stack { display: grid; gap: 10px; }
.build-layer {
  border: 1px solid var(--line); background: var(--surface-2); padding: 20px 22px;
  transition: .25s ease; position: relative;
}
.build-layer.locked { opacity: .42; }
.build-layer.built { border-color: var(--accent2, var(--teal)); }
.build-layer-head { display: flex; gap: 16px; align-items: baseline; flex-wrap: wrap; }
.build-place {
  font: 700 .75rem/1 var(--mono); letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent2, var(--teal));
}
.build-layer h3 { margin: 0; }
.build-layer .b-def { color: var(--muted); font-size: .9rem; margin: 12px 0 0; max-width: 78ch; }
.build-body { margin-top: 16px; }
.build-body[hidden] { display: none; }
.build-body .b-arg { color: var(--ink); font-size: .92rem; margin: 0 0 16px; max-width: 78ch; }
.build-body .b-claim {
  border-left: 2px solid var(--accent2, var(--teal)); padding-left: 14px;
  color: var(--muted); font-size: .88rem; margin: 16px 0 0;
}
.practice-list { display: flex; gap: 7px; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; }
.practice-list li {
  border: 1px solid var(--line); padding: 7px 11px;
  font: .75rem/1.2 var(--mono); color: var(--muted); letter-spacing: .02em;
}
.build-cta { margin-top: 16px; }
.lock-note {
  font: 700 .75rem/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase;
  color: var(--rust); margin: 12px 0 0;
}
.base-marker {
  position: absolute; top: -1px; left: -1px; background: var(--teal); color: #111318;
  font: 700 .75rem/1 var(--mono); letter-spacing: .1em; padding: 5px 8px;
}

/* -------------------------------------------- station 05: card sort */

.sort-stage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .75fr); gap: 20px; align-items: start; }
.sort-card {
  border: 1px solid var(--line); background: var(--surface-2); padding: 26px 28px; min-height: 190px;
  display: flex; flex-direction: column;
}
.sort-counter { font: 700 .75rem/1 var(--mono); letter-spacing: .12em; color: var(--muted-dim); text-transform: uppercase; }
.sort-text { font-size: 1.06rem; line-height: 1.6; color: var(--ink); margin: 22px 0 0; }
.sort-dim { margin-top: auto; padding-top: 18px; font: 700 .75rem/1 var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--rose); }
.sort-choices { display: grid; gap: 9px; }
.sort-choices .verdict { text-align: left; }
.sort-choices .hint { color: var(--muted-dim); font-size: .78rem; line-height: 1.5; margin: 4px 0 0; }

.scoreboard { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.score-pill {
  border: 1px solid var(--line); padding: 8px 12px;
  font: 700 .75rem/1.2 var(--mono); letter-spacing: .06em; color: var(--muted);
}
.score-pill b { color: var(--gold); }

/* -------------------------------------------- station 06: arena */

.arena-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.arena-tab {
  border: 1px solid var(--line); background: transparent; cursor: pointer;
  padding: 10px 14px; font: 700 .75rem/1.2 var(--mono); letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); transition: .18s ease;
}
.arena-tab:hover { border-color: var(--violet); color: var(--violet); }
.arena-tab[aria-selected="true"] { background: var(--violet); border-color: var(--violet); color: #111318; }
.arena-tab.solved::after { content: " ✓"; }

.steelman {
  border: 1px solid var(--violet); background: rgba(170, 161, 220, .07);
  padding: 22px 24px; margin-bottom: 18px;
}
.steelman h4 { color: var(--violet); }
.steelman p { color: var(--ink); margin: 0; font-size: .98rem; }

/* -------------------------------------------- station 07: evidence */

.ev-controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
.ev-filter {
  border: 1px solid var(--line); background: transparent; cursor: pointer;
  padding: 9px 13px; font: 700 .75rem/1 var(--mono); letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); transition: .18s ease;
}
.ev-filter:hover, .ev-filter[aria-pressed="true"] { border-color: var(--gold); background: var(--gold); color: #111318; }

.ev-group { margin-bottom: 26px; }
.ev-group > h4 { color: var(--muted); margin-bottom: 12px; }
.ev-row { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 2fr); gap: 16px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.ev-label { font-size: .86rem; color: var(--ink); line-height: 1.4; }
.ev-label small { display: block; color: var(--muted-dim); font: .75rem/1.4 var(--mono); margin-top: 4px; }
.ev-bar-wrap { display: flex; align-items: center; gap: 12px; }
.ev-track { flex: 1; height: 22px; background: var(--surface-2); border: 1px solid var(--line); position: relative; overflow: hidden; }
.ev-bar { position: absolute; inset: 0 auto 0 0; width: 0; transition: width .9s cubic-bezier(.2, .8, .2, 1); }
.ev-pct { font: 700 .78rem/1 var(--mono); color: var(--ink); min-width: 52px; text-align: right; }

.ev-note {
  border: 1px solid var(--line); background: var(--surface-2); padding: 18px 20px;
  color: var(--muted); font-size: .8rem; line-height: 1.65; margin-top: 8px;
}
.ev-note strong { color: var(--ink); }

.gap-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 28px; }
.gap-card { border: 1px solid var(--line); background: var(--surface-2); padding: 20px; }
.gap-card h3 { font-size: 1.05rem; margin-bottom: 12px; }
.gap-card .g-has { color: var(--teal); font-size: .85rem; margin: 0 0 8px; }
.gap-card .g-lacks { color: var(--rust); font-size: .85rem; margin: 0; }
.gap-card .g-has::before { content: "Holds — "; font-weight: 700; }
.gap-card .g-lacks::before { content: "Missing — "; font-weight: 700; }

.rq-list { display: grid; gap: 10px; margin-top: 28px; }
.rq {
  border: 1px solid var(--line); background: var(--surface-2); padding: 20px 22px;
  display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 18px; align-items: start;
}
.rq b { font-family: var(--display); font-size: 1.5rem; letter-spacing: -.05em; color: var(--gold); line-height: 1; }
.rq p { margin: 0 0 12px; color: var(--ink); font-size: .94rem; }
.rq .rq-links { display: flex; gap: 7px; flex-wrap: wrap; }
.rq .rq-links span {
  border: 1px solid var(--line); padding: 5px 9px;
  font: 700 .75rem/1 var(--mono); letter-spacing: .06em; color: var(--muted);
}

/* ----------------------------------------------------------- citations */

.cite {
  background: none; border: 0; padding: 0 1px; cursor: pointer;
  color: var(--gold); font: inherit; border-bottom: 1px dotted var(--gold);
}
.cite:hover { background: rgba(240, 189, 69, .14); }

.source-drop { margin-top: 18px; }
.source-drop summary {
  cursor: pointer; font: 700 .75rem/1 var(--mono); letter-spacing: .09em;
  text-transform: uppercase; color: var(--muted-dim); padding: 8px 0;
}
.source-drop summary:hover { color: var(--gold); }
.source-drop ul { margin: 10px 0 0; padding: 0 0 0 18px; }
.source-drop li { color: var(--muted); font-size: .8rem; line-height: 1.65; margin-bottom: 8px; }

/* ----------------------------------------------------------- badges + completion */


.station-done {
  margin-top: 26px; border: 1px solid var(--teal); background: rgba(103, 185, 170, .08);
  padding: 16px 20px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
}
.station-done[hidden] { display: none; }
.station-done p { margin: 0; color: var(--teal); font: 700 .75rem/1.4 var(--mono); letter-spacing: .07em; text-transform: uppercase; }
.station-done .button { margin-left: auto; }

/* ----------------------------------------------------------- modal */

.modal[hidden] { display: none; }
.modal {
  position: fixed; inset: 0; z-index: 60; display: flex;
  align-items: flex-start; justify-content: center; padding: 5vh 16px;
  background: rgba(10, 11, 15, .84); backdrop-filter: blur(6px);
}
.modal-box {
  background: var(--surface); border: 1px solid var(--line);
  width: min(760px, 100%); max-height: 90vh; display: flex; flex-direction: column;
}
.modal-head {
  display: flex; align-items: center; gap: 16px; padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 { font-family: var(--display); font-size: 1.35rem; letter-spacing: -.045em; margin: 0; }
.modal-head .tally { font: 700 .75rem/1 var(--mono); color: var(--gold); letter-spacing: .07em; }
.modal-close {
  margin-left: auto; background: transparent; border: 1px solid var(--line);
  cursor: pointer; width: 34px; height: 34px; color: var(--muted); font-size: 1.1rem; line-height: 1;
}
.modal-close:hover { border-color: var(--gold); color: var(--gold); }
.modal-body { overflow-y: auto; padding: 20px 24px 26px; }

.codex-search {
  width: 100%; background: var(--bg); border: 1px solid var(--line);
  color: var(--ink); padding: 11px 13px; font: .82rem/1.2 var(--mono); margin-bottom: 16px;
}
.codex-list { list-style: none; margin: 0; padding: 0; }
.codex-list li { padding: 13px 0; border-bottom: 1px solid var(--line-soft); }
.codex-list li[hidden] { display: none; }
.codex-tag {
  display: inline-block; border: 1px solid var(--line); padding: 3px 7px; margin-bottom: 7px;
  font: 700 .75rem/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--gold);
}
.codex-ref { color: var(--muted); font-size: .84rem; line-height: 1.6; }
.codex-ref em { color: var(--ink); font-style: italic; }
.codex-locked { color: var(--muted-dim); font: .8rem/1.6 var(--mono); }
.codex-empty { color: var(--muted-dim); font-size: .85rem; }

/* ----------------------------------------------------------- footer */

.footer { border-top: 1px solid var(--line); padding: 42px 0 34px; }
.footer-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; margin-bottom: 30px; }
.footer h4 { margin-bottom: 12px; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: 8px; }
.footer a { color: var(--muted); text-decoration: none; font-size: .86rem; }
.footer a:hover { color: var(--gold); }
.footer-meta {
  border-top: 1px solid var(--line); padding-top: 22px;
  color: var(--muted-dim); font: .75rem/1.8 var(--mono); letter-spacing: .04em;
}
.footer-meta a { color: var(--muted-dim); }

/* ----------------------------------------------------------- responsive */

@media (max-width: 1000px) {
  .map-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .match-grid { grid-template-columns: 1fr; }
  .arc-detail { grid-template-columns: 1fr; }
  .artifact-frame { grid-template-columns: 1fr; }
  .sort-stage { grid-template-columns: 1fr; }
  .gap-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; }
  .arc-rail { grid-template-columns: repeat(5, 168px); overflow-x: auto; scroll-snap-type: x proximity; }
  .arc-stop { scroll-snap-align: start; }
  .stat-strip { grid-template-columns: 1fr; }
  .ev-row { grid-template-columns: 1fr; gap: 8px; }
}

@media (max-width: 620px) {
  :root { --shell: min(1180px, calc(100% - 26px)); }
  .hero h1 { font-size: clamp(2.3rem, 12vw, 3.2rem); overflow-wrap: anywhere; }
  .map-grid { grid-template-columns: 1fr; }
  .progress-wrap { order: 3; flex-basis: 100%; }
  .rq { grid-template-columns: 1fr; gap: 10px; }
  .artifact-paper, .sort-card { padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* ------------------------------------------------------------------ */
/* Review pass, July 2026 — target sizes, diagrams, and choice states  */
/* ------------------------------------------------------------------ */

/*
 * WCAG 2.5.8 target minimum. Citation buttons sit inline inside running prose,
 * so the hit area grows through padding rather than layout, keeping the text
 * baseline intact.
 */
.cite {
  display: inline-block; min-height: 24px; padding: 3px 3px 2px;
  line-height: 1.5; vertical-align: baseline;
}
.footer ul a { display: inline-block; min-height: 24px; padding: 3px 0; }
.footer li { margin-bottom: 4px; }
/* Links inside running footer prose get the same treatment as inline citations. */
.footer-meta a { display: inline-block; min-height: 24px; padding: 3px 1px 2px; line-height: 1.5; }

/* Station 03: the slot is armed once a condition is selected. There is no
   drag anywhere on this page, so the label states the next step instead. */
.match-slot { cursor: pointer; transition: border-color .16s ease, color .16s ease; }
.match-slot.is-armed { border-color: var(--gold); color: var(--gold); border-style: solid; }
.match-slot:disabled { cursor: default; }

/* Station 01: the draft's own answer stays identified after any pick, so a
   reader who chose differently still learns which one it was. */
.verdict.is-answer { border-color: var(--teal); }
.answer-tag {
  display: block; margin-top: 8px;
  font: 700 .75rem/1 var(--mono); letter-spacing: .08em;
  text-transform: uppercase; color: var(--teal);
}
.reveal.is-off { border-color: var(--strained); }

/* Inline SVG diagrams. Wide content scrolls inside its own container so the
   page body never scrolls horizontally. */
.diagram { margin: 26px 0 0; padding: 0; }
.diagram-scroll { overflow-x: auto; overflow-y: hidden; }
.diagram-scroll svg { display: block; width: 100%; min-width: 460px; height: auto; }
.diagram figcaption {
  margin-top: 12px; max-width: 74ch;
  font-size: .95rem; line-height: 1.55; color: var(--muted);
}
.mx-col {
  font: 700 .75rem/1 var(--mono); fill: var(--muted);
  letter-spacing: .04em; text-transform: uppercase;
}
.mx-col.mx-new { fill: var(--gold); }
.mx-row {
  font: 700 .8rem/1 var(--mono); fill: var(--ink); letter-spacing: .03em;
}
.fd-place {
  font: 700 .75rem/1 var(--mono); fill: var(--muted-dim); letter-spacing: .1em;
}
.fd-name { font-family: var(--display); font-size: 1.05rem; fill: var(--muted); }
.fd-name.is-on { fill: var(--ink); }

@media (max-width: 620px) {
  .diagram-scroll svg { min-width: 420px; }
}
