/* Alternate homepage: the original version is kept in huanwuai-background. */
.huanwuai-card-slot {
  position: relative;
  display: grid;
  min-width: 0;
}

.huanwuai-products .huanwuai-card {
  transform: none;
  transform-origin: center top;
  transition:
    transform 450ms cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 450ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Stable slots keep the hover target from shrinking away under the cursor.
 * The small sideways shift retains a gap between the two visible cards.
 * A top origin leaves the headline clear when a card grows to 130%.
 */
@media (min-width: 701px) and (any-hover: hover) and (any-pointer: fine) {
  .huanwuai-products:has(.huanwuai-card-slot:hover) .huanwuai-card-slot:hover {
    z-index: 2;
  }

  .huanwuai-products:has(.huanwuai-card-slot:hover) .huanwuai-card-slot:hover .huanwuai-card {
    transform: translateY(-10px) scale(1.3);
    box-shadow:
      inset 0 1px 0 rgb(246 224 255 / 16%),
      inset 0 0 32px rgb(149 95 215 / 3%),
      0 30px 65px rgb(0 0 0 / 50%);
  }

  .huanwuai-products:has(.huanwuai-card-slot:first-child:hover) .huanwuai-card-slot:last-child .huanwuai-card {
    transform: translateX(3.3cqw) scale(0.9);
  }

  .huanwuai-products:has(.huanwuai-card-slot:last-child:hover) .huanwuai-card-slot:first-child .huanwuai-card {
    transform: translateX(-3.3cqw) scale(0.9);
  }
}

/* Keep the requested focus state available when Windows reduces animations.
 * Shorten the transition instead of suppressing the 130% / 90% state.
 */
@media (prefers-reduced-motion: reduce) {
  .huanwuai-products .huanwuai-card {
    transition-duration: 150ms !important;
  }
}
