/* =====================================================================
   GROUND STATION — LIGHT
   Light theme layer, loaded by index.html after its inline <style>.
   Light is the default; the header toggle switches to dark and the
   choice is remembered per browser.

   Everything below is scoped to [data-theme="light"], so the dark
   theme is the original inline design, untouched.

   Two rules hold the theme together:
   - Amber is #FFB347. Not a shade of it, not a tint — the brand value,
     in both themes, in every role.
   - Grounds invert by section, not globally. The differentiator was the
     one light band in the dark build, so here it is the one dark band.
   ===================================================================== */

/* ---------------------------------------------------------------------
   Theme toggle — unscoped; it has to read correctly in both themes.
   --------------------------------------------------------------------- */
.theme-t{display:grid;place-items:center;width:34px;height:34px;flex:none;
  border:1px solid var(--line2);color:var(--mute);
  transition:color .2s,border-color .2s,background .2s}
.theme-t:hover{color:var(--amber);border-color:var(--amber)}
.theme-t svg{display:block}
.theme-t .i-moon{display:none}
[data-theme="light"] .theme-t .i-sun{display:none}
[data-theme="light"] .theme-t .i-moon{display:block}
@media (max-width:980px){.theme-t{margin-right:4px}}

/* Legend swatches, keyed to tokens instead of baked hexes so they
   follow the toggle. */
.legend i.lg-q{background:var(--dim)}
.legend i.lg-u{background:var(--amber)}
.legend i.lg-d{background:var(--red)}

/* ---------------------------------------------------------------------
   Paper ground
   --------------------------------------------------------------------- */
:root[data-theme="light"]{
  --bg:#F5F7FB;--bg2:#E9EEF6;--panel:#FFFFFF;--panel2:#F3F6FB;
  --line:#D4DCE9;--line2:#B2BFD3;
  --ink:#0B1020;--mute:#55627C;--dim:#A6B1C6;
  --amber:#FFB347;--amber2:#FFC46B;--amber-ink:#1A1200;--red:#FF5A4E;
  --plate:#EDF1F8;
}
/* Small amber type measures 1.75:1 on paper. Amber is fixed by design;
   if the labels ever need to pass AA, these three lines are the whole fix:
   :root[data-theme="light"]{--amber:#9A5200}
   :root[data-theme="light"] .btn-p{background:#FFB347;color:#1A1200}
   :root[data-theme="light"] .bet-h .hl{background:#FFB347}                */

[data-theme="light"] body::before{background:repeating-linear-gradient(0deg,transparent 0 3px,rgba(11,16,32,.022) 3px 4px)}
[data-theme="light"] ::selection{background:var(--amber);color:var(--amber-ink)}

/* ---------- nav ---------- */
[data-theme="light"] .nav{background:rgba(245,247,251,.86)}

/* ---------- hero ---------- */
[data-theme="light"] .hero::before{background:radial-gradient(1100px 520px at 85% -10%,rgba(255,179,71,.30),transparent 62%)}
[data-theme="light"] .bar{background:var(--plate)}
[data-theme="light"] .delta .track{background:var(--plate)}
[data-theme="light"] .mini .r.h,[data-theme="light"] .fleet .r.h{background:var(--bg2)}
[data-theme="light"] .cmdline{background:var(--bg2)}

/* ---------- panels ---------- */
[data-theme="light"] .panel,[data-theme="light"] .case,[data-theme="light"] .metrics{box-shadow:0 18px 40px -30px rgba(11,16,32,.35)}
[data-theme="light"] .help{box-shadow:0 40px 90px -62px rgba(11,16,32,.55)}

/* Blueprint plates are dark-navy negatives. On paper they invert into
   drafting prints; inside the dark differentiator they stay as drawn. */
[data-theme="light"] .fig{background:var(--plate)}
[data-theme="light"] .fig img{filter:invert(1) hue-rotate(180deg) saturate(.45) brightness(1.05)}

/* ---------------------------------------------------------------------
   DIFFERENTIATOR — the proper inverse
   In the dark build this section is the one sheet of paper. Here it is
   the one dark band, carrying the original :root tokens verbatim.
   --------------------------------------------------------------------- */
[data-theme="light"] .paper{
  --bg:#0B1020;--bg2:#0D1426;--panel:#111A2E;--panel2:#152038;--line:#22304D;--line2:#2E3F63;
  --ink:#E7ECF6;--mute:#7E8BA8;--dim:#3A4A6E;--amber:#FFB347;--amber2:#FFC46B;--amber-ink:#1A1200;--red:#FF5A4E;
  color:var(--ink);background-color:#0D1426;
  background-image:linear-gradient(rgba(231,236,246,.05) 1px,transparent 1px),linear-gradient(90deg,rgba(231,236,246,.05) 1px,transparent 1px)}
[data-theme="light"] .paper .d2{color:var(--ink)}
[data-theme="light"] .paper .sec-line{display:block}
[data-theme="light"] .paper .fig{background:#141B33}
[data-theme="light"] .paper .fig img{filter:none}
[data-theme="light"] .paper .bet-fig{box-shadow:0 20px 40px -30px rgba(11,16,32,.45)}

/* ---------- close ---------- */
[data-theme="light"] .grid-bg{background-image:linear-gradient(rgba(11,16,32,.05) 1px,transparent 1px),linear-gradient(90deg,rgba(11,16,32,.05) 1px,transparent 1px)}

/* ---------------------------------------------------------------------
   READOUTS
   The amber band is ground-independent: it carries its own tokens and
   its ink reads at 9:1 on amber in either theme, so it is left alone.
   The one correction is the panel lift above, which would otherwise
   drop a navy shadow under the metrics strip on the amber ground.
   --------------------------------------------------------------------- */
[data-theme="light"] .amber .metrics{box-shadow:none}
