/* ============================================================
   Base — reset, typography, layout primitives.
   Consumes tokens.css only. No hard-coded design values.
   → WordPress: the middle of style.css
   ============================================================ */

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-body);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--green-600); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Type scale (handoff §3) ------------------------------- */

h1, h2, h3, h4 {
  color: var(--ink);
  font-weight: 600;
  margin: 0;
  text-wrap: pretty;          /* handoff rule */
}

.t-display {
  font-size: var(--fs-display);
  line-height: 1.02;
  letter-spacing: -0.03em;
}
h2, .t-h2 {
  font-size: var(--fs-h2);
  line-height: 1.15;
  letter-spacing: -0.02em;
}
h3, .t-h3 {
  font-size: var(--fs-h3);
  line-height: 1.30;
  letter-spacing: -0.01em;
}
p { margin: 0 0 var(--s-4); }
p:last-child { margin-bottom: 0; }

.t-lede {
  font-size: 19px;
  line-height: 1.6;
  color: var(--ink-muted);
}
.t-small { font-size: var(--fs-small); line-height: 1.55; color: var(--ink-muted); }
.t-meta  { font-size: 13px; color: var(--ink-faint); }

/* Eyebrow — the ONLY tracked-out UI type (handoff §3) */
.eyebrow {
  display: block;
  font-size: var(--fs-eyebrow);
  line-height: 1.4;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--green-600);
  margin: 0 0 var(--s-3);
}

/* Body measure cap — handoff: 56ch */
.measure { max-width: var(--measure); }

@media (max-width: 900px) { :root { --fs-display: 44px; } }
@media (max-width: 640px) {
  :root { --fs-display: 36px; --fs-h2: 30px; }
}

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

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

/* Section rhythm: alternates paper and wash.
   Shamrock (--dark) is used ONCE per page, as the closing CTA. */
.section { padding-block: var(--section-y); }
.section--wash { background: var(--green-50); }
.section--dark { background: var(--green-900); color: var(--on-dark-muted); }
.section--dark h2,
.section--dark h3 { color: var(--on-dark); }
.section--dark .eyebrow { color: var(--green-300); }
.section--tight { padding-block: calc(var(--section-y) * 0.6); }

/* Section heading cluster */
.sec-head { margin-bottom: var(--s-12); }
.sec-head p { color: var(--ink-muted); max-width: var(--measure); }

/* Grids: 3-up → 2-up → 1-up (handoff breakpoints) */
.grid { display: grid; gap: var(--s-6); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
}

/* Accessibility */
.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-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--paper), 0 0 0 5.5px var(--green-500);
  border-radius: var(--r-input);
}

/* Motion — respect reduced motion (handoff §6) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
