/* 統合背景動画のスタイル */
/* 1つの動画要素を動的に制御し、必要に応じて位置とスタイルを変更 */

.unified-background-video {
  /* 基本設定 */
  object-fit: cover;
  pointer-events: none;
  will-change: transform, opacity, z-index, clip-path;

  /* トランジション設定 - clip-path用に最適化 */
  transition: opacity 0.05s linear, visibility 0.05s linear, clip-path 0.05s linear;

  /* デフォルトは非表示 */
  opacity: 0;
  visibility: hidden;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: -10;
}

/* TOPページのデフォルト表示モード（常に表示） */
.unified-background-video.mode-default {
  opacity: 1;
  visibility: visible;
  position: fixed;
  z-index: -1;
  height: calc(var(--safari-vh, 100vh) * var(--viewport-scale, 1));
}

/* TOPページのservice表示モード */
.unified-background-video.mode-service {
  opacity: 1;
  visibility: visible;
  position: fixed;
  z-index: -1;
  height: calc(var(--safari-vh, 100vh) * var(--viewport-scale, 1));
}

/* ハンバーガーメニュー表示モード */
.unified-background-video.mode-menu {
  opacity: 1;
  visibility: visible;
  position: fixed;
  z-index: 998;
  height: calc(100vh * var(--viewport-scale, 1));
  min-height: calc(100vh * var(--viewport-scale, 1));
}

/* Pre-footer表示モード */
.unified-background-video.mode-footer {
  opacity: 1;
  visibility: visible;
  position: fixed;
  z-index: -1;
  height: calc(100vh * var(--viewport-scale, 1));
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .unified-background-video {
    height: 100vh;
    height: calc(100vh * var(--viewport-scale, 1));
    min-height: -webkit-fill-available;
    object-position: center;
  }
}

/* Safari対応 */
@supports (-webkit-touch-callout: none) {
  .unified-background-video {
    height: calc(100vh * var(--viewport-scale, 1));
    min-height: -webkit-fill-available;
  }
}

/* Firefox対応 */
@supports (-moz-appearance: none) {
  .unified-background-video.mode-default,
  .unified-background-video.mode-service,
  .unified-background-video.mode-menu {
    height: 100vh;
  }
}

/* パフォーマンス最適化：GPU アクセラレーション */
@media (prefers-reduced-motion: no-preference) {
  .unified-background-video {
    transform: translateZ(0);
    backface-visibility: hidden;
  }
}