/* Reset, element defaults, typography.

   Typographic contract:
   - Display headings are Archivo, uppercase, set on the width axis.
   - Body copy is Geist. Figures use its tabular numerals. There is no third face.
   - letter-spacing is never used, anywhere, including on uppercase text. */

/* Registered so the width and weight axes INTERPOLATE. font-variation-settings
   is not animatable as a string; a typed custom property inside it is. */
@property --wdth {
  syntax: '<number>';
  inherits: true;
  initial-value: 112;
}
@property --wght {
  syntax: '<number>';
  inherits: true;
  initial-value: 800;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + var(--space-4));
  background: var(--bg);
}

/* The browser scrolls. Nothing smooths the page as a whole any more, so the
   native behaviour is the one anchor links and the skip link ride on. */
html { scroll-behavior: smooth; }

/* Set while an overlay is up. The gutter is reserved in both states so locking
   the page does not pull the layout sideways by a scrollbar's width. */
html { scrollbar-gutter: stable; }
html.is-locked { overflow: hidden; }

/* `hidden` is only a User-Agent rule of display: none, so ANY component-level
   display wins against it and the element stays on screen while being absent
   from the accessibility tree — painted, but not there. That had already been
   patched three times in three files by the time it bit a fourth. Once, here,
   with the weight the attribute's meaning deserves. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

/* ------------------------------------------------------- display headings */

/* Applied through .display-* rather than to the element, so an h3 used for
   document structure is not dragged into caps. */
.display-xl,
.display-lg,
.display-md,
.display-sm,
.display-xs {
  font-family: var(--font-display);
  font-variation-settings: 'wdth' var(--wdth), 'wght' var(--wght);
  font-weight: 800;
  text-transform: uppercase;
  line-height: var(--leading-display);
  text-wrap: balance;
  /* Archivo's uppercase sits high in the em box; this optically centres a
     block of caps against the space around it. */
  margin-block: -0.06em;
}

.display-xl { font-size: var(--display-xl); }
.display-lg { font-size: var(--display-lg); }
.display-md { font-size: var(--display-md); }
.display-sm { font-size: var(--display-sm); line-height: var(--leading-tight); }
.display-xs { font-size: var(--display-xs); line-height: var(--leading-tight); --wght: 700; }

/* Mixed-case editorial variant, for long-form headings that would shout in
   caps. Same face, narrower and lighter. */
.display-sentence {
  text-transform: none;
  --wdth: 96;
  --wght: 600;
  line-height: var(--leading-tight);
}

h3, h4 {
  font-family: var(--font-sans);
  font-weight: 600;
  line-height: var(--leading-tight);
}

p { text-wrap: pretty; }

.lead {
  font-size: var(--text-lg);
  line-height: var(--leading-snug);
  color: var(--ink-2);
  max-width: 40ch;
}

.prose { color: var(--ink-2); max-width: 62ch; }
.prose > * + * { margin-top: var(--space-6); }
.prose strong { color: var(--ink); font-weight: 600; }

/* Figures that are counted, compared or animated.

   This was a monospace face. It is not any more: the site is two families and
   no more — Archivo for display headings, Geist for everything else. What the
   mono was actually earning was tabular figures, so that a counter animating
   from 0 to 94.53 does not jitter as each digit changes width. Geist carries
   tabular numerals, so the jitter is solved without a third family.

   Figures only. Never a label. */
.num { font-variant-numeric: tabular-nums; }

a {
  color: inherit;
  text-decoration-color: var(--brand);
  text-underline-offset: 0.22em;
  text-decoration-thickness: 1px;
}

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

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

:focus-visible {
  outline: 2px solid var(--brand-lift);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

::selection { background: var(--brand); color: #fff; }

.icon {
  width: 1em;
  height: 1em;
  flex: none;
  fill: currentColor;
}

/* --------------------------------------------------------------- layout */

/* Anything that can hold a display heading declares itself a container, so
   --display-* resolves against the width the heading actually has. */
.container,
.container--wide,
.container--narrow,
.measure,
.panel,
.card {
  container-type: inline-size;
}

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

.measure { max-width: 48rem; }
.measure--tight { max-width: 34rem; }

.section {
  position: relative;
  padding-block: var(--section-y);
}
.section--tight { padding-block: clamp(3.5rem, 7vw, 6rem); }
.section--flush-top { padding-top: 0; }

/* The header floats over the page, so the first section has to clear it. The
   homepage hero handles this in its own padding and opts out. */
main > .section:first-child { padding-top: calc(var(--section-y) + var(--header-h)); }

.rule { border: 0; border-top: 1px solid var(--line); margin: 0; }

.skip-link {
  position: fixed;
  left: var(--space-4);
  top: var(--space-4);
  z-index: 200;
  padding: var(--space-3) var(--space-5);
  background: var(--brand);
  color: #fff;
  border-radius: var(--radius-pill);
  text-decoration: none;
  transform: translateY(-250%);
  transition: transform var(--dur-base) var(--ease-out);
}
.skip-link:focus { transform: translateY(0); }

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

/* Everything interactive on this site is opt-in for a pointer. Keyboard and
   touch always reach a plain, working version. */
@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;
  }
}
