/* Madam Legal Design System, design tokens.
   Generated from tokens.dtcg.json. Do not edit values here; edit the JSON and
   regenerate, otherwise the drift check has nothing to compare against.

   Noir is the :root default because the brand world is near-black.
   Ivory is a full peer, not an inversion: the ground is paper rather than
   ivory, and the entire gold ramp darkens, because the Noir gold measures
   2.06:1 on a light ground and is unusable for text.

   Ratios in the comments are documentation. scripts/check-contrast.mjs
   recomputes them from the source and fails the build on a breach. */

:root {
  /* ── ink: warm neutrals, hue ~35deg. Higher number = darker. ── */
  --ink-950:#0D0B09; --ink-900:#12100D; --ink-850:#161310; --ink-800:#1C1815;
  --ink-700:#23201B; --ink-600:#2E2A24; --ink-500:#423C33; --ink-400:#6B6255;
  --ink-300:#8F8677; --ink-200:#B5AD9D; --ink-100:#D8D1C3; --ink-050:#F2ECDF;

  /* ── gold: brand and emphasis only, never a status ──
     700 and 800 are NON-TEXT in this theme: rims, hairlines, dividers. */
  --gold-200:#F5E4C2; --gold-300:#E6C98C; --gold-400:#D4B478; --gold-500:#C6A15B;
  --gold-600:#A88544; --gold-700:#8A6B32; --gold-800:#5E4820;
  --on-gold:#0D0B09;

  /* ── credential: the consequence surface, 7:1 floor ──
     figure is gold-400, not gold-500: brand gold is 6.69:1 on bedrock. */
  --credential-figure:var(--gold-400);
  --credential-label:var(--ink-200);

  /* ── accent: jewel tones for section grounds. Never a status. ── */
  --emerald:#123B2D; --oxblood:#4A1420;

  /* ── signal: system feedback only. Never colour alone; icon + label + colour. ── */
  --positive:#6FB58C; --caution:#D9A85C; --critical:#D98078;

  /* ── glass material (Noir) ── */
  --blur-chrome:24px; --blur-panel:40px; --blur-lens:64px;
  --sat:190%; --bright:1.06;
  --tint-chrome:rgba(13,11,9,.75);
  --tint-panel:rgba(22,19,16,.70);
  --tint-panel-gold:rgba(198,161,91,.08);
  --edge-bright:rgba(230,201,140,.35);
  --edge-mid:rgba(198,161,91,.15);
  --edge-dim:rgba(242,236,223,.04);
  --spec:rgba(255,255,255,.18);
  --spec-gold:rgba(198,161,91,.22);
  --lens-top:rgba(242,236,223,.22);
  --lens-bot:rgba(0,0,0,.55);
  --ca-cool:rgba(198,161,91,.12);
  --ca-warm:rgba(230,201,140,.14);
  --shadow-glass:0 1px 2px rgba(0,0,0,.40), 0 22px 60px -18px rgba(0,0,0,.82);

  /* ── geometry: inner radius = outer radius minus gap ── */
  --r-xs:6px; --r-sm:10px; --r-md:14px; --r-lg:20px; --r-xl:28px; --r-pill:999px;

  /* ── space: 4px base, component-internal ── */
  --space-1:4px;  --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;

  /* ── rhythm: editorial vertical scale, wider than the component scale ── */
  --rhythm-1:4px;  --rhythm-2:8px;   --rhythm-3:16px;  --rhythm-4:24px;
  --rhythm-5:40px; --rhythm-6:64px;  --rhythm-7:104px; --rhythm-8:168px;

  /* ── measure: line length, and the page gutter ── */
  --measure-prose:68ch; --measure-lede:54ch; --measure-page:1440px;
  --margin-page:clamp(24px,5vw,96px);

  /* ── motion ── */
  --liquid:cubic-bezier(.32,.72,0,1);
  --spring:cubic-bezier(.34,1.42,.64,1);
  --ease-reveal:cubic-bezier(.16,1,.3,1);
  --quick:180ms; --commit:240ms; --morph:420ms; --micro:350ms; --reveal:1000ms;

  /* ── type: families ── */
  --f-display:"Fraunces",Georgia,"Times New Roman",serif;
  --f-text:"Newsreader",Georgia,serif;
  --f-ui:"Manrope",-apple-system,BlinkMacSystemFont,"Segoe UI",system-ui,sans-serif;
  --f-mono:ui-monospace,"SF Mono",Menlo,"Cascadia Mono",monospace;

  /* ── type: sizes ── */
  --fs-monument:clamp(64px,12vw,180px);
  --fs-display-xl:clamp(44px,6vw,88px);
  --fs-display-l:clamp(34px,4vw,56px);
  --fs-display-m:clamp(26px,2.6vw,36px);
  --fs-title-l:22px; --fs-title-m:18px;
  --fs-pull-quote:clamp(24px,2.6vw,34px);
  --fs-lede:clamp(19px,1.5vw,23px);
  --fs-body-l:17px; --fs-body-m:15px; --fs-body-s:13.5px;
  --fs-eyebrow:12px; --fs-label:13px; --fs-wordmark:14px; --fs-caption:12px;

  /* ── type: line heights ── */
  --lh-monument:.9; --lh-display-xl:1.02; --lh-display-l:1.08; --lh-display-m:1.15;
  --lh-title-l:1.25; --lh-title-m:1.3; --lh-pull-quote:1.4; --lh-lede:1.6;
  --lh-body-l:1.7; --lh-body-m:1.6; --lh-body-s:1.45;
  --lh-eyebrow:1.4; --lh-label:1.4; --lh-caption:1.5;

  /* ── type: weights and tracking ── */
  --fw-light:300; --fw-regular:400; --fw-medium:500; --fw-semibold:600;
  --tr-monument:-.03em; --tr-display-xl:-.025em; --tr-display-l:-.02em;
  --tr-display-m:-.015em; --tr-title:-.01em;
  --tr-eyebrow:.16em; --tr-label:.12em; --tr-wordmark:.18em;

  /* ── elevation and effects ──
     Shadows are complete values, not colours: a shadow that is merely
     recoloured for a light theme still reads as a dark theme's shadow. */
  --shadow-raised:0 8px 24px rgba(0,0,0,.40);
  --shadow-floating:0 12px 40px -10px rgba(0,0,0,.75);
  --shadow-inverted:0 -10px 40px rgba(0,0,0,.50);
  --glow-gold:0 12px 32px rgba(198,161,91,.25);
  --grain:rgba(255,255,255,.08);
  --halo:rgba(4,3,2,.95);

  /* ── elevation ── */
  --z-flat:0; --z-raised:1; --z-floating:40; --z-sticky:60;
  --z-overlay:180; --z-transient:200;

  /* The compatibility aliases that used to sit here are gone. They carried the
     pre-system names (--noir, --ivory, --gold, --s-1…--s-8) so the existing
     pages kept rendering while the system replaced their token block, and they
     were always misnomers: in the Ivory theme --ivory resolved to near-black,
     because its role was "primary text" rather than "the colour ivory".

     main.css now consumes the primitives directly. check-drift.mjs asserts the
     aliases are not reintroduced — a name that lies about its value is worse
     than no name. */
}

/* ── Ivory theme ──────────────────────────────────────────────────
   Ground is paper #FBF8F1, not ivory #F2ECDF: the same gold measures
   7.18:1 on paper against 6.47:1 on ivory, and that decides whether
   credentials clear the 7:1 floor. Ivory becomes the panel tint. */

@media (prefers-color-scheme: light) {
  :root {
    --ink-950:#FBF8F1; --ink-900:#F6F1E6; --ink-850:#F2ECDF; --ink-800:#EDE6D7;
    --ink-700:#FFFFFF; --ink-600:#DED5C2; --ink-500:#B9AE97; --ink-400:#7D7261;
    --ink-300:#574E40; --ink-200:#2E2820; --ink-100:#1C1811; --ink-050:#14100A;

    --gold-200:#3D2E14; --gold-300:#4A3818; --gold-400:#54401C; --gold-500:#5E4820;
    --gold-600:#6B4F18; --gold-700:#7A5C1F; --gold-800:#8A6B32;
    --on-gold:#FFFFFF;

    --credential-figure:var(--gold-500);
    --credential-label:var(--ink-200);

    --positive:#2F6B4A; --caution:#7A5312; --critical:#9C3A32;

    --tint-chrome:rgba(251,248,241,.72);
    --tint-panel:rgba(242,236,223,.68);
    --tint-panel-gold:rgba(94,72,32,.06);
    --edge-bright:rgba(255,255,255,.92);
    --edge-mid:rgba(94,72,32,.18);
    --edge-dim:rgba(20,16,10,.06);
    --spec:rgba(255,255,255,.55);
    --spec-gold:rgba(94,72,32,.10);
    --lens-top:rgba(255,255,255,.78);
    --lens-bot:rgba(20,16,10,.10);
    --ca-cool:rgba(94,72,32,.10);
    --ca-warm:rgba(122,92,31,.12);
    --shadow-glass:0 1px 2px rgba(20,16,10,.06), 0 22px 60px -22px rgba(20,16,10,.24);

    /* On paper, depth is a tight contact shadow, not a long dark plume. */
    --shadow-raised:0 6px 18px rgba(20,16,10,.10);
    --shadow-floating:0 12px 34px -12px rgba(20,16,10,.20);
    --shadow-inverted:0 -8px 30px rgba(20,16,10,.10);
    --glow-gold:0 12px 32px rgba(94,72,32,.16);
    --grain:rgba(20,16,10,.05);
    --halo:rgba(251,248,241,.92);
  }
}

/* Explicit overrides must win in both directions when a theme toggle
   stamps data-theme on the root. */
:root[data-theme="noir"] {
  --ink-950:#0D0B09; --ink-900:#12100D; --ink-850:#161310; --ink-800:#1C1815;
  --ink-700:#23201B; --ink-600:#2E2A24; --ink-500:#423C33; --ink-400:#6B6255;
  --ink-300:#8F8677; --ink-200:#B5AD9D; --ink-100:#D8D1C3; --ink-050:#F2ECDF;
  --gold-200:#F5E4C2; --gold-300:#E6C98C; --gold-400:#D4B478; --gold-500:#C6A15B;
  --gold-600:#A88544; --gold-700:#8A6B32; --gold-800:#5E4820;
  --on-gold:#0D0B09;
  --credential-figure:var(--gold-400);
  --credential-label:var(--ink-200);
  --positive:#6FB58C; --caution:#D9A85C; --critical:#D98078;
  --tint-chrome:rgba(13,11,9,.75); --tint-panel:rgba(22,19,16,.70);
  --tint-panel-gold:rgba(198,161,91,.08);
  --edge-bright:rgba(230,201,140,.35); --edge-mid:rgba(198,161,91,.15);
  --edge-dim:rgba(242,236,223,.04); --spec:rgba(255,255,255,.18);
  --spec-gold:rgba(198,161,91,.22);
  --lens-top:rgba(242,236,223,.22); --lens-bot:rgba(0,0,0,.55);
  --ca-cool:rgba(198,161,91,.12); --ca-warm:rgba(230,201,140,.14);
  --shadow-glass:0 1px 2px rgba(0,0,0,.40), 0 22px 60px -18px rgba(0,0,0,.82);
  --shadow-raised:0 8px 24px rgba(0,0,0,.40);
  --shadow-floating:0 12px 40px -10px rgba(0,0,0,.75);
  --shadow-inverted:0 -10px 40px rgba(0,0,0,.50);
  --glow-gold:0 12px 32px rgba(198,161,91,.25);
  --grain:rgba(255,255,255,.08);
  --halo:rgba(4,3,2,.95);
}

:root[data-theme="ivory"] {
  --ink-950:#FBF8F1; --ink-900:#F6F1E6; --ink-850:#F2ECDF; --ink-800:#EDE6D7;
  --ink-700:#FFFFFF; --ink-600:#DED5C2; --ink-500:#B9AE97; --ink-400:#7D7261;
  --ink-300:#574E40; --ink-200:#2E2820; --ink-100:#1C1811; --ink-050:#14100A;
  --gold-200:#3D2E14; --gold-300:#4A3818; --gold-400:#54401C; --gold-500:#5E4820;
  --gold-600:#6B4F18; --gold-700:#7A5C1F; --gold-800:#8A6B32;
  --on-gold:#FFFFFF;
  --credential-figure:var(--gold-500);
  --credential-label:var(--ink-200);
  --positive:#2F6B4A; --caution:#7A5312; --critical:#9C3A32;
  --tint-chrome:rgba(251,248,241,.72); --tint-panel:rgba(242,236,223,.68);
  --tint-panel-gold:rgba(94,72,32,.06);
  --edge-bright:rgba(255,255,255,.92); --edge-mid:rgba(94,72,32,.18);
  --edge-dim:rgba(20,16,10,.06); --spec:rgba(255,255,255,.55);
  --spec-gold:rgba(94,72,32,.10);
  --lens-top:rgba(255,255,255,.78); --lens-bot:rgba(20,16,10,.10);
  --ca-cool:rgba(94,72,32,.10); --ca-warm:rgba(122,92,31,.12);
  --shadow-glass:0 1px 2px rgba(20,16,10,.06), 0 22px 60px -22px rgba(20,16,10,.24);
  /* On paper, depth is a tight contact shadow, not a long dark plume. */
  --shadow-raised:0 6px 18px rgba(20,16,10,.10);
  --shadow-floating:0 12px 34px -12px rgba(20,16,10,.20);
  --shadow-inverted:0 -8px 30px rgba(20,16,10,.10);
  --glow-gold:0 12px 32px rgba(94,72,32,.16);
  --grain:rgba(20,16,10,.05);
  --halo:rgba(251,248,241,.92);
}

/* ── Accessibility variants ───────────────────────────────────────
   Reduced transparency is a designed theme, not backdrop-filter: none.
   The tint becomes an opaque surface so the material still reads as a
   distinct plane rather than dissolving into the page. */

:root[data-transparency="reduce"] {
  --blur-chrome:0px; --blur-panel:0px; --blur-lens:0px;
  --tint-chrome:var(--ink-850);
  --tint-panel:var(--ink-800);
  --spec-gold:transparent;
  --spec:transparent;
}

:root[data-contrast="more"] {
  --ink-200:#DCD6C9; --ink-300:#B3AA98;
  --tint-panel:rgba(22,19,16,.94); --tint-chrome:rgba(13,11,9,.92);
  --edge-bright:rgba(230,201,140,.55);
}
@media (prefers-color-scheme: light) {
  :root[data-contrast="more"] {
    --ink-200:#1A160F; --ink-300:#3D3529;
    --tint-panel:rgba(255,255,255,.96); --tint-chrome:rgba(251,248,241,.94);
    --edge-bright:rgba(94,72,32,.35);
  }
}
:root[data-theme="ivory"][data-contrast="more"] {
  --ink-200:#1A160F; --ink-300:#3D3529;
  --tint-panel:rgba(255,255,255,.96); --tint-chrome:rgba(251,248,241,.94);
  --edge-bright:rgba(94,72,32,.35);
}

/* Motion is a brand property here: slow, confident, never bouncy. When the
   visitor asks for less, the reveal collapses to a cross-fade rather than
   being switched off, so the editorial pacing survives. */
@media (prefers-reduced-motion: reduce) {
  :root {
    --reveal:1ms; --morph:1ms; --micro:1ms; --quick:1ms; --commit:1ms;
    --dur-reveal:1ms; --dur-micro:1ms;
    --spring:linear; --liquid:linear; --ease-reveal:linear;
  }
}

/* Compact density. */
:root[data-density="compact"] {
  --space-3:9px; --space-4:12px; --space-5:15px; --space-6:18px;
}
