/**
 * Frontend polish + motion accents.
 */

html.lenis,
html.lenis body {
  height: auto;
}

.ml-body {
  background:
    radial-gradient(900px 420px at 50% -8%, rgba(159, 122, 234, 0.1), transparent 65%),
    var(--ml-bg, #121212);
}

/* Nav */
.ml-nav {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  background: rgba(18, 18, 18, 0.94);
}
.ml-nav.is-scrolled {
  background: rgba(12, 12, 12, 0.96);
  border-bottom-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.ml-btn-signup {
  transition: transform 0.22s ease, opacity 0.22s ease, box-shadow 0.22s ease;
}
.ml-btn-signup:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(159, 122, 234, 0.25);
}

/* Hero atmosphere */
.ml-hero {
  position: relative;
  isolation: isolate;
}
.ml-hero::before {
  content: "";
  position: absolute;
  inset: 10% 18% auto;
  height: 42%;
  background: radial-gradient(ellipse at center, rgba(159, 122, 234, 0.16), transparent 70%);
  pointer-events: none;
  z-index: -1;
  animation: ml-hero-glow 8s ease-in-out infinite alternate;
}
@keyframes ml-hero-glow {
  from {
    opacity: 0.55;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1.06);
  }
}

.ml-hero__badge {
  animation: ml-badge-float 3.6s ease-in-out infinite;
}
@keyframes ml-badge-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

.ml-hero__cta {
  position: relative;
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  box-shadow: 0 8px 28px rgba(207, 222, 246, 0.18);
}
.ml-hero__cta::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255, 255, 255, 0.28) 50%,
    transparent 60%
  );
  transform: translateX(-120%);
  pointer-events: none;
}
.ml-hero__cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(207, 222, 246, 0.28);
}
.ml-hero__cta:hover::after {
  animation: ml-cta-shine 0.7s ease;
}
@keyframes ml-cta-shine {
  to {
    transform: translateX(120%);
  }
}

/* Filters */
.ml-filter-pill {
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease,
    transform 0.2s ease, box-shadow 0.2s ease;
}
.ml-filter-pill:hover {
  transform: translateY(-1px);
}
.ml-filters button.is-active,
.ml-filter-pill.is-active {
  box-shadow: 0 0 0 1px rgba(159, 122, 234, 0.45), 0 6px 16px rgba(159, 122, 234, 0.18);
}

/* Cards */
.ml-card {
  border-radius: 16px;
  overflow: hidden;
  background: var(--ml-surface, #202020);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.2s ease,
    box-shadow 0.28s ease, filter 0.28s ease;
}
/* 无视频卡片可跳过渲染；有视频的保持可见以免解码异常 */
.ml-card:not(.ml-card--video) {
  content-visibility: auto;
  contain-intrinsic-size: 280px 320px;
}
.ml-card--video {
  content-visibility: visible;
}
@media (hover: hover) and (pointer: fine) {
  .ml-card:hover,
  .ml-card:focus-visible {
    transform: translate3d(0, -5px, 0);
    border-color: rgba(159, 122, 234, 0.38);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.38);
    filter: brightness(1.04);
    outline: none;
  }
  .ml-card:hover .ml-card__media video,
  .ml-card:hover .ml-card__media img {
    transform: scale(1.04);
  }
}
.ml-card__media {
  overflow: hidden;
}
.ml-card__media img,
.ml-card__media video {
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
}

/* Scroll reveals */
.ml-reveal {
  opacity: 0;
  transform: translate3d(0, 16px, 0);
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.ml-reveal.is-inview {
  opacity: 1;
  transform: none;
}
.ml-grid .ml-card.ml-reveal {
  transition-delay: calc(var(--ml-i, 0) * 30ms);
}

.ml-load-more {
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.22s ease,
    box-shadow 0.22s ease;
}
.ml-load-more:hover:not(:disabled) {
  box-shadow: 0 8px 22px rgba(159, 122, 234, 0.2);
}

.ml-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

::selection {
  background: rgba(159, 122, 234, 0.45);
  color: #fff;
}

@media (prefers-reduced-motion: reduce) {
  .ml-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .ml-card,
  .ml-hero__cta,
  .ml-btn-signup,
  .ml-card__media img,
  .ml-card__media video,
  .ml-filter-pill,
  .ml-hero__badge,
  .ml-hero::before {
    animation: none !important;
    transition: none !important;
  }
  .ml-card:hover {
    transform: none;
  }
  .ml-hero__cta::after {
    display: none;
  }
}
