/*
  tokens.css: every colour, radius, shadow, spacing step, font and motion value of the site lives here.
  Colour tokens follow the brand palette (docs/release/brand/identity/palette.json in the app repo): Ink #1F3FAE light and
  #9DB4FF dark, Ember for calls to action, Paper and Surface backgrounds, with dark mode under prefers-color-scheme.
  site.css and the illustrations only read them.
  After changing a colour, run: node tools/contrast.mjs
*/
:root {
  color-scheme: light dark;

  /* colour: page */
  --c-bg: #f8f7f4;
  --c-bg-alt: #f0eee8;
  --c-surface: #ffffff;
  --c-surface-2: #f3f1ec;
  --c-text: #16181d;
  --c-text-muted: #525866;
  --c-border: #e2ded5;
  --c-border-strong: #c3beb2;
  --c-field-border: #858a94;
  --c-header-bg: rgba(248, 247, 244, 0.84);

  /* colour: the one accent, plus ink blue */
  --c-accent: #c2410c;
  --c-accent-hover: #9a3412;
  --c-accent-text: #ffffff;
  --c-accent-soft: #fbe6da;
  --c-accent-strong: #9a3412;
  --c-ink: #1f3fae;
  --c-ink-red: #c0262d;
  --c-ink-soft: #e3e9fb;
  --c-ink-ui: #1f3fae;     /* ink blue on the page itself (ticks, dots); --c-ink stays the pen on paper */
  --c-focus: #1f3fae;
  --c-glow-1: rgba(31, 63, 174, 0.10);
  --c-glow-2: rgba(194, 65, 12, 0.08);

  --c-notice-bg: #fff4d6;
  --c-notice-text: #5a3b00;
  --c-notice-border: #e0b24a;

  /* colour: illustrations (the device, its screen and the paper) */
  --c-device: #17191e;
  --c-device-edge: #3a3e47;
  --c-screen: #e7e9ee;
  --c-screen-bar: #ffffff;
  --c-chrome-icon: #5b6170;
  --c-chrome-sel: #dfe6fb;
  --c-paper: #ffffff;
  --c-paper-edge: #dcd8ce;
  --c-paper-line: #d5dbe6;
  --c-paper-grid: #dde5f1;
  --c-paper-grid-major: #b7c6dc;
  --c-print: #23262d;
  --c-print-muted: #646a76;
  --c-highlight: #ffe45c;
  --c-instrument: rgba(150, 190, 230, 0.30);
  --c-instrument-line: #4f6a88;
  --c-compass: #3b414c;
  --c-compass-hi: #8a93a3;
  --c-stylus: #2a2d34;
  --c-stylus-hi: #555b67;
  --c-sub-1: #3f6fd8;
  --c-sub-2: #d9662b;
  --c-sub-3: #2f9a73;
  --c-sub-4: #8a55c7;
  --c-sub-5: #c7417a;
  --c-sub-6: #2a9bb5;
  --c-sub-7: #b58a1f;
  --c-sub-8: #5f6b7d;

  /* type: system faces only, nothing downloaded */
  --f-body: "Segoe UI Variable Text", "Segoe UI Variable", "Segoe UI", -apple-system, BlinkMacSystemFont, "SF Pro Text", Roboto, system-ui, sans-serif;
  --f-display: "Segoe UI Variable Display", "Segoe UI Variable", "Segoe UI", -apple-system, BlinkMacSystemFont, "SF Pro Display", Roboto, system-ui, sans-serif;
  --f-mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
  --fs-hero: clamp(2.4rem, 1.3rem + 3.9vw, 4.6rem);
  --fs-h1: clamp(2.1rem, 1.5rem + 2.4vw, 3.2rem);
  --fs-h2: clamp(1.9rem, 1.3rem + 2.3vw, 3rem);
  --fs-h3: 1.25rem;
  --fs-lede: clamp(1.1rem, 1rem + 0.45vw, 1.35rem);
  --fs-base: 1.0625rem;
  --fs-small: 0.9375rem;
  --fs-xs: 0.8125rem;
  --fs-price: clamp(2.4rem, 2rem + 1.2vw, 3rem);
  --fw-head: 700;
  --lh-body: 1.6;
  --lh-head: 1.08;
  --ls-tight: -0.025em;

  /* spacing */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 1rem;
  --s-4: 1.5rem;
  --s-5: 2.5rem;
  --s-6: 4rem;
  --s-7: 6rem;
  --section-pad: clamp(4.5rem, 3rem + 6vw, 8.5rem);
  --gutter: 1rem;
  --measure: 40rem;
  --wide: 74rem;
  --header-h: 4rem;

  /* shape */
  --r-s: 12px;
  --r-m: 16px;
  --r-l: 24px;
  --r-pill: 999px;
  --border-w: 1px;

  /* depth */
  --sh-1: 0 1px 2px rgba(18, 20, 26, 0.05), 0 4px 14px rgba(18, 20, 26, 0.05);
  --sh-2: 0 2px 6px rgba(18, 20, 26, 0.05), 0 18px 44px rgba(18, 20, 26, 0.10);
  --sh-visual: drop-shadow(0 28px 34px rgba(18, 20, 26, 0.16)) drop-shadow(0 6px 10px rgba(18, 20, 26, 0.08));
  --blur-header: saturate(1.6) blur(14px);

  /* motion: eased, no bounce; all of it is off under prefers-reduced-motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-ink: cubic-bezier(0.45, 0.05, 0.55, 0.95);
  --dur-1: 400ms;
  --dur-2: 650ms;
  --dur-3: 900ms;
  --stagger: 90ms;
  --rise: 28px;
  --ink-speed: 0.55;      /* px of stroke per ms while ink writes itself (read by site.js) */
  --ink-lift: 45;         /* ms between pen strokes (read by site.js) */
  --ink-max: 3200;        /* ms: the longest one figure takes to write (read by site.js) */
  --float: 46;            /* px: the most the hero tablet drifts while scrolling (read by site.js) */
}

@media (prefers-color-scheme: dark) {
  :root {
    --c-bg: #0f1115;
    --c-bg-alt: #15181e;
    --c-surface: #1a1d24;
    --c-surface-2: #22262e;
    --c-text: #eceef2;
    --c-text-muted: #a8afbc;
    --c-border: #2a2f38;
    --c-border-strong: #454c58;
    --c-field-border: #77808e;
    --c-header-bg: rgba(15, 17, 21, 0.80);

    --c-accent: #ff8a57;
    --c-accent-hover: #ffa984;
    --c-accent-text: #1a0d05;
    --c-accent-soft: #3a2216;
    --c-accent-strong: #ffb48f;
    --c-ink-soft: #1c2440;
    --c-ink-ui: #9db4ff;
    --c-focus: #9db4ff;
    --c-glow-1: rgba(110, 140, 255, 0.12);
    --c-glow-2: rgba(255, 138, 87, 0.08);

    --c-notice-bg: #3a2e10;
    --c-notice-text: #ffe2a0;
    --c-notice-border: #8a6a1c;

    --c-device: #050608;
    --c-device-edge: #30343c;
    --c-screen: #20242c;
    --c-screen-bar: #2a2e37;
    --c-chrome-icon: #aeb5c2;
    --c-chrome-sel: #33406a;
    --c-paper: #f4f2ec;
    --c-paper-edge: #3a3e46;

    --sh-1: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 14px rgba(0, 0, 0, 0.3);
    --sh-2: 0 2px 6px rgba(0, 0, 0, 0.4), 0 18px 44px rgba(0, 0, 0, 0.45);
    --sh-visual: drop-shadow(0 28px 34px rgba(0, 0, 0, 0.5)) drop-shadow(0 6px 10px rgba(0, 0, 0, 0.3));
  }
}

@media (min-width: 48rem) {
  :root { --gutter: 2rem; --header-h: 4.25rem; }
}
