/* ==========================================================================
   MMA Reskin 2026 — design tokens
   github.com/vivwebsolutions/mma, branch reskin2026. Tracking: issue #1225
   (WS-B Phase 0). Loaded between css/global.css and css/reskin-2026.css.

   Tier 1: primitives (the ONLY place a literal color/size is written)
   Tier 2: semantics  (what the rest of the CSS is allowed to reference)

   Phase 0 rule: this file introduces NAMES, never new VALUES. Any legacy
   declaration whose value has no exact token keeps its literal until the
   Phase 2 spacing/type reset deliberately rounds it.
   ========================================================================== */

:root {

	/* ---------- Tier 1: color primitives ---------------------------------- */

	/* Cool neutral ramp — locked 2026-08. No warm/cream values.
	   -100/-200/-300/-400 are the four already agreed; the rest complete the
	   ramp at even perceptual steps and replace 30 ungraded legacy greys. */
	--c-white:        #ffffff;
	--c-neutral-50:   #f9fafb;
	--c-neutral-100:  #f4f5f6;   /* locked — page ground */
	--c-neutral-150:  #f5f6f7;   /* locked — alt band ground */
	--c-neutral-200:  #eef0f2;   /* locked — subtle fill */
	--c-neutral-300:  #e3e6ea;   /* locked — hairline border */
	--c-neutral-400:  #cbd1d8;   /* strong border, disabled edge */
	--c-neutral-500:  #9aa2ad;   /* placeholder, decorative rules */
	--c-neutral-600:  #5c636d;   /* muted text — 5.56:1 on --c-neutral-100, 6.07:1 on white */
	--c-neutral-700:  #464d56;   /* secondary text */
	--c-neutral-800:  #2b3138;   /* headings on light */
	--c-neutral-900:  #1b1b1b;   /* ink — matches existing #page_head ground */
	--c-black:        #060606;   /* legacy body ink, kept for exact parity */

	/* Brand red. #dc0009 is canonical; #db0009 in global.css is a typo-level
	   variant and is NOT given a token — it maps to --c-red-500 on migration. */
	--c-red-500:      #dc0009;
	--c-red-600:      #a80007;   /* hover */
	--c-red-700:      #7a0006;   /* pressed / active underline */
	--c-red-300:      #ff675b;   /* SR hero button */

	/* Section accent primitives. Values already locked in reskin-2026.css. */
	--c-accent-advocacy:         #c89a3c;  --c-accent-advocacy-dark:    #8a631f;
	--c-accent-resources:        #33587a;  --c-accent-resources-dark:   #1b3346;
	--c-accent-members:          #c4685f;  --c-accent-members-dark:     #7c3730;
	--c-accent-news:             #62706d;  --c-accent-news-dark:        #33403e;
	--c-accent-events:           #23977f;  --c-accent-events-dark:      #14544a;
	--c-accent-marketplace:      #7b5a94;  --c-accent-marketplace-dark: #4e3760;
	--c-accent-default:          #8a8a8a;  --c-accent-default-dark:     #1b1b1b;

	/* ---------- Tier 1: spacing scale (4px base) --------------------------- */
	--space-0:    0;
	--space-1:    4px;
	--space-2:    8px;
	--space-3:   12px;
	--space-4:   16px;
	--space-5:   20px;
	--space-6:   24px;
	--space-8:   32px;
	--space-10:  40px;
	--space-12:  48px;
	--space-16:  64px;
	--space-20:  80px;
	--space-24:  96px;
	--space-32: 128px;

	/* ---------- Tier 1: type scale ---------------------------------------- */
	/* Anchored on the locked 18px body. Ten steps replace 48 legacy values.
	   Line-heights are unitless so the reskin's font-size changes stop
	   orphaning the 175 hard-px line-heights in global.css. */
	--fs-100:  13px;   /* meta, captions, copyright — the legibility floor */
	--fs-200:  15px;   /* breadcrumbs, sub-menu links, footer #info */
	--fs-300:  17px;   /* dense UI, table body, subheads */
	--fs-400:  18px;   /* body — LOCKED */
	--fs-500:  20px;   /* lead paragraph, card title */
	--fs-600:  24px;   /* h4 / widget title */
	--fs-700:  30px;   /* h3 */
	--fs-800:  38px;   /* h2 */
	--fs-900:  48px;   /* h1, inner page */
	--fs-1000: 60px;   /* hero display */

	--lh-tight:   1.15;  /* --fs-900 and above */
	--lh-heading: 1.25;  /* --fs-600 … --fs-800 */
	--lh-snug:    1.4;   /* UI, nav, buttons */
	--lh-body:    1.61;  /* = 29/18, the locked body ratio */
	--lh-loose:   1.75;  /* long-form article body if ever needed */

	/* Byte-identical to the shipped stacks. The audit proposed widening these
	   to 'Lexend', system-ui, -apple-system, 'Segoe UI', sans-serif — that is
	   NOT a no-op and was rejected for Phase 0: any glyph Lexend lacks (the
	   breadcrumb "→", for one) falls through to the next family in the list,
	   so adding system-ui visibly re-renders those characters. Widening the
	   stack is a Phase 2 decision with its own screenshot pass. */
	--font-body:    'Lexend', sans-serif;
	/* Display serif: Newsreader, picked by Kalman 2026-09-15 over Fraunces
	   (the Blueprint's D2 rec) and Playfair (retired: faux-bold bug #1218,
	   second serif round-trip). Every legacy Playfair rule in global.css /
	   community.css now reads these two tokens, so the face and its weight
	   change here and nowhere else (#1221). Weight 600 — Newsreader's 700
	   is heavier than Playfair's was. */
	--font-display: 'Newsreader', Georgia, 'Times New Roman', serif;
	--fw-display:   600;
	/* Body weight, sitewide default (#1207, widened from long-form-only to
	   the whole site by Kalman 2026-09-15). Rules that must stay at 400
	   say var(--fw-regular) explicitly. */
	--fw-body:      350;
	/* Sans headlines — the h1/h2/h3 base, the title bar, and the homepage
	   band headings (which add +200 to this). Face defaults to the body
	   face; weight 500 is what shipped. Kalman 2026-09-15: wanted these
	   adjustable separately from the serif headings, hence own tokens. */
	--font-headline: var(--font-body);
	--fw-headline:   500;

	--fw-regular: 400;
	--fw-medium:  500;
	--fw-semi:    600;
	--fw-bold:    700;

	--tracking-tight: .01em;   /* nav links */
	--tracking-wide:  .04em;   /* footer menu */
	--tracking-caps:  .06em;   /* small-caps eyebrows */

	/* ---------- Tier 1: radius / shadow / motion / layering --------------- */
	--radius-xs:    4px;
	--radius-sm:    6px;
	--radius-md:   10px;   /* card shell — matches the locked horizontal card */
	--radius-lg:   16px;
	--radius-pill: 999px;
	--radius-circle: 50%;

	/* Light from directly above. Replaces 28 legacy diagonal shadows.
	   NOTE (Phase 0): these are the agreed NEW values — the mega-menu's
	   shipped shadow is rgba(0,0,0,.25), not rgba(16,24,32,.25), so
	   reskin-2026.css keeps its literal until Phase 2 adopts --shadow-lg. */
	--shadow-xs: 0 1px 2px rgba(16, 24, 32, .06);
	--shadow-sm: 0 2px 6px rgba(16, 24, 32, .07);
	--shadow-md: 0 6px 18px rgba(16, 24, 32, .08);        /* card hover */
	--shadow-lg: 0 16px 32px -12px rgba(16, 24, 32, .25); /* mega-menu */

	--ease:        cubic-bezier(.2, 0, .2, 1);
	--duration-1:  .15s;   /* the reskin's existing default, 8 uses */
	--duration-2:  .3s;    /* legacy .btn transition, kept for parity */

	/* Layering. Legacy runs 0 → 20,000,000 across 23 ungraded values.
	   --z-escape exists so plugin fights have ONE documented value to use
	   instead of inventing 10200111. */
	--z-base:      0;
	--z-raised:    1;
	--z-sticky:  100;
	--z-header:  500;
	--z-logo:    600;   /* replaces #logo's 10000 */
	--z-dropdown: 700;
	--z-overlay: 800;
	--z-modal:   900;
	--z-toast:  1000;
	--z-escape: 10300;  /* only for out-gunning third-party inline z-index */

	/* Shared decorative asset — was duplicated byte-for-byte at
	   reskin-2026.css:95 and :429. */
	--texture-noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");

	/* ---------- Tier 2: semantic tokens ----------------------------------- */

	--color-bg-page:      var(--c-neutral-100);
	--color-bg-surface:   var(--c-white);
	--color-bg-subtle:    var(--c-neutral-200);
	--color-bg-alt-band:  var(--c-neutral-150);
	--color-bg-inverse:   var(--c-neutral-900);

	--color-border:        var(--c-neutral-300);
	--color-border-strong: var(--c-neutral-400);
	--color-divider:       var(--c-neutral-200);

	--color-text:          var(--c-black);
	--color-text-heading:  var(--c-neutral-900);
	--color-text-muted:    var(--c-neutral-600);
	--color-text-inverse:  var(--c-white);
	--color-text-on-dark-muted: #d0d0d0;  /* breadcrumb trail */

	--color-brand:         var(--c-red-500);
	--color-brand-hover:   var(--c-red-600);
	--color-brand-active:  var(--c-red-700);
	--color-brand-tint:    rgba(220, 0, 9, .08);  /* unified brand tint */
	--color-brand-on-tint: var(--c-red-600);    /* text on the tint: 6.8:1 (red-500 is 4.50:1) */

	--color-link:          var(--c-black);
	--color-link-hover:    var(--color-brand);
	--color-focus-ring:    var(--c-red-500);

	/* Section accent — DEFAULT values. Overridden per section by the
	   body.section--* / #page_head.page-head--* rules in reskin-2026.css.
	   Every accent-aware rule reads these two, never the --c-accent-*
	   primitives directly. */
	--color-accent:      var(--c-accent-default);
	--color-accent-dark: var(--c-accent-default-dark);

	/* The six shipped section gradients differ only in the corner they
	   radiate from, so that corner is a token and the gradient itself is
	   composed once — but NOT here. var() inside a custom property is
	   substituted where that property is DECLARED, not where it is read, so
	   a --section-gradient composed in :root would bake in :root's default
	   accent (#8a8a8a) and inherit that literal unchanged into every
	   section. Measured, not assumed: the first attempt did exactly that and
	   flattened all six title bars. --section-gradient is therefore declared
	   in reskin-2026.css on the section-scoped selectors, where
	   --color-accent already holds the right value. */
	--section-gradient-origin: 100% 0%;
}
