/* Reset */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

a {
  color: inherit;
  text-underline-offset: 0.2em;
}

h1,
h2,
h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

/* Focus: always visible, never harsh */

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

[tabindex='-1']:focus {
  outline: none;
}

::selection {
  background: color-mix(in srgb, var(--taupe) 28%, transparent);
}

/* Utilities */

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

.skip-link {
  position: fixed;
  top: var(--s-3);
  left: var(--s-3);
  z-index: 100;
  padding: var(--s-2) var(--s-4);
  background: var(--primary-bg);
  color: var(--primary-fg);
  border-radius: var(--r-pill);
  font-size: var(--small);
  text-decoration: none;
  transform: translateY(-200%);
}
.skip-link:focus {
  transform: none;
}

/* Boot screen: shown before scripts arrive, so there is never a blank page. */

.boot {
  display: grid;
  place-items: center;
  align-content: center;
  gap: var(--s-4);
  min-height: 100dvh;
  color: var(--text-soft);
  animation: fade-in 900ms var(--ease) both;
}
.boot svg {
  width: 2.25rem;
  height: 2.25rem;
  color: var(--accent);
}
.boot .wordmark {
  font-size: 1.75rem;
}

.noscript {
  padding: var(--s-7) var(--gutter);
  text-align: center;
  color: var(--text-soft);
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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