/* ============================================================
   Base / reset / typography primitives
   ============================================================ */

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
}

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

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

h1 { font-size: var(--fs-h1); text-wrap: balance; }
h2 { font-size: var(--fs-h2); text-wrap: balance; }
h3 { font-size: var(--fs-h3); font-weight: 800; }

p { margin: 0; max-width: 62ch; }

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

/* Visible keyboard focus everywhere, never remove outline without a replacement */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

button { font-family: inherit; cursor: pointer; }

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

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
/* A <caption> or <table>-related visually-hidden element can push its
   scrollWidth past width:1px (white-space:nowrap preserves its natural,
   unwrapped text width for layout/scroll calculations even though it's
   visually clipped), which can tip a narrow viewport into horizontal
   scroll. Table captions are long sentences, not short labels, so for
   those specifically allow wrapping within the 1px box instead. */
caption.visually-hidden { white-space: normal; }

.skip-link {
  position: absolute;
  left: var(--sp-2);
  top: -60px;
  background: var(--navy);
  color: #fff;
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--radius-sm);
  z-index: 200;
  transition: top 0.15s var(--ease);
}
.skip-link:focus { top: var(--sp-2); }

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