/* ============================================================================
   VIVARIUM — design tokens
   Mono base · ONE rationed signal (sapphire-cyan = LIVE) · amber = focus/warning.
   Colour emits from screens + edge-light; it is never painted onto chrome.
   ========================================================================== */

:root {
  /* ── Containment void (base) ─────────────────────────────────────────── */
  --void:        oklch(13% 0.012 250);   /* lit dark room, faint cool cast   */
  --void-deep:   oklch(10% 0.008 250);   /* behind each specimen, floats     */
  --pane:        oklch(19% 0.016 250);   /* glass faces, HUD chrome          */
  --pane-hi:     oklch(26% 0.020 250);   /* raised chrome / hover            */
  --line:        oklch(34% 0.018 250);   /* hairline structure               */

  /* ── Type tones ──────────────────────────────────────────────────────── */
  --ink:         oklch(94% 0.012 230);   /* primary readout text             */
  --ink-soft:    oklch(80% 0.014 235);   /* secondary                        */
  --ink-mute:    oklch(68% 0.012 240);   /* tertiary text — keeps >=4.5:1     */
  --ink-faint:   oklch(58% 0.012 245);   /* faintest text-bearing label      */
  --hairline:    oklch(42% 0.012 245);   /* non-text decoration only         */

  /* ── Signal (rationed) ───────────────────────────────────────────────── */
  --live:        oklch(80% 0.145 214);   /* LIVE / ONLINE / selected         */
  --live-dim:    oklch(64% 0.115 214);
  --live-deep:   oklch(40% 0.085 220);
  --amber:       oklch(82% 0.150 73);    /* focus / observe / warning ONLY   */
  --amber-dim:   oklch(66% 0.120 70);

  /* glows (emissive) */
  --glow-live:   0 0 22px oklch(80% 0.145 214 / 0.45), 0 0 64px oklch(80% 0.145 214 / 0.18);
  --glow-amber:  0 0 20px oklch(82% 0.150 73 / 0.40), 0 0 56px oklch(82% 0.150 73 / 0.16);
  --rim-live:    inset 0 0 0 1px oklch(80% 0.145 214 / 0.42), inset 0 0 30px oklch(80% 0.145 214 / 0.10);

  /* ── Type families ───────────────────────────────────────────────────── */
  --f-display: "Archivo Expanded", "Archivo", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* fluid type scale — near-binary jumps (eyebrow tiny ↔ display huge) */
  --t-micro:   0.6875rem;                                   /* 11px labels   */
  --t-label:   clamp(0.72rem, 0.68rem + 0.2vw, 0.82rem);
  --t-body:    clamp(0.9rem, 0.84rem + 0.3vw, 1.02rem);
  --t-lead:    clamp(1.05rem, 0.9rem + 0.7vw, 1.4rem);
  --t-title:   clamp(2.2rem, 1.2rem + 4.4vw, 5rem);
  --t-titan:   clamp(3.6rem, 1rem + 13vw, 13rem);           /* VIVARIUM      */

  /* ── Spacing / rhythm (8pt) ──────────────────────────────────────────── */
  --sp-1: 0.5rem;  --sp-2: 1rem;   --sp-3: 1.5rem;  --sp-4: 2rem;
  --sp-6: 3rem;    --sp-8: 4rem;   --sp-12: 6rem;   --sp-16: 8rem;
  --gutter: clamp(1.25rem, 1rem + 3vw, 4.5rem);
  --station-h: 100svh;

  /* ── Motion ──────────────────────────────────────────────────────────── */
  --e-out: cubic-bezier(0.16, 1, 0.3, 1);       /* expo-out, entering        */
  --e-in:  cubic-bezier(0.7, 0, 0.84, 0);       /* exiting                   */
  --e-soft: cubic-bezier(0.33, 1, 0.68, 1);
  --d-fast: 220ms;  --d-mid: 420ms;  --d-slow: 760ms;

  /* ── Atmosphere intensity (driven up by SIGNAL=live) ─────────────────── */
  --grain-opacity: 0.05;
  --scan-opacity: 0.05;
  --flicker: 0;                                  /* 0 idle → 1 live           */
  --rim-energy: 0.5;                             /* edge-light strength       */

  /* ── Layering ────────────────────────────────────────────────────────── */
  --z-atmos: 1;  --z-content: 10;  --z-hud: 60;  --z-reticle: 70;
  --z-observe: 90;  --z-threshold: 80;
}

/* SIGNAL = LIVE — the wing powers up: more current, more glow, more life */
body[data-signal="live"] {
  --grain-opacity: 0.085;
  --scan-opacity: 0.09;
  --flicker: 1;
  --rim-energy: 1;
}

@media (prefers-reduced-motion: reduce) {
  :root { --flicker: 0; --grain-opacity: 0.04; --scan-opacity: 0.03; }
  body[data-signal="live"] { --flicker: 0; }
}
