/*
  Responderme design tokens
  Mirrors DESIGN.md (version 1.1, 2026-12-01). Change values here and in
  DESIGN.md together. Pages and components use these names, never raw values.

  Themes
    Light is the default.
    The ink theme applies in two places:
      1. any element with class="band-ink" (navy bands on the light page)
      2. the whole page when the visitor's device is set to dark
    To lock the site to light, add data-theme="light" to <html>.
*/

:root {
  color-scheme: light dark;

  /* Palette (fixed values; use the role tokens below in components) */
  --white: #FFFFFF;
  --paper-alt: #F2F5F8;
  --ink-900: #0B1B2B;
  --ink-800: #13283C;
  --ink-700: #24384C;
  --ink-600: #44576A;
  --ink-500: #617385;
  --ink-200: #D5DDE5;
  --mist-100: #F4F7FA;
  --mist-300: #9DAEBF;
  --mist-500: #8496A8;
  --mist-700: #3B5066;
  --gold-500: #F4B223;
  --gold-600: #E2A416;

  /* Color roles: light theme */
  --color-bg: var(--white);
  --color-bg-alt: var(--paper-alt);
  --color-text: var(--ink-900);
  --color-text-muted: var(--ink-600);
  --color-border: var(--ink-200);
  --color-border-strong: var(--ink-500);
  --color-ink: var(--ink-900);
  --color-accent: var(--gold-500);
  --color-accent-hover: var(--gold-600);
  --color-accent-soft: #FFF1C2;
  --color-inverse-bg: var(--ink-900);
  --color-inverse-text: var(--white);
  --color-inverse-hover: var(--ink-700);
  --color-success: #17693F;
  --color-success-soft: #E3F3EA;
  --color-warning: #8A4B00;
  --color-warning-soft: #FFEEDC;
  --color-error: #B3261E;
  --color-error-soft: #FCEBE9;
  --color-focus: var(--ink-900);
  --color-button-border: var(--ink-900);

  /* Typography */
  --font-display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --weight-regular: 400;
  --weight-bold: 700;

  /* Fluid sizes run from a 360px screen to 1280px */
  --text-stat: clamp(4rem, 3.217rem + 3.478vw, 6rem);          /* 64 to 96px */
  --text-display: clamp(2.75rem, 1.967rem + 3.478vw, 4.75rem); /* 44 to 76px */
  --text-h2: clamp(2rem, 1.609rem + 1.739vw, 3rem);            /* 32 to 48px */
  --text-h3: 1.375rem;                                         /* 22px */
  --text-lead: clamp(1.25rem, 1.201rem + 0.217vw, 1.375rem);   /* 20 to 22px */
  --text-body: 1.125rem;                                       /* 18px */
  --text-small: 1rem;                                          /* 16px, the floor */
  --text-label: 1.125rem;                                      /* 18px, uppercase */

  --leading-stat: 0.95;
  --leading-display: 1.05;
  --leading-h2: 1.1;
  --leading-h3: 1.25;
  --leading-lead: 1.5;
  --leading-body: 1.6;
  --leading-small: 1.5;
  --leading-label: 1.2;
  --tracking-label: 0.06em;

  /* Spacing (4px base) */
  --space-1: 0.25rem;  /* 4px */
  --space-2: 0.5rem;   /* 8px */
  --space-3: 0.75rem;  /* 12px */
  --space-4: 1rem;     /* 16px */
  --space-5: 1.5rem;   /* 24px */
  --space-6: 2rem;     /* 32px */
  --space-7: 3rem;     /* 48px */
  --space-8: 4rem;     /* 64px */
  --space-9: 6rem;     /* 96px */
  --space-10: 8rem;    /* 128px */

  /* Layout */
  --section-y: clamp(4rem, 2.826rem + 5.217vw, 7rem);   /* 64 to 112px */
  --gutter: clamp(1.25rem, 0.957rem + 1.304vw, 2rem);   /* 20 to 32px */
  --container: 72rem;
  --measure: 40rem;
  --target-min: 3rem;     /* 48px */
  --target-main: 3.5rem;  /* 56px */
  --header-height: 4rem;  /* 64px; 72px from 900px */
  /* Breakpoints, for reference (custom properties cannot be used in media
     queries): 600px, 900px, 1200px */

  /* Shape, borders, depth */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --border-thin: 1px;
  --border-thick: 2px;
  --stripe: 8px;
  --shadow-float: 0 8px 24px rgb(11 27 43 / 0.16);

  /* Focus and motion */
  --focus-width: 3px;
  --focus-offset: 3px;
  --duration: 120ms;
  --ease: ease-out;
}

/* Ink theme: navy bands inside the light page */
.band-ink {
  color-scheme: dark;
  --color-bg: var(--ink-900);
  --color-bg-alt: var(--ink-800);
  --color-text: var(--mist-100);
  --color-text-muted: var(--mist-300);
  --color-border: var(--mist-700);
  --color-border-strong: var(--mist-500);
  --color-accent-soft: #3A2F06;
  --color-inverse-bg: var(--mist-100);
  --color-inverse-text: var(--ink-900);
  --color-inverse-hover: var(--ink-200);
  --color-success: #6FD49B;
  --color-success-soft: #123524;
  --color-warning: #FFB86B;
  --color-warning-soft: #3A2708;
  --color-error: #FF9A91;
  --color-error-soft: #3F1A17;
  --color-focus: var(--gold-500);
  --color-button-border: var(--gold-500);
}

/* Ink theme: whole page, when the device is set to dark */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg: var(--ink-900);
    --color-bg-alt: var(--ink-800);
    --color-text: var(--mist-100);
    --color-text-muted: var(--mist-300);
    --color-border: var(--mist-700);
    --color-border-strong: var(--mist-500);
    --color-accent-soft: #3A2F06;
    --color-inverse-bg: var(--mist-100);
    --color-inverse-text: var(--ink-900);
    --color-inverse-hover: var(--ink-200);
    --color-success: #6FD49B;
    --color-success-soft: #123524;
    --color-warning: #FFB86B;
    --color-warning-soft: #3A2708;
    --color-error: #FF9A91;
    --color-error-soft: #3F1A17;
    --color-focus: var(--gold-500);
    --color-button-border: var(--gold-500);
  }
}

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

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