/* Default app UI — tokens. Single source of truth.
   Every contrast number below was computed (WCAG 2.1) on 2026-09-27; see DESIGN.md § 3.
   Change a colour here → rebuild the mockups → re-run ui-verify. */

:root {
  /* ── Cornflower blue (supplied scale) ─────────────────────────── */
  --blue-50:  #eef4ff;
  --blue-100: #dae7ff;
  --blue-200: #bdd6ff;
  --blue-300: #90bdff;
  --blue-400: #4d91ff;
  --blue-500: #3573fc;
  --blue-600: #1f53f1;
  --blue-700: #173ede;
  --blue-800: #1933b4;
  --blue-900: #1a308e;
  --blue-950: #152056;

  /* ── Neutrals (cool, low chroma, sit beside the blue) ─────────── */
  --gray-0:   #ffffff;
  --gray-25:  #f8f9fb;
  --gray-50:  #f1f3f7;
  --gray-100: #e4e7ec;
  --gray-200: #d0d5dd;
  --gray-400: #8a93a3;
  --gray-500: #5d6679;
  --gray-600: #475467;
  --gray-700: #344054;
  --gray-900: #101828;

  /* ── Semantic: surfaces ───────────────────────────────────────── */
  --canvas:          var(--gray-0);    /* main content floor */
  --surface-subtle:  var(--gray-25);   /* sidebar, page header band */
  --surface-raised:  var(--gray-0);    /* cards */
  --surface-sunken:  var(--gray-50);   /* pill selects, hover rows, segmented bg */
  --surface-inverse: var(--blue-950);  /* tooltip, toast */

  /* ── Semantic: text ───────────────────────────────────────────── */
  --text-primary:   var(--gray-900);   /* 17.75:1 on white */
  --text-secondary: var(--gray-600);   /*  7.69:1 on white */
  --text-muted:     var(--gray-500);   /*  5.77 white · 5.47 subtle · 5.19 sunken */
  --text-on-accent: var(--gray-0);     /*  5.89:1 on --accent-fill */
  --text-on-inverse: var(--gray-0);    /* 15.30:1 on --surface-inverse */

  /* ── Semantic: accent — two grades, never swap them ──────────── */
  --accent-fill:       var(--blue-600); /* buttons, icons, chart series, rules. 5.89 w/ white text */
  --accent-fill-hover: var(--blue-700);
  --accent-text:       var(--blue-700); /* links, small accent labels. 7.55 white · 6.84 on blue-50 */
  --accent-subtle:     var(--blue-50);  /* active nav, info pill, selected row */
  --accent-border:     var(--blue-200);
  --focus-ring:        var(--blue-500); /* 4.19 on white — graphic, needs 3:1 */
  /* Rejected: --blue-500 as a button fill. White text on it measures 4.19:1. */

  /* ── Semantic: lines ──────────────────────────────────────────── */
  --border:        var(--gray-100);    /* cards, dividers (decorative) */
  --border-strong: var(--gray-200);    /* table header rule, secondary button outline */
  --border-input:  var(--gray-400);    /* 3.10:1 — form fields must be findable */

  /* ── Semantic: status (text on its own tint) ──────────────────── */
  --success-text: #067647;  --success-bg: #ecfdf3;  --success-dot: #17b26a;  /* 5.40 */
  --warning-text: #b54708;  --warning-bg: #fffaeb;  --warning-dot: #f79009;  /* 5.20 */
  --danger-text:  #b42318;  --danger-bg:  #fef3f2;  --danger-dot:  #f04438;  /* 6.05 */
  --danger-fill:  #b42318;  /* white text 6.57 */
  --neutral-text: var(--gray-700); --neutral-bg: var(--gray-50);             /* 9.49 */

  /* ── Chart series (validated: CVD ΔE 34.2, both ≥3:1 on white) ── */
  --series-1: var(--blue-600);  /* income */
  --series-2: #d97706;          /* expenses */
  --chart-grid: var(--gray-100);

  /* ── Type: Figtree (Google Fonts, SIL OFL), variable 300–900 ──── */
  /* Load it with the Google <link> in DESIGN.md § 3, or self-host tokens/fonts/*.woff2. */
  --font-sans: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --text-display: 32px;  --lh-display: 1.15;  --track-display: -0.02em;  /* greeting / page title */
  --text-h2:      20px;  --lh-h2: 1.3;        --track-h2: -0.01em;       /* section heading */
  --text-h3:      16px;  --lh-h3: 1.4;                                   /* card title */
  --text-body:    15px;  --lh-body: 1.5;                                 /* default UI text */
  --text-sm:      14px;  --lh-sm: 1.45;                                  /* table cells, secondary */
  --text-xs:      13px;  --lh-xs: 1.4;                                   /* captions, meta, pills */
  --text-axis:    12px;                                                  /* chart axis only */

  --weight-regular: 400;
  --weight-medium:  500;
  --weight-semi:    600;
  --weight-bold:    700;

  /* ── Space (4px base) ─────────────────────────────────────────── */
  --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;

  /* ── Radii (nested = outer − gap, always concentric) ──────────── */
  --radius-sm:   8px;    /* inputs, tiles, small buttons inside cards */
  --radius-md:  12px;    /* menus, toasts */
  --radius-lg:  16px;    /* cards */
  --radius-pill: 999px;  /* buttons, pills, pill selects */

  /* ── Elevation: borders at rest, shadow only when floating ────── */
  --shadow-overlay: 0 12px 32px -8px rgb(16 24 40 / 0.18), 0 2px 6px rgb(16 24 40 / 0.06);
  --shadow-drawer:  8px 0 32px -8px rgb(16 24 40 / 0.22);

  /* ── Layout ───────────────────────────────────────────────────── */
  --sidebar-w:   248px;
  --topbar-h:    64px;
  --content-max: 1200px;
  --gutter:      40px;   /* 20px under 720px */

  /* ── Motion (values from emil-design-eng) ─────────────────────── */
  --ease-out:    cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --dur-press:   160ms;  /* button scale 0.97 */
  --dur-hover:   150ms;  /* colour only */
  --dur-pop:     180ms;  /* menus, tooltips — exit 120ms */
  --dur-pop-out: 120ms;
  --dur-drawer:  280ms;  /* phone sidebar */
  --dur-toast:   240ms;
}
