/**
 * @file tokens.css
 * @description Nova Soul design tokens (v0.1). The single source of truth for
 * colour, typography, spacing, radii and motion. Every page loads this file
 * first; base.css, components.css and page styles only reference these
 * custom properties, never raw values.
 *
 * Loaded by: every HTML page (first stylesheet).
 * Consumed by: css/base.css, css/components.css, css/styleguide.css.
 *
 * Rule of thumb: components use ROLE tokens (--color-text, --color-ornament),
 * never BRAND tokens (--ns-forest) directly. That way a palette change is a
 * one-line edit here.
 */

:root {
  /* ------------------------------------------------------------------
   * Brand palette (from logo-brand-style). Do not use directly in components.
   * ------------------------------------------------------------------ */
  --ns-forest: #22392b;
  --ns-cream-warm: #efe7d4;
  --ns-cream-light: #f3eee1;
  --ns-gold: #a9884a;
  --ns-brown: #84561a;

  /* ------------------------------------------------------------------
   * Colour roles. Contrast ratios measured against --color-bg (#F3EEE1).
   * ------------------------------------------------------------------ */
  --color-bg: var(--ns-cream-light);
  --color-surface: var(--ns-cream-warm);          /* selected / raised areas */
  --color-text: var(--ns-forest);                 /* 10.7:1, all text */
  --color-text-muted: #4e5e53;                    /* 5.9:1, secondary text */
  --color-link: var(--ns-brown);                  /* 5.5:1, links + small accents */
  --color-ornament: var(--ns-gold);               /* 2.9:1, decoration + large type only */
  --color-line: color-mix(in srgb, var(--ns-forest) 16%, transparent);
  --color-line-strong: color-mix(in srgb, var(--ns-forest) 55%, transparent);
  --color-error: #8c2f1c;                         /* 7.1:1 */
  --color-focus: var(--ns-brown);

  --color-inverse-bg: var(--ns-forest);
  --color-inverse-text: var(--ns-cream-warm);     /* 10.1:1 */
  --color-inverse-accent: var(--ns-gold);         /* 3.7:1, large text + icons only */

  /* ------------------------------------------------------------------
   * Typography.
   * Licensed Garamond Premier Pro (Adobe Fonts) is listed first; the
   * self-hosted open-source Garamonds in assets/fonts are the fallback.
   * ------------------------------------------------------------------ */
  --font-display: "garamond-premier-pro-display", "Cormorant Garamond", Garamond, serif;
  --font-text: "garamond-premier-pro", "EB Garamond", Garamond, serif;

  --weight-light: 300;
  --weight-regular: 400;
  --weight-medium: 500;

  /* Scale: perfect fourth (1.333) on an 18px body, fluid at the top end. */
  --text-xs: 0.8125rem;                                   /* 13px legal, meta */
  --text-s: 0.9375rem;                                    /* 15px help text */
  --text-m: 1.125rem;                                     /* 18px body */
  --text-l: 1.5rem;                                       /* 24px lead, prices */
  --text-xl: clamp(1.75rem, 1.4rem + 1.2vw, 2.25rem);     /* section titles */
  --text-2xl: clamp(2.25rem, 1.6rem + 2.6vw, 3.5rem);     /* page titles */
  --text-hero: clamp(3rem, 1.5rem + 6.5vw, 7rem);         /* hero only */

  --leading-tight: 1.02;
  --leading-snug: 1.2;
  --leading-body: 1.6;

  --tracking-wordmark: 0.32em;
  --measure: 34rem;                                       /* ~65 characters */

  /* ------------------------------------------------------------------
   * Space (4px base) and layout.
   * ------------------------------------------------------------------ */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 5rem;
  --space-9: clamp(5rem, 3rem + 8vw, 10rem);

  --page-max: 76rem;
  --page-gutter: clamp(1.25rem, 0.5rem + 3vw, 3rem);

  /* ------------------------------------------------------------------
   * Shape. Radii follow hierarchy: small controls stay crisp,
   * larger panels soften slightly, like the printed card corners.
   * ------------------------------------------------------------------ */
  --radius-control: 3px;
  --radius-panel: 14px;
  --radius-round: 999px;
  --border-hairline: 1px solid var(--color-line);

  /* ------------------------------------------------------------------
   * Motion. One orchestrated moment per page; everything else responds
   * to user action. Disabled entirely under prefers-reduced-motion.
   * ------------------------------------------------------------------ */
  --ease-settle: cubic-bezier(0.22, 1, 0.36, 1);
  --duration-quick: 160ms;
  --duration-settle: 1600ms;
}

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