body {
  --ambientAmount: 0.1;
  --easeAmount: 0;
  animation: ambientMovement;
  animation-duration: 24s;
  animation-iteration-count: infinite;
  animation-timing-function: ease-in-out;
}

.rewind-report-container {
  perspective: 1000px;
  transform-style: preserve-3d;
  gap: 0.5em;
}

.rewind-card__wrapper {
  width: 150px;
  height: 100px;
  perspective: 1000px;
  will-change: transform;
  transform-style: preserve-3d;
  border-radius: 0.25vw;
  cursor: pointer;
  animation-name: ambientMovement;
  animation-duration: 4000ms;
  animation-delay: calc(-4000ms * var(--rand));
  animation-iteration-count: infinite;
  animation-timing-function: ease-in-out;
  transform: rotateZ(calc(var(--ambientAmount) * 10deg));
  z-index: 1;
  .rewind-card__inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transform-style: preserve-3d;
    transform: rotateY(0) scale(1);
  }
  &:hover {
    z-index: 999;
  }
  &:hover .rewind-card__inner {
    animation-name: flip-zoom;
    animation-direction: normal;
    animation-fill-mode: both;
    animation-timing-function: cubic-bezier(0.73, 0.42, 0.03, 0.78);
    animation-duration: 0.5s;
  }
  .rewind-card.-back {
    transform: rotateY(180deg);
  }
  .rewind-card.-front,
  .rewind-card.-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden; /* Safari */
    backface-visibility: hidden;
  }
}

@keyframes flip-zoom {
  0% {
    transform: rotateY(0) scale(1);
  }
  50% {
    transform: rotateY(0) scale(0.9);
  }
  100% {
    transform: rotateY(180deg) scale(1.25);
  }
}

.rewind-card {
  background-color: var(--secondary);
  box-shadow: 0 0 0 1px var(--primary-200);
  border-radius: var(--d-border-radius);
  display: flex;
  flex-direction: column;
  text-align: center;
  padding: 1em;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  &__title {
    font-weight: 600;
  }
  &__data {
    font-family: monospace;
    font-weight: normal;
    font-size: 14px;
  }
}

@keyframes ambientMovement {
  0% {
    --ambientAmount: 0.1;
  }
  50% {
    --ambientAmount: -0.1;
  }
  100% {
    --ambientAmount: 0.1;
  }
}

@keyframes card-hover {
  0% {
    transform: translateY(0) rotate(0);
  }
  25% {
    transform: translateY(-2px) rotate(2deg);
  }
  50% {
    transform: translateY(-4px) rotate(-1deg);
  }
  75% {
    transform: translateY(2px) rotate(-2deg);
  }
  100% {
    transform: translateY(0) rotate(0);
  }
}

@keyframes easeOutElastic {
  0% {
    --easeAmount: 0;
  }
  16% {
    --easeAmount: 1.3227;
  }
  28% {
    --easeAmount: 0.8688;
  }
  44% {
    --easeAmount: 1.0463;
  }
  59% {
    --easeAmount: 0.9836;
  }
  73% {
    --easeAmount: 1.0058;
  }
  88% {
    --easeAmount: 0.998;
  }
  100% {
    --easeAmount: 1;
  }
}

@property --easeAmount {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}

@property --ambientAmount {
  syntax: "<number>";
  inherits: true;
  initial-value: 0.1;
}
