/*
 * CSS Reset
 * Modern reset for consistent cross-browser rendering
 */

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

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

  /* Improve text rendering */
  html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-size-adjust: 100%;
  }

  /* Prevent horizontal scroll from positioned elements */
  html,
  body {
    overflow-x: clip;
  }

  /* Full-height flex layout so main fills remaining viewport */
  body {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
  }

  main {
    flex: 1;
  }

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

  /* Remove built-in form typography styles */
  input,
  button,
  textarea,
  select {
    font: inherit;
  }

  /* Avoid text overflows */
  p,
  li,
  h1,
  h2,
  h3,
  h4 {
    word-break: break-word;
  }

  /* Remove list styles on ul, ol with role="list" */
  ul[role="list"],
  ol[role="list"] {
    list-style: none;
    padding: 0;
  }

  /* Anchor defaults */
  a {
    color: inherit;
    text-decoration: inherit;
  }

  /* Fieldset reset */
  fieldset {
    border: none;
    padding: 0;
    margin: 0;
  }

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

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

  /* Summary marker removal */
  summary {
    &::-webkit-details-marker { display: none; }
    &::marker { content: ""; }
  }

  /* Reduced motion preference */
  @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;
    }
  }
}
