/**
 * FounderOS design tokens — the single source of truth (#1786).
 *
 * Canonical home of the N1 token ramp for EVERY surface. Consumers:
 *   - apps/fos-bridge/fosBridge/tokens.css — GENERATED copy (scripts/sync-tokens.mjs),
 *     held in lockstep by __tests__/tokens-lockstep-1786.test.mjs. Never hand-edit.
 *   - apps/cloud-ui/src/styles/tokens.css — still the local original; repointing
 *     cloud-ui here and deleting that copy is the #1786 follow-up PR.
 * Change tokens HERE, run the bridge sync, and both surfaces move together.
 *
 * Component CSS consumes these and MUST NOT redeclare the :root token block —
 * that fork is what N1 removed.
 *
 * Two orthogonal axes on <html>:
 *   [data-theme]   = dark (default) | light
 *   [data-surface] = foundry (alpha, default) | bridge (beta customers)
 * data-surface overrides accent + brand chrome only; the structural ramp
 * (bg / text / line / spacing) is shared so one layout themes twice.
 */

:root,
[data-theme='dark'],
html[data-theme='night'] {
  --bg: #0a0e1a;
  --bg-2: #111827;
  --bg-3: #1a2236;
  --line: #1e293b;
  --line-2: #334155;
  --text: #e5e7eb;
  --text-2: #9ca3af;
  --text-3: #8897a9; /* lifted from #6b7280 — AA 4.55:1 on --bg (#0a0e1a) */
  --accent: #4f9eff;
  --accent-2: #1d4ed8;
  --accent-hover: #3b8fff;
  --penguin-blue: #4f9eff;
  --rockhopper: #fbbf24;
  --african: #34d399;
  --danger: #f87171;
  --warn: #fbbf24;
  --ok: #34d399;
  /* #1786 phase-2c: semantic CHIP pairs. A count badge or priority flag is a
     tinted ground with its own ink — it cannot borrow --danger directly (that
     value is tuned as a foreground). Each -tint/-ink pair clears AA 4.5:1
     against ITSELF, so a chip is legible without knowing the page ground.
     These are theme-scoped: the previous bridge chips hardcoded LIGHT pastels
     and stayed pale pink/cream in night mode. */
  --danger-tint: #3b1c19;
  --danger-ink: #fca5a0;
  --warn-tint: #3a2c0a;
  --warn-ink: #fcd34d;
  --ok-tint: #10301f;
  --ok-ink: #6ee7b7;
  --neutral-tint: #1f2a44;
  --neutral-ink: #b6c2d6;
  --shadow-strong: 0 20px 60px rgba(0, 0, 0, 0.5);
  /* #1786: categorical swatch palette (project/team identity). Validated
     (dataviz six-checks) on the dark/night surface; ORDER is the CVD-safety
     mechanism — never reorder or cycle. Every swatch renders WITH a text
     label (design canon: no bare colors). */
  --swatch-1: #3987e5;
  --swatch-2: #008300;
  --swatch-3: #d55181;
  --swatch-4: #c98500;
  --swatch-5: #199e70;
  --swatch-6: #d95926;
  --swatch-7: #9085e9;
  --swatch-8: #e66767;
  --mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
  --chat-w: 400px;
  --chat-h: 420px;
}

/* #1786: fos-bridge board uses a day/night theme axis — aliased here until
   the axes unify, so the board's day mode receives the light ramp. */
[data-theme='light'],
html[data-theme='day'] {
  --bg: #f8fafc;
  --bg-2: #ffffff;
  --bg-3: #f1f5f9;
  --line: #e2e8f0;
  --line-2: #cbd5e1;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #4b5563; /* darkened from #64748b — AA 4.68:1 on --bg (#f8fafc) */
  --accent: #2563eb;
  --accent-2: #1d4ed8;
  --accent-hover: #1d4ed8;
  --penguin-blue: #2563eb;
  --rockhopper: #d97706;
  --african: #059669;
  /* #1786: deep light semantics adopted from the bridge board — the bright
     values fail AA as text on light grounds (#d97706 ≈ 3.2:1). */
  --danger: #b8473d;
  --warn: #b8730a;
  --ok: #2e844a;
  /* Light chip pairs — the pastel grounds the bridge board already shipped,
     now theme-scoped and paired with an AA ink. */
  --danger-tint: #fee4e2;
  /* Deeper than --danger: the chip's own pink ground eats contrast, and
     #b8473d measured 4.35:1 on #fee4e2 — the shipped high-priority flag was
     under AA. #a83c32 restores 5.19:1 and matches the other three pairs. */
  --danger-ink: #a83c32;
  --warn-tint: #fef3c7;
  --warn-ink: #92400e;
  --ok-tint: #dcfce7;
  --ok-ink: #166534;
  --neutral-tint: #e5e7eb;
  --neutral-ink: #4b5563;
  --shadow-strong: 0 20px 60px rgba(15, 23, 42, 0.12);
  /* #1786: light-surface swatch steps (same hues). Slots 3/4/5 sit below 3:1
     on light — the relief rule applies and is satisfied: swatches always
     carry a visible text label. */
  --swatch-1: #2a78d6;
  --swatch-2: #008300;
  --swatch-3: #e87ba4;
  --swatch-4: #eda100;
  --swatch-5: #1baf7a;
  --swatch-6: #eb6834;
  --swatch-7: #4a3aa7;
  --swatch-8: #e34948;
}

/**
 * Per-surface seam. Default (foundry) inherits the penguin-blue accent above.
 * Bridge (beta customers) shifts the accent to the african-green brand line.
 * Structural tokens are intentionally NOT overridden here.
 */
[data-surface='bridge'] {
  --accent: #2dd4a7;
  --accent-2: #0f9d74;
  --accent-hover: #34e6b6;
}

[data-theme='light'][data-surface='bridge'] {
  --accent: #0f9d74;
  --accent-2: #0b7a5a;
  --accent-hover: #0b7a5a;
}
