/* ===================================================
   楽暮（たのくら）公式サイト - 高度なアニメーション & エフェクト
   =================================================== */

/* --- パーティクル/背景アニメーション --- */
@keyframes float-rise {
  0% {
    opacity: 0;
    transform: translateY(40px) scale(0);
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-100vh) scale(0.5);
  }
}

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

@keyframes glow-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(232, 154, 60, 0.7);
  }
  50% {
    box-shadow: 0 0 0 20px rgba(232, 154, 60, 0);
  }
}

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

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

@keyframes slide-down {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in-scale {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes bounce-in {
  0% {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes rotate-in {
  from {
    opacity: 0;
    transform: rotate(-10deg) scale(0.9);
  }
  to {
    opacity: 1;
    transform: rotate(0) scale(1);
  }
}

@keyframes pulse-subtle {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

@keyframes gradient-shift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes underline-expand {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

/* --- 要素個別のアニメーション適用 --- */

/* ヒーローセクション */
.hero-badge {
  display: inline-block;
  animation: slide-down 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hero h1 {
  animation: slide-up 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
}

.hero .hero-sub {
  animation: slide-up 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}

.hero-cta {
  animation: slide-up 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s both;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-img-main {
  animation: fade-in-scale 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.4s both;
}

.hero-img-sub {
  animation: fade-in-scale 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.5s both;
}

/* デコレーション要素の浮遊 */
.hero-deco {
  animation: float-slow 3s ease-in-out infinite;
  font-size: 3rem;
  position: absolute;
}

.hero-deco-1 {
  animation-delay: 0s;
}

.hero-deco-2 {
  animation-delay: 1.5s;
}

/* ボタンのホバーエフェクト強化 */
.btn {
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.3);
  transition: left 0.4s ease;
  z-index: -1;
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  animation: glow-pulse 2s infinite;
}

/* reveal-on-scroll クラスのアニメーション */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), 
              transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

/* ステップ別遅延 */
.reveal-on-scroll:nth-child(2) { transition-delay: 0.1s; }
.reveal-on-scroll:nth-child(3) { transition-delay: 0.2s; }
.reveal-on-scroll:nth-child(4) { transition-delay: 0.3s; }
.reveal-on-scroll:nth-child(5) { transition-delay: 0.4s; }

/* カード要素のホバーエフェクト */
.card, .service-card, .staff-card {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.3s ease,
              border-color 0.3s ease;
}

.card:hover, .service-card:hover, .staff-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(196, 138, 80, 0.25);
}

/* テキストホバーエフェクト */
a:not(.btn) {
  position: relative;
}

a:not(.btn)::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  transition: width 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

a:not(.btn):hover::after {
  width: 100%;
}

/* セクション見出しのアニメーション */
.section-title {
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
  animation: underline-expand 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.5s both;
}

/* リスト要素のアニメーション */
ul.feature-list li,
.benefit-list li,
.step-list li {
  opacity: 0;
  animation: slide-up 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

ul.feature-list li:nth-child(1) { animation-delay: 0.2s; }
ul.feature-list li:nth-child(2) { animation-delay: 0.3s; }
ul.feature-list li:nth-child(3) { animation-delay: 0.4s; }
ul.feature-list li:nth-child(4) { animation-delay: 0.5s; }
ul.feature-list li:nth-child(5) { animation-delay: 0.6s; }

.benefit-list li:nth-child(1) { animation-delay: 0.1s; }
.benefit-list li:nth-child(2) { animation-delay: 0.2s; }
.benefit-list li:nth-child(3) { animation-delay: 0.3s; }

.step-list li:nth-child(1) { animation-delay: 0.1s; }
.step-list li:nth-child(2) { animation-delay: 0.2s; }
.step-list li:nth-child(3) { animation-delay: 0.3s; }

/* イメージのホバーエフェクト */
img {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              filter 0.3s ease;
}

a:hover img {
  transform: scale(1.05);
}

.card:hover img,
.service-card:hover img,
.staff-card:hover img {
  filter: brightness(1.1);
}

/* フォームのインタラクション */
input, textarea, select {
  transition: border-color 0.3s ease,
              box-shadow 0.3s ease,
              background-color 0.3s ease;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(232, 154, 60, 0.1);
  outline: none;
}

/* スムーズなページ遷移 */
@supports (animation: page-enter 0.6s ease-out) {
  body {
    animation: page-enter 0.6s ease-out;
  }
}

@keyframes page-enter {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* CTA セクションの背景アニメーション */
.cta-section {
  background: linear-gradient(135deg, 
    rgba(232, 154, 60, 0.05) 0%,
    rgba(139, 174, 82, 0.05) 50%,
    rgba(107, 56, 56, 0.05) 100%);
  background-size: 400% 400%;
  animation: gradient-shift 15s ease infinite;
}

/* スクロールプログレスバー */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
  width: 0%;
  z-index: 999;
  animation: progress-load 0.3s ease-out;
}

@keyframes progress-load {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

/* モバイル最適化 */
@media (max-width: 768px) {
  .hero-deco {
    font-size: 1.5rem;
  }

  .reveal-on-scroll:nth-child(2),
  .reveal-on-scroll:nth-child(3),
  .reveal-on-scroll:nth-child(4),
  .reveal-on-scroll:nth-child(5) {
    transition-delay: 0s;
  }

  .card:hover, .service-card:hover, .staff-card:hover {
    transform: translateY(-4px);
  }
}

/* パフォーマンス最適化：prefer-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
