/*
  bezdock.com tokens (this site only). The single source of truth for colour, type, space,
  radius and motion on bezdock.com and every page under /design.

  Upstream: the Bezdock brand kit (kept separate from this file). Values here
  follow the kit. If the kit changes, change it here, then update /design.

  Rule: never hard-code a colour, size or radius in a page. Add a token here
  first, document it on /design/foundations.html, then use it.
*/

:root {
  /* Primitives (from the brand kit) */
  --bz-charcoal: #0E1014;
  --bz-paper: #FAFAFA;
  --bz-white: #FFFFFF;
  --bz-slate: #5E6571;
  --bz-slate-dark: #9096A1;
  --bz-rule-light: #E4E4E7;
  --bz-rule-dark: #262A31;
  --bz-panel-dark: #15181D;
  --bz-signal-light: #FF4F00;
  --bz-signal-dark: #FF6A2B;

  /* Semantic, light theme (default) */
  color-scheme: light;
  --bz-bg: var(--bz-paper);
  --bz-ink: var(--bz-charcoal);
  --bz-muted: var(--bz-slate);
  --bz-rule: var(--bz-rule-light);
  --bz-panel: var(--bz-white);
  --bz-signal: var(--bz-signal-light); /* live, focus, current only */

  /* Type */
  --bz-font-sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bz-font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --bz-text-display: 52px;
  --bz-text-heading: 32px;
  --bz-text-title: 20px;
  --bz-text-body: 16px;
  --bz-text-small: 13px;
  --bz-weight-regular: 400;
  --bz-weight-medium: 500;
  --bz-weight-semibold: 600;
  --bz-leading-tight: 1.1;
  --bz-leading-body: 1.55;
  --bz-tracking-display: -0.03em;
  --bz-tracking-heading: -0.02em;
  --bz-tracking-wordmark: -0.045em;

  /* Space (4px base) */
  --bz-space-1: 4px;
  --bz-space-2: 8px;
  --bz-space-3: 12px;
  --bz-space-4: 16px;
  --bz-space-6: 24px;
  --bz-space-8: 32px;
  --bz-space-12: 48px;
  --bz-space-16: 64px;

  /* Radius */
  --bz-radius-sm: 8px;
  --bz-radius-md: 12px;
  --bz-radius-pill: 999px;

  /* Layout */
  --bz-width-page: 760px;
  --bz-gutter: 24px;
  --bz-gutter-phone: 16px;

  /* Motion */
  --bz-duration: 160ms;
  --bz-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Dark theme: system preference when no explicit choice is stored */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bz-bg: var(--bz-charcoal);
    --bz-ink: var(--bz-paper);
    --bz-muted: var(--bz-slate-dark);
    --bz-rule: var(--bz-rule-dark);
    --bz-panel: var(--bz-panel-dark);
    --bz-signal: var(--bz-signal-dark);
  }
}

/* Dark theme: explicit choice */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bz-bg: var(--bz-charcoal);
  --bz-ink: var(--bz-paper);
  --bz-muted: var(--bz-slate-dark);
  --bz-rule: var(--bz-rule-dark);
  --bz-panel: var(--bz-panel-dark);
  --bz-signal: var(--bz-signal-dark);
}

@media (prefers-reduced-motion: reduce) {
  :root { --bz-duration: 0ms; }
}
