/*!
 * Cronuts Design System — Unified Token Layer (tokens.css)
 * ------------------------------------------------------------------
 * P2-8 · Fase 1 · 2026-07-07. Canonical namespace = --cd-*.
 *
 * This sheet is ADDITIVE and NON-DESTRUCTIVE:
 *   · Layer 1 (gap-fillers): canonical --cd-* tokens the site already USES but
 *     that the global cronuts-tokens-inline.php (v1.4.0) does NOT define
 *     (light neumorphic canvas, surface-ink text scale, neumorphic shadows).
 *     These become available site-wide. AA-corrected.
 *   · Layer 2 (retro-compat / centralization): every legacy design token from
 *     main.css :root re-declared here with its CURRENT value (exact --cd-*
 *     alias where values match 1:1; literal otherwise). While main.css :root
 *     still defines them this layer is INERT (same value wins either way);
 *     it ACTIVATES — with zero pixel shift — the moment those scattered
 *     :root blocks are removed in Fase 3. Divergent scales are marked
 *     "converge Fase 2" and rationalized there with visual diff.
 *
 * Canonical typography = Poppins (display) + Inter (body). Space Grotesk +
 * DM Sans are being retired (Fase 3) — their local --font-* redefinitions in
 * subservice.css / phtml inline are removed, not aliased.
 *
 * Enqueue order: AFTER cronuts-tokens-inline (which ships the full --cd-* set
 * critically at wp_head prio 2) and BEFORE main.css. Do NOT edit generated
 * cache/cronuts-css or uploads/cronuts-static artifacts.
 */

/* ============================================================
 * LAYER 1 — Canonical gap-fillers (new --cd-* tokens; active)
 * ============================================================ */
:root {
  /* Light neumorphic canvas (promoted from per-page inline; single source). */
  --cd-canvas: #E0E5EC;
  --cd-canvas-dark: #121212;
  --cd-canvas-dark-2: #1A1A1A;

  /* Surface-ink text scale for text ON the light canvas (complements the dark-
   * theme --cd-fg family). AA-verified on #E0E5EC:
   *   --cd-ink    #242424  ~13:1   --cd-ink-2 #545760 ~5.6:1
   *   --cd-ink-3  #5C6068  ~4.96:1 (was #848484 = 2.97:1, failed AA) */
  --cd-ink: #242424;
  --cd-ink-2: #545760;
  --cd-ink-3: #5C6068;
  --cd-ink-inv: #EBEAEA;

  /* Neumorphic shadow scale (folded from --nm-* / --nmd-*; single source). */
  --cd-nm-out: -6px -6px 16px 0 rgba(255,255,255,1), 6px 6px 16px 0 rgba(163,177,198,.55);
  --cd-nm-out-sm: -3px -3px 8px 0 rgba(255,255,255,.95), 3px 3px 8px 0 rgba(163,177,198,.45);
  --cd-nm-out-lg: -10px -10px 24px 0 rgba(255,255,255,1), 10px 10px 24px 0 rgba(163,177,198,.55);
  --cd-nm-in-sm: inset 2px 2px 5px 0 rgba(163,177,198,.5), inset -2px -2px 5px 0 rgba(255,255,255,1);
  --cd-nm-red: -3px -3px 7px 0 rgba(255,255,255,.9), 5px 5px 14px 0 rgba(230,36,63,.45);
  --cd-nm-red-d: -3px -3px 7px 0 rgba(58,58,58,.35), 5px 5px 14px 0 rgba(230,36,63,.5);
  --cd-nmd-out: -6px -6px 14px 0 rgba(58,58,58,.55), 8px 8px 20px 0 rgba(0,0,0,.6);
  --cd-nmd-out-sm: -3px -3px 7px 0 rgba(58,58,58,.5), 4px 4px 10px 0 rgba(0,0,0,.55);

  /* Single button radius (kills the pill<->square flash; components.css Fase 2
   * points .btn at this instead of legacy --radius-none:0). */
  --cd-radius-btn: var(--cd-r-full, 9999px);
}

/* ============================================================
 * LAYER 2 — Retro-compat / centralization (inert until Fase 3)
 * Legacy tokens from main.css :root, current values preserved.
 * ============================================================ */
:root {
  /* Brand colors — exact 1:1 with --cd-* → safe var() alias. */
  --color-black: var(--cd-black);              /* #121212 */
  --color-white: var(--cd-white);              /* #FFFFFF */
  --color-red: var(--cd-red);                  /* #E6243F */
  --color-accent: var(--cd-red);
  --color-bg: var(--cd-black);                 /* #121212 (NOT --cd-bg #0A0A0B) */
  --color-bg-inverse: var(--cd-white);
  --color-fg: var(--cd-white);                 /* #FFFFFF (NOT --cd-fg #F5F5F7) */
  --color-fg-inverse: var(--cd-black);

  /* Divergent values — kept literal, converge Fase 2. */
  --color-red-dark: #c01e35;                   /* ≠ --cd-red-hover #C71C33 */
  --color-accent-hover: #c01e35;
  --color-gray-100: #f5f5f5;
  --color-gray-200: #e8e8e8;
  --color-gray-400: #a0a0a0;
  --color-gray-600: #555;
  --color-gray-800: #2a2a2a;
  --color-gray-900: #1a1a1a;
  --color-border: #2a2a2a;
  --color-border-inverse: #e8e8e8;

  /* Typography — canonical Poppins/Inter (user decision 2026-07-07). */
  --font-display: var(--cd-font-display);      /* Poppins */
  --font-body: var(--cd-font-body);            /* Inter */
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Spacing scale (rem) — centralized literal; converge to --cd-sp-* Fase 2. */
  --space-1: .25rem;  --space-2: .5rem;   --space-3: .75rem;  --space-4: 1rem;
  --space-5: 1.25rem; --space-6: 1.5rem;  --space-8: 2rem;    --space-10: 2.5rem;
  --space-12: 3rem;   --space-16: 4rem;   --space-20: 5rem;   --space-24: 6rem;
  --space-32: 8rem;

  /* Type scale (rem) — centralized literal; converge to --cd-fs-* Fase 2. */
  --text-xs: .75rem; --text-sm: .875rem; --text-base: 1rem; --text-lg: 1.125rem;
  --text-xl: 1.25rem; --text-2xl: 1.5rem; --text-3xl: 1.875rem; --text-4xl: 2.25rem;
  --text-5xl: 3rem; --text-6xl: 3.75rem; --text-7xl: 4.5rem;

  /* Weights — 1:1 with --cd-fw-*. */
  --weight-regular: 400; --weight-medium: 500; --weight-semibold: 600;
  --weight-bold: 700; --weight-heavy: 800;

  /* Line-height — converge to --cd-lh-* Fase 2. */
  --leading-tight: 1.1; --leading-snug: 1.25; --leading-normal: 1.5; --leading-relaxed: 1.65;

  /* Radius — legacy; NOTE --radius-none stays 0 (some intentional square uses);
   * the button flash is fixed in components.css by pointing .btn at
   * --cd-radius-btn, NOT by remapping --radius-none. */
  --radius-none: 0; --radius-sm: 2px; --radius-md: 4px;

  /* Layout. */
  --container-max: 1200px;
  --container-px: clamp(1rem, 4vw, 2rem);

  /* Neumorphic shadows — legacy → canonical alias (exact values). Inert while
   * sector.css / subservice.css still define --nm-* locally; activates without
   * shift when those local defs are removed in Fase 2. */
  --nm-out: var(--cd-nm-out);
  --nm-out-sm: var(--cd-nm-out-sm);
  --nm-out-lg: var(--cd-nm-out-lg);
  --nm-in-sm: var(--cd-nm-in-sm);
  --nm-red: var(--cd-nm-red);
  --nm-red-d: var(--cd-nm-red-d);
  --nmd-out: var(--cd-nmd-out);
  --nmd-out-sm: var(--cd-nmd-out-sm);
}

/* ============================================================
 * DEFERRED to Fase 2 (documented — intentionally NOT defined here)
 * ------------------------------------------------------------
 * A) Used-but-globally-undefined --cd-* tokens (currently resolve to `initial`,
 *    i.e. dividers fall back to currentColor). Defining them now would CHANGE
 *    rendering, so they are handled in Fase 2 with per-component visual diff:
 *      --cd-canvas-dark-3  --cd-divider-dark  --cd-divider-light
 *      --cd-ink-inv-2      --cd-ink-inv-3
 * B) Non-DS utility tokens still owned by main.css :root (centralize when
 *    main.css :root is emptied in Fase 3):
 *      --duration-fast|base|slow  --ease-out  --ease-quart  --focus-ring
 *      --focus-offset  --gap  --section-py  --z-base|sticky|overlay|modal
 * C) Divergent scales (kept literal above, converge in Fase 2 w/ visual diff):
 *      --space-5|10|20 · --text-xl..7xl · --radius-sm|md · --color-red-dark
 * ============================================================ */

