/* Product moments driven by rl-scenes.js. Nothing here applies until the
   script marks a scene as pending, so the page reads the same without it. */

.rl-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Stamps pressed onto the card, one after another. Until its turn, each
   stamp looks like the empty slots beside it. */
.rl-scene[data-rl-scene="stamps"].is-pending > .rl-stamp {
  background-color: transparent;
  border-color: var(--rl-stamp-empty, #AFBAB9);
  border-style: dashed;
  color: transparent;
}

.rl-scene[data-rl-scene="stamps"].is-playing > .rl-stamp {
  animation: rl-stamp-press 560ms cubic-bezier(0.2, 0.8, 0.25, 1.15) both;
  animation-delay: calc(var(--rl-i, 0) * 150ms + 120ms);
}

/* The colours ink in from the empty slot to the page's own stamp style. */
@keyframes rl-stamp-press {
  0% {
    background-color: transparent;
    border-color: var(--rl-stamp-empty, #AFBAB9);
    border-style: dashed;
    color: transparent;
    transform: none;
  }

  1% {
    transform: scale(1.6) rotate(-14deg);
  }

  55% {
    transform: scale(0.92) rotate(4deg);
  }

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

/* Reminders arriving like notifications on a phone. */
.rl-scene[data-rl-scene="notifications"].is-pending > * {
  opacity: 0;
  transform: translateY(-16px) scale(0.97);
}

.rl-scene[data-rl-scene="notifications"] > * {
  transition:
    opacity 480ms cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 560ms cubic-bezier(0.2, 0.8, 0.2, 1.1);
  transition-delay: calc(var(--rl-i, 0) * 420ms + 150ms);
}

/* Progress filling from the left. */
.rl-scene[data-rl-scene="progress"] > * {
  transform-origin: left center;
  transition: transform 1100ms cubic-bezier(0.2, 0.7, 0.2, 1) 180ms;
}

.rl-scene[data-rl-scene="progress"].is-pending > * {
  transform: scaleX(0);
}

@media (prefers-reduced-motion: reduce) {
  .rl-scene > *,
  .rl-scene.is-pending > * {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
