:root {
  --motion-ease: cubic-bezier(0.2, 0, 0, 1);
  --motion-base: 360ms;
  --motion-touch: 180ms;
  --motion-stagger: 45ms;
}

@media (prefers-reduced-motion: no-preference) {
  .hero-proof .comparison {
    animation: proof-in var(--motion-base) var(--motion-ease) both;
  }

  .hero-proof .compare-row,
  .hero-proof .difference {
    animation: surface-in var(--motion-base) var(--motion-ease) both;
  }

  .hero-proof .compare-row:nth-child(2) {
    animation-delay: var(--motion-stagger);
  }

  .hero-proof .compare-row:nth-child(3) {
    animation-delay: calc(2 * var(--motion-stagger));
  }

  .hero-proof .compare-row:nth-child(4) {
    animation-delay: calc(3 * var(--motion-stagger));
  }

  .hero-proof .difference {
    animation-delay: calc(4 * var(--motion-stagger));
  }

  .motion-enter,
  .step-enter,
  .chat-message.motion-message,
  .faq details[open] > p {
    animation: surface-in var(--motion-base) var(--motion-ease) both;
  }

  .motion-enter {
    animation-delay: var(--motion-delay, 0ms);
  }

  .step-enter,
  .chat-message.motion-message,
  .faq details[open] > p {
    animation-duration: var(--motion-touch);
  }

  .dialog[open] {
    animation: surface-in var(--motion-base) var(--motion-ease) both;
  }

  .chat-panel[open] {
    animation-name: chat-in;
  }

  .dialog[open]::backdrop {
    animation: backdrop-in var(--motion-touch) var(--motion-ease) both;
  }

  .header nav.open {
    animation: surface-in var(--motion-touch) var(--motion-ease) both;
  }

  .button > span[aria-hidden="true"]:last-child,
  .stock-link > span,
  .model-shortcut > b {
    transition: transform var(--motion-touch) var(--motion-ease);
  }

  .live > i,
  .promo-top > i {
    animation: signal-in calc(var(--motion-base) * 3) var(--motion-ease) 2;
  }

  .price-updated {
    animation: surface-in var(--motion-touch) var(--motion-ease) both;
  }

  @media (hover: hover) and (pointer: fine) {
    .stock-card,
    .model-shortcut,
    .link-card {
      transition:
        transform var(--motion-touch) var(--motion-ease),
        border-color var(--motion-touch) var(--motion-ease),
        box-shadow var(--motion-touch) var(--motion-ease);
    }

    .stock-card:hover,
    .model-shortcut:hover,
    .link-card:hover {
      transform: translateY(-3px);
      border-color: #b7c8fc;
      box-shadow: var(--shadow);
    }

    .button:hover > span[aria-hidden="true"]:last-child,
    .stock-link:hover > span,
    .model-shortcut:hover > b {
      transform: translateX(3px);
    }
  }

  @media (max-width: 760px) {
    .chat-panel[open] {
      animation-name: mobile-chat-in;
    }
  }
}

@keyframes proof-in {
  from {
    transform: translateY(12px);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes surface-in {
  from {
    opacity: 0.76;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes chat-in {
  from {
    opacity: 0.8;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes mobile-chat-in {
  from {
    opacity: 0.85;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes signal-in {
  0% {
    box-shadow: 0 0 0 0 #25a46b55;
  }
  100% {
    box-shadow: 0 0 0 7px #25a46b00;
  }
}
