/* Command Navy — the Phase-1 design-token layer.
 *
 * SCOPE, WHICH IS THE WHOLE ARCHITECTURE: this file is linked ONLY by
 * app/templates/base_navy.html, the second shell that the two migrated
 * surfaces (public homepage, Product Center) extend. Nothing here reaches an
 * unmigrated page, design-system.css, app.css or Desert Storm — isolation is
 * achieved by who links the file, not by selector prefixing, which is why
 * these tokens may sit on :root.
 *
 * NEW NAMES ON PURPOSE. The legacy layer's semantics genuinely differ
 * (--ds-gold means SELECTED there; here gold is the rare-signal/brand stroke
 * and ORANGE is selected), so reusing --ds-* names would make one spelling
 * mean two things depending on the shell. --nx-* states which system a rule
 * belongs to at the point of use.
 *
 * VALUES are the locked contract from the Claude Design Engineering Handoff
 * (AUTHORITATIVE, AUG 19 2026), §1 "Design tokens — final contract".
 *
 * SEMANTIC ROLES ARE PRODUCT CONTRACT (handoff §2):
 *   cyan   = live / open / available fact, links, focus     — NEVER selection
 *   blue   = alliance / organizational context              — NEVER decoration
 *   orange = selected / current control / command decision  — NEVER warning
 *   gold   = brand stroke + rare documented signal          — NEVER availability,
 *            selection, ordinary status, stale, unknown, generic warning
 *   red    = opponent / danger / destructive / error        — NEVER "the lower number"
 *   olive  = restrained personal/progression context, success
 *   stale/unknown = muted tones + text/shape (dotted ◌), never yellow
 */

:root {
  /* --- Surfaces -------------------------------------------------------- */
  --nx-canvas: #101820;
  --nx-surface: #17242e;
  --nx-elevated: #1e303c;
  --nx-border: #334957;
  --nx-border-2: #223240;

  /* Component neutrals (handoff §1): input bg · row divider · outline
     border/neutral rail · gradient base. --nx-deep doubles as the recessed
     band tone the mockups use for the trust strip and footer. */
  --nx-inset: #0d141b;
  --nx-row-line: #1f2c37;
  --nx-outline: #45596a;
  --nx-grad-base: #131c24;
  --nx-deep: #0d141b;

  /* --- Text, five levels — keep all five ------------------------------- */
  --nx-text: #f2f5f6;
  --nx-body: #c3cdd3;
  --nx-support: #a5b2bc;
  --nx-muted: #9aaab4;
  --nx-faint: #76868f;

  /* --- Semantic families ------------------------------------------------ */
  --nx-cyan: #35cfe3;
  --nx-cyan-tint: #0f2227;
  --nx-cyan-line: #1e5560;

  --nx-blue: #347fc4;
  --nx-blue-text: #6fa8d8;      /* the small-text variant — AA on surface */
  --nx-blue-tint: #182636;
  --nx-blue-line: #2b4257;

  /* SSR IS PURPLE, AND THE GAME SAYS SO IN TWO PLACES. Its quality quiz --
     id 121304, "Which is the correct hero quality sequence?" -- answers at id
     121306 «أخضر < أزرق < بنفسجي < برتقالي», and it wraps the SSR code in
     #8d4bbb / #D355E7 / #eb86ff (hue 275-292) in three separate strings. The
     extracted chip art agrees: an SSR chip's frame measures hue 266, an SR
     chip's 211.

     This trio exists because SSR was painted BLUE on /drone and /heroes and
     PURPLE on /decorations -- one rule with three implementations, two of them
     wrong. #a66cf0 is the value /decorations already shipped; it is kept rather
     than replaced because it is the one that was right and its hue (266.4)
     lands on the art. Sat/val for the tint and line mirror the blue trio's own
     relationship, so a purple panel sits at the same depth as a blue one.

     SR STAYS BLUE. It is blue in the game (#0000FF, #70e6f1, #5FA3ED) and blue
     in the art. Only SSR moved. */
  --nx-purple: #a66cf0;         /* AA on surface (4.54) — the small-text variant */
  --nx-purple-tint: #251836;
  --nx-purple-line: #3e2b57;

  --nx-orange: #f4822d;
  --nx-orange-tint: #2a1a10;

  --nx-gold: #f3b83f;
  --nx-gold-tint: #2a2413;
  --nx-gold-line: #5d4a1a;

  --nx-red: #d94b43;
  --nx-red-text: #e2766f;       /* the small-text variant */
  --nx-red-tint: #33201c;
  --nx-red-line: #5a3029;
  --nx-red-line-2: #5c2b27;

  --nx-olive: #7f9162;
  --nx-olive-text: #9db07e;
  --nx-olive-tint: #1a2117;
  --nx-olive-line: #3c4530;
  --nx-olive-light: #c6d6ad;

  /* Season/cold semantics only — reserved, currently unused (handoff §1). */
  --nx-ice: #91d0ea;

  /* --- Hovers (documented, not improvised) ------------------------------ */
  --nx-link-hover: #7fdff0;
  --nx-blue-hover: #83adce;
  --nx-ivory-hover: #ffffff;

  /* --- Typography roles ------------------------------------------------- */
  /* Alexandria and Rubik carry real Arabic coverage (that is why the locked
     design chose them), so no RTL display swap is needed; the Plex entries
     remain purely as cold-cache fallbacks. Faces are declared once, in
     tokens/fonts.css — the product keeps one font-loading mechanism. */
  --nx-font-display: "Alexandria", "IBM Plex Sans Arabic", "Segoe UI", system-ui, sans-serif;
  --nx-font-body: "Rubik", "IBM Plex Sans", "IBM Plex Sans Arabic", "Segoe UI", system-ui, sans-serif;
  /* Mono mirrors the shipped stack: the Arabic alias sits before Cascadia
     Mono so joined Arabic letterforms survive on Windows (tokens/fonts.css).
     Mono is for figures, dates, ids and tags — never prose, button labels or
     Arabic script runs. */
  --nx-font-mono: "IBM Plex Mono", "LW Mono Arabic Fallback", "Cascadia Mono", Consolas, ui-monospace, monospace;

  /* --- Structure -------------------------------------------------------- */
  --nx-radius-sm: 6px;
  --nx-radius: 10px;
  --nx-radius-card: 12px;
  --nx-radius-band: 14px;
  --nx-public-max: 1100px;      /* public pages (handoff §3) */
  --nx-tool-max: 1240px;        /* tool pages */
  --nx-gutter: 32px;
  --nx-touch: 44px;             /* minimum touch target */

  /* --- Focus ------------------------------------------------------------ */
  --nx-focus: var(--nx-cyan);
}

/* --- Names the page sheets already use, mapped to the tokens that exist -----
 *
 * These are ALIASES, not new design values. Four navy page sheets were written
 * against an `--nx-`-prefixed spelling of the product token layer that never
 * landed here, so every one of these resolved to nothing: `font-size` fell back
 * to inherit and `border-radius` collapsed to 0 on /analytics, the comparison
 * result, the scouting report, the public analysis share, six Technology
 * journey pages, seven Stores pages and the calculators. Each name below points
 * at the token the sheet plainly meant; no colour, size or radius is invented.
 *
 * Found by the 2026-09-09 hygiene census and confirmed by a var()-reference
 * sweep that ignores `var(--x, fallback)` forms, which render correctly.
 * tests/test_design_tokens.py now fails if a loaded sheet gains another one.
 */
:root {
  /* type scale -- the product layer spells these without the prefix */
  --nx-text-xs: var(--text-xs);
  --nx-text-sm: var(--text-sm);
  --nx-text-lg: var(--text-lg);
  --nx-text-xl: var(--text-xl);
  --nx-text-2xl: var(--text-2xl);
  --nx-text-label: var(--text-label);
  --nx-text-meta: var(--text-meta);
  --nx-text-data: var(--text-data);
  --nx-text-data-sm: var(--text-data-sm);

  /* radii -- likewise */
  --nx-radius-md: var(--radius-md);
  --nx-radius-micro: var(--radius-micro);
  --nx-radius-circle: var(--radius-circle);
  --nx-radius-pill: var(--radius-pill);

  /* secondary text and panel ground, in this shell's own vocabulary */
  --nx-text-2: var(--nx-muted);
  --nx-panel: var(--nx-surface);
}
