/* ============================================================
   reset.css — layer order is declared HERE and nowhere else.
   Load order in every HTML file must match this declaration.
   ============================================================ */

@layer reset, tokens, base, layout, components, utilities;

@layer reset {

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

  * {
    margin: 0;
    padding: 0;
  }

  html {
    /* Full-bleed sections use a grid escape, never 100vw. This keeps the
       gutter reserved so nothing shifts when a page grows past one screen. */
    scrollbar-gutter: stable;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  body {
    min-height: 100svh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }

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

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

  button {
    background: none;
    border: 0;
    cursor: pointer;
  }

  p,
  h1,
  h2,
  h3,
  h4 {
    overflow-wrap: break-word;
  }

  ul[class],
  ol[class] {
    list-style: none;
  }

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

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

  /* ---------------------------------------------------------------
     REDUCED MOTION — the vestibular-safety floor.

     This block is the ONLY sanctioned use of !important in the codebase.
     !important escapes @layer ordering entirely, which is exactly the
     property a global safety override needs and exactly why it is banned
     everywhere else. Both halves live here, adjacent, so the re-enable
     always wins by source order rather than by a second !important war
     scattered across component files.
     --------------------------------------------------------------- */
  @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;
    }

    /* Opacity feedback survives at 160ms. Reduced motion means less
       vestibular trigger, not no feedback -- a UI that changes state with
       zero transition reads as broken rather than as calm. */
    .is-in [data-reveal-child],
    .pg-fade,
    .pg-panel,
    .pg-btn,
    .pg-link::after {
      transition: opacity 160ms linear !important;
    }
  }
}
