/*
 * Pakkelyst design tokens.
 *
 * Derived from Understory's Leaf (structure, scales, soft elevation), made
 * warmer and airier: cream-tinted neutrals instead of cool greys, a forest
 * green instead of pine-on-lime, rounder radii, a looser type rhythm and more
 * space between things. Names follow the published brief v4 so mocks written
 * against the brief keep working. See
 * docs/decisions/our-own-leaf-derived-tokens.md.
 *
 * Fonts: Bricolage Grotesque (display) and Figtree (body), both SIL OFL
 * (licences in static/fonts). Self-hosted so pages make no third-party
 * requests; the latin subset covers Danish.
 */

@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("/static/fonts/bricolage-grotesque-latin.woff2") format("woff2");
}
@font-face {
  font-family: Figtree;
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/static/fonts/figtree-latin.woff2") format("woff2");
}

:root {
  color-scheme: light;

  /* Surfaces, back to front. */
  --bg: #f7f6ef;
  --base: #fbfaf5;
  --raised: #ffffff;
  --sunken: #efeee4;
  --scrim: rgba(46, 40, 22, 0.30);
  --hover: color-mix(in srgb, var(--ink) 3%, var(--raised));
  --disabled-bg: #efeee4;
  --skel: #efeee4;
  --skel-hi: #f8f7f0;
  --media-blend: multiply;

  /* Content. --ink-3 is the lightest text that still passes AA on --bg and --moss. */
  --ink: #1c211b;
  --ink-2: #4a5048;
  --ink-3: #62675c;
  --ink-disabled: #a9ab9e;

  /* Borders. */
  --line: #e8e6dc;
  --line-2: #d3d2c4;
  --line-strong: #8f8f80;

  /* Brand. Forest carries actions and links; meadow is the soft accent. */
  --forest: #245c37;
  --forest-hover: #1d4c2d;
  --forest-active: #173d24;
  --on-forest: #ffffff;
  --meadow: #e4efb0;
  --meadow-hover: #d9e79a;
  --on-meadow: #22471f;
  --meadow-subtle: #e4efb0;
  --on-meadow-subtle: #22471f;
  --moss: #edf0dd;

  /* Tints for chips, categories and states. */
  --rose: #f6dccf;
  --on-rose: #7b3520;
  --sky: #dcebf3;
  --on-sky: #1d4057;
  --straw: #f0ead2;
  --on-straw: #5a4d22;

  /* Status. */
  --positive: #2f6b3a;
  --positive-subtle: #e4efb0;
  --warning: #7a5a12;
  --warning-subtle: #f7ecc0;
  --negative: #a3321f;
  --negative-hover: #8a2918;
  --negative-subtle: #f9ddd3;
  --on-negative: #ffffff;
  --danger: #b3261e;
  --danger-hover: #93201a;
  --on-danger: #ffffff;

  /* A full-width brand band; in dark it stays a raised surface. */
  --band-bg: #245c37;
  --band-ink: #ffffff;
  --band-border: transparent;
  --focus: #245c37;

  /* Toasts stay dark in both themes. */
  --toast-bg: #1c211b;
  --toast-ink: #f7f6ef;
  --toast-accent: #e4efb0;
  --toast-danger: #f0907a;

  /* Elevation: warm-tinted, very soft. */
  --shadow-1: 0 1px 2px rgba(40, 38, 20, 0.05);
  --shadow-2: 0 1px 2px rgba(40, 38, 20, 0.04), 0 8px 24px rgba(40, 38, 20, 0.06);
  --shadow-3: 0 2px 6px rgba(40, 38, 20, 0.05), 0 18px 48px rgba(40, 38, 20, 0.10);
  --shadow-4: 0 4px 12px rgba(40, 38, 20, 0.06), 0 28px 72px rgba(40, 38, 20, 0.18);
  --shadow: var(--shadow-2);

  /* Type. */
  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", sans-serif;
  --body: Figtree, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --text-caption: 500 13px/18px var(--body);
  --text-label: 600 14px/20px var(--body);
  --text-button: 600 15px/20px var(--body);
  --text-body-sm: 400 14px/22px var(--body);
  --text-body: 400 16px/26px var(--body);
  --text-body-lg: 400 18px/30px var(--body);
  --text-title-sm: 600 18px/26px var(--body);
  --text-title: 700 22px/28px var(--display);
  --text-headline: 700 30px/36px var(--display);
  --text-display: 700 clamp(36px, 6vw, 52px)/1.05 var(--display);
  --text-hero: 700 clamp(44px, 8vw, 76px)/1.0 var(--display);
  --tracking-display: -0.02em;
  --tracking-eyebrow: 0.08em;

  /* Space: a 4px grid, with generous steps at the top for sections. */
  --space-0-5: 2px;
  --space-1: 4px;
  --space-1-5: 6px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;
  --space-32: 128px;
  --gutter: 16px;
  --measure: 64ch;
  --page-max: 1140px;

  /* Radii: a step rounder than Leaf throughout. */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 32px;
  --r-full: 999px;

  /* Control sizes. 44px keeps every tap target thumb-sized. */
  --control-sm: 40px;
  --control: 44px;
  --control-lg: 52px;
  --topnav-h: 64px;

  /* Motion. */
  --dur-fast: 120ms;
  --dur: 200ms;
  --dur-slow: 320ms;
  --dur-slower: 480ms;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.4, 0.64, 1);

  /* Layers, from Leaf's scale. */
  --z-raised: 1;
  --z-elevated: 100;
  --z-header: 200;
  --z-drawer: 1000;
  --z-dialog: 2000;
  --z-popover: 3000;
  --z-toast: 4000;
  --z-tooltip: 5000;
}

/* Dark theme: only when the person picks it. Light is the default, whatever
   the OS prefers. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141612;
  --base: #1b1e19;
  --raised: #232720;
  --sunken: #10120e;
  --scrim: rgba(0, 0, 0, 0.56);
  --hover: color-mix(in srgb, var(--ink) 6%, var(--raised));
  --disabled-bg: #2a2e27;
  --skel: #2b2f27;
  --skel-hi: #363b32;
  --media-blend: normal;
  --ink: #f3f2ea;
  --ink-2: #cfd0c4;
  --ink-3: #9a9d90;
  --ink-disabled: #5e6258;
  --line: #2f332b;
  --line-2: #41463c;
  --line-strong: #7d8273;
  --forest: #8fd49a;
  --forest-hover: #a6dfaf;
  --forest-active: #7cc488;
  --on-forest: #10240f;
  --meadow: #cfe38a;
  --meadow-hover: #dbeca0;
  --on-meadow: #1d2a0b;
  --meadow-subtle: #2f3a18;
  --on-meadow-subtle: #e6f2b4;
  --moss: #232a1e;
  --rose: #55302a;
  --on-rose: #f7d2c2;
  --sky: #1d3a4d;
  --on-sky: #d3e8f4;
  --straw: #423a21;
  --on-straw: #ece2bd;
  --positive: #8fd49a;
  --positive-subtle: #2c3a17;
  --warning: #e8c66a;
  --warning-subtle: #40351a;
  --negative: #f0907a;
  --negative-hover: #f5a895;
  --negative-subtle: #4a2219;
  --on-negative: #2a0d06;
  --danger: #ff8a80;
  --danger-hover: #ffa49c;
  --on-danger: #2a0d06;
  --band-bg: #1b3524;
  --band-ink: #f3f2ea;
  --band-border: transparent;
  --focus: #8fd49a;
  --toast-bg: #2e332a;
  --toast-ink: #f3f2ea;
  --toast-accent: #8fd49a;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-2: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-3: 0 2px 6px rgba(0, 0, 0, 0.3), 0 18px 48px rgba(0, 0, 0, 0.4);
  --shadow-4: 0 4px 12px rgba(0, 0, 0, 0.35), 0 28px 72px rgba(0, 0, 0, 0.5);
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-fast: 0ms;
    --dur: 0ms;
    --dur-slow: 0ms;
    --dur-slower: 0ms;
  }
}
