/* Maxum Mart design tokens: direction "Trade Counter" (docs/design/DESIGN_DIRECTION.md).
   STATUS: LINKED sitewide since 2026-11-05 (Lane B Step 0), right after style.css; the duplicate :root blocks were removed from home.css and glass.css.

   HOW IT IS BUILT
   - Every token that already exists in style.css / home.css / glass.css is repeated here with the SAME NAME and the SAME VALUE
     ("existing"), so linking this file changes nothing visible. It becomes the single source of truth; Lane B then deletes the
     duplicate :root blocks from home.css section 1 and glass.css (the Appearance admin overrides, which set --mm-brand-rgb,
     --mm-accent-rgb, --mm-accent-dark-rgb and the colours inline in <head>, keep winning because they are printed after the CSS links).
   - Tokens marked "new" are additive. No live class is renamed. Raw colour values appear ONLY in this file from now on.
   - Link order when linked: style.css, tokens.css, home.css, glass.css, (page css). tokens.css must come before home.css so that
     home.css rules can read the tokens; the duplicate :root blocks are removed in the same change so order cannot matter.
   - Dark band: add class "mm-dark" to a section; it re-points the colour tokens below (nothing else changes inside the section).
   - Product photos are never styled through these tokens except --mm-stage (the neutral stage BEHIND a contained photo). */

:root {
  /* ------------------------------------------------------------ 1. COLOUR: brand and ink (existing) */
  --mm-teal: #0DC0DF;            /* brand cyan: fills, rings, decoration. Text on it is ALWAYS --mm-ink (8.8:1). Never white on it (2.2:1). */
  --mm-teal-ink: #067a8f;        /* cyan for small text, links, icons on white (5.0:1) */
  --mm-teal-deep: #055a6b;       /* hover / pressed (7.8:1) */
  --mm-teal-tint: #effbfd;       /* soft cyan surface */
  --mm-teal-line: #cdeef5;       /* cyan hairline */
  --mm-ink: #0a0f12;             /* headings, body (19.3:1) */
  --mm-ink-2: #26323a;           /* secondary ink (13.1:1) */
  --mm-muted: #55626a;           /* secondary text (6.3:1 on white, 5.9:1 on surface) */
  --mm-line: #e3e9ec;            /* decorative hairline */
  --mm-surface: #f5f8f9;         /* soft grey section */
  --mm-white: #fff;
  --mm-control-line: #7b8a91;    /* border of any control (3.6:1, WCAG 1.4.11) */
  --mm-danger: #b3261e;          /* 6.5:1 on white */

  /* ------------------------------------------------------------ 1b. COLOUR: new */
  --mm-teal-ink-2: #0a6a7e;      /* new: link text on tint surfaces (6.2:1 on white, 5.9:1 on --mm-teal-tint) */
  --mm-teal-50: #effbfd;         /* new: cyan scale for backgrounds/meshes (50 = --mm-teal-tint) */
  --mm-teal-100: #d6f4fa;
  --mm-teal-200: #a9e8f4;
  --mm-teal-300: #6fd8ec;
  --mm-teal-400: #3accE6;        /* between 300 and brand */
  --mm-teal-500: #0DC0DF;        /* = --mm-teal */
  --mm-teal-600: #0aa9c5;        /* = --mm-brand-hover (ink text 6.9:1) */
  --mm-teal-700: #067a8f;        /* = --mm-teal-ink */
  --mm-teal-800: #055a6b;        /* = --mm-teal-deep */
  --mm-teal-900: #033d49;
  --mm-stage: #f3f6f7;           /* neutral stage behind a CONTAINED product photo (never visible on 1:1 photos, shows on odd ratios) */
  --mm-stage-line: #e3e9ec;
  --mm-line-strong: #cbd8dd;     /* decoration only, never a control border */
  /* status colours: pairs are text-on-background and pass AA (existing in home.css, repeated) */
  --mm-wa: #167a42;  --mm-wa-deep: #0f5f33;
  --mm-ok-bg: #e8f6ec;   --mm-ok-ink: #14532d;      /* 8.2:1 */
  --mm-warn-bg: #fff4e0; --mm-warn-ink: #8a4b08;    /* 6.2:1 */
  --mm-bad-bg: #fdeceb;  --mm-bad-line: #f1b9b4; --mm-bad-ink: #8c1d16;
  --mm-field-line: #7b8a91;
  --mm-scrim: rgb(10 15 18 / .5);   /* new: backdrop behind drawers / modals */

  /* brand fills used by glass.css (existing, repeated) */
  --mm-brand: #0DC0DF;
  --mm-on-brand: #0a0f12;
  --mm-brand-hover: #0aa9c5;
  --mm-brand-deep: #067a8f;
  --mm-brand-rgb: 13 192 223;           /* the Appearance admin group overrides these three together with the colours */
  --mm-accent-rgb: 6 122 143;
  --mm-accent-dark-rgb: 5 90 107;
  --mm-brand-glow: rgb(var(--mm-brand-rgb) / .30);

  /* dark band (new): used under .mm-dark, never as the page background */
  --mm-dark-bg: #0a0f12;
  --mm-dark-bg-2: #0f171b;       /* raised panel on a dark band */
  --mm-dark-line: rgb(255 255 255 / .12);
  --mm-dark-text: #fff;          /* 19.3:1 on --mm-dark-bg */
  --mm-dark-muted: #a9bcc4;      /* 9.8:1 on --mm-dark-bg, 8.9:1 on --mm-dark-bg-2 */
  --mm-dark-accent: #0DC0DF;     /* cyan text/icons on dark: 8.8:1 on --mm-dark-bg, 8.3:1 on --mm-dark-bg-2 */

  /* legacy aliases for the older stylesheets (existing in home.css, repeated) */
  --color-text: #000;
  --color-bg: #fff;
  --color-muted: var(--mm-muted);
  --color-border: var(--mm-line);
  --color-accent: var(--mm-teal-ink);
  --color-accent-button: var(--mm-teal-ink);
  --color-accent-light: var(--mm-teal);
  --color-accent-text: #fff;
  --color-dark: #000;
  --color-sale: #d64545;
  --color-success: #1e7e34;
  --max-width: var(--wrap);

  /* ------------------------------------------------------------ 2. TYPE (self-hosted Inter + Manrope, see header.php @font-face) */
  --font-heading: 'Manrope', 'Manrope Fallback', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;   /* existing */
  --font-body: 'Inter', 'Inter Fallback', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;           /* existing */
  /* existing scale */
  --fs-xs: 0.75rem;   /* 12 */
  --fs-sm: 0.875rem;  /* 14 */
  --fs-md: 1rem;      /* 16 */
  --fs-lg: 1.125rem;  /* 18 */
  --fs-xl: 1.375rem;  /* 22 */
  --fs-2xl: clamp(1.5rem, 1.25rem + 1.2vw, 2rem);      /* 24 -> 32: section titles (h2) */
  --fs-3xl: clamp(1.85rem, 1.3rem + 2.6vw, 3.1rem);    /* 30 -> 50: page titles (h1 on listing/product) */
  --lh-tight: 1.2;
  --lh-base: 1.55;
  /* new */
  --fs-display: clamp(2.25rem, 1.45rem + 2.6vw, 3.5rem);    /* 36 -> 56: hero H1 only (36 at 390, 56 at 1440) */
  --fs-h3: clamp(1.125rem, 1.05rem + .4vw, 1.375rem);       /* 18 -> 22: card group / step titles */
  --fs-eyebrow: 0.75rem;
  --fs-card-title: 0.9375rem;                               /* 15: product-card title everywhere (today 14 on lists, 16 on home picks) */
  --fs-price: 1.125rem;                                     /* card price (18), PDP price uses --fs-2xl */
  --lh-display: 1.04;
  --lh-snug: 1.35;
  --ls-display: -0.03em;
  --ls-tight: -0.02em;
  --ls-eyebrow: 0.12em;
  --fw-regular: 400; --fw-medium: 500; --fw-semibold: 600; --fw-bold: 700;   /* Inter ships 400-600, Manrope 600-700; 800 only after the font file is re-exported (owner decision, optional) */

  /* ------------------------------------------------------------ 3. SPACING (existing 4-based scale + new steps) */
  --sp-1: 0.25rem;  /* 4 */
  --sp-2: 0.5rem;   /* 8 */
  --sp-3: 0.75rem;  /* 12 */
  --sp-4: 1rem;     /* 16 */
  --sp-5: 1.5rem;   /* 24 */
  --sp-6: 2rem;     /* 32 */
  --sp-7: 3rem;     /* 48 */
  --sp-8: 4.5rem;   /* 72 */
  --sp-9: 6rem;     /* 96: new, desktop section rhythm */
  --hm-sec: 40px;   /* section padding: existing; 56 from 768, 72 from 1100 (media queries below) */
  --hm-gap: 20px;
  --wrap: 1240px;   /* existing content width */
  --wrap-narrow: 760px;   /* new: text pages, FAQ */
  --gutter: 16px;   /* 24 from 860 */
  --tabbar-h: 62px;
  --header-h: 61px; /* new: measured mobile header height (61 mobile, 128 desktop incl. nav row); used for sticky offsets and scroll-margin */

  /* ------------------------------------------------------------ 4. RADIUS */
  --r-sm: 8px;      /* existing: inputs inside cards, thumbs, small chips */
  --r-md: 14px;     /* existing: cards, panels */
  --r-lg: 22px;     /* existing: large panels, hero showcase */
  --r-pill: 999px;  /* existing: buttons, chips, search */
  --r-xs: 4px;      /* new: tags/badges that are not pills, focus ring corners */
  --r-xl: 28px;     /* new: hero wall, dark band container */
  --r-media: var(--r-md);   /* new alias: photo stages and collection tiles use ONE radius */

  /* ------------------------------------------------------------ 5. ELEVATION */
  --sh-1: 0 1px 2px rgba(10, 15, 18, 0.05), 0 2px 8px rgba(10, 15, 18, 0.04);   /* existing: resting card */
  --sh-2: 0 8px 28px rgba(10, 15, 18, 0.09);                                    /* existing: hover card, dropdown */
  --sh-3: 0 20px 56px rgba(10, 15, 18, 0.18);                                   /* existing: drawer, modal */
  --sh-cyan: 0 10px 30px -12px rgb(var(--mm-accent-rgb) / .45);                 /* new: primary card hover tint */
  --sh-inset: inset 0 0 0 1px var(--mm-line);                                   /* new: border drawn as shadow (no layout shift on hover) */
  /* glass button shadows (existing in glass.css, repeated) */
  --glass-blur: 10px;
  --glass-sat: 1.6;
  --glass-hi: inset 0 1px 0 rgba(255, 255, 255, .72), inset 0 -1px 0 rgb(var(--mm-accent-dark-rgb) / .14);
  --glass-sh: 0 1px 2px rgba(10, 15, 18, .10), 0 8px 18px -8px rgb(var(--mm-accent-rgb) / .42);
  --glass-sh-up: 0 1px 2px rgba(10, 15, 18, .10), 0 14px 26px -10px rgb(var(--mm-accent-rgb) / .58);
  --glass-sh-soft: 0 1px 2px rgba(10, 15, 18, .06), 0 6px 14px -8px rgb(var(--mm-accent-rgb) / .30);
  /* gloss alpha lowered .46 -> .30 on 2026-11-05 (design v5, B1); the inner highlight --glass-hi is kept */
  --glass-gloss: linear-gradient(180deg, rgba(255, 255, 255, .16) 0, rgba(255, 255, 255, 0) 60%);   /* v6 (2026-11-06): was .30/.10 glass sheen; flatter = bolder */
  --glass-gloss-soft: linear-gradient(180deg, rgba(255, 255, 255, .85) 0, rgba(255, 255, 255, .25) 100%);
  --glass-gloss-dark: linear-gradient(180deg, rgba(255, 255, 255, .20) 0, rgba(255, 255, 255, .04) 48%, rgba(255, 255, 255, 0) 52%, rgba(0, 0, 0, .18) 100%);

  /* ------------------------------------------------------------ 6. BORDERS */
  --bw: 1px;
  --bw-strong: 2px;                                 /* new: focus ring, selected state */
  --border: var(--bw) solid var(--mm-line);         /* new: default decorative border */
  --border-control: var(--bw) solid var(--mm-control-line);   /* new: any input/button outline */
  --ring: 0 0 0 3px var(--mm-brand-glow), 0 0 0 1px var(--mm-teal-ink);   /* new: focus-visible ring on light */
  --ring-dark: 0 0 0 3px rgb(var(--mm-brand-rgb) / .55);                  /* new: focus-visible ring on dark band */

  /* ------------------------------------------------------------ 7. BACKGROUND TREATMENTS (CSS only, no files) */
  --mm-grid: rgb(var(--mm-accent-rgb) / .055);      /* existing: grid line colour */
  --mm-dot: rgb(var(--mm-accent-rgb) / .13);        /* existing */
  --bg-grid-size: 56px;                              /* new */
  --bg-grid: linear-gradient(var(--mm-grid) 1px, transparent 1px) 0 0 / var(--bg-grid-size) var(--bg-grid-size),
             linear-gradient(90deg, var(--mm-grid) 1px, transparent 1px) 0 0 / var(--bg-grid-size) var(--bg-grid-size);   /* new: use with the `background:` shorthand, not background-image */
  --bg-mesh: radial-gradient(60% 55% at 12% 0%, rgb(var(--mm-brand-rgb) / .20) 0, transparent 70%),
             radial-gradient(50% 50% at 92% 30%, rgb(var(--mm-brand-rgb) / .12) 0, transparent 70%),
             linear-gradient(180deg, var(--mm-teal-50) 0%, #fff 100%);                                                    /* new: light hero / page-head mesh */
  --bg-mesh-dark: radial-gradient(55% 70% at 85% 0%, rgb(var(--mm-brand-rgb) / .22) 0, transparent 70%),
                  radial-gradient(40% 50% at 0% 100%, rgb(var(--mm-brand-rgb) / .10) 0, transparent 70%),
                  var(--mm-dark-bg);                                                                                    /* new: dark band */
  /* noise: 160px inline SVG turbulence at 4% (about 350 bytes, no request); apply with background-image on a ::before, opacity .04-.06 */
  --bg-noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");

  /* ------------------------------------------------------------ 8. MOTION */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);           /* existing (= --mm-ease-out): entrances, hovers */
  --mm-ease-out: cubic-bezier(.2, .7, .2, 1);       /* existing alias */
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);    /* new: drawers, accordions */
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);  /* new: toast + badge pop ONLY */
  --dur-1: 120ms;   /* new: colour/border/opacity feedback */
  --dur-2: 200ms;   /* new: hover lift, button, chip */
  --dur-3: 320ms;   /* new: drawer, modal, accordion, menu */
  --dur-4: 520ms;   /* new: section reveal (once) */
  --reveal-y: 16px;       /* new: reveal travel */
  --reveal-stagger: 60ms; /* new: per item, max 6 items then flat */

  /* ------------------------------------------------------------ 9. LAYERS */
  --z-header: 50;   /* existing value of .site-header / .mm-header */
  --z-scrim: 70;    /* new */
  --z-drawer: 75;
  --z-modal: 80;
  --z-toast: 90;    /* existing value of .mm-toast */

  /* ------------------------------------------------------------ 10. IMAGE SYSTEM (docs/design/IMAGE_STYLE_GUIDE.md) */
  --ar-product: 1 / 1;            /* product card, hero wall tile, gallery main, cart/checkout thumbs */
  --ar-collection: 4 / 5;         /* collection cover tile (all breakpoints) */
  --ar-banner: 8 / 3;             /* wide promo banner >= 768 */
  --ar-banner-m: 4 / 5;           /* promo banner < 768 */
  --ar-promo: 3 / 2;              /* half-width promo tile */
  --ar-og: 1200 / 630;            /* share image */
  --ar-blog: 16 / 9;              /* blog cover (none today) */

  /* ------------------------------------------------------------ 11. V6 "bold" additions (2026-11-06, docs/design/V6_CRITIQUE.md) */
  --mm-sun: #ffc93c;              /* v6: offer highlight (Save N %, deals chip). ONLY text on it is --mm-ink (12.6:1); never used for text itself */
  --mm-sun-deep: #e0a800;         /* v6: pressed / border of --mm-sun */
  --mm-star: #b86e00;             /* v6: review stars on white (4.1:1; decorative, the number is next to it) */
  --mm-sun-bg: #fff6d6;           /* v6: soft sun surface (offer tag on white) with --mm-ink text */
  --bg-hero: linear-gradient(135deg, #0DC0DF 0%, #36cde8 48%, #8fe3f2 100%);   /* v6: hero + bulk panel; ink text only (min 8.8:1) */
  --bg-hero-glow: radial-gradient(50% 60% at 85% 10%, rgb(255 255 255 / .38) 0, transparent 70%), radial-gradient(40% 50% at 5% 100%, rgb(5 90 107 / .16) 0, transparent 70%);
  --bg-grid-white: linear-gradient(rgb(255 255 255 / .22) 1px, transparent 1px) 0 0 / 48px 48px, linear-gradient(90deg, rgb(255 255 255 / .22) 1px, transparent 1px) 0 0 / 48px 48px;
  --fs-sec: clamp(1.75rem, 1.4rem + 1.5vw, 2.5rem);   /* v6: home section headings 28 -> 40 */
  --r-2xl: 32px;                  /* v6: hero panel / big panels */
}

/* section rhythm: --sp-section is the vertical padding of a home section (40 / 56 / 72 / 96); --hm-sec / --hm-gap are the existing names */
:root { --sp-section: 40px; }
@media (min-width: 768px) { :root { --hm-sec: 56px; --hm-gap: 28px; --sp-section: 56px; } }
@media (min-width: 860px) { :root { --gutter: 24px; } }
@media (min-width: 1100px) { :root { --hm-sec: 72px; --sp-section: 72px; } }
@media (min-width: 1440px) { :root { --sp-section: 96px; } }
@media (max-width: 767px) { :root { --glass-blur: 6px; } }   /* existing: smaller blur on phones */

/* ------------------------------------------------------------ 11. DARK BAND: re-points the colour tokens inside one section */
.mm-dark {
  --mm-ink: var(--mm-dark-text);
  --mm-ink-2: var(--mm-dark-text);
  --mm-muted: var(--mm-dark-muted);
  --mm-line: var(--mm-dark-line);
  --mm-surface: var(--mm-dark-bg-2);
  --mm-teal-ink: var(--mm-dark-accent);
  --mm-control-line: rgb(255 255 255 / .42);   /* 3:1+ on dark */
  --ring: var(--ring-dark);
  color: var(--mm-dark-text);
  background: var(--bg-mesh-dark);
}

/* ------------------------------------------------------------ 12. REDUCED MOTION: tokens collapse so any rule built on them goes quiet */
@media (prefers-reduced-motion: reduce) {
  :root { --dur-1: 0.01ms; --dur-2: 0.01ms; --dur-3: 0.01ms; --dur-4: 0.01ms; --reveal-y: 0px; --reveal-stagger: 0ms; }
}
