/* ===== TOP オープニング：映画の始まりのようにロゴが現れる =====
   黒い画面の中心に光の点 → 横に光の線が走る → その中心からロゴが広がって現れる
   → ロゴが手前に迫ってきて、いつものTOPページへ。
   JavaScriptが動かなくても、CSSだけで最後は必ず消える。 */
.intro {
  position: fixed; inset: 0; z-index: 1000; overflow: hidden;
  display: grid; place-items: center;
  background: #000;
  animation: intro-out .8s ease-in 3.6s forwards;
}
@keyframes intro-out { to { opacity: 0; visibility: hidden; } }
.intro.is-done { display: none; }

/* 光の点 → 横に伸びる光の線 */
.intro-flare {
  position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px;
  border-radius: 50%; background: #fff;
  box-shadow: 0 0 12px 4px #fff, 0 0 40px 12px rgba(255,212,0,.8), 0 0 90px 30px rgba(255,212,0,.35);
  opacity: 0;
  animation: intro-flare 1.5s cubic-bezier(.3, 0, .2, 1) .3s forwards;
}
@keyframes intro-flare {
  0%   { opacity: 0; transform: scale(0); }
  25%  { opacity: 1; transform: scale(1); }
  55%  { opacity: 1; transform: scaleX(160) scaleY(.5); }
  100% { opacity: 0; transform: scaleX(260) scaleY(.2); }
}

/* ロゴのうしろの黄色い光 */
.intro-glow {
  position: absolute; left: 50%; top: 50%; width: min(80vw, 900px); height: min(40vw, 420px);
  transform: translate(-50%, -50%) scale(.2);
  background: radial-gradient(closest-side, rgba(255,212,0,.35), rgba(255,212,0,.08) 60%, transparent);
  opacity: 0;
  animation: intro-glow 2.4s ease-out .8s forwards;
}
@keyframes intro-glow {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(.2); }
  40%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: .6; transform: translate(-50%, -50%) scale(1.15); }
}

/* ロゴ：中心から左右に広がって出てくる → 少しずつ近づく → 一気に手前へ */
.intro-logo {
  position: relative; width: min(72vw, 640px); padding: 60px; box-sizing: content-box;
  clip-path: inset(0 50% 0 50%);
  transform: scale(.85); filter: blur(10px); opacity: 0;
  animation:
    intro-open 1.1s cubic-bezier(.2, .7, .1, 1) .9s forwards,
    intro-drift 1.6s linear 2s forwards,
    intro-zoom .9s cubic-bezier(.6, 0, .9, .4) 3.4s forwards;
}
.intro-logo img { display: block; width: 100%; height: auto; filter: drop-shadow(0 0 18px rgba(255,212,0,.45)); }
@keyframes intro-open {
  0%   { opacity: 0; clip-path: inset(0 50% 0 50%); transform: scale(.85); filter: blur(10px); }
  30%  { opacity: 1; }
  100% { opacity: 1; clip-path: inset(0 0 0 0); transform: scale(1); filter: blur(0); }
}
@keyframes intro-drift {
  from { opacity: 1; clip-path: inset(0 0 0 0); filter: blur(0); transform: scale(1); }
  to   { opacity: 1; clip-path: inset(0 0 0 0); filter: blur(0); transform: scale(1.06); }
}
@keyframes intro-zoom {
  from { opacity: 1; clip-path: inset(0 0 0 0); filter: blur(0); transform: scale(1.06); }
  to   { opacity: 0; clip-path: inset(0 0 0 0); filter: blur(6px); transform: scale(6); }
}

/* ロゴの上をキラッと光が通る */
.intro-shine {
  position: absolute; inset: 60px;
  background: linear-gradient(105deg, transparent 40%, rgba(255,240,170,.95) 50%, transparent 60%) no-repeat;
  background-size: 300% 100%; background-position: 100% 0;
  -webkit-mask: url(../images/logo-white.svg) center / 100% 100% no-repeat;
          mask: url(../images/logo-white.svg) center / 100% 100% no-repeat;
  animation: intro-shine 1s ease-in-out 2.1s forwards;
}
@keyframes intro-shine { to { background-position: 0 0; } }

/* 社名（警備保障株式会社） */
.intro-sub {
  position: absolute; left: 0; right: 0; top: calc(50% + min(14vw, 125px)); margin: 0; text-align: center;
  color: #d8d7d1; font-family: "Noto Sans JP", sans-serif; font-weight: 700;
  font-size: clamp(13px, 1.6vw, 18px); letter-spacing: .5em; text-indent: .5em;
  opacity: 0;
  animation: intro-sub 1.6s ease-out 1.8s forwards;
}
@keyframes intro-sub {
  0%   { opacity: 0; letter-spacing: 1.2em; }
  50%  { opacity: 1; }
  80%  { opacity: 1; letter-spacing: .5em; }
  100% { opacity: 0; letter-spacing: .5em; }
}

/* スキップ */
.intro-skip {
  position: absolute; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 5;
  padding: 8px 16px; border: 1px solid rgba(243,242,238,.35); border-radius: 999px;
  background: transparent; color: rgba(243,242,238,.7); cursor: pointer;
  font-family: "Barlow Condensed", "Arial Narrow", sans-serif; font-weight: 700; font-size: 15px; letter-spacing: .12em;
}
.intro-skip:hover { background: #f3f2ee; color: #111; }
.intro.is-skip { animation: intro-out .3s ease-in forwards; }

/* 動きを減らす設定の人には、オープニングを出さない */
@media (prefers-reduced-motion: reduce) { .intro { display: none; } }

/* 2回目以降（同じブラウザを開いている間）は出さない */
.intro-off .intro { display: none; }
