/* Baseline: the shared base settings for every front end (#370). The one place for colours, font families and
   weights, the type scale, the spacing scale, borders and radii. A colour or font change happens here once.
   Each area keeps its own small stylesheet on top and only picks from this file:
     - public text pages: site/assets/site.css  (copied from here to <site>/assets/tokens.css by site_build)
     - private admin:     app/static/admin.css  (this file is served read-only at /static/tokens.css)
   Rule: no colour value (hex, rgb, rgba) outside this file. tests/test_site_rules.py fails any that appears in an area file.
   Names here are neutral (--color-*, --app-*, --text-*, --space-*); each area maps its own older names (--c-bg, --sp-3 ...)
   onto them, so templates and rules did not change.
   Haffer XH is the trial licence, fine for preview; the licence is bought before 27 Nov. */

:root {
  /* ---- colour: shared by every area ---- */
  --color-ink: #1b1e14;       /* headings, strong text */
  --color-text: #3a3d34;      /* body text */
  --color-muted: #6b6f64;     /* secondary text */
  --color-white: #ffffff;
  --color-accent: #2f5fc4;    /* links, focus */

  /* ---- colour: public text pages (light only) ---- */
  --color-paper: #fafaf7;     /* page background */
  --color-lede: #55594f;      /* intro paragraph */
  --color-faint: #a6a99f;     /* wordmark in the nav, code labels */
  --color-line: #e4e6e0;
  --color-panel: #f6f6f3;     /* title bar of the terminal card */
  --color-accent-soft: #eef3fd;
  --color-dot-1: #e3342f;
  --color-dot-2: #f4c21b;
  --color-dot-3: #5db33f;
  /* the soft half of each dot pair (Figma node 194:2), one per sidebar item for the Highlight hover (#580) */
  --color-dot-peach: #F9D0A7;  /* About (pair: orange #F08A24) */
  --color-dot-butter: #FBE7A4; /* How we check prices (pair: yellow #F4C21B) */
  --color-dot-lilac: #D2B4E9;  /* How we visit stores (pair: purple #8E44C8) */
  --color-dot-mint: #BEE1B2;   /* BaselineBot (pair: green #5DB33F) */
  /* the rest of the home page's nine dots (#593, Figma node 194:2); ink, peach, butter and dot-1/2/3 are above */
  --color-dot-purple: #8E44C8;
  --color-dot-blue: #2F6FE0;
  --color-dot-orange: #F08A24;
  --shadow-card: 0 8px 24px -4px rgba(26, 31, 20, 0.07), 0 1px 2px 0 rgba(26, 31, 20, 0.05);

  /* ---- colour: private admin (light; dark values below) ---- */
  --app-bg: #F9F9F4;          /* page */
  --app-surface: #FFFFFF;     /* cards, tables, inputs */
  --app-soft: #F1F1EA;        /* hover rows, nav hover */
  --app-ink: var(--color-ink);
  --app-body: var(--color-text);
  --app-muted: var(--color-muted);
  --app-faint: #7C8076;       /* stale and placeholder text */
  --app-line: #E4E4DA;        /* dividers */
  --app-line-strong: #D2D2C6; /* input and tag borders */
  --app-ok: #2F7A32;
  --app-warn: #9A5B0C;
  --app-bad: #B3261E;
  --app-link: var(--color-accent);
  --app-focus: var(--color-accent);
  --app-nav-active-bg: #FFFFFF;
  --app-shadow: 0 1px 0 rgba(27, 30, 20, .03);

  /* ---- fonts ---- */
  --font-sans: "Haffer XH", "Haffer XH Fallback", system-ui, -apple-system, sans-serif;
  --font-mono-brand: "Haffer XH Mono", "Haffer XH Mono Fallback", ui-monospace, monospace;
  --font-mono-system: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --weight-regular: 400;      /* two weights only */
  --weight-strong: 500;
  /* Haffer XH vertical metrics, as fractions of the font size (OS/2 and hhea agree: ascent 950, descent 240, cap 700
     per 1000). site.css uses them to place a line's cap top, so columns line up on capitals, not on boxes (#580). */
  --font-sans-ascent: 0.95;
  --font-sans-descent: 0.24;
  --font-sans-cap: 0.7;

  /* ---- type scale (rem) and line heights ---- */
  --text-xs: 0.75rem;         /* 12px */
  --text-sm: 0.875rem;        /* 14px */
  --text-md: 1rem;            /* 16px */
  --text-lg: 1.125rem;        /* 18px */
  --text-xl: 1.5rem;          /* 24px */
  --text-2xl: 1.875rem;       /* 30px */
  --leading-tight: 1.25;
  --leading-body: 1.5;

  /* ---- spacing scale ---- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  /* ---- borders and radii ---- */
  --border-width: 1px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;
}

/* The admin follows the system dark setting. Only the --app-* colours change, so the public pages stay light. */
@media (prefers-color-scheme: dark) {
  :root {
    --app-bg: #14150F;
    --app-surface: #1C1E16;
    --app-soft: #252820;
    --app-ink: #F2F2EA;
    --app-body: #D3D4C9;
    --app-muted: #A2A598;
    --app-faint: #8C9084;
    --app-line: #2C2F26;
    --app-line-strong: #3C4034;
    --app-ok: #6FC273;
    --app-warn: #E2A655;
    --app-bad: #F0877F;
    --app-link: #8FB0F5;
    --app-focus: #8FB0F5;
    --app-nav-active-bg: #252820;
    --app-shadow: none;
  }
}
