/* Infrared City — "The Console" prototype.
   Tokens, base, chrome (nav + rail), intro gate. Section styles: sections.css.
   Dark only, by decision: the instrument register is a dark register, and a
   second theme would be a second design. Two colour systems: BRAND teal for
   chrome and CTAs; DATA ramps for values only, never decoration. */

:root {
  --brand: #088A91;
  --brand-lift: #4AA8B4;
  --data: #22D3EE;

  /* Near-black deep petrol ground — what makes a thermal field legible. */
  --ink-0: #04121A;
  --ink-1: #071A23;
  --ink-2: #0C222C;
  --panel: rgba(6, 22, 30, 0.92);
  --line: rgba(126, 196, 207, 0.16);
  --line-soft: rgba(126, 196, 207, 0.08);
  --text: #EAF4F4;
  --muted: #7E97A3;

  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Space Grotesk", -apple-system, sans-serif;
  --body: "Geist", -apple-system, "Segoe UI", Roboto, sans-serif;

  --rail-h: 46px;
  --nav-h: 54px;
  --col: 640px;          /* the content column; the instrument keeps the rest */
}

* { box-sizing: border-box; }
/* Class display rules (.btn, .dial…) must never resurrect a [hidden] element. */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--ink-0); color: var(--text);
  font-family: var(--body); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }

/* ONE technical-label spec. 12 px floor — nothing on this page goes below it. */
.lbl, .eyebrow, .tab, .sub-pill, .exp-note, .exp-label, .exp-time, .rk,
.hero .sub, .city-pill, .speeds .l, .price-line, .go, .dial-head, .dial-note,
.dial-scale, .stamp, .integrations, .fine, #pauseBtn, #navBtn, .shot-cap {
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
}
.eyebrow { color: var(--brand-lift); letter-spacing: .22em; margin: 0 0 14px; }

h1, h2, h3 { font-family: var(--sans); font-weight: 600; letter-spacing: -.02em; text-wrap: balance; }
h2 { font-size: clamp(26px, 3.2vw, 38px); line-height: 1.1; margin: 0 0 14px; }
h3 { font-size: 18px; margin: 0 0 6px; }
p { max-width: 36em; }
.muted { color: var(--muted); }
.lede { font-size: clamp(16px, 1.8vw, 19px); line-height: 1.6; max-width: 32em;
  margin: 0 0 22px; color: var(--muted); }
.lede strong { color: var(--text); font-weight: 600; }
.fine { color: var(--muted); letter-spacing: .06em; text-transform: none; margin: 18px 0 0; }

/* ---------- buttons ---------- */
.btn {
  background: transparent; display: inline-flex; align-items: center; gap: 9px;
  cursor: pointer; font-family: var(--mono); font-size: 12px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
  padding: 13px 22px; border-radius: 3px; text-decoration: none;
  border: 1px solid transparent;
  transition: background .18s ease, border-color .18s ease, color .18s ease;
}
.btn:focus-visible { outline: 2px solid var(--brand-lift); outline-offset: 3px; }
.btn-pri { background: var(--brand); color: #fff; }
.btn-pri:hover { background: var(--brand-lift); }
.btn-sec { border-color: var(--line); color: var(--brand-lift); }
.btn-sec::after { content: " →"; }
.btn-sec:hover { color: var(--text); border-color: var(--brand-lift); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- the instrument (fixed backdrop) ---------- */
.instrument { position: fixed; inset: 0; z-index: 0; }
#stage, #stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.instrument .still-fallback { position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; filter: brightness(.75); }
/* Steps up as the argument moves from picture to text. Set by JS per state. */
.instr-dim { position: absolute; inset: 0; background: var(--ink-0);
  opacity: 0; transition: opacity .6s ease; pointer-events: none; }

/* ---------- content sits above the instrument ---------- */
/* pointer-events is inherited: the feed passes the pointer to the canvas, and
   each interactive island (.card, .station, …) takes it back for its subtree. */
.feed { position: relative; z-index: 1; padding-bottom: var(--rail-h);
  pointer-events: none; }

/* ---------- nav ---------- */
nav.top {
  position: fixed; inset: 0 0 auto 0; z-index: 40; display: flex; align-items: center;
  gap: 22px; padding: 10px 20px;
  padding-top: max(10px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--ink-0) 78%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
nav.top .logo { height: 20px; }
nav.top .links { display: flex; gap: 20px; margin-left: auto; }
nav.top .links a { color: var(--muted); text-decoration: none;
  font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
nav.top .links a:hover { color: var(--text); }
nav.top .btn { padding: 9px 16px; }
#navBtn { display: none; cursor: pointer; background: transparent; color: var(--muted);
  border: 1px solid var(--line); border-radius: 3px; padding: 10px 14px; min-height: 44px; }
.nav-sheet { position: fixed; z-index: 39; inset: 0 0 auto 0; display: flex;
  flex-direction: column; padding: 64px 20px 16px; background: var(--ink-1);
  border-bottom: 1px solid var(--line); }
.nav-sheet a { padding: 13px 4px; min-height: 44px; color: var(--text);
  text-decoration: none; border-bottom: 1px solid var(--line-soft); font-size: 16px; }
.sheet-personas { padding: 14px 4px 6px; display: flex; flex-wrap: wrap; gap: 8px; }
.sheet-personas .lbl { width: 100%; color: var(--muted); margin-bottom: 4px; }
.sheet-personas button { font-family: var(--mono); font-size: 12px; cursor: pointer;
  background: transparent; color: var(--muted); border: 1px solid var(--line);
  border-radius: 3px; padding: 9px 12px; min-height: 40px; }
.sheet-personas button[aria-selected="true"] { color: var(--text); border-color: var(--brand-lift); }
@media (max-width: 900px) {
  nav.top .links, nav.top .btn-pri { display: none; }
  #navBtn { display: inline-flex; align-items: center; margin-left: auto; }
}
@media (min-width: 901px) { .nav-sheet { display: none !important; } }

/* ---------- THE RAIL — permanent chrome ---------- */
.rail {
  position: fixed; inset: auto 0 0 0; z-index: 40; height: var(--rail-h);
  display: flex; align-items: stretch;
  background: color-mix(in srgb, var(--ink-0) 86%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.rail-cell { display: flex; flex-direction: column; justify-content: center;
  gap: 1px; padding: 0 16px; border-right: 1px solid var(--line-soft);
  min-width: 0; }
.rk { color: var(--muted); font-size: 12px; letter-spacing: .18em; line-height: 1; }
.rv { font-family: var(--mono); font-size: 12.5px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3;
  transition: opacity .3s ease; }
.rv[data-out="true"] { opacity: 0; }
.rc-analysis { flex: 0 1 340px; }
.rc-extent { flex: 0 1 250px; }
.rc-solve { flex: 0 0 auto; }
.rc-probe { flex: 1 1 200px; }
.rc-probe .rv { color: var(--data); }
.rc-legend { flex: 0 0 auto; flex-direction: row; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12px; color: var(--muted); }
.rc-legend .ramp { width: 140px; height: 6px; border-radius: 1px; }
.rc-persona { flex: 0 0 auto; border-right: none; position: relative; padding: 0; }
.fab-btn { height: 100%; display: flex; flex-direction: column; justify-content: center;
  gap: 1px; align-items: flex-start; padding: 0 18px 0 16px; cursor: pointer;
  background: transparent; border: none; border-left: 1px solid var(--line-soft);
  color: var(--text); }
.fab-btn .rv { color: var(--brand-lift); }
.fab-btn:hover .rv { color: var(--text); }
.fab-menu { position: absolute; right: 8px; bottom: calc(100% + 8px); width: 300px;
  background: var(--ink-1); border: 1px solid var(--line); border-radius: 4px;
  padding: 8px; box-shadow: 0 18px 60px rgba(0,0,0,.5); }
.fab-hint { font-size: 12.5px; color: var(--muted); padding: 8px 10px 12px;
  border-bottom: 1px solid var(--line-soft); margin-bottom: 6px; line-height: 1.5; }
.fab-hint code { font-family: var(--mono); color: var(--data); font-size: 12px; }
.fab-menu [role="option"] { display: block; width: 100%; text-align: left; cursor: pointer;
  background: transparent; border: none; color: var(--text); font-family: var(--mono);
  font-size: 12.5px; letter-spacing: .06em; padding: 10px; border-radius: 3px; }
.fab-menu [role="option"]:hover { background: var(--ink-2); }
.fab-menu [role="option"][aria-selected="true"] { color: var(--brand-lift); }

/* Phone: the rail becomes ONE line — analysis, probe, ramp. */
@media (max-width: 900px) {
  .rc-extent, .rc-solve, .rc-persona { display: none; }
  .rail-cell { padding: 0 12px; }
  .rc-analysis { flex: 0 1 46%; }
  .rc-analysis .rk, .rc-probe .rk { display: none; }
  .rc-legend .ramp { width: 64px; }
  .rc-legend span:first-child, .rc-legend span:last-child { display: none; }
}

/* ---------- intro / boot gate ---------- */
.intro { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  padding: 24px; background: var(--ink-0); overflow-y: auto; height: 100dvh;
  transition: opacity .5s ease; }
.intro[data-go="true"] { opacity: 0; pointer-events: none; }
.intro-card { width: min(660px, 100%); padding: 40px 42px 36px;
  background: var(--ink-1); border: 1px solid var(--line); border-radius: 4px;
  max-height: calc(100dvh - 36px); overflow-y: auto; }
.intro-card img { height: 22px; margin-bottom: 22px; }
.intro-card h2 { font-size: clamp(22px, 3vw, 30px); margin: 0 0 18px; }
.intro-list { list-style: none; margin: 0 0 28px; padding: 0;
  border-top: 1px solid var(--line-soft); }
.intro-list li { padding: 12px 0; border-bottom: 1px solid var(--line-soft);
  font-size: 14px; line-height: 1.55; color: var(--muted); }
.intro-list b { color: var(--text); font-weight: 600; }
.intro-list code { font-family: var(--mono); font-size: 12px; color: var(--data); }
#introGo[disabled] { opacity: .55; cursor: progress; }
html.intro-open, html.intro-open body { overflow: hidden; }
@media (max-width: 820px) {
  .intro-card { padding: 26px 20px 22px; }
  .intro-card h2 { font-size: 21px; margin-bottom: 12px; }
  .intro-list { margin-bottom: 20px; }
  .intro-list li { font-size: 13px; padding: 9px 0; }
}
