/* Rocket transition between Cockpit, Gate and Tower (see js/portal-switch.js).
   Layers: .eps-sky (z 0, behind)  <  body (z 1, flies up)  <  .eps-fx (z 2, rocket + trail) */
html.eps-launching { overflow: hidden; background: #070b1a; }
html.eps-launching body { position: relative; z-index: 1; will-change: transform;
  transition: transform .74s cubic-bezier(.55, 0, .75, .2) .7s, opacity .45s ease .98s; }
html.eps-go body { transform: translateY(-108vh) scale(.95); opacity: 0; }

.eps-sky, .eps-fx { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.eps-sky { z-index: 0; background: radial-gradient(ellipse at 50% 120%, #312e81 0%, #111a3a 38%, #070b1a 75%); }
.eps-fx { z-index: 2; }

.eps-stars i { position: absolute; border-radius: 50%; background: #fff; opacity: .15; animation: eps-twinkle 1.6s ease-in-out infinite; }
@keyframes eps-twinkle { 0%, 100% { opacity: .15; } 50% { opacity: .9; } }

/* step 1 (0-.55 s): veil + destination, readable */
.eps-veil { position: absolute; inset: 0; background: rgba(7, 11, 26, .62); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .25s ease; }
html.eps-go .eps-veil { opacity: 1; }
.eps-dest { position: absolute; left: 0; right: 0; top: 34%; text-align: center; color: #fff; opacity: 0; transform: translateY(14px) scale(.96);
  font: 600 15px/1.2 "Manrope", -apple-system, "Segoe UI", system-ui, sans-serif; transition: opacity .28s ease .05s, transform .4s cubic-bezier(.2, .9, .3, 1.2) .05s;
 }
.eps-dest strong { filter: drop-shadow(0 6px 24px rgba(99, 102, 241, .55)); }
.eps-dest span { display: block; color: #c7d2fe; letter-spacing: .26em; text-transform: uppercase; font-size: 14px; font-weight: 800; }
.eps-dest strong { display: block; font-size: 64px; letter-spacing: -.02em; margin-top: 6px;
  background: linear-gradient(90deg, #60a5fa, #a78bfa); -webkit-background-clip: text; background-clip: text; color: transparent; }
html.eps-go .eps-dest { opacity: 1; transform: none; }

.eps-rocket { position: absolute; left: 50%; bottom: 0; width: 84px; height: 168px; margin-left: -42px;
  transform: translateY(110%); filter: drop-shadow(0 0 18px rgba(129, 140, 248, .7)); }
/* step 2 (from .55 s): take-off, the page goes up with it */
html.eps-go .eps-rocket { animation: eps-fly .95s cubic-bezier(.5, 0, .7, .3) .55s forwards; }
@keyframes eps-fly {
  0% { transform: translateY(110%); }
  14% { transform: translateY(38%) rotate(-2deg); }
  22% { transform: translateY(30%) rotate(2deg); }
  30% { transform: translateY(24%) rotate(0deg); }
  100% { transform: translateY(calc(-100vh - 120%)); }
}
.eps-flame { transform-origin: 60px 150px; animation: eps-flicker .07s linear infinite alternate; }
@keyframes eps-flicker { from { transform: scaleY(.85) scaleX(.94); } to { transform: scaleY(1.18) scaleX(1.06); } }

.eps-trail { position: absolute; left: 50%; bottom: 0; width: 46px; margin-left: -23px; height: 0; border-radius: 30px 30px 0 0;
  background: linear-gradient(to top, rgba(148, 163, 184, 0) 0%, rgba(199, 210, 254, .5) 55%, rgba(251, 191, 36, .85) 100%);
  filter: blur(10px); }
html.eps-go .eps-trail { animation: eps-trail .95s cubic-bezier(.5, 0, .7, .3) .55s forwards; }
@keyframes eps-trail { 0% { height: 0; opacity: 1; } 70% { height: 105vh; opacity: .9; } 100% { height: 125vh; opacity: 0; } }

/* arrival in the next area: the page rises in from below */
html.eps-arriving { background: #070b1a; }
html.eps-arriving body { transform: translateY(80px) scale(.97); opacity: 0; }
html.eps-arriving.eps-arrived body { transform: none; opacity: 1;
  transition: transform .7s cubic-bezier(.2, .9, .25, 1.08), opacity .45s ease; }

@media (prefers-reduced-motion: reduce) {
  html.eps-arriving body { transform: none; opacity: 1; }
}
