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

html {
  min-block-size: 100%;
  background: var(--color-page);
  font-family: var(--font-interface);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html[data-language-ready="pending"] body {
  visibility: hidden;
}

body {
  isolation: isolate;
  min-block-size: 100vh;
  min-block-size: 100svh;
  margin: 0;
  overflow-x: clip;
  background-color: var(--color-page);
  color: var(--color-text);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--color-grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--color-grid) 1px, transparent 1px);
  background-position: center top;
  background-size: clamp(4rem, 8vw, 7rem) clamp(4rem, 8vw, 7rem);
  content: "";
  pointer-events: none;
}

:where(h1, h2, h3, p, figure, blockquote, dl, dd) {
  margin: 0;
}

:where(ul, ol) {
  margin: 0;
  padding: 0;
}

:where(img, picture, svg, video, canvas) {
  display: block;
  max-inline-size: 100%;
}

img {
  block-size: auto;
}

:where(button, input, select, textarea) {
  margin: 0;
  color: inherit;
  font: inherit;
}

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

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

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

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

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