/* base.css — reset, typography, layout primitives. */

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

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

body {
  margin: 0;
  background: var(--field);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  /* clip, not hidden: overflow-x:hidden makes body a scroll container,
     which is a known hazard for scroll measurement. clip stops the
     overflow without creating a scroller. */
  overflow-x: clip;
  transition: background-color var(--dur-slow) var(--ease),
    color var(--dur-slow) var(--ease);
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 0.92;
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0 0 1em;
  text-wrap: pretty;
}

a {
  color: inherit;
}

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

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

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

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

.section {
  padding-block: var(--space-9);
  border-top: var(--rule) solid var(--rule-colour);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 var(--space-5);
}

.nil {
  color: var(--muted);
  opacity: 0.55;
}

/* Accessibility --------------------------------------------------------- */

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--field);
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  z-index: 100;
}

.skip:focus {
  left: var(--space-4);
  top: var(--space-4);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

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

/* Reduced motion is a hard requirement: everything becomes a static
   document. scroll.js also bails before registering any ScrollTrigger. */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  [data-motion] {
    transform: none !important;
    opacity: 1 !important;
    clip-path: none !important;
    filter: none !important;
  }
}
