/* ============================================================
   jedeeai.com 全站动效层
   由 /motion.js 驱动；两套 layout 共用
   ============================================================ */

/* ---------- 顶部滚动进度条 ---------- */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  z-index: 99;
  pointer-events: none;
  background: linear-gradient(90deg, #22e3ff, #8b6bff, #ff48e0);
  transform-origin: 0 50%;
  transform: scaleX(0);
  box-shadow: 0 0 12px rgba(34, 227, 255, 0.55);
}

/* ---------- 滚动渐入（多方向 + 模糊消散） ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(30px);
  filter: blur(6px);
  transition:
    opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.8s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform, filter;
}
[data-reveal="left"]  { transform: translateX(-44px); }
[data-reveal="right"] { transform: translateX(44px); }
[data-reveal="scale"] { transform: scale(0.92); }
[data-reveal="down"]  { transform: translateY(-30px); }
[data-reveal].is-visible {
  opacity: 1;
  transform: none;
  filter: blur(0);
}

/* ---------- 卡片 3D 倾斜 + 光斑追踪 ---------- */
.fx-card {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.fx-card.is-tilting {
  transition:
    transform 0.08s linear,
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}
.fx-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
  background: radial-gradient(
    420px circle at var(--mx, 50%) var(--my, 50%),
    rgba(34, 227, 255, 0.14),
    rgba(139, 107, 255, 0.08) 35%,
    transparent 65%
  );
}
.fx-card:hover::after,
.fx-card.is-lit::after { opacity: 1; }

/* 手机端：进入视口即「点亮」（代替 hover） */
.fx-card.is-lit {
  border-color: rgba(34, 227, 255, 0.35) !important;
}

/* ---------- 按钮扫光 ---------- */
.fx-shine {
  position: relative;
  overflow: hidden;
}
.fx-shine::before {
  content: "";
  position: absolute;
  top: 0;
  left: -80%;
  width: 55%;
  height: 100%;
  background: linear-gradient(
    105deg,
    transparent,
    rgba(255, 255, 255, 0.45),
    transparent
  );
  transform: skewX(-20deg);
  transition: left 0.6s ease;
  pointer-events: none;
}
.fx-shine:hover::before { left: 130%; }

/* ---------- 导航栏滚动收缩 ---------- */
.fx-nav {
  transition:
    padding 0.35s ease,
    background 0.35s ease,
    box-shadow 0.35s ease,
    border-color 0.35s ease;
}
.fx-nav.is-shrunk {
  padding-top: 11px !important;
  padding-bottom: 11px !important;
  background: rgba(8, 8, 14, 0.85) !important;
  border-color: rgba(34, 227, 255, 0.22) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 24px rgba(34, 227, 255, 0.08) !important;
}

/* ---------- CTA 呼吸光晕 ---------- */
@keyframes ctaGlow {
  0%, 100% { box-shadow: 0 0 40px rgba(34, 227, 255, 0.12), inset 0 0 60px rgba(139, 107, 255, 0.04); }
  50%      { box-shadow: 0 0 70px rgba(139, 107, 255, 0.22), inset 0 0 80px rgba(34, 227, 255, 0.07); }
}
.fx-cta-glow { animation: ctaGlow 5s ease-in-out infinite; }

/* ---------- Hero 首屏逐行升入（不等滚动） ---------- */
@keyframes heroRise {
  from { opacity: 0; transform: translateY(34px); filter: blur(8px); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}
.hero-rise {
  opacity: 0;
  animation: heroRise 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: var(--rise-delay, 0ms);
}

/* ---------- 章节序号扫光下划线 ---------- */
.fx-underline {
  position: relative;
  display: inline-block;
}
.fx-underline::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -10px;
  height: 3px;
  width: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, #22e3ff, #8b6bff, #ff48e0);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.15s;
}
.is-visible .fx-underline::after,
.fx-underline.is-visible::after { transform: scaleX(1); }

/* ---------- 视差层 ---------- */
[data-parallax] { will-change: transform; }

/* ---------- 手机端细化 ---------- */
@media (max-width: 880px) {
  .hero-h1 { font-size: 48px !important; letter-spacing: -1px !important; }
}
@media (max-width: 480px) {
  .hero-h1 { font-size: 38px !important; }
  .cta-h2 { font-size: 26px !important; }
  .section-h2 { font-size: 30px !important; }
}

/* 首页移动端横滑导航 */
.m-nav-row {
  display: none;
}
@media (max-width: 880px) {
  .m-nav-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 10px 2px 2px;
    margin-top: 8px;
  }
  .m-nav-row::-webkit-scrollbar { display: none; }
  .m-nav-chip {
    flex-shrink: 0;
    font-size: 13px;
    color: #cfcfe0;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 7px 15px;
    border-radius: 999px;
    text-decoration: none;
    white-space: nowrap;
  }
  .m-nav-chip.active {
    background: rgba(34, 227, 255, 0.16);
    border-color: rgba(34, 227, 255, 0.45);
    color: #22e3ff;
  }
}

/* ---------- 减少动态偏好：全部关闭 ---------- */
@media (prefers-reduced-motion: reduce) {
  #scroll-progress { display: none; }
  [data-reveal],
  .hero-rise {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
    animation: none !important;
  }
  .fx-card,
  .fx-card.is-tilting { transition: none !important; transform: none !important; }
  .fx-cta-glow { animation: none !important; }
  .fx-underline::after { transform: scaleX(1); transition: none; }
}
