/* Element defaults: typography, links, focus and motion preferences. */

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + var(--space-lg));
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  font-variant-numeric: tabular-nums;
}

h1,
h2,
h3,
h4 {
  font-weight: 620;
  line-height: var(--leading-heading);
  letter-spacing: -0.012em;
  text-wrap: balance;
}

h1,
h2 {
  font-stretch: var(--stretch-display);
  letter-spacing: -0.022em;
}

h1 {
  font-size: var(--text-page);
  line-height: var(--leading-display);
}

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

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

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

p,
li,
dd {
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

strong {
  font-weight: 600;
}

address {
  font-style: normal;
}

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

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

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

.skip-link {
  position: absolute;
  top: var(--space-xs);
  left: var(--space-xs);
  z-index: 100;
  padding: var(--space-xs) var(--space-md);
  background: var(--color-accent-strong);
  color: var(--color-on-accent);
  border-radius: var(--radius-sm);
  font-weight: 600;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: none;
}

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

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