/* ============================================================
   assets/css/animation/loading-animation.css
   オープニング・ローディングアニメーション（トップページ専用）
   ============================================================ */

/* ── ローディング画面（カーテン兼用） ── */
#loader {
  position: fixed;
  inset: 0;
  background: #1a1919;
  z-index: var(--z-maximum);
  transition: transform 1.5s cubic-bezier(0.76, 0, 0.24, 1);
}

#loader.tow-up {
  transform: translateY(-100%);
}

/* 背景の砂漠グラデーション */
#loader::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 40% at 50% 80%, #1a110500 0%, #0c0c0e 70%);
  pointer-events: none;
}

/* 飛行機ラッパー：ローディング中は中央、その後上端へ */
#plane-wrap {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
  transition: top 0.9s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.9s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 上端へ移動（牽引位置） */
#plane-wrap.to-top {
  top: 36px;
  transform: translate(-50%, 0);
}

/* 牽引ロープ */
#tow-rope {
  width: 1px;
  height: 0;
  background: linear-gradient(to bottom, rgba(200, 169, 110, 0.6), rgba(200, 169, 110, 0));
  margin-top: -36px;
  transition: height 0.5s ease 0.3s;
  pointer-events: none;
}

#plane-wrap.to-top #tow-rope {
  height: 60px;
}

/* 飛行機SVG */
#jet {
  width: 72px;
  height: 72px;
  fill: #ffffff;
  filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.35));
  animation: loader-pulse-glow 2s ease-in-out infinite;
}

@keyframes loader-pulse-glow {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.25)); opacity: 0.85; }
  50%       { filter: drop-shadow(0 0 18px rgba(255, 255, 255, 0.6)); opacity: 1; }
}

/* 進捗テキスト */
#progress-pct {
  font-size: 13px;
  letter-spacing: 0.25em;
  color: #8a7a62;
  font-family: 'Helvetica Neue', sans-serif;
  font-weight: 300;
}

#pct-num {
  color: #c8a96e;
  font-size: 15px;
  font-weight: 400;
}

/* 細いプログレスバー */
#bar-wrap {
  width: 160px;
  height: 1px;
  background: rgba(200, 169, 110, 0.12);
  position: relative;
  margin-top: -12px;
}

#bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #8a6a3a, #c8a96e);
  width: 0%;
  transition: width 0.1s linear;
  box-shadow: 0 0 8px rgba(200, 169, 110, 0.5);
}

/* ── 飛行機雲 ── */
#contrail {
  position: absolute;
  left: 50%;
  top: 108px;
  transform: translateX(-50%);
  width: 24px;
  height: 0;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  transition: height 1.0s cubic-bezier(0.2, 0, 0.4, 1);
  overflow: visible;
}

#contrail.show {
  height: calc(100vh - 108px);
}

.loader-trail {
  width: 2px;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.55) 0%,
    rgba(255, 255, 255, 0.25) 30%,
    rgba(255, 255, 255, 0.08) 70%,
    rgba(255, 255, 255, 0) 100%
  );
  border-radius: 2px;
  animation: loader-trail-breathe 3s ease-in-out infinite;
}

.loader-trail:nth-child(2) {
  animation-delay: 0.4s;
}

@keyframes loader-trail-breathe {
  0%, 100% { opacity: 0.7; }
  50%       { opacity: 1.0; }
}