/* ============================================================
   BASE — page defaults, focus styles, helpers.
   ============================================================ */

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

html, body {
  margin: 0;
  background: var(--page);
  color: var(--dark);
  font-family: var(--text);
  -webkit-font-smoothing: antialiased;
}


/* Open menu: the page behind it is held still, without changing its height,
   so it stays where you'd scrolled to (and is still there when the menu closes).
   scrollbar-gutter keeps the scrollbar's space reserved, so the page doesn't
   shift sideways when the scrollbar hides (Windows, or Macs set to always show scrollbars). */
html { scrollbar-gutter: stable; }
html.menu-open { overflow: hidden; }

a { color: inherit; }

:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 3px; }
.strip :focus-visible, .menu :focus-visible, .topbar :focus-visible, .btn:focus-visible { outline-color: var(--accent); }
[tabindex="-1"]:focus { outline: none; }

/* Hidden until focused with the keyboard */
.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 100;
  padding: 10px 14px; background: var(--light); color: var(--dark);
  border: 1px solid var(--dark); border-radius: 8px;
  font-size: var(--fs-meta); letter-spacing: var(--track); text-transform: uppercase; text-decoration: none;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* No animations until the page has appeared (site.js adds .ready), so nothing slides into place
   on arrival — Safari can otherwise animate the menu open-and-shut as a page loads.
   (With JavaScript off, .ready never comes and the site simply doesn't animate.) */
html:not(.ready) *, html:not(.ready) *::before, html:not(.ready) *::after { transition: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
