/* Reset + base typography */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Prevent accidental horizontal scroll from oversized text/images on mobile.
     overflow-x: clip is the modern choice — no phantom iOS scrollbar from
     nested horizontal scroll containers. Fall back to hidden for old Safari. */
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
  position: relative;
}

/* Offset anchor scroll under sticky header */
section[id] { scroll-margin-top: 72px; }

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--color-text);
  background: var(--surface-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, svg, video { max-width: 100%; height: auto; display: block; }
picture { display: contents; }
/* <source> must not become a layout box (breaks grid/flex parents) */
picture > source { display: none; }

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-display);
  color: var(--color-black);
  overflow-wrap: break-word;
  word-break: normal;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); line-height: var(--lh-snug); }

p { margin: 0; }
p + p { margin-top: var(--space-4); }

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease);
}
a:hover { opacity: 0.8; }
a:focus-visible {
  outline: 2px solid var(--color-green-dark);
  outline-offset: 3px;
  border-radius: 2px;
}

ul { margin: 0; padding: 0; list-style: none; }

.eyebrow {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--fs-tiny);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.lead {
  font-size: var(--fs-lead);
  color: var(--color-text-muted);
  max-width: 60ch;
}

.uppercase { text-transform: uppercase; }
/* Brand name keeps its camelCase even inside uppercased headings/eyebrows */
.brand-name { text-transform: none; }
.nowrap { white-space: nowrap; }

.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;
}

::selection {
  background: var(--color-green);
  color: var(--color-white);
}
