/* ==========================================================================
   Base / Reset / Typography
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@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;
    scroll-behavior: auto !important;
  }
}

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

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

/* Default size for our hand-authored line icons (WRAP() in lib/icons.js
   gives every icon class="icon-svg") — contexts that need a different
   size (e.g. .card--icon svg, loaded after this file) override it.
   Without this, a bare icon() call with no sizing wrapper inflates to
   fill its container because of the max-width:100% rule above. */
.icon-svg {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  display: inline-block;
  vertical-align: -0.15em;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--ink);
  margin: 0 0 0.5em;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

h1 { font-size: 38px; line-height: 44px; letter-spacing: -0.02em; }
h2 { font-size: 30px; line-height: 38px; }
h3 { font-size: 24px; line-height: 32px; font-weight: 600; }
h4 { font-size: 20px; line-height: 28px; font-weight: 600; }

@media (min-width: 900px) {
  h1 { font-size: 56px; line-height: 64px; letter-spacing: -0.03em; }
  h2 { font-size: 40px; line-height: 48px; letter-spacing: -0.025em; }
  h3 { font-size: 28px; line-height: 36px; }
}

.eyebrow {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal-700);
}

.eyebrow-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--sand-900);
  background: var(--sand-100);
  border: 1px solid var(--sand-400);
  border-radius: var(--radius-full);
  padding: 7px 16px 7px 12px;
}
.eyebrow-pill svg { width: 15px; height: 15px; color: var(--teal-800); flex: none; }

.lede {
  font-size: 17px;
  line-height: 1.6;
  color: var(--body);
}
@media (min-width: 900px) {
  .lede { font-size: 18px; line-height: 1.65; }
}

.text-muted { color: var(--muted); }

/* Focus states — visible everywhere, never suppressed */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2.5px solid var(--teal-800);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--teal-800);
  color: #fff;
  padding: 0.75rem 1.25rem;
  z-index: 1000;
  border-radius: 0 0 var(--radius-md) 0;
}
.skip-link:focus {
  left: 0;
}

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

/* Layout primitives */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.section {
  padding-top: var(--space-2xl);
  padding-bottom: var(--space-2xl);
}
.section--tight { padding-top: var(--space-xl); padding-bottom: var(--space-xl); }
.section--alt { background: var(--background-alt); }
.section--surface { background: var(--surface); }
.section--sand { background: var(--sand-100); }
.section--dark {
  background: var(--teal-900);
  color: rgba(255,255,255,0.88);
}
.section--dark h1, .section--dark h2, .section--dark h3, .section--dark h4 { color: #fff; }
.section--dark .eyebrow { color: var(--sand-400); }

.grid {
  display: grid;
  gap: var(--space-lg);
}
@media (min-width: 700px) {
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1000px) {
  .grid--4 { grid-template-columns: repeat(4, 1fr); }
}

.stack { display: flex; flex-direction: column; gap: var(--space-md); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--space-sm); align-items: center; }

.flow-lg > * + * { margin-top: var(--space-xl); }

.text-center { text-align: center; }
.measure { max-width: 68ch; }
.measure-narrow { max-width: 52ch; }

.mx-auto { margin-left: auto; margin-right: auto; }

/* Scroll-reveal: content is visible by default (no-JS, or JS not yet run).
   Only once the head's inline script marks <html class="js"> does content
   start hidden, pending IntersectionObserver adding .is-visible — so
   nothing ever depends on animation to be readable. */
.reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: no-preference) {
  html.js .reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.6s ease, transform 0.6s ease;
  }
  html.js .reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
  }
}
