/* ==========================================================================
   motion.css — アニメーション
   すべてのアニメーションは prefers-reduced-motion: reduce で停止する。
   ========================================================================== */

/* --- マスコットの浮遊 --------------------------------------------------- */

@keyframes float-soft {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}

.float {
  animation: float-soft 3.6s ease-in-out infinite;
}

.float--slow {
  animation-duration: 4.8s;
}

/* --- アンテナの揺れ ------------------------------------------------------ */

@keyframes wiggle {
  0%,
  100% {
    transform: rotate(-5deg);
  }
  50% {
    transform: rotate(5deg);
  }
}

.wiggle {
  transform-origin: bottom center;
  animation: wiggle 2.8s ease-in-out infinite;
}

/* --- カードのホバー ------------------------------------------------------ */

.card,
.client-card,
.biz,
.person-card,
.step {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover,
.client-card:hover,
.biz:hover,
.person-card:hover,
.step:hover {
  transform: translateY(-4px) rotate(-0.4deg);
  box-shadow: var(--shadow-lift);
}

/* --- スクロール表示 ------------------------------------------------------ */

@keyframes reveal-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

html.js .reveal {
  opacity: 0;
}

html.js .reveal.is-visible {
  animation: reveal-up 0.6s ease forwards;
}

/* 印刷時はアニメーションを無視して必ず内容を見せる */
@media print {
  html.js .reveal {
    opacity: 1 !important;
    animation: none !important;
  }
}

/* --- 背景ブロブの漂い --------------------------------------------------- */

@keyframes drift {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(18px, -14px) scale(1.06);
  }
  66% {
    transform: translate(-14px, 12px) scale(0.96);
  }
}

.drift {
  animation: drift 14s ease-in-out infinite;
}

.drift--delay {
  animation-delay: -5s;
}

/* --- 装飾スパークルのゆらぎ --------------------------------------------- */

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.9);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

.twinkle {
  animation: twinkle 3.2s ease-in-out infinite;
}

.twinkle--delay {
  animation-delay: -1.4s;
}

/* --- モーション减弱時の停止 ----------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .float,
  .wiggle,
  .drift,
  .twinkle {
    animation: none !important;
  }

  html.js .reveal {
    opacity: 1 !important;
    transform: none !important;
  }

  html.js .reveal.is-visible {
    animation: none !important;
  }

  .card:hover,
  .client-card:hover,
  .biz:hover,
  .person-card:hover,
  .step:hover {
    transform: none !important;
  }
}
