/* Document-level styling: reset, typography, layout primitives, accessibility.
   Component styling lives in components.css; page-specific styling in pages.css. */

*,
*::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: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: var(--step-0);
  font-weight: var(--weight-regular);
  line-height: 1.62;
  letter-spacing: 0.01em;
  color: var(--text);
  background: var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

main { flex: 1 0 auto; }

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

/* --- Typography ---------------------------------------------------------- */
h1, h2, h3, h4 {
  margin: 0 0 0.55em;
  font-weight: var(--weight-thin);
  letter-spacing: -0.025em;
  line-height: 1.12;
  text-wrap: balance;
}

h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); font-weight: var(--weight-regular); letter-spacing: -0.015em; }
h4 { font-size: var(--step-0); font-weight: var(--weight-bold); letter-spacing: 0.01em; }

p { margin: 0 0 1.15em; max-width: var(--measure); text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a { color: inherit; text-decoration: none; }

/* Body links keep an underline: colour alone must never be the only signal. */
main p a,
.footer-note a {
  text-decoration: underline;
  text-underline-offset: 0.22em;
  text-decoration-thickness: 1px;
}

strong { font-weight: var(--weight-bold); }
small { font-size: var(--step--1); }

ul, ol { margin: 0 0 1.15em; padding-left: 1.2em; }
li { margin-bottom: 0.35em; }

/* --- Shared utilities ---------------------------------------------------- */
.muted { color: var(--muted); }

.eyebrow {
  display: inline-block;
  margin-bottom: 1.1rem;
  font-size: var(--step--1);
  font-weight: var(--weight-bold);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.lede {
  font-size: var(--step-1);
  font-weight: var(--weight-thin);
  line-height: 1.45;
  letter-spacing: -0.012em;
  max-width: 54ch;
}

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

.section { padding-block: var(--section-gap); }
.section + .section { padding-top: 0; }

.stack > * + * { margin-top: 1.15rem; }

/* Spacing utilities. These exist so no fragment needs a style attribute — the
   CSP is `style-src 'self'`, which blocks inline styles outright. */
.push { margin-top: 1.75rem; }
.push-sm { margin-top: 1rem; }

.grid {
  display: grid;
  gap: clamp(1rem, 0.6rem + 1.4vw, 1.65rem);
}

.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 21rem), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }

.rule {
  border: 0;
  border-top: 1px solid var(--hair);
  margin-block: var(--section-gap) 0;
}

/* --- Accessibility ------------------------------------------------------- */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100%;
  z-index: 100;
  padding: 0.7rem 1.1rem;
  background: var(--void-2);
  border: 1px solid var(--hair-2);
  border-radius: var(--radius);
  font-weight: var(--weight-bold);
}

.skip-link:focus-visible { top: 0.75rem; }

/* One visible focus treatment everywhere. Never removed, never colour-only. */
:where(a, button, input, textarea, select, [tabindex]):focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
  border-radius: var(--radius-sm);
}
