/* Hidden only when JS runs (html.ai-split-js is set in wp_head), so text never disappears without JS. */
.ai-split-js .ai-text-hide {
  opacity: 0;
}

.ai-text-revel-wrapper .ai-split-line-reveal {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
}

.ai-text-revel-wrapper .ai-split-line-reveal .word {
  display: inline-block;
  transform: translateY(2em);
  opacity: 0;
  transition: transform .4s ease, opacity .4s ease;
}

.ai-text-revel-wrapper .ai-split-line-reveal .ai-split-line-span-reaveal {
  transform: translateY(0);
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .ai-split-js .ai-text-hide,
  .ai-text-revel-wrapper .ai-split-line-reveal .word {
    transform: none;
    opacity: 1;
    transition: none;
  }
}

/*
 * Rotating words: the active word wipes in from the left while the old one wipes out.
 * Each word is a mask (overflow hidden) moving one way and its text moving the
 * other, so the letters stay put while the mask passes over them.
 * Without JS, or with reduced motion, only the first word shows.
 */
.ai-rotate {
  position: relative;
  display: inline-block;
  vertical-align: bottom;
  transition: width .8s cubic-bezier(.2, 1, .3, 1);
}

.ai-rotate-words {
  display: block;
}

.ai-rotate-word {
  display: block;
  overflow: hidden;
  /* room for descenders inside the mask */
  padding-bottom: .12em;
  margin-bottom: -.12em;
  white-space: nowrap;
  transform: translate3d(-100%, 0, 0);
  transition: transform .8s cubic-bezier(.2, 1, .3, 1), opacity .8s cubic-bezier(.2, 1, .3, 1);
}

.ai-rotate-word > span {
  display: inline-block;
  transform: translate3d(100%, 0, 0);
  transition: transform .8s cubic-bezier(.2, 1, .3, 1);
}

.ai-rotate-word:not(.is-active) {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  pointer-events: none;
}

.ai-rotate-word.is-active,
.ai-rotate-word.is-active > span {
  transform: translate3d(0, 0, 0);
  transition-delay: .4s;
}

@media (prefers-reduced-motion: reduce) {
  .ai-rotate,
  .ai-rotate-word,
  .ai-rotate-word > span {
    transition: none;
  }
}
