/* tokens.css — GreenRoots design system: earthy greens + warm soil accents */

:root, [data-theme='light'] {
  /* Type scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --text-3xl: clamp(2.5rem, 1rem + 4vw, 5rem);
  --text-hero: clamp(2.75rem, 0.5rem + 6.5vw, 7rem);

  /* Spacing (4px base) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Surfaces — warm cream/parchment */
  --color-bg: #f7f4ec;
  --color-surface: #fbf9f2;
  --color-surface-2: #fdfcf8;
  --color-surface-offset: #efe9db;
  --color-surface-offset-2: #e6ddc9;
  --color-surface-dynamic: #dbd0b7;
  --color-divider: #ddd3bd;
  --color-border: #cebfa0;

  /* Text — deep bark charcoal */
  --color-text: #22261d;
  --color-text-muted: #6b6a57;
  --color-text-faint: #a29e88;
  --color-text-inverse: #f7f4ec;

  /* Primary Accent — Forest Green */
  --color-primary: #2f5d3a;
  --color-primary-hover: #24492c;
  --color-primary-active: #1a361f;
  --color-primary-highlight: #d4e2ce;

  /* Secondary Accent — Terracotta Soil (used for highlights/tags/dividers) */
  --color-soil: #b5622c;
  --color-soil-hover: #914d22;
  --color-soil-active: #6d3a19;
  --color-soil-highlight: #ecd6c4;

  /* Warning */
  --color-warning: #96551f;
  --color-warning-hover: #714016;
  --color-warning-active: #4c2a0f;
  --color-warning-highlight: #e2d0bc;

  /* Error */
  --color-error: #9c3b3b;
  --color-error-hover: #782d2d;
  --color-error-active: #531f1f;
  --color-error-highlight: #decdcb;

  /* Success (leaf green, brighter than primary) */
  --color-success: #4c7a34;
  --color-success-hover: #385c26;
  --color-success-active: #263f19;
  --color-success-highlight: #d3e0c9;

  /* Gold — for metrics/highlights */
  --color-gold: #b8892f;
  --color-gold-hover: #966d22;
  --color-gold-active: #715117;
  --color-gold-highlight: #e8dcc1;

  /* Blue (rarely used — water/sustainability data) */
  --color-blue: #386e7d;
  --color-blue-hover: #2a5560;
  --color-blue-active: #1c3b43;
  --color-blue-highlight: #cddadd;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1.25rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Shadows (warm-tinted) */
  --shadow-sm: 0 1px 2px oklch(0.2 0.02 100 / 0.08);
  --shadow-md: 0 4px 14px oklch(0.2 0.02 100 / 0.10);
  --shadow-lg: 0 16px 40px oklch(0.2 0.02 100 / 0.16);

  /* Content widths */
  --content-narrow: 640px;
  --content-default: 1000px;
  --content-wide: 1240px;
  --content-full: 100%;

  /* Fonts */
  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-body: 'General Sans', 'Work Sans', 'Helvetica Neue', sans-serif;
}

/* DARK MODE */
[data-theme='dark'] {
  --color-bg: #12150e;
  --color-surface: #171a11;
  --color-surface-2: #1b1f14;
  --color-surface-offset: #1e2216;
  --color-surface-offset-2: #262b1a;
  --color-surface-dynamic: #313720;
  --color-divider: #262b1a;
  --color-border: #3a4028;
  --color-text: #e7e3d3;
  --color-text-muted: #a19d87;
  --color-text-faint: #686553;
  --color-text-inverse: #1b1f14;
  --color-primary: #7bb384;
  --color-primary-hover: #97c69e;
  --color-primary-active: #b0d5b5;
  --color-primary-highlight: #263a29;
  --color-soil: #d68a55;
  --color-soil-hover: #e0a273;
  --color-soil-active: #e9ba98;
  --color-soil-highlight: #3f2f22;
  --color-warning: #c98a4c;
  --color-warning-hover: #d7a370;
  --color-warning-active: #e4bc96;
  --color-warning-highlight: #3c2f1f;
  --color-error: #c96e6e;
  --color-error-hover: #d68e8e;
  --color-error-active: #e2adad;
  --color-error-highlight: #3a2626;
  --color-success: #86ba69;
  --color-success-hover: #a1c988;
  --color-success-active: #bbd8a8;
  --color-success-highlight: #293620;
  --color-gold: #d3ac5f;
  --color-gold-hover: #ddbd7f;
  --color-gold-active: #e7ce9f;
  --color-gold-highlight: #3a3121;
  --color-blue: #6ca3b0;
  --color-blue-hover: #8fb9c4;
  --color-blue-active: #b1cfd7;
  --color-blue-highlight: #223338;
  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3);
  --shadow-md: 0 4px 14px oklch(0 0 0 / 0.4);
  --shadow-lg: 0 16px 40px oklch(0 0 0 / 0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #12150e;
    --color-surface: #171a11;
    --color-surface-2: #1b1f14;
    --color-surface-offset: #1e2216;
    --color-surface-offset-2: #262b1a;
    --color-surface-dynamic: #313720;
    --color-divider: #262b1a;
    --color-border: #3a4028;
    --color-text: #e7e3d3;
    --color-text-muted: #a19d87;
    --color-text-faint: #686553;
    --color-text-inverse: #1b1f14;
    --color-primary: #7bb384;
    --color-primary-hover: #97c69e;
    --color-primary-active: #b0d5b5;
    --color-primary-highlight: #263a29;
    --color-soil: #d68a55;
    --color-soil-hover: #e0a273;
    --color-soil-active: #e9ba98;
    --color-soil-highlight: #3f2f22;
    --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3);
    --shadow-md: 0 4px 14px oklch(0 0 0 / 0.4);
    --shadow-lg: 0 16px 40px oklch(0 0 0 / 0.5);
  }
}
