/* ===========================================================
   ProViands — Design Tokens
   Palette derived from brand logo (forest green / sage leaf)
   =========================================================== */

:root {
  /* 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.25rem);
  --text-3xl: clamp(2.25rem, 1rem + 3.75vw, 4.5rem);

  /* Spacing (4px system) */
  --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;

  /* Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.875rem;
  --radius-full: 9999px;

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

  /* Content widths */
  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1180px;

  /* Fonts */
  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Inter', -apple-system, 'Segoe UI', sans-serif;
}

:root,
[data-theme='light'] {
  /* Surfaces — warm paper / trade-ledger feel */
  --color-bg: #faf8f2;
  --color-surface: #ffffff;
  --color-surface-2: #fdfcf9;
  --color-surface-offset: #f1eee4;
  --color-surface-offset-2: #e9e4d5;
  --color-divider: #e2ddce;
  --color-border: #d6cfba;

  /* Text */
  --color-text: #201f1a;
  --color-text-muted: #635e50;
  --color-text-faint: #a29a84;
  --color-text-inverse: #faf8f2;

  /* Primary — Forest Green (from logo wordmark) */
  --color-primary: #34502b;
  --color-primary-hover: #263c1f;
  --color-primary-active: #1c2e17;
  --color-primary-highlight: #dfe6d5;

  /* Accent — Sage Leaf (from logo leaf) */
  --color-accent: #7a9f47;
  --color-accent-hover: #64843a;
  --color-accent-highlight: #e7edd8;

  /* Warning / Error (minimal use) */
  --color-warning: #9a5a1f;
  --color-error: #9b3535;

  --shadow-sm: 0 1px 2px oklch(0.2 0.02 100 / 0.06);
  --shadow-md: 0 6px 20px oklch(0.2 0.02 100 / 0.09);
  --shadow-lg: 0 18px 40px oklch(0.2 0.02 100 / 0.14);
}

[data-theme='dark'] {
  --color-bg: #14170f;
  --color-surface: #191d13;
  --color-surface-2: #1d2116;
  --color-surface-offset: #20241a;
  --color-surface-offset-2: #262b1d;
  --color-divider: #2b3121;
  --color-border: #363c28;

  --color-text: #e9e6d9;
  --color-text-muted: #a9a591;
  --color-text-faint: #6f6c59;
  --color-text-inverse: #1a1d13;

  --color-primary: #86b56d;
  --color-primary-hover: #a0cb87;
  --color-primary-active: #b6da9f;
  --color-primary-highlight: #2c3a24;

  --color-accent: #a9cb74;
  --color-accent-hover: #bfdb8f;
  --color-accent-highlight: #33421f;

  --color-warning: #d38a4c;
  --color-error: #d17b7b;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.35);
  --shadow-md: 0 6px 20px oklch(0 0 0 / 0.4);
  --shadow-lg: 0 18px 40px oklch(0 0 0 / 0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #14170f;
    --color-surface: #191d13;
    --color-surface-2: #1d2116;
    --color-surface-offset: #20241a;
    --color-surface-offset-2: #262b1d;
    --color-divider: #2b3121;
    --color-border: #363c28;
    --color-text: #e9e6d9;
    --color-text-muted: #a9a591;
    --color-text-faint: #6f6c59;
    --color-text-inverse: #1a1d13;
    --color-primary: #86b56d;
    --color-primary-hover: #a0cb87;
    --color-primary-active: #b6da9f;
    --color-primary-highlight: #2c3a24;
    --color-accent: #a9cb74;
    --color-accent-hover: #bfdb8f;
    --color-accent-highlight: #33421f;
    --color-warning: #d38a4c;
    --color-error: #d17b7b;
    --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.35);
    --shadow-md: 0 6px 20px oklch(0 0 0 / 0.4);
    --shadow-lg: 0 18px 40px oklch(0 0 0 / 0.5);
  }
}
