/* The neutral shell.
 *
 * Deliberately opinionless. Page styling is decided after a liveness treatment wins,
 * and running a palette inside the realism comparison would reintroduce exactly the
 * confound the bake-off was restructured to remove.
 *
 * The viewport backdrop is a neutral mid-grey for the same reason photographers judge
 * prints against one: it flatters neither a dark treatment nor a light one.
 */

:root {
  --bg: #202325;
  --surface: #2A2E30;
  --backdrop: #5A5E60;
  --text: #E8E6E3;
  --muted: #9AA0A2;
  --line: #3B4043;
  --radius: 3px;
  --font-body: 'IBM Plex Sans', 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', 'Consolas', monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px 80px; }

/* Lane badge: which liveness treatment this file is, stated plainly so a screenshot
   sheet is never ambiguous about what is being compared. */
.lane-badge {
  display: inline-block;
  margin: 22px 0 6px;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

h1 { font-size: 30px; font-weight: 600; margin: 6px 0 2px; letter-spacing: -0.01em; }
h1 .sci { font-style: italic; font-weight: 300; color: var(--muted); font-size: 20px; margin-left: 10px; }
h2 { font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 34px 0 12px; }

/* ---- viewport ---- */

.stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  min-height: 320px;
  margin-top: 14px;
  background: var(--backdrop);
  border-radius: var(--radius);
  overflow: hidden;
  touch-action: none; /* orbit and scrub own the gesture inside the stage */
}

.stage canvas { display: block; width: 100%; height: 100%; }

.hotspot-layer { position: absolute; inset: 0; pointer-events: none; }

.hotspot {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  width: 17px; height: 17px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.82);
  background: rgba(20,22,24,0.34);
  cursor: pointer;
  padding: 0;
  transition: transform 140ms ease, background 140ms ease;
}
.hotspot:hover, .hotspot:focus-visible { background: rgba(255,255,255,0.9); transform: translate(-50%,-50%) scale(1.22); outline: none; }
.hotspot[aria-expanded="true"] { background: rgba(255,255,255,0.95); }
.hotspot.occluded { opacity: 0.28; }

.hotspot-card {
  position: absolute;
  transform: translate(-50%, calc(-100% - 16px));
  min-width: 168px; max-width: 260px;
  background: rgba(24,27,29,0.95);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 11px;
  pointer-events: none;
}
.hotspot-card .label { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.hotspot-card .line { font-size: 13px; color: var(--muted); line-height: 1.42; }

.readout {
  position: absolute; left: 14px; bottom: 12px;
  font-family: var(--font-mono); font-size: 13px; color: rgba(255,255,255,0.72);
  background: rgba(18,20,22,0.5); padding: 5px 9px; border-radius: var(--radius);
  pointer-events: none;
}

/* ---- controls ---- */

.controls {
  display: flex; flex-wrap: wrap; gap: 22px; align-items: center;
  margin-top: 14px; padding: 13px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.control { display: flex; align-items: center; gap: 10px; }
.control > label { font-size: 13px; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
.control input[type=range] { width: 190px; accent-color: #C9CCCE; }
.control .value { font-family: var(--font-mono); font-size: 13px; min-width: 76px; }

.modes { display: flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.modes button {
  background: transparent; border: 0; color: var(--muted);
  font-family: var(--font-body); font-size: 13px; padding: 6px 13px; cursor: pointer;
}
.modes button[aria-pressed="true"] { background: #3C4245; color: var(--text); }

.consequence { font-size: 13px; font-family: var(--font-mono); }
.consequence[data-state="sinking"] { color: #E2A03C; }
.consequence[data-state="climbing"] { color: #7FC4E8; }
.consequence[data-state="hover"] { color: var(--muted); }

/* ---- facts ---- */

.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-top: 14px; }
.fact { background: var(--surface); padding: 14px 16px; }
.fact .n { font-family: var(--font-mono); font-size: 25px; letter-spacing: -0.02em; }
.fact .n small { font-size: 14px; color: var(--muted); margin-left: 3px; }
.fact .k { font-size: 13px; color: var(--muted); margin-top: 3px; }
.fact .cite { font-size: 13px; color: #6E7476; margin-top: 6px; font-family: var(--font-mono); }
.fact .unverified { color: #E2A03C; }

/* ---- scale + map ---- */

.two-up { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.panel svg { display: block; width: 100%; height: auto; }
.panel .caption { font-size: 13px; color: var(--muted); margin-top: 9px; }

.map-node { cursor: pointer; }
.map-node circle { fill: #464B4E; stroke: #5E6467; stroke-width: 1; transition: fill 130ms ease; }
.map-node:hover circle { fill: #5A6063; }
.map-node.lit circle { fill: #D8DBDC; stroke: #FFFFFF; }
.map-node text { fill: var(--muted); font-size: 13px; font-family: var(--font-body); text-anchor: middle; }
.map-node.lit text { fill: var(--text); }
.map-edge { stroke: #3E4346; stroke-width: 1; fill: none; }

/* ---- sources ---- */

details.sources { margin-top: 34px; border-top: 1px solid var(--line); padding-top: 14px; }
details.sources summary { cursor: pointer; font-size: 13px; color: var(--muted); letter-spacing: 0.07em; text-transform: uppercase; }
details.sources ol { font-size: 13px; color: var(--muted); line-height: 1.6; padding-left: 20px; }
details.sources code { font-family: var(--font-mono); font-size: 13px; color: #8E9497; }

.exits { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }
.exits a {
  font-size: 13px; color: var(--text); text-decoration: none;
  border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 13px;
}
.exits a:hover { border-color: #5E6467; }
.exits a span { color: var(--muted); }

.a11y-summary { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 760px) {
  .two-up { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; }
  .stage { aspect-ratio: 4 / 5; }
  .control input[type=range] { width: 100%; }
  .control { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
