/* =============================================
   Modern CSS Reset + Base Styles
   Using Cascade Layers for easy overrides
   ============================================= */

@layer reset {
  /* 1. Better box-sizing */
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  /* 2. Remove default margins (except dialog) */
  *:not(dialog) {
    margin: 0;
  }

  /* 3. Core document styles */
  html {
    /* Smooth scrolling, but respect user motion preferences */
    scroll-behavior: smooth;
  }

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

  body {
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeSpeed;
  }

  /* 4. Typography improvements */
  h1, h2, h3, h4, h5, h6 {
    text-wrap: balance;
    line-height: 1.1;
  }

  p {
    text-wrap: pretty;
  }

  /* 5. Media elements */
  img,
  picture,
  video,
  canvas,
  svg {
    display: block;
    /* max-width: 100%;
    height: auto; */
  }

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

  /* Remove annoying outlines on focus for mouse users, keep for keyboard */
  :focus-visible {
    outline: none;
    outline-offset: 0;
  }

  /* 7. Lists */
  ul,
  ol {
    list-style: none;
    padding: 0;
  }

  /* 8. Anchor styles */
  a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 0.15em;
  }

  /* 9. Table resets */
  table {
    border-collapse: collapse;
  }

  /* 10. Make everything more accessible by default */
  @media (prefers-reduced-motion: no-preference) {
    html {
      interpolate-size: allow-keywords;
    }
  }
}