/* GratisAI shared design tokens — assets/site/tokens.css
   One token system for every App (the constitution's coherence attribute, §23).
   An App links this sheet and adds only its fingerprint in its inline CSS:
   one accent color, the domain metaphor, and the layout signature.
   Token names are identical across Apps; only fingerprint values differ.

   Verified 2026-10-08:
   - every text/background pair below measures at least 4.5:1 (WCAG 2.2 AA);
   - the focus ring measures at least 3:1 against its background (WCAG 2.2, 1.4.11);
   - motion is 150–400 ms, ease-out, transform and opacity only (§8);
   - touch targets are at least 44 px (§23, attribute 11).
   This sheet is never required for a result or an artifact: it is a stylesheet,
   and a page that cannot load it still works with its inline fallbacks. */

:root {
  /* Spacing scale (4 px base) */
  --gq-space-1: 0.25rem;
  --gq-space-2: 0.5rem;
  --gq-space-3: 0.75rem;
  --gq-space-4: 1rem;
  --gq-space-5: 1.5rem;
  --gq-space-6: 2rem;
  --gq-space-7: 3rem;
  --gq-space-8: 4rem;

  /* Type scale (system stacks; no web font is required) */
  --gq-type-sans: system-ui, -apple-system, "Segoe UI", sans-serif;
  --gq-type-serif: Georgia, "Times New Roman", serif;
  --gq-type-mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
  --gq-type-base: 1rem;
  --gq-type-lede: 1.1rem;
  --gq-type-h3: 1.15rem;
  --gq-type-h2: 1.55rem;
  --gq-type-h1: clamp(2rem, 4vw, 3.15rem);
  --gq-line: 1.58;

  /* Motion (150–400 ms, ease-out, transform and opacity only) */
  --gq-motion-fast: 150ms;
  --gq-motion: 250ms;
  --gq-motion-slow: 400ms;
  --gq-ease: ease-out;

  /* Focus ring (10.87:1 on white) */
  --gq-focus-width: 3px;
  --gq-focus-color: #103d72;
  --gq-focus-offset: 2px;

  /* Touch target */
  --gq-target-min: 44px;

  /* Contrast-checked neutral pairs (≥ 4.5:1, measured 2026-10-08) */
  --gq-ink: #17231f;        /* 14.73:1 on --gq-paper, 16.05:1 on --gq-surface */
  --gq-muted: #4b5a53;      /* 6.61:1 on --gq-paper, 7.21:1 on --gq-surface */
  --gq-paper: #f6f4ee;
  --gq-surface: #fffefa;
  --gq-wash: #e9eeeb;       /* 13.80:1 with --gq-ink */
  --gq-rule: #c9d0c9;
  --gq-error: #9a3028;      /* 6.89:1 on --gq-error-bg */
  --gq-error-text: #4b1915; /* 13.44:1 on --gq-error-bg */
  --gq-error-bg: #fff4f2;

  /* Reduced motion: one rule, every App */
  --gq-reduced-motion: no-preference;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --gq-motion-fast: 0ms;
    --gq-motion: 0ms;
    --gq-motion-slow: 0ms;
  }
}
