/* base.css — resets, document defaults, the type scale, and the accessibility floor.
 * Depends on tokens.css. Sets the look of raw elements; components.css styles the
 * named classes. */

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

/* The `hidden` attribute must always win, even over class display rules like
 * .btn{display:inline-flex} (author origin beats the UA [hidden] rule otherwise). */
[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Headlines use the condensed display face. Tight leading + slight negative
 * tracking gives the confident, premium-contractor voice. */
h1, h2, h3, h4 {
  margin: 0 0 var(--s-3);
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-wrap: balance;
}
h1 { font-size: clamp(2.6rem, 6vw, 5.2rem); }
h2 { font-size: clamp(2rem, 4vw, 3.4rem); }
h3 { font-size: clamp(1.3rem, 2vw, 1.7rem); letter-spacing: 0; }
h4 { font-size: 1.1rem; letter-spacing: 0; }

p { margin: 0 0 var(--s-4); }
p:last-child { margin-bottom: 0; }

a { color: var(--forest-2); text-decoration: none; }
a:hover { color: var(--gold-dark); }

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

strong, b { font-weight: 700; }

small { font-size: 0.82rem; }

code, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

::selection { background: rgba(36, 106, 85, .22); }

/* Visible focus for keyboard users — never removed without a replacement. */
:focus-visible {
  outline: 2px solid var(--forest-2);
  outline-offset: 2px;
  border-radius: 4px;
}
[data-theme="dark"] :focus-visible { outline-color: var(--gold); }

/* Layout primitive: a max-width content column with consistent inline padding. */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad);
}

/* Screen-reader-only text. */
.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;
}

/* Skip link revealed on focus. */
.skip-link {
  position: absolute; left: var(--s-3); top: -60px;
  background: var(--forest); color: #fff; padding: 10px 16px;
  border-radius: var(--r-sm); z-index: var(--z-tooltip);
  transition: top var(--dur-1) var(--ease);
}
.skip-link:focus { top: var(--s-3); color: #fff; }

/* Reduced-motion: kill smooth scroll + cap all animations/transitions. The shimmer
 * has its own per-component guard in shimmer.css that keeps the green border. */
@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;
  }
}

/* Anchored targets (e.g. /pricing.html#packages, #custom, the #main skip target)
 * land with breathing room below the fixed 72px header instead of underneath it. */
:target, #packages, #custom, #main {
  scroll-margin-top: 84px;
}
