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

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

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--color-ink-body);
  background: var(--color-surface-white);
  accent-color: var(--color-emerald);
  caret-color: var(--color-emerald);
}

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

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

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

a {
  color: var(--color-emerald);
  text-underline-offset: 0.18em;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--color-ink-body);
  margin: 0;
  line-height: 1.12;
  text-wrap: balance;
}

p {
  margin: 0;
}

ul, ol {
  margin: 0;
  padding: 0;
}

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

.skip-link {
  position: absolute;
  inset-block-start: -100%;
  inset-inline-start: 1rem;
  z-index: 100;
  padding: 0.65rem 1rem;
  background: var(--color-emerald);
  color: var(--color-surface-white);
  font-weight: 700;
  text-decoration: none;
  border-radius: var(--radius-sm);
}

.skip-link:focus {
  inset-block-start: 0.75rem;
}

/* Custom scrollbar theming */
@media (pointer: fine) {
  ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
  }
  ::-webkit-scrollbar-track {
    background: var(--color-surface-mist);
  }
  ::-webkit-scrollbar-thumb {
    background: #8b9993;
    border: 2px solid var(--color-surface-mist);
  }
  ::-webkit-scrollbar-thumb:hover {
    background: var(--color-emerald);
  }
}
