.pages { overflow-x: clip; }

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(1.5rem);
  }
}

@keyframes drop {
  from {
    opacity: 0;
    transform: translateY(-1.5rem) rotate(-3deg);
  }
}

@keyframes tilt {
  from {
    opacity: 0;
    transform: rotate(-4deg) scale(0.9);
  }
}

@keyframes sweep {
  from {
    background: linear-gradient(transparent var(--hl-top), var(--hl) var(--hl-top)) 0 0 / 0% 100% no-repeat;
    box-shadow: none;
  }

  to {
    background: linear-gradient(transparent var(--hl-top), var(--hl) var(--hl-top)) 0 0 / 100% 100% no-repeat;
    box-shadow: none;
  }
}

@keyframes draw {
  from { stroke-dashoffset: 1; }
}

@keyframes fall {
  from { translate: 0 -90cqi; }
}

@keyframes fly {
  0% { width: 0; }
  25%, 92% { width: calc(var(--gap) * 6.3); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes tick {
  0% { --violations: 412; }
  25% { --violations: 398; }
  50% { --violations: 371; }
  75% { --violations: 342; }
  100% { --violations: 317; }
}

@keyframes click {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(-30deg); }
  50% { transform: rotate(-60deg); }
  75% { transform: rotate(-90deg); }
  100% { transform: rotate(-120deg); }
}

@keyframes tui-s1 {
  0%, 3.1% {
    opacity: 0;
    transform: translateY(4px);
  }

  5.1%, 95% {
    opacity: 1;
    transform: none;
  }
  100% { opacity: 0; }
}

@keyframes tui-s2 {
  0%, 15.6% {
    opacity: 0;
    transform: translateY(4px);
  }

  17.6%, 95% {
    opacity: 1;
    transform: none;
  }
  100% { opacity: 0; }
}

@keyframes tui-s3 {
  0%, 31.2% {
    opacity: 0;
    transform: translateY(4px);
  }

  33.2%, 95% {
    opacity: 1;
    transform: none;
  }
  100% { opacity: 0; }
}

@keyframes tui-s4 {
  0%, 43.8% {
    opacity: 0;
    transform: translateY(4px);
  }

  45.8%, 95% {
    opacity: 1;
    transform: none;
  }
  100% { opacity: 0; }
}

@keyframes tui-s5 {
  0%, 53.1% {
    opacity: 0;
    transform: translateY(4px);
  }

  55.1%, 95% {
    opacity: 1;
    transform: none;
  }
  100% { opacity: 0; }
}

@keyframes tui-s6 {
  0%, 62.5% {
    opacity: 0;
    transform: translateY(4px);
  }

  64.5%, 95% {
    opacity: 1;
    transform: none;
  }
  100% { opacity: 0; }
}

@keyframes tui-s7 {
  0%, 78.1% {
    opacity: 0;
    transform: translateY(4px);
  }

  80.1%, 95% {
    opacity: 1;
    transform: none;
  }
  100% { opacity: 0; }
}

@keyframes blink {
  50% { opacity: 0; }
}

.cover .morph { display: none; }

@media (prefers-reduced-motion: no-preference) {
  .cover .still { display: none; }
  .cover .morph { display: inline; }
  .tui-step.s1 { animation: tui-s1 16s linear infinite; }
  .tui-step.s2 { animation: tui-s2 16s linear infinite; }
  .tui-step.s3 { animation: tui-s3 16s linear infinite; }
  .tui-step.s4 { animation: tui-s4 16s linear infinite; }
  .tui-step.s5 { animation: tui-s5 16s linear infinite; }
  .tui-step.s6 { animation: tui-s6 16s linear infinite; }
  .tui-step.s7 { animation: tui-s7 16s linear infinite; }
  .tui-cursor { animation: blink 1s steps(1) infinite; }

  .tui-think {
    display: inline-block;
    animation: spin 2s linear infinite;
  }
  .chart .expo, .chart .better { stroke-dasharray: 1; }

  @supports (animation-timeline: view()) {
    .page > *, .stations > div, .rebrand tr, .checks li, .todo li, .warn li {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 70%;
    }
    .page h2 { animation-name: tilt; }

    .hl {
      animation: sweep linear both;
      animation-timeline: view();
      animation-range: entry 50% cover 40%;
    }
    .ratchet { view-timeline-name: --ratchet; }

    .count, .wheel {
      animation: tick linear both;
      animation-timing-function: steps(1, end);
      animation-timeline: --ratchet;
      animation-range: entry 40% cover 70%;
    }

    .wheel {
      animation-name: click;
      transform-box: view-box;
      transform-origin: 0 0;
    }

    .swiss .slice, .swiss .name:not(.end), .swiss .bug {
      animation: fall linear both;
      animation-timeline: --swiss;
    }
    .swiss .slice:nth-child(1), .swiss .name:nth-of-type(1) { animation-range: cover 18% cover 26%; }
    .swiss .slice:nth-child(2), .swiss .name:nth-of-type(2) { animation-range: cover 24% cover 32%; }
    .swiss .slice:nth-child(3), .swiss .name:nth-of-type(3) { animation-range: cover 30% cover 38%; }
    .swiss .slice:nth-child(4), .swiss .name:nth-of-type(4) { animation-range: cover 36% cover 44%; }
    .swiss .slice:nth-child(5), .swiss .name:nth-of-type(5) { animation-range: cover 42% cover 50%; }

    .swiss .bug { animation-name: fly; }
    .swiss .bug:nth-of-type(1) { animation-range: cover 4% cover 34%; }
    .swiss .bug:nth-of-type(2) { animation-range: cover 4% cover 40%; }
    .swiss .bug:nth-of-type(3) { animation-range: cover 4% cover 46%; }

    .chart .expo, .chart .better {
      animation: draw linear both;
      animation-timeline: view();
      animation-range: entry 30% cover 50%;
    }
  }

  .cover > *, .cover .hl {
    animation-timeline: auto;
    animation-range: normal;
  }
  .cover > * { animation: rise 0.6s ease-out both; }
  .cover h1 { animation: drop 0.7s 0.1s ease-out both; }
  .cover .hl { animation: sweep 0.6s 0.6s ease-in-out both; }
  .cover .chips li { animation: drop 0.4s ease-out both; }
  .cover .chips li:nth-child(1) { animation-delay: 1.2s; }
  .cover .chips li:nth-child(2) { animation-delay: 2.2s; }
  .cover .chips li:nth-child(3) { animation-delay: 3.2s; }
  .cover .lede { animation-delay: 0.3s; }
  .cover .tagline { animation-delay: 0.4s; }
}

@media (prefers-reduced-motion: reduce) {
  .runner { display: none; }
}
