/*
 * MindKite design tokens, from the brand's tokens.css (docs/decisions.md, EY-45). Every colour in the app comes from
 * here, so the brand is one file to change. PROPOSAL pending Ed's approval: the domain colours (indigo, mulberry,
 * clay, which also make up the logo) and the fonts (EY-44).
 *
 * - HOLD, STOP and SWITCH are equally dark on purpose and always carry their glyph and word, so nothing relies on
 *   colour alone. Each domain colour is used only where that domain appears, never as an action colour.
 * - One colour, `position`, for all four positions and "Not enough evidence": nothing is a scale.
 * - No red, amber or green anywhere. Problems are shown with an alert mark, bold words and a 2px `ink` border.
 * - Dark theme follows the device on screen; print is always light; `data-theme` on <html> can force either.
 */

@font-face {
  font-family: 'Outfit';
  src: url('./fonts/Outfit-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Nunito Sans';
  src: url('./fonts/NunitoSans-Variable.woff2') format('woff2');
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}

:root,
[data-theme='light'] {
  color-scheme: light;
  /* brand constants: the same in both themes */
  --spool: #26221f;
  --linen: #faf7f2;
  --hold-reverse: #a9b6ee;
  --stop-reverse: #e7a6cf;
  --switch-reverse: #f0ad86;
  /* grounds */
  --paper: #faf7f2;
  --surface: #ffffff;
  --panel: #f1ece4;
  --sky: #e6edf1;
  /* text and actions */
  --ink: #26221f;
  --ink-muted: #5f5852;
  --ink-hover: #45403b;
  --on-ink: #ffffff;
  /* lines */
  --line: #ded7cd;
  --line-strong: #847b72;
  --focus-ring: var(--ink);
  /* domains: each only where that domain appears */
  --hold: #38488a;
  --hold-tint: #e8ebf6;
  --stop: #7a3462;
  --stop-tint: #f5e7f0;
  --switch: #94461f;
  --switch-tint: #f7e9e1;
  /* positions and "Not enough evidence": one colour, no scale */
  --position: #3f4b5b;
  --position-tint: #eceff3;
  /* status: system feedback only, never about a child */
  --status-done: var(--sky);
  --status-waiting: var(--panel);
  --status-problem: var(--ink);
  /* depth */
  --backdrop: rgba(38, 34, 31, 0.45);
  --shadow-raised: 0 1px 2px rgba(38, 34, 31, 0.08), 0 2px 8px rgba(38, 34, 31, 0.06);
  --shadow-overlay: 0 12px 32px rgba(38, 34, 31, 0.18);
}

[data-theme='dark'] {
  color-scheme: dark;
  --paper: #161412;
  --surface: #1f1c19;
  --panel: #282420;
  --sky: #1e272e;
  --ink: #f3eee7;
  --ink-muted: #b8afa6;
  --ink-hover: #d8d0c6;
  --on-ink: #1f1c19;
  --line: #3a342f;
  --line-strong: #8f867d;
  --hold: #a9b6ee;
  --hold-tint: #262c45;
  --stop: #e7a6cf;
  --stop-tint: #3a2333;
  --switch: #f0ad86;
  --switch-tint: #3d2a1e;
  --position: #c3ccd8;
  --position-tint: #252a31;
  --backdrop: rgba(0, 0, 0, 0.6);
  --shadow-raised: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-overlay: 0 12px 32px rgba(0, 0, 0, 0.5);
}

/* Screen only: printed reports always use the light theme. */
@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --paper: #161412;
    --surface: #1f1c19;
    --panel: #282420;
    --sky: #1e272e;
    --ink: #f3eee7;
    --ink-muted: #b8afa6;
    --ink-hover: #d8d0c6;
    --on-ink: #1f1c19;
    --line: #3a342f;
    --line-strong: #8f867d;
    --hold: #a9b6ee;
    --hold-tint: #262c45;
    --stop: #e7a6cf;
    --stop-tint: #3a2333;
    --switch: #f0ad86;
    --switch-tint: #3d2a1e;
    --position: #c3ccd8;
    --position-tint: #252a31;
    --backdrop: rgba(0, 0, 0, 0.6);
    --shadow-raised: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-overlay: 0 12px 32px rgba(0, 0, 0, 0.5);
  }
}

:root {
  /* spacing: a 4px base and an 8px rhythm */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-8: 48px;
  --space-10: 64px;
  /* shape */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --hairline: 1px;
  --rule-strong: 2px;
  /* size */
  --tap-min: 44px;
  --measure: 680px;
  --page-max: 1080px;
  --mark-min: 24px;
  --lockup-min: 120px;
  /* type: Outfit for the wordmark, headings and domain words; Nunito Sans for everything people read */
  --font-display: 'Outfit', 'Segoe UI', Arial, sans-serif;
  --font-sans: 'Nunito Sans', 'Segoe UI', Arial, sans-serif;
  --font-child: 'Andika', 'Nunito Sans', Arial, sans-serif;
}
