/* Outwiry design tokens — Casual Edgepunk (owner-approved 2026-07-14).
 *
 * Canon of the visual layer. Source mockup: claude.ai/design project
 * "Outwiry design system start" (cb01c896-5339-473e-b30d-bdec6863445c),
 * file "Outwiry Design System - Casual Edgepunk.dc.html" + edgepunk-theme.js.
 * The mockup is a mirror; if this file and the mockup diverge, this file wins
 * only after the divergence is deliberate — otherwise re-sync from the mockup.
 *
 * One theme: mid-graphite, deliberately reading as neither dark nor light.
 * No light/dark pair, no per-service accent — single palette for Scout and
 * Deck (owner decisions 2026-07-14, superseding the same morning's light/dark
 * + per-service-seed contract; rationale in the embedding change's design.md).
 *
 * 2026-07-14 AA pass (owner): --muted/--blue-text/--danger-text/--danger nudged
 * lighter than the then-mockup so every pair on --raised clears WCAG AA — see
 * scripts/ds_check.py CONTRAST_PAIRS. (The mockup has since caught up to these —
 * see v4 below; the divergence this note recorded no longer stands.)
 *
 * 2026-07-15 contrast v2 (owner, after live review on real screens): --sub/
 * --muted/--blue-text one more step lighter — AA with headroom (6.40/5.03/4.99
 * on --raised), not at the 4.5 edge. Disabled fills raised 40%→60% in surfaces.
 *
 * 2026-07-15 contrast v3 (owner: body text in posts still read thin): --sub to
 * #d8dce2 — 7.01 on --raised, the AAA bar. Body copy is the reading surface;
 * title/body hierarchy is carried by weight (600 vs 400), not by dimming.
 *
 * 2026-07-17 contrast v4 (owner re-tuned the mockup itself for contrast, then
 * asked to inherit it): surfaces one step darker (--ground/--raised/--sunken)
 * and text one step lighter (--ink #f7f7f8, --sub #e6e8ea, --muted #c5c9ce).
 * This re-syncs the six tokens FROM the mockup — mockup and canon now agree on
 * them. Accents/on-colours unchanged. All CONTRAST_PAIRS improve (text↑,
 * surfaces↓ both raise ratios); verified by scripts/ds_check.py.
 */

:root {
  /* ── Surfaces ─────────────────────────────────────────── */
  --ground: #2a2e37;   /* app background; the only surface that carries texture */
  --raised: #3c424e;   /* cards, panels */
  --sunken: #21252b;   /* wells, drawers, headers-in-cards */

  /* ── Text ─────────────────────────────────────────────── */
  --ink: #f7f7f8;      /* primary text */
  --sub: #e6e8ea;      /* body/preview text */
  --muted: #c5c9ce;    /* labels, hints, HUD */

  /* ── Lines ────────────────────────────────────────────── */
  --line: rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.20);
  /* Граница элемента, который обязан ЧИТАТЬСЯ как индикатор, а не разделять области: на 8x8
   * разделительная линия пропадает, и «выключено» перестаёт быть видимым состоянием. Роль, не
   * место употребления — второй индикатор с той же задачей берёт её же (change
   * deck-beacon-line-token). Полупрозрачный → намеренно НЕ в CONTRAST_PAIRS ds_check: композит
   * зависит от подложки, число по токенам было бы ложной точностью. */
  --line-indicator: rgba(255, 255, 255, 0.40);

  /* ── Overlays (change deck-ds-color-debt) ─────────────────
   * Roles, not one-off values: each of these was repeated across surfaces as a literal —
   * the scrim with three different alphas and two syntaxes, the wash as a raw rgba fed to a
   * vendored editor variable. `--scrim` darkens IMAGERY so controls stay legible on any
   * photo; `--on-scrim` is what sits on it; `--wash` is the light film of an interactive
   * state over a graphite surface (hover/active), and the same value bridges the inherited
   * editor's own surface variable.
   * Translucent by nature, so deliberately NOT in ds_check CONTRAST_PAIRS: the composite
   * depends on the image underneath, and a ratio computed from the tokens alone would be
   * false precision (design D3 of the change).
   */
  --scrim: rgba(0, 0, 0, 0.55);
  --on-scrim: #ffffff;
  --wash: rgba(255, 255, 255, 0.10);

  /* ── Accents ──────────────────────────────────────────── */
  --blue: #4c96d2;        /* primary actions — the only colour that competes for the click */
  --blue-text: #8fc0e7;   /* links, inline accents on graphite */
  --blue-deep: #114c5a;   /* terminal counter bg, mono-avatar bg */
  --yellow: #e3b93b;      /* status marker (Scout badge) + rescue actions (UNDO, +Add) only */
  --danger: #e16e52;      /* destructive fills */
  --danger-text: #f29b85; /* destructive text on graphite */
  --success: #57b89a;

  /* ── On-colours (text on accent fills) ────────────────── */
  --on-blue: #0a2438;
  --on-yellow: #3a2c00;
  --on-deep: #cfe3ea;

  /* ── Form: one-corner chamfer (top-right) + rounds ────── */
  /* Chamfer via corner-shape is progressive enhancement (no WKWebView
   * support): degrades to plain border-radius. Owner accepted 2026-07-14. */
  --bevel-lg: 14px;    /* containers, cards, panels, drawer */
  --bevel-md: 8px;     /* accent buttons, avatars, icon tiles */
  --bevel-sm: 5px;     /* accent badges (Scout) */
  --round-lg: 10px;    /* toasts, snackbars — floating neutral layers */
  --round-md: 7px;     /* neutral buttons, segmented, chips, steppers — never chamfered */
  --square: 2px;       /* terminal counter [ N ] */

  /* ── Ground texture & elevation ───────────────────────── */
  /* Dot grid: only ever on --ground (never cards/panels/controls). */
  --texture-dots: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.04) 1px, transparent 0);
  --texture-dots-size: 22px 22px;
  --shadow-float: 0 6px 24px rgba(0, 0, 0, 0.25); /* toasts, snackbars */

  /* ── Typography ───────────────────────────────────────── */
  --font-display: 'Manrope', -apple-system, system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace; /* HUD labels, badges, counters, meta */

  /* ── Motion ───────────────────────────────────────────── */
  --dur-fast: 120ms;
  --dur-base: 180ms;
  --dur-slow: 280ms;
  --dur-spin: 700ms;
  --ease-out: cubic-bezier(0.2, 0, 0, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
}
