/* ============================================================
   Base — reset, typography, layout primitives, focus
   ============================================================ */

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

* {
  margin: 0;
}

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

body {
  /* The host paints nothing behind us, so background is explicit. */
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--step-0);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

img {
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  cursor: pointer;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  transition: color var(--t-fast) var(--ease);
}

::selection {
  background: var(--select-bg);
  color: var(--select-ink);
}

/* ---- Typography ------------------------------------------- */

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--lh-snug);
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 {
  font-size: var(--step-5);
  font-weight: 800;
  line-height: var(--lh-tight);
  letter-spacing: -0.035em;
  /* --lh-tight is deliberately tighter than the font's ink height, so
     descenders (g, j, p, q, y) paint a few pixels below the line box.
     Nothing crops them today, but .hero__stage is overflow:hidden and
     an earlier version of this site did clip them. This keeps the
     tight leading while making the box actually contain the glyphs. */
  padding-block-end: 0.08em;
}

h2 {
  font-size: var(--step-3);
}

h3 {
  font-size: var(--step-1);
}

p {
  text-wrap: pretty;
}

/* ---- Focus -------------------------------------------------
   Visible, generous, and one of the five sanctioned uses of
   the accent. Never removed — only replaced.                 */

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

:focus:not(:focus-visible) {
  outline: none;
}

.skip-link {
  position: absolute;
  top: var(--s-3);
  left: var(--s-3);
  z-index: 100;
  padding: var(--s-2) var(--s-4);
  border-radius: var(--r-sm);
  background: var(--accent-fill);
  color: var(--on-accent-fill);
  font-size: var(--step--1);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform var(--t-mid) var(--ease);
}

.skip-link:focus-visible {
  transform: translateY(0);
}

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

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

.section {
  padding-block: clamp(var(--s-8), 10vw, var(--s-10));
}

.section--tint {
  background: var(--surface);
}

.measure {
  max-width: var(--measure);
}

.stack > * + * {
  margin-top: var(--flow, var(--s-4));
}

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

/* ---- Reduced motion ----------------------------------------
   One global switch. Individual components check the same
   query where they need to do more than shorten a duration
   (the hero pin collapses entirely, for instance).          */

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