/* service-bundle-core · design tokens — the white-label seam.
 *
 * CORE-SERVED since the 2026-08-24 design-normalization pass: this file lives
 * ONCE in runtime-core static/ (served estate-wide at /core-static/tokens.css)
 * — the per-bundle byte-identical copies are retired (the drift trap that bit
 * theme-toggle.js). Fonts self-hosted via /core-static/fonts.css (linked
 * before this file by every shell; the old Google @import is gone).
 *
 * WHITE-LABEL CONTRACT (cycle-43 Sieve repair · 2026-05-20):
 *   --c-action  — THE override point. A white-label client redefines this
 *                 ONE token in client-overrides.css to rebrand. Drives
 *                 links, headings, prices, primary emphasis.
 *   --c-accent  — decorative blue (borders, rules). Defaults to the same
 *                 source but is separable, for clients who want decorative
 *                 elements to follow brand independently of the action color.
 * Rebrand by overriding ONLY --c-action (optionally --c-accent) in a
 * client-overrides.css loaded after the shared layers. Never fork this file.
 */

:root {
  /* ── brand · the white-label override point ───────────────────── */
  --c-blue:        #0f62fe;          /* canonical IBM Carbon blue */
  --c-blue-hover:  #0050e6;
  --c-action:      var(--c-blue);    /* ← white-label clients override THIS */
  --c-accent:      var(--c-blue);    /* decorative blue · separable */
  /* Derived darker accent — follows any --c-action override (tenant inline
   * style or theme pack) automatically. First declaration is the
   * no-color-mix fallback. Promoted from cleaning/dog-sitter 2026-08-24. */
  --c-action-hover: var(--c-action);
  --c-action-hover: color-mix(in srgb, var(--c-action) 82%, #000);

  /* ── band signature (2026-08-24 polish pass) ──────────────────────
   * The band gradient runs --c-band → --c-band-2. Both DERIVE from the
   * action pair, so a tenant override or pack accent re-pitches the band
   * for free; a pack may also set them explicitly to restyle the
   * signature independently (workshop's charcoal band). */
  --c-band:        var(--c-action);
  --c-band-2:      var(--c-action-hover);

  /* ── depth · light mode gets soft shadows, dark mode borders ────── */
  --c-shadow-1:    0 1px 2px rgba(17,17,17,.05), 0 1px 3px rgba(17,17,17,.07);
  --c-shadow-2:    0 2px 4px rgba(17,17,17,.07), 0 4px 10px rgba(17,17,17,.08);

  /* ── text hierarchy ───────────────────────────────────────────── */
  --c-text:        #1a1a1a;
  --c-text-2:      #666666;
  --c-text-3:      #777777;

  /* ── surfaces ─────────────────────────────────────────────────── */
  --c-bg:          #ffffff;
  --c-surface:     #f5f5f5;
  --c-surface-2:   #f0f0f0;

  /* ── hairlines ────────────────────────────────────────────────── */
  --c-border:      #dddddd;
  --c-border-2:    #e0e0e0;

  /* ── status · semantic, NOT brand · fixed across white-label themes ── */
  --c-warn:        #ff9800;
  --c-warn-soft:   #fff8e1;
  --c-danger:      #c62828;
  --c-danger-soft: #ffebee;
  --c-info:        #1565c0;          /* strong info text · promoted 2026-08-24 */
  --c-info-soft:   #e3f2fd;
  --c-success:     #2e7d32;          /* promoted from cleaning/dog-sitter */
  --c-success-soft:#e8f5e9;

  /* ── ticket-lifecycle status pills · semantic, fixed across themes ──
   * Absorbed from landing-base's raw hex (2026-08-24). -bg/-fg pairs are
   * AA text-on-tint. received uses info blue, NOT --c-action: status is
   * semantic; it must not follow a white-label rebrand. */
  --c-status-received-bg:   var(--c-info-soft);
  --c-status-received-fg:   var(--c-info);
  --c-status-diagnosing-bg: var(--c-warn-soft);
  --c-status-diagnosing-fg: #9a6700;
  --c-status-quoted-bg:     #f3e5f5;
  --c-status-quoted-fg:     #6a1b9a;
  --c-status-approved-bg:   var(--c-success-soft);
  --c-status-approved-fg:   var(--c-success);
  --c-status-repair-bg:     #fff3e0;
  --c-status-repair-fg:     #e65100;
  --c-status-ready-bg:      var(--c-success-soft);
  --c-status-ready-fg:      #1b5e20;
  --c-status-pickedup-bg:   #eeeeee;
  --c-status-pickedup-fg:   #555555;
  --c-status-declined-bg:   var(--c-danger-soft);
  --c-status-declined-fg:   var(--c-danger);
  --c-status-abandoned-bg:  #efebe9;
  --c-status-abandoned-fg:  #5d4037;

  /* ── type ─────────────────────────────────────────────────────── */
  --c-font-sans:   'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --c-font-mono:   'IBM Plex Mono', 'SF Mono', Menlo, monospace;

  /* ── layout ───────────────────────────────────────────────────── */
  --c-maxw:        760px;
  --c-maxw-wide:   960px;            /* gallery surfaces: hub grid, showcase */
  --c-radius:      6px;
  --c-line:        1.55;

  color-scheme: light;
}

/* ═══════════════════════════════════════════════════════════════════
 * DARK THEME · Carbon Gray-100 canonical (mirrors darntech house
 * carbon.css .carbon-surface-dark — cycle-9 dark house-standard).
 *
 * Single source of truth (cycle-97 · global light/dark, visitor-toggled):
 * the no-flash theme script (theme-toggle.js, injected by render_acme_demo.py)
 * resolves the effective theme — stored choice ?? OS preference — and stamps
 * data-theme="dark|light" on <html> BEFORE paint. So all dark styling keys
 * on this ONE selector; there is no prefers-color-scheme block to drift out
 * of sync, and therefore no "half-dark" state. A no-JS visitor gets light
 * (acceptable: the estate needs JS for the toggle + slideshow anyway).
 *
 * WHITE-LABEL still holds: only --c-blue is re-pitched (link contrast on
 * dark). A client that overrides --c-action in client-overrides.css keeps
 * that one brand color across BOTH modes — the deliberate global-mode
 * behaviour (per-client dark palettes deferred, cycle-97 operator ruling).
 * ═══════════════════════════════════════════════════════════════════ */
:root[data-theme="dark"] {
  color-scheme: dark;

  /* depth on dark = borders, not glow — shadows read as smears on Gray-100 */
  --c-shadow-1:    none;
  --c-shadow-2:    0 0 0 1px var(--c-border-2);

  --c-blue:        #4589ff;   /* lighter blue · AA-legible link on Gray-100 */
  --c-blue-hover:  #6ea1ff;
  --c-action-hover: var(--c-action);
  --c-action-hover: color-mix(in srgb, var(--c-action) 82%, #fff);

  --c-text:        #f4f4f4;   /* Carbon text-primary */
  --c-text-2:      #c6c6c6;   /* text-secondary */
  --c-text-3:      #8d8d8d;   /* text-helper */

  --c-bg:          #161616;   /* Gray-100 background */
  --c-surface:     #262626;   /* layer-01 */
  --c-surface-2:   #393939;   /* layer-02 */

  --c-border:      #393939;   /* border-subtle */
  --c-border-2:    #525252;   /* border a touch stronger on dark */

  --c-warn:        #ffa726;
  --c-warn-soft:   #33280a;
  --c-danger:      #ff6b6b;
  --c-danger-soft: #3a1414;
  --c-info:        #64b5f6;
  --c-info-soft:   #12263a;
  --c-success:     #5fd08a;
  --c-success-soft:#12271a;

  --c-status-diagnosing-fg: #e6b25e;
  --c-status-quoted-bg:     #2a1a33;
  --c-status-quoted-fg:     #e1bee7;
  --c-status-repair-bg:     #2a1c0a;
  --c-status-repair-fg:     #ffb74d;
  --c-status-ready-fg:      #b9f6ca;
  --c-status-pickedup-bg:   #393939;
  --c-status-pickedup-fg:   #c6c6c6;
  --c-status-abandoned-bg:  #2b2320;
  --c-status-abandoned-fg:  #d7ccc8;
}
