/* =========================================================
   base.css — Reset, typography, utilities
   ========================================================= */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  max-width: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  transition: background var(--dur-base) var(--ease-smooth), color var(--dur-base) var(--ease-smooth);
  min-height: 100vh;
  max-width: 100%;
  overflow-x: clip;
}

/* Constrain common overflow culprits to viewport width on mobile */
.site-nav,
.nav-inner,
.mobile-drawer,
.leaflet-container {
  max-width: 100vw;
}
.map-wrapper,
#service-area-map,
.service-area-map {
  overflow: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  color: inherit;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 var(--space-3);
  color: var(--text);
}

h1 { font-size: var(--text-hero); font-weight: 500; }
h2 { font-size: var(--text-display); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p {
  margin: 0 0 var(--space-3);
  color: var(--text);
}

.lead {
  font-size: var(--text-lg);
  line-height: 1.55;
  color: var(--text-muted);
}

.eyebrow {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-strong);
  margin: 0 0 var(--space-2);
}

.section-title {
  font-family: var(--font-serif);
  font-size: var(--text-section);
  font-weight: 500;
  margin: 0 0 var(--space-3);
  letter-spacing: -0.015em;
}

.section-sub {
  font-size: var(--text-lg);
  color: var(--text-muted);
  max-width: 56ch;
  margin: 0 auto var(--space-6);
}

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-serif { font-family: var(--font-serif); }
.text-accent { color: var(--accent-strong); }

/* Layout helpers */
.container {
  width: 100%;
  max-width: var(--max-content);
  margin: 0 auto;
  padding-inline: var(--space-3);
}
@media (min-width: 640px) { .container { padding-inline: var(--space-4); } }
@media (min-width: 1024px) { .container { padding-inline: var(--space-6); } }

.narrow {
  max-width: var(--max-narrow);
  margin-inline: auto;
}

.section {
  padding-block: var(--space-12);
}
@media (max-width: 640px) {
  .section { padding-block: var(--space-8); }
}

.section-alt { background: var(--bg-alt); }
.section-inverse { background: var(--bg-inverse); color: var(--text-inverse); }
.section-inverse h1, .section-inverse h2, .section-inverse h3, .section-inverse h4, .section-inverse p { color: var(--text-inverse); }
.section-inverse .text-muted { color: rgba(250, 247, 242, 0.75); }

/* Grid helpers */
.grid { display: grid; gap: var(--space-4); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.grid-6 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); }

/* Flex helpers */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }

.divider-gold {
  width: 56px;
  height: 2px;
  background: var(--accent);
  border: none;
  margin: var(--space-3) auto var(--space-4);
}

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

/* Focus */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Selection */
::selection { background: var(--accent); color: var(--color-navy); }

/* Scrollbar (subtle) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* rebuild utility additions */
.muted{color:var(--color-muted)}
.small{font-size:var(--text-sm)}
.text-center{text-align:center}
