/* ============================================================
   FYRONYX · COLOR & MATERIAL SYSTEM
   Two families: Blue (12-step field scale) and Palladium (12-step warm
   silver neutral). Blue is NOT an accent — it is the environment, from
   daylight mist through cobalt to blue-black. Palladium = structure,
   rules, construction, labels; it never competes with the field.

   The blue family IS the environment: mist → steel → cobalt →
   imperial → blue-black. Anchor: --fynx-royal = #174B9B
   (illuminated cobalt). Deep surfaces are imperial #0A2E6F and
   blue-black #06152F; abyss #030712 is the deepest part of the
   blue field, never a neutral black.

   Palette discipline: a white scale (frost → gray) on the radial
   blue field, plus ONE accent — indigo-blue #3E63DD in both modes (text-safe
   tint #7B96F5 in the dark field). The pale steel blues (blue-6..8) are field tones for
   mist and lines only; never text, never an accent.
   ============================================================ */

:root {
  color-scheme: light;

  /* ── Blue scale — 12 steps, mist → blue-black ──────────────
     Anchor: step 9 = #174B9B (illuminated cobalt)
     1–2   Daylight surfaces
     3–5   Mist · radial wells
     6–8   Borders and rules
     9–10  Solid fills (main · hover)
     11–12 Text and deep surfaces                              */
  --fynx-blue-1:  #f3f6fa;   /* cool surface                     */
  --fynx-blue-2:  #e8eef7;   /* atmospheric field                */
  --fynx-blue-3:  #dae4f2;
  --fynx-blue-4:  #c9d6e8;   /* radial blue mist                 */
  --fynx-blue-5:  #b4c6df;
  --fynx-blue-6:  #9fb4d2;   /* particle steel                   */
  --fynx-blue-7:  #7c9ac8;
  --fynx-blue-8:  #4f79b5;
  --fynx-blue-9:  #174b9b;   /* Illuminated cobalt — main solid  */
  --fynx-blue-10: #0f3a85;   /* solid hover / pressed            */
  --fynx-blue-11: #0a2e6f;   /* Imperial field — deep surfaces   */
  --fynx-blue-12: #06152f;   /* Blue-black — deepest surface     */

  /* ── Palladium scale — 12-step warm silver neutral ─────────
     Palladium: the catalyst metal — enables without being consumed.
     1–2   Ivory paper, app ground
     3–5   Rule lines, subtle fills, platinum tones
     6–8   Component borders, construction marks
     9–10  Dark palladium — label ink, engraved text
     11–12 Near-black charcoal, deep shadow                   */
  --fynx-pd-1:  #faf9f7;
  --fynx-pd-2:  #f3f1ec;
  --fynx-pd-3:  #e8e5df;
  --fynx-pd-4:  #dddad3;
  --fynx-pd-5:  #d4d0c9;   /* Platinum — bright metal          */
  --fynx-pd-6:  #c7c3ba;
  --fynx-pd-7:  #b8b2a6;   /* Palladium — catalyst anchor      */
  --fynx-pd-8:  #a59e92;
  --fynx-pd-9:  #8d8579;
  --fynx-pd-10: #706961;   /* Label ink — engraved on ivory    */
  --fynx-pd-11: #4c4740;
  --fynx-pd-12: #272320;

  /* ── Named aliases ──────────────────────────────────────── */
  --fynx-royal:        var(--fynx-blue-9);   /* #174B9B — cobalt      */
  --fynx-royal-light:  var(--fynx-blue-6);   /* #9FB4D2 — steel       */
  --fynx-imperial:     var(--fynx-blue-11);  /* #0A2E6F — imperial    */
  --fynx-lacquer:      var(--fynx-blue-10);  /* #0F3A85 — hover/press */
  --fynx-night:        var(--fynx-blue-12);  /* #06152F — blue-black  */
  --fynx-abyss:        #030712;              /* deepest blue, not black */
  --fynx-steel:        #3e63dd;              /* THE accent (dark)     */
  --fynx-silver:       #d4dce8;              /* silver                */
  --fynx-frost:        #f4f7fb;              /* frost — dark-mode ink */
  --fynx-cover:        var(--fynx-blue-11);  /* covers / ceremony     */
  --fynx-ivory:        var(--fynx-pd-1);     /* #FAF9F7               */
  --fynx-ivory-bright: #fbfcfe;           /* light source — never pure white */
  --fynx-platinum:     var(--fynx-pd-5);     /* #D4D0C9               */
  --fynx-palladium:    var(--fynx-pd-7);     /* #B8B2A6               */

  /* ── Semantic surfaces — the daylight atmospheric field ──
     Never flat white: white is a light source and a content
     surface, not the page. See tokens/atmosphere.css.        */
  --fynx-paper:         #e2eaf5;
  --fynx-surface:       #f3f6fa;
  --fynx-surface-muted: #e8eef7;
  --fynx-exhibit:       #edf2f9;

  /* ── Semantic text ──────────────────────────────────────── */
  --fynx-ink:        #0a2048;
  --fynx-text-muted: #3a4f6d;
  --fynx-text-faint: #3c5170;

  /* ── Lines & accents ────────────────────────────────────── */
  --fynx-line:          rgb(21 60 122 / 0.14);
  --fynx-line-strong:   rgb(21 60 122 / 0.26);
  --fynx-accent:        #3e63dd;
  --fynx-accent-strong: #2f4fc4;
  --fynx-accent-soft:   rgb(62 99 221 / 0.10);
  --fynx-metal:         var(--fynx-palladium);
  --fynx-focus:         #3e63dd;

  /* ── Label ink ─────────────────────────────────────────── */
  --fynx-label-ink: #3a4f6d;

  /* ── Signal tones — used ONLY beside a text label, never alone ── */
  --fynx-signal-up:    #1f6f4a;   /* momentum rising / advance    */
  --fynx-signal-hold:  #8a5a12;   /* attention / stale / watch    */
  --fynx-signal-down:  #9a3434;   /* blocker / adverse / stop     */
}

/* ── Light override — the daylight atmospheric field ────────── */
:root[data-theme="light"] {
  color-scheme: light;
  --fynx-paper:         #e2eaf5;
  --fynx-surface:       #f3f6fa;
  --fynx-surface-muted: #e8eef7;
  --fynx-exhibit:       #edf2f9;
  --fynx-ink:           #0a2048;
  --fynx-text-muted:    #3a4f6d;
  --fynx-text-faint:    #3c5170;
  --fynx-line:          rgb(21 60 122 / 0.14);
  --fynx-line-strong:   rgb(21 60 122 / 0.26);
  --fynx-accent:        #3e63dd;
  --fynx-accent-strong: #2f4fc4;
  --fynx-accent-soft:   rgb(62 99 221 / 0.10);
  --fynx-metal:         var(--fynx-palladium);
  --fynx-focus:         #3e63dd;
  --fynx-label-ink:     #3a4f6d;
}

/* ── Dark mode — the primary expression: an imperial-blue field
   paper    #030712  abyss      — deepest part of the blue field
   surface  #06152f  blue-black — panels, cards
   muted    #0b2249  imperial-ish — elevated / nested
   ink      #f4f7fb  frost
   accent   #87a9e6  blue-steel light (≈8:1 on abyss)
   There is no neutral charcoal anywhere in this mode.        */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --fynx-paper:         #030712;
    --fynx-surface:       #06152f;
    --fynx-surface-muted: #0b2249;
    --fynx-exhibit:       #061a37;
    --fynx-ink:           #f4f7fb;
    --fynx-text-muted:    #c6cdd8;
    --fynx-text-faint:    #8e97a6;
    --fynx-line:          rgb(255 255 255 / 0.10);
    --fynx-line-strong:   rgb(255 255 255 / 0.22);
    --fynx-accent:        #3e63dd;
    --fynx-accent-strong: #7b96f5;
    --fynx-accent-soft:   rgb(62 99 221 / 0.18);
    --fynx-metal:         #9aa3b2;
    --fynx-focus:         #3e63dd;
    --fynx-label-ink:     #8e97a6;
    --fynx-signal-up:     #7fcaa0;
    --fynx-signal-hold:   #e0b36a;
    --fynx-signal-down:   #e08a8a;
  }
}

/* ── Explicit dark override ─────────────────────────────────── */
:root[data-theme="dark"] {
  color-scheme: dark;
  --fynx-paper:         #030712;
  --fynx-surface:       #06152f;
  --fynx-surface-muted: #0b2249;
  --fynx-exhibit:       #061a37;
  --fynx-ink:           #f4f7fb;
  --fynx-text-muted:    #c6cdd8;
  --fynx-text-faint:    #8e97a6;
  --fynx-line:          rgb(255 255 255 / 0.10);
  --fynx-line-strong:   rgb(255 255 255 / 0.22);
  --fynx-accent:        #3e63dd;
  --fynx-accent-strong: #7b96f5;
  --fynx-accent-soft:   rgb(62 99 221 / 0.18);
  --fynx-metal:         #9aa3b2;
  --fynx-focus:         #3e63dd;
  --fynx-label-ink:     #8e97a6;
  --fynx-signal-up:     #7fcaa0;
  --fynx-signal-hold:   #e0b36a;
  --fynx-signal-down:   #e08a8a;
}
