/* What moves in the animated scenes, and when (the moves themselves are in keyframes.css). Every scene loops
   every 10 seconds, starts once its phone has scrolled into view (.shown), and stays still for people who
   asked for less motion: they see each scene's last frame. */
@media (prefers-reduced-motion: no-preference) {
  /* Progress bars fill up (Library, Reading, the widget). */
  .js .shown .s-fill {
    animation: fill 10s ease-in-out infinite both;
  }

  /* Things that fade in at about a third of the way through. */
  .js .shown .s-result,
  .js .shown .s-rating,
  .js .shown .s-old-note,
  .js .shown .s-link,
  .js .shown .s-saved-quote {
    animation: appear 10s ease-out infinite both;
  }

  .js .shown .s-toast {
    animation: toast 10s ease-out infinite both;
    animation-delay: 1.2s;
  }

  .js .shown .s-tap {
    animation: tap 10s ease-out infinite both;
  }

  /* 1. Find: a title is typed, three results arrive, Add is tapped on the first, and the app says "Enjoy!". */
  .js .shown .s-typed {
    animation: type 10s infinite both;
  }

  .js .shown .s-result:nth-child(2) {
    animation-delay: 0.3s;
  }

  .js .shown .s-result:nth-child(3) {
    animation-delay: 0.6s;
  }

  .js .shown .s-result:first-child {
    animation-name: appear, pick;
  }

  /* 2. Reading: the bar moves on, "Add a thought or quote" is tapped, and the quote is saved. */
  .js .shown .s-note {
    animation: appear 10s ease-out infinite both;
    animation-delay: 3.6s;
  }

  .js .shown .s-saved-quote {
    animation-delay: 1.5s;
  }

  /* 3. Character map: the people appear one by one, then the lines between them draw themselves. */
  .js .shown .s-node {
    animation: node 10s ease-out infinite both;
  }

  .js .shown .s-map line {
    animation: draw 10s ease-in-out infinite both;
  }

  .js .shown .s-n2,
  .js .shown .s-k1 {
    animation-delay: 0.5s;
  }

  .js .shown .s-n3,
  .js .shown .s-l2 {
    animation-delay: 0.8s;
  }

  .js .shown .s-n4,
  .js .shown .s-k2 {
    animation-delay: 1.3s;
  }

  .js .shown .s-l3 {
    animation-delay: 1.6s;
  }

  .js .shown .s-k3 {
    animation-delay: 2.1s;
  }

  .js .shown .s-l4 {
    animation-delay: 2.4s;
  }

  .js .shown .s-k4 {
    animation-delay: 2.9s;
  }

  /* 4. Review: the stars fill one by one, "Loved it", the characters' bars grow, then Save. */
  .js .shown .s-star {
    animation: star 10s ease-out infinite both;
  }

  .js .shown .s-star:nth-child(2) {
    animation-delay: 0.35s;
  }

  .js .shown .s-star:nth-child(3) {
    animation-delay: 0.7s;
  }

  .js .shown .s-star:nth-child(4) {
    animation-delay: 1.05s;
  }

  .js .shown .s-star:nth-child(5) {
    animation-delay: 1.4s;
  }

  .js .shown .s-bar-fill {
    animation: grow 10s ease-out infinite both;
  }

  .js .shown .s-b2 {
    animation-delay: 0.5s;
  }

  .js .shown .s-save {
    animation: press 10s infinite both;
  }

  /* 5. Memories: last year's book comes back with a glow, then your note, a heartbeat and a saved quote. */
  .js .shown .s-anniversary {
    animation: remember 10s ease-out infinite both;
  }

  .js .shown .s-heart {
    animation: beat 10s ease-in-out infinite both;
  }

  /* The widget's avatar and the cheering avatars bob gently. */
  .js .shown .s-avatar,
  .js .shown.step-more img {
    animation: bob 3s ease-in-out infinite;
  }

  /* Māui wobbles a little on their hands while reading. */
  .js .intro-avatar.shown {
    animation: wobble 4s ease-in-out infinite;
  }

  .js .shown.step-more img:nth-child(2) {
    animation-delay: 0.4s;
  }

  .js .shown.step-more img:nth-child(3) {
    animation-delay: 0.8s;
  }
}
