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

  html {
    -moz-text-size-adjust: none;
    -webkit-text-size-adjust: none;
    text-size-adjust: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  body {
    min-height: 100dvh;
    line-height: 1.5;
    margin: unset;
  }

  h1, h2, h3, h4,
  button, input, label {
    line-height: 1.1;
  }

  h1, h2, h3, h4 {
    text-wrap: balance;
    margin-block-start: unset;
  }

  a:not([class]) {
    text-decoration-skip-ink: auto;
    color: currentColor;
  }

  figure {
    margin: unset;
  }

  img, picture {
    max-inline-size: 100%;
    display: block;
    block-size: auto;
  }

  input, button, textarea, select {
    font-family: inherit;
    font-size: inherit;
  }

  :target {
    scroll-margin-block: 5ex;
  }

  svg {
    flex-shrink: 0;
  }

  [popover] {
    position-area: bottom;
    
    margin: initial;
    
    border: unset;

    opacity: 0;
    translate: 0 5px;
    transition:
      display 0.1s linear allow-discrete,
      overlay 0.1s linear allow-discrete,
      opacity 0.1s linear,
      translate 0.2s ease-out;

    &:popover-open {
      opacity: 1;
      translate: 0 0;
      
      @starting-style {
        opacity: 0;
        translate: 0 5px;
      }
    }
  }

  dialog {
    border: unset;
    box-shadow: 0 0 30px oklch(from var(--color-neutral) l c h / 0.5);

    opacity: 0;
    transition:
      display 0.1s linear allow-discrete,
      overlay 0.1s linear allow-discrete,
      opacity 0.1s linear,
      translate 0.2s ease-out;

    &::backdrop {
      background-color: oklch(from var(--color-neutral) l c h / 0.5);
      
      transition: opacity 0.1s linear;
      opacity: 0;
    }

    &[open], &[open]::backdrop {
      opacity: 1;
      translate: 0 0;
      
      @starting-style {
        opacity: 0;
        translate: 0 5px;
      }
    }
  }
}