/* Living With GP — color tokens. Every page links this before site.css.

   Tokens are named by role, not by hue, so the dark palette can swap values
   without a page knowing which theme it is in. The pages follow the reader's
   system setting (prefers-color-scheme); there is no in-page toggle.

   Contrast (WCAG 2): every *text* token below is at least 4.5:1 on bg, surface
   and its matching tint, in both themes. lime, gold and coral are fills and
   borders; coral is also allowed as heading text at 19px bold and up (3.3:1
   light, 4.9:1 dark). Re-check with tools/check-contrast.js after changing a value. */

:root{
  color-scheme:light dark;

  /* Brand fills — the same in both themes */
  --lime:#95C11F;            /* signature accent: header rule, card tops, active tab. Never text. */
  --gold:#F5B01D;            /* analogies, caution */
  --coral:#E8663C;           /* cautions, danger; heading text only at 19px bold+ */

  /* Surfaces */
  --bg:#FBF7EF;              /* page */
  --surface:#FFFFFF;         /* cards, tab bar, dialogs */
  --surface-clear:rgba(255,255,255,0); /* surface at 0 alpha, for scroll-edge fades */
  --surface-sunken:#F6F3EA;  /* wells inside a card: steps, stat pills, table heads */
  --hair:#E8E3D6;            /* hairline borders */
  --hair-soft:#F0EDE4;       /* row separators inside cards */
  --track:#EEEEEE;           /* empty meter / progress track */

  /* Text */
  --text:#2E2E2E;            /* 12.7:1 on bg */
  --text-lead:#39422F;       /* lead paragraphs */
  --text-soft:#4A4A44;       /* sources, table heads, small labels */
  --muted:#6B6B63;           /* secondary text, 5.0:1 on bg */

  /* Green — two roles */
  --green:#33691E;           /* text role: headings, links, terms, borders */
  --green-fill:#33691E;      /* header/footer bands, buttons, number discs */
  --green-fill-hover:#2A561A;
  --on-fill:#FFFFFF;         /* text on green-fill or coral-fill */
  --on-green-soft:#DBE9C2;   /* eyebrow and home link on the band */

  /* Tints and their text */
  --green-tint:#EEF4E6;
  --lime-tint:#F4FAE5;
  --gold-tint:#FDF3DA;
  --coral-tint:#FBE9E2;
  --lime-text:#55720E;       /* lime-role text: 4.9:1 on green-tint */
  --gold-text:#8A6400;       /* 4.9:1 on gold-tint */
  --coral-text:#B23A16;      /* small coral-role text: 5.1:1 on coral-tint */
  --coral-fill:#B23A16;      /* chips and discs that carry white text (6.0:1) */
  --on-lime:#1F2A0A;         /* text on a lime fill (7.1:1) */
  --on-gold:#4A3800;         /* text on a gold fill (6.0:1) */
  --disabled:#767670;        /* disabled button fill, white text 4.6:1 */

  /* Focus: a solid ring, at least 3:1 on whatever it lands on */
  --focus:#33691E;
  --focus-on-band:#95C11F;   /* on the green band, 3.1:1 */

  /* Elevation */
  --scrim:rgba(46,46,46,.55);
  --edge-shade:rgba(46,46,46,.16);
  --shadow-soft:0 1px 4px rgba(0,0,0,.08);
  --shadow-card:0 2px 8px rgba(0,0,0,.06);
  --shadow-card-hover:0 6px 18px rgba(0,0,0,.10);
  --shadow-drawer:0 10px 40px rgba(30,35,20,.25);
  --shadow-dialog:0 12px 40px rgba(0,0,0,.28);
}

@media (prefers-color-scheme: dark){
  :root{
    --bg:#141911;
    --surface:#1D2419;
    --surface-clear:rgba(29,36,25,0);
    --surface-sunken:#181E15;
    --hair:#333C2D;
    --hair-soft:#2A3225;
    --track:#2F3829;

    --text:#ECE9DF;
    --text-lead:#D6DCCB;
    --text-soft:#C4C6BB;
    --muted:#A3A69A;

    --green:#9CCC5E;
    --green-fill:#33691E;
    --green-fill-hover:#3D7A25;
    --on-fill:#FFFFFF;
    --on-green-soft:#DBE9C2;

    --green-tint:#212D1C;
    --lime-tint:#232C16;
    --gold-tint:#2E2715;
    --coral-tint:#33201A;
    --lime-text:#B9D96B;
    --gold-text:#F0C45A;
    --coral-text:#FF9B7A;
    --coral-fill:#B23A16;
    --on-lime:#1F2A0A;
    --on-gold:#4A3800;
    --disabled:#767670;

    --focus:#9CCC5E;
    --focus-on-band:#95C11F;

    --scrim:rgba(0,0,0,.65);
    --edge-shade:rgba(0,0,0,.5);
    --shadow-soft:0 1px 4px rgba(0,0,0,.4);
    --shadow-card:0 2px 8px rgba(0,0,0,.35);
    --shadow-card-hover:0 6px 18px rgba(0,0,0,.5);
    --shadow-drawer:0 10px 40px rgba(0,0,0,.6);
    --shadow-dialog:0 12px 40px rgba(0,0,0,.6);
  }
}
