/* ==========================================
   BASE CSS — Midwest RoofPros & Construction
   ========================================== */

/* === DESIGN TOKENS === */
: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);

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

  /* Brand palette — derived from logo gold/tan */
  --color-gold:        #b5873a;
  --color-gold-light:  #c9a05a;
  --color-gold-dark:   #8c6325;
  --color-gold-pale:   #f5eddf;

  /* Surfaces — warm charcoal/slate for roofing authority */
  --color-bg:              #f8f6f2;
  --color-surface:         #ffffff;
  --color-surface-2:       #faf9f6;
  --color-surface-offset:  #f0ece4;
  --color-divider:         #e0dbd2;
  --color-border:          #d4cfc6;

  /* Text */
  --color-text:         #1e1c18;
  --color-text-muted:   #6b6762;
  --color-text-faint:   #a8a49f;
  --color-text-inverse: #f9f8f4;

  /* Primary accent = brand gold */
  --color-primary:           #b5873a;
  --color-primary-hover:     #8c6325;
  --color-primary-active:    #6a4a1a;
  --color-primary-highlight: #f0e6d0;

  /* Dark navy for strong CTAs / hero dark areas */
  --color-dark:       #14181f;
  --color-dark-2:     #1d2330;
  --color-dark-3:     #252c3a;

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

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(20, 16, 8, 0.08);
  --shadow-md:  0 4px 16px rgba(20, 16, 8, 0.10);
  --shadow-lg:  0 12px 40px rgba(20, 16, 8, 0.14);
  --shadow-xl:  0 20px 60px rgba(20, 16, 8, 0.18);

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

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

  /* Fonts */
  --font-display: 'Aldrich', 'Arial Narrow', sans-serif;
  --font-body:    'Aldrich', 'Helvetica Neue', sans-serif;
}

[data-theme='dark'] {
  --color-bg:             #121110;
  --color-surface:        #1a1916;
  --color-surface-2:      #1f1e1b;
  --color-surface-offset: #242220;
  --color-divider:        #2e2c29;
  --color-border:         #3a3834;
  --color-text:           #e8e5e0;
  --color-text-muted:     #8a8782;
  --color-text-faint:     #585552;
  --color-text-inverse:   #1a1916;
  --color-primary:        #c9a05a;
  --color-primary-hover:  #e0bc7a;
  --color-primary-active: #f5d898;
  --color-primary-highlight: #3a2e18;
  --color-gold:           #c9a05a;
  --color-gold-light:     #e0bc7a;
  --color-gold-pale:      #2e2618;
  --color-dark:           #0c0e12;
  --color-dark-2:         #141820;
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.3);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg:  0 12px 40px rgba(0,0,0,0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg:             #121110;
    --color-surface:        #1a1916;
    --color-surface-2:      #1f1e1b;
    --color-surface-offset: #242220;
    --color-divider:        #2e2c29;
    --color-border:         #3a3834;
    --color-text:           #e8e5e0;
    --color-text-muted:     #8a8782;
    --color-text-faint:     #585552;
    --color-text-inverse:   #1a1916;
    --color-primary:        #c9a05a;
    --color-primary-hover:  #e0bc7a;
    --color-primary-active: #f5d898;
    --color-primary-highlight: #3a2e18;
    --color-gold:           #c9a05a;
    --color-gold-light:     #e0bc7a;
    --color-gold-pale:      #2e2618;
    --color-dark:           #0c0e12;
    --color-dark-2:         #141820;
  }
}

/* === BASE RESET === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: var(--space-20);
}

body {
  min-height: 100dvh;
  line-height: 1.6;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

ul[role='list'], ol[role='list'] { list-style: none; }

input, button, textarea, select { font: inherit; color: inherit; }

h1, h2, h3, h4, h5, h6 {
  text-wrap: balance;
  line-height: 1.15;
}

p, li, figcaption {
  text-wrap: pretty;
  max-width: 72ch;
}

::selection {
  background: rgba(181, 135, 58, 0.2);
  color: var(--color-text);
}

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

a, button, [role='button'], input, textarea, select {
  transition:
    color var(--transition),
    background var(--transition),
    border-color var(--transition),
    box-shadow var(--transition),
    opacity var(--transition);
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}
