/* CANONICAL ASTRUM V2 TOKENS — shared :root vars (single source of truth).
 *
 * The V2 design system (live since 1 Oct 2026): paper/ink/navy/night/orange, Geist + Geist Mono,
 * square-ish radii (3/4/4/2) and one button height scale. Values match web/brand/v2/site.css :root.
 * <link>ed by the portal, admin, rep, affiliate, marketing, marketing-hub, email-prefs,
 * reset-password, accept-invite and content pages BEFORE their own stylesheet, so a palette change
 * happens in ONE place. Mirrors shared/brand-tokens.cjs (the JS copy the portal Tailwind build reads).
 *
 * Rules of the system (audit, 1 Oct 2026):
 *   - Primary button = ink fill, paper text, navy on hover. On dark (night) sections it is white,
 *     orange on hover. Orange is the ACCENT (marks, underlines, focus), not a button fill.
 *   - Every text link has an orange underline (shared/v2-app.css a, portal .v-link, admin .dt-link).
 *   - Radii: buttons 3px, cards/inputs 4px, chips 2px.
 *   - Button heights: --h-lg 48 (sign-in + brand CTAs), --h-md 40 (app default), --h-sm 32.
 *   - Surface CSS only consumes var(--…): no raw hex, font stacks or radii (engineering/PLATFORM-FOUNDATIONS.md §2).
 *   - E-mail and print shells read the same values from shared/brand-tokens.cjs (V2 export); a unit
 *     test keeps the two files in lockstep.
 *
 * Aliases below preserve every var name existing CSS already references (legacy surfaces too). */
:root {
  /* ===== V2 core ===== */
  --paper:#f2f1ed; --paper-2:#e8e6e0; --paper-3:#dcd9d1; --tile:#fbfaf8;
  --ink:#0f1419; --ink-2:#4a525b; --ink-3:#878d94;
  --line:rgba(15,20,25,.13);
  --navy:#184669; --night:#0a1a28; --night-2:#10273b;
  --orange:#f47231; --ok:#2f7d4f; --warn:#b7791f; --err:#b42318;
  --sans:'Geist',ui-sans-serif,system-ui,sans-serif;
  --mono:'Geist Mono',ui-monospace,Menlo,monospace;
  --ease:cubic-bezier(.2,.7,.1,1);
  --tr-display:-.06em; --tr-title:-.04em; --tr-text-lg:-.03em; --tr-heading:-.02em; --tr-ui:-.01em;
  --lh-display:.9; --lh-title:1; --lh-text-lg:1.12; --lh-heading:1.2;
  /* status tints + surfaces (AA text on each tint) */
  --ok-bg:#e8f1eb; --warn-ink:#8a5a12; --warn-bg:#f8efdf; --err-bg:#fbecea; --info-bg:#e3ebf2; --accent-wash:#fbefe6;
  --white:#fff;
  /* on night (dark) sections */
  --on-night:rgba(242,241,237,.8); --on-night-2:rgba(242,241,237,.55); --on-night-line:rgba(242,241,237,.2);
  /* focus, overlays, shadows */
  --focus-ring:0 0 0 3px rgba(244,114,49,.18);
  --scrim:rgba(10,26,40,.5);
  --shadow-pop:0 6px 20px rgba(10,26,40,.25);
  /* radii + control heights */
  --r-btn:3px; --r-md:4px; --r-lg:4px; --r-chip:2px;
  --h-lg:48px; --h-md:40px; --h-sm:32px;

  /* ===== brand palette (pre-V2 names, kept) ===== */
  --brand:#F47231;            /* Astrum Orange (158C) — accent: marks, underlines, focus ring */
  --brand-ink:#1a1208;        /* dark warm text if anything sits ON orange (AA 6.44:1) */
  --brand-hover:#ff8a52;
  --brand-navy:#184669;       /* Astrum Dark Blue (427C) */
  --brand-orange-text:#c0480f;/* small orange TEXT label when needed (AA on white) */
  --brand-sky:#3D86C6;        /* Astrum Light Blue (2193C) — secondary accent */
  --brand-skylink:#2f6da6;
  --brand-bg-grey:#f2f1ed;    /* = --paper (was #f6f4f1 pre-V2) */

  /* ===== STOCK-STATUS TOKENS — canonical across all platforms (2026-06-30) ===== */
  --stk-ok:#059669;   /* green  — in_stock */
  --stk-low:#B45309;  /* amber  — low stock */
  --stk-out:#DC2626;  /* red    — out of stock */

  /* aliases used by existing CSS (do not remove — kept for compat) */
  --brand-orange:#F47231;
  --btn-ink:#1a1208;
  --orange-text:#c0480f;
  --sky:#3D86C6;
  --sky-link:#2f6da6;
  --bg-grey:#f2f1ed;

  /* Content overlay ("Surface", design concept 2c) on the brand site */
  --overlay-ink:#0f1f2b;
  --ghost-text:#ffd9c4;

  /* ===== semantic additions (hex burn-down, 2 Oct 2026) ===== */
  --orange-2:#e0611f;         /* pressed / hover orange on the brand site */
  --night-3:#1d3246;          /* raised panel on night (cards inside dark sections) */
  /* solid text ramp on night/navy sections (opaque twin of --on-night*, for small text + icons) */
  --night-ink:#c9d3dc; --night-ink-2:#a8b3be; --night-ink-3:#7f8b97; --night-ink-4:#5d7286;
  /* violet: platinum tier, draft/admin role chips */
  --violet:#6d28d9; --violet-bg:#f5f3ff;
  /* admin dark theme ([data-theme="dark"]) palette */
  --dk-line:#243349; --dk-line-2:#1b2740; --dk-rail:#06121c; --dk-raised:#172238; --dk-fill:#1e293b;
  --dk-ink:#e5e9f0; --dk-ink-2:#94a3b8; --dk-ink-3:#7c8ba1; --dk-track:#5a7191;
  --dk-sky:#8cc0ec; --dk-ok:#4ade80; --dk-err:#f87171; --dk-warn:#facc15; --dk-violet:#c4b5fd;
  /* WhatsApp message preview (third-party UI, marketing hub) */
  --wa-chat-bg:#efe7da; --wa-bubble:#dcf8c6; --wa-ink:#111b21; --wa-link:#0b7bb8; --wa-meta:#667781; --wa-head:#075e54;
  /* Admin → Site stats heatmap: sequential orange click-density ramp (light → dark) and the click-kind
     dots. The canvas draws the same values as rgb in web/admin/modules/sitestats-heat.js (RAMP, KIND_RGB). */
  --heat-1:#ffedd5; --heat-2:#fdba74; --heat-3:#f97316; --heat-4:#c2410c; --heat-5:#7c2d12;
  --click-error:#b91c1c; --click-rage:#ea580c; --click-dead:#b48209;
}

/* ── Astrum loading mark (owner, 15 Nov 2026) ─────────────────────────────────────────────────────
   Four orange squares in a 2×2. Each beat one diagonal pair spins half a turn round the centre, pulling
   in so all four line up on the other diagonal, then swings out to the swapped corners and eases in
   (TL/BR anticlockwise, TR/BL clockwise; 0.6 s a beat, 1.2 s a round). Motion measured from the Claude
   desktop app's busy indicator, drawn with the brand's square marks.
   One empty element draws it (its box-shadow paints the four squares), so it also works as a pseudo-
   element: <span class="aw-mark" aria-hidden="true"></span>. `.spinner` (v2-app.css surfaces) uses it
   too, and shared/motion.js puts one in front of any "Loading…" text on the app surfaces.
   Sizes: default for text and buttons, .aw-lg for a whole page. Off for reduced motion (static 2×2). */
@property --aw-ta{syntax:'<angle>';inherits:false;initial-value:225deg}
@property --aw-tb{syntax:'<angle>';inherits:false;initial-value:315deg}
@property --aw-ra{syntax:'<number>';inherits:false;initial-value:1}
@property --aw-rb{syntax:'<number>';inherits:false;initial-value:1}
.aw-mark{--aw-s:4px;--aw-p:10px}
.aw-mark.aw-lg{--aw-s:8px;--aw-p:19px}
.aw-mark,.spinner{display:inline-block;flex:none;vertical-align:middle;box-sizing:content-box;
  width:var(--aw-s);height:var(--aw-s);margin:calc(var(--aw-p) / 2);margin-right:calc(var(--aw-p) / 2 + .5em);
  border:0;border-radius:0;background:none;
  --aw-d:calc(var(--aw-p) * .7071);
  box-shadow:
    calc(cos(var(--aw-ta)) * var(--aw-ra) * var(--aw-d)) calc(sin(var(--aw-ta)) * var(--aw-ra) * var(--aw-d)) 0 0 var(--orange),
    calc(cos(var(--aw-ta)) * var(--aw-ra) * var(--aw-d) * -1) calc(sin(var(--aw-ta)) * var(--aw-ra) * var(--aw-d) * -1) 0 0 var(--orange),
    calc(cos(var(--aw-tb)) * var(--aw-rb) * var(--aw-d)) calc(sin(var(--aw-tb)) * var(--aw-rb) * var(--aw-d)) 0 0 var(--orange),
    calc(cos(var(--aw-tb)) * var(--aw-rb) * var(--aw-d) * -1) calc(sin(var(--aw-tb)) * var(--aw-rb) * var(--aw-d) * -1) 0 0 var(--orange);
  animation:aw-ta 1.2s infinite,aw-ra 1.2s infinite,aw-tb 1.2s .6s infinite,aw-rb 1.2s .6s infinite}
.spinner{--aw-s:4px;--aw-p:10px}
.aw-mark.aw-alone{margin-right:calc(var(--aw-p) / 2)}
/* the turn: slow start, fast through the middle, long soft landing */
@keyframes aw-ta{0%{--aw-ta:225deg;animation-timing-function:linear(0,.02 10%,.07 20%,.2 30%,.5 39%,.7 47%,.82 57%,.9 70%,.96 84%,1)}50%,100%{--aw-ta:45deg}}
@keyframes aw-tb{0%{--aw-tb:315deg;animation-timing-function:linear(0,.02 10%,.07 20%,.2 30%,.5 39%,.7 47%,.82 57%,.9 70%,.96 84%,1)}50%,100%{--aw-tb:495deg}}
/* the pull-in: to 40% a third of the way through, back out by three quarters */
@keyframes aw-ra{0%{--aw-ra:1;animation-timing-function:cubic-bezier(.45,0,.7,1)}17%{--aw-ra:.4;animation-timing-function:cubic-bezier(.25,.6,.35,1)}42%,100%{--aw-ra:1}}
@keyframes aw-rb{0%{--aw-rb:1;animation-timing-function:cubic-bezier(.45,0,.7,1)}17%{--aw-rb:.4;animation-timing-function:cubic-bezier(.25,.6,.35,1)}42%,100%{--aw-rb:1}}
@media (prefers-reduced-motion:reduce){.aw-mark,.spinner{animation:none!important}}
