:root {
  --stage: #f6f6f7;
  --motion-enter: ease-in-out;
  --motion-exit: ease-in-out;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  background: var(--stage);
}

.demo-stage {
  display: grid;
  min-height: 100vh;
  place-items: center;
}

.motion-frame {
  position: relative;
  width: 560px;
  height: 220px;
  overflow: hidden;
  background: var(--stage);
}

.alert-positioner {
  position: absolute;
  top: 44px;
  left: 50%;
  width: 477px;
  height: 133px;
  transform: translateX(-50%);
}

.alert-banner {
  position: relative;
  width: 477px;
  height: 133px;
  opacity: 0;
  transform: translateY(-178px) scale(0.985);
  transform-origin: center top;
  pointer-events: none;
  will-change: opacity, transform;
}

.alert-banner.is-entering,
.alert-banner.is-visible {
  pointer-events: auto;
}

.alert-banner.is-entering {
  animation: toast-enter 220ms var(--motion-enter) both;
}

.alert-banner.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.alert-banner.is-exiting {
  pointer-events: none;
  animation: toast-exit 180ms var(--motion-exit) both;
}

.alert-artwork {
  display: block;
  width: 477px;
  height: 133px;
}

.dismiss-button {
  position: absolute;
  z-index: 2;
  top: 65.9648px;
  left: 359.22px;
  width: 100.965px;
  height: 49.9765px;
  padding: 0;
  border: 0;
  border-radius: 8.24118px;
  background: transparent;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.dismiss-hover {
  position: absolute;
  z-index: 1;
  top: 65.9648px;
  left: 359.22px;
  display: block;
  width: 100.965px;
  height: 49.9765px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease;
}

.dismiss-button:hover + .dismiss-hover,
.dismiss-button:active + .dismiss-hover,
.dismiss-button:focus-visible + .dismiss-hover {
  opacity: 1;
}

@keyframes toast-enter {
  0% {
    opacity: 0;
    transform: translateY(-178px) scale(0.985);
  }

  72% {
    opacity: 1;
    transform: translateY(5px) scale(1);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-exit {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  to {
    opacity: 0;
    transform: translateY(-178px) scale(0.985);
  }
}

@media (prefers-reduced-motion: reduce) {
  .alert-banner.is-entering,
  .alert-banner.is-exiting {
    animation-duration: 1ms;
  }

  .dismiss-hover {
    transition-duration: 1ms;
  }
}
