/* TRP Studio. Dark steel navy, one blue accent, silver and white type,
   pale gold reserved for a halt. Transparent glass surfaces, no cards. */
:root {
  --bg: #0a0e27;
  --bg-deep: #060918;
  --glass: rgba(255, 255, 255, 0.025);
  --hair: rgba(214, 222, 238, 0.09);
  --hair-strong: rgba(214, 222, 238, 0.18);
  --silver: #9aa3b5;
  --silver-dim: #8a93a8;
  --white: #f4f6fb;
  --accent: #4fa8e8;
  --gold: #e6d3a1;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--white); }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.backdrop {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1200px 700px at 78% -10%, rgba(79, 168, 232, 0.10), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(154, 163, 181, 0.07), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
.muted { color: var(--silver); }

/* Header */
.top {
  display: flex; align-items: center; gap: 32px;
  padding: 20px 36px;
  border-bottom: 1px solid var(--hair);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  background: rgba(10, 14, 39, 0.55);
  position: sticky; top: 0; z-index: 5;
}
.wordmark { display: flex; align-items: baseline; gap: 8px; letter-spacing: 0.02em; }
.mark { font-weight: 600; font-size: 17px; }
.mark-sub { font-weight: 300; font-size: 17px; color: var(--silver); }
.packs { display: flex; gap: 22px; flex: 1; overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); padding-right: 40px; }
.packs::-webkit-scrollbar { display: none; }
.pack-tab {
  background: none; border: 0; padding: 6px 0; cursor: pointer;
  color: var(--silver); font-size: 14px; white-space: nowrap;
  border-bottom: 1px solid transparent;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.pack-tab:hover { color: var(--white); }
.pack-tab[aria-selected="true"] { color: var(--white); border-bottom-color: var(--accent); }
.top-actions { display: flex; gap: 22px; }
.link { color: var(--silver); cursor: pointer; transition: color 0.2s var(--ease); }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; }
/* Early access to Nautilus. */
.early[hidden] { display: none; }
.early { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(4, 7, 20, 0.82); backdrop-filter: blur(6px); }
.early-card { position: relative; width: min(520px, 100%); padding: 28px 30px 26px; background: #0b1430; border: 1px solid #6b4b22; box-shadow: inset 0 0 0 1px rgba(196, 154, 85, 0.35), 0 30px 80px rgba(0, 0, 0, 0.6); color: #e6d3a1; }
.early-close { position: absolute; top: 10px; right: 12px; background: none; border: 0; color: #c49a55; font-size: 26px; line-height: 1; cursor: pointer; }
.early-art { display: block; width: calc(100% + 60px); max-width: none; height: auto; margin: -28px -30px 18px; }
.early-art[hidden] { display: none; }
.early-sub { color: #8a93a8; font-size: 13px; }
.early-eyebrow { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: #c49a55; }
.early-card h2 { margin: 4px 0 10px; font-size: 30px; font-weight: 400; color: #f0d9a0; }
.early-card p { margin: 0 0 12px; font-size: 16px; line-height: 1.55; color: #e6d3a1; }
.early-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.early-card input[type=text], .early-card input[type=email] { width: 100%; background: #070d22; border: 1px solid #6b4b22; color: #f4f6fb; padding: 10px 12px; font: 14px var(--font); }
.early-card input:focus { outline: none; border-color: #c49a55; }
.early-hidden { position: absolute; left: -9999px; }
.early-consent { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0 14px; font-size: 13px; line-height: 1.5; color: #c9b27d; }
.early-consent a { color: #f0d9a0; }
.early-actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.early-msg { font-size: 13px; color: #c9b27d; }
@media (max-width: 520px) { .early-row { grid-template-columns: 1fr; } }
.link:hover { color: var(--white); }

/* Layout */
.stage[hidden] { display: none; }
.stage {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 0;
}
.scene-wrap { padding: 32px 36px 28px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.scene-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
h1 { margin: 0; font-weight: 300; font-size: 34px; letter-spacing: -0.01em; }
.scene-head p { margin: 4px 0 0; max-width: 60ch; }
.transport { display: flex; gap: 20px; flex-shrink: 0; }

.text-btn {
  background: none; border: 0; padding: 4px 0; cursor: pointer;
  color: var(--silver); letter-spacing: 0.01em;
  border-bottom: 1px solid transparent;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.text-btn:hover { color: var(--white); }
.text-btn[aria-pressed="true"] { color: var(--white); border-bottom-color: var(--accent); }
.text-btn.small { font-size: 12px; }
.text-btn:focus-visible, .pack-tab:focus-visible, .link:focus-visible, .toggle:focus-visible {
  outline: 1px solid var(--accent); outline-offset: 4px;
}

.scene {
  position: relative;
  flex: none;
  height: clamp(380px, 56vh, 640px);
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
  background: var(--glass);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  overflow: hidden;
}
canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.caption {
  position: absolute; left: 28px; right: 28px; bottom: 18px; margin: 0;
  font-size: 15px; font-weight: 300; color: var(--white);
  opacity: 0; transform: translateY(6px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  text-shadow: 0 1px 12px rgba(6, 9, 24, 0.8);
}
.caption.show { opacity: 1; transform: none; }

.halt {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px;
  background: radial-gradient(closest-side, rgba(6, 9, 24, 0.7), rgba(6, 9, 24, 0.35));
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  animation: fade 0.35s var(--ease);
}
.halt[hidden] { display: none; }
.halt-word { font-size: 46px; font-weight: 200; letter-spacing: 0.04em; color: var(--gold); }
.halt-why { color: var(--white); font-weight: 300; font-size: 15px; text-align: center; max-width: 46ch; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* Controls */
.controls {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 18px 32px;
}
.control { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.control-label { display: flex; justify-content: space-between; color: var(--silver); font-size: 12px; letter-spacing: 0.02em; }
.control-value { font-family: var(--mono); color: var(--white); font-variant-numeric: tabular-nums; }
.toggle {
  display: flex; align-items: center; gap: 12px; background: none; border: 0; padding: 4px 0;
  color: var(--silver); cursor: pointer; text-align: left; font-size: 14px;
  transition: color 0.2s var(--ease);
}
.toggle .switch {
  width: 28px; height: 1px; background: var(--hair-strong); position: relative; flex-shrink: 0;
}
.toggle .switch::after {
  content: ""; position: absolute; top: -4px; left: 0; width: 9px; height: 9px; border-radius: 50%;
  background: var(--silver-dim); transition: left 0.3s var(--ease), background 0.3s var(--ease);
}
.toggle:hover { color: var(--white); }
.toggle[aria-pressed="true"] { color: var(--white); }
.toggle[aria-pressed="true"] .switch::after { left: 19px; background: var(--accent); box-shadow: 0 0 10px rgba(79, 168, 232, 0.6); }

input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 18px; background: none; margin: 0; cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track { height: 1px; background: var(--hair-strong); }
input[type="range"]::-moz-range-track { height: 1px; background: var(--hair-strong); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 11px; height: 11px; border-radius: 50%; margin-top: -5px;
  background: var(--white); box-shadow: 0 0 0 4px rgba(79, 168, 232, 0.12);
}
input[type="range"]::-moz-range-thumb { width: 11px; height: 11px; border: 0; border-radius: 50%; background: var(--white); }
input[type="range"]:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; }

/* Readout */
.readout {
  border-left: 1px solid var(--hair);
  padding: 32px 30px 28px;
  display: flex; flex-direction: column; gap: 30px;
  background: rgba(255, 255, 255, 0.015);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  min-width: 0;
}
.eyebrow { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--silver-dim); }
.eyebrow-row { display: flex; justify-content: space-between; align-items: baseline; }
.exports { display: flex; gap: 14px; }

.standing-word {
  font-size: 52px; font-weight: 200; letter-spacing: -0.01em; margin-top: 6px; line-height: 1.05;
  text-transform: capitalize; transition: color 0.4s var(--ease);
}
.standing-word.long { font-size: 40px; }
.standing-response { color: var(--silver); margin-top: 6px; min-height: 21px; }
.standing.worst .standing-word { color: var(--gold); }
.standing.mid .standing-word { color: var(--white); }
.standing.best .standing-word { color: var(--white); }

.scale { position: relative; height: 36px; margin-top: 18px; }
.scale-line { position: absolute; left: 0; right: 0; top: 6px; height: 1px; background: linear-gradient(90deg, var(--accent), var(--hair-strong) 45%, var(--hair-strong) 75%, rgba(230, 211, 161, 0.6)); }
.scale-dot {
  position: absolute; top: 1px; width: 11px; height: 11px; margin-left: -5px; border-radius: 50%;
  background: var(--white); box-shadow: 0 0 14px rgba(79, 168, 232, 0.7);
  transition: left 0.6s var(--ease), background 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.standing.worst .scale-dot { background: var(--gold); box-shadow: 0 0 16px rgba(230, 211, 161, 0.7); }
.scale-labels { position: absolute; left: 0; right: 0; top: 16px; display: flex; justify-content: space-between; font-size: 11px; color: var(--silver-dim); text-transform: capitalize; }

ul, ol { list-style: none; margin: 10px 0 0; padding: 0; }
.signals li { padding: 9px 0; border-bottom: 1px solid var(--hair); }
.signals li:last-child { border-bottom: 0; }
.sig-top { display: flex; justify-content: space-between; gap: 12px; }
.sig-name { color: var(--silver); font-size: 13px; }
.sig-val { font-family: var(--mono); font-size: 13px; font-variant-numeric: tabular-nums; color: var(--white); }
.sig-val .unit { color: var(--silver-dim); margin-left: 4px; }
.sig-track { position: relative; height: 9px; margin-top: 6px; }
.sig-track .line { position: absolute; left: 0; right: 0; top: 4px; height: 1px; background: var(--hair); }
.sig-track .tick { position: absolute; top: 1px; width: 1px; height: 7px; background: var(--hair-strong); }
.sig-track .tick.crit { background: rgba(230, 211, 161, 0.45); }
.sig-track .pos { position: absolute; top: 1px; width: 7px; height: 7px; margin-left: -3px; border-radius: 50%; background: var(--silver); transition: left 0.35s var(--ease), background 0.3s var(--ease); }
li.warn .sig-name, li.warn .sig-val { color: var(--white); }
li.warn .pos { background: var(--white); box-shadow: 0 0 8px rgba(244, 246, 251, 0.6); }
li.crit .sig-val { color: var(--gold); }
li.crit .pos { background: var(--gold); box-shadow: 0 0 10px rgba(230, 211, 161, 0.7); }
li.missing .sig-val { color: var(--silver-dim); font-style: italic; }

.rules li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 13px; color: var(--silver); }
.rules .state { font-family: var(--mono); font-size: 12px; color: var(--silver-dim); white-space: nowrap; }
.rules li.on { color: var(--white); }
.rules li.on .state { color: var(--gold); }
.rules li.unknown .state { color: var(--white); }

.events { max-height: 220px; overflow-y: auto; scrollbar-width: thin; }
.events li { display: grid; grid-template-columns: 56px 1fr; gap: 10px; padding: 6px 0; font-size: 12px; color: var(--silver); animation: fade 0.4s var(--ease); }
.events .t { font-family: var(--mono); color: var(--silver-dim); }
.events li.worst { color: var(--white); }
.events li.worst .what { color: var(--gold); }
.events li.empty { display: block; color: var(--silver-dim); }

.foot {
  display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  padding: 16px 36px; border-top: 1px solid var(--hair); font-size: 12px; color: var(--silver-dim);
}

.drop {
  position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center;
  background: rgba(6, 9, 24, 0.7); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-size: 22px; font-weight: 300; color: var(--white);
}
.drop[hidden] { display: none; }
.drop > div { border-bottom: 1px solid var(--accent); padding-bottom: 8px; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 30;
  padding: 10px 18px; color: var(--white); font-size: 13px;
  background: rgba(10, 14, 39, 0.85); border-bottom: 1px solid var(--accent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); animation: fade 0.3s var(--ease);
}

@media (max-width: 1080px) {
  .stage { grid-template-columns: 1fr; }
  .readout { border-left: 0; border-top: 1px solid var(--hair); }
}
@media (max-width: 640px) {
  .top { padding: 14px 16px; gap: 16px; flex-wrap: wrap; }
  .packs { order: 3; flex-basis: 100%; }
  .scene-wrap, .readout { padding: 22px 16px; }
  .scene-head { flex-direction: column; align-items: flex-start; }
  h1 { font-size: 28px; }
  .scene { height: 340px; }
  .foot { padding: 14px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* Modes, HUD and panels */
.head-right { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.modes { display: flex; gap: 22px; }
.mode {
  background: none; border: 0; padding: 4px 0; cursor: pointer; font-size: 15px; color: var(--silver);
  border-bottom: 1px solid transparent; transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.mode:hover { color: var(--white); }
.mode[aria-selected="true"] { color: var(--white); border-bottom-color: var(--accent); }
.mode:disabled { color: var(--silver-dim); cursor: not-allowed; opacity: 0.5; }
.mode:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; }
#record-btn[aria-pressed="true"] { color: var(--gold); border-bottom-color: var(--gold); }

.hud {
  position: absolute; left: 28px; right: 28px; top: 20px; display: flex; justify-content: space-between; gap: 24px;
  font-size: 13px; color: var(--silver); pointer-events: none;
}
.hud[hidden] { display: none; }
.hud .big { font-size: 22px; font-weight: 200; color: var(--white); display: block; margin-top: 2px; font-variant-numeric: tabular-nums; }
.hud .move { color: var(--white); max-width: 40ch; }
.hud .truth { color: var(--gold); }
.hud-col { display: flex; flex-direction: column; gap: 2px; }
.hud-stats { display: flex; gap: 26px; text-align: right; }

.panel { display: flex; flex-direction: column; gap: 18px; }
.panel[hidden], .controls[hidden] { display: none; }
.panel h2 { margin: 0; font-weight: 300; font-size: 22px; }
.panel p { margin: 0; color: var(--silver); max-width: 70ch; }
.panel-row { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.guards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px 32px; }
.guard {
  display: grid; grid-template-columns: 20px 1fr auto; gap: 4px 12px; align-items: start; text-align: left;
  background: none; border: 0; border-top: 1px solid var(--hair); padding: 12px 0 4px; color: var(--silver); cursor: pointer;
}
.guard .check { width: 11px; height: 11px; margin-top: 4px; border-radius: 50%; border: 1px solid var(--silver-dim); transition: background 0.2s var(--ease); }
.guard .name { color: var(--white); font-size: 14px; }
.guard .cost { font-family: var(--mono); font-size: 12px; color: var(--silver); }
.guard .detail { grid-column: 2 / 4; font-size: 12px; color: var(--silver-dim); }
.guard[aria-pressed="true"] .check { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 10px rgba(79,168,232,0.6); }
.guard[aria-pressed="true"] .name { color: var(--white); }
.guard:disabled { opacity: 0.4; cursor: not-allowed; }
.guard:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; }
.budget { font-family: var(--mono); color: var(--white); }
.primary {
  background: none; border: 0; border-bottom: 1px solid var(--accent); color: var(--white); padding: 6px 0;
  font-size: 15px; cursor: pointer; letter-spacing: 0.01em;
}
.primary:hover { color: var(--accent); }
.primary:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; }
.result-score { font-size: 64px; font-weight: 200; line-height: 1; }
.medal { font-size: 14px; letter-spacing: 0.16em; text-transform: uppercase; }
.medal.gold { color: var(--gold); }
.medal.silver { color: #c9d0dc; }
.medal.bronze { color: #c8a27e; }
.result-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px 28px; }
.stat-label { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--silver-dim); }
.stat-value { font-size: 24px; font-weight: 200; color: var(--white); font-variant-numeric: tabular-nums; }
.share-line { font-family: var(--mono); font-size: 13px; color: var(--white); border-left: 1px solid var(--accent); padding-left: 12px; white-space: pre-wrap; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-weight: 400; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--silver-dim); padding: 6px 12px 6px 0; border-bottom: 1px solid var(--hair); }
.table td { padding: 8px 12px 8px 0; border-bottom: 1px solid var(--hair); color: var(--silver); font-variant-numeric: tabular-nums; }
.table td.num { font-family: var(--mono); color: var(--white); }
.table tr.weak td.num.rate { color: var(--gold); }
select { background: transparent; color: var(--white); border: 0; border-bottom: 1px solid var(--hair-strong); font: inherit; padding: 4px 0; }
select option { background: var(--bg); }

.events li { cursor: pointer; }
.events li.empty { cursor: default; }
.events li:hover .what { color: var(--white); }
.explain { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--hair-strong); font-size: 13px; color: var(--silver); display: flex; flex-direction: column; gap: 8px; }
.explain[hidden] { display: none; }
.explain h3 { margin: 0; font-weight: 400; font-size: 14px; color: var(--white); text-transform: capitalize; }
.explain .row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.explain .mono { font-family: var(--mono); color: var(--white); font-size: 12px; }
.explain .close { align-self: flex-start; }

@media (max-width: 640px) {
  .head-right { align-items: flex-start; }
  .hud { left: 14px; right: 14px; top: 12px; font-size: 12px; }
  .hud-stats { gap: 14px; }
}

/* Learn */
.challenges { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.challenge { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 16px; border-radius: 14px; border: 1px solid var(--hair); background: var(--glass); color: var(--white); font: inherit; cursor: pointer; transition: border-color .2s var(--ease), transform .2s var(--ease); }
.challenge:hover { border-color: var(--hair-strong); transform: translateY(-1px); }
.challenge .c-title { font-size: 17px; }
.challenge .c-pack, .challenge .c-status { font-size: 12px; color: var(--silver); }
/* Command, the first screen. */
.command { max-width: 1480px; margin: 0 auto; padding: 36px 36px 60px; }
.command[hidden] { display: none; }
.cmd-hero h1 { margin: 0 0 10px; max-width: 980px; font-size: 44px; line-height: 1.2; font-weight: 300; letter-spacing: -0.01em; color: var(--white); }
.cmd-sub { margin: 0; max-width: 760px; font-size: 16px; line-height: 1.55; color: var(--silver); }
.cmd-bar { display: flex; justify-content: space-between; align-items: flex-end; gap: 28px; flex-wrap: wrap; margin: 30px 0 10px; padding: 18px 0; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); }
.cmd-nums { display: flex; gap: 36px; flex-wrap: wrap; }
.cmd-nums .num { display: flex; flex-direction: column; min-width: 90px; }
.cmd-nums b { font-size: 34px; font-weight: 200; line-height: 1.1; color: var(--white); font-variant-numeric: tabular-nums; }
.cmd-nums span { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--silver-dim); margin-top: 4px; }
.cmd-nums .good b { color: var(--gold); }
.cmd-nums .bad b { color: #f2b48a; }
.cmd-books-wrap { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; max-width: 420px; }
.cmd-books { display: inline-flex; border: 1px solid var(--hair-strong); border-radius: 999px; padding: 3px; }
.cmd-books button { background: none; border: 0; color: var(--silver); font: inherit; font-size: 13px; padding: 7px 16px; border-radius: 999px; cursor: pointer; }
.cmd-books button[aria-pressed=true] { background: var(--white); color: var(--bg); }
.cmd-book-note { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--silver); text-align: right; }
.cmd-source { margin-top: 4px; }
.cmd-d-source { margin: 0 0 10px; color: var(--silver); }
.cmd-d-signals .sig .real { color: var(--accent, #4fa8e8); font-weight: 600; margin-right: 6px; }
.cmd-state { margin: 0 0 10px; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--silver-dim); }
.cmd-wall { position: static; inset: auto; display: block; width: 100%; height: auto; outline: none; }
.cmd-wall:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.cmd-lower { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 36px; margin-top: 28px; }
.cmd-lower h2 { margin: 0 0 10px; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--silver-dim); font-weight: 500; }
.cmd-incidents { list-style: none; margin: 0; padding: 0; }
.cmd-incidents li { display: grid; grid-template-columns: 44px auto minmax(0, 1fr); gap: 12px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--hair); font-size: 13.5px; }
.cmd-incidents .t { font-family: var(--mono); font-size: 12px; color: var(--silver-dim); }
.cmd-incidents .who { background: none; border: 0; padding: 0; font: inherit; color: var(--white); cursor: pointer; text-align: left; white-space: nowrap; }
.cmd-incidents .who:hover { text-decoration: underline; }
.cmd-incidents .what { color: var(--silver); }
.cmd-incidents li.caught .what { color: var(--gold); }
.cmd-incidents li.missed .what { color: #f2b48a; }
.cmd-incidents li.empty { display: block; color: var(--silver-dim); }
.cmd-detail { padding: 18px 20px; border: 1px solid var(--hair); border-radius: 14px; background: var(--glass); }
.cmd-detail[hidden] { display: none; }
.cmd-d-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.cmd-d-head h2 { font-size: 17px; letter-spacing: 0; text-transform: none; color: var(--white); margin: 0 0 2px; font-weight: 500; }
.cmd-d-head p { margin: 0; font-size: 12.5px; }
.cmd-d-response { margin: 14px 0 4px; font-size: 28px; font-weight: 200; color: var(--white); }
.cmd-d-why { margin: 0 0 12px; font-size: 13.5px; line-height: 1.5; color: var(--silver); }
.cmd-d-signals { display: flex; flex-direction: column; }
.cmd-d-signals .sig { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 14px; padding: 7px 0; border-top: 1px solid var(--hair); font-size: 13px; color: var(--silver); }
.cmd-d-signals .sig .mono { font-family: var(--mono); color: var(--white); }
.cmd-d-signals .sig .lim { font-size: 11.5px; color: var(--silver-dim); }
.cmd-d-signals .sig.warning .mono { color: var(--white); }
.cmd-d-signals .sig.critical .mono { color: var(--gold); }
.cmd-d-signals .sig.missing .mono { color: var(--silver-dim); font-style: italic; }
.cmd-detail .primary { margin-top: 14px; }
@media (max-width: 900px) { .command { padding: 24px 16px 48px; } .cmd-hero h1 { font-size: 30px; } .cmd-lower { grid-template-columns: 1fr; } .cmd-books-wrap { align-items: flex-start; } .cmd-book-note { text-align: left; } .cmd-nums { gap: 22px; } .cmd-nums b { font-size: 28px; } }

/* Connect. */
.cn-status { margin: 14px 0 18px; padding: 12px 14px; border: 1px solid var(--hair); border-radius: 12px; background: var(--glass); font-size: 13.5px; }
.cn-status b { color: var(--white); font-weight: 500; }
.cn-now { display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.cn-map { margin-top: 8px; display: grid; gap: 4px; }
.cn-sources { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.cn-src { padding: 14px 16px; border: 1px solid var(--hair); border-radius: 14px; background: var(--glass); display: flex; flex-direction: column; gap: 8px; }
.cn-src h3 { margin: 0; font-size: 15px; font-weight: 500; color: var(--white); }
.cn-src p { margin: 0; line-height: 1.5; }
.cn-src input[type=url], .cn-src input[type=text], .cn-src input[type=number] { width: 100%; box-sizing: border-box; background: var(--glass); border: 1px solid var(--hair-strong); color: var(--white); border-radius: 8px; padding: 7px 9px; font-family: var(--mono); font-size: 12.5px; }
.cn-src .text-btn { align-self: flex-start; }
.cn-src code { font-family: var(--mono); font-size: 12px; color: var(--white); }

/* Glossary, rendered by codex.js. */
.glossary-row { margin-top: 36px; }
.codex { margin-top: 8px; }
.codex-group { margin-top: 18px; }
.codex-group-title { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--silver-dim); margin: 0 0 2px; }
.codex-group-sub { margin: 0 0 10px; font-size: 13px; color: var(--silver); }
.codex-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.codex-item { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--hair); background: var(--glass); color: var(--white); font: inherit; cursor: pointer; transition: border-color .2s var(--ease), transform .2s var(--ease); }
.codex-item:hover { border-color: var(--hair-strong); transform: translateY(-1px); }
.codex-item-term { font-size: 15px; }
.codex-item-short { font-size: 12.5px; color: var(--silver); line-height: 1.45; }
.codex-item-done { font-size: 11px; color: var(--accent); }
.codex-back { margin-bottom: 14px; }
.codex-head { margin: 6px 0 14px; }
.codex-eyebrow { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--silver-dim); }
.codex-term { margin: 4px 0 6px; font-size: 24px; font-weight: 500; }
.codex-short { margin: 0; color: var(--silver); font-size: 15px; line-height: 1.5; }
.codex-section { padding: 14px 0; border-top: 1px solid var(--hair); }
.codex-section-title { margin: 0 0 6px; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--silver-dim); }
.codex-text, .codex-question { margin: 0; font-size: 14.5px; line-height: 1.6; max-width: 72ch; }
.codex-basis { margin: 8px 0 0; font-size: 12.5px; color: var(--silver); line-height: 1.5; max-width: 72ch; }
.codex-spec, .codex-learn { display: inline-block; margin-top: 8px; font-size: 13px; color: var(--accent); }
.codex-frameworks { margin: 0; padding-left: 18px; font-size: 13.5px; color: var(--silver); line-height: 1.6; }
.codex-more { margin: 14px 0 4px; background: none; border: 1px solid var(--hair-strong); color: var(--white); border-radius: 999px; padding: 8px 14px; font: inherit; font-size: 13px; cursor: pointer; }
.codex-options { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; max-width: 72ch; }
.codex-option { text-align: left; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--hair); background: var(--glass); color: var(--white); font: inherit; font-size: 14px; cursor: pointer; }
.codex-option:hover:not(:disabled) { border-color: var(--hair-strong); }
.codex-option.right { border-color: #5fb3a0; }
.codex-option.wrong { border-color: #c8643c; }
.codex-result { margin: 0; font-size: 14px; color: var(--silver); line-height: 1.55; max-width: 72ch; }
.codex-related { display: flex; flex-wrap: wrap; gap: 8px; }
.codex-chip { background: var(--glass); border: 1px solid var(--hair); color: var(--white); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.codex-chip:hover { border-color: var(--hair-strong); }
.limits { display: flex; flex-direction: column; gap: 10px; }
.limit-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 16px; align-items: center; padding: 12px 0; border-top: 1px solid var(--hair); }
.limit-row label { font-size: 12px; color: var(--silver); display: flex; flex-direction: column; gap: 4px; }
.limit-row input { width: 110px; background: var(--glass); border: 1px solid var(--hair-strong); color: var(--white); border-radius: 8px; padding: 7px 9px; font-family: var(--mono); font-size: 13px; }
.limit-name { color: var(--white); }
.small { font-size: 12px; }
.checks, .misses { margin: 8px 0; padding-left: 18px; }
.checks li { margin: 4px 0; }
.checks li.pass { color: var(--gold); }
.checks li.fail { color: var(--silver); }
.lesson { margin-top: 12px; padding: 14px 16px; border-radius: 12px; border: 1px solid rgba(230, 211, 161, 0.35); background: rgba(230, 211, 161, 0.06); color: var(--white); line-height: 1.5; }
@media (max-width: 640px) { .limit-row { grid-template-columns: 1fr 1fr; } .limit-row > div:first-child { grid-column: 1 / -1; } .limit-row input { width: 100%; } }

/* World view of the Command floor. */
.cmd-view { display: inline-flex; gap: 2px; padding: 3px; margin: 0 0 12px; border: 1px solid var(--hair); border-radius: 999px; }
.cmd-view button { background: none; border: 0; color: var(--silver); font: inherit; font-size: 13px; padding: 6px 16px; border-radius: 999px; cursor: pointer; }
.cmd-view button[aria-pressed="true"] { background: var(--white); color: var(--bg); }
.cmd-view button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cmd-world { position: relative; height: min(72vh, 760px); min-height: 420px; border-radius: 16px; overflow: hidden; background: #060a1b; border: 1px solid var(--hair); }
.cmd-world[hidden] { display: none; }
.cmd-world canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; cursor: grab; outline: none; }
.cmd-world canvas:active { cursor: grabbing; }
.world-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.world-label { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; white-space: nowrap; text-shadow: 0 1px 8px rgba(0,0,0,0.8); }
.world-label b { font-weight: 500; font-size: 13px; letter-spacing: 0.04em; color: var(--white); }
.world-label span { font-size: 11px; color: var(--silver); }
.world-cap { position: absolute; left: 20px; bottom: 20px; max-width: min(460px, calc(100% - 40px)); padding: 14px 16px; border-radius: 12px; background: rgba(6,10,27,0.82); border: 1px solid var(--hair-strong); backdrop-filter: blur(12px); display: grid; gap: 5px; font-size: 13px; color: var(--silver); }
.world-cap[hidden] { display: none; }
.world-cap .wc-title { color: var(--white); font-size: 15px; font-weight: 500; }
.world-cap .wc-row span { display: inline-block; min-width: 76px; color: var(--silver-dim); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.world-cap .wc-verdict { margin-top: 4px; font-weight: 500; color: var(--white); }
.world-cap.caught .wc-verdict { color: #8fd3a8; }
.world-cap.missed .wc-verdict { color: #ff8a7a; }
.world-cap.needless .wc-verdict { color: var(--gold); }
.world-msg { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 24px; text-align: center; color: var(--silver); }
.world-msg[hidden] { display: none; }
.cmd-wall[hidden] { display: none; }
.world-replay { position: absolute; left: 20px; right: 20px; top: 16px; display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 12px; background: rgba(6,10,27,0.72); border: 1px solid var(--hair); backdrop-filter: blur(10px); }
.world-replay.replaying { border-color: rgba(230,211,161,0.5); }
.wr-btn { background: none; border: 1px solid var(--hair-strong); color: var(--white); font: inherit; font-size: 12px; padding: 5px 12px; border-radius: 999px; cursor: pointer; }
.wr-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wr-track { position: relative; flex: 1; height: 26px; display: flex; align-items: center; }
.wr-range { width: 100%; accent-color: var(--gold); }
.wr-marks { position: absolute; left: 0; right: 0; top: 0; height: 8px; pointer-events: none; }
.wr-mark { position: absolute; top: -2px; width: 8px; height: 8px; margin-left: -4px; padding: 0; border: 0; border-radius: 50%; pointer-events: auto; cursor: pointer; }
.wr-mark.caught { background: #8fd3a8; } .wr-mark.missed { background: #ff8a7a; } .wr-mark.needless { background: var(--gold); }
.wr-time { min-width: 56px; font-size: 12px; color: var(--silver); font-variant-numeric: tabular-nums; text-align: right; }

/* Home. The first screen, with the story before the floor. */
.home { max-width: 1120px; margin: 0 auto; padding: 72px 36px 96px; }
.home[hidden] { display: none; }
.home-hero h1 { margin: 0 0 18px; max-width: 900px; font-size: 56px; line-height: 1.08; font-weight: 300; letter-spacing: -0.015em; color: var(--white); }
.home-lede { margin: 0; max-width: 720px; font-size: 19px; line-height: 1.55; color: var(--silver); }
.home-actions { display: flex; align-items: center; gap: 28px; margin-top: 28px; }
.home-pick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 36px; }
.pick { display: flex; flex-direction: column; gap: 8px; text-align: left; padding: 20px 20px 22px; background: var(--glass); border: 1px solid var(--hair-strong); border-radius: 14px; color: var(--white); font: inherit; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.pick b { font-size: 18px; font-weight: 500; }
.pick span { font-size: 14px; line-height: 1.45; color: var(--silver); }
.pick:hover { border-color: var(--accent); background: rgba(79, 168, 232, 0.06); }
.pick:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
button.home-link { background: none; border: 0; border-bottom: 1px solid var(--accent); font: inherit; font-size: 15px; cursor: pointer; padding: 0 0 3px; }
.home-go { background: var(--white); color: var(--bg); border: 0; border-radius: 999px; padding: 12px 26px; font: inherit; font-size: 15px; font-weight: 500; cursor: pointer; }
.home-go:hover { background: var(--accent); color: var(--white); }
.home-go:focus-visible, .home-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.home-link { color: var(--white); font-size: 15px; text-decoration: none; border-bottom: 1px solid var(--accent); padding-bottom: 3px; }
.home-link:hover { color: var(--accent); }
.home-rows { margin-top: 88px; border-top: 1px solid var(--hair); }
.home-row { display: grid; grid-template-columns: 220px 1fr; gap: 32px; padding: 34px 0; border-bottom: 1px solid var(--hair); }
.home-row h2 { margin: 0; font-size: 13px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--silver); padding-top: 4px; }
.home-row p { margin: 0; max-width: 680px; font-size: 18px; line-height: 1.6; color: var(--white); }
.home-end { margin-top: 56px; }
@media (max-width: 760px) {
  .home { padding: 40px 16px 64px; }
  .home-hero h1 { font-size: 36px; }
  .home-lede { font-size: 17px; }
  .home-actions { flex-wrap: wrap; gap: 18px; }
  .home-pick { grid-template-columns: 1fr 1fr; }
  .home-rows { margin-top: 56px; }
  .home-row { grid-template-columns: 1fr; gap: 10px; padding: 26px 0; }
  .home-row p { font-size: 16px; }
}

/* Tour of the Command floor. */
.cmd-viewbar { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; margin: 0 0 12px; }
.cmd-look[hidden], .cmd-look-about[hidden] { display: none; }
.cmd-look-about { margin: -4px 0 12px; }
.cmd-viewbar .cmd-view { margin: 0; }
.tour-card { position: absolute; z-index: 40; width: 320px; max-width: calc(100vw - 32px); padding: 16px 18px 14px; background: rgba(10, 14, 39, 0.97); border: 1px solid var(--hair-strong); border-radius: 14px; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45); color: var(--white); }
.tour-card p { margin: 0 0 14px; font-size: 14.5px; line-height: 1.5; }
.tour-card .tour-foot { display: flex; align-items: center; gap: 10px; }
.tour-card .tour-count { font-size: 12px; color: var(--silver); margin-right: auto; }
.tour-card button { background: none; border: 1px solid var(--hair-strong); color: var(--white); border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 13px; cursor: pointer; }
.tour-card button.tour-next { background: var(--white); color: var(--bg); border-color: var(--white); }
.tour-card button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tour-target { outline: 1px solid var(--accent); outline-offset: 6px; border-radius: 8px; }
@media (max-width: 760px) { .tour-card { position: fixed; left: 16px !important; right: 16px; bottom: 16px; top: auto !important; width: auto; } }

.packs[hidden] { display: none; }
