/*
 * Reset, based on Josh W. Comeau's "custom CSS reset" (https://www.joshwcomeau.com/css/custom-css-reset/)
 * and Andy Bell's "(more) modern CSS reset" (https://piccalil.li/blog/a-more-modern-css-reset/).
 * Selectors use :where() so any later rule overrides them.
 */

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

  * { margin: 0; }

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

  @media (prefers-reduced-motion: no-preference) {
    html { interpolate-size: allow-keywords; scroll-behavior: smooth; }
  }

  body { min-height: 100vh; line-height: 1.5; }

  :where(h1, h2, h3, h4, h5, h6) { font-size: inherit; font-weight: inherit; text-wrap: balance; overflow-wrap: break-word; }

  :where(p, li, figcaption) { text-wrap: pretty; overflow-wrap: break-word; }

  /* Lists with a class are layout, not content: no bullets or indent */
  :where(ul, ol)[class] { list-style: none; padding: 0; }

  :where(a) { color: inherit; text-decoration-skip-ink: auto; }

  :where(img, picture, video, canvas, svg) { display: block; max-width: 100%; }
  :where(img) { height: auto; }

  :where(input, button, textarea, select) { font: inherit; color: inherit; letter-spacing: inherit; }

  :where(button) { border: 0; background: none; padding: 0; cursor: pointer; }

  :where(textarea:not([rows])) { min-height: 10em; }

  :where(table) { border-collapse: collapse; }

  :target { scroll-margin-block: 5ex; }

  /* hidden always hides, even on elements whose display is set elsewhere */
  [hidden] { display: none !important; }
}
