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

@keyframes stress-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}

@keyframes stress-out {
  from { opacity: 1; }
  to { opacity: 0; transform: scale(0.98); }
}

@keyframes calm-in {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: none; }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes drift {
  0%, 100% { transform: scale(1.06); }
  50% { transform: scale(1.14) translate(-1.6%, -1.2%); }
}

@keyframes blink {
  0%, 80%, 100% { opacity: 0.25; }
  40% { opacity: 1; }
}

@keyframes clock-one {
  0%, 5% { opacity: 0; }
  7%, 30% { opacity: 1; }
  34%, 100% { opacity: 0; }
}

@keyframes clock-two {
  0%, 32% { opacity: 0; }
  36%, 58% { opacity: 1; }
  62%, 100% { opacity: 0; }
}

@keyframes clock-three {
  0%, 60% { opacity: 0; }
  66%, 100% { opacity: 1; }
}

@keyframes count-one {
  0%, 22% { opacity: 1; }
  25%, 100% { opacity: 0; }
}

@keyframes count-two {
  0%, 24% { opacity: 0; }
  27%, 47% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes count-three {
  0%, 49% { opacity: 0; }
  52%, 72% { opacity: 1; }
  75%, 100% { opacity: 0; }
}

@keyframes count-four {
  0%, 74% { opacity: 0; }
  77%, 100% { opacity: 1; }
}

@keyframes inbox-scroll {
  from { transform: translateY(-40px); }
  to { transform: translateY(210px); }
}

@keyframes task-late {
  0%, 30% { transform: none; border-color: var(--border-2); }
  50%, 100% { transform: translateY(88px); border-color: var(--warn-3); }
}

@keyframes tasks-up {
  0%, 30% { transform: none; }
  50%, 100% { transform: translateY(-44px); }
}

@keyframes wait-fill {
  0%, 5% { transform: scaleX(0); }
  70%, 100% { transform: scaleX(1); }
}

@keyframes wait-label-1 {
  0%, 5% { opacity: 0; }
  7%, 19% { opacity: 1; }
  22%, 100% { opacity: 0; }
}

@keyframes wait-label-2 {
  0%, 20% { opacity: 0; }
  23%, 36% { opacity: 1; }
  39%, 100% { opacity: 0; }
}

@keyframes wait-label-3 {
  0%, 37% { opacity: 0; }
  40%, 53% { opacity: 1; }
  56%, 100% { opacity: 0; }
}

@keyframes wait-label-4 {
  0%, 54% { opacity: 0; }
  57%, 100% { opacity: 1; }
}

@keyframes outcome-step {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.hero-rise {
  animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.hero-delay-1 { animation-delay: 0.1s; }
.hero-delay-2 { animation-delay: 0.25s; }
.hero-delay-3 { animation-delay: 0.4s; }
.hero-delay-4 { animation-delay: 0.55s; }

.sequence-a .notification-slot:nth-child(1) .notification--stress,
.sequence-b .notification-slot:nth-child(1) .notification--stress {
  animation: stress-in 0.45s ease 0.3s both, stress-out 0.45s ease 2.2s forwards;
}

.sequence-a .notification-slot:nth-child(2) .notification--stress,
.sequence-b .notification-slot:nth-child(2) .notification--stress {
  animation: stress-in 0.45s ease 0.6s both, stress-out 0.45s ease 2.8s forwards;
}

.sequence-a .notification-slot:nth-child(3) .notification--stress,
.sequence-b .notification-slot:nth-child(3) .notification--stress {
  animation: stress-in 0.45s ease 0.9s both, stress-out 0.45s ease 3.4s forwards;
}

.sequence-a .notification-slot:nth-child(1) .notification--calm,
.sequence-b .notification-slot:nth-child(1) .notification--calm {
  animation: calm-in 0.5s ease 2.2s both;
}

.sequence-a .notification-slot:nth-child(2) .notification--calm,
.sequence-b .notification-slot:nth-child(2) .notification--calm {
  animation: calm-in 0.5s ease 2.8s both;
}

.sequence-a .notification-slot:nth-child(3) .notification--calm,
.sequence-b .notification-slot:nth-child(3) .notification--calm {
  animation: calm-in 0.5s ease 3.4s both;
}

.sequence-a .stack-footer,
.sequence-b .stack-footer {
  animation: fade-in 0.6s ease 4.2s both;
}

.image-card-media img {
  animation: drift 22s ease-in-out infinite;
}

.typing i {
  animation: blink 1.2s ease-in-out infinite;
}

.typing i:nth-child(2) { animation-delay: 0.2s; }
.typing i:nth-child(3) { animation-delay: 0.4s; }

.scene-time,
.unread-count span,
.task--late i {
  animation-duration: 9s;
  animation-iteration-count: infinite;
}

.time-one,
.unread-count span:nth-child(1),
.task--late i:nth-child(1) { animation-name: clock-one; }
.time-two,
.unread-count span:nth-child(2),
.task--late i:nth-child(2) { animation-name: clock-two; }
.time-three,
.unread-count span:nth-child(3),
.task--late i:nth-child(3) { animation-name: clock-three; }
.unread-count span:nth-child(1) { animation-name: count-one; }
.unread-count span:nth-child(2) { animation-name: count-two; }
.unread-count span:nth-child(3) { animation-name: count-three; }
.unread-count span:nth-child(4) { animation-name: count-four; }

.inbox-rows span {
  animation: inbox-scroll 9s linear infinite;
}

.inbox-rows span:nth-child(2) { animation-delay: -1.5s; }
.inbox-rows span:nth-child(3) { animation-delay: -3s; }
.inbox-rows span:nth-child(4) { animation-delay: -4.5s; }
.inbox-rows span:nth-child(5) { animation-delay: -6s; }
.inbox-rows span:nth-child(6) { animation-delay: -7.5s; }

.task--late { animation: task-late 9s ease-in-out infinite; }
.task--done { animation: tasks-up 9s ease-in-out infinite; }

.wait-progress i {
  transform-origin: left;
  animation: wait-fill 13s ease infinite;
}

.wait-labels span {
  animation-duration: 13s;
  animation-iteration-count: infinite;
}

.wait-labels span:nth-child(1) { animation-name: wait-label-1; }
.wait-labels span:nth-child(2) { animation-name: wait-label-2; }
.wait-labels span:nth-child(3) { animation-name: wait-label-3; }
.wait-labels span:nth-child(4) { animation-name: wait-label-4; }

.good-step {
  animation: outcome-step 0.6s ease both;
  animation-timeline: view();
}

.good-step-1 { animation-delay: 0.1s; }
.good-step-2 { animation-delay: 0.3s; }
.good-step-3 { animation-delay: 0.5s; }
.good-step-4 { animation-delay: 0.7s; }

.js .reveal {
  opacity: 0;
  transform: translateY(24px);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
  transition: opacity 700ms ease, transform 700ms ease;
}

.modal:not([hidden]) .modal-dialog {
  animation: rise 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .notification--stress {
    display: none;
  }

  .notification--calm,
  .stack-footer,
  .scene-time:last-of-type,
  .unread-count span:last-child,
  .task--late i:last-child,
  .wait-labels span:last-child {
    opacity: 1 !important;
  }

  .image-card-media img {
    transform: scale(1.06);
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}
