/* tokens.css -- every value the rest of the CSS is allowed to use.
 *
 * Layer 1 of 4 (tokens, base, layout, components). Nothing in this file
 * selects an element or sets a property on anything real; it only declares
 * custom properties. That constraint is what makes the admin's brand-colour
 * feature possible: server-rendered pages inject ONE declaration overriding
 * --brand-accent, and every shade downstream re-derives from it because they
 * are written as color-mix() against var(--brand-accent) rather than against a
 * literal.
 *
 * The production site did the opposite -- partials/head.ejs computed seven
 * separate color-mix() expressions inline against the raw admin value, so the
 * injected <style> block grew with every shade added and admin.css carried its
 * own disconnected #f1c40f palette. One property, derived seven ways, is the
 * whole difference.
 *
 * The default below is the same gold the production seed data ships, so a page
 * rendered with no accent injected at all still looks finished.
 */

/* Self-hosted Inter. Variable weight 400-700, so one file covers the whole
 * design; the two subsets are split by unicode-range and the browser fetches
 * latin-ext only if a page actually needs it. font-display: swap means text
 * paints in the fallback immediately rather than waiting on the download. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* ── Brand ────────────────────────────────────────────────────────────
   * --brand-accent is the ONE value an admin controls. Everything below it
   * derives. Overridden by a single nonce'd declaration in the layout. */
  --brand-accent: #c9a227;

  --accent-strong: color-mix(in srgb, var(--brand-accent) 82%, black);
  --accent-soft: color-mix(in srgb, var(--brand-accent) 18%, white);
  --accent-muted: color-mix(in srgb, var(--brand-accent) 40%, white);
  --accent-ring: color-mix(in srgb, var(--brand-accent) 45%, transparent);
  --accent-contrast: #14161a; /* text on an accent fill; the accent is light */

  /* ── Neutrals ─────────────────────────────────────────────────────────
   * A single cool-grey ramp. Named by role, not by lightness, so a component
   * never has to know which end of the scale it sits at. */
  --ink: #14161a;
  --ink-2: #333941;
  --ink-3: #5b636e;
  --ink-4: #858d98;

  --surface: #ffffff;
  --surface-2: #f6f7f9;
  --surface-3: #eceef2;
  --surface-inverse: #14161a;
  --surface-inverse-2: #1e222a;

  --line: #dfe3e9;
  --line-strong: #c4cad3;

  /* ── Status ───────────────────────────────────────────────────────────
   * Used by toasts, badges and field errors. Each has a fill light enough to
   * carry --ink text, so no status colour needs its own text colour. */
  --ok: #1b7f4b;
  --ok-fill: #e6f5ec;
  --warn: #9a6800;
  --warn-fill: #fdf3e0;
  --danger: #b3261e;
  --danger-fill: #fdeceb;
  --info: #1f5f9e;
  --info-fill: #e8f1fa;

  /* ── Type ─────────────────────────────────────────────────────────────
   * Fluid sizes via clamp() so nothing needs a breakpoint to stay readable.
   * The middle term is the viewport-relative part; the outer two are the
   * floor and ceiling. */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
  --text-2xl: clamp(1.5rem, 1.3rem + 1vw, 2rem);
  --text-3xl: clamp(1.875rem, 1.5rem + 1.9vw, 2.75rem);
  --text-4xl: clamp(2.25rem, 1.6rem + 3.2vw, 3.75rem);

  --leading-tight: 1.15;
  --leading-snug: 1.35;
  --leading-normal: 1.6;

  --tracking-tight: -0.02em;
  --tracking-wide: 0.08em;

  /* ── Space ────────────────────────────────────────────────────────────
   * A 4px base, doubling loosely. Components compose from these; no
   * component invents its own number. */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;

  /* ── Shape ────────────────────────────────────────────────────────────── */
  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 14px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgb(20 22 26 / 6%), 0 1px 3px rgb(20 22 26 / 5%);
  --shadow: 0 2px 6px rgb(20 22 26 / 7%), 0 8px 24px rgb(20 22 26 / 6%);
  --shadow-lg: 0 4px 12px rgb(20 22 26 / 9%), 0 24px 48px rgb(20 22 26 / 10%);

  /* ── Motion ───────────────────────────────────────────────────────────
   * base.css zeroes both of these under prefers-reduced-motion, which is why
   * every transition in the tree references a token instead of a literal
   * duration -- one override turns off all of them. */
  --ease: cubic-bezier(0.2, 0, 0.15, 1);
  --dur-fast: 120ms;
  --dur: 220ms;
  --dur-slow: 380ms;

  /* ── Layout ───────────────────────────────────────────────────────────── */
  --measure: 68ch; /* readable line length for long-form copy */
  --container: 1140px;
  --container-narrow: 820px;
  --sidebar: 244px;
  --header-height: 68px;

  --z-header: 100;
  --z-sidebar: 90;
  --z-toast: 200;
}
