/* ナビゲーション
 * NOTE: バー本体 (nav / nav.scrolled の背景・blur・影・border) は
 * src/styles/critical.css が唯一の source of truth (ATF / inline)。
 * ここで再定義すると値が二重管理になり競合するため定義しない。 */

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

.logo {
  font-size: 1.375rem;
  font-weight: 700;
  background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: all 0.3s var(--easing-standard);
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0;
}

.logo-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
  transition: transform 0.3s var(--easing-standard);
  display: block;
  margin-top: 2px;
}

.logo:hover .logo-icon {
  transform: scale(1.05) rotate(-3deg);
}

.logo:hover {
  transform: translateY(-1px);
}

.logo::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #1e3a8a, #1d4ed8);
  transition: width 0.3s var(--easing-standard);
}

.logo:hover::after {
  width: 100%;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  align-items: center;
}

.nav-links a:not(.nav-cta) {
  color: var(--text);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: all 0.2s;
  position: relative;
  padding: 0.5rem 0;
}

.nav-links a:not(.nav-cta):after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  transition: all 0.3s var(--easing-standard);
  transform: translateX(-50%);
}

.nav-links a:not(.nav-cta):hover,
.nav-links a:not(.nav-cta).active {
  color: var(--primary);
}

.nav-links a:not(.nav-cta):hover:after,
.nav-links a:not(.nav-cta).active:after {
  width: 100%;
}

.nav-cta {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--on-primary) !important;
  padding: 0.625rem 1.75rem;
  min-height: 44px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
  display: inline-block;
  white-space: nowrap;
}

.nav-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(30, 58, 138, 0.4);
}

/* ハンバーガーメニューボタン（デフォルトは非表示） */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
}

.hamburger-line {
  width: 100%;
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* モバイルメニューが開いている時 */
.mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
  transform: translateY(10.5px) rotate(45deg);
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
  transform: translateY(-10.5px) rotate(-45deg);
}

/* モバイル対応 */
@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 80px;
    right: -100%;
    width: 100%;
    height: calc(100vh - 80px);
    /* v4: solid 背景 (critical.css と同値)。透け防止のため backdrop-filter は使わない。 */
    background: var(--canvas);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 2rem;
    gap: 1.75rem;
    transition: right 0.3s var(--easing-standard);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
  }

  .nav-links.active {
    right: 0;
  }

  .nav-links a:not(.nav-cta) {
    font-size: 1.25rem;
    padding: 1rem 0;
    width: 100%;
    text-align: center;
  }

  .nav-cta {
    width: 100%;
    max-width: 300px;
    text-align: center;
    padding: 1rem 2rem;
    margin-top: 1rem;
  }
}
/* ヒーローセクション
 *
 * Phase 4b 完了: hero のコア構造・タイポ・proof-card・hero-video は
 * `src/styles/critical.css` が唯一の source of truth。
 * このファイルは critical.css に含めない補助スタイルのみを保持する:
 *   - hero CTA の微調整 (.hero-cta / .hero-cta-secondary)
 *   - 装飾アニメーション (mac/phone float, video play ring)
 *   - インタラクション (hover transform)
 *   - レガシー .recording-indicator / .waveform (旧 hero 内ウィジェット)
 */

/* hero-content 内ビジュアル枠 */
.visual-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* hero CTA の微調整 (critical.css の .btn-primary を継承した上で padding/font-size を上書き) */
.hero-cta {
  padding: 1.125rem 2.75rem;
  font-size: 1.0625rem;
}

.hero-cta-secondary {
  padding: 0.875rem 2rem;
  font-size: 0.9375rem;
}

/* v2 (restraint): idle float を全廃。2 台が永遠に別周期でバウンドする「無料テンプレ感」を
 * 断ち、定常状態を「置かれた製品ショット」=情報密度の高い静止画にする。浮遊感は多層
 * box-shadow と接地影 (::after) が代替する。動きの予算は入場 1 回と SOAP 生成に集中。
 *
 * Mac (LCP の H1 と並ぶ主役・本文を含む) は opacity:0 を一切経由させず静止位置で即可視。
 * iPhone (従・前面) のみ一度だけ「置かれる」着地を与える。fill は backwards にして
 *   (1) delay 中だけ from(不可視) を適用し、(2) 完了後は base へ戻すことで hover lift と
 *   競合しない (forwards で transform を保持すると hover が効かなくなるため)。常駐
 *   will-change は付けない (一回の着地に永続レイヤは不要)。 */
@media (prefers-reduced-motion: no-preference) {
  .iphone-wrapper {
    animation: deviceSettleUp 0.7s var(--easing-entrance, cubic-bezier(0.16, 1, 0.3, 1)) 0.3s backwards;
  }
}

@keyframes deviceSettleUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* hover の浮き上がりは「大画面 + hover 可能ポインタ」に限定。タブレット中央寄せ帯
 * (transform: translate(-50%,-50%)) に translateY(-50%) のホバー値が漏れて Mac が
 * 右へ飛びクリップするリグレッションを防ぐ。 */
@media (min-width: 1025px) and (hover: hover) {
  .hero-visual:hover .mac-wrapper {
    transform: translateY(-50%) translateX(-10px) scale(1.02);
  }

  .hero-visual:hover .iphone-wrapper {
    transform: translateX(10px) scale(1.02);
  }
}

/* (v2) floatMac / floatPhone keyframes は idle float 廃止により削除済み。 */

/* --- レガシー hero 内ウィジェット (recording / waveform) ---
 * 現行 LP では VoiceToChart セクションが等価機能を提供するため
 * markup 上では使用されていないが、CSS 互換のため残置。 */
.recording-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--canvas);
  padding: 0.75rem 1.5rem;
  border-radius: 100px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border);
}

.recording-indicator span {
  font-weight: 500;
  color: var(--text);
  font-size: 0.875rem;
}

.rec-dot {
  width: 8px;
  height: 8px;
  background: #ff4444;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.waveform {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 60px;
  margin: 2rem 0;
  padding: 1rem;
  background: var(--canvas);
  border-radius: 15px;
  box-shadow: var(--shadow-sm);
}

.wave-bar {
  flex: 1;
  background: linear-gradient(180deg, var(--primary), var(--accent));
  border-radius: 3px;
  animation: wave 1.5s ease-in-out infinite;
  opacity: 0.8;
}

.wave-bar:nth-child(odd) { animation-delay: 0.1s; }
.wave-bar:nth-child(even) { animation-delay: 0.3s; }
/* ヒーローセクション レスポンシブ
 *
 * Phase 4b 完了: hero のレスポンシブ基本ルールは critical.css に集約済み。
 * このファイルは critical.css の 768/480/375px ブレイクポイント外でのみ
 * 必要な調整 (ラージデスクトップ・1024 タブレット横・landscape 等) と
 * critical.css でカバーしていないアニメーション/装飾を担当する。
 */

/* ラージデスクトップ (1440px 以上) ── critical の clamp 上限 4.25rem で
 * 十分大きいが、デバイスステージの最大サイズと padding は強化する */
@media (min-width: 1440px) {
  .hero {
    padding: 12rem 4rem 8rem;
  }

  .devices-stage {
    max-width: 750px;
  }
  /* デバイス寸法は critical.css の --mw/--iw が唯一の source of truth
     (実 DOM モック化で .mac-image/.iphone-image は削除済み)。 */
}

/* デスクトップ (1024-1439px) ── デバイス寸法は critical.css の --mw/--iw が担う */

/* タブレット横向き (1024px 以下、768px は critical.css 担当) */
@media (max-width: 1024px) and (min-width: 769px) {
  .hero {
    padding: 9rem 2.5rem 5rem;
  }

  .hero-container {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 3rem;
  }

  .hero-content {
    max-width: 680px;
    margin: 0 auto;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-visual {
    height: 450px;
    margin-top: 2rem;
  }

  .devices-stage {
    max-width: 600px;
  }

  /* 単一カラム中央寄せ帯では Mac(主役)も中央へ寄せ、右へはみ出てクリップするのを防ぐ。
     iPhone は中央 Mac の右下コーナーに前面で重ねる。寸法は critical.css の
     --mw / --iw が担う (旧 .mac-image/.iphone-image ルールは <img> 撤去で失効)。 */
  .mac-wrapper {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
  }

  .iphone-wrapper {
    right: 12%;
    bottom: 14%;
  }

  .hero-video {
    padding: 2.75rem 2.5rem 3.5rem;
  }

  .hero-video__inner {
    padding: 0 1.5rem;
  }

  .hero-video__preview {
    padding: 1.5rem;
  }
  /* (v2) タブレットの float 再定義は idle float 廃止により削除。デバイスは静止。 */
}

/* モバイル (768px 以下) ── critical.css で基本 layout は対応済み。
 * v2: idle float は全廃。タッチ端末では hover lift も無効化する。
 * iPhone の一回着地 (deviceSettleUp) は hero.e3068587.css の no-preference 配下で全幅に適用される。 */
@media (max-width: 768px) {
  .hero-visual:hover .mac-wrapper {
    transform: translate(-50%, -50%);
  }

  .hero-visual:hover .iphone-wrapper {
    transform: none;
  }
}

/* 横向きモード対応 */
@media (max-height: 600px) and (orientation: landscape) {
  .hero {
    padding: 5rem 2rem 3rem;
    min-height: auto;
  }

  .hero-visual {
    height: 280px;
  }

  .devices-stage {
    max-width: 450px;
  }

  .iphone-wrapper {
    right: 15%;
    bottom: 20%;
  }
}

/* アクセシビリティ */
@media (prefers-reduced-motion: reduce) {
  .mac-wrapper,
  .iphone-wrapper {
    animation: none !important;
  }
}
/* 社会的証明バー - ヒーロー直下
 * v2: 薄水色グラデから neutral オフホワイトに変更。
 * Hero 下の sub-nav 帯として情報点が前に出るデザインへ。 */
.trust-bar {
  padding: 2.75rem 3rem;
  background: var(--canvas-soft);
  border-top: 1px solid var(--hairline-navy);
  border-bottom: 1px solid var(--hairline-navy);
}

/* 3 signal の cluster は ~580px しかないため、container を 1100px で開けると
 * 左右に 430px ずつ余白が出て帯として希薄に見える。
 * cluster 幅に寄せて cap し、信頼バンドとして凝集させる。 */
.trust-bar-inner {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3.5rem;
}

.trust-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.25rem;
}

.trust-number {
  font-size: 1.75rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary, #1e3a8a) 0%, var(--primary-dark, #1e40af) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.trust-unit {
  font-size: 1.25rem;
  font-weight: 600;
}

.trust-label {
  font-size: 0.875rem;
  color: var(--text-light, #64748b);
  font-weight: 500;
  white-space: nowrap;
}

.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.125rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary, #1e3a8a) 0%, var(--primary-dark, #1e40af) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.trust-badge svg {
  color: var(--primary, #1e3a8a);
  flex-shrink: 0;
}

/* trust-badge--metric / trust-metric-num/unit は導入実績バッジ撤去に伴い未使用 */

.trust-divider {
  width: 1px;
  height: 3rem;
  background: var(--hairline-navy-strong); /* Issue #25: indigo-300 → navy 薄め (パレット統一) */
  flex-shrink: 0;
}

/* 監修医バリアント: 顔写真 + 名前を横並びで表示 */
.trust-item--supervisor {
  flex-direction: row;
  gap: 0;
}

.trust-supervisor-link {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  color: inherit;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: background-color 0.2s ease;
}

.trust-supervisor-link:hover,
.trust-supervisor-link:focus-visible {
  background-color: rgba(255, 255, 255, 0.6);
  outline: none;
}

.trust-supervisor-link:focus-visible {
  box-shadow: 0 0 0 2px var(--primary, #1e3a8a);
}

.trust-supervisor-photo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 35%;
  flex-shrink: 0;
  /* gold accent ring を subtle に復活させ、Hero「2時間」と並ぶ "gold の点" に */
  box-shadow: 0 2px 6px rgba(30, 58, 138, 0.18), 0 0 0 2px rgba(216, 168, 73, 0.45);
}

.trust-supervisor-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.25;
}

.trust-supervisor-eyebrow {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-light, #64748b);
  letter-spacing: 0.06em;
}

.trust-supervisor-name {
  font-size: 1.0625rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary, #1e3a8a) 0%, var(--primary-dark, #1e40af) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}

.trust-note {
  margin: 1.25rem auto 0;
  max-width: var(--max-width-content, 1100px);
  color: var(--text-light, #64748b); /* Issue #22: 白系背景で AA 確保 */
  font-size: 0.75rem;
  line-height: 1.6;
  text-align: center;
}

/* レスポンシブ: タブレット */
@media (max-width: 768px) {
  .trust-bar {
    padding: 2rem 1.5rem;
  }

  .trust-bar-inner {
    flex-wrap: wrap;
    gap: 1.5rem 2rem;
  }

  .trust-divider {
    display: none;
  }

  .trust-item {
    flex: 0 0 calc(50% - 1rem);
  }

  /* 監修医はモバイルで最上段に単独配置 (信頼信号として最優先) */
  .trust-item--supervisor {
    flex: 0 0 100%;
    justify-content: center;
  }

  .trust-number {
    font-size: 1.5rem;
  }

  .trust-note {
    margin-top: 1rem;
    padding: 0 0.5rem;
  }

}

@media (max-width: 600px) {
  .trust-bar {
    padding: 1.5rem 1rem;
  }

  .trust-bar-inner {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 0.875rem;
  }

  .trust-item,
  .trust-item--supervisor {
    width: min(100%, 20.5rem);
    max-width: 20.5rem;
    min-width: 0;
    flex: none;
  }

  .trust-item:not(.trust-item--supervisor) {
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: var(--radius-md);
  }

  .trust-supervisor-link {
    justify-content: center;
    width: 100%;
    padding: 0.5rem 0.75rem;
  }

  .trust-label {
    white-space: normal;
  }

  .trust-badge {
    justify-content: center;
    font-size: 0.95rem;
  }

  .trust-supervisor-photo {
    width: 56px;
    height: 56px;
  }
}

/* レスポンシブ: スマートフォン */
@media (max-width: 480px) {
  .trust-bar {
    padding: 1.375rem 1rem;
  }

  .trust-bar-inner {
    gap: 0.75rem;
  }

  .trust-number {
    font-size: 1.25rem;
  }

  .trust-label {
    font-size: 0.75rem;
  }

  .trust-badge {
    font-size: 0.875rem;
  }

}
