/* Card and icon motion, layered after prisma-refresh.css. */

@keyframes prisma-block-enter {
  from { opacity: 0; transform: translate3d(0, 18px, 0) scale(.985); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes prisma-icon-enter {
  from { opacity: .35; transform: translate3d(0, 7px, 0) scale(.78) rotate(-9deg); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1) rotate(0); }
}

/* motion.js already marks the larger page sections; the companion script
   marks the small how-to cards. The fallback stays visible without JS. */
html.motion-ready .motion-reveal:not(.is-visible),
html.motion-ready .prisma-block-reveal:not(.is-visible) {
  opacity: 0;
}

html.motion-ready .motion-reveal.is-visible,
html.motion-ready .prisma-block-reveal.is-visible {
  animation: prisma-block-enter 620ms cubic-bezier(.2, .76, .24, 1) backwards;
  animation-delay: calc(var(--prisma-reveal-order, 0) * 65ms);
}

html.motion-ready .motion-reveal[data-motion-order="1"] { --prisma-reveal-order: 1; }
html.motion-ready .motion-reveal[data-motion-order="2"] { --prisma-reveal-order: 2; }
html.motion-ready .motion-reveal[data-motion-order="3"] { --prisma-reveal-order: 3; }
html.motion-ready .motion-reveal[data-motion-order="4"] { --prisma-reveal-order: 4; }
html.motion-ready .motion-reveal[data-motion-order="5"] { --prisma-reveal-order: 5; }

html.motion-ready .feature-card.is-visible .feature-icon,
html.motion-ready .download-card.is-visible .download-icon,
html.motion-ready .prisma-block-reveal.is-visible > span:first-child {
  animation: prisma-icon-enter 540ms cubic-bezier(.2, .76, .24, 1) backwards;
  animation-delay: calc(150ms + var(--prisma-reveal-order, 0) * 65ms);
}

/* Keep motion on the small visual elements, so card content stays steady. */
.feature-icon, .download-icon, .how-card > span:first-child,
.route-demo-icon, .country-flag, .button > span[aria-hidden="true"],
.text-link > span[aria-hidden="true"] {
  transition: transform 330ms cubic-bezier(.2, .76, .24, 1),
              box-shadow 330ms ease, border-color 330ms ease, background-color 330ms ease;
}

.how-card {
  transition: transform 380ms cubic-bezier(.2, .76, .24, 1),
              border-color 380ms ease, box-shadow 380ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .feature-card:hover .feature-icon,
  .download-card:hover .download-icon,
  .how-card:hover > span:first-child {
    transform: translate3d(0, -3px, 0) rotate(-5deg) scale(1.09);
    border-color: rgba(36, 237, 141, .52);
    box-shadow: 0 8px 22px rgba(36, 237, 141, .13), inset 0 0 16px rgba(36, 237, 141, .08);
  }

  .how-card:hover {
    transform: translate3d(0, -5px, 0);
    border-color: rgba(36, 237, 141, .37);
    box-shadow: 0 20px 44px rgba(0, 0, 0, .22), 0 0 27px rgba(36, 237, 141, .055);
  }

  .route-demo-list li:hover .route-demo-icon { transform: rotate(-7deg) scale(1.1); }
  .server-row:hover .country-flag { transform: translate3d(0, -2px, 0) scale(1.08); box-shadow: 0 5px 14px rgba(0, 0, 0, .18); }
  .button:hover > span[aria-hidden="true"],
  .text-link:hover > span[aria-hidden="true"] { transform: translate3d(3px, -1px, 0); }
}

@media (prefers-reduced-motion: reduce) {
  html.motion-ready .motion-reveal,
  html.motion-ready .prisma-block-reveal { opacity: 1 !important; animation: none !important; transform: none !important; }

  html.motion-ready .feature-card .feature-icon,
  html.motion-ready .download-card .download-icon,
  html.motion-ready .prisma-block-reveal > span:first-child,
  .feature-icon, .download-icon, .how-card, .how-card > span:first-child,
  .route-demo-icon, .country-flag, .button > span[aria-hidden="true"],
  .text-link > span[aria-hidden="true"] { animation: none !important; transition: none !important; }

  .how-card:hover, .feature-card:hover .feature-icon,
  .download-card:hover .download-icon, .how-card:hover > span:first-child,
  .route-demo-list li:hover .route-demo-icon,
  .server-row:hover .country-flag,
  .button:hover > span[aria-hidden="true"],
  .text-link:hover > span[aria-hidden="true"] { transform: none !important; }
}
