/* ==========================================================================
   base.css — Reset, CSS variables, typography
   Home Services Website Factory · Master Template
   Mobile-first. Breakpoints: 480 / 768 / 1024 / 1280px
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS Variables (:root)
   Brand colors are overridden per-client by brand.css (auto-generated).
   The values here are the Home Services default palette.
   -------------------------------------------------------------------------- */
:root {
  /* Brand colors — auto-populated/overridden by brand.css */
  --brand-primary: #2563eb;    /* Main brand color (blue) */
  --brand-secondary: #1e40af;  /* Darker shade */
  --brand-accent: #f59e0b;     /* CTA accent (orange) */
  --brand-accent-dark: #d97706;/* Accent hover */
  --brand-dark: #1f2937;       /* Text / headers */
  --brand-light: #f3f4f6;      /* Backgrounds */
  --brand-white: #ffffff;

  /* Semantic / UI colors */
  --color-text: #1f2937;
  --color-text-muted: #6b7280;
  --color-border: #e5e7eb;
  --color-success: #16a34a;
  --color-error: #dc2626;
  --color-star: #f59e0b;
  --overlay-dark: rgba(15, 23, 42, 0.62);

  /* Typography */
  --font-heading: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --fs-xs: 0.75rem;    /* 12px */
  --fs-sm: 0.875rem;   /* 14px */
  --fs-base: 1rem;     /* 16px */
  --fs-md: 1.125rem;   /* 18px */
  --fs-lg: 1.375rem;   /* 22px */
  --fs-xl: 1.75rem;    /* 28px */
  --fs-2xl: 2.25rem;   /* 36px */
  --fs-3xl: 3rem;      /* 48px */
  --fs-4xl: 3.75rem;   /* 60px */

  --lh-tight: 1.15;
  --lh-snug: 1.35;
  --lh-normal: 1.6;

  --fw-normal: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;

  /* Spacing scale */
  --space-xs: 0.5rem;   /* 8px */
  --space-sm: 1rem;     /* 16px */
  --space-md: 2rem;     /* 32px */
  --space-lg: 4rem;     /* 64px */
  --space-xl: 8rem;     /* 128px */

  /* Border radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.10);
  --shadow-md: 0 4px 6px -1px rgba(16, 24, 40, 0.08), 0 2px 4px -2px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 12px 20px -4px rgba(16, 24, 40, 0.12), 0 4px 8px -4px rgba(16, 24, 40, 0.08);
  --shadow-xl: 0 24px 48px -12px rgba(16, 24, 40, 0.18);

  /* Layout */
  --container-max: 1200px;
  --container-wide: 1360px;
  --header-height: 72px;
  --mobile-cta-height: 60px;

  /* Motion */
  --transition-fast: 0.15s ease;
  --transition-base: 0.25s ease;
  --transition-slow: 0.4s ease;

  /* z-index scale */
  --z-header: 1000;
  --z-drawer: 1100;
  --z-overlay: 1050;
  --z-mobile-cta: 900;
  --z-modal: 1200;
}

/* --------------------------------------------------------------------------
   2. Modern reset
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 1rem);
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--color-text);
  background-color: var(--brand-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Prevent scroll when mobile drawer open */
body.no-scroll {
  overflow: hidden;
}

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

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

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

ul,
ol {
  list-style: none;
}

a {
  color: var(--brand-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--brand-secondary);
}

table {
  border-collapse: collapse;
  width: 100%;
}

/* --------------------------------------------------------------------------
   3. Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  color: var(--brand-dark);
  letter-spacing: -0.01em;
}

h1 { font-size: var(--fs-2xl); margin-bottom: var(--space-sm); }
h2 { font-size: var(--fs-xl); margin-bottom: var(--space-sm); }
h3 { font-size: var(--fs-lg); margin-bottom: var(--space-xs); }
h4 { font-size: var(--fs-md); margin-bottom: var(--space-xs); }
h5 { font-size: var(--fs-base); font-weight: var(--fw-semibold); }
h6 { font-size: var(--fs-sm); font-weight: var(--fw-semibold); text-transform: uppercase; letter-spacing: 0.05em; }

p {
  margin-bottom: var(--space-sm);
  max-width: 68ch;
}

strong, b { font-weight: var(--fw-semibold); }

small { font-size: var(--fs-sm); }

.eyebrow {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-primary);
  margin-bottom: var(--space-xs);
}

.text-muted { color: var(--color-text-muted); }
.text-center { text-align: center; }
.text-white { color: var(--brand-white); }

/* --------------------------------------------------------------------------
   4. Accessibility helpers
   -------------------------------------------------------------------------- */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-sm);
  z-index: var(--z-modal);
  padding: 0.75rem 1.25rem;
  background: var(--brand-primary);
  color: var(--brand-white);
  border-radius: var(--radius-md);
  font-weight: var(--fw-semibold);
  transition: top var(--transition-fast);
}
.skip-link:focus {
  top: var(--space-sm);
  color: var(--brand-white);
}

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

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

/* --------------------------------------------------------------------------
   5. Responsive type scale (fluid up at breakpoints)
   -------------------------------------------------------------------------- */
@media (min-width: 768px) {
  h1 { font-size: var(--fs-3xl); }
  h2 { font-size: var(--fs-2xl); }
  h3 { font-size: var(--fs-xl); }
}

@media (min-width: 1024px) {
  h1 { font-size: var(--fs-4xl); }
  p { font-size: var(--fs-md); }
}
