
/* ================================
   REVEAL ANIMATION SYSTEM
================================ */

.reveal {
  --x: 0px;
  --y: 60px;
  --scale: 0.96;

  opacity: 0;
  transform: translate(var(--x), var(--y)) scale(var(--scale));

  transition:
    opacity 0.8s cubic-bezier(.16,1,.3,1),
    transform 0.8s cubic-bezier(.16,1,.3,1);

  will-change: transform, opacity;
}

.reveal.active {
  opacity: 1;
  transform: translate(0, 0) scale(1);
}

/* ================================
   DIRECTION VARIANTS
================================ */

.reveal-up {
  --y: 60px;
}

.reveal-down {
  --y: -60px;
}

@media (min-width: 768px) {

  .reveal-left {
    --x: -80px;
    --y: 0;
  }

  .reveal-right {
    --x: 80px;
    --y: 0;
  }
}

/* ================================
   WORD CYCLE (rotating tagline)
================================ */

.word-cycle {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  opacity: 0;
  animation: word-cycle-fade 7.5s ease-in-out infinite;
}

@keyframes word-cycle-fade {

  0%,
  4% {
    opacity: 0;
    transform: translateY(6px);
  }

  8%,
  25% {
    opacity: 1;
    transform: translateY(0);
  }

  30%,
  100% {
    opacity: 0;
    transform: translateY(-6px);
  }

}

/* ================================
   ACCESSIBILITY
================================ */

@media (prefers-reduced-motion: reduce) {

  .reveal,
  .reveal.active {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .word-cycle {
    position: static;
    opacity: 1;
    transform: none;
    animation: none;
  }

  .word-cycle:not(:first-child) {
    display: none;
  }

}
