/* Art direction: Agricultural land tool → earthy, trustworthy, working-professional tone
   Palette: warm earthy green (#2d6a4f) primary, golden amber (#d4a017) accent, warm off-white bg
   Typography: Fraunces (display, agricultural warmth/character) + DM Sans (body, clean/modern)
   Density: spacious — landing page with generous whitespace */

/* ===== TYPE SCALE ===== */
:root {
  --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(3rem,     0.5rem  + 7vw,    8rem);

  /* ===== 4px SPACING ===== */
  --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;

  /* ===== FONTS ===== */
  --font-display: 'Fraunces', 'Georgia', serif;
  --font-body: 'DM Sans', 'Helvetica Neue', sans-serif;

  /* ===== RADIUS ===== */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

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

  /* ===== CONTENT WIDTHS ===== */
  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;
  --content-full: 100%;
}

/* ===== LIGHT MODE (default) ===== */
:root, [data-theme="light"] {
  /* Surfaces — warm off-white, organic feel */
  --color-bg:               #faf8f5;
  --color-surface:          #f5f2ed;
  --color-surface-2:        #efebe5;
  --color-surface-offset:   #e8e4dc;
  --color-surface-offset-2: #ddd8ce;
  --color-surface-dynamic:  #d4cfc5;
  --color-divider:          #ccc7bb;
  --color-border:           #bfb9ac;

  /* Text */
  --color-text:           #1a2e1a;
  --color-text-muted:     #5a6b5a;
  --color-text-faint:     #95a395;
  --color-text-inverse:   #faf8f5;

  /* Primary — earthy green */
  --color-primary:          #2d6a4f;
  --color-primary-hover:    #1b5038;
  --color-primary-active:   #143b2a;
  --color-primary-highlight: #c8ddd2;

  /* Accent — golden amber (CTA, sparingly) */
  --color-accent:           #d4a017;
  --color-accent-hover:     #b8890f;
  --color-accent-active:    #9a7209;
  --color-accent-highlight: #f0e4c0;

  /* Semantic */
  --color-success:        #437a22;
  --color-success-hover:  #2e5c10;
  --color-error:          #a13544;
  --color-error-hover:    #782b33;
  --color-warning:        #964219;
  --color-warning-hover:  #713417;

  /* Shadows — warm-tinted */
  --shadow-sm: 0 1px 2px oklch(0.25 0.02 80 / 0.08);
  --shadow-md: 0 4px 12px oklch(0.25 0.02 80 / 0.1);
  --shadow-lg: 0 12px 32px oklch(0.25 0.02 80 / 0.14);

  /* Dark surface for contrast sections */
  --color-dark-bg: #1a2e22;
  --color-dark-surface: #223828;
  --color-dark-text: #e8e4dc;
  --color-dark-text-muted: #9aab9a;
}

/* ===== DARK MODE ===== */
[data-theme="dark"] {
  --color-bg:               #121a15;
  --color-surface:          #182019;
  --color-surface-2:        #1e271f;
  --color-surface-offset:   #243026;
  --color-surface-offset-2: #2a372d;
  --color-surface-dynamic:  #334035;
  --color-divider:          #2e3a30;
  --color-border:           #3d4e40;

  --color-text:           #d4ddd4;
  --color-text-muted:     #8ea08e;
  --color-text-faint:     #5a6b5a;
  --color-text-inverse:   #121a15;

  --color-primary:          #5aab82;
  --color-primary-hover:    #3d9068;
  --color-primary-active:   #2d7553;
  --color-primary-highlight: #1e3327;

  --color-accent:           #e8b83a;
  --color-accent-hover:     #d4a017;
  --color-accent-active:    #b8890f;
  --color-accent-highlight: #3a3320;

  --color-success:        #6daa45;
  --color-success-hover:  #4d8f25;
  --color-error:          #dd6974;
  --color-error-hover:    #c24a59;
  --color-warning:        #bb653b;
  --color-warning-hover:  #b95525;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.25);
  --shadow-md: 0 4px 12px oklch(0 0 0 / 0.35);
  --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.45);

  --color-dark-bg: #0d1410;
  --color-dark-surface: #121a15;
  --color-dark-text: #d4ddd4;
  --color-dark-text-muted: #8ea08e;
}

/* System preference fallback */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg:               #121a15;
    --color-surface:          #182019;
    --color-surface-2:        #1e271f;
    --color-surface-offset:   #243026;
    --color-surface-offset-2: #2a372d;
    --color-surface-dynamic:  #334035;
    --color-divider:          #2e3a30;
    --color-border:           #3d4e40;
    --color-text:           #d4ddd4;
    --color-text-muted:     #8ea08e;
    --color-text-faint:     #5a6b5a;
    --color-text-inverse:   #121a15;
    --color-primary:          #5aab82;
    --color-primary-hover:    #3d9068;
    --color-primary-active:   #2d7553;
    --color-primary-highlight: #1e3327;
    --color-accent:           #e8b83a;
    --color-accent-hover:     #d4a017;
    --color-accent-active:    #b8890f;
    --color-accent-highlight: #3a3320;
    --color-success:        #6daa45;
    --color-success-hover:  #4d8f25;
    --color-error:          #dd6974;
    --color-error-hover:    #c24a59;
    --color-warning:        #bb653b;
    --color-warning-hover:  #b95525;
    --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.25);
    --shadow-md: 0 4px 12px oklch(0 0 0 / 0.35);
    --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.45);
    --color-dark-bg: #0d1410;
    --color-dark-surface: #121a15;
    --color-dark-text: #d4ddd4;
    --color-dark-text-muted: #8ea08e;
  }
}
