/* Reset + element defaults. No visual design decisions belong here beyond
   neutralizing the browser stylesheet — that's typography.css/layout.css. */

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100svh;
  font-family: var(--font-body);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: var(--line-height-normal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

img {
  font-style: italic; /* alt text styling if an image fails to load */
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

fieldset {
  border: none;
  min-width: 0;
}

/* The [hidden] attribute's UA-stylesheet display:none loses to any author
   rule of equal-or-higher specificity that sets display on the same
   element (e.g. .btn's display: inline-flex) — author origin always beats
   user-agent origin regardless of source order. Reassert it here so
   `hidden` reliably hides any element, everywhere, no matter what other
   classes it carries. */
[hidden] {
  display: none !important;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

table {
  border-collapse: collapse;
}

:target {
  scroll-margin-top: var(--space-24);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
