/*
 * reset.css
 *
 * A modern, opinionated CSS reset that:
 *   – Removes browser inconsistencies
 *   – Sets sensible defaults for box-sizing, margins, and padding
 *   – Improves text rendering and media defaults
 *   – Respects user motion preferences from the start
 *
 * Based on Josh Comeau's modern CSS reset (adapted).
 * Do NOT put design values here — use variables.css for that.
 */

/* 1. Use border-box sizing globally */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* 2. Remove default margin and padding */
* {
  margin: 0;
  padding: 0;
}

/* 3. Root defaults */
html {
  font-size: 100%;           /* respect user browser font size setting */
  scroll-behavior: smooth;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  hanging-punctuation: first last;
}

/* 4. Body baseline */
body {
  min-height: 100dvh;
  line-height: var(--leading-normal);
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text-primary);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* 5. Images and media */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

/* 6. Form elements inherit font */
input,
button,
textarea,
select {
  font: inherit;
}

/* 7. Avoid text overflow on long strings */
p,
h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

h1, h2, h3, h4, h5, h6 {
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

/* 8. List resets (use .list-styled to restore bullets/numbers) */
ul,
ol {
  list-style: none;
}

/* 9. Anchor reset */
a {
  color: inherit;
  text-decoration: none;
}

/* 10. Button reset */
button {
  cursor: pointer;
  background: none;
  border: none;
  appearance: none;
  -webkit-appearance: none;
}

/* 11. Table resets */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* 12. HR */
hr {
  border: none;
  border-top: var(--border-width) var(--border-style) var(--color-border);
}

/* 13. Focus outline — visible for keyboard, hidden for mouse (handled via :focus-visible) */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--color-brand-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* 14. Respect user motion preferences */
@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;
  }
}
