/* ============================================= */
/* Mysteryuncle Custom CSS                       */
/* Tailwindでは表現しきれないカスタムスタイル     */
/* ============================================= */

/* ---- スムーススクロール ---- */
html {
  scroll-behavior: smooth;
}

/* ---- グラスモーフィズムカード ---- */
/* ミステリアスな半透明感を演出 */
.glass-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.glass-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}

/* ---- ホバーで浮き上がるカード ---- */
.hover-lift {
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.hover-lift:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(108, 99, 255, 0.15);
}

/* ---- ヒーローロゴのグロー ---- */
.hero-logo-glow {
  animation: logo-glow 4s ease-in-out infinite alternate;
}
@keyframes logo-glow {
  0% {
    box-shadow: 0 0 20px rgba(108, 99, 255, 0.3),
                0 0 40px rgba(108, 99, 255, 0.1);
  }
  100% {
    box-shadow: 0 0 30px rgba(226, 185, 111, 0.4),
                0 0 60px rgba(226, 185, 111, 0.15);
  }
}

/* ---- パーティクルフィールド（CSS only） ---- */
/* ミステリアスな浮遊粒子で深淵な空間を演出 */
.particle-field {
  overflow: hidden;
  pointer-events: none;
}
.particle-field::before,
.particle-field::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background-image:
    radial-gradient(2px 2px at 20% 30%, rgba(108, 99, 255, 0.4), transparent),
    radial-gradient(2px 2px at 40% 70%, rgba(226, 185, 111, 0.3), transparent),
    radial-gradient(1.5px 1.5px at 60% 20%, rgba(139, 131, 255, 0.5), transparent),
    radial-gradient(1.5px 1.5px at 80% 60%, rgba(226, 185, 111, 0.4), transparent),
    radial-gradient(2px 2px at 10% 80%, rgba(108, 99, 255, 0.3), transparent),
    radial-gradient(1px 1px at 70% 40%, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(1.5px 1.5px at 90% 10%, rgba(139, 131, 255, 0.4), transparent),
    radial-gradient(1px 1px at 30% 50%, rgba(255, 255, 255, 0.2), transparent),
    radial-gradient(2px 2px at 50% 90%, rgba(226, 185, 111, 0.3), transparent),
    radial-gradient(1px 1px at 15% 55%, rgba(108, 99, 255, 0.5), transparent);
  animation: particle-float-1 20s ease-in-out infinite;
}
.particle-field::after {
  background-image:
    radial-gradient(1.5px 1.5px at 25% 45%, rgba(226, 185, 111, 0.4), transparent),
    radial-gradient(2px 2px at 55% 25%, rgba(108, 99, 255, 0.3), transparent),
    radial-gradient(1px 1px at 75% 75%, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(2px 2px at 35% 85%, rgba(139, 131, 255, 0.4), transparent),
    radial-gradient(1.5px 1.5px at 85% 35%, rgba(226, 185, 111, 0.3), transparent),
    radial-gradient(1px 1px at 45% 15%, rgba(108, 99, 255, 0.4), transparent),
    radial-gradient(2px 2px at 65% 55%, rgba(255, 255, 255, 0.2), transparent),
    radial-gradient(1.5px 1.5px at 5% 65%, rgba(139, 131, 255, 0.3), transparent);
  animation: particle-float-2 25s ease-in-out infinite;
}

@keyframes particle-float-1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(20px, -30px) scale(1.1); }
  50% { transform: translate(-15px, 20px) scale(0.95); }
  75% { transform: translate(25px, 15px) scale(1.05); }
}
@keyframes particle-float-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-25px, 20px) scale(1.08); }
  66% { transform: translate(20px, -25px) scale(0.92); }
}

/* ---- フェードインアニメーション ---- */
@keyframes fade-in-up {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}
.animate-fade-in-up {
  animation: fade-in-up 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  opacity: 0;
}
.animation-delay-200 { animation-delay: 0.2s; }
.animation-delay-400 { animation-delay: 0.4s; }
.animation-delay-600 { animation-delay: 0.6s; }

/* ---- スクロールリビール ---- */
.scroll-reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ---- ヘッダーの状態 ---- */
/* スクロール時にグラスモーフィズムヘッダーに変化 */
#main-header {
  transition: background-color 0.5s ease, backdrop-filter 0.5s ease, box-shadow 0.5s ease;
}
#main-header.scrolled {
  background-color: rgba(26, 26, 46, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

/* ---- コーヒーカードの温かみ ---- */
.coffee-card:hover {
  box-shadow: 0 20px 40px rgba(226, 185, 111, 0.15);
}

/* ---- ナビリンクのアンダーラインアニメーション ---- */
.nav-link {
  position: relative;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #6c63ff, #e2b96f);
  transition: width 0.3s ease;
}
.nav-link:hover::after {
  width: 100%;
}

/* ---- アクセシビリティ: フォーカスの視認性向上 ---- */
a:focus-visible,
button:focus-visible {
  outline: 3px solid #6c63ff;
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---- モバイル最適化 ---- */
@media (max-width: 640px) {
  body {
    font-size: 16px;
  }
  h1 {
    line-height: 1.2;
  }
  .glass-card {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
}

/* ---- プリファーズ・リデュースド・モーション ---- */
/* アクセシビリティ: 動きを減らすユーザー設定に対応 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .scroll-reveal {
    opacity: 1;
    transform: none;
  }
  .animate-fade-in-up {
    opacity: 1;
    transform: none;
  }
}
