/* Art direction: Montana Rod & Gun Club (est. 1902) → Rugged, authoritative, outdoor heritage
   Palette: Warm dark surfaces, deep charcoal/slate with amber/gold accent + forest green secondary
   Typography: Cormorant (display serif — authority, heritage) + General Sans (body — clean, modern outdoor)
   Density: Spacious — informational/community site, generous section padding */

/* ======================== CUSTOM BRGC PALETTE ======================== */

: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.5rem);
  --text-3xl:  clamp(2.5rem,   1rem    + 4vw,    5rem);
  --text-hero: clamp(3rem,     0.5rem  + 7vw,    8rem);

  /* 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;

  /* 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%;

  /* Font families */
  --font-display: 'Cormorant', 'Georgia', serif;
  --font-body: 'General Sans', 'Helvetica Neue', sans-serif;
}

/* ======================== LIGHT MODE ======================== */
:root, [data-theme="light"] {
  /* Surfaces — warm cream/off-white with stone undertone */
  --color-bg:               #f5f2ec;
  --color-surface:          #faf8f4;
  --color-surface-2:        #ffffff;
  --color-surface-offset:   #ede9e0;
  --color-surface-offset-2: #e5e0d5;
  --color-surface-dynamic:  #ddd8cc;
  --color-divider:          #d0cbbf;
  --color-border:           #c5bfb1;

  /* Text — deep charcoal (warm) */
  --color-text:           #1c1a15;
  --color-text-muted:     #6b6760;
  --color-text-faint:     #a09b92;
  --color-text-inverse:   #faf8f4;

  /* Primary Accent — warm amber/gold */
  --color-primary:        #b8860b;
  --color-primary-hover:  #9a7009;
  --color-primary-active: #7a5907;
  --color-primary-highlight: #f0e4c8;

  /* Secondary — forest green */
  --color-secondary:       #2d5a27;
  --color-secondary-hover: #1e4019;
  --color-secondary-active:#14300f;

  /* Success */
  --color-success:          #2d5a27;
  --color-success-hover:    #1e4019;
  --color-success-highlight:#d8e5d5;

  /* Error */
  --color-error:          #a13535;
  --color-error-hover:    #7d2020;
  --color-error-highlight:#e0cecc;

  /* Warning */
  --color-warning:        #964219;
  --color-warning-hover:  #713417;

  /* Shadows (warm-tinted) */
  --shadow-sm: 0 1px 2px oklch(0.2 0.02 70 / 0.06);
  --shadow-md: 0 4px 12px oklch(0.2 0.02 70 / 0.08);
  --shadow-lg: 0 12px 32px oklch(0.2 0.02 70 / 0.12);
}

/* ======================== DARK MODE ======================== */
[data-theme="dark"] {
  /* Surfaces — deep charcoal/slate with warm undertone */
  --color-bg:               #141210;
  --color-surface:          #1b1916;
  --color-surface-2:        #22201c;
  --color-surface-offset:   #1e1c18;
  --color-surface-offset-2: #262420;
  --color-surface-dynamic:  #302e28;
  --color-divider:          #2a2824;
  --color-border:           #3a3832;

  /* Text */
  --color-text:           #e8e5de;
  --color-text-muted:     #9a968d;
  --color-text-faint:     #5e5b54;
  --color-text-inverse:   #1b1916;

  /* Primary Accent — brighter amber for dark bg */
  --color-primary:        #d4a017;
  --color-primary-hover:  #e8b52c;
  --color-primary-active: #f0c850;
  --color-primary-highlight: #3a3425;

  /* Secondary — lighter forest green */
  --color-secondary:       #5fa856;
  --color-secondary-hover: #4a8b42;
  --color-secondary-active:#398032;

  /* Success */
  --color-success:          #5fa856;
  --color-success-hover:    #4a8b42;
  --color-success-highlight:#2a3428;

  /* Error */
  --color-error:          #d06060;
  --color-error-hover:    #b94848;
  --color-error-highlight:#3a2828;

  /* Warning */
  --color-warning:        #bb653b;
  --color-warning-hover:  #b95525;

  /* Shadows */
  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.2);
  --shadow-md: 0 4px 12px oklch(0 0 0 / 0.3);
  --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.4);
}

/* System preference fallback */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg:               #141210;
    --color-surface:          #1b1916;
    --color-surface-2:        #22201c;
    --color-surface-offset:   #1e1c18;
    --color-surface-offset-2: #262420;
    --color-surface-dynamic:  #302e28;
    --color-divider:          #2a2824;
    --color-border:           #3a3832;
    --color-text:           #e8e5de;
    --color-text-muted:     #9a968d;
    --color-text-faint:     #5e5b54;
    --color-text-inverse:   #1b1916;
    --color-primary:        #d4a017;
    --color-primary-hover:  #e8b52c;
    --color-primary-active: #f0c850;
    --color-primary-highlight: #3a3425;
    --color-secondary:       #5fa856;
    --color-secondary-hover: #4a8b42;
    --color-secondary-active:#398032;
    --color-success:          #5fa856;
    --color-success-hover:    #4a8b42;
    --color-success-highlight:#2a3428;
    --color-error:          #d06060;
    --color-error-hover:    #b94848;
    --color-error-highlight:#3a2828;
    --color-warning:        #bb653b;
    --color-warning-hover:  #b95525;
    --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.2);
    --shadow-md: 0 4px 12px oklch(0 0 0 / 0.3);
    --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.4);
  }
}
