/* Reset & base typography */

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

html {
  color-scheme: light dark;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-serif);
  font-size: var(--step-00);
  line-height: 1.55;
  min-height: 100vh;
}

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

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

a:not(.unstyled-link) {
  text-underline-offset: 0.15em;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

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

svg.icon {
  width: 1.25em;
  height: 1.25em;
  fill: none;
  flex-shrink: 0;
}

/* Visible keyboard focus everywhere - WCAG 2.2 2.4.11/2.4.13 */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -3rem;
  background: var(--color-ink);
  color: var(--color-bg);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--step-neg1);
  z-index: 100;
  transition: top 0.15s ease;
}

.skip-link:focus-visible {
  top: 0.5rem;
  outline-offset: 4px;
}

.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;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-mono);
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 var(--space-3);
}

h1 {
  font-size: var(--step-3);
}

h2 {
  font-size: var(--step-2);
}

h3 {
  font-size: var(--step-1);
}

p {
  margin: 0 0 var(--space-4);
}

.mono {
  font-family: var(--font-mono);
}

.sans {
  font-family: var(--font-sans);
}

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