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

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

  html {
    scrollbar-gutter: stable;
    scroll-behavior: smooth;
  }

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

    *,
    *::before,
    *::after {
      animation: none !important;
      transition: none !important;
    }
  }

  body:has(:popover-open:not([data-no-scroll-lock]), dialog:modal) {
    overflow: hidden;
  }

  body {
    margin: 0;
    font-family:
      system-ui,
      -apple-system,
      sans-serif;
    line-height: 1.6;
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  p,
  ul,
  ol,
  blockquote,
  figure {
    margin: 0;
  }

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

  img {
    display: block;
    max-width: 100%;
  }

  a {
    color: inherit;
  }

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

@layer utilities {
  :is(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 2px;
  }

  .visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    border: 0 !important;

    clip-path: inset(50%) !important;
    overflow: hidden !important;
    white-space: nowrap !important;
  }
}
