/* =======================================
   💅 上品で洗練されたアニメーション CSS
   ネイルサロン専用 - プロフェッショナル実装
   ======================================= */

/* ページロード時の残像防止 - パフォーマンス最適化 */
html:not(.js-loaded) .p-fv__logo,
html:not(.js-loaded) .p-fv__title-bg,
html:not(.js-loaded) .p-fv__subtitle-bg,
html:not(./* カードエフェクト - プロフェッショナルな実装 */
.p-recommend__item,
.p-reason__item,
.p-capital__block,
.p-loyalty__card {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  isolation: isolate;
}

/* ホバー時のグラデーションオーバーレイ */
.p-recommend__item::before,
.p-reason__item::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    rgba(255, 107, 157, 0.03),
    rgba(255, 217, 61, 0.03),
    rgba(107, 207, 127, 0.03)
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: -1;
}

.p-recommend__item:hover,
.p-reason__item:hover {
  box-shadow: 
    0 12px 30px rgba(0, 0, 0, 0.08),
    0 0 0 1px rgba(255, 107, 157, 0.05) inset;
  transform: translateY(-8px) translateZ(0);
}

.p-recommend__item:hover::before,
.p-reason__item:hover::before {
  opacity: 1;
}v__feature,
html:not(.js-loaded) .p-fv__cta,
html:not(.js-loaded) .p-recommend__item,
html:not(.js-loaded) .p-reason__item,
html:not(.js-loaded) .p-application-flow__step,
html:not(.js-loaded) .p-owner__image img,
html:not(.js-loaded) .p-faq__item,
html:not(.js-loaded) .l-section {
  opacity: 0 !important;
  visibility: hidden !important;
  will-change: opacity, transform;
}

/* GPU加速の最適化 */
.p-fv__logo,
.p-fv__title-bg,
.p-fv__subtitle-bg,
.p-fv__feature,
.p-fv__cta,
.p-recommend__item,
.p-reason__item {
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000px;
}

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

/* スクロールバーのカスタマイズ（Webkit） */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #ff6b9d, #ffa8c5);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #ff4d88, #ff6b9d);
}

/* =======================================
   ✨ エレガントなキーフレーム
   ======================================= */

/* ソフトなフェードイン */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* 上品なフェードアップ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 控えめなフローティング */
@keyframes gentleFloat {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-8px);
  }
}

/* 控えめなフローティング */
@keyframes gentleFloat {
  0%, 100% {
    transform: translateY(0px) translateZ(0);
  }
  50% {
    transform: translateY(-8px) translateZ(0);
  }
}

/* ソフトなシャイン効果 */
@keyframes subtleShine {
  0% {
    opacity: 0;
    left: -30%;
  }
  50% {
    opacity: 0.3;
  }
  100% {
    opacity: 0;
    left: 130%;
  }
}

/* グラデーションフロー */
@keyframes gradientFlow {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* パルスグロー（控えめ） */
@keyframes subtleGlow {
  0%, 100% {
    box-shadow: 0 0 10px rgba(255, 107, 157, 0.15);
  }
  50% {
    box-shadow: 0 0 20px rgba(255, 107, 157, 0.25);
  }
}

/* =======================================
   � ファーストビューエフェクト
   ======================================= */

.p-fv {
  position: relative;
  overflow: hidden;
}

.p-fv__inner {
  animation: fadeIn 1s ease-out;
}

/* ロゴに上品なホバー */
.p-fv__logo {
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.p-fv__logo:hover {
  transform: scale(1.05) translateZ(0);
}

/* タイトル背景にグラデーション効果 */
.p-fv__title-bg {
  position: relative;
  background: linear-gradient(135deg, transparent, rgba(255, 107, 157, 0.03), transparent);
  background-size: 200% 200%;
  animation: gradientFlow 8s ease infinite;
  padding: 0.2em 0.5em;
  border-radius: 4px;
}

/* サブタイトルに微細な輝き */
.p-fv__subtitle-bg {
  position: relative;
  overflow: hidden;
}

.p-fv__subtitle-bg::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: subtleShine 4s ease-in-out infinite;
  pointer-events: none;
}

/* タイトル・サブタイトル・特徴バッジの初期状態 */
.js-loaded .p-fv__title-bg,
.js-loaded .p-fv__subtitle-bg,
.js-loaded .p-fv__feature,
.js-loaded .p-fv__cta {
  opacity: 1;
  visibility: visible;
}

/* 特徴バッジに控えめなフロート */
.p-fv__feature {
  animation: gentleFloat 4s ease-in-out infinite;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.p-fv__feature::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 107, 157, 0.1), rgba(255, 217, 61, 0.1));
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.p-fv__feature:hover::before {
  opacity: 1;
}

.p-fv__feature:nth-child(1) { animation-delay: 0s; }
.p-fv__feature:nth-child(2) { animation-delay: 0.8s; }
.p-fv__feature:nth-child(3) { animation-delay: 1.6s; }
.p-fv__feature:nth-child(4) { animation-delay: 2.4s; }

.p-fv__feature:hover {
  transform: translateY(-5px) translateZ(0);
  box-shadow: 
    0 8px 20px rgba(0, 0, 0, 0.08),
    0 0 0 1px rgba(255, 107, 157, 0.1) inset;
}

/* =======================================
   💎 CTAボタンエフェクト
   ======================================= */

.p-cta__btn,
.p-fv__cta {
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ボタンに上品なシャイン */
.p-cta__btn::before,
.p-fv__cta::before {
  content: '';
  position: absolute;
  top: 0;
  left: -30%;
  width: 30%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  transform: skewX(-20deg);
  pointer-events: none;
}

.p-cta__btn:hover::before,
.p-fv__cta:hover::before {
  animation: subtleShine 0.8s ease;
}

.p-cta__btn:hover,
.p-fv__cta:hover {
  transform: translateY(-2px) translateZ(0);
  box-shadow: 
    0 8px 20px rgba(255, 107, 157, 0.25),
    0 0 30px rgba(255, 107, 157, 0.1);
}

/* ボタンにマイクロインタラクション */
.p-cta__btn:active,
.p-fv__cta:active {
  transform: translateY(0) translateZ(0) scale(0.98);
  transition-duration: 0.1s;
}

/* アイコンにスムーズな移動 */
.p-cta__btn svg,
.p-fv__cta svg {
  transition: transform 0.3s ease;
}

.p-cta__btn:hover svg,
.p-fv__cta:hover svg {
  transform: translateX(4px);
}

/* =======================================
   🌹 カードエフェクト - プロフェッショナル実装
   ======================================= */

.p-recommend__item,
.p-reason__item,
.p-capital__block,
.p-loyalty__card {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  isolation: isolate;
}

/* ホバー時のグラデーションオーバーレイ */
.p-recommend__item::before,
.p-reason__item::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    rgba(255, 107, 157, 0.03),
    rgba(255, 217, 61, 0.03),
    rgba(107, 207, 127, 0.03)
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: -1;
}

.p-recommend__item:hover,
.p-reason__item:hover {
  box-shadow: 
    0 12px 30px rgba(0, 0, 0, 0.08),
    0 0 0 1px rgba(255, 107, 157, 0.05) inset;
  transform: translateY(-8px) translateZ(0);
}

.p-recommend__item:hover::before,
.p-reason__item:hover::before {
  opacity: 1;
}

/* =======================================
   � 数字エフェクト
   ======================================= */

.p-capital__total-amount,
.p-capital__block-price {
  transition: color 0.3s ease;
}

.p-capital__total-amount:hover {
  color: #ff6b9d;
}

/* =======================================
   � アプリケーションフローエフェクト
   ======================================= */

.p-application-flow__step {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.p-application-flow__step:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.06);
}

/* 矢印にスムーズな動き */
.p-application-flow__arrow {
  transition: transform 0.3s ease;
}

.p-application-flow__arrow:hover {
  transform: scale(1.1);
}

/* =======================================
   💬 FAQアコーディオンエフェクト
   ======================================= */

.p-faq__item {
  transition: all 0.3s ease;
}

.p-faq__item:hover {
  background: rgba(255, 107, 157, 0.02);
}

.p-faq__arrow {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.p-faq__item.is-open .p-faq__arrow {
  transform: rotate(180deg);
}

/* =======================================
   � スクロール連動エフェクト
   ======================================= */

.l-section {
  opacity: 0;
  transform: translateY(20px) translateZ(0);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.l-section.is-visible {
  opacity: 1;
  transform: translateY(0) translateZ(0);
}

/* セクション背景に微細なグラデーション */
.p-recommend,
.p-reason,
.p-capital {
  position: relative;
}

.p-recommend::before,
.p-reason::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 200px;
  background: linear-gradient(
    180deg,
    rgba(255, 107, 157, 0.02),
    transparent
  );
  pointer-events: none;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  /* モバイルではアニメーションを控えめに */
  .p-fv__feature {
    animation-duration: 5s;
  }
  
  .p-recommend__item:hover,
  .p-reason__item:hover {
    transform: translateY(-4px);
  }
}

/* パフォーマンス最適化とアクセシビリティ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
