/* Sprout Design System - core tokens.
 *
 * Lift these as CSS custom properties for the plants dashboard / UI.
 * Toggle  data-theme="dark"  on the root element for "soil" (dark) mode.
 * Names match the design source: docs/design/foundations/Sprout Design System.dc.html (section 14 - Engineering tokens).
 *
 * Fonts (load via Google Fonts or self-host):
 *   Baloo 2 (display) - Hanken Grotesk (UI/body) - JetBrains Mono (all numbers/data).
 *
 * v3 update (ADR-0008): the "soil" (dark) mode NEUTRALS were refined from the original warm-olive surfaces
 * to a cooler, deeper green-charcoal that reads refined rather than dank. Light mode and every --st-* / --band-*
 * meaning color are unchanged. The v3 personality content now lives in docs/design/voice/ and docs/design/components/.
 */

:root {
  /* brand + neutrals (light) */
  --leaf: #34A853;
  --sprout: #8BD24F;
  --ink: #1E2A18;
  --muted: #6F7E62;
  --border: #E3E9D8;
  --surface: #FFFFFF;
  --surface-2: #F7FAF2;
  --bg: #EEF4E6;

  /* status - state IS the color */
  --st-watering: #17B6C4;
  --st-dry: #F5A623;
  --st-due: #E8703A;
  --st-fault: #E0483D;
  --st-predicted: #7C5CFF;

  /* the seven moisture bands (wet -> dry) */
  --band-saturated: #0E7A86;
  --band-wet: #17B6C4;
  --band-moist: #34A853;
  --band-ideal: #8BD24F;
  --band-drying: #F5A623;
  --band-dry: #E8703A;
  --band-parched: #E0483D;

  /* quality flags */
  --q-ok: #34A853;
  --q-suspect: #F5A623;
  --q-saturated: #17B6C4;
  --q-nosignal: #9A8480;

  /* type - metrically-aware fallback stacks (#116): if a brand face fails to load, degrade to an
   * intentional, close system font, never to bare generic sans-serif/monospace (which reads off-brand
   * AND overflows layout - the #101 part-1 clipping mechanism). Belt-and-suspenders on #106's embed. */
  --font-display: "Baloo 2", ui-rounded, "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-ui: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-data: "JetBrains Mono", ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Consolas, Menlo, monospace;

  /* space - 4px base */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 40px;

  /* ---- #930 the full creative palette (charter-ruled, 2026-07-19) ------------- */
  /* chrome aliases - the charter's muted-neutral family named (rule 2). Semantic
   * names over the existing neutrals; never a new hue, never near the state ramp. */
  --sprout-soft: var(--bg);
  --mist: var(--surface-2);
  --sand: var(--surface);
  --soil-line: var(--border);
  --soil-muted: var(--muted);
  --soil-ink: var(--ink);

  /* identity materials - the MUTED register (charter rule 3, two-register
   * principle): pot / foliage / per-plant identity colour. Capped saturation by
   * construction; can never be mistaken for a state hue. 12 for a full fleet. */
  --mat-terracotta: #B98F6F;
  --mat-clay: #C08A6A;
  --mat-persimmon: #CB763E;
  --mat-stoneware: #9AA6A0;
  --mat-stone: #A59E93;
  --mat-ceramic: #8FA3B0;
  --mat-cream: #E3DAC2;
  --mat-sage-glaze: #A9B7A0;
  --mat-charcoal: #52585A;
  --mat-moss: #7E9B6B;
  --mat-bark: #7C6A4E;
  --mat-slate: #6E7B86;

  /* chart series - the charter's chart-series pass (#930/#1039): a line is a
   * plant's IDENTITY, so series strokes come from the muted materials register;
   * the band-ground carries state; focus-on-interaction saturates ONE series to
   * ink and drops the rest. Order is legibility-first: adjacent channels get
   * maximally-different strokes; cream sits last (too light for a thin line).
   * NEVER a fleet-wide 0-100 raw normalization behind these (#1039 ruling 3). */
  --series-1: var(--mat-terracotta);
  --series-2: var(--mat-ceramic);
  --series-3: var(--mat-moss);
  --series-4: var(--mat-charcoal);
  --series-5: var(--mat-persimmon);
  --series-6: var(--mat-slate);
  --series-7: var(--mat-sage-glaze);
  --series-8: var(--mat-bark);
  --series-9: var(--mat-clay);
  --series-10: var(--mat-stoneware);
  --series-11: var(--mat-stone);
  --series-12: var(--mat-cream);
  --series-focus: var(--ink);   /* the one saturated line under interaction */
  --series-faint: 0.28;         /* unfocused-line opacity while one is focused */

  /* radius */
  --r-control: 8px;
  --r-tile: 14px;
  --r-card: 20px;
  --r-pill: 999px;

  /* elevation */
  --e1: 0 1px 2px rgba(30, 42, 24, 0.06);
  --e2: 0 6px 18px rgba(30, 42, 24, 0.08);
  --e3: 0 16px 36px rgba(30, 42, 24, 0.14);
}

/* "soil" / dark mode (v3, ADR-0008) - refined cool green-charcoal neutrals.
 * Surfaces are deep and desaturated rather than warm/olive; greens still glow; meaning colors hold position. */
[data-theme="dark"] {
  /* surfaces - cool desaturated green-charcoal ramp (was warm olive: #0E140B / #121A0E / #1B2417 / #283322) */
  --bg: #0C1311;
  --surface-2: #111A16;
  --surface: #18231F;
  --border: #29372F;

  /* text - cool soft sage-white (was warm cream #EAF2E0 / #7C8A72) */
  --ink: #E9F1EB;
  --muted: #8B9B90;

  /* accents hold; brand green loses a little acid against the cooler ground (was #9EE04A) */
  --leaf: #93DD6A;
  --st-watering: #3FD0DE;
  --st-fault: #FF6B5E;
  /* #930 materials on dark soil - lifted a step so thin strokes stay legible on
   * the deep ground; same hue family, never the state ramp. */
  --mat-terracotta: #C9A183;
  --mat-clay: #D09C7E;
  --mat-persimmon: #DC8A55;
  --mat-stoneware: #AAB6B0;
  --mat-stone: #B5AEA3;
  --mat-ceramic: #9FB3C0;
  --mat-cream: #E9E2CE;
  --mat-sage-glaze: #B9C7B0;
  --mat-charcoal: #8A9298;
  --mat-moss: #93AE80;
  --mat-bark: #9A8768;
  --mat-slate: #8493A0;

  /* live status dots: add  box-shadow: 0 0 8px currentColor  for the glow */
}
