/* ===================================
   Splatoon 3 Hub - 墨汁动画效果
   =================================== */

/* 墨汁飞溅动画 */
@keyframes inkSplash {
  0% {
    transform: scale(0) rotate(0deg);
    opacity: 1;
  }
  50% {
    transform: scale(1.2) rotate(180deg);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.5) rotate(360deg);
    opacity: 0;
  }
}

/* 墨汁扩散效果 */
@keyframes inkSpread {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  100% {
    transform: scale(4);
    opacity: 0;
  }
}

/* 墨汁滴落动画 */
@keyframes inkDrop {
  0% {
    transform: translateY(-100%) scale(1);
    opacity: 1;
  }
  60% {
    transform: translateY(0) scale(1.1);
    opacity: 1;
  }
  80% {
    transform: translateY(-20%) scale(0.9);
    opacity: 0.8;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* 墨汁波纹效果 */
@keyframes inkRipple {
  0% {
    transform: scale(0.8);
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(230, 0, 126, 0.4);
  }
  70% {
    transform: scale(1);
    opacity: 0.8;
    box-shadow: 0 0 0 20px rgba(230, 0, 126, 0);
  }
  100% {
    transform: scale(0.8);
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(230, 0, 126, 0);
  }
}

/* 墨汁脉冲动画 */
@keyframes inkPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.1);
    opacity: 1;
  }
}

/* 墨汁游动动画 */
@keyframes inkSwim {
  0%, 100% {
    transform: translateX(0) rotate(0deg);
  }
  25% {
    transform: translateX(10px) rotate(5deg);
  }
  75% {
    transform: translateX(-10px) rotate(-5deg);
  }
}

/* 墨汁旋转动画 */
@keyframes inkSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* 墨汁闪烁动画 */
@keyframes inkBlink {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

/* 墨汁浮动动画 */
@keyframes inkFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
}

/* 墨汁摇摆动画 */
@keyframes inkWiggle {
  0%, 100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(5deg);
  }
  75% {
    transform: rotate(-5deg);
  }
}

/* 墨汁爆炸动画 */
@keyframes inkExplode {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  50% {
    transform: scale(1.5);
    opacity: 0.8;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

/* 墨汁滑入动画 */
@keyframes inkSlideIn {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* 墨汁淡入动画 */
@keyframes inkFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 墨汁缩放动画 */
@keyframes inkScale {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* 墨汁背景动画 */
@keyframes inkBackground {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* 墨汁渐变动画 */
@keyframes inkGradient {
  0% {
    filter: hue-rotate(0deg);
  }
  100% {
    filter: hue-rotate(360deg);
  }
}

/* 应用动画的类 */
.ink-splash {
  animation: inkSplash 0.6s ease-out;
}

.ink-spread {
  animation: inkSpread 1s ease-out;
}

.ink-drop {
  animation: inkDrop 0.8s ease-out;
}

.ink-ripple {
  animation: inkRipple 2s ease-in-out infinite;
}

.ink-pulse {
  animation: inkPulse 2s ease-in-out infinite;
}

.ink-swim {
  animation: inkSwim 3s ease-in-out infinite;
}

.ink-spin {
  animation: inkSpin 10s linear infinite;
}

.ink-blink {
  animation: inkBlink 1.5s ease-in-out infinite;
}

.ink-float {
  animation: inkFloat 3s ease-in-out infinite;
}

.ink-wiggle {
  animation: inkWiggle 1s ease-in-out infinite;
}

.ink-explode {
  animation: inkExplode 0.8s ease-out;
}

.ink-slide-in {
  animation: inkSlideIn 0.5s ease-out;
}

.ink-fade-in {
  animation: inkFadeIn 0.5s ease-out;
}

.ink-scale {
  animation: inkScale 2s ease-in-out infinite;
}

/* Hero区域动态墨汁背景 */
.hero-ink-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: -1;
}

.hero-ink-bg::before {
  content: '';
  position: absolute;
  width: 200%;
  height: 200%;
  top: -50%;
  left: -50%;
  background: radial-gradient(circle at 20% 50%, rgba(107, 44, 145, 0.3) 0%, transparent 50%),
              radial-gradient(circle at 80% 50%, rgba(0, 160, 233, 0.3) 0%, transparent 50%),
              radial-gradient(circle at 50% 80%, rgba(230, 0, 126, 0.3) 0%, transparent 50%);
  animation: inkSpin 20s linear infinite;
}

/* 墨汁粒子效果 */
.ink-particle {
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--splat-magenta);
  border-radius: 50%;
  animation: inkFloat 4s ease-in-out infinite;
}

/* 墨汁边框效果 */
.ink-border {
  position: relative;
  overflow: hidden;
}

.ink-border::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(90deg, var(--splat-magenta), var(--splat-cyan), var(--splat-yellow));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.ink-border:hover::before {
  opacity: 1;
  animation: inkGradient 3s linear infinite;
}

/* 墨汁悬停效果 */
.ink-hover {
  position: relative;
  transition: all var(--transition-normal);
}

.ink-hover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, var(--splat-magenta) 0%, transparent 70%);
  opacity: 0;
  transition: opacity var(--transition-normal);
  border-radius: inherit;
  pointer-events: none;
}

.ink-hover:hover::after {
  opacity: 0.2;
}

/* 滚动触发动画 */
.scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease-out;
  will-change: opacity, transform;
}

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

/* 备用方案：5秒后自动显示所有元素（防止JS失效） */
@keyframes forceReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.scroll-reveal {
  animation: forceReveal 1s ease-out 3s forwards;
}

/* 当添加visible类时，取消强制动画 */
.scroll-reveal.visible {
  animation: none;
}

/* 依次延迟显示 */
.scroll-reveal:nth-child(1) { transition-delay: 0.05s; }
.scroll-reveal:nth-child(2) { transition-delay: 0.1s; }
.scroll-reveal:nth-child(3) { transition-delay: 0.15s; }
.scroll-reveal:nth-child(4) { transition-delay: 0.2s; }
.scroll-reveal:nth-child(5) { transition-delay: 0.25s; }
.scroll-reveal:nth-child(6) { transition-delay: 0.3s; }
.scroll-reveal:nth-child(7) { transition-delay: 0.35s; }
.scroll-reveal:nth-child(8) { transition-delay: 0.4s; }
.scroll-reveal:nth-child(9) { transition-delay: 0.45s; }
.scroll-reveal:nth-child(10) { transition-delay: 0.5s; }
.scroll-reveal:nth-child(11) { transition-delay: 0.55s; }
.scroll-reveal:nth-child(12) { transition-delay: 0.6s; }

/* 墨汁喷溅加载动画 */
@keyframes inkSplashLoad {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.5);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.loader-ink-splash {
  position: absolute;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle, var(--splat-magenta) 0%, transparent 70%);
  animation: inkSplashLoad 2s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

/* 3秒强制停留 - 修改原有加载器 */
.loader-ink {
  animation-duration: 3s !important;
}
