/* ===========================================================================
   NEXO VISUAL SYSTEM V1 - FROZEN TOKENS
   Derived from DIRECTION_C_PREMIUM_V2 (SOVEREIGN AURIC INTELLIGENCE V2),
   selected by the Director at commit 3c07fa7bc3cdbc525fb141cf206ad57d5ee4bfa8.

   This file is the single source of visual truth for the NEXO design layer.
   It encodes PRESENTATION ONLY. It never encodes business policy, authority or
   canonical state; it is consumed by surfaces that render what the canonical
   owners decide.

   FROZEN means: these values do not change without a Director-authorised
   revision of the visual system. Seven values below were adjusted from the V2
   candidates, each for a measured accessibility failure and by the minimum
   amount that cleared it - never for taste. Every adjustment is recorded in
   TOKEN_VALIDATION_REPORT.md with its before/after contrast ratio.

   Convergence note: these tokens are proposed as the design-layer counterpart
   of nexo_tokens.dart. They are not a second token system; where the two meet,
   the canonical implementation token wins and this file follows it.
   =========================================================================== */

:root{

  /* =========================================================================
     1. SURFACE LEVELS
     Tone carries structure. A surface change is a semantic change of ground,
     which is why the system can afford almost no drawn rectangles.
     Critical, truth-bearing content is ALWAYS solid: never translucent,
     never blurred.
     ========================================================================= */
  --nx-surface-0:#0e0d10;   /* page ground                                   */
  --nx-surface-1:#131216;   /* decision field: economics + governed action   */
  --nx-surface-2:#1a181f;   /* raised: the governed contract object          */
  --nx-surface-sink:#0b0a0d;/* recedes: provenance, de-emphasised context    */
  --nx-surface-chrome:rgba(14,13,16,.72); /* THE ONLY permitted translucency:
                               navigation, floating and map controls,
                               transient overlays. Never content.            */

  /* =========================================================================
     2. SEMANTIC COLOUR ROLES
     Colour is NEVER the only channel. Every state below is also carried by a
     glyph, a shape and a word. Measured worst-case contrast against all four
     surfaces is quoted per token; AA text = 4.5:1, UI/large = 3:1.
     ========================================================================= */

  /* GRAPHITE - sovereign environment and authority. Above (surfaces). */

  /* AURIC - commitment, material economic value, scarce premium emphasis.
     Spent at most twice per surface: verified money, and the one material
     action. Never decorative, never a brand wash.                           */
  --nx-auric:#b0862f;              /* 5.27  AA text                          */
  --nx-auric-lift:#caa04a;         /* 7.23  machined edge of the action base */
  --nx-auric-soft:rgba(176,134,47,.14);
  --nx-authority:#98793a;          /* 4.30  UI/3:1 ONLY - the authority spine.
                                      Not a text colour; authority TEXT uses
                                      --nx-auric.                            */

  /* MINERAL TEAL - reasoning, intelligence, material change, revalidation.  */
  --nx-teal:#38908f;               /* 4.65  AA text                          */
  --nx-teal-lift:#4aa9a6;          /* 6.29  new value after a material change*/
  --nx-teal-soft:rgba(56,144,143,.14);

  /* CERTAINTY FAMILY                                                        */
  --nx-verified:#5fa882;           /* 6.20  AA text                          */
  --nx-verified-soft:rgba(95,168,130,.16);
  --nx-estimated:#c2953f;          /* 6.42  AA text - estimated / aging      */
  --nx-estimated-soft:rgba(194,149,63,.16);
  --nx-unknown:#8a837b;            /* 4.70  AA text - unknown / unavailable  */
  --nx-unknown-soft:rgba(138,131,123,.12);

  /* BLOCKED - reserved for blocked and destructive outcomes ONLY. It must
     never be used for "unknown", for "estimated", or for emphasis.
     Lifted from the V2 candidate #c2564b, which measured 4.20.              */
  --nx-blocked:#d15d51;            /* 4.52  AA text                          */
  --nx-blocked-soft:rgba(209,93,81,.14);

  /* TEXT
     --nx-text-3 was lifted from the V2 candidate #736d66, which measured
     3.44 on the raised surface and failed AA for real body copy (evidence
     metadata, freshness, ledger notes).                                     */
  --nx-text-1:#f2ede5;             /* 15.09  primary                         */
  --nx-text-2:#a8a199;             /*  6.88  secondary                       */
  --nx-text-3:#878077;             /*  4.51  metadata, freshness, notes      */
  --nx-text-on-auric:#14100a;      /*  5.68  on the material action base     */

  /* SEPARATORS
     Two tokens, deliberately. A hairline that carries no information stays
     quiet; a separator that DOES carry meaning - inputs versus result in the
     ledger, one semantic domain from the next - must be perceivable and
     meets the 3:1 non-text requirement.                                     */
  --nx-rule:#221f29;               /* non-informational structure            */
  --nx-rule-2:#332f3d;             /* non-informational, slightly stronger   */
  --nx-rule-strong:#676371;        /* 3.01  SEMANTIC separators only         */

  /* FOCUS
     Two rings, because one cannot clear 3:1 on both a dark surface and the
     auric action base. --nx-focus measures 16.01 on surfaces;
     --nx-focus-on-auric measures 5.68 on the action base.                   */
  --nx-focus:#f2ede5;
  --nx-focus-on-auric:#14100a;
  --nx-focus-width:2px;
  --nx-focus-offset:2px;

  /* =========================================================================
     3. TYPOGRAPHY
     Eight roles, each independently recognisable. No exotic face is chosen
     for distinctiveness: distinctiveness comes from the instruments, not the
     font. Every stack is a system or near-universal face, so the system is
     localisation-safe and does not depend on a web-font download to be
     legible.
     ========================================================================= */
  --nx-font-display:"Iowan Old Style",Georgia,"Times New Roman",serif;
  --nx-font-ui:ui-sans-serif,"Segoe UI",Inter,Roboto,system-ui,sans-serif;
  --nx-font-num:"Iowan Old Style",Georgia,"Times New Roman",serif;

  /* Economic numerals are ALWAYS tabular and lining, and always right-aligned
     in a ledger column, so a money column can never misalign or reflow.     */
  --nx-num-features:lining-nums tabular-nums;

  /* Type scale. rem-based so browser text scaling works; validated at 200%. */
  --nx-fs-display-l:clamp(2.125rem,5.4vw,4rem);      /* brand display       */
  --nx-fs-display-m:clamp(1.625rem,3.4vw,2.375rem);  /* operating heading   */
  --nx-fs-display-s:1.5625rem;                       /* action name         */
  --nx-fs-num-hero:1.5rem;                           /* verified money      */
  --nx-fs-num-row:1.1875rem;                         /* ledger row value    */
  --nx-fs-num-sum:clamp(1.375rem,2.5vw,1.75rem);     /* the result slot     */
  --nx-fs-num-change:1.375rem;                       /* material change     */
  --nx-fs-body:0.9375rem;                            /* body                */
  --nx-fs-body-s:0.875rem;                           /* dense body          */
  --nx-fs-meta:0.78125rem;                           /* evidence metadata   */
  --nx-fs-micro:0.71875rem;                          /* state / authority   */
  --nx-fs-nano:0.65625rem;                           /* provenance only     */

  --nx-lh-tight:1.1;
  --nx-lh-heading:1.25;
  --nx-lh-body:1.6;

  --nx-fw-regular:400;
  --nx-fw-medium:600;
  --nx-fw-bold:700;

  /* Tracking. Uppercase is reserved for canonical state identifiers, which
     are machine tokens rather than prose; everything else is sentence case. */
  --nx-track-state:.11em;
  --nx-track-label:.05em;
  --nx-track-brand:.24em;
  --nx-track-display:-.014em;

  /* =========================================================================
     4. SPACING - 2px base, used to buy hierarchy instead of containers.
     ========================================================================= */
  --nx-sp-1:0.25rem;   /*  4px */
  --nx-sp-2:0.5rem;    /*  8px */
  --nx-sp-3:0.75rem;   /* 12px */
  --nx-sp-4:1rem;      /* 16px */
  --nx-sp-5:1.25rem;   /* 20px */
  --nx-sp-6:1.625rem;  /* 26px */
  --nx-sp-7:2rem;      /* 32px */
  --nx-sp-8:2.375rem;  /* 38px */
  --nx-sp-9:2.75rem;   /* 44px */
  --nx-sp-10:3.25rem;  /* 52px */

  --nx-gutter:1.625rem;
  --nx-measure:1120px;  /* the decision column. Width past this is margin,
                           never another card.                              */

  /* =========================================================================
     5. GEOMETRY
     The principle, not the metric: a FULL RECTANGLE IS DRAWN ONLY WHEN IT
     HAS A MATERIAL SEMANTIC JOB. V2 reached zero full rectangles; that is
     evidence the principle works, not a quota to defend. Prefer spacing,
     tone, partial rules, the authority spine, the certainty spine and
     alignment before drawing a container.
     ========================================================================= */
  --nx-radius-0:0;
  --nx-radius-1:2px;
  --nx-radius-2:4px;
  --nx-radius-pill:999px;
  --nx-hairline:1px;
  --nx-spine:3px;       /* authority spine and certainty spine              */
  --nx-accent-rule:2px; /* the material-change rule                          */

  /* =========================================================================
     6. MOTION
     Motion communicates a state transition and nothing else. It runs once,
     comes fully to rest, and is removed entirely under reduced-motion.
     Forbidden: continuous pulse, ambient motion, shimmer, glow loops,
     decorative parallax, anything that does not end.
     ========================================================================= */
  --nx-motion-settle:420ms;        /* material change: old -> new, once      */
  --nx-motion-settle-min:360ms;
  --nx-motion-settle-max:480ms;
  --nx-motion-ui:140ms;            /* hover, focus, disclosure               */
  --nx-ease-settle:cubic-bezier(.2,.7,.3,1);
  --nx-ease-ui:cubic-bezier(.3,.6,.4,1);

  /* =========================================================================
     7. INTERACTION SURFACE
     Minimum touch target is 44px on any pointer-coarse device. The material
     action base is sized from this floor, not from its label.
     ========================================================================= */
  --nx-target-min:44px;
  --nx-action-pad-y:1.1875rem;
  --nx-action-pad-x:1.375rem;

  /* =========================================================================
     8. RESPONSIVE BREAKPOINTS
     Validated at 390 / 768 / 1024 / 1280 / 1440. More width never means more
     visible information: it buys spatial relationship and hierarchy.
     ========================================================================= */
  --nx-bp-compact:480px;
  --nx-bp-medium:768px;
  --nx-bp-wide:1024px;
  --nx-bp-full:1280px;

  /* =========================================================================
     9. MAP / ROUTE
     Cartography is structural, never decorative: no tiles, no terrain, no
     GIS overload. A leg that has not happened is dashed; a leg that has is
     solid and verified. Position never substitutes for verified money, and
     a distance that was not reported is never drawn as if it were.
     ========================================================================= */
  --nx-geo-grid:var(--nx-rule);
  --nx-geo-leg-pending:var(--nx-text-3);
  --nx-geo-leg-done:var(--nx-verified);
  --nx-geo-leg-dash:4 6;
  --nx-geo-stop:var(--nx-text-2);
  --nx-geo-stop-now:var(--nx-teal);
  --nx-geo-stroke:2px;
}

/* ===========================================================================
   ICONOGRAPHY PRINCIPLES (no icon set is frozen; these rules are)
   - An icon never carries a state alone. State is glyph + shape + word.
   - Certainty glyphs are fixed and are part of the system, not decoration:
       verified   check,     square corner
       estimated  tilde,     round corner
       unknown    question,  dashed square corner
     Shape carries the state for a viewer who cannot separate the hues.
   - Authority is marked by a filled diamond. Nothing else uses it.
   - No illustrative, playful, animated or branded-mascot iconography.
   - Icons are drawn from currentColor so they inherit their semantic role.
   =========================================================================== */

/* ===========================================================================
   REDUCED MOTION - a system-level guarantee, not a per-component courtesy.
   =========================================================================== */
@media (prefers-reduced-motion:reduce){
  :root{--nx-motion-settle:0ms;--nx-motion-ui:0ms}
  *,*::before,*::after{
    animation-duration:0.01ms !important;
    animation-iteration-count:1 !important;
    transition-duration:0.01ms !important;
    scroll-behavior:auto !important;
  }
}

/* ===========================================================================
   FORCED COLOURS / HIGH CONTRAST - the system must survive the OS overriding
   its palette, because sunlight and accessibility modes are real operating
   conditions for a driver. Semantics that were carried by colour fall back to
   the glyph, the shape and the word, which are always present.
   =========================================================================== */
@media (forced-colors:active){
  :root{
    --nx-rule:CanvasText;--nx-rule-2:CanvasText;--nx-rule-strong:CanvasText;
    --nx-focus:Highlight;--nx-focus-on-auric:Highlight;
  }
}
