/* 表示アニメーションと動きの制御 */
.js-enabled [data-animate] {
  --animate-transform-hidden: translate3d(0, 30px, 0);
  --animate-transform-visible: translate3d(0, 0, 0);
  opacity: 0;
  transform: var(--animate-transform-hidden);
  transition:
    opacity 0.8s var(--ease-out-expo),
    transform 0.8s var(--ease-out-expo);
}

.js-enabled [data-animate].is-visible {
  opacity: 1;
  transform: var(--animate-transform-visible);
}

.js-enabled [data-animate-delay="1"] {
  transition-delay: 0.15s;
}

.js-enabled [data-animate-delay="2"] {
  transition-delay: 0.3s;
}

.js-enabled [data-animate-delay="3"] {
  transition-delay: 0.45s;
}

.js-enabled [data-animate-delay="4"] {
  transition-delay: 0.6s;
}

.js-enabled .photo-placeholder[data-animate],
.js-enabled .culture-photo[data-animate] {
  --animate-transform-hidden: scale(0.95);
  --animate-transform-visible: scale(1);
}

.scroll-indicator span {
  animation: scroll-line 1.8s infinite;
}

@keyframes scroll-line {
  0% {
    opacity: 0;
    transform: translate3d(0, -12px, 0);
  }

  30% {
    opacity: 1;
  }

  70% {
    opacity: 1;
    transform: translate3d(0, 12px, 0);
  }

  100% {
    opacity: 0;
    transform: translate3d(0, 18px, 0);
  }
}

/* ===== テキスト1文字ずつアニメーション ===== */

.js-enabled .text-animate-ready {
  word-break: break-all;
  overflow-wrap: anywhere;
}

@media (min-width: 641px) {
  .js-enabled .text-animate-ready {
    max-width: max-content;
    justify-self: center;
    word-break: normal;
  }
}

.js-enabled .text-animate-ready .char {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.5em) scale(0.8) rotate(4deg);
  transition:
    opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition-delay: calc(var(--char-index) * 0.035s);
}

.js-enabled .text-animate-visible .char {
  opacity: 1;
  transform: translateY(0) scale(1) rotate(0deg);
}

/* Heroの見出しは大きく・ダイナミックに */
.js-enabled #hero .text-animate-ready .char {
  transform: translateY(1em) scale(0.6) rotate(8deg);
  transition:
    opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition-delay: calc(0.3s + var(--char-index) * 0.05s);
}

.js-enabled #hero .text-animate-visible .char {
  opacity: 1;
  transform: translateY(0) scale(1) rotate(0deg);
}

/* CTAセクションの見出し — 下から浮き上がり */
.js-enabled #cta .text-animate-ready .char {
  transform: translateY(0.8em) scale(0.7);
  transition:
    opacity 0.5s ease-out,
    transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition-delay: calc(var(--char-index) * 0.04s);
}

.js-enabled #cta .text-animate-visible .char {
  opacity: 1;
  transform: translateY(0) scale(1) rotate(0deg);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
