/* ═══════════════════════════════════════════════════════════════════════════
   TIBERIUM CONTROL — the Arcline skin.

   Arcline ships one seed and derives the rest. This file is the whole theme:
   the seed, three status overrides, and the bridge that points the board's
   original variable names at Arcline tokens so 1000 lines of existing layout
   inherit the new palette without being rewritten.

   Load order matters:
     vendor/arcline/tokens.css      the system
     vendor/arcline/components.css  the components
     arcline-skin.css               this file — seed + bridge
     style.css                      the board's own layout
   ═══════════════════════════════════════════════════════════════════════ */

:root,
.arcline {
  /* ── The seed ───────────────────────────────────────────────────────────
     Nod red. Verified with Arcline's own checker before shipping:

       node scripts/check-brand.mjs "#CC2936"   → all 13 gates pass

     Every other accent — the dark cut, the label ink, the tint, the focus
     ring, the specular edge, chart slot 1 — derives from this one value. */
  --brand-seed: #CC2936;

  /* ── The dark cut, pinned by hand ────────────────────────────────────────
     Arcline derives the dark brand as oklch(from seed 0.693 c*0.66 h+3),
     which lands on #e27a71: a bright, legible signal, and the right default
     for a general design system. It is not Nod red. Lightness 0.693 with a
     third of the chroma removed reads as salmon, and this board's whole
     identity is the Brotherhood's scarlet.

     So the dark family is pinned rather than derived. That is a real
     departure from "one seed and everything follows", so each value carries
     the measurement that justifies it (against the dark ramp: canvas
     #0e1214, surface #171d20):

       --brand      #E4141C   3.96:1 on canvas, clears the 3:1 focus gate
       --on-brand   #FFFFFF   4.76:1 on the fill. Pinned rather than left to
                              the computed flip, because #E4141C sits within
                              a hair of the l=0.56 boundary where the rule
                              switches to near-black, and near-black measures
                              4.32:1 there, under AA.
       --brand-text #FF4A40   5.34:1 on the tint, 5.65:1 on the canvas. Text
                              on a dark ground has to be lighter than the
                              fill; this is the reddest value that clears AA
                              on both.
       --brand-soft #2E0D0F   sits below the canvas, so it still reads as a
                              tint rather than as a lighter surface.

     Light mode is untouched and still derives from the seed alone. */
  --brand:      light-dark(#CC2936, #E4141C);
  --on-brand:   light-dark(#FFFFFF, #FFFFFF);
  --brand-text: light-dark(#a8232d, #FF4A40);
  --brand-soft: light-dark(#f9e1dc, #2E0D0F);

  /* The neutrals stay Arcline's mineral ramp, turned a few degrees cooler so
     the board reads as a screen rather than as paper. Chroma is pulled down
     because a dark ops console wants near-neutral surfaces under a hot
     signal, not a tinted ground competing with it. */
  --neutral-hue-shift: -14;
  --neutral-chroma: 0.72;
}

/* ── Status, re-pointed at the game ──────────────────────────────────────
   Arcline forbids a second saturated hue and warns when the brand lands on a
   hue that already carries meaning. A red brand collides with `critical`
   (ember, hue 36) — the checker says so. Rather than ignore it, the status
   ramp moves:

     positive  → Tiberium green.  This board's "good" is literally a live
                 game with people in it, and green is the game's own colour
                 for that. It replaces Moss, which sat too close to nothing.
     caution   → amber, unchanged in meaning, warmed to match.
     critical  → pushed to hue 45, a hot orange-red, so it clears the brand.

   Every ink below was measured against the canvas and the surface it sits on
   (scratch check, all ≥ 5.1:1). Nothing here relies on colour alone: the
   board pairs every status with a word and a shape, which is also what lets
   the brand and critical share a family safely — the same argument Arcline
   makes for chart slot 2. */
:root,
.arcline {
  --moss:      light-dark(#2E8B48, #63d47a);
  --moss-ink:  light-dark(#1f6f3a, #63d47a);  /* ours: Arcline has no moss ink */

  --yellow:      light-dark(#C08A1E, #d7b25f);
  --yellow-text: light-dark(#8a4a05, #d7b25f);

  --ember:       light-dark(#D9531C, #ff9a5c);
  --ember-text:  light-dark(#a13a00, #ff9a5c);
}

/* ── Faction identity ────────────────────────────────────────────────────
   The three armies carry the game's own colours, and every sub-faction
   inherits its parent's: Steel Talons and ZOCOM are GDI green, Black Hand
   and Marked of Kane are Nod red, Reaper-17 and Traveler-59 are Scrin cyan.

   These are deliberately separate tokens from the status ramp. A faction tag
   is an identity label, not a state, and the two must be free to move
   independently: Nod shares a hue with the brand, and GDI shares one with
   "live", so a tag is always accompanied by its name in text.

   Each ink was measured as a label on a 15% tint of itself over the dark
   surface (#171d20), which is how the tags are drawn:
     green #4ADE6A  7.03:1     red #FF5A4E  4.59:1     cyan #4DD9E8  7.24:1 */
:root,
.arcline {
  --faction-gdi:   light-dark(#1c7a3a, #4ADE6A);
  --faction-nod:   light-dark(#b3222c, #FF5A4E);
  --faction-scrin: light-dark(#0b7c8a, #4DD9E8);
}

/* ── Type ────────────────────────────────────────────────────────────────
   Arcline's pairing is Inter Tight for UI and IBM Plex Mono for metadata,
   and both are kept. Chakra Petch is added for display only — it is the
   board's own voice and the reason the page reads as Kane's Wrath rather
   than as a generic dashboard. A deliberate deviation, scoped to headings. */
:root,
.arcline {
  --font-sans: "Inter Tight", -apple-system, "Segoe UI", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --font-display: "Chakra Petch", "Inter Tight", system-ui, sans-serif;
}

/* ═════════════════════════════════════════════════════════ the bridge ════
   The board was built on its own variable names. Rather than rewrite every
   rule that uses them, each one is re-pointed at the Arcline token that
   carries the same meaning. One consequence worth stating: the board is no
   longer a hand-mixed palette that drifts, it is a view of the system, and
   changing --brand-seed above now re-themes every one of these at once.

   The board's own `--panel` was renamed to `--deck` first: Arcline uses
   `--panel` for its recessed surface, and quietly redefining it here would
   have repainted every track, well and segmented rail in components.css. */
:root {
  /* surfaces — Arcline's elevation ladder */
  --void:     var(--canvas);
  --deck:     var(--surface);
  --deck-2:   color-mix(in srgb, var(--surface) 78%, var(--canvas));
  --raised:   var(--panel);
  --line:     var(--rule);
  --line-2:   var(--rule-strong);
  --line-hot: color-mix(in srgb, var(--brand) 34%, var(--rule-strong));

  /* ink */
  --ink:   var(--text);
  --ink-2: var(--muted);
  --ink-3: color-mix(in srgb, var(--muted) 62%, var(--canvas));

  /* signal — the board's four meanings, now sourced from the system.
     tib   live, in combat        → status positive (Tiberium green)
     gdi   staging, waiting       → status caution
     nod   locked, link down      → the brand itself
     scrin observers, idle        → chart slot 3 (teal), the one place a
           second hue is licensed, and it is used for data, not chrome. */
  --tib:      var(--moss);
  --tib-deep: color-mix(in srgb, var(--moss) 70%, var(--canvas));
  --tib-text: var(--moss-ink);
  --gdi:      var(--yellow);
  --nod:      var(--brand);
  /* The Command Centre tints itself with the Brotherhood's red, but #E4141C
     at 8-16% over a near-black ground composites to a pale mauve haze rather
     than to red. This is the same hue taken dark, so the low alphas land as
     deep red instead of washed pink. Solid red TEXT still uses --nod, which
     needs the lightness to stay legible. */
  --nod-deep: #7d0f14;
  --scrin:    var(--chart-3);
  --cold:     var(--chart-3);

  --mono: var(--font-mono);
  --disp: var(--font-display);
}

/* ── Page ground ─────────────────────────────────────────────────────────
   Arcline declares tokens at :root precisely so html/body can use them.
   The theme is pinned with data-theme="dark" on <html>, not on the body:
   pinning it lower leaves :root itself following the OS, so the canvas
   behind the page would resolve light while everything on it resolved dark.
   That is the flash-of-light case tokens.css warns about. */
body {
  background: var(--canvas);
  color: var(--text);
  font-family: var(--font-sans);
}

/* ── Focus ───────────────────────────────────────────────────────────────
   One rule, everywhere. Arcline's contract is a 2px brand outline on every
   keyboard target; the board previously set this per component. */
:focus-visible {
  outline: var(--focus-ring) solid var(--brand);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}
