/* ============================================================
   MAGNA BUREAU — DESIGN TOKENS v1.0
   Dark is the default theme. Light via [data-theme="light"].
   4px base grid. All color pairs meet WCAG 2.2 AA (4.5:1).
   ============================================================ */

/* ---------- Self-hosted fonts ---------- */
@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader-latin-normal.woff2") format("woff2");
  font-weight: 400 700; font-style: normal; font-display: swap;
  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: "Newsreader";
  src: url("fonts/newsreader-latin-ext-normal.woff2") format("woff2");
  font-weight: 400 700; font-style: normal; font-display: swap;
  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: "Newsreader";
  src: url("fonts/newsreader-latin-italic.woff2") format("woff2");
  font-weight: 400 700; font-style: italic; font-display: swap;
  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: "Newsreader";
  src: url("fonts/newsreader-latin-ext-italic.woff2") format("woff2");
  font-weight: 400 700; font-style: italic; font-display: swap;
  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";
  src: url("fonts/inter-latin-normal.woff2") format("woff2");
  font-weight: 400 700; font-style: normal; font-display: swap;
  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: "Inter";
  src: url("fonts/inter-latin-ext-normal.woff2") format("woff2");
  font-weight: 400 700; font-style: normal; font-display: swap;
  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;
}

:root,
:root[data-theme="dark"] {
  color-scheme: dark;

  /* Surfaces */
  --bg-base: #0C111D;
  --surface-1: #121A2B;
  --surface-2: #1A2438;
  --surface-3: #222F4A;
  --border: #263250;
  --border-strong: #35436B;

  /* Text — F2F5FA on 0C111D = 15.9:1 · A9B4C8 on 0C111D = 7.4:1 */
  --text-primary: #F2F5FA;
  --text-secondary: #A9B4C8;
  --text-tertiary: #7E8BA3;

  /* Brand gold — C8A24A on 0C111D = 7.1:1 (AA pass for text) */
  --gold: #C8A24A;
  --gold-hover: #E0BD62;
  --gold-ink: #0C111D;          /* text on gold fills */
  --gold-soft: rgba(200, 162, 74, 0.12);

  /* LENS colors — meaning-locked: ONLY ever denote a lens */
  --lens-west: #4C8DFF;
  --lens-east: #B084FF;
  --lens-south: #2EC4B6;

  /* RATING colors — meaning-locked: ONLY ever denote risk */
  --rating-critical: #FF4D5E;
  --rating-tense: #FFB020;
  --rating-calm: #7A8CA5;
  --rating-critical-bg: rgba(255, 77, 94, 0.12);
  --rating-tense-bg: rgba(255, 176, 32, 0.12);
  --rating-calm-bg: rgba(122, 140, 165, 0.14);

  /* Links */
  --link: #8FB0FF;
  --link-hover: #B9CCFF;

  /* Typography */
  --font-serif: "Newsreader", "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;

  /* Type scale (1.25 major-third) */
  --text-xs: 0.75rem;    /* 12 */
  --text-sm: 0.875rem;   /* 14 */
  --text-base: 1rem;     /* 16 */
  --text-lg: 1.125rem;   /* 18 — article body */
  --text-xl: 1.25rem;    /* 20 */
  --text-2xl: 1.5rem;    /* 24 */
  --text-3xl: 2rem;      /* 32 */
  --text-4xl: 2.5rem;    /* 40 */
  --text-5xl: 3.5rem;    /* 56 */

  --leading-tight: 1.15;
  --leading-snug: 1.35;
  --leading-body: 1.65;
  --leading-loose: 1.8;

  /* Spacing — 4px base */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;
  --sp-12: 48px; --sp-16: 64px; --sp-20: 80px; --sp-24: 96px;

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-full: 999px;

  /* Layout */
  --measure-article: 680px;
  --measure-wide: 1200px;
  --header-h: 64px;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 150ms;
  --dur-med: 250ms;

  /* Shadows — minimal */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);

  /* Focus */
  --focus-ring: 0 0 0 3px rgba(200, 162, 74, 0.45);

  /* Skeleton */
  --skeleton: var(--surface-2);
  --skeleton-shine: var(--surface-3);
}

:root[data-theme="light"] {
  color-scheme: light;

  --bg-base: #FAF8F3;
  --surface-1: #FFFFFF;
  --surface-2: #F3EFE6;
  --surface-3: #EAE4D6;
  --border: #E3DFD3;
  --border-strong: #CFC8B4;

  /* 101828 on FAF8F3 = 14.8:1 · secondary tuned for AA */
  --text-primary: #101828;
  --text-secondary: #3E4A5E;
  --text-tertiary: #667085;

  /* Gold darkened for AA on paper: 8A6D2B on FAF8F3 = 4.6:1 */
  --gold: #8A6D2B;
  --gold-hover: #6E5620;
  --gold-ink: #FFFFFF;
  --gold-soft: rgba(138, 109, 43, 0.1);

  /* Lens hues hold on light; west/east darkened one step for AA text use */
  --lens-west: #2F6FE4;
  --lens-east: #7A4FE0;
  --lens-south: #0E8C7E;

  --rating-critical: #D92D42;
  --rating-tense: #B25E00;
  --rating-calm: #5B6B82;
  --rating-critical-bg: rgba(217, 45, 66, 0.08);
  --rating-tense-bg: rgba(178, 94, 0, 0.1);
  --rating-calm-bg: rgba(91, 107, 130, 0.1);

  --link: #1D4ED8;
  --link-hover: #1E40AF;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.08);
  --shadow-md: 0 4px 16px rgba(16, 24, 40, 0.1);
  --focus-ring: 0 0 0 3px rgba(138, 109, 43, 0.35);
  --skeleton: var(--surface-2);
  --skeleton-shine: var(--surface-3);
}

/* ---------- Breakpoints (documented; use in media queries) ----------
   --bp-sm: 360px · --bp-md: 768px · --bp-lg: 1024px · --bp-xl: 1440px
   Mobile-first: base styles target 360px; enhance at 768 / 1024 / 1440.
------------------------------------------------------------------------ */
