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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 1.25rem);
  color-scheme: light;
}

body {
  margin: 0;
  color: var(--color-ink);
  background: var(--color-surface);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

body.menu-open {
  overflow: hidden;
}

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

a {
  color: inherit;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

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

button,
select {
  cursor: pointer;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
dl {
  margin-top: 0;
}

h1,
h2,
h3,
h4 {
  color: var(--color-ink);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.12;
  text-wrap: balance;
}

h1 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 500;
  letter-spacing: -0.045em;
}

h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 500;
}

h3 {
  font-size: var(--text-lg);
}

h4 {
  font-size: var(--text-md);
}

p,
li,
dd {
  color: var(--color-ink-soft);
}

p {
  text-wrap: pretty;
}

ul,
ol {
  padding-left: 1.25rem;
}

::selection {
  color: var(--color-primary-deep);
  background: var(--color-secondary-soft);
}

:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: var(--space-3);
  left: var(--space-3);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  color: white;
  background: var(--color-primary-deep);
  transform: translateY(-180%);
  transition: transform var(--transition);
}

.skip-link:focus {
  transform: translateY(0);
}

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

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