/* Design tokens. :root is the dark default; [data-theme="light"] overrides the
   same names. Components and pages use tokens only, never raw values.
   Brand: deep green #173D2D (main), gold #B69A5B (secondary), slate #26364A
   (accessories), cream #F1EBDD (subtle accent), olive #6B7650 (decoration). */
:root {
  /* Surfaces (dark default): the brand green and its deeper shades */
  --color-bg-primary: #0F2920;
  --color-bg-secondary: #173D2D;
  --color-bg-tertiary: #1E4A37;
  --color-bg-hover: #255640;
  --color-bg-active: #2C624A;

  /* Text: cream on green */
  --color-text-primary: #F1EBDD;
  --color-text-secondary: #C8C3B2;
  --color-text-tertiary: #A4A994;
  --color-text-inverse: #0F2920;

  /* Borders */
  --color-border-default: #2B5542;
  --color-border-subtle: #214634;
  --color-border-strong: #3B6B54;

  /* Accent: brand gold. 5.7:1 on bg-primary but 4.46:1 on bg-secondary, so
     text on cards uses --color-accent-text. */
  --color-accent: #B69A5B;
  --color-accent-hover: #C9AF72;
  --color-accent-muted: #B69A5B26;
  --color-accent-text: #D9C48F;

  /* Secondary: olive decoration (fills and marks, never text) */
  --color-secondary: #6B7650;
  --color-secondary-hover: #7E8A61;
  --color-secondary-muted: #6B76501A;

  /* Chrome: slate accessories (device bezels, rails, status bars) */
  --color-chrome: #26364A;

  /* Chart series (dataviz reference palette, validated against
     bg-secondary with validate_palette.js; one measure per chart) */
  --chart-rain: #3987e5;
  --chart-temp: #d95926;
  --chart-moisture: #199e70;

  /* Status */
  --color-success: #8CBF7E;
  --color-success-bg: #8CBF7E1A;
  --color-warning: #E3A845;
  --color-warning-bg: #E3A8451A;
  --color-danger: #E68B7C;
  --color-danger-bg: #E68B7C1A;
  --color-info: #93AACB;
  --color-info-bg: #93AACB1A;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 20px rgba(182, 154, 91, 0.12);

  /* Spacing (8px base, 4px steps) */
  --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; --space-20: 80px;

  /* Radius */
  --radius-sm: 4px;  --radius-md: 8px;
  --radius-lg: 12px; --radius-xl: 16px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 120ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 350ms ease;

  /* Typography (placeholder families: swap for the brand's) */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-serif: 'Fraunces', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Type scale */
  --text-xs: 0.75rem;   --text-sm: 0.875rem;
  --text-base: 1rem;    --text-lg: 1.125rem;
  --text-xl: 1.25rem;   --text-2xl: 1.5rem;
  --text-3xl: 1.875rem; --text-4xl: 2.25rem;
  --text-5xl: 3rem;

  /* Line heights */
  --leading-tight: 1.2;  --leading-snug: 1.35;
  --leading-normal: 1.6; --leading-relaxed: 1.75;

  /* Letter spacing */
  --tracking-tight: -0.02em;  --tracking-normal: 0.01em;
  --tracking-wide: 0.04em;    --tracking-wider: 0.08em;

  /* Z-index */
  --z-dropdown: 100; --z-sticky: 200;
  --z-modal-backdrop: 300; --z-modal: 400; --z-toast: 500;

  /* Container widths */
  --container-sm: 640px;  --container-md: 768px;
  --container-lg: 1024px; --container-xl: 1200px;

  /* Aluni, the seedling mascot. Mirrored as hex ints in
     app/javascript/mascot/palette.js; change both together. */
  --color-mascot-soil: #46392A;
  --color-mascot-soil-shade: #2E2619;
  --color-mascot-seed-coat: #8C6A43;
  --color-mascot-seed-coat-shade: #5E4428;
  --color-mascot-stem: #A6B587;
  --color-mascot-leaf: #4F8F55;
  --color-mascot-leaf-shade: #2F6A3E;
  --color-mascot-vein: #86A06E;
  --color-mascot-tip: #B69A5B;
  --color-mascot-root: #D9CBA8;
}

/* Light mode override: cream surfaces, deep green text and accent */
[data-theme="light"] {
  --color-bg-primary: #F1EBDD;
  --color-bg-secondary: #FAF7EF;
  --color-bg-tertiary: #E7DFCB;
  --color-bg-hover: #DDD3BB;
  --color-bg-active: #D2C7AA;
  --color-text-primary: #173D2D;
  --color-text-secondary: #3F5A4C;
  --color-text-tertiary: #566659;
  --color-text-inverse: #F1EBDD;
  --color-border-default: #D4CAB2;
  --color-border-subtle: #E3DBC7;
  --color-border-strong: #B9AD90;
  --color-accent: #173D2D;
  --color-accent-hover: #112E22;
  --color-accent-muted: #173D2D14;
  --color-accent-text: #173D2D;
  --color-secondary: #6B7650;
  --color-secondary-hover: #5C664A;
  --color-secondary-muted: #6B765026;
  --color-chrome: #26364A;
  --chart-rain: #2a78d6;
  --chart-temp: #c4501f;
  --chart-moisture: #0f8a5f;
  --color-success: #35703F;
  --color-success-bg: #35703F1A;
  --color-warning: #7D5F18;
  --color-warning-bg: #7D5F181A;
  --color-danger: #A8432F;
  --color-danger-bg: #A8432F1A;
  --color-info: #26364A;
  --color-info-bg: #26364A1A;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);
  --shadow-glow: none;
  --color-mascot-soil: #5A4A33;
  --color-mascot-soil-shade: #43372A;
  --color-mascot-seed-coat: #8C6A43;
  --color-mascot-seed-coat-shade: #5E4428;
  --color-mascot-stem: #6F8A52;
  --color-mascot-leaf: #35703F;
  --color-mascot-leaf-shade: #24502E;
  --color-mascot-vein: #9DB383;
  --color-mascot-tip: #8A6A1E;
  --color-mascot-root: #8C7A5A;
}
