/**
 * Platform design tokens.
 *
 * Source of truth: the NCHM brand system (NCHM Identity Presentation v1.0),
 * delivered in the Claude Design handoff and adopted by SPEC.md D-49 so that
 * tools.nchm.org is visually continuous with nchm.org. The handoff's own token
 * files are kept verbatim under tools/limits/design/handoff/tokens/ for
 * comparison.
 *
 * Every tool on tools.nchm.org uses these. Nothing tool-specific belongs here
 * (CLAUDE.md rule 12).
 *
 * Theme: light only for v1.
 */

@import './tokens/colors.css';
@import './tokens/typography.css';
@import './tokens/spacing.css';

:root {
  /* ==========================================================
     Accessibility corrections to the brand palette
     ==========================================================
     SPEC.md Section 8 makes WCAG 2.2 AA a launch gate, so where a
     brand value cannot carry a role accessibly, the role gets a
     corrected value and the brand colour keeps its own name.
     ---------------------------------------------------------- */

  /* Brand Cherry reaches only 4.41:1 on white — under the 4.5 floor for
     normal text, and lower still on --surface-page and --status-danger-bg.
     This is Cherry darkened along its own hue until it clears all three:
     5.36 on white, 5.00 on gray-50, 4.51 on the danger tint. Use it for
     error *text*; --cherry itself remains correct for icons, rules and
     fills, which answer to the 3:1 non-text threshold. */
  --status-danger-text: #cc292b;

  /* --border-focus is defined as Sky in the brand file and reaches 2.82:1
     on white, under the 3:1 non-text minimum (WCAG 2.2 SC 1.4.11). The
     design's actual focus treatment is DESIGN_SPEC's sunray-on-navy ring,
     which the prototype uses and which passes, so that is what the focus
     tokens carry. Sky stays available as a brand accent. */
  --focus-ring-color: var(--sunray);
  --focus-ring-width: 2px;
  --focus-ring-offset: 2px;

  /* ==========================================================
     DESIGN_SPEC Section 3 compatibility
     ==========================================================
     Section 3 names seven tokens and Section 9 says components are
     written against those names. D-49 changed their values, not the
     contract, so the names keep resolving — onto the brand system.
     ---------------------------------------------------------- */

  --paper: var(--white);
  --mist: var(--gray-50);
  --rule: var(--border-default);
  --slate: var(--text-muted);
  --brick: var(--status-danger-text);

  /* Section 3 type scale, mapped onto the brand scale. */
  --size-13: var(--fs-caption);
  --size-16: var(--fs-body);
  --size-20: var(--fs-h5);
  --size-25: var(--fs-h4);
  --size-31: var(--fs-h3);
  --size-39: var(--fs-h2);

  --font-heading: var(--font-display);
  --font-figures: var(--font-mono);

  --line-body: var(--lh-body);
  --measure: 72ch; /* body lines no longer than about 72 characters */

  --radius: var(--radius-xs);
  --content-max: var(--container-max);
  --gutter: var(--space-5);
  --motion-fast: var(--dur-base);
}

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