/*! tokens.css — ledgerbook.ai design tokens — tokens@1.0.0
 *  Source of truth: docs/website/chapters/w6-design-system.md §2 (verbatim token sets).
 *  Dark-first brand surface; light is designed, never an inversion.
 *  RULE: no component, template or page may hard-code a hex, radius, font size or
 *  duration outside this file (w6 §1). Status hues are semantic, never decorative.
 */

/* ── Colour — light set (fallback theme) ─────────────────────────────────── */
:root{
  --lb-accent:var(--lb-primary);  /* accent for contact-path links */
  /* graphite ramp — surfaces and structure (cool, not warm) */
  --lb-bg:#FFFFFF; --lb-surface:#F7F8FA; --lb-surface-2:#EEF0F4; --lb-surface-inset:#FBFCFD;
  --lb-border:#E3E6EB;              /* decorative hairlines — 1.25:1 */
  --lb-border-strong:#8A93A3;       /* functional borders (inputs) — 3.10:1 */
  --lb-overlay:rgb(11 18 32 / .48);
  /* text */
  --lb-text:#0B1220;                /* 18.72:1 */
  --lb-text-muted:#5A6473;          /* 5.99:1 */
  --lb-text-faint:#8A93A3;          /* 3.10:1 — large text and meta only */
  /* brand — ink indigo */
  --lb-primary:#4338CA;             /* links and default solid — 7.90:1 */
  --lb-primary-solid:#4338CA; --lb-primary-fg:#FFFFFF;
  --lb-primary-hover:#372DA8; --lb-primary-soft:#EEF0FF; --lb-focus:#4338CA;
  /* status — ledger semantics */
  --lb-verified:#0B7A59;    --lb-verified-soft:#E7F6EF;
  --lb-provisional:#B45309; --lb-provisional-soft:#FDF3E3;
  --lb-reversal:#B42318;    --lb-reversal-soft:#FDECEA;
  --lb-info:#0B63CE;        --lb-info-soft:#EAF2FE;
  /* code — dark in both themes */
  --lb-code-bg:#0B1220; --lb-code-fg:#E7EBF2; --lb-code-border:#1E2735;
  --lb-code-comment:#7C8798; --lb-code-keyword:#97A5FF; --lb-code-string:#4ADE9B;
  --lb-code-number:#F5B547; --lb-code-type:#6FB3FF;
}

/* ── Colour — dark set (site default) ────────────────────────────────────── */
.dark, :root[data-theme="dark"]{
  --lb-accent:var(--lb-primary);  /* accent links, dark */
  --lb-bg:#070A0F;                    /* near-black with a blue cast — not #000 */
  --lb-surface:#0E131C; --lb-surface-2:#151C28; --lb-surface-inset:#0A0F17;
  --lb-border:rgb(255 255 255 / .10);        /* hairline — 1.25:1, decorative */
  --lb-border-strong:rgb(255 255 255 / .40); /* corrected from m5 (.28 = 2.40:1, fails 1.4.11) */
  --lb-overlay:rgb(3 6 10 / .72);
  --lb-text:#E7EBF2;                  /* 16.58:1 */
  --lb-text-muted:#98A2B3;            /* 7.70:1 */
  --lb-text-faint:#6B7686;            /* 4.31:1 — large text and meta only */
  --lb-primary:#97A5FF; --lb-primary-solid:#4F46E5; --lb-primary-fg:#FFFFFF;
  --lb-primary-hover:#6157F0; --lb-primary-soft:rgb(151 165 255 / .12); --lb-focus:#97A5FF;
  --lb-verified:#4ADE9B;    --lb-verified-soft:rgb(74 222 155 / .14);
  --lb-provisional:#F5B547; --lb-provisional-soft:rgb(245 181 71 / .14);
  --lb-reversal:#FF8A8A;    --lb-reversal-soft:rgb(255 138 138 / .14);
  --lb-info:#6FB3FF;        --lb-info-soft:rgb(111 179 255 / .14);
  --lb-code-bg:#05080D; --lb-code-border:rgb(255 255 255 / .12);
}
/* native UI hint (form controls, scrollbars) — follows the active theme */
:root{color-scheme:light}
.dark, :root[data-theme="dark"]{color-scheme:dark}

/* ── Typography ──────────────────────────────────────────────────────────── */
:root{
  --lb-font-sans:"Geist","Inter Variable",ui-sans-serif,system-ui,"Segoe UI",sans-serif;
  --lb-font-mono:"Geist Mono","JetBrains Mono",ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  --lb-text-xs:.75rem; --lb-text-sm:.875rem; --lb-text-base:1rem; --lb-text-lg:1.125rem;
  --lb-text-xl:1.25rem; --lb-text-2xl:1.5rem; --lb-text-3xl:1.875rem;
  --lb-text-4xl:clamp(2rem, 1.4rem + 2.4vw, 2.75rem);    /* section hero */
  --lb-text-5xl:clamp(2.5rem, 1.4rem + 4.2vw, 4rem);     /* page h1 */
  --lb-leading-tight:1.1; --lb-leading-snug:1.3; --lb-leading-normal:1.6;
  --lb-tracking-tight:-.02em; --lb-tracking-wide:.08em; --lb-measure:68ch;
}
.mono-data{font-family:var(--lb-font-mono);font-variant-numeric:tabular-nums;
  font-feature-settings:"tnum" 1,"zero" 1}

/* ── Space, radius, hairline, elevation ──────────────────────────────────── */
:root{
  --lb-space-1:4px; --lb-space-2:8px; --lb-space-3:12px; --lb-space-4:16px; --lb-space-5:24px;
  --lb-space-6:32px; --lb-space-7:48px; --lb-space-8:64px; --lb-space-9:96px; --lb-space-10:128px;
  --lb-section-y:clamp(64px, 8vw, 128px);
  --lb-radius-xs:4px; --lb-radius-sm:6px; --lb-radius-md:8px;
  --lb-radius-lg:12px; --lb-radius-xl:16px; --lb-radius-pill:999px;
  --lb-shadow-sm:0 1px 2px rgb(11 18 32 / .06), 0 1px 1px rgb(11 18 32 / .04);
  --lb-shadow-md:0 8px 24px -8px rgb(11 18 32 / .12);
  --lb-shadow-lg:0 24px 64px -24px rgb(11 18 32 / .18);   /* light only */
  --lb-container:1280px; --lb-container-wide:1400px; --lb-gutter:24px; --lb-header-h:64px;
  --lb-z-nav:100; --lb-z-dropdown:200; --lb-z-modal:300; --lb-z-toast:400;
}

/* ── Motion ──────────────────────────────────────────────────────────────── */
:root{
  --lb-dur-1:120ms; --lb-dur-2:180ms; --lb-dur-3:240ms; --lb-dur-4:320ms;
  --lb-ease-standard:cubic-bezier(.4, 0, .2, 1);   /* default everywhere */
  --lb-ease-out:cubic-bezier(0, 0, .2, 1);
  --lb-ease-entrance:cubic-bezier(.16, 1, .3, 1);
}
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:1ms !important;transition-duration:1ms !important}
}
