/* The coming-soon hangar: the game's own title-screen bay door, a departure board, and the cast
   wandering in around it. Every animation is finite and stops; reduced motion skips them all. */

.hangar-page {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: clip;
}

/* ------------------------------------------------------------ backdrop */

.hangar {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--midnight);
}
.hangar-sky {
  position: absolute;
  inset: 0;
  background: url('/assets/cast/hangar.webp') center 40% / cover no-repeat;
  animation: sky-in 1.6s cubic-bezier(.2, .7, .2, 1) both;
}
/* Gunmetal grade: pull the edges into shadow and keep a soft pool of light behind the board. */
.hangar::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(48% 42% at 50% 46%, rgb(12 18 26 / 62%), transparent 100%),
    radial-gradient(120% 90% at 50% 40%, transparent 45%, rgb(8 12 18 / 80%) 100%),
    linear-gradient(180deg, rgb(20 28 36 / 30%) 0%, transparent 30%, transparent 70%, rgb(10 14 20 / 85%) 100%);
}
.hangar-floor {
  position: absolute;
  inset: auto 0 0;
  height: 18%;
  z-index: 1;
  background: radial-gradient(60% 100% at 50% 100%, rgb(243 174 38 / 10%), transparent 70%);
}

@keyframes sky-in {
  from { transform: scale(1.08); filter: brightness(.4); }
  to { transform: scale(1); filter: none; }
}

/* ------------------------------------------------------------ hazard tape */

.hazard-tape {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: fit-content;
  max-width: calc(100% - 32px);
  margin: calc(16px + env(safe-area-inset-top)) auto 0;
  padding: 6px 8px;
  border-radius: 999px;
  background: repeating-linear-gradient(-45deg, #f3ae26 0 12px, #15191e 12px 24px);
  box-shadow: inset 0 1px 0 rgb(255 247 214 / 55%), inset 0 -2px 0 rgb(0 0 0 / 35%), 0 2px 0 #05080c, 0 8px 18px rgb(0 0 0 / 40%);
  animation: drop-in .7s .2s cubic-bezier(.3, 1.4, .5, 1) both;
}
.hazard-tape span {
  padding: 3px 12px;
  border-radius: 999px;
  background: #15191e;
  color: var(--amber);
  font: 800 11px/1.4 var(--body);
  letter-spacing: .16em;
  text-transform: uppercase;
  white-space: nowrap;
}
.hazard-tape b {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff5a3c;
  box-shadow: 0 0 8px #ff5a3c;
}

@keyframes drop-in {
  from { opacity: 0; transform: translateY(-40px); }
}

/* ------------------------------------------------------------ the bay (content) */

.bay {
  position: relative;
  z-index: 3;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  width: min(640px, 100%);
  margin: 0 auto;
  padding: clamp(28px, 6vh, 64px) 16px clamp(150px, 22vh, 220px);
  text-align: center;
}

.bay-mark {
  margin: 0;
  width: min(440px, 82vw);
  filter: drop-shadow(0 10px 24px rgb(0 0 0 / 55%));
  animation: mark-in .9s .35s cubic-bezier(.3, 1.5, .5, 1) both;
}
@keyframes mark-in {
  from { opacity: 0; transform: translateY(26px) scale(.82) rotate(-4deg); }
}

.bay-kicker {
  margin: -6px 0 0;
  font: 800 clamp(22px, 3.4vw, 32px)/1.1 var(--display);
  letter-spacing: -.03em;
  color: var(--ivory);
  text-shadow: 0 2px 0 rgb(0 0 0 / 50%), 0 6px 18px rgb(0 0 0 / 60%);
  animation: rise .7s .6s ease-out both;
}
.bay-kicker em { font-style: normal; color: var(--banana); }

.bay-lede {
  max-width: 470px;
  margin: 0;
  color: #d7dee4;
  font-size: 17px;
  text-shadow: 0 2px 10px rgb(0 0 0 / 80%);
  animation: rise .7s 1.1s ease-out both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
}

/* ------------------------------------------------------------ departure board */

.board {
  position: relative;
  width: min(520px, 100%);
  margin-top: 6px;
  padding: 16px 22px 20px;
  border: 1px solid var(--ink-edge);
  border-radius: 28px;
  background:
    radial-gradient(100% 50% at 50% 0%, rgb(255 255 255 / 9%), transparent 70%),
    linear-gradient(180deg, #3a4757 0%, #252f3b 50%, #19212b 100%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 22%), inset 0 -4px 0 rgb(0 0 0 / 30%), 0 3px 0 #05080c, 0 22px 50px rgb(0 0 0 / 55%);
  animation: rise .8s .8s cubic-bezier(.3, 1.3, .5, 1) both;
}
.board-bolts i {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #c9d0d4, #59626b 60%, #2a3138);
  box-shadow: 0 1px 0 rgb(0 0 0 / 60%);
}
.board-bolts i:nth-child(1) { top: 12px; left: 14px; }
.board-bolts i:nth-child(2) { top: 12px; right: 14px; }
.board-bolts i:nth-child(3) { bottom: 12px; left: 14px; }
.board-bolts i:nth-child(4) { bottom: 12px; right: 14px; }

.board-head, .board-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 12px;
  align-items: center;
}
.board-head {
  padding: 0 4px 10px;
  color: var(--amber);
  font: 800 10px/1 var(--body);
  letter-spacing: .2em;
  text-transform: uppercase;
}
.board-row {
  padding: 10px;
  border-radius: 18px;
  background: #0d1218;
  box-shadow: inset 0 2px 6px rgb(0 0 0 / 70%), 0 1px 0 rgb(255 255 255 / 8%);
}

.flaps {
  display: flex;
  justify-content: center;
  gap: 3px;
  min-height: 34px;
}
.flap {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(17px, 3.6vw, 22px);
  height: 32px;
  border-radius: 6px;
  background: linear-gradient(180deg, #2b333d 0 49%, #1f262e 51% 100%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 12%), 0 1px 0 #000;
  color: var(--ivory);
  font: 700 clamp(15px, 3vw, 19px)/1 var(--display);
}
.flap::after {
  content: '';
  position: absolute;
  inset: 50% 2px auto;
  height: 1px;
  background: rgb(0 0 0 / 65%);
}
.flap.is-space { background: transparent; box-shadow: none; width: 6px; }
.flaps-status .flap { color: var(--amber); }
.flaps-status.is-settled .flap { animation: status-blink .9s 4 steps(2, jump-none); }
@keyframes status-blink {
  50% { color: #6b4a10; }
}

/* Without the script the board still reads: show the destination text plainly. */
html:not(.js) .flaps::after {
  content: attr(data-flap);
  color: var(--ivory);
  font: 700 18px/34px var(--display);
  letter-spacing: .08em;
}
html:not(.js) .flaps-status::after { color: var(--amber); }

/* ------------------------------------------------------------ call to action */

.crew-button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  margin-top: 4px;
  padding: 0 28px;
  border-radius: 999px;
  background: var(--amber-fill);
  box-shadow: var(--amber-shadow);
  color: var(--amber-ink);
  font: 800 16px/1 var(--body);
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
  animation: rise .7s 1.3s ease-out both;
}
.crew-button:hover { transform: translateY(-2px) scale(1.02); }
.crew-button:active { transform: translateY(1px); box-shadow: inset 0 2px 3px rgb(0 0 0 / 30%), 0 1px 0 #3a2504; }
.crew-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #1f8f4e;
  box-shadow: 0 0 0 3px rgb(31 143 78 / 25%);
}

/* ------------------------------------------------------------ the cast */

.cast {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
}
.cast-member {
  position: absolute;
  pointer-events: auto;
  cursor: pointer;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-tap-highlight-color: transparent;
  filter: drop-shadow(0 12px 14px rgb(0 0 0 / 45%));
  animation: var(--enter) var(--enter-time, .9s) var(--delay, 0s) cubic-bezier(.25, 1.25, .5, 1) both,
             var(--idle, bob) var(--idle-time, 2.6s) calc(var(--delay, 0s) + var(--enter-time, .9s)) ease-in-out 3;
}
.cast-member.is-home { animation: none; }
/* A poke gives the member a single boing. */
.cast-member.is-poked {
  animation: boing .6s cubic-bezier(.3, 1.6, .5, 1);
}

/* Heroes dive in through the bay door. */
.cast-bonana   { --enter: dive-left;  --delay: .5s;  top: 13%; left: 9%;  width: clamp(120px, 14vw, 230px); rotate: -6deg; }
.cast-velvet   { --enter: dive-right; --delay: .8s;  top: 9%;  right: 10%; width: clamp(110px, 12vw, 200px); rotate: 4deg; scale: -1 1; }
.cast-redline  { --enter: dive-left;  --delay: 1.1s; top: 46%; left: 3%;  width: clamp(90px, 10vw, 170px); rotate: 12deg; }
.cast-lil      { --enter: dive-right; --delay: 1.4s; top: 40%; right: 5%; width: clamp(70px, 7vw, 120px); rotate: -10deg; scale: -1 1; }
/* Trouble on the floor and in the air. */
.cast-mosquito { --enter: buzz-in; --idle: hover; --delay: 1.8s; --idle-time: 1.4s; top: 25%; right: 25%; width: clamp(80px, 8vw, 140px); }
.cast-toaster  { --enter: stomp-in; --delay: 1.2s; --enter-time: 1.2s; bottom: 2%; right: -3%; width: clamp(240px, 31vw, 520px); }
.cast-worm     { --enter: pop-up; --idle: sway; --delay: 2.1s; bottom: 2%; left: 4%; width: clamp(90px, 10vw, 170px); transform-origin: 50% 100%; }
.cast-chair    { --enter: roll-in; --idle: none; --delay: 2.4s; --enter-time: 1.4s; bottom: 3%; left: 22%; width: clamp(60px, 6vw, 104px); }
.cast-suitcase { --enter: pop-up; --idle: sway; --delay: 2.7s; bottom: 2%; right: 26%; width: clamp(90px, 9vw, 150px); transform-origin: 50% 100%; }

@keyframes dive-left {
  from { opacity: 0; transform: translate(-60vw, -50vh) rotate(-40deg); }
  70% { opacity: 1; }
}
@keyframes dive-right {
  from { opacity: 0; transform: translate(60vw, -50vh) rotate(40deg); }
  70% { opacity: 1; }
}
@keyframes buzz-in {
  0% { opacity: 0; transform: translate(40vw, -10vh); }
  30% { opacity: 1; transform: translate(10vw, 6vh) rotate(-8deg); }
  55% { transform: translate(14vw, -4vh) rotate(6deg); }
  80% { transform: translate(-3vw, 2vh) rotate(-4deg); }
}
@keyframes stomp-in {
  from { opacity: 0; transform: translateX(40vw); }
  40% { opacity: 1; transform: translateX(22vw) translateY(-12px); }
  55% { transform: translateX(14vw); }
  75% { transform: translateX(5vw) translateY(-10px); }
}
@keyframes pop-up {
  from { opacity: 0; transform: translateY(110%) scaleY(.6); }
  60% { opacity: 1; transform: translateY(-8%) scaleY(1.08); }
}
@keyframes roll-in {
  from { opacity: 0; transform: translateX(-40vw) rotate(-20deg); }
  60% { opacity: 1; transform: translateX(3vw) rotate(6deg); }
  80% { transform: translateX(-1vw) rotate(-2deg); }
}
@keyframes bob {
  50% { transform: translateY(-10px) rotate(2deg); }
}
@keyframes hover {
  25% { transform: translate(-6px, -8px) rotate(-3deg); }
  75% { transform: translate(6px, 4px) rotate(3deg); }
}
@keyframes sway {
  50% { transform: rotate(-4deg) scaleY(1.03); }
}
@keyframes boing {
  30% { transform: scale(1.18, .82); }
  55% { transform: scale(.9, 1.12) translateY(-18px); }
  80% { transform: scale(1.04, .96); }
}

/* ------------------------------------------------------------ smaller screens */

@media (max-width: 900px) {
  .cast-redline, .cast-chair { display: none; }
  .cast-lil { top: 52%; }
  .cast-suitcase { right: auto; left: 28%; }
}

@media (max-width: 600px) {
  .hazard-tape span:nth-of-type(n+3), .hazard-tape b:nth-of-type(n+2) { display: none; }
  .bay { padding-top: 96px; padding-bottom: 170px; gap: 16px; }
  .cast-bonana { top: 62px; left: -10px; width: 104px; }
  .cast-velvet { top: 56px; right: -8px; width: 96px; }
  .cast-lil, .cast-mosquito, .cast-suitcase { display: none; }
  .cast-toaster { width: 250px; right: -40px; bottom: 30px; }
  .cast-worm { width: 104px; left: 0; bottom: 34px; }
  .board { padding: 14px 12px 16px; border-radius: 24px; }
  .board-head, .board-row { gap: 6px; }
  .board-row { padding: 8px 6px; }
  .flaps { gap: 2px; }
  .flap { height: 28px; border-radius: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  .cast-member, .cast-member.is-poked { animation: none; }
}
