/* Box-model reset + base body styles. */

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

html {
  scroll-behavior: smooth;
  text-size-adjust: none;
}

/* Lenis drives smooth scrolling when active; native smooth scrolling
   would fight it. */
html.lenis {
  scroll-behavior: auto;
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* Square scrollbar. Chrome, Edge and Safari draw the thumb from the
   ::-webkit-scrollbar parts, where it can be made square. Current Chrome ignores
   those parts when scrollbar-color or scrollbar-width is set, so those two are
   left to Firefox, which has no way to square the thumb (it keeps its own). */

html::-webkit-scrollbar {
  width: 0.5rem;
  height: 0.5rem;
}

html::-webkit-scrollbar-track {
  background: transparent;
}

html::-webkit-scrollbar-thumb {
  border-radius: 0;
  background: var(--theme-color-heading-alt);
}

@supports (-moz-appearance: none) {
  :root {
    scrollbar-color: var(--theme-color-heading-alt) transparent;
    scrollbar-width: thin;
  }
}

/* `html ::selection` and `html body` outrank the parent theme's
   unscoped app.css rules regardless of load order. */
html ::selection {
  background: var(--theme-color-inverse);
  color: var(--theme-color-text-inverse);
}

html body {
  font-family: var(--theme-font-body);
  font-size: var(--theme-fs-base);
  font-weight: 400;
  line-height: var(--theme-lh-body);
  color: var(--theme-color-text);
  background: var(--theme-color-background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis: none;
  text-rendering: optimizelegibility;
}

img,
svg,
video,
picture {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  cursor: pointer;
}

ul[role='list'],
ol[role='list'] {
  list-style: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--theme-font-heading);
  font-weight: 400;
  line-height: var(--theme-lh-heading);
  letter-spacing: var(--theme-tracking-heading);
  text-wrap: pretty;
}

p {
  text-wrap: pretty;
}

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