/* ===========================================
   CSS Reset / Normalize
   ===========================================
   Modern CSS reset with accessibility in mind.
   =========================================== */

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

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

  /* Prevent font size inflation */
  html {
    -moz-text-size-adjust: none;
    -webkit-text-size-adjust: none;
    text-size-adjust: none;
  }

  /* Set core body defaults */
  body {
    min-height: 100vh;
    line-height: 1.5;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
      "Helvetica Neue", Arial, sans-serif;
    color: var(--color-text);
    background-color: var(--color-background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

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

  /* Set shorter line heights on headings */
  h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    text-wrap: balance;
  }

  /* A elements that don't have a class get default styles */
  a:not([class]), .link {
    color: var(--color-link);
    text-decoration: underline dotted;
    text-decoration-skip-ink: auto;

    &.link--destructive {
      color: var(--color-error);
    }
  }

  a:not([class]):hover {
    color: var(--color-link-hover);
  }

  /* Make images easier to work with */
  img,
  picture,
  video,
  canvas,
  svg {
    display: block;
    max-width: 100%;
    height: auto;
  }

  /* Inherit fonts for inputs and buttons */
  input,
  button,
  textarea,
  select {
    font: inherit;
    color: inherit;
  }

  /* Textarea without rows attribute */
  textarea:not([rows]) {
    min-height: 10em;
  }

  /* Anything that has been anchored to should have extra scroll margin */
  :target {
    scroll-margin-block: 5ex;
  }

  /* Remove all animations and transitions for people who prefer not to see them */
  @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;
    }
  }

  /* Focus visible styles */
  :focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px hsl(var(--color-primary-h) var(--color-primary-s) 50% / 0.2);
  }

  /* Remove outline for mouse users */
  :focus:not(:focus-visible) {
    outline: none;
  }

  /* Remove default button styles */
  button {
    background: none;
    border: none;
    cursor: pointer;
  }

  /* Disabled elements */
  [disabled] {
    cursor: not-allowed;
    opacity: 0.6;
  }

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

  .visually-hidden {
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
  }

} /* End @layer reset */
