/* =========================================================================
   Steady Chapter design tokens
   Calm, clear, Australian. Ink-blue accent with warm paper neutrals.
   semantic mapping (swap the lower block for dark mode later).
   ========================================================================= */

/*
 * Selected display direction: Lyon Display.
 * The bundled Steady Display files are a Literata proxy until the licensed
 * Lyon webfont files are supplied. Local Lyon installations take precedence.
 * Font licences live in /styleguide/fonts/.
 */
@font-face {
  font-family: "Steady Display";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src:
    local("Lyon Display"),
    local("Lyon Display Web"),
    url("./fonts/steady-display-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: "Steady Display";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src:
    local("Lyon Display"),
    local("Lyon Display Web"),
    url("./fonts/steady-display-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;
}

@font-face {
  font-family: "Steady Display";
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src:
    local("Lyon Display Italic"),
    local("Lyon Display Web Italic"),
    url("./fonts/steady-display-italic-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: "Steady Display";
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src:
    local("Lyon Display Italic"),
    local("Lyon Display Web Italic"),
    url("./fonts/steady-display-italic-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;
}

@font-face {
  font-family: "Commissioner";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("./fonts/commissioner-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: "Commissioner";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("./fonts/commissioner-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;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("./fonts/jetbrains-mono-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: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("./fonts/jetbrains-mono-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 {
  /* ----- Palette: Paper (warm domestic neutrals) ----- */
  --paper-50: #fffaf4; /* page background */
  --paper-100: #f7f0e7; /* surface, cards on page */
  --paper-200: #eee1d1; /* hover surface, quiet dividers */
  --paper-300: #d9c8b7; /* borders, rule lines */
  --paper-400: #b6a392; /* muted, disabled */

  /* ----- Palette: Ink (text + structure) ----- */
  --ink-900: #263348; /* display text */
  --ink-800: #352b27; /* primary text */
  --ink-700: #403833; /* body text */
  --ink-600: #75665d; /* secondary text */
  --ink-500: #75665d; /* tertiary and captions, AA on paper */
  --ink-400: #a39388; /* placeholder */
  --ink-300: #c2b3a6; /* faint */

  /* Compatibility alias used by existing page-scoped styles. */
  --ink-muted: var(--ink-500);

  /* ----- Palette: Ink blue (primary accent) ----- */
  --brand-50: #edf0f5;
  --brand-100: #dce2ea;
  --brand-200: #cbd3df;
  --brand-300: #aab7ca;
  --brand-400: #7183a0;
  --brand-500: #32415c;
  --brand-600: #263348;
  --brand-700: #1f2b3e;
  --brand-800: #182235;

  /* Legacy aliases retained while component names are migrated. */
  --euc-50: var(--brand-50);
  --euc-100: var(--brand-100);
  --euc-200: var(--brand-200);
  --euc-300: var(--brand-300);
  --euc-400: var(--brand-400);
  --euc-500: var(--brand-500);
  --euc-600: var(--brand-600);
  --euc-700: var(--brand-700);
  --euc-800: var(--brand-800);

  /* ----- Brand accents (pillar themes — used sparingly) ----- */
  --gold: #6f858b; /* Muted secondary accent */
  --terracotta: #557d8a; /* AI agent / annotation */
  --plum: #657589; /* Property and finance track */

  /* ----- Palette: Signal (semantic, used sparingly) ----- */
  --signal-care-bg: #f5e8e2; /* care / pause */
  --signal-care-fg: #8a4a33;
  --signal-care-line: #d9b5a4;

  --signal-warn-bg: #f5ebd4;
  --signal-warn-fg: #7a5a1f;
  --signal-warn-line: #ddc78a;

  /* Compatibility alias used by existing caution states. */
  --signal-caution-bg: var(--signal-warn-bg);
  --signal-caution-fg: var(--signal-warn-fg);
  --signal-caution-line: var(--signal-warn-line);
  --signal-caution-border: var(--signal-caution-line);

  --signal-stop-bg: #f0dad2;
  --signal-stop-fg: #8b3a2a;
  --signal-stop-line: #d4a293;

  --signal-ok-bg: #e2ebe2;
  --signal-ok-fg: #3f5e3f;
  --signal-ok-line: #b5c8b5;

  /* ----- Semantic mapping (use these in components) ----- */
  --bg-page: var(--paper-50);
  --bg-surface: var(--paper-100);
  --bg-raised: #fffdfc;
  --bg-hover: var(--paper-200);
  --bg-muted: var(--paper-200);
  --bg-overlay: rgba(17, 27, 44, 0.52);

  --border-subtle: var(--paper-200);
  --border-default: var(--paper-300);
  --border-strong: var(--ink-300);

  --text-display: var(--ink-900);
  --text-primary: var(--ink-800);
  --text-body: var(--ink-700);
  --text-secondary: var(--ink-600);
  --text-tertiary: var(--ink-500);
  --text-muted: var(--ink-400);
  --text-placeholder: var(--ink-600);
  --text-on-accent: #fffaf4;
  --text-link: var(--brand-600);
  --accent-fg: var(--text-on-accent);

  /* Focus must remain visible without relying on colour or soft shadows alone. */
  --focus-ring: var(--brand-600);
  --focus-ring-inverse: var(--paper-50);

  --accent: var(--brand-500);
  --accent-hover: var(--brand-600);
  --accent-press: var(--brand-700);
  --accent-soft-bg: var(--brand-50);
  --accent-soft-fg: var(--brand-700);

  /* Product pillars share one interface language. Colour is a locator, not decoration. */
  --pillar-journey: #516b73;
  --pillar-journey-soft: #e8eff0;
  --pillar-decisions: #786b4d;
  --pillar-decisions-soft: #f1ecdd;
  --pillar-comms: #6f5d72;
  --pillar-comms-soft: #efe8f0;
  --pillar-record: #53657d;
  --pillar-record-soft: #e8edf3;

  /* Inverse surfaces: the persistent public-site header and dark sections. */
  --surface-inverse: var(--brand-800);
  --surface-inverse-strong: #111b2c;
  --text-on-inverse: var(--paper-50);
  --text-inverse-muted: var(--brand-200);
  --border-inverse: rgba(255, 250, 244, 0.13);

  /* ----- Typography ----- */
  --font-display: "Steady Display", Georgia, serif;
  --font-body: "Commissioner", ui-sans-serif, sans-serif;
  --font-sans: var(--font-body);
  --font-mono:
    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --font-serif: var(--font-display);

  /* Type scale — major-third (1.25) tuned for editorial reading */
  --fs-10: 0.625rem; /* 10 — dense labels */
  --fs-11: 0.6875rem; /* 11 — compact meta */
  --fs-12: 0.75rem; /* 12 — caption */
  --fs-13: 0.8125rem; /* 13 — meta */
  --fs-14: 0.875rem; /* 14 — small */
  --fs-15: 0.9375rem; /* 15 — UI default */
  --fs-16: 1rem; /* 16 — body */
  --fs-17: 1.0625rem; /* 17 — comfortable UI body */
  --fs-18: 1.125rem; /* 18 — large body */
  --fs-20: 1.25rem; /* 20 — h5 */
  --fs-22: 1.375rem; /* 22 — compact section title */
  --fs-24: 1.5rem; /* 24 — h4 */
  --fs-28: 1.75rem; /* 28 — card feature title */
  --fs-30: 1.875rem; /* 30 — h3 */
  --fs-32: 2rem; /* 32 — section title */
  --fs-38: 2.375rem; /* 38 — h2 */
  --fs-40: 2.5rem; /* 40 — compact display */
  --fs-48: 3rem; /* 48 — h1 */
  --fs-64: 4rem; /* 64 — display */

  --lh-tight: 1.15;
  --lh-snug: 1.3;
  --lh-normal: 1.5;
  --lh-relaxed: 1.65;

  --tracking-tight: -0.02em;
  --tracking-snug: -0.01em;
  --tracking-normal: 0;
  --tracking-wide: 0.02em;
  --tracking-caps: 0.14em;

  /* ----- Spacing (4px base) ----- */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-7: 28px;
  --sp-8: 32px;
  --sp-9: 36px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;
  --sp-20: 80px;
  --sp-24: 96px;
  --sp-32: 128px;

  /* ----- Radii — soft, never sharp, never pill-ish for cards ----- */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-2xl: 28px;
  --r-pill: 999px;

  /* Compatibility aliases while page-level CSS moves to the canonical names. */
  --radius-sm: var(--r-sm);
  --radius-md: var(--r-md);
  --radius-lg: var(--r-lg);
  --radius-xl: var(--r-xl);

  /* ----- Shadows — paper-soft, not floaty ----- */
  --shadow-xs: 0 1px 0 rgba(38, 51, 72, 0.04);
  --shadow-sm:
    0 1px 2px rgba(38, 51, 72, 0.05), 0 1px 1px rgba(38, 51, 72, 0.03);
  --shadow-md:
    0 2px 4px rgba(38, 51, 72, 0.05), 0 4px 12px rgba(38, 51, 72, 0.06);
  --shadow-lg:
    0 4px 8px rgba(38, 51, 72, 0.05), 0 12px 32px rgba(38, 51, 72, 0.08);
  --shadow-inset:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -1px 0 rgba(38, 51, 72, 0.03);
  --shadow-focus: 0 0 0 3px var(--focus-ring);

  /* ----- Controls ----- */
  --control-sm: 36px;
  --control-md: 44px;
  --control-lg: 52px;

  /* ----- Motion — unhurried, never bouncy ----- */
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-in-out: cubic-bezier(0.5, 0, 0.2, 1);
  --ease-emphasized: cubic-bezier(0.4, 0, 0.1, 1);

  --dur-instant: 80ms;
  --dur-fast: 160ms;
  --dur-base: 240ms;
  --dur-slow: 400ms;
  --dur-deliberate: 700ms; /* for cooling-off-style affordances */

  /* ----- Layout ----- */
  --content-narrow: 640px;
  --content-prose: 720px;
  --content-wide: 960px;
  --content-max: 1200px;
  --page-gutter: clamp(16px, 4vw, 48px);

  /* ----- Layers ----- */
  --z-base: 0;
  --z-sticky: 20;
  --z-overlay: 40;
  --z-modal: 50;
  --z-toast: 60;
}

/* Honour reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
