/* Reset and element defaults, mobile first. */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--s-4));
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ink-900);
  color: var(--on-paper);
  font-family: var(--font-text);
  font-size: 1rem;
  line-height: 1.6;
  overflow-x: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

h1,
h2,
h3,
p,
ul,
dl,
dd,
figure {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  line-height: 1.1;
  text-wrap: balance;
  overflow-wrap: break-word;
  hyphens: auto;
}

a {
  color: inherit;
  text-underline-offset: 0.2em;
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--red-500);
  outline-offset: 3px;
  border-radius: 2px;
}

.surface-dark :focus-visible {
  outline-color: var(--on-ink);
}

.skip-link {
  position: absolute;
  left: var(--s-4);
  top: -100px;
  z-index: 100;
  padding: var(--s-3) var(--s-4);
  background: var(--on-ink);
  color: var(--ink-900);
  font-weight: 600;
  border-radius: var(--r-control);
}

.skip-link:focus {
  top: var(--s-2);
  outline-color: var(--red-500);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
