/* ═══════════════════════════════════════════════════════════════════════
   PRISM · tokens — the one place a colour, a size or a duration is decided.

   Loaded first on every page, before anything else. Nothing in this file
   paints; it only names things, so a room can be restyled by changing a
   value here instead of by editing eleven copies of the same declaration.

   Three rules that the old suite broke and this file is written to enforce:

   1. ONE ground. There were five near-blacks in play (#04060c, #05070c,
      #040509, #04050a, #020306). Nobody consciously notices; everybody
      feels it. There is now --p-ground and there are four steps up from it.

   2. --p-text-3 IS THE FLOOR. It sits at 5.0:1 on the ground. Nothing
      fainter ships. Every hint line, note, panel border and back-link in
      the old suite sat between 1.26:1 and 3.0:1 — the interface was
      legible and the instructions were not.

   3. Motion collapses under prefers-reduced-motion, here, once, for
      everyone — not per room, which is how ten of eleven rooms missed it.
   ═══════════════════════════════════════════════════════════════════════ */

:root{

  /* ── ground ──────────────────────────────────────────────────────────
     One near-black and four steps up. --p-ground is deliberately very
     dark: this suite spends its life on a projector in a dim room, and
     anything lighter throws grey light onto the wall around the image. */
  --p-ground:#05070d;
  --p-surface:#0a0e17;      /* cards, chrome bars, sheets            */
  --p-raised:#111726;       /* panels sitting on a surface           */
  --p-overlay:#1a2133;      /* menus, popovers, hover fills          */
  --p-line:rgba(150,175,225,.14);
  --p-line-hi:#252e44;      /* borders that must read as a boundary  */
  --p-scrim:rgba(3,5,10,.82);

  /* ── text ────────────────────────────────────────────────────────────
     Contrast on --p-ground: 17.2 · 9.1 · 5.0. The third is the floor. */
  --p-text-1:#f0f4fc;
  --p-text-2:#a8b4cc;
  --p-text-3:#7c89a3;

  /* ── the spectrum ────────────────────────────────────────────────────
     Six hues, drawn from the rays leaving the mark. A room picks one in
     the register and never invents its own. --p-accent is what every
     component actually reads; a room overrides that single line. */
  --p-violet:#a98bff;
  --p-blue:#6d9bff;
  --p-cyan:#3fd8e8;
  --p-lime:#9be55a;
  --p-amber:#ffb454;
  --p-rose:#ff6b9d;
  --p-accent:var(--p-blue);
  --p-accent-soft:rgba(109,155,255,.16);
  --p-accent-line:rgba(109,155,255,.42);

  /* ── semantic ── */
  --p-ok:#6edb8f;
  --p-warn:#ffb454;
  --p-bad:#ff7a8a;

  /* ── type ────────────────────────────────────────────────────────────
     Outfit has character and carries the brand at display sizes; Inter
     holds together at 11–13px, which is exactly where the chrome lives
     and exactly where Outfit was going soft. Rajdhani is retired. */
  --p-display:Outfit,system-ui,-apple-system,sans-serif;
  --p-ui:Inter,system-ui,-apple-system,"Segoe UI",sans-serif;
  --p-mono:"JetBrains Mono",ui-monospace,SFMono-Regular,Menlo,monospace;

  --p-fs-display:clamp(38px,7vw,64px);
  --p-fs-title:clamp(24px,3.4vw,32px);
  --p-fs-head:20px;
  --p-fs-body:15px;
  --p-fs-ui:13.5px;
  --p-fs-small:12.5px;
  --p-fs-micro:11px;
  --p-track-micro:.12em;    /* uppercase micro labels          */
  --p-track-mono:.14em;     /* codes, telemetry, keyboard hints */

  /* ── space ── */
  --p-1:4px; --p-2:8px; --p-3:12px; --p-4:16px;
  --p-5:24px; --p-6:32px; --p-7:48px; --p-8:64px;

  /* ── radius ── */
  --p-r1:8px;    /* control */
  --p-r2:12px;   /* panel   */
  --p-r3:16px;   /* card    */
  --p-r4:20px;   /* sheet   */
  --p-rp:999px;  /* pill    */

  /* ── elevation ── */
  --p-e1:0 1px 2px rgba(0,0,0,.4);
  --p-e2:0 6px 24px -8px rgba(0,0,0,.6), 0 1px 2px rgba(0,0,0,.4);
  --p-e3:0 20px 60px -18px rgba(0,0,0,.8), 0 2px 6px rgba(0,0,0,.5);

  /* ── motion ── */
  --p-t-micro:120ms;
  --p-t-std:200ms;
  --p-t-enter:320ms;
  --p-t-ambient:600ms;
  --p-ease:cubic-bezier(.2,.8,.2,1);

  /* ── touch ──────────────────────────────────────────────────────────
     44 is the usable figure. 24 is WCAG 2.2 AA's floor and is only ever
     acceptable for a control that also has a larger duplicate elsewhere.
     The old room sliders were a 3px track with a 12px thumb. */
  --p-tap:44px;
  --p-tap-min:24px;

  /* ── chrome geometry ── */
  --p-head:52px;
  --p-head-chip:40px;

  /* ── safe area — the rooms used none of this, so bars sat under the
     notch and the home indicator on every iPhone ── */
  --p-top:env(safe-area-inset-top,0px);
  --p-bot:env(safe-area-inset-bottom,0px);
  --p-lft:env(safe-area-inset-left,0px);
  --p-rgt:env(safe-area-inset-right,0px);

  color-scheme:dark;
}

/* Room accents. The register names one of these; the shell writes the
   class onto <html>. Keeping them here means a room file contains no
   colour at all. */
.p-ac-violet{--p-accent:var(--p-violet);--p-accent-soft:rgba(169,139,255,.16);--p-accent-line:rgba(169,139,255,.42)}
.p-ac-blue  {--p-accent:var(--p-blue);  --p-accent-soft:rgba(109,155,255,.16);--p-accent-line:rgba(109,155,255,.42)}
.p-ac-cyan  {--p-accent:var(--p-cyan);  --p-accent-soft:rgba( 63,216,232,.16);--p-accent-line:rgba( 63,216,232,.42)}
.p-ac-lime  {--p-accent:var(--p-lime);  --p-accent-soft:rgba(155,229, 90,.16);--p-accent-line:rgba(155,229, 90,.42)}
.p-ac-amber {--p-accent:var(--p-amber); --p-accent-soft:rgba(255,180, 84,.16);--p-accent-line:rgba(255,180, 84,.42)}
.p-ac-rose  {--p-accent:var(--p-rose);  --p-accent-soft:rgba(255,107,157,.16);--p-accent-line:rgba(255,107,157,.42)}

@media (prefers-reduced-motion:reduce){
  :root{--p-t-micro:0ms;--p-t-std:0ms;--p-t-enter:0ms;--p-t-ambient:0ms}
  html{scroll-behavior:auto}
}

/* One focus ring, everywhere, on everything. The rooms set
   input[type=range]{outline:none} with no replacement, so the ring was
   not merely weak — it had been removed. */
:focus-visible{outline:2px solid var(--p-accent);outline-offset:2px;border-radius:var(--p-r1)}
