.wrapper {
  --scale: scale(1);
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) var(--scale);
  background: var(--color-background-static-muted);
  @extend .pos-3dp;
  border-radius: var(--radii-large);
  z-index: var(--z-index-overlay);
  overflow: auto;
  /* stylelint-disable-next-line csstools/value-no-unknown-custom-properties */
  width: var(--width);
  opacity: 1;
  visibility: visible;

  &.wrapperEnter {
    opacity: 0;
    visibility: hidden;
    --scale: scale(0.975);
  }

  &.wrapperEnterActive {
    opacity: 1;
    visibility: visible;
    --scale: scale(1);

    transition: var(--transition-slow);
    transition-property: opacity, visibility, transform;
  }

  &.wrapperExit {
    opacity: 1;
    visibility: visible;
    --scale: scale(1);
  }

  &.wrapperExitActive {
    opacity: 0;
    visibility: hidden;

    transition: var(--transition-slow);
    transition-property: opacity, visibility, transform;
    --scale: scale(0.975);
  }
}

.backdrop {
  position: fixed;
  z-index: var(--z-index-overlay-backdrop);
  inset: 0;
  background: var(--color-background-overlay);
  cursor: pointer;
  opacity: 1;
  visibility: visible;

  &.backdropEnter {
    opacity: 0;
    visibility: hidden;
  }

  &.backdropEnterActive {
    opacity: 1;
    visibility: visible;

    transition: var(--transition-slow);
    transition-property: opacity, visibility;
  }

  &.backdropExit {
    opacity: 1;
    visibility: visible;
    pointer-events: none;
  }

  &.backdropExitActive {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition: var(--transition-slow);
    transition-property: opacity, visibility;
  }
}

.closeButton {
  position: absolute;
  top: 8px;
  right: 8px;
  opacity: 0;
  cursor: cell;
  pointer-events: none;

  &:focus {
    pointer-events: all;
    opacity: 1;
  }
}
