/**
 * 百鸣软件 — 渐进展示与交互动效
 * 配合 bm-reveal.js；html.bm-lite / prefers-reduced-motion 自动降级
 */

/* —— 首屏错落入场 —— */
.is-home .hero-content > * {
  opacity: 0;
  transform: translate3d(0, 22px, 0);
  animation: bmHeroIn 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.is-home .hero-content > *:nth-child(1) { animation-delay: 0.05s; }
.is-home .hero-content > *:nth-child(2) { animation-delay: 0.14s; }
.is-home .hero-content > *:nth-child(3) { animation-delay: 0.22s; }
.is-home .hero-content > *:nth-child(4) { animation-delay: 0.3s; }
.is-home .hero-content > *:nth-child(5) { animation-delay: 0.38s; }
.is-home .hero-content > *:nth-child(6) { animation-delay: 0.48s; }

.is-home .bm-hero-scroll {
  opacity: 0;
  animation: bmHeroIn 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.7s forwards;
}

@keyframes bmHeroIn {
  from {
    opacity: 0;
    transform: translate3d(0, 22px, 0);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
    filter: blur(0);
  }
}

/* —— 滚动渐进显现 —— */
.bm-reveal {
  opacity: 0;
  transform: translate3d(0, 36px, 0);
  filter: blur(5px);
  transition:
    opacity 0.85s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.95s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.9s ease;
  will-change: opacity, transform, filter;
}

.bm-reveal.is-in {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  filter: blur(0);
  will-change: auto;
}

.bm-reveal-stagger > .bm-reveal:nth-child(1) { transition-delay: 0.04s; }
.bm-reveal-stagger > .bm-reveal:nth-child(2) { transition-delay: 0.1s; }
.bm-reveal-stagger > .bm-reveal:nth-child(3) { transition-delay: 0.16s; }
.bm-reveal-stagger > .bm-reveal:nth-child(4) { transition-delay: 0.22s; }
.bm-reveal-stagger > .bm-reveal:nth-child(5) { transition-delay: 0.28s; }
.bm-reveal-stagger > .bm-reveal:nth-child(6) { transition-delay: 0.34s; }
.bm-reveal-stagger > .bm-reveal:nth-child(7) { transition-delay: 0.4s; }
.bm-reveal-stagger > .bm-reveal:nth-child(8) { transition-delay: 0.46s; }
.bm-reveal-stagger > .bm-reveal:nth-child(9) { transition-delay: 0.52s; }
.bm-reveal-stagger > .bm-reveal:nth-child(10) { transition-delay: 0.58s; }

/* 卡片交互增强（非 lite） */
html:not(.bm-lite) .category-card,
html:not(.bm-lite) .software-card,
html:not(.bm-lite) .bm-tool-card {
  transition:
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.28s ease,
    border-color 0.22s ease;
}

html:not(.bm-lite) .category-card:hover,
html:not(.bm-lite) .software-card:hover,
html:not(.bm-lite) .bm-tool-card:hover {
  transform: translateY(-4px);
  border-color: rgba(45, 212, 191, 0.4);
  box-shadow:
    0 0 0 1px rgba(45, 212, 191, 0.12),
    0 18px 40px rgba(0, 0, 0, 0.4),
    0 0 28px rgba(45, 212, 191, 0.08);
}

html:not(.bm-lite) .category-card:hover .category-icon-wrap {
  transform: scale(1.06);
  box-shadow: 0 0 20px rgba(45, 212, 191, 0.2);
}

html:not(.bm-lite) .bm-tool-card:hover .bm-tool-card__link {
  color: var(--bm-brand-hover);
  letter-spacing: 0.02em;
}

/* 搜索框微交互 */
html:not(.bm-lite) .hero-section .search-rim {
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

html:not(.bm-lite) .hero-section .search-rim:focus-within {
  transform: translateY(-2px);
}

html:not(.bm-lite) .bm-btn-ghost,
html:not(.bm-lite) .bm-btn-solid {
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

html:not(.bm-lite) .bm-btn-ghost:hover,
html:not(.bm-lite) .bm-btn-solid:hover {
  transform: translateY(-1px);
}

@media (prefers-reduced-motion: reduce) {
  .is-home .hero-content > *,
  .is-home .bm-hero-scroll {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    animation: none !important;
  }

  .bm-reveal,
  .bm-reveal.is-in {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
  }

  html:not(.bm-lite) .category-card:hover,
  html:not(.bm-lite) .software-card:hover,
  html:not(.bm-lite) .bm-tool-card:hover,
  html:not(.bm-lite) .bm-btn-ghost:hover,
  html:not(.bm-lite) .bm-btn-solid:hover,
  html:not(.bm-lite) .hero-section .search-rim:focus-within {
    transform: none !important;
  }
}
