/* ==========================================================================
   4-Life ブランドカラー & 基本設定
   ========================================================================== */
:root {
  --color-primary: #1a3a8f;       /* ロイヤルブルー */
  --color-primary-dark: #12285f;  /* 濃いロイヤルブルー */
  --color-primary-light: #3b5fc4; /* 明るいロイヤルブルー */
  --color-bg: #ffffff;
  --color-bg-soft: #f7f9fc;       /* 上品な淡いグレー */
  --color-text: #1c2333;
  --color-text-soft: #4b5468;
  --shadow-soft: 0 10px 30px rgba(26, 58, 143, 0.12);
  --shadow-hover: 0 18px 40px rgba(26, 58, 143, 0.2);
}

html {
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
  font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', sans-serif;
  color: var(--color-text);
  background-color: var(--color-bg);
  font-size: 16px;
  line-height: 1.8;
}

.font-heading {
  font-family: 'Shippori Mincho', 'Noto Serif JP', serif;
}

/* フォーカスリング（アクセシビリティ） */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--color-primary-light);
  outline-offset: 2px;
}

/* ==========================================================================
   ヘッダー：スクロール連動
   ========================================================================== */
#site-header {
  transition: background-color 0.4s ease, box-shadow 0.4s ease, padding 0.4s ease;
  background-color: transparent;
}

#site-header.scrolled {
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 20px rgba(26, 58, 143, 0.08);
}

#site-header .logo-text {
  color: var(--color-primary);
  transition: color 0.4s ease;
}

#site-header:not(.scrolled) .nav-link,
#site-header:not(.scrolled) .logo-text {
  color: #ffffff;
}

#site-header.scrolled .nav-link {
  color: var(--color-primary-dark);
}

/* ヒーローが無いページ（プロフィール等）は常時ソリッド表示 */
#site-header.solid {
  background-color: rgba(255, 255, 255, 0.98);
  box-shadow: 0 4px 20px rgba(26, 58, 143, 0.08);
}
#site-header.solid .nav-link,
#site-header.solid .logo-text {
  color: var(--color-primary-dark);
}

/* ==========================================================================
   ヒーローセクション：動きのある背景
   ========================================================================== */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #0f2a6b 0%, #1a3a8f 45%, #3b5fc4 100%);
}

.hero-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  animation: float-blob 16s ease-in-out infinite;
  will-change: transform;
}

.hero-blob--a {
  width: 420px;
  height: 420px;
  background: rgba(255, 255, 255, 0.18);
  top: -120px;
  left: -100px;
  animation-delay: 0s;
}

.hero-blob--b {
  width: 340px;
  height: 340px;
  background: rgba(120, 160, 255, 0.35);
  bottom: -100px;
  right: -80px;
  animation-delay: -5s;
  animation-duration: 20s;
}

.hero-blob--c {
  width: 260px;
  height: 260px;
  background: rgba(255, 255, 255, 0.12);
  top: 40%;
  right: 15%;
  animation-delay: -10s;
  animation-duration: 24s;
}

@keyframes float-blob {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -40px) scale(1.08); }
  66% { transform: translate(-25px, 25px) scale(0.95); }
}

.hero-particles {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(rgba(255,255,255,0.5) 1px, transparent 1px),
    radial-gradient(rgba(255,255,255,0.3) 1px, transparent 1px);
  background-size: 90px 90px, 140px 140px;
  background-position: 0 0, 45px 70px;
  animation: drift-particles 40s linear infinite;
  opacity: 0.5;
}

@keyframes drift-particles {
  from { background-position: 0 0, 45px 70px; }
  to { background-position: 400px 300px, 545px 370px; }
}

/* ヒーローテキストのフェードアップ */
.hero-fade-up {
  opacity: 0;
  transform: translateY(24px);
  animation: fade-up 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.hero-fade-up.delay-1 { animation-delay: 0.15s; }
.hero-fade-up.delay-2 { animation-delay: 0.35s; }
.hero-fade-up.delay-3 { animation-delay: 0.55s; }

@keyframes fade-up {
  to { opacity: 1; transform: translateY(0); }
}

/* ヒーロー：ロゴリビール(左右から線が伸び、ロゴが浮かび上がる) */
.hero-logo-reveal {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
}

.hero-logo-reveal .hero-line {
  display: inline-block;
  height: 1px;
  width: clamp(40px, 12vw, 120px);
  background: rgba(255, 255, 255, 0.55);
  transform: scaleX(0);
  opacity: 0;
  animation: line-grow 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: 0.1s;
}

.hero-logo-reveal .hero-line--left {
  transform-origin: right center;
}

.hero-logo-reveal .hero-line--right {
  transform-origin: left center;
}

.hero-logo-reveal .hero-logo-text {
  opacity: 0;
  transform: translateY(16px);
  animation: fade-up 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: 0.5s;
}

@keyframes line-grow {
  to { transform: scaleX(1); opacity: 1; }
}

/* CTAボタンのホバー動作 + 光沢アニメーション */
.btn-cta {
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}
.btn-cta:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}
.btn-cta::after {
  content: '';
  position: absolute;
  top: 0;
  left: -75%;
  width: 40%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: skewX(-20deg);
  animation: btn-shimmer 5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes btn-shimmer {
  0% { left: -75%; }
  22% { left: 130%; }
  100% { left: 130%; }
}

/* ヒーロー：スクロール連動パララックス層 */
.hero-parallax {
  position: absolute;
  inset: 0;
  will-change: transform;
}

/* 見出し下線：スクロールで画面に入ると伸びる */
.section-underline {
  display: block;
  width: 48px;
  height: 3px;
  margin: 0.9rem auto 0;
  background: var(--color-primary);
  border-radius: 2px;
  transform: scaleX(0);
  opacity: 0;
  transform-origin: center;
}
[data-aos].aos-animate .section-underline {
  animation: line-grow 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: 0.25s;
}

/* 写真：ケンバーンズ効果（ゆっくり拡大し続ける） */
.ken-burns {
  overflow: hidden;
}
.ken-burns img {
  animation: ken-burns-zoom 20s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes ken-burns-zoom {
  from { transform: scale(1); }
  to { transform: scale(1.08); }
}

/* スクロール進捗バー */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--color-primary-light), var(--color-primary));
  z-index: 60;
  transition: width 0.1s linear;
}

/* スクロール誘導アイコン */
.scroll-cue {
  animation: bob 2s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(10px); }
}

/* ==========================================================================
   カード共通ホバー
   ========================================================================== */
.hover-lift {
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.hover-lift:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
}

/* ==========================================================================
   カウントアップ数字
   ========================================================================== */
.counter {
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   セクション装飾（波形の区切り）
   ========================================================================== */
.wave-divider {
  display: block;
  width: 100%;
  height: 60px;
}

/* ==========================================================================
   モバイルメニュー
   ========================================================================== */
#mobile-menu {
  transition: max-height 0.4s ease, opacity 0.3s ease;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
}
#mobile-menu.open {
  max-height: 480px;
  opacity: 1;
}

.hamburger-line {
  transition: transform 0.3s ease, opacity 0.3s ease;
}
#hamburger-btn.open .hamburger-line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
#hamburger-btn.open .hamburger-line:nth-child(2) {
  opacity: 0;
}
#hamburger-btn.open .hamburger-line:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ==========================================================================
   お問い合わせ方法選択モーダル
   ========================================================================== */
.contact-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.contact-modal.open {
  visibility: visible;
  opacity: 1;
}
.contact-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 21, 54, 0.55);
  backdrop-filter: blur(2px);
}
.contact-modal__panel {
  position: relative;
  background: #ffffff;
  border-radius: 1.5rem;
  padding: 2.5rem 2rem 2rem;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-hover);
  transform: translateY(16px) scale(0.98);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}
.contact-modal.open .contact-modal__panel {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.contact-modal__panel--form {
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem 1.25rem 1.25rem;
}
.contact-modal__form-wrap {
  border-radius: 1rem;
  overflow: hidden;
  background: #ffffff;
}
.contact-modal__form-wrap iframe {
  display: block;
}

.contact-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  color: var(--color-text-soft);
  transition: background-color 0.2s ease;
}
.contact-modal__close:hover {
  background-color: var(--color-bg-soft);
}

/* ==========================================================================
   動きを抑えたいユーザーへの配慮
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .hero-fade-up {
    opacity: 1;
    transform: none;
  }
}
