/* ============================================================
   URTH DESIGN SYSTEM v1.0 — TOKENS (single source of truth)
   Namespace: --urth-* (v1.0). Legacy --u-* (theme.css) remains
   valid on unmigrated pages; a mapping layer is at the bottom.
   RULE: new/migrated screens use ONLY --urth-* tokens.
   Never hardcode hex. Never white (#FFF) or black (#000).
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,600;0,9..144,700;1,9..144,500&family=Mada:wght@300;400;500;600;700&display=swap');

:root{
  /* ---- color ---- */
  --urth-forest-900:#1D4331;   /* deepest green: bands, headers, strong fills */
  --urth-forest-700:#2F5F48;   /* brand green: page bg (workspace), primary buttons */
  --urth-cream-50:#FFFDF7;     /* raised cards, panels, fields; TEXT ON GREEN */
  --urth-cream-100:#F6F1E6;    /* page bg (documents), secondary surfaces */
  --urth-gold-500:#CDA24A;     /* accent: active states, highlights, primary CTA on cream */
  --urth-text-primary:#26372E; /* body text on cream surfaces */
  --urth-text-muted:#66736B;   /* secondary text on cream surfaces (4.5:1 on cream-50) */
  --urth-danger-600:#B42318;   /* destructive, errors, overdue */

  /* contrast-safe derived pairs (do not invent new ones) */
  --urth-on-green:var(--urth-cream-50);        /* ANY text on forest-700/900 = cream-50 (7.24:1 on 700) */
  --urth-on-green-muted:rgba(255,253,247,.80); /* secondary text on green, still >=4.5:1 */
  --urth-on-gold:var(--urth-forest-900);       /* text on gold-500 */
  --urth-line:#E2D9C8;                         /* hairlines on cream */
  --urth-line-on-green:rgba(255,253,247,.18);  /* hairlines on green */

  /* confidence ladder (Q1/Q2/Q3) — fixed meanings, workspace-only colors */
  --urth-q1:#7FA8C9;  --urth-on-q1:#0F2C3B;   /* Early Budget Range */
  --urth-q2:#E6C670;  --urth-on-q2:#4A3A10;   /* Reviewed Project Budget */
  --urth-q3:#6BA88A;  --urth-on-q3:#0E2C20;   /* Field-Verified Proposal */

  /* ---- type ---- */
  --urth-font-display:'Fraunces',Georgia,serif;             /* headings, display numbers */
  --urth-font-body:'Mada',system-ui,-apple-system,Arial,sans-serif;
  --urth-fs-display:28px; --urth-fs-h1:22px; --urth-fs-h2:18px; --urth-fs-h3:15.5px;
  --urth-fs-body:14.5px;  --urth-fs-small:13px; --urth-fs-micro:11.5px;
  --urth-lh-tight:1.15;   --urth-lh-body:1.55;

  /* ---- space (4px scale) ---- */
  --urth-s-1:4px; --urth-s-2:8px; --urth-s-3:12px; --urth-s-4:16px;
  --urth-s-5:20px; --urth-s-6:24px; --urth-s-8:32px; --urth-s-10:40px; --urth-s-12:48px;

  /* ---- shape & elevation ---- */
  --urth-r-sm:8px; --urth-r-md:12px; --urth-r-lg:18px; --urth-r-pill:999px;
  --urth-shadow-1:0 2px 10px rgba(29,67,49,.08);
  --urth-shadow-2:0 6px 24px rgba(29,67,49,.18);
  --urth-shadow-3:0 14px 42px rgba(29,67,49,.30);

  /* ---- interaction ---- */
  --urth-touch-min:44px;              /* minimum hit target, everywhere */
  --urth-focus:0 0 0 3px rgba(205,162,74,.55);  /* gold focus ring */
  --urth-ease:.15s ease;
}

/* legacy mapping — lets migrated components render on unmigrated pages.
   Do NOT use --u-* in new code; this exists only for coexistence. */
:root{
  --u-beige:var(--urth-cream-100); --u-cream:var(--urth-cream-50);
  --u-green:var(--urth-forest-700); --u-green-deep:var(--urth-forest-900);
  --u-on-green:var(--urth-on-green); --u-gold:var(--urth-gold-500);
  --u-line:var(--urth-line);
}
