/* ─────────────────────────────────────────────────────────────────────────
 * design-systems/byzymz/tokens.css
 *
 * Machine-readable token bindings for "byzymz — Precision Tool Dark".
 * Canonical source of values for styles.css; every component must consume
 * these tokens via var() rather than re-declaring raw values.
 *
 * Contract: nexu-io/open-design · packages/contracts/src/design-systems/
 *           token-schema.ts (layers A1-identity / A1-structure / A2 / B-slot)
 * Verify with: node scripts/check-tokens.js   (repo-local guard)
 *
 * Layer map:
 *   A1-identity  --bg, --surface, --fg, --muted, --border,
 *                  --accent, --font-display, --font-body
 *   A1-structure type scale, leading/tracking, section rhythm,
 *                  container max + gutters
 *   A2           accent-on/hover/active, semantic, mono stack,
 *                  spacing, radius, elevation, focus, motion
 *   B-slot       --surface-warm, --fg-2, --meta, --border-soft
 *                  (alias to siblings when byzymz has no richer tier)
 * ───────────────────────────────────────────────────────────────────────── */

:root {
  /* ─── Surface ───────────────────────────────────────────────────── */
  --bg: #0b0d12;
  --surface: #141824;
  --surface-warm: var(--surface);      /* alias — no third tier */

  /* ─── Foreground ramp ──────────────────────────────────────────── */
  --fg: #e7eaf3;
  --fg-2: #a9b1c6;                     /* true secondary tier */
  --muted: #7a839b;
  --meta: var(--muted);                /* alias — no metadata tier */

  /* ─── Border ───────────────────────────────────────────────────── */
  --border: #232a3b;
  --border-soft: #1a2030;

  /* ─── Accent ───────────────────────────────────────────────────── */
  --accent: #6c5ce7;
  --accent-on: #ffffff;
  --accent-hover: color-mix(in oklab, var(--accent), black 8%);
  --accent-active: color-mix(in oklab, var(--accent), black 14%);

  /* ─── Semantic ─────────────────────────────────────────────────── */
  --success: #17c964;
  --warn: #f5a524;
  --danger: #f31260;

  /* ─── Typography ───────────────────────────────────────────────── */
  --font-display: "Inter", -apple-system, "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", -apple-system, "Segoe UI", system-ui, sans-serif;
  --font-mono: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, monospace;

  --text-xs: 12px;
  --text-sm: 14px;
  --text-base: 16px;
  --text-lg: 20px;
  --text-xl: 24px;
  --text-2xl: 32px;
  --text-3xl: 48px;
  --text-4xl: 48px;                    /* hero capped at 3xl size */

  --leading-body: 1.5;
  --leading-tight: 1.2;
  --tracking-display: -0.01em;

  /* ─── Spacing (4px grid) ───────────────────────────────────────── */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-20: 80px;

  --section-y-desktop: 80px;
  --section-y-tablet: 48px;
  --section-y-phone: 32px;

  /* ─── Radius ───────────────────────────────────────────────────── */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 9999px;

  /* ─── Elevation ────────────────────────────────────────────────── */
  --elev-flat: none;
  --elev-ring: 0 0 0 1px var(--border);
  --elev-raised: 0 2px 8px color-mix(in oklab, var(--fg), transparent 92%);

  /* ─── Focus ────────────────────────────────────────────────────── */
  --focus-ring: 0 0 0 3px color-mix(in oklab, var(--accent), transparent 70%);

  /* ─── Motion ───────────────────────────────────────────────────── */
  --motion-fast: 150ms;
  --motion-base: 200ms;
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);

  /* ─── Layout ───────────────────────────────────────────────────── */
  --container-max: 1200px;
  --container-gutter-desktop: 24px;
  --container-gutter-tablet: 16px;
  --container-gutter-phone: 12px;
}

/* ─── Light theme: same tokens, alternate binding ───────────────────────
 * Not applied by default (the tool is dark-first). Enable with
 * <html data-theme="light"> or by flipping the default below. */
[data-theme='light'] {
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-warm: var(--surface);
  --fg: #111111;
  --fg-2: #3d4454;
  --muted: #6b7280;
  --meta: var(--muted);
  --border: #e5e7eb;
  --border-soft: #eef0f4;
  --accent: #5a4bd6;
  --accent-on: #ffffff;
  --success: #17a34a;
  --warn: #eab308;
  --danger: #dc2626;
  --elev-raised: 0 2px 8px color-mix(in oklab, var(--fg), transparent 92%);
}
