/* ==========================================================================
   RESET
   ==========================================================================
   An opinionated modern reset, not a Normalize-style browser-parity patch.
   Goal: remove default styling that fights our design system, while
   preserving useful native behavior (e.g. form control inheritance).
   ========================================================================== */

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

* {
  margin: 0;
  padding: 0;
}

html {
  /* Prevents iOS text-size-adjust from silently breaking our type scale */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Respect user font-size preferences; base px size is set in base.css */
  scroll-behavior: smooth;
}

@media (max-width: 767px) {
  html {
    font-size: 100%;
  }
}

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

body {
  min-height: 100vh;
  line-height: 1.5; /* overridden per-element in base.css; sane fallback */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

button {
  background: none;
  border: none;
  cursor: pointer;
  text-align: inherit;
}

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

ul, ol {
  list-style: none;
}

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

/* Prevent long words/URLs from breaking the reading layout */
p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

/* Avoid layout shift from scrollbars on platforms that reserve space */
html {
  scrollbar-gutter: stable;
}

/* Remove built-in form typography inconsistencies */
textarea {
  resize: vertical;
}

/* Respect reduced motion globally at the reset level as a final safety net.
   Component-level motion should already check this, but this guarantees
   no animation/transition slips through uncontrolled. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
