/* ==========================================================================
   Design tokens
   Single source of truth for colors, type, spacing and motion.
   Change a value here and it updates everywhere on the site.

   Brand (see brand/board.html): warm monochrome. Bone, mist, stone, taupe
   and onyx; Archivo Expanded caps with wide tracking; light body text.

   THEMES
   The values in :root are the light theme. The dark theme, further down,
   only re-defines the color tokens. Which theme applies is decided by the
   data-theme attribute on <html> (set before first paint by the inline
   script in index.html, toggled by scripts/features/theme.js).

   Think of the color tokens as roles, not fixed colors:
     --color-paper  the page background        --color-ink   text and lines on it
     --color-mist / --color-stone / --color-taupe   tinted section backgrounds
                                                    (always paired with ink text)
     --color-band   the darkest sections (statement, about, footer)
     --color-on-band / --color-on-dark / --color-subtle   text on a band
   ========================================================================== */

:root {
  color-scheme: light;

  /* ---- Surfaces and text (light theme) ---- */
  --color-paper: #ede8e3;          /* Bone: page background */
  --color-ink: #1e1e1e;            /* Onyx: text, borders, solid buttons */
  --color-mist: #d4cdc6;           /* Mist: soft bands and cards */
  --color-stone: #b7aea8;          /* Stone: panels, hover fills */
  --color-taupe: #9d948c;          /* Taupe: deeper panels */
  --color-muted: #5a544f;          /* secondary text on paper and mist only */
  --color-line: #cfc8c0;           /* hairline borders on paper */

  /* RGB triplets of ink and paper, for translucent lines and fills:
     rgb(var(--ink-rgb) / .2) */
  --ink-rgb: 30 30 30;
  --paper-rgb: 237 232 227;

  /* ---- Bands: the darkest sections. Dark in both themes. ---- */
  --color-band: #1e1e1e;
  --color-on-band: #ede8e3;        /* headings and primary text on a band */
  --color-on-dark: #d4cdc6;        /* body text on a band */
  --color-subtle: #a39a92;         /* tertiary text on a band */

  /* ---- Accent: decorative rules, dots and large accent text.
          Same in both themes. Never use for small text. ---- */
  --color-accent: #9d948c;

  /* ---- Feedback ---- */
  --color-error: #b3261e;          /* form errors */

  /* ---- Typography: one family, two voices ----
     Display = Archivo Expanded Medium, uppercase, tracked.
     Body    = Archivo Light. */
  --font-body: Archivo, 'Helvetica Neue', Arial, sans-serif;
  --font-display: Archivo, 'Helvetica Neue', Arial, sans-serif;
  --stretch-display: 125%;             /* font-stretch for display text */
  --weight-display: 500;
  --weight-body: 300;
  --tracking-display: .06em;           /* headings */
  --tracking-caps: .3em;               /* small uppercase labels, buttons, nav */

  /* Type scale. Use these instead of raw sizes so the same kind of text is
     the same size in every section. (Display type such as the hero name,
     statement, stats and footer headline keeps its own sizes.) */
  --text-num: 12px;                                 /* small index numbers: 01, 02 */
  --text-sm: 14px;                                  /* meta, captions, secondary lines */
  --text-base: 16px;                                /* body copy, card text, quotes */
  --text-lead: 17px;                                /* short intro lines beside titles */
  --text-lg: clamp(18px, 1.6vw, 21px);              /* card and item titles */
  --text-xl: clamp(20px, 2vw, 26px);                /* lead sentences, case and FAQ titles */
  --heading-md: clamp(26px, 3.4vw, 50px);           /* section titles in side-by-side layouts */
  --heading-lg: clamp(30px, 4.4vw, 64px);           /* full-width section titles */

  /* ---- Spacing ---- */
  --gutter: max(clamp(20px, 5.5vw, 80px), calc((100vw - 1440px) / 2), env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  --section-y: clamp(64px, 8vw, 120px);     /* default top/bottom section padding */

  /* ---- Shape ---- */
  --radius-box: 4px;               /* every card, tile and panel corner */
  --radius-pill: 999px;            /* buttons, tags, filter tray */

  /* ---- Motion ---- */
  --ease: cubic-bezier(.23, 1, .32, 1);
}

/* ==========================================================================
   Dark theme: the same roles, re-valued. Paper and ink trade places, the
   tinted surfaces become deep warm greys, and bands go one step darker
   than the page.
   ========================================================================== */

:root[data-theme="dark"] {
  color-scheme: dark;

  --color-paper: #171615;
  --color-ink: #ede8e3;
  --color-mist: #211f1d;
  --color-stone: #2b2826;
  --color-taupe: #383430;
  --color-muted: #a8a099;
  --color-line: #34302c;

  --ink-rgb: 237 232 227;
  --paper-rgb: 23 22 21;

  --color-band: #0d0d0c;

  --color-error: #f2b8b5;
}
