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

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

/* ---- グラスモーフィズムカード ---- */
/* ミステリアスな半透明感を演出 */

/* ---- ヒーロータイトル行（折り返し禁止） ---- */
/* 各行をwhite-space:nowrapで1行に固定し、font-sizeでvwスケーリング */
.hero-title-line {
  white-space: nowrap;
  /* 文字数に合わせてフォントサイズをやや小さめに設定（以前の約半分のサイズ） */
  font-size: clamp(1rem, 3vw, 2.4rem);
}

.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-bg-image {
  background-image: url('../images/hero-bg.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.35;
  animation: bg-zoom 25s ease-in-out infinite alternate;
}
@keyframes bg-zoom {
  0%   { transform: scale(1); }
  100% { transform: scale(1.1); }
}
@keyframes glow-pulse {
  0%   { opacity: 0.2; transform: scale(0.95); }
  100% { opacity: 0.5; transform: scale(1.05); }
}

/* ---- ヒーロー幾何学装飾 ---- */
.hero-geo-circle {
  width: 700px;
  height: 700px;
  border-radius: 50%;
  border: 1px solid rgba(108, 99, 255, 0.07);
  right: -100px;
  top: 50%;
  transform: translateY(-50%);
  animation: ring-rotate 60s linear infinite;
}
.hero-geo-arc {
  width: 500px;
  height: 500px;
  border-radius: 50%;
  border: 1px dashed rgba(226, 185, 111, 0.08);
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  animation: ring-rotate-reverse 40s linear infinite;
}

/* ---- 右カラム ロゴリング ---- */
.hero-ring-outer {
  border: 1px dashed rgba(108, 99, 255, 0.4);
  border-left-color: transparent;
  animation: ring-rotate 20s linear infinite;
}
.hero-ring-outer::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6c63ff;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 12px 4px rgba(108,99,255,0.6);
}
.hero-ring-mid {
  border: 1px dashed rgba(226, 185, 111, 0.3);
  border-bottom-color: transparent;
  animation: ring-rotate-reverse 30s linear infinite;
}
.hero-ring-mid::after {
  content: '';
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #e2b96f;
  top: 50%;
  right: 0;
  transform: translate(50%, -50%);
  box-shadow: 0 0 10px 3px rgba(226,185,111,0.5);
}
.hero-ring-inner {
  border: 1.5px dotted rgba(255, 255, 255, 0.15);
  border-right-color: transparent;
  animation: ring-rotate 15s linear infinite;
}

/* ---- ドットパルスアニメーション ---- */
.hero-dot-pulse {
  animation: dot-pulse 2s ease-in-out infinite;
}
@keyframes dot-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.7); }
}

/* ---- グラデーションテキスト ---- */
.hero-gradient-text {
  background: linear-gradient(135deg, #6c63ff 0%, #8b83ff 40%, #e2b96f 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% auto;
  animation: gradient-shift 4s ease-in-out infinite alternate;
}
@keyframes gradient-shift {
  0%   { background-position: 0% center; }
  100% { background-position: 100% center; }
}

/* ---- CSSアニメーション（GSAPのフォールバック） ---- */
/* ページロードと同時にアニメーションで表示 */
.hero-anim-1 {
  animation: hero-fade-up 0.8s cubic-bezier(0.4,0,0.2,1) 0.3s both;
}
.hero-anim-2 {
  animation: hero-fade-up 0.9s cubic-bezier(0.4,0,0.2,1) 0.5s both;
}
.hero-anim-3 {
  animation: hero-fade-up 0.9s cubic-bezier(0.4,0,0.2,1) 0.75s both;
}
.hero-anim-4 {
  animation: hero-fade-up 0.9s cubic-bezier(0.4,0,0.2,1) 1.0s both;
}
.hero-anim-5 {
  animation: hero-fade-up 0.9s cubic-bezier(0.4,0,0.2,1) 1.25s both;
}
.hero-anim-logo {
  animation: hero-fade-scale 1.2s cubic-bezier(0.4,0,0.2,1) 0.6s both;
}
.hero-anim-scroll {
  animation: hero-fade-up 0.9s cubic-bezier(0.4,0,0.2,1) 1.6s both;
}

@keyframes hero-fade-up {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes hero-fade-scale {
  from { opacity: 0; transform: scale(0.88); }
  to   { opacity: 1; transform: scale(1); }
}

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

/* ---- リング回転 ---- */
@keyframes ring-rotate {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes ring-rotate-reverse {
  from { transform: rotate(0deg); }
  to   { transform: rotate(-360deg); }
}

/* ---- ヒーロー中心グロー ---- */
.hero-radial-glow {
  background: radial-gradient(ellipse 70% 60% at 70% 45%,
    rgba(108,99,255,0.14) 0%,
    rgba(226,185,111,0.07) 40%,
    transparent 70%);
  animation: radial-pulse 6s ease-in-out infinite alternate;
}
@keyframes radial-pulse {
  0%   { opacity: 0.7; transform: scale(1); }
  100% { opacity: 1;   transform: scale(1.06); }
}

/* ---- ヒーローボタン ---- */
.hero-btn-primary {
  background: linear-gradient(135deg, #6c63ff, #8b83ff);
  box-shadow: 0 4px 24px rgba(108,99,255,0.35);
}
.hero-btn-primary:hover {
  box-shadow: 0 8px 36px rgba(108,99,255,0.55);
  background: linear-gradient(135deg, #7d75ff, #a09aff);
}
.hero-btn-secondary {
  border: 1.5px solid rgba(226,185,111,0.4);
  backdrop-filter: blur(8px);
  background: rgba(226,185,111,0.05);
}
.hero-btn-secondary:hover {
  border-color: rgba(226,185,111,0.75);
  background: rgba(226,185,111,0.12);
  box-shadow: 0 8px 28px rgba(226,185,111,0.18);
}

/* ---- マウス型スクロール ---- */
.hero-scroll-mouse {
  width: 22px; height: 36px;
  border: 1.5px solid rgba(255,255,255,0.18);
  border-radius: 11px;
  position: relative;
  display: flex; align-items: flex-start;
  justify-content: center; padding-top: 6px;
}
.hero-scroll-mouse::before {
  content: ''; display: block;
  width: 3px; height: 7px;
  background: linear-gradient(180deg, #6c63ff, #e2b96f);
  border-radius: 2px;
  animation: mouse-scroll 1.8s ease-in-out infinite;
}
@keyframes mouse-scroll {
  0%  { opacity: 1; transform: translateY(0); }
  75% { opacity: 0; transform: translateY(11px); }
  100%{ opacity: 0; transform: translateY(0); }
}

/* ---- ローダーリング ---- */
#loader-ring-progress {
  transition: stroke-dashoffset 1s cubic-bezier(0.4,0,0.2,1);
  transform-origin: center;
  transform: rotate(-90deg);
}

/* ---- パーティクルフィールド（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 1.2s cubic-bezier(0.16, 1, 0.3, 1),
              transform 1.2s cubic-bezier(0.16, 1, 0.3, 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;
  }
}
