/**
 * Reset and typographic foundation.
 *
 * KEEP-on-clone: contains no colour or font values of its own, only references
 * to brand tokens.
 */

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

html {
  -webkit-text-size-adjust: 100%;
  /* Anchors scroll clear of the sticky header rather than under it. */
  scroll-padding-top: calc(var(--header-h) + var(--sp-4));
}

body {
  margin: 0;
  background: var(--paper-tint);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--leading-tight);
  letter-spacing: -0.01em;
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }

p { margin: 0 0 var(--sp-3); }
p:last-child { margin-bottom: 0; }

a {
  color: var(--gold-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

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

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

/**
 * One focus style, everywhere, and it is never removed.
 *
 * Gold on navy is the brand's own accent, so the accessible thing and the
 * on-brand thing are the same thing — which is the only way a focus ring
 * survives a design review.
 */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Skip link — the first thing a keyboard user meets. */
.skip-link {
  position: absolute;
  left: var(--sp-4);
  top: calc(-1 * var(--header-h) - 20px);
  z-index: 100;
  padding: var(--sp-2) var(--sp-4);
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius-sm);
  transition: top 120ms ease;
}
.skip-link:focus { top: var(--sp-3); }

/* Visually hidden, but read aloud. */
.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;
}

.muted { color: var(--ink-muted); }
.small { font-size: var(--text-sm); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
