/* ============================================================
   Neutron design tokens
   Loaded BEFORE style.css in base.html.

   Origin: docs/design-research/2026-09-10-product-listing/tokens.css
   Spec:   docs/superpowers/specs/2026-09-10-neutron-storefront-rethink-design.md

   What changed in this pass (PR #33 polish):
   - Navy and gold are now sampled from the brand wordmark artwork instead of
     being guessed, so chrome and logo can no longer drift apart.
   - Three WCAG failures in the old style.css :root are fixed (see contrast
     table at the foot of this file).
   - The sky-blue family (--surface #dff0ff, --sky-*, --action-blue*,
     --header-bg, --orbit-blue) is retired. It was the second palette that made
     the storefront read as two half-finished designs at once.
   The --n- prefix avoids clashes with Bootstrap's --bs-*.
   ============================================================ */

:root {
  /* Every token below is a light-design value. Declaring the scheme here as
     well as in base.html covers the stylesheet being applied where the meta tag
     is not consulted, and it is the CSS half of the same statement: this design
     is light by choice, so do not synthesise a dark one from it.

     When a real dark theme exists this becomes `light dark` and a dark token
     set sits behind prefers-color-scheme. Not yet: style.css still carries
     literal #fff surfaces and white rgba() values that would have to become
     semantic tokens first. */
  color-scheme: only light;

  /* ---------- Brand ----------
     Sampled from static/images/brand/*.png: the navy artwork's field is
     #05112d and the light artwork's ink is #081838; the bolt and ".bg" are
     #f8c000. The old --navy #1a1a2e was a desaturated purple-navy that did not
     match either, which is why the logo sat in a visible darker rectangle. */
  --n-navy:          #0a1a3a; /* brand ink; 17.19:1 on white */
  --n-navy-deep:     #06122a; /* top bar + footer field; matches the wordmark's own ground */
  --n-navy-soft:     #16264c; /* hover/divider on navy chrome */
  --n-navy-line:     #23355e; /* hairline on navy */

  /* Gold is a two-stop ramp, not one value. Large fills on light surfaces want
     the calmer stop; small marks on navy want the brighter one. Both descend
     from the wordmark's #f8c000. */
  --n-gold:          #e0a92e; /* primary CTA fill; navy text on it = 8.09:1 */
  --n-gold-bright:   #f5be2e; /* accents ON NAVY only (badges, bolt, search btn) */
  --n-gold-hover:    #c98f22;
  --n-gold-ink:      #7a5c12; /* gold-FAMILY TEXT on light; 6.24:1. Gold itself is 2.1:1 = fail */
  --n-on-gold:       #0a1a3a;

  /* ---------- Neutrals ---------- */
  --n-canvas:        #f6f8fb; /* page ground: cool neutral, one flat value, no gradient stack */
  --n-surface:       #ffffff;
  --n-surface-alt:   #eef2f7; /* chips, image wells, hover fill */
  --n-ink:           #0f1b33; /* headings */
  --n-ink-body:      #2f3642; /* body copy; 11.8:1 on white */
  --n-ink-muted:     #5c6370; /* meta/SKU; 6.05:1. Replaces #8892a0 (3.15:1 FAIL) */
  --n-on-dark:       #f2f5fa; /* text on navy bands */
  --n-on-dark-muted: #a9b6cd; /* secondary text on navy; 7.4:1 on --n-navy */
  --n-hairline:      #e3e8ef; /* decorative rules only */
  --n-border:        #d7dee8; /* real card/panel boundaries */
  --n-control-border:#8a91a0; /* inputs need 3:1 per WCAG 1.4.11; 3.07:1 */
  --n-focus:         #0a1a3a; /* focus ring; gold would fail 3:1 */

  /* ---------- Status ---------- */
  --n-stock-in:      #1d7a45; /* 5.35:1. Replaces #4ecca3 (2.00:1 FAIL) */
  --n-stock-in-bg:   #e7f4ec;
  --n-stock-out:     #6b6f76;
  --n-stock-out-bg:  #f0f1f3;
  --n-danger:        #b3261e;
  --n-danger-bg:     #fdecea;

  /* ---------- Type ---------- */
  --n-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  --n-text-xs:   0.75rem;   /* 12px meta */
  --n-text-sm:   0.875rem;  /* 14px tile name, facets */
  --n-text-md:   1rem;      /* 16px body */
  --n-text-lg:   1.125rem;  /* 18px tile price */
  --n-text-xl:   1.375rem;  /* 22px section heading */
  --n-text-2xl:  1.75rem;   /* 28px page h1 */
  --n-text-3xl:  2.75rem;   /* 44px hero only */
  --n-leading-tight: 1.2;
  --n-leading-body:  1.6;
  --n-tracking-caps: 0.08em;

  /* ---------- Space (4/8 scale, spec §5.1 #5) ---------- */
  --n-space-1: 4px;  --n-space-2: 8px;  --n-space-3: 12px; --n-space-4: 16px;
  --n-space-5: 24px; --n-space-6: 32px; --n-space-7: 48px; --n-space-8: 64px;
  --n-space-9: 88px;

  /* ---------- Radius ----------
     Spec §5.2 asks for 0-4px. The owner-supplied reference board uses softly
     rounded cards, and re-endorsed it on 2026-09-16, so surfaces sit at 8px
     here. Recorded as a deliberate deviation rather than a drift. */
  --n-radius-sm:   4px;   /* inputs, chips, badges */
  --n-radius-md:   8px;   /* cards, buttons, tiles */
  --n-radius-lg:   14px;  /* hero panel, mega-menu, drawers */
  --n-radius-pill: 999px;

  /* ---------- Elevation ----------
     Hairline first, shadow as a whisper. Spec §5.1 #2: bands separate by
     background shift, not by floating cards. */
  --n-shadow-none: none;
  --n-shadow-sm:   0 1px 2px rgba(10, 26, 58, 0.05);
  --n-shadow-card: 0 1px 2px rgba(10, 26, 58, 0.04), 0 4px 14px rgba(10, 26, 58, 0.05);
  --n-shadow-lift: 0 2px 6px rgba(10, 26, 58, 0.07), 0 12px 28px rgba(10, 26, 58, 0.09);
  --n-shadow-overlay: 0 16px 44px rgba(6, 18, 42, 0.18);
  --n-shadow-header:  0 1px 0 rgba(10, 26, 58, 0.06);

  /* ---------- Layout ---------- */
  --n-content-max: 1320px;
  --n-gutter:      var(--n-space-4);
  --n-gutter-lg:   var(--n-space-5);
  --n-tap-min:     44px;
  --n-header-h:    64px;
  --n-transition:  160ms ease;
}

/* ============================================================
   Legacy variable bridge.

   style.css is ~2.6k lines written against the old names. Re-pointing them
   here re-skins every existing rule in one place, so the palette cannot be
   half-migrated. New rules should use --n-* directly.

   Retired values are mapped, never left dangling:
     --surface #dff0ff, --sky-top/mid/deep, --action-blue*, --header-bg,
     --header-line, --orbit-blue  ->  neutral/navy equivalents.
   ============================================================ */
:root {
  --primary:           var(--n-navy);
  --primary-dark:      var(--n-navy-deep);
  --accent:            var(--n-gold);
  --accent-hover:      var(--n-gold-hover);

  --navy:              var(--n-navy);
  --gold:              var(--n-gold);
  --gold-bright:       var(--n-gold-bright);
  --gold-hover:        var(--n-gold-hover);
  --yellow:            var(--n-gold-bright);
  --line:              var(--n-border);
  --card-shadow:       var(--n-shadow-card);

  --surface:           var(--n-surface-alt);   /* was #dff0ff sky tint */
  --text-light:        var(--n-on-dark);
  --text-dark:         var(--n-ink-body);
  --muted:             var(--n-ink-muted);     /* value changed: 3.15:1 -> 6.05:1 */
  --success:           var(--n-stock-in);      /* value changed: 2.00:1 -> 5.35:1 */
  --bg-light:          var(--n-canvas);

  --sky-top:           var(--n-canvas);        /* gradient stack retired */
  --sky-mid:           var(--n-canvas);
  --sky-deep:          var(--n-surface-alt);

  --action-blue:       var(--n-navy);          /* secondary actions become ink; primary is gold */
  --action-blue-hover: var(--n-navy-soft);
  --action-blue-soft:  var(--n-surface-alt);

  --header-bg:         var(--n-surface);
  --header-line:       var(--n-hairline);
  --graphite:          var(--n-navy-deep);
  --orbit-blue:        var(--n-gold-bright);   /* only remaining use is brand sparkle */
}

/* ============================================================
   Contrast (WCAG 2.x), recomputed 2026-09-16 for the values above.

   PASS 17.19  --n-navy on white            PASS 16.18  --n-navy on canvas
   PASS 11.80  --n-ink-body on white        PASS  6.05  --n-ink-muted on white
   PASS 17.19  white on --n-navy            PASS  7.40  --n-on-dark-muted on --n-navy
   PASS  8.09  --n-on-gold on --n-gold      PASS 10.08  --n-gold-bright on --n-navy
   PASS  6.24  --n-gold-ink on white        PASS  5.35  --n-stock-in on white
   UI   3.07  --n-control-border on white   (WCAG 1.4.11 needs 3:1)

   Fixed in this pass:
   FAIL 3.15 -> PASS 6.05   meta text  (#8892a0 -> #5c6370)
   FAIL 2.00 -> PASS 5.35   stock badge (#4ecca3 -> #1d7a45)
   FAIL 2.29 -> PASS 6.24   gold text on light (gold -> --n-gold-ink)
   ============================================================ */
