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

html {
  min-width: 320px;
  background: var(--color-background);
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: clip;
  background: var(--color-background);
  color: var(--color-ink);
  font-family: var(--font-primary);
  font-size: var(--text-body);
  font-weight: 400;
  line-height: 1.3;
}

main {
  display: block;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--color-ink);
  font-family: var(--font-primary);
  font-weight: 400;
  text-wrap: balance;
}

h1,
.h1 {
  font-size: var(--text-h1);
  letter-spacing: -0.02em;
  line-height: 1;
}

h2,
.h2 {
  font-size: var(--text-h2);
  letter-spacing: -0.02em;
  line-height: 1;
}

h3,
.h3 {
  font-size: var(--text-h3);
  letter-spacing: -0.02em;
  line-height: 1;
}

h4,
.h4 {
  font-size: var(--text-h4);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

p {
  text-wrap: pretty;
}

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

button,
input,
textarea,
select {
  margin: 0;
  border: 0;
  border-radius: 0;
  color: inherit;
  font: inherit;
}

button,
[role="button"] {
  cursor: pointer;
}

button:disabled,
input:disabled,
textarea:disabled,
select:disabled {
  cursor: not-allowed;
}

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

img {
  height: auto;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

address {
  font-style: normal;
}

::selection {
  background: var(--color-accent);
  color: var(--color-surface);
}

:where(a, button, input, textarea, select, summary):focus-visible {
  outline: 0;
  box-shadow: var(--shadow-focus);
}

.container {
  width: min(100%, var(--page-max));
  margin-inline: auto;
  padding-inline: var(--page-gutter);
}

.content-width {
  width: min(100%, var(--content-max));
  margin-inline: auto;
}

.reading-width {
  width: min(100%, var(--reading-max));
  margin-inline: auto;
}

.accent {
  color: var(--color-accent);
}

.muted {
  color: var(--color-grey);
}

.fine-print {
  color: var(--color-grey);
  font-family: var(--font-fine);
  font-size: var(--text-caption);
  font-weight: 300;
  line-height: 1.2;
}

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

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  inset: 8px auto auto 8px;
  padding: 10px 14px;
  translate: 0 -160%;
  background: var(--color-ink-deep);
  color: var(--color-surface);
  transition: translate var(--duration-fast) var(--ease-out);
}

.skip-link:focus {
  translate: 0;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
}
