/* ==========================================================
   GeoSeo Portal · Motion & Animations
   ========================================================== */

/* 关键帧 */
@keyframes float {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -16px, 0); }
}
@keyframes float-slow {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(24px, -30px, 0) scale(1.06); }
}
@keyframes pulse-ring {
  0% { transform: scale(.85); opacity: .7; }
  100% { transform: scale(2.1); opacity: 0; }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes drift {
  0% { transform: translate3d(0, 0, 0); }
  33% { transform: translate3d(3%, -2%, 0); }
  66% { transform: translate3d(-2%, 3%, 0); }
  100% { transform: translate3d(0, 0, 0); }
}
@keyframes dash-flow { to { stroke-dashoffset: -1000; } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* 滚动显现（配合 IntersectionObserver） */
.reveal {
  opacity: 0;
  transform: translate3d(0, 32px, 0);
  transition:
    opacity var(--dur-4) var(--ease-out),
    transform var(--dur-4) var(--ease-out);
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .08s; }
.reveal[data-delay="2"] { transition-delay: .16s; }
.reveal[data-delay="3"] { transition-delay: .24s; }
.reveal[data-delay="4"] { transition-delay: .32s; }
.reveal[data-delay="5"] { transition-delay: .4s; }

.reveal-left { opacity: 0; transform: translate3d(-40px, 0, 0); }
.reveal-left.is-visible { opacity: 1; transform: none; }
.reveal-right { opacity: 0; transform: translate3d(40px, 0, 0); }
.reveal-right.is-visible { opacity: 1; transform: none; }

/* 3D 悬停卡片（配合 JS tilt） */
.tilt { transform-style: preserve-3d; transition: transform var(--dur-2) var(--ease-out); }
.tilt:hover { transition-duration: .1s; }
.tilt .tilt-inner { transform: translateZ(30px); }

/* 持续动画工具类 */
.float-anim { animation: float 5s ease-in-out infinite; }
.float-slow { animation: float-slow 16s ease-in-out infinite; }
.spin-anim { animation: spin 12s linear infinite; }
.drift-anim { animation: drift 18s ease-in-out infinite; }
.blink-anim { animation: blink 2s ease-in-out infinite; }

/* 渐变描边流光 */
.shimmer-text {
  background: linear-gradient(90deg, var(--text-2) 25%, var(--text-1) 50%, var(--text-2) 75%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: shimmer 3s linear infinite;
}

/* 无障碍：减少动效 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal, .reveal-left, .reveal-right { opacity: 1 !important; transform: none !important; }
}

/* ---------- 滚动进度条 ---------- */
.gs-scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0;
  z-index: 9999;
  background: var(--grad-brand, linear-gradient(90deg, var(--c-cyan), var(--c-purple)));
  box-shadow: 0 0 12px rgba(14,116,144,.45);
  pointer-events: none;
  transition: width .08s linear;
}

/* ---------- 卡片光晕跟随 ---------- */
.tilt, .cloud-app-card {
  position: relative;
  overflow: hidden;
}
.tilt::before, .cloud-app-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(500px circle at var(--mx,50%) var(--my,50%), rgba(14,116,144,.16), transparent 42%);
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
  z-index: 1;
}
.tilt:hover::before, .cloud-app-card:hover::before { opacity: 1; }
.tilt > *, .cloud-app-card > * { position: relative; z-index: 2; }

@media (prefers-reduced-motion: reduce) {
  .gs-scroll-progress { transition: none; }
  .tilt::before, .cloud-app-card::before { display: none; }
}
