/* research/static/research/css/landing/motion.css */
@keyframes lp-wipe {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0 0 0); }
}

@keyframes lp-rise-line {
  from { transform: translateY(105%); }
  to   { transform: translateY(0); }
}

@keyframes lp-rise {
  from { opacity: 0; transform: translateY(48px); }
  to   { opacity: 1; transform: none; }
}

@keyframes lp-drift {
  from { transform: translateX(-8%); }
  to   { transform: none; }
}

@keyframes lp-pan {
  from { transform: translateY(-4%) scale(1.12); }
  to   { transform: translateY(4%) scale(1.12); }
}

@keyframes lp-ticker {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@keyframes lp-swap {
  0%   { opacity: 0; transform: translateY(60%); }
  100% { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .lp-poster__head,
  .lp-poster__photo,
  .lp-poster__word {
    animation: lp-wipe calc(var(--duration-slower) * 1.6) var(--ease-emphasis) both;
  }

  .lp-poster__photo           { animation-delay: calc(var(--duration-fast) * 1); }
  .lp-poster__word--read      { animation-delay: calc(var(--duration-fast) * 2); }
  .lp-poster__word--understood { animation-delay: calc(var(--duration-fast) * 3); }
  .lp-poster__word--cited     { animation-delay: calc(var(--duration-fast) * 4); }

  .lp-poster .lp-poster__line > span {
    animation: lp-rise-line calc(var(--duration-slower) * 1.8) var(--ease-emphasis) both;
    animation-delay: calc(var(--duration-fast) * 2);
  }

  .lp-poster .lp-poster__line + .lp-poster__line > span {
    animation-delay: calc(var(--duration-fast) * 3);
  }

  .lp-ticker__track {
    animation: lp-ticker 60s linear infinite;
  }

  @media (hover: hover) {
    .lp-ticker:hover .lp-ticker__track {
      animation-play-state: paused;
    }
  }

  /* Product sections (landing.js initProductReveal): only the kicker + headline show,
     centred in the text column, until the section settles into view; then the headline
     rises and the lede and each group of points follow. Gated on .lp-reveal-ready, which
     JS sets, so without JS everything is visible. Opacity/transform only: the card never
     changes size and screen readers always get the text. */
  .lp-reveal-ready .lp-product__kicker,
  .lp-reveal-ready .lp-product__title {
    transition: transform calc(var(--duration-slower) * 1.5) var(--ease-emphasis);
  }

  .lp-reveal-ready .lp-product:not(.is-revealed) .lp-product__kicker,
  .lp-reveal-ready .lp-product:not(.is-revealed) .lp-product__title {
    transform: translateY(var(--lp-title-shift, 0px));
  }

  .lp-reveal-ready .lp-product__lede,
  .lp-reveal-ready .lp-product .lp-legend__group,
  .lp-reveal-ready .lp-product .lp-steps {
    transition: opacity calc(var(--duration-slower) * 1.25) var(--ease-emphasis), transform calc(var(--duration-slower) * 1.25) var(--ease-emphasis);
  }

  .lp-reveal-ready .lp-product:not(.is-revealed) .lp-product__lede,
  .lp-reveal-ready .lp-product:not(.is-revealed) .lp-legend__group,
  .lp-reveal-ready .lp-product:not(.is-revealed) .lp-steps {
    opacity: 0;
    transform: translateY(48px);
  }

  .lp-product.is-revealed .lp-product__lede                { transition-delay: calc(var(--duration-fast) * 3); }
  .lp-product.is-revealed .lp-legend__group:first-child,
  .lp-product.is-revealed .lp-steps                         { transition-delay: calc(var(--duration-fast) * 6); }
  .lp-product.is-revealed .lp-legend__group:nth-child(2)   { transition-delay: calc(var(--duration-fast) * 8); }

  /* Cloud section and the "Start reading." headline (landing.js initSlideIn): each
     [data-slide-group] keeps its .lp-slide text off-screen left until the group scrolls in,
     then slides it in once, one piece after another. Each plan ([data-drop-group]) instead drops its lines down one at a time, all
     three columns in step. Gated on .lp-slide-ready, which JS sets, so without JS everything
     is visible. --lp-slide-step orders the pieces in a group. */
  .lp-slide-ready [data-slide-group].is-in .lp-slide {
    transition: transform calc(var(--duration-slower) * 2) var(--ease-emphasis), opacity var(--duration-slower) var(--ease-standard);
    transition-delay: calc(var(--duration-fast) * 0.6 * var(--lp-slide-step, 0));
  }

  .lp-slide-ready [data-slide-group]:not(.is-in) .lp-slide {
    opacity: 0;
    transform: translateX(-100vw);
  }

  /* Hosted / Updated / Prepaid rise from below instead; .lp-cloud__show clips them. */
  .lp-slide-ready [data-slide-group]:not(.is-in) .lp-slide--up {
    transform: translateY(100vh);
  }

  .lp-slide-ready [data-drop-group].is-in .lp-slide {
    transition: transform calc(var(--duration-slower) * 1.25) var(--ease-emphasis), opacity calc(var(--duration-slower) * 1.25) var(--ease-standard);
    transition-delay: calc(var(--duration-fast) * 1.25 * var(--lp-slide-step, 0));
  }

  /* 24px of travel keeps each line clear of the one above while it fades in. */
  .lp-slide-ready [data-drop-group]:not(.is-in) .lp-slide {
    opacity: 0;
    transform: translateY(-24px);
  }

  /* Stacked plans each drop on their own, so the lines come twice as fast and the
     button isn't left waiting. */
  @media (max-width: 1099px) {
    .lp-slide-ready [data-drop-group].is-in .lp-slide {
      transition-delay: calc(var(--duration-fast) * 0.6 * var(--lp-slide-step, 0));
    }
  }

  .lp-cloud__aside.lp-slide,
  .lp-cloud__facts li:nth-child(1)  { --lp-slide-step: 3; }
  .lp-cloud__facts li:nth-child(2)  { --lp-slide-step: 4; }
  .lp-cloud__facts li:nth-child(3)  { --lp-slide-step: 5; }
  .lp-cloud__plan-name              { --lp-slide-step: 1; }
  .lp-cloud__plan-lede              { --lp-slide-step: 2; }
  .lp-cloud__limits li:nth-child(1) { --lp-slide-step: 3; }
  .lp-cloud__limits li:nth-child(2) { --lp-slide-step: 4; }
  .lp-cloud__limits li:nth-child(3) { --lp-slide-step: 5; }
  .lp-cloud__limits li:nth-child(4) { --lp-slide-step: 6; }
  .lp-cloud__limits li:nth-child(5) { --lp-slide-step: 7; }
  .lp-cloud__price                  { --lp-slide-step: 8; }

  /* "Start reading." (_cta.html): one word, then the next. */
  .lp-cta__title .lp-poster__line + .lp-poster__line .lp-slide { --lp-slide-step: 8; }

  .lp-poster__cycle.is-swapping,
  .lp-compat__name-item.is-swapping {
    animation: lp-swap var(--duration-slow) var(--ease-emphasis) both;
  }

  @supports (animation-timeline: view()) {
    .lp-reveal {
      animation: lp-rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 55%;
    }

    .lp-drift {
      animation: lp-drift linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 40%;
    }

    .lp-retire__photo img {
      animation: lp-pan linear both;
      animation-timeline: view();
      animation-range: entry 0% exit 100%;
    }
  }
}
