/* ============================================================================
   Vintage Mio — DESIGN TOKENS (single source of truth)
   Dark-first. Deep charcoal / near-black field + gold/amber accent.
   Every colour, size, space, radius, shadow, z-index and motion value the
   storefront AND admin use is declared here. Nothing hard-codes a hex elsewhere.
   ========================================================================== */
:root {
  color-scheme: dark;

  /* ---- Brand: charcoal / ink ramp (tinted neutral toward warm ink) -------- */
  --ink-950: #0a0a0c;   /* deepest field                       */
  --ink-900: #0d0d0f;   /* app background (brand)              */
  --ink-850: #121216;
  --ink-800: #17171b;   /* elevated surface 1 (cards)          */
  --ink-750: #1d1d22;   /* elevated surface 2 (raised)         */
  --ink-700: #26262c;   /* elevated surface 3 / hairline wash  */
  --ink-600: #34343c;   /* borders on dark                     */
  --ink-500: #4a4a54;
  --ink-400: #6b6b76;   /* disabled ink / faint                */
  --ink-300: #9a9aa6;   /* muted text (>=4.5:1 on ink-900)     */
  --ink-200: #c3c3cc;   /* secondary text                      */
  --ink-100: #e6e6ea;   /* primary text                        */
  --ink-050: #f4f4f6;   /* brightest text / on-gold-inverse    */

  /* ---- Brand: gold / amber ramp ------------------------------------------- */
  --gold-050: #fbf3dd;
  --gold-100: #f6e6bb;
  --gold-200: #eecf85;
  --gold-300: #e6be5c;
  --gold-400: #d9ab42;
  --gold-500: #d4a13a;  /* accent (primary)                    */
  --gold-600: #b6862a;
  --gold-700: #92691f;
  --gold-800: #6d4e17;
  --gold-900: #47320e;

  /* ---- Semantic role tokens ---------------------------------------------- */
  --bg:            var(--ink-900);
  --bg-inset:      var(--ink-950);
  --surface-1:     var(--ink-800);   /* card                     */
  --surface-2:     var(--ink-750);   /* raised / popover         */
  --surface-3:     var(--ink-700);   /* header on scroll / modal */
  --border:        var(--ink-700);
  --border-strong: var(--ink-600);
  --hairline:      color-mix(in srgb, var(--ink-050) 7%, transparent);

  --text:          var(--ink-100);
  --text-secondary:var(--ink-200);
  --text-muted:    var(--ink-300);
  --text-faint:    var(--ink-400);

  --accent:        var(--gold-500);
  --accent-hover:  var(--gold-400);
  --accent-press:  var(--gold-600);
  --accent-weak:   color-mix(in srgb, var(--gold-500) 16%, transparent);
  --accent-wash:   color-mix(in srgb, var(--gold-500) 8%, transparent);
  --on-accent:     var(--ink-950);   /* dark ink on gold (>=4.5:1) */
  --focus-ring:    var(--gold-300);

  /* Semantic status (own small set — NOT the gold accent) */
  --success:   #4caf7d;  --success-wash: color-mix(in srgb,#4caf7d 15%,transparent);
  --warning:   #d9a441;  --warning-wash: color-mix(in srgb,#d9a441 15%,transparent);
  --danger:    #e0625f;  --danger-wash:  color-mix(in srgb,#e0625f 15%,transparent);
  --info:      #5b9dd9;  --info-wash:    color-mix(in srgb,#5b9dd9 15%,transparent);
  --sale-red:  #C8102E;  /* the On Sale banner: Armando asked for red, 2026-09-25 — not --danger */

  /* Goldmine condition-grade colour keys (used by .grade badges) */
  --grade-m:   #63d29b;  /* Mint            */
  --grade-nm:  #4caf7d;  /* Near Mint       */
  --grade-vgp: #8fc866;  /* VG+             */
  --grade-vg:  #d9c34a;  /* VG              */
  --grade-gp:  #d9a441;  /* G+              */
  --grade-g:   #d98341;  /* G               */
  --grade-f:   #d9623f;  /* Fair            */
  --grade-p:   #b0545a;  /* Poor            */

  /* ---- Typography --------------------------------------------------------- */
  /* Display: characterful serif for headers; Text: legible sans for UI.
     Both fall back to robust system stacks (no-build, no web-font blocking). */
  --font-display: "Playfair Display", "Georgia", "Times New Roman", serif;
  --font-text: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* Fixed rem scale (1.2 ratio), body 16px */
  --fs-xs:   0.75rem;   /* 12 — micro labels        */
  --fs-sm:   0.875rem;  /* 14 — meta / captions     */
  --fs-base: 1rem;      /* 16 — body                */
  --fs-md:   1.125rem;  /* 18                       */
  --fs-lg:   1.375rem;  /* 22 — card titles         */
  --fs-xl:   1.75rem;   /* 28 — section headings    */
  --fs-2xl:  2.25rem;   /* 36 — page titles         */
  --fs-3xl:  3rem;      /* 48 — hero                */

  --lh-tight: 1.15;
  --lh-heading: 1.2;
  --lh-body: 1.6;

  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-display: 800;
  --tracking-caps: 0.09em;

  /* ---- Spacing — 8pt scale (with 4pt half-step) --------------------------- */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px; --sp-9: 96px;

  /* ---- Radii -------------------------------------------------------------- */
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-pill: 999px;

  /* ---- Elevation (dark mode = lighter surface + restrained shadow) -------- */
  --shadow-1: 0 1px 2px rgba(0,0,0,.4);
  --shadow-2: 0 6px 20px rgba(0,0,0,.45);
  --shadow-3: 0 18px 48px rgba(0,0,0,.55);
  --shadow-focus: 0 0 0 3px color-mix(in srgb, var(--gold-300) 55%, transparent);

  /* ---- Layout ------------------------------------------------------------- */
  --container: 1200px;
  --header-h: 64px;

  /* ---- Z-index (semantic scale, never 9999) ------------------------------- */
  /* ⚑ Ascending, and the backdrop MUST stay below the drawer. These were the
     other way round: the scrim (300) covered the drawer (200) it exists to sit
     behind, so every tap on a menu link hit the backdrop instead — and the
     backdrop's handler is closeDrawer, so the menu shut and nothing navigated.
     On a phone the drawer IS the navigation, so the whole site was unreachable.
     Invisible in code review and in any test that clicks via JS, because
     element.click() skips hit-testing; only a real tap goes through the scrim. */
  --z-base: 0; --z-sticky: 100; --z-backdrop: 200; --z-drawer: 300;
  --z-modal: 400; --z-toast: 500; --z-tooltip: 600;

  /* ---- Motion ------------------------------------------------------------- */
  --ease: cubic-bezier(0.25, 1, 0.5, 1);
  --dur-fast: 120ms;
  --dur: 200ms;
  --dur-slow: 320ms;
}

@media (prefers-reduced-motion: reduce) {
  :root { --dur-fast: 0ms; --dur: 0ms; --dur-slow: 0ms; }
}
