/* ==========================================================================
   Base
   Element defaults and small utilities. No component styling here.
   ========================================================================== */

* { box-sizing: border-box; }

html {
  scroll-padding-top: 108px;
  scrollbar-gutter: stable;
  -webkit-text-size-adjust: 100%;
  /* arrows like ↗ have an emoji form; iPhones would otherwise draw a blue
     emoji (the HTML also adds U+FE0E after each one) */
  font-variant-emoji: text;
}

/* Keep wheel/touch input from moving the page behind the opening screen. */
html.loading { overflow: hidden; }

body {
  margin: 0;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-body);
}

a, button { touch-action: manipulation; }
button { font: inherit; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--color-ink);
  outline-offset: 5px;
}

::selection { background: var(--color-stone); color: var(--color-ink); }

.skip-link {
  position: fixed;
  top: 12px;
  left: var(--gutter);
  z-index: 100;
  padding: 12px 20px;
  background: var(--color-ink);
  color: var(--color-paper);
  transform: translateY(-180%);
}
.skip-link:focus { transform: none; }

/* Page wrapper: sets the default text style for everything inside */
.page {
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: var(--weight-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

a {
  color: var(--color-ink);
}

/* :where() keeps specificity at zero, so any component that sets its own
   link color keeps that color on hover. */
@media (hover: hover) and (pointer: fine) {
  a:where(:hover) { color: var(--color-muted); }
}

/* ---- Utilities ---- */
.text-accent {
  color: var(--color-accent);
}

.list-reset {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Hidden visually, still read by screen readers */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
