/* 海纳 · 动画系统 */

/* ============ 滚动触发动画（GSAP 驱动，CSS 作为降级） ============ */
.scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-reveal.active {
  opacity: 1;
  transform: translateY(0);
}

.scroll-reveal[data-delay="1"] { transition-delay: 0.1s; }
.scroll-reveal[data-delay="2"] { transition-delay: 0.2s; }
.scroll-reveal[data-delay="3"] { transition-delay: 0.3s; }
.scroll-reveal[data-delay="4"] { transition-delay: 0.4s; }
.scroll-reveal[data-delay="5"] { transition-delay: 0.5s; }

/* ============ Hero 波浪（canonical，与 style.css 重复时以本文件为准） ============ */
.waves path {
  animation: wave-swell 8s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
  will-change: transform;
}

.waves path:nth-child(1) { animation-duration: 7s; animation-delay: 0s; }
.waves path:nth-child(2) { animation-duration: 8.5s; animation-delay: -1s; }
.waves path:nth-child(3) { animation-duration: 10s; animation-delay: -2s; }
.waves path:nth-child(4) { animation-duration: 11.5s; animation-delay: -3s; }
.waves path:nth-child(5) { animation-duration: 13s; animation-delay: -4s; }

@keyframes wave-swell {
  0%, 100% { transform: translateY(0) scaleY(1); }
  50% { transform: translateY(-6px) scaleY(1.02); }
}

/* 云朵漂移 */
.clouds {
  animation: cloud-drift 80s linear infinite;
  will-change: transform;
}

@keyframes cloud-drift {
  from { transform: translateX(0); }
  to   { transform: translateX(-200px); }
}

/* 帆船摇摆 */
.boat {
  animation: boat-bob 5s ease-in-out infinite;
  transform-origin: 330px 156px;
  will-change: transform;
}

@keyframes boat-bob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-5px) rotate(-1.2deg); }
  75% { transform: translateY(-3px) rotate(1.2deg); }
}

/* ============ 深海区浮动粒子 ============ */
.particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.particle {
  position: absolute;
  bottom: -20px;
  width: 4px;
  height: 4px;
  background: rgba(56, 229, 236, 0.4);
  border-radius: 50%;
  animation: float-up linear infinite;
}

.particle:nth-child(1) { left: 10%; animation-duration: 12s; animation-delay: 0s; width: 3px; height: 3px; }
.particle:nth-child(2) { left: 25%; animation-duration: 15s; animation-delay: 2s; width: 5px; height: 5px; opacity: 0.6; }
.particle:nth-child(3) { left: 40%; animation-duration: 10s; animation-delay: 4s; width: 4px; height: 4px; opacity: 0.4; }
.particle:nth-child(4) { left: 55%; animation-duration: 14s; animation-delay: 1s; width: 3px; height: 3px; }
.particle:nth-child(5) { left: 70%; animation-duration: 11s; animation-delay: 3s; width: 6px; height: 6px; opacity: 0.5; }
.particle:nth-child(6) { left: 85%; animation-duration: 16s; animation-delay: 5s; width: 4px; height: 4px; opacity: 0.3; }

@keyframes float-up {
  0% {
    transform: translateY(0) translateX(0) scale(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
    transform: translateY(-10vh) translateX(10px) scale(1);
  }
  90% {
    opacity: 0.6;
  }
  100% {
    transform: translateY(-100vh) translateX(-20px) scale(0.5);
    opacity: 0;
  }
}

/* ============ 数字滚动动画（GSAP 优先，CSS 为降级） ============ */
.stat-number {
  display: inline-block;
  transition: transform 0.3s;
}

.stat-number.counting {
  animation: number-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes number-pop {
  0% { transform: scale(0.8); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* 注：原 card-enter 块已移除（与 GSAP scroll-reveal 冲突，由 animations.js 接管） */

/* ============ 按钮微动效 ============ */
.load-more,
.dash-expand,
.page-btn,
.btn-origin {
  position: relative;
  overflow: hidden;
}

.load-more::after,
.dash-expand::after,
.page-btn::after,
.btn-origin::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(56, 229, 236, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.4s, height 0.4s;
}

.load-more:active::after,
.dash-expand:active::after,
.page-btn:active::after,
.btn-origin:active::after {
  width: 200px;
  height: 200px;
}

/* ============ 标题文字渐变流动 ============ */
.zone-title {
  background: linear-gradient(90deg, #fff 0%, #fff 40%, #38E5EC 50%, #fff 60%, #fff 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: title-shine 4s ease-in-out infinite;
}

@keyframes title-shine {
  0%, 100% { background-position: 100% 0; }
  50% { background-position: 0 0; }
}

/* ============ 标签微动 ============ */
.jtag {
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.home-job-card:hover .jtag {
  transform: translateY(-1px);
}

/* ============ 图片加载动画 ============ */
.news-thumb img,
.article-body img {
  opacity: 0;
  transition: opacity 0.5s ease;
  background: rgba(255, 255, 255, 0.04);
}

.news-thumb img.is-loaded,
.article-body img.is-loaded {
  opacity: 1;
}

/* ============ 响应式调整 ============ */
@media (max-width: 720px) {
  .scroll-reveal {
    transform: translateY(20px);
  }
  .particle {
    display: none;
  }
}

/* ============ 减少动画偏好 ============ */
@media (prefers-reduced-motion: reduce) {
  .scroll-reveal,
  .news-card,
  .home-job-card,
  .dash-card,
  .comm-card {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }
  .waves path,
  .clouds,
  .boat,
  .seabird-1,
  .seabird-2,
  .particle,
  .zone-title {
    animation: none !important;
  }
}
