/* Copied from the design handoff (_PROJECTS/finance/_DESIGN/tokens.css); only the font loading and the
   automatic dark-mode block were changed. */
/* Household Finance — design tokens
   Derived from the Organic system (cream / terracotta / sage), tuned calmer.
   Brand colors are warm only. Green / red / blue / amber carry data meaning only. */

/* Fonts are served by this app (latin subset, SIL Open Font License) - nothing is loaded from Google. */
@font-face { font-family: "Caprasimo"; font-style: normal; font-weight: 400; font-display: swap; src: url("/static/fonts/caprasimo-latin.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 300 900; font-display: swap; src: url("/static/fonts/figtree-latin.woff2") format("woff2"); }

:root {
  /* Surfaces */
  --hf-bg: #f5ead8;            /* page ground (cream) */
  --hf-sidebar: #ebddc5;       /* nav rail, sand */
  --hf-card: #f9f4ed;          /* cards, drawers, tab bar */
  --hf-sunken: #eee7db;        /* tracks, row rules, neutral chips */
  --hf-border: #dcd3c4;        /* axis lines, input borders */

  /* Ink */
  --hf-text: #201e1d;
  --hf-text-2: #474238;        /* secondary copy */
  --hf-text-muted: #645c50;    /* labels, captions (5.3:1 on bg) */

  /* Brand accent (terracotta ramp) */
  --hf-accent-100: #fff2eb;
  --hf-accent-200: #ffe1d0;    /* chart area fill */
  --hf-accent-300: #ffc6a5;    /* active tab dot, avatar C */
  --hf-accent-500: #c67139;    /* brand mark */
  --hf-accent-600: #b2622d;    /* chart line, outline buttons */
  --hf-accent-700: #8c491a;    /* primary button fill, links, active nav text (AA on cream) */
  --hf-accent-800: #643312;    /* pressed / hover of primary */

  /* Second voice (sage) — decorative/brand only, never "good" */
  --hf-sage-300: #ccdbb2;
  --hf-sage-700: #56633f;

  /* Data meaning only */
  --hf-gain: #2f7a4a;          /* under budget, gains, pass */
  --hf-gain-bg: #e3efe2;
  --hf-loss: #b3372c;          /* over budget, losses, fail */
  --hf-loss-bg: #f6e0dc;
  --hf-info: #2f6597;          /* informational */
  --hf-info-bg: #e0e9f3;
  --hf-warn: #a8741a;          /* stale, attention */
  --hf-warn-ink: #5e3f08;
  --hf-warn-bg: #fbeed0;

  /* Probability zones (fills) */
  --hf-zone-low: #f0c9c2;      /* 0–69% */
  --hf-zone-mid: #f1dea6;      /* 70–84% */
  --hf-zone-high: #c6dfc8;     /* 85–100% */

  /* Chart series: tax buckets / owners (warm + earth, distinguishable) */
  --hf-series-1: #b2622d;      /* Traditional */
  --hf-series-2: #d9a26b;      /* Roth */
  --hf-series-3: #7a8a5e;      /* Taxable */
  --hf-series-4: #645c50;      /* HSA */
  --hf-fan-outer: #ffe1d0;     /* 5th–95th percentile band */
  --hf-fan-inner: #f6b98f;     /* 25th–75th */

  /* Type */
  --hf-font-display: "Caprasimo", Georgia, serif;    /* page titles only */
  --hf-font-body: "Figtree", system-ui, sans-serif;
  --hf-fs-display: 44px;       /* page title, laptop (phone 32px) */
  --hf-fs-h2: 24px;            /* drawer / section title */
  --hf-fs-h3: 17px;            /* card title, 600 */
  --hf-fs-figure-xl: 36px;     /* hero figure, 700 */
  --hf-fs-figure: 34px;        /* KPI tile figure, 700 */
  --hf-fs-lede: 19px;          /* plain-language summary */
  --hf-fs-body: 15px;
  --hf-fs-small: 14px;
  --hf-fs-caption: 13px;
  --hf-fs-micro: 12px;         /* axis labels, tab labels */
  --hf-lh-body: 1.5;
  /* All amounts: font-variant-numeric: tabular-nums; right-aligned in tables */

  /* Spacing (4.4px base, Organic density 1.1×) */
  --hf-space-1: 4px;
  --hf-space-2: 8px;
  --hf-space-3: 12px;
  --hf-space-4: 16px;
  --hf-space-5: 20px;
  --hf-space-6: 24px;
  --hf-space-7: 28px;
  --hf-space-8: 40px;
  --hf-space-9: 48px;

  /* Radius */
  --hf-radius-sm: 8px;
  --hf-radius-md: 16px;
  --hf-radius-lg: 28px;        /* cards (phone: 24px) */
  --hf-radius-pill: 999px;     /* buttons, chips, inputs, bars */

  /* Elevation */
  --hf-shadow-sm: 0 1px 2px rgba(46, 43, 37, .14);
  --hf-shadow-md: 0 3px 10px rgba(46, 43, 37, .16);
  --hf-shadow-lg: 0 12px 32px rgba(46, 43, 37, .22);

  /* Focus */
  --hf-focus: 2px solid var(--hf-accent-600);
}

/* Dark mode — token swap only; components need no changes */
[data-theme="dark"] {
  --hf-bg: #1d1a17;
  --hf-sidebar: #26221e;
  --hf-card: #2b2622;
  --hf-sunken: #37312b;
  --hf-border: #4a423a;
  --hf-text: #f5ead8;
  --hf-text-2: #dcd3c4;
  --hf-text-muted: #b3a896;
  --hf-accent-100: #3a2519;
  --hf-accent-200: #4d2e1a;
  --hf-accent-300: #7a4520;
  --hf-accent-600: #e08a52;
  --hf-accent-700: #f6a06b;    /* links / primary fill (use dark text on it) */
  --hf-accent-800: #ffc6a5;
  --hf-gain: #7cc48f;   --hf-gain-bg: #1f3325;
  --hf-loss: #f08a7e;   --hf-loss-bg: #3d2320;
  --hf-info: #8db8e3;   --hf-info-bg: #1f2c3a;
  --hf-warn: #e0b35a;   --hf-warn-ink: #f3d9a3;  --hf-warn-bg: #3a2e17;
  --hf-zone-low: #5a2e29; --hf-zone-mid: #5a4a22; --hf-zone-high: #2f4a34;
  --hf-fan-outer: #4d2e1a; --hf-fan-inner: #7a4520;
  --hf-shadow-sm: 0 0 0 1px rgba(255,255,255,.06);
  --hf-shadow-md: 0 0 0 1px rgba(255,255,255,.08), 0 4px 12px rgba(0,0,0,.4);
  --hf-shadow-lg: 0 0 0 1px rgba(255,255,255,.08), 0 12px 32px rgba(0,0,0,.55);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --hf-bg: #1d1a17;
  --hf-sidebar: #26221e;
  --hf-card: #2b2622;
  --hf-sunken: #37312b;
  --hf-border: #4a423a;
  --hf-text: #f5ead8;
  --hf-text-2: #dcd3c4;
  --hf-text-muted: #b3a896;
  --hf-accent-100: #3a2519;
  --hf-accent-200: #4d2e1a;
  --hf-accent-300: #7a4520;
  --hf-accent-600: #e08a52;
  --hf-accent-700: #f6a06b;    /* links / primary fill (use dark text on it) */
  --hf-accent-800: #ffc6a5;
  --hf-gain: #7cc48f;   --hf-gain-bg: #1f3325;
  --hf-loss: #f08a7e;   --hf-loss-bg: #3d2320;
  --hf-info: #8db8e3;   --hf-info-bg: #1f2c3a;
  --hf-warn: #e0b35a;   --hf-warn-ink: #f3d9a3;  --hf-warn-bg: #3a2e17;
  --hf-zone-low: #5a2e29; --hf-zone-mid: #5a4a22; --hf-zone-high: #2f4a34;
  --hf-fan-outer: #4d2e1a; --hf-fan-inner: #7a4520;
  --hf-shadow-sm: 0 0 0 1px rgba(255,255,255,.06);
  --hf-shadow-md: 0 0 0 1px rgba(255,255,255,.08), 0 4px 12px rgba(0,0,0,.4);
  --hf-shadow-lg: 0 0 0 1px rgba(255,255,255,.08), 0 12px 32px rgba(0,0,0,.55);
  color-scheme: dark;
  }
}
[data-theme="dark"] { color-scheme: dark; }

:focus-visible { outline: var(--hf-focus); outline-offset: 2px; }
