/* =============================================================================
   BASE — reset, element defaults, typography, small utilities.
   Reads tokens from theme.css. Avoid hardcoding colors or fonts in here.
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 16px);
  -webkit-text-size-adjust: 100%;
  /* Stops the off-canvas mobile nav (parked at translateX(100%)) from adding
     horizontal scroll. `clip` rather than `hidden` — it doesn't create a
     scroll container, so the sticky header keeps working. */
  overflow-x: clip;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: var(--font-weight-body);
  font-size: var(--fs-base);
  line-height: var(--line-height-body);
  color: var(--color-body);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 .5em;
  font-family: var(--font-heading);
  font-weight: var(--font-weight-heading);
  line-height: var(--line-height-heading);
  letter-spacing: var(--letter-spacing-heading);
  color: var(--color-ink);
  text-wrap: balance;
}

h1 { font-size: var(--fs-display); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
strong { font-weight: var(--font-weight-bold); color: var(--color-ink); }

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

::selection { background: var(--color-primary); color: var(--color-on-primary); }


/* ---------- Layout helpers ---------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Standalone — nests inside .container without doubling the gutter */
.container-narrow {
  width: 100%;
  max-width: var(--container-narrow);
  margin-inline: auto;
}

section { padding-block: var(--section-padding); }
section.section-tight { padding-block: var(--space-7); }
.bg-alt { background: var(--color-bg-alt); }

@media (max-width: 900px) {
  section { padding-block: var(--section-padding-mobile); }
}


/* ---------- Section headers ---------- */

.section-head {
  max-width: 640px;
  margin: 0 auto var(--space-8);
  text-align: center;
}
.section-head p { font-size: var(--fs-lg); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
  padding: var(--space-2) 18px;
  border-radius: var(--radius-pill);
  background: var(--color-primary-tint);
  color: var(--color-primary-dark);
  font-size: var(--fs-2xs);
  font-weight: var(--font-weight-bold);
  letter-spacing: .02em;
}
.eyebrow .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-primary);
}


/* ---------- Utilities ---------- */

.text-center { text-align: center; }
.hl { color: var(--color-primary); }
.muted { color: var(--color-body); }
.stack-sm > * + * { margin-top: var(--space-3); }

.icon { width: 20px; height: 20px; flex-shrink: 0; }
.icon-sm { width: 16px; height: 16px; flex-shrink: 0; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  padding: 10px 16px;
  background: var(--color-primary);
  color: var(--color-on-primary);
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

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

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