/* ============================================================
   GRACE AFTER GRIT — Modern CSS Reset
   Based on Josh Comeau's CSS Reset + accessibility enhancements
   ============================================================ */

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

/* Remove default margins */
* {
  margin: 0;
  padding: 0;
}

/* Smooth scrolling (respects user preference) */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

@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;
  }
}

/* Body defaults */
body {
  min-height: 100vh;
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

/* Form element font inheritance */
input, button, textarea, select {
  font: inherit;
  color: inherit;
}

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

/* List reset */
ul, ol {
  list-style: none;
}

/* Link reset */
a {
  color: inherit;
  text-decoration: none;
}

/* Button reset */
button {
  background: none;
  border: none;
  cursor: pointer;
}

/* Table reset */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* Focus visible — accessible keyboard focus */
:focus-visible {
  outline: 3px solid var(--md-primary);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

:focus:not(:focus-visible) {
  outline: none;
}

/* Remove fieldset styling */
fieldset {
  border: none;
}

/* Screen reader only utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
