/* ===========================================
   Modern CSS Reset + Base Enhancements
   =========================================== */

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

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

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
}

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

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

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

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

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

ul, ol {
  list-style: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* Remove default styling for form elements */
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
  -webkit-appearance: none;
}

/* Prevent iOS zoom on input focus (16px at every width) */
@supports (-webkit-touch-callout: none) {
  input, textarea, select {
    font-size: 16px;
  }
}

/* Anchor offset for the sticky top bar */
html {
  scroll-padding-top: var(--header-height, 56px);
}

/* Hide elements accessibly */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Root isolation */
#root, #__next {
  isolation: isolate;
}

/* The single reduced-motion rule. Scrolling is never smooth: smooth
 * programmatic scrollIntoView destabilises system specs.
 *
 * Transitions are removed, not shortened. transition-property defaults to
 * `all`, so a forced duration on every element makes every property change
 * a transition: after a resize across a breakpoint, margins, padding and
 * heights keep their old values until the next frame finishes them, and a tap
 * or click aimed at that layout lands wherever the element moves to.
 * (Animations are safe to shorten: animation-name defaults to none.) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
