/* =====================================================================
   EVOLVE — STYLES
   A sci-fi genetic engineering lab: dark chamber, one hologram colour
   (cyan), amber for anything an adaptation adds, HUD corner brackets
   and data readouts.
   ===================================================================== */

@font-face {
  font-family: "Michroma";
  src: url("assets/fonts/michroma-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("assets/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("assets/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("assets/fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("assets/fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  --bg: #04090e;        /* the lab chamber */
  --panel: #0a141d;     /* panels and cards */
  --panel-2: #0f1d29;   /* raised / hover */
  --line: rgba(111, 227, 255, 0.14);
  --holo: #6fe3ff;      /* the hologram colour */
  --holo-dim: rgba(111, 227, 255, 0.6);
  --amber: #ff9f43;     /* things an adaptation adds */
  --text: #d8f3ff;
  --muted: #8fabbf;
  --faint: #6d8698;

  --high: #6dffc8;
  --mid: #6fe3ff;
  --low: #ffb347;
  --critical: #ff5a5f;

  --display: "Michroma", "Eurostile", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", Consolas, monospace;
  --sans: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --maxw: 1240px;

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { font-size: 100%; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex; flex-direction: column;
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  background-color: var(--bg);
  /* faint lab grid */
  background-image:
    linear-gradient(rgba(111, 227, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(111, 227, 255, 0.035) 1px, transparent 1px),
    radial-gradient(ellipse 70% 50% at 70% 0%, rgba(111, 227, 255, 0.07), transparent 70%);
  background-size: 44px 44px, 44px 44px, auto;
  background-attachment: fixed;
}
h1, h2, h3, p, ul, ol, dl, dd, figure, blockquote { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; }
code { font-family: var(--mono); font-size: 0.9em; color: var(--holo); }

:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
[tabindex="-1"]:focus { outline: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--holo); color: #02121a; padding: 10px 14px; font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* Small data readout text (status strips, labels in the lab) */
.readout {
  font-family: var(--mono); font-size: 0.74rem; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--holo-dim);
}

/* HUD panel: corner brackets instead of a full border */
.hud {
  --b: rgba(111, 227, 255, 0.7);
  --s: 14px;
  background:
    linear-gradient(var(--b), var(--b)) top left / var(--s) 1.5px no-repeat,
    linear-gradient(var(--b), var(--b)) top left / 1.5px var(--s) no-repeat,
    linear-gradient(var(--b), var(--b)) top right / var(--s) 1.5px no-repeat,
    linear-gradient(var(--b), var(--b)) top right / 1.5px var(--s) no-repeat,
    linear-gradient(var(--b), var(--b)) bottom left / var(--s) 1.5px no-repeat,
    linear-gradient(var(--b), var(--b)) bottom left / 1.5px var(--s) no-repeat,
    linear-gradient(var(--b), var(--b)) bottom right / var(--s) 1.5px no-repeat,
    linear-gradient(var(--b), var(--b)) bottom right / 1.5px var(--s) no-repeat,
    var(--panel);
  border: 1px solid var(--line);
}

/* ---------------- Buttons (bevelled console buttons) ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 0.6em 1.4em;
  border: 1px solid transparent; background: none; cursor: pointer;
  font-weight: 700; line-height: 1.2; letter-spacing: 0.02em;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  touch-action: manipulation;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.btn:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-primary { background: var(--holo); color: #02121a; }
.btn-primary:hover:not(:disabled) { background: #a6efff; }
.btn-secondary { background: rgba(111, 227, 255, 0.08); color: var(--holo); border-color: rgba(111, 227, 255, 0.45); }
.btn-secondary:hover:not(:disabled) { background: rgba(111, 227, 255, 0.18); }
.btn-quiet { color: var(--muted); font-weight: 400; min-height: 42px; padding: 0.4em 0.8em; clip-path: none; }
.btn-quiet:hover { color: var(--holo); }
.btn-lg { min-height: 54px; padding: 0.75em 1.7em; font-size: 1.05rem; }
.btn-block { width: 100%; }

.link-btn {
  background: none; border: 0; padding: 4px 2px; cursor: pointer;
  color: var(--muted); text-decoration: underline; text-underline-offset: 3px;
}
.link-btn:hover { color: var(--holo); }

/* ---------------- Header ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 28px;
  padding: 10px max(16px, calc((100vw - var(--maxw)) / 2));
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.wordmark-small {
  background: none; border: 0; cursor: pointer; padding: 4px 0;
  font-family: var(--display); font-size: 1.05rem; letter-spacing: 0.28em; color: var(--text);
}
.stepper { display: flex; gap: 22px; margin-right: auto; color: var(--faint); font-size: 0.92rem; }
.stepper li { display: flex; align-items: center; gap: 8px; }
.step-num { font-family: var(--mono); font-size: 0.78rem; padding: 1px 5px; border: 1px solid currentColor; }
.stepper li[aria-current="step"] { color: var(--holo); font-weight: 700; }
.stepper li[aria-current="step"] .step-num { background: var(--holo); color: #02121a; border-color: var(--holo); }
.stepper li.done { color: var(--muted); }
body[data-screen="landing"] .stepper { visibility: hidden; }
.header-actions { display: flex; gap: 4px; }
.present-short { display: none; }

/* ---------------- Layout ---------------- */
main { flex: 1; width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 36px 16px 56px; }
.screen-head { margin-bottom: 28px; }
.screen-head .readout { margin-bottom: 10px; }
.screen-head h2 { font-family: var(--display); font-weight: 400; font-size: clamp(1.5rem, 3.4vw, 2.2rem); line-height: 1.2; margin-bottom: 8px; }
.intro { color: var(--muted); font-size: 1.08rem; }
.intro strong { color: var(--text); }
.fine { color: var(--faint); font-size: 0.92rem; }

/* ---------------- Landing ---------------- */
.landing {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 48px; align-items: center; min-height: 72vh;
}
.landing-text .readout { margin-bottom: 18px; }
.wordmark {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(3rem, 9vw, 6.2rem); line-height: 1; letter-spacing: 0.14em;
  color: #eafaff;
  text-shadow: 0 0 24px rgba(111, 227, 255, 0.45);
}
.subtitle { font-size: clamp(1.3rem, 2.8vw, 1.8rem); color: var(--holo); margin: 14px 0 20px; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 30em; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 30px 0 16px; }

.chamber { position: relative; overflow: hidden; }
/* faint CRT scan-lines over hologram areas */
.chamber::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.18) 0 1px, transparent 1px 3px);
}
.landing-chamber { padding: 20px 20px 16px; max-width: 460px; justify-self: end; width: 100%; }
.figure { display: block; width: 100%; height: auto; }
.figure-hero { max-height: 460px; animation: materialise 1.8s ease-out both; }
@keyframes materialise {
  from { clip-path: inset(100% 0 0 0); opacity: 0.2; }
  to { clip-path: inset(0 0 0 0); opacity: 1; }
}
.chamber-readouts { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.chamber-readouts dt { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.chamber-readouts dd { font-family: var(--mono); color: var(--holo); font-size: 0.92rem; }

/* ---------------- Photos (when images exist) ---------------- */
/* Landing: a dim lab photo behind everything, fading out towards the text */
.landing-bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.landing-photo {
  width: 100%; height: 100%; object-fit: cover;
  filter: brightness(0.55) saturate(0.9);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0,0,0,0.35) 30%, #000 65%);
  mask-image: linear-gradient(90deg, transparent 0%, rgba(0,0,0,0.35) 30%, #000 65%);
}
body:not([data-screen="landing"]) .landing-bg { display: none; }

/* Habitat cards and the results chamber: photo underneath, dark tint on top */
.env-card, .chamber { isolation: isolate; }
.env-photo, .chamber-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; }
.env-photo { filter: brightness(0.85) saturate(1); transition: filter 0.25s ease; }
.env-card.has-photo:hover .env-photo, .env-card.has-photo:focus-within .env-photo { filter: brightness(1) saturate(1.05); }
.env-card.has-photo::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, rgba(4, 9, 14, 0.5) 0%, rgba(4, 9, 14, 0.62) 50%, rgba(4, 9, 14, 0.86) 100%);
}
.env-card.has-photo { text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9); }
.chamber-photo { filter: brightness(0.4) saturate(0.8) hue-rotate(-10deg); }
.chamber.has-photo { background-color: transparent; }

/* Animal cards: the photo covers the hologram drawing */
.art-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(0.9) contrast(1.05); }
.adapt-art.has-photo .sample-id { z-index: 2; text-shadow: 0 1px 3px #000; color: var(--holo); }

/* ---------------- Habitats ---------------- */
.env-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.env-card { position: relative; display: flex; flex-direction: column; padding: 18px 20px 18px; }
.env-card:hover, .env-card:focus-within { --b: var(--holo); border-color: rgba(111, 227, 255, 0.4); background-color: var(--panel-2); }
.env-card.chosen { --b: var(--amber); border-color: rgba(255, 159, 67, 0.5); }
.env-card.speculative { border-style: dashed; border-color: rgba(255, 90, 95, 0.35); }
.env-card .readout { margin-bottom: 12px; }
.env-name { font-family: var(--display); font-weight: 400; font-size: 1.3rem; line-height: 1.2; }
.env-tag { color: var(--critical); font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; margin-top: 6px; }
.env-fact { font-family: var(--mono); color: var(--holo); font-size: 0.95rem; margin: 12px 0; }
.env-card.has-photo .env-challenges { color: #b8cfdd; }
.env-card.has-photo { min-height: 240px; }
.env-challenges { color: var(--muted); font-size: 0.93rem; margin-bottom: 16px; }
.env-choose { margin-top: auto; align-self: flex-start; }
.env-choose::after { content: ""; position: absolute; inset: 0; }

/* ---------------- Builder ---------------- */
.presenter-tools { display: none; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.builder-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 26px; align-items: start; }
.adapt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }

/* Gene sample card */
.adapt-card { display: flex; flex-direction: column; padding: 16px 16px 14px; }
.adapt-card:hover { border-color: rgba(111, 227, 255, 0.35); }
.adapt-art {
  position: relative; height: 120px; margin: -16px -16px 12px;
  background: radial-gradient(ellipse at 50% 85%, rgba(111, 227, 255, 0.12), rgba(4, 9, 14, 0.9) 70%);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.adapt-art::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.2) 0 1px, transparent 1px 3px);
}
.adapt-art svg { display: block; width: 100%; height: 100%; }
.sample-id { position: absolute; left: 10px; top: 8px; z-index: 1; font-size: 0.66rem; }
.adapt-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.adapt-animal { font-size: 0.9rem; font-weight: 700; color: var(--muted); }
.adapt-species { font-style: italic; color: var(--faint); font-size: 0.88rem; }
.adapt-name { font-family: var(--display); font-weight: 400; font-size: 1.05rem; line-height: 1.3; margin: 6px 0 2px; }
.adapt-tag { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--critical); }
.tradeoff { display: grid; gap: 3px; margin: 10px 0; font-size: 0.97rem; }
.tradeoff div { display: flex; gap: 8px; }
.tradeoff dt { flex: none; width: 1em; font-weight: 700; text-align: center; }
.tradeoff dd { margin: 0; }
.tradeoff .gain dt { color: var(--high); }
.tradeoff .cost dt { color: var(--critical); }
.bio { margin: 0 0 12px; font-size: 0.9rem; }
.bio summary { cursor: pointer; color: var(--faint); width: max-content; padding: 2px 0; text-decoration: underline; text-underline-offset: 3px; }
.bio summary:hover { color: var(--holo); }
.bio[open] summary { margin-bottom: 6px; }
.adapt-fact { color: var(--muted); margin-bottom: 6px; }
.effects { font-family: var(--mono); color: var(--faint); font-size: 0.78rem; }
.btn-select { margin-top: auto; width: 100%; background: rgba(111, 227, 255, 0.06); border-color: rgba(111, 227, 255, 0.35); color: var(--holo); }
.btn-select:hover:not(:disabled) { background: rgba(111, 227, 255, 0.16); }

/* A selected sample glows amber, like the feature it adds to the human */
.adapt-card.selected { --b: var(--amber); border-color: rgba(255, 159, 67, 0.55); background-color: #15130f; }
.adapt-card.selected .btn-select { border-color: var(--amber); color: var(--amber); background: rgba(255, 159, 67, 0.1); }
.adapt-card.locked { opacity: 0.45; }

/* Synthesis chamber panel */
.panel { padding: 16px 18px 18px; }
.panel-strip { display: flex; justify-content: space-between; margin-bottom: 8px; }
.pulse { color: var(--high); }
.pulse::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; background: var(--high); border-radius: 50%; animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.25; } }
#livePanel { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 14px; max-height: calc(100vh - 92px); overflow-y: auto; }
#livePanel .panel-strip { margin-bottom: -4px; }
.figure-live { max-height: 290px; margin: 0 auto; }
.figure.flicker { animation: flicker 0.45s steps(2, end); }
@keyframes flicker { 0% { opacity: 0.35; } 40% { opacity: 1; } 60% { opacity: 0.6; } 100% { opacity: 1; } }
.counter { color: var(--muted); text-align: center; font-family: var(--mono); font-size: 0.95rem; }
.counter strong { color: var(--holo); }
.panel-details summary { cursor: pointer; color: var(--muted); padding: 4px 0; }
.panel-details summary:hover { color: var(--holo); }
.panel-details[open] { display: grid; gap: 14px; }
.picked { display: grid; gap: 2px; }
.picked li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 3px 0; border-bottom: 1px solid var(--line); color: var(--amber); }
.picked .picked-empty { color: var(--faint); border: 0; }
.remove-btn { flex: none; width: 34px; height: 34px; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 1.3rem; line-height: 1; }
.remove-btn:hover { color: var(--critical); }

/* Meters: segmented like an instrument readout */
.meter-row { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; font-size: 0.93rem; }
.meter-row strong { white-space: nowrap; font-family: var(--mono); font-weight: 500; }
.bar { height: 8px; background: repeating-linear-gradient(90deg, rgba(111, 227, 255, 0.1) 0 5px, transparent 5px 7px); overflow: hidden; }
.bar-fill {
  --c: var(--mid);
  display: block; height: 100%;
  background: repeating-linear-gradient(90deg, var(--c) 0 5px, transparent 5px 7px);
  filter: drop-shadow(0 0 3px var(--c));
  transition: width 0.7s cubic-bezier(.2, .8, .2, 1);
}
.level-high { --c: var(--high); }
.level-mid { --c: var(--mid); }
.level-low { --c: var(--low); }
.level-critical { --c: var(--critical); }
.bar-energy .bar-fill { --c: var(--amber); }

.rating { font-family: var(--sans); font-weight: 700; margin-left: 6px; }
.rating-high { color: var(--high); }
.rating-mid { color: var(--mid); }
.rating-low { color: var(--low); }
.rating-critical { color: var(--critical); }

.live-warnings { font-size: 0.92rem; }
.live-warnings ul { display: grid; gap: 3px; }
.live-warnings li { display: flex; gap: 10px; }
.warn-amt { flex: none; min-width: 2.4em; font-family: var(--mono); color: var(--critical); }
.warn-none { color: var(--faint); }

.mobile-bar { display: none; }

/* ---------------- Results ---------------- */
#screen-results > .readout { margin-bottom: 18px; }
.result-hero {
  display: grid; grid-template-columns: minmax(260px, 380px) minmax(0, 1fr); gap: 44px; align-items: center;
  margin-bottom: 32px;
}
.result-hero .chamber { padding: 16px; }
.figure-result { max-height: 540px; }

/* Realistic photo of the human (layers stacked on top of each other) */
.figure[hidden], .human-photo[hidden] { display: none; }
.human-photo { position: relative; aspect-ratio: 2 / 3; max-width: 100%; margin: 0 auto; }
.human-photo canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: center bottom; }
.photo-figure-hero { height: 460px; animation: materialise 1.8s ease-out both; }
.photo-figure-live { height: 290px; }
.photo-figure-result { height: 540px; }
.human-photo.flicker { animation: flicker 0.45s steps(2, end); }
.chamber.showing-photo { padding-bottom: 0; }
.chamber.showing-photo .chamber-photo { filter: brightness(0.75) saturate(0.95); }
.chamber.showing-photo::after { opacity: 0.4; }
.specimen-kicker { font-size: 1rem; font-weight: 400; color: var(--muted); }
.binomial {
  font-family: var(--display); font-size: clamp(1.9rem, 5vw, 3.4rem); line-height: 1.15; margin: 6px 0 10px;
  color: #eafaff; text-shadow: 0 0 20px rgba(111, 227, 255, 0.4);
}
.specimen-meta { color: var(--muted); font-family: var(--mono); font-size: 0.95rem; }
.specimen-meta strong { color: var(--amber); font-weight: 500; }

.gauges { display: flex; flex-wrap: wrap; gap: 36px; margin: 26px 0 22px; }
.gauge-block { text-align: center; }
.gauge { position: relative; width: 150px; height: 150px; }
.gauge svg { width: 100%; height: 100%; transform: rotate(135deg); overflow: visible; }
.gauge circle { fill: none; stroke-width: 7; }
.g-track { stroke: rgba(111, 227, 255, 0.14); stroke-dasharray: 235.6 314.2; }
.g-fill { --c: var(--mid); stroke: var(--c); stroke-dasharray: 0 314.2; filter: drop-shadow(0 0 4px var(--c)); transition: stroke-dasharray 1s cubic-bezier(.2, .8, .2, 1); }
.gauge.level-high .g-fill { --c: var(--high); }
.gauge.level-low .g-fill { --c: var(--low); }
.gauge.level-critical .g-fill { --c: var(--critical); }
.gauge.level-high, .gauge.level-mid, .gauge.level-low, .gauge.level-critical { background: none; }
.g-num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 2.6rem; font-weight: 500; }
.g-of { font-size: 0.85rem; color: var(--faint); margin: 14px 0 0 2px; }
.g-label { font-size: 0.93rem; color: var(--muted); margin-top: -16px; }
.g-word { font-weight: 700; }

.result-adapts { counter-reset: a; display: grid; gap: 4px; }
.result-adapts li { counter-increment: a; display: flex; gap: 12px; font-weight: 700; }
.result-adapts li::before { content: counter(a, decimal-leading-zero); font-family: var(--mono); font-weight: 500; color: var(--amber); }

.results-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 20px; margin-bottom: 24px; align-items: start; }
.bars { display: grid; gap: 14px; }
.score-main { margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--line); }
.score-main .meter-row { font-weight: 700; }
.score-main .bar { height: 12px; }

.findings { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.findings .panel { padding: 18px 20px; }
.findings h3 { font-family: var(--display); font-weight: 400; font-size: 1rem; margin-bottom: 10px; }
.findings .why { grid-column: 1 / -1; }
.why p { max-width: 42em; }
.point-list { display: grid; gap: 6px; }
.point-list li { display: flex; gap: 10px; }
.point-list li::before { flex: none; width: 1em; font-weight: 700; text-align: center; }
.gains li::before { content: "+"; color: var(--high); }
.costs li::before { content: "−"; color: var(--critical); }

.breakdown { margin-top: 12px; }
.breakdown summary { cursor: pointer; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; padding: 4px 0; }
.breakdown summary:hover { color: var(--holo); }
.breakdown-list { display: grid; margin-top: 10px; max-width: 460px; font-family: var(--mono); font-size: 0.88rem; }
.breakdown-list li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.breakdown-list li span em { font-style: normal; color: var(--faint); margin-left: 8px; }
.breakdown-list .bd-total { border-bottom: 0; color: var(--holo); }
.breakdown-list li:not(.bd-start):not(.bd-total) strong { color: var(--critical); }

.lesson { margin-bottom: 24px; padding: 4px 0 4px 20px; border-left: 2px solid var(--holo); max-width: 50em; }
.lesson .readout { margin-bottom: 6px; }
.lesson p:last-child { font-size: 1.15rem; }

.mars-note { color: var(--critical); margin-bottom: 22px; max-width: 50em; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

/* ---------------- Footer ---------------- */
.disclaimer { padding: 20px 16px 28px; border-top: 1px solid var(--line); color: var(--faint); font-size: 0.85rem; }
.disclaimer p { max-width: var(--maxw); margin: 0 auto; }

/* ---------------- Dialog ---------------- */
.dialog { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 26px 28px; color: var(--text); }
.dialog::backdrop { background: rgba(2, 5, 9, 0.8); }
.dialog .readout { margin-bottom: 8px; }
.dialog h2 { font-family: var(--display); font-weight: 400; font-size: 1.5rem; margin-bottom: 14px; }
.dialog p { margin-bottom: 14px; color: var(--muted); }
.how-steps { list-style: decimal; padding-left: 1.3em; display: grid; gap: 4px; margin-bottom: 14px; }
.dialog-close { position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; border: 0; background: none; color: var(--muted); font-size: 1.7rem; cursor: pointer; }
.dialog-close:hover { color: var(--holo); }

/* ---------------- Toast ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 50;
  transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  padding: 10px 18px; background: var(--holo); color: #02121a; font-weight: 700;
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* =====================================================================
   PRESENTATION MODE: bigger text, less on screen, easy to screen-share
   ===================================================================== */
html.presenting { font-size: 125%; }
html.presenting .hide-presenting,
html.presenting .stepper,
html.presenting .bio,
html.presenting .panel-details,
html.presenting .disclaimer { display: none !important; }
html.presenting .presenter-tools { display: flex; }
html.presenting main { max-width: 1500px; }
html.presenting .builder-layout { grid-template-columns: minmax(0, 1fr) 360px; }
html.presenting .adapt-art { height: 104px; }
html.presenting .chamber::after,
html.presenting .adapt-art::after { display: none; }
/* The button only shows while presenting (to exit); press P to start */
html:not(.presenting) #presentBtn { display: none; }
html.presenting #presentBtn { color: var(--amber); }

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 980px) {
  .landing { grid-template-columns: 1fr; gap: 32px; min-height: 0; }
  .landing-chamber { justify-self: start; max-width: 420px; }
  .env-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .builder-layout, html.presenting .builder-layout { grid-template-columns: 1fr; }
  #livePanel { position: static; max-height: none; }
  .figure-live { max-height: 240px; }
  .photo-figure-live { height: 240px; }
  .mobile-bar {
    position: sticky; bottom: 0; z-index: 15;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin: 20px -16px -56px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: var(--panel); border-top: 1px solid rgba(111, 227, 255, 0.35);
    font-size: 0.95rem; line-height: 1.35;
  }
  .result-hero { grid-template-columns: 1fr; gap: 24px; }
  .result-hero .result-visual { max-width: 380px; width: 100%; }
  .figure-result { max-height: 440px; }
  .photo-figure-result { height: 440px; }
  .results-body { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  main { padding-top: 26px; }
  .site-header { gap: 12px; }
  .stepper { gap: 8px; font-size: 0; }
  .stepper .step-num { font-size: 0.72rem; }
  .header-actions .hide-presenting { display: none; }
  .present-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .present-short { display: inline; }
  .env-grid, .findings { grid-template-columns: 1fr; }
  .cta-row .btn, .actions .btn { width: 100%; }
  .gauges { gap: 20px; justify-content: space-between; }
  .gauge { width: 132px; height: 132px; }
  .g-num { font-size: 2rem; }
  .g-of { font-size: 0.72rem; margin-top: 10px; }
  .chamber-readouts { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
