/* ============================================
   Acqua Animations & Transitions
   ============================================ */

/* === Loading Screen (ローディングムービー) === */
.loading-screen {
  position: fixed;
  z-index: var(--z-loading, 9999);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 1;
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #fff;
  animation: loadingBase 6s ease forwards;
}

@keyframes loadingBase {
  0% { opacity: 1; }
  55% { opacity: 1; background-color: #fff; }
  80% { opacity: 1; background-color: #0a0f1e; }
  85% { opacity: 0; background-color: #0a0f1e; }
  100% { display: none; opacity: 0; background-color: #0a0f1e; z-index: -1; pointer-events: none; }
}

.loading-screen img {
  max-width: 30rem;
}

.loading-screen .load-item {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.loading-screen .item01 {
  z-index: 10001;
  animation: loadItem01 6s ease forwards;
}
@keyframes loadItem01 {
  0% { opacity: 0; transform: translate(-50%, 0%); }
  5% { opacity: 0; transform: translate(-50%, 0%); }
  25% { opacity: 1; transform: translate(-50%, -50%); }
  100% { opacity: 1; }
}

.loading-screen .item02 {
  z-index: 10002;
  animation: loadItem02 6s ease forwards;
}
@keyframes loadItem02 {
  0% { opacity: 0; }
  15% { opacity: 0; transform: translate(-50%, -100%); }
  35% { opacity: 1; transform: translate(-50%, -50%); }
  100% { opacity: 1; }
}

.loading-screen .item03 {
  z-index: 10003;
  animation: loadItem03 6s ease forwards;
}
@keyframes loadItem03 {
  0% { opacity: 0; }
  25% { opacity: 0; transform: translate(-100%, -50%); }
  45% { opacity: 1; transform: translate(-50%, -50%); }
  65% { opacity: 1; transform: translate(-50%, -50%); }
  100% { opacity: 0; }
}

.loading-screen .item04 {
  z-index: 10004;
  animation: loadItem04 6s ease forwards;
}
@keyframes loadItem04 {
  0% { opacity: 0; }
  50% { opacity: 0; }
  65% { opacity: 1; }
  100% { opacity: 1; }
}

/* === Scroll Reveal Animations === */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.reveal--left {
  opacity: 0;
  transform: translateX(-60px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal--left.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal--right {
  opacity: 0;
  transform: translateX(60px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal--right.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal--scale {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal--scale.is-visible {
  opacity: 1;
  transform: scale(1);
}

/* Stagger children */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-stagger.is-visible > *:nth-child(1) { transition-delay: 0.05s; }
.reveal-stagger.is-visible > *:nth-child(2) { transition-delay: 0.1s; }
.reveal-stagger.is-visible > *:nth-child(3) { transition-delay: 0.15s; }
.reveal-stagger.is-visible > *:nth-child(4) { transition-delay: 0.2s; }
.reveal-stagger.is-visible > *:nth-child(5) { transition-delay: 0.25s; }
.reveal-stagger.is-visible > *:nth-child(6) { transition-delay: 0.3s; }
.reveal-stagger.is-visible > *:nth-child(7) { transition-delay: 0.35s; }
.reveal-stagger.is-visible > *:nth-child(8) { transition-delay: 0.4s; }
.reveal-stagger.is-visible > *:nth-child(9) { transition-delay: 0.45s; }
.reveal-stagger.is-visible > *:nth-child(10) { transition-delay: 0.5s; }

.reveal-stagger.is-visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* === Hero Animations === */
.hero__title .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(100%);
  animation: wordReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero__title .word:nth-child(1) { animation-delay: 0.6s; }
.hero__title .word:nth-child(2) { animation-delay: 0.7s; }
.hero__title .word:nth-child(3) { animation-delay: 0.8s; }
.hero__title .word:nth-child(4) { animation-delay: 0.9s; }
.hero__title .word:nth-child(5) { animation-delay: 1.0s; }

@keyframes wordReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero__subtitle {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.8s ease 1.2s forwards;
}

.hero__actions {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.8s ease 1.5s forwards;
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === Hero Background Particles === */
.hero__particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}

.hero__particle {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent-start);
  opacity: 0.15;
  animation: float linear infinite;
}

@keyframes float {
  0% {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.15;
  }
  90% {
    opacity: 0.15;
  }
  100% {
    transform: translateY(-10vh) rotate(720deg);
    opacity: 0;
  }
}

/* === Counter Animation === */
.counter {
  font-family: var(--font-family-en);
  font-weight: var(--font-weight-black);
  font-variant-numeric: tabular-nums;
}

/* === Magnetic Button Effect === */
.btn-magnetic {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* === Smooth Hover Line === */
.hover-line {
  position: relative;
  display: inline-block;
}

.hover-line::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--color-accent-gradient);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--transition-base);
}

.hover-line:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* === Pulse for CTA === */
.pulse {
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(46, 124, 246, 0.4);
  }
  50% {
    box-shadow: 0 0 0 15px rgba(46, 124, 246, 0);
  }
}

/* === Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal,
  .reveal--left,
  .reveal--right,
  .reveal--scale {
    opacity: 1;
    transform: none;
  }

  .reveal-stagger > * {
    opacity: 1;
    transform: none;
  }
}
