/* ── DRONE·I·FY — mission control for sky poetry ── */

:root {
  --sky-0: #04060d;
  --sky-1: #0a0f24;
  --horizon: #1b1345;
  --ink: #eae7dc;
  --ink-dim: #9a97b0;
  --amber: #ffb547;
  --amber-soft: #ffd9a0;
  --ice: #9fd8ff;
  --danger: #ff5340;
  --mono: 'IBM Plex Mono', monospace;
  --disp: 'Bricolage Grotesque', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { height: 100%; overflow: hidden; }

body {
  background: var(--sky-0);
  color: var(--ink);
  font-family: var(--mono);
  -webkit-font-smoothing: antialiased;
}

/* ── sky layers ── */
#sky { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }

.horizon {
  position: fixed; left: 0; right: 0; bottom: 0; height: 42vh;
  background:
    radial-gradient(120% 90% at 50% 118%, rgba(94, 60, 200, .28), transparent 62%),
    radial-gradient(70% 55% at 72% 112%, rgba(255, 122, 60, .10), transparent 70%),
    linear-gradient(to top, rgba(27, 19, 69, .55), transparent 75%);
  pointer-events: none;
}

.vignette {
  position: fixed; inset: 0; pointer-events: none;
  background: radial-gradient(115% 95% at 50% 42%, transparent 58%, rgba(0, 0, 0, .5) 100%);
}

.grain { position: fixed; inset: -50%; pointer-events: none; opacity: .05; animation: grain 7s steps(10) infinite;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E");
}
@keyframes grain {
  0%,100% { transform: translate(0,0) } 20% { transform: translate(-3%,2%) }
  40% { transform: translate(2%,-3%) } 60% { transform: translate(-2%,-2%) } 80% { transform: translate(3%,3%) }
}

/* ── telemetry chrome ── */
.tele {
  position: fixed; z-index: 30;
  font: 500 10px/1 var(--mono);
  letter-spacing: .22em; color: var(--ink-dim);
  text-shadow: 0 1px 8px rgba(0,0,0,.8);
  user-select: none;
}
.tele-tl { top: 18px; left: 22px; }
.tele-tr { top: 18px; right: 22px; text-align: right; }
.tele-br { bottom: 16px; right: 22px; }
.tele b { color: var(--amber); font-weight: 600; }
.tele-btn {
  font: inherit; letter-spacing: inherit; color: inherit;
  background: none; border: 1px solid rgba(154,151,176,.35);
  padding: 6px 10px; cursor: pointer; border-radius: 3px;
}
.tele-btn:hover { color: var(--ink); border-color: var(--ink-dim); }

/* ── landing console ── */
.console {
  position: fixed; inset: 0; z-index: 20;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 26px; padding: 24px 24px 80px;
  transition: opacity .7s ease, visibility .7s;
}
.home-reel {
  position: absolute; inset: 0; z-index: -2; pointer-events: none;
  width: 100%; height: 100%; object-fit: cover;
  opacity: .16; mix-blend-mode: screen;
  -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent 72%);
  mask-image: linear-gradient(to bottom, #000 30%, transparent 72%);
}
.console::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(58% 54% at 50% 44%, rgba(3, 5, 12, .78), rgba(3, 5, 12, .28) 62%, transparent 78%);
}
.console.away { opacity: 0; visibility: hidden; pointer-events: none; }

.brand {
  font: 200 clamp(44px, 8.5vw, 96px)/1 var(--disp);
  font-stretch: 88%;
  letter-spacing: .04em;
  background: linear-gradient(180deg, #f6f8ff 8%, #cfe0ff 46%, #9fb4e8 74%, #ffd9a0 108%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  filter: drop-shadow(0 0 34px rgba(159, 216, 255, .3)) drop-shadow(0 2px 18px rgba(0, 0, 0, .7));
  animation: settle .9s cubic-bezier(.2,.9,.25,1) both;
}
.brand span {
  background: linear-gradient(180deg, #ffe0a8, #ff9432);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  font-weight: 400;
  animation: led-blink 2.6s ease-in-out infinite;
}
.brand span + span { animation-delay: 1.3s; }
@keyframes led-blink { 50% { opacity: .45; } }

.aurora {
  position: absolute; inset: -22%; z-index: -3; pointer-events: none;
  filter: blur(64px); opacity: .55;
  background:
    radial-gradient(30% 38% at 28% 30%, rgba(94, 60, 200, .38), transparent 70%),
    radial-gradient(26% 34% at 72% 24%, rgba(255, 122, 60, .22), transparent 70%),
    radial-gradient(24% 30% at 56% 58%, rgba(60, 150, 255, .22), transparent 70%);
  animation: aurora-drift 18s ease-in-out infinite alternate;
}
@keyframes aurora-drift {
  to { transform: translate3d(3%, -2.5%, 0) scale(1.07) rotate(1.5deg); }
}

.tag {
  font: 500 11px/1 var(--mono); letter-spacing: .34em; text-transform: uppercase;
  color: var(--ink-dim);
  animation: settle .9s .12s cubic-bezier(.2,.9,.25,1) both;
}

@keyframes settle { from { opacity: 0; transform: translateY(18px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }

#launch-form { width: min(720px, 94vw); animation: settle .9s .22s cubic-bezier(.2,.9,.25,1) both; }

.pad {
  display: flex; gap: 0; align-items: stretch;
  background: rgba(10, 14, 32, .58);
  border: 1px solid rgba(159, 216, 255, .16);
  border-radius: 14px;
  backdrop-filter: blur(14px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255,255,255,.05);
  overflow: hidden;
  transition: border-color .25s, box-shadow .25s;
}
.pad:focus-within {
  border-color: rgba(255, 181, 71, .5);
  box-shadow: 0 30px 90px rgba(0,0,0,.6), 0 0 0 4px rgba(255,181,71,.07), inset 0 1px 0 rgba(255,255,255,.05);
}

#scenario {
  flex: 1; resize: none; border: 0; outline: 0; background: transparent;
  color: var(--ink); caret-color: var(--amber);
  font: 400 17px/1.55 var(--disp); font-stretch: 96%;
  padding: 20px 22px;
}
#scenario::placeholder { color: #565a78; }

.launch {
  position: relative; overflow: hidden;
  border: 0; cursor: pointer;
  min-width: 152px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  background: linear-gradient(160deg, #ffc35e, #ff9432);
  color: #241300;
  box-shadow: -8px 0 32px rgba(255, 148, 50, .18);
  transition: filter .2s, transform .12s, box-shadow .3s;
}
.launch::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.42) 50%, transparent 65%);
  transform: translateX(-120%);
  animation: launch-sheen 4.2s ease-in-out infinite;
}
@keyframes launch-sheen { 12%, 100% { transform: translateX(120%); } }
.launch:hover { filter: brightness(1.08) saturate(1.05); box-shadow: -8px 0 44px rgba(255, 148, 50, .34); }
.launch:active { transform: scale(.985); }
.launch-word { font: 700 17px/1 var(--disp); letter-spacing: .16em; }
.launch-sub { font: 500 8.5px/1 var(--mono); letter-spacing: .14em; opacity: .72; }

.tryout {
  width: min(820px, 94vw);
  display: grid;
  gap: 14px;
  justify-items: center;
  margin-top: 2px;
  padding: 16px 18px 18px;
  border-radius: 22px;
  border: 1px solid rgba(154,151,176,.14);
  background:
    linear-gradient(180deg, rgba(18, 22, 46, .48), rgba(8, 11, 24, .34)),
    radial-gradient(120% 140% at 50% 0%, rgba(255,181,71,.08), rgba(0,0,0,0));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
  animation: settle .9s .34s cubic-bezier(.2,.9,.25,1) both;
}
.tryout-head { text-align: center; display: grid; gap: 8px; }
.tryout-kicker {
  margin: 0;
  font: 600 10px/1 var(--mono);
  letter-spacing: .34em;
  color: rgba(255, 181, 71, .82);
}
.tryout-copy {
  margin: 0;
  font: 400 11px/1.65 var(--mono);
  letter-spacing: .08em;
  color: #6f7393;
}
.chips { display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; width: 100%; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  font: 400 11.5px/1.35 var(--mono); color: var(--ink-dim);
  background: rgba(10, 14, 32, .5); border: 1px solid rgba(154,151,176,.22);
  border-radius: 999px; padding: 8px 14px 8px 12px; cursor: pointer;
  transition: color .2s, border-color .2s, background .2s, transform .2s, box-shadow .2s;
}
.chip::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%; flex: none;
  background: var(--ice); box-shadow: 0 0 8px var(--ice);
}
.chip:nth-child(1)::before { background: #ffd9a0; box-shadow: 0 0 8px #ffd9a0; }
.chip:nth-child(2)::before { background: #8affd4; box-shadow: 0 0 8px #8affd4; }
.chip:nth-child(3)::before { background: #ff9de2; box-shadow: 0 0 8px #ff9de2; }
.chip:nth-child(4)::before { background: #9fd8ff; box-shadow: 0 0 8px #9fd8ff; }
.chip:nth-child(5)::before { background: #c4b5ff; box-shadow: 0 0 8px #c4b5ff; }
.chip.surprise::before { display: none; }
.chip:hover {
  color: var(--ice); border-color: rgba(159,216,255,.5); background: rgba(159,216,255,.06);
  transform: translateY(-1px); box-shadow: 0 6px 22px rgba(0,0,0,.35);
}
.chip.surprise { color: var(--amber); border-color: rgba(255,181,71,.4); }
.chip.surprise:hover { background: rgba(255,181,71,.08); border-color: var(--amber); }

.foot { font: 400 10px/1.9 var(--mono); letter-spacing: .08em; color: #565a78; text-align: center;
  animation: settle .9s .46s cubic-bezier(.2,.9,.25,1) both; }
.foot a { color: #7b7fa3; }

/* ── planning interstitial ── */
.planning {
  position: fixed; inset: 0; z-index: 40;
  display: grid; place-items: center;
  background: #04060d;
}
.planning::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(70% 60% at 50% 46%, transparent 22%, rgba(4, 6, 13, .9) 100%);
}
/* ── mission-control HUD chrome ── */
.hud-grid {
  position: absolute; left: -10%; right: -10%; bottom: -2%; height: 34vh;
  background:
    linear-gradient(rgba(111, 168, 255, .16) 1px, transparent 1px) 0 0 / 100% 44px,
    linear-gradient(90deg, rgba(111, 168, 255, .16) 1px, transparent 1px) 0 0 / 64px 100%;
  transform: perspective(420px) rotateX(62deg);
  transform-origin: 50% 100%;
  -webkit-mask-image: linear-gradient(to top, #000 30%, transparent 92%);
          mask-image: linear-gradient(to top, #000 30%, transparent 92%);
  animation: grid-flow 7s linear infinite;
  opacity: .5;
}
@keyframes grid-flow { to { background-position: 0 44px, 0 0; } }
.hud-scan { position: absolute; inset: 0; pointer-events: none; }
.hud-scan::before {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, rgba(159, 216, 255, .028) 0 1px, transparent 1px 3px);
}
.hud-scan::after {
  content: ''; position: absolute; left: 0; right: 0; top: -8%; height: 90px;
  background: linear-gradient(to bottom, transparent, rgba(159, 216, 255, .07), transparent);
  animation: scan-fall 6.5s cubic-bezier(.3, 0, .7, 1) infinite;
}
@keyframes scan-fall { to { top: 108%; } }
.hud-frame i {
  position: absolute; width: 36px; height: 36px;
  border: 1px solid rgba(159, 216, 255, .5);
  animation: bracket-breathe 3.2s ease-in-out infinite;
}
.hud-frame i::after {
  content: ''; position: absolute; width: 5px; height: 5px; background: var(--amber);
  box-shadow: 0 0 10px 1px rgba(255, 215, 94, .8);
}
.hud-frame i:nth-child(1) { top: 26px; left: 26px; border-right: 0; border-bottom: 0; }
.hud-frame i:nth-child(1)::after { top: -3px; left: -3px; }
.hud-frame i:nth-child(2) { top: 26px; right: 26px; border-left: 0; border-bottom: 0; }
.hud-frame i:nth-child(2)::after { top: -3px; right: -3px; }
.hud-frame i:nth-child(3) { bottom: 26px; left: 26px; border-right: 0; border-top: 0; }
.hud-frame i:nth-child(3)::after { bottom: -3px; left: -3px; }
.hud-frame i:nth-child(4) { bottom: 26px; right: 26px; border-left: 0; border-top: 0; }
.hud-frame i:nth-child(4)::after { bottom: -3px; right: -3px; }
@keyframes bracket-breathe { 50% { opacity: .45; } }
.hud-rail {
  position: absolute; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 17px;
  font: 400 9px/1 var(--mono); letter-spacing: .18em;
  color: rgba(159, 216, 255, .5);
  text-shadow: 0 1px 8px rgba(0, 0, 0, .9);
}
.hud-rail-l { left: 30px; }
.hud-rail-r { right: 30px; text-align: right; }
.hud-rail .hr-row b { display: block; color: var(--amber); font-weight: 600; font-size: 11px; margin-top: 5px; letter-spacing: .1em; }
.hud-rail .hr-meter {
  display: block; width: 74px; height: 2px; margin-top: 6px;
  background: rgba(159, 216, 255, .14);
}
.hud-rail-r .hr-meter { margin-left: auto; }
.hud-rail .hr-meter i {
  display: block; height: 100%; background: var(--ice);
  box-shadow: 0 0 8px rgba(159, 216, 255, .7);
  transition: width .45s ease;
}
.hud-radar {
  position: absolute; left: 34px; bottom: 34px; width: 108px; height: 108px;
  border-radius: 50%;
  border: 1px solid rgba(159, 216, 255, .3);
  background:
    repeating-radial-gradient(circle at 50% 50%, transparent 0 17px, rgba(159, 216, 255, .12) 17px 18px),
    linear-gradient(rgba(159, 216, 255, .06) 1px, transparent 1px) 50% 50% / 100% 50.5%,
    linear-gradient(90deg, rgba(159, 216, 255, .06) 1px, transparent 1px) 50% 50% / 50.5% 100%;
  overflow: hidden;
}
.hud-radar::before {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(159, 216, 255, .38), transparent 72deg, transparent);
  animation: radar-sweep 3.6s linear infinite;
}
.hud-radar::after {
  content: ''; position: absolute; left: 68%; top: 30%; width: 4px; height: 4px; border-radius: 50%;
  background: var(--amber); box-shadow: 0 0 8px 1px rgba(255, 215, 94, .9);
  animation: blip 3.6s ease-out infinite;
}
@keyframes radar-sweep { to { transform: rotate(360deg); } }
@keyframes blip { 0%, 18% { opacity: 1; } 60%, 100% { opacity: .08; } }
.planning-eyebrow {
  font: 500 9.5px/1 var(--mono); letter-spacing: .34em;
  color: var(--amber); margin-bottom: 16px;
  text-shadow: 0 0 14px rgba(255, 215, 94, .4);
}
.planning-eyebrow::after {
  content: '▮'; margin-left: 8px; animation: caret-blink 1.1s steps(1) infinite;
}
@media (max-width: 900px) { .hud-rail, .hud-radar { display: none; } }
.planning-orbit {
  position: relative; width: 78px; height: 78px; margin: 0 auto 30px;
  animation: orbit-spin 6.5s linear infinite;
}
.planning-orbit::before {
  content: ''; position: absolute; inset: 6px; border-radius: 50%;
  border: 1px dashed rgba(159, 216, 255, .18);
}
.planning-orbit i {
  position: absolute; top: 50%; left: 50%;
  width: 7px; height: 7px; margin: -3.5px; border-radius: 50%;
}
.planning-orbit i:nth-child(1) { background: #ffd9a0; box-shadow: 0 0 14px 2px rgba(255, 217, 160, .8); transform: rotate(0deg) translateX(33px); }
.planning-orbit i:nth-child(2) { background: #9fd8ff; box-shadow: 0 0 14px 2px rgba(159, 216, 255, .8); transform: rotate(120deg) translateX(33px); }
.planning-orbit i:nth-child(3) { background: #ff9de2; box-shadow: 0 0 14px 2px rgba(255, 157, 226, .8); transform: rotate(240deg) translateX(33px); }
@keyframes orbit-spin { to { transform: rotate(360deg); } }
.planning-copy {
  position: relative; z-index: 1; text-align: center;
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center;
  padding: 8vh 0 7vh;
}
.planning-title {
  font: 500 15px/1 var(--mono); letter-spacing: .42em; color: var(--ink);
  text-shadow: 0 2px 24px rgba(0,0,0,.9);
  animation: pulse-t 2.2s ease-in-out infinite;
}
.planning-sub { font: 400 10px/1 var(--mono); letter-spacing: .24em; color: var(--ink-dim); margin-top: 14px; }
.planning-bar {
  width: 260px; height: 2px; margin: 24px auto 0;
  background: rgba(154,151,176,.16); border-radius: 2px; overflow: hidden;
}
.planning-bar i {
  display: block; height: 100%; width: 46%;
  background: linear-gradient(90deg, transparent, var(--amber) 40%, var(--ice) 60%, transparent);
  animation: scan 1.8s cubic-bezier(.4,0,.6,1) infinite;
}
@keyframes scan { from { transform: translateX(-100%); } to { transform: translateX(350%); } }
@keyframes pulse-t { 50% { opacity: .55; } }
/* the script, full page — the choreographer thinks across the whole sky */
.planning-log {
  flex: 1 1 auto; width: min(960px, 90vw); margin: 4vh auto 0; min-height: 0;
  overflow-y: auto; scrollbar-width: none;
  text-align: left;
  font: 400 13.5px/2.1 var(--mono); letter-spacing: .045em;
  color: rgba(196, 222, 255, .88); font-style: italic;
  text-shadow: 0 1px 16px rgba(0, 0, 0, .95), 0 0 32px rgba(111, 168, 255, .12);
  white-space: pre-wrap; word-break: break-word;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 14%, #000 96%, transparent);
          mask-image: linear-gradient(to bottom, transparent 0, #000 14%, #000 96%, transparent);
  transition: flex .6s ease, opacity .6s ease, max-height .6s ease;
}
.planning-log::-webkit-scrollbar { display: none; }
.planning-log:not(:empty)::after {
  content: '▍'; font-style: normal; color: var(--amber);
  animation: caret-blink 1s steps(1) infinite;
}
@keyframes caret-blink { 50% { opacity: 0; } }
.planning-log.done { flex: 0 1 auto; max-height: 16vh; opacity: .3; }

/* the locked flight plan — big cinematic rows, no box */
.planning-plan {
  width: min(880px, 90vw); margin: 3vh auto 0; padding: 0;
  list-style: none; text-align: left;
  animation: plan-in .5s ease both;
}
.planning-plan li {
  position: relative;
  display: flex; align-items: baseline; gap: 22px;
  padding: 13px 4px;
  font: 400 15px/1.5 var(--mono); letter-spacing: .07em; color: var(--ink);
  text-shadow: 0 1px 14px rgba(0, 0, 0, .9);
  animation: row-in .5s ease both;
}
.planning-plan li::after {
  content: ''; position: absolute; left: 0; bottom: 0; height: 1px;
  width: var(--dur, 40%);
  background: linear-gradient(90deg, var(--amber), transparent);
  opacity: .55;
}
@keyframes row-in { from { opacity: 0; transform: translateX(-16px); } }
.planning-plan li + li { border-top: 1px dashed rgba(159, 216, 255, .14); }
.planning-plan .pp-n {
  color: var(--amber); font-weight: 600; font-size: 21px;
  text-shadow: 0 0 18px rgba(255, 215, 94, .45);
}
.planning-plan .pp-cap { flex: 1; text-transform: lowercase; font-size: 16.5px; }
.planning-plan .pp-meta { color: var(--ink-dim); font-size: 10px; letter-spacing: .14em; white-space: nowrap; text-transform: uppercase; }
@keyframes plan-in { from { opacity: 0; transform: translateY(14px); } }

/* ── during-show chrome ── */
.subtitle {
  position: fixed; left: 50%; bottom: 12vh; transform: translateX(-50%);
  z-index: 25; max-width: min(760px, 90vw); text-align: center;
  font: 300 clamp(17px, 2.6vw, 26px)/1.45 var(--disp); font-stretch: 94%;
  color: var(--ink);
  text-shadow: 0 2px 24px rgba(0,0,0,.85);
  opacity: 0; transition: opacity .6s ease;
  pointer-events: none;
}
.subtitle.on { opacity: .96; }

.waypoints {
  position: fixed; left: 50%; bottom: 7vh; transform: translateX(-50%);
  z-index: 25; display: flex; gap: 10px; align-items: center;
}
.wp { width: 7px; height: 7px; border-radius: 50%; border: 1px solid rgba(154,151,176,.6); background: transparent; transition: all .4s; }
.wp.done { background: rgba(154,151,176,.55); border-color: transparent; }
.wp.now { background: var(--amber); border-color: var(--amber); box-shadow: 0 0 14px rgba(255,181,71,.8); transform: scale(1.35); }

.showbar {
  position: fixed; top: 46px; left: 50%; transform: translateX(-50%);
  z-index: 30; display: flex; gap: 8px;
  opacity: .28; transition: opacity .3s;
}
.showbar:hover { opacity: 1; }
.showbar button {
  font: 500 10.5px/1 var(--mono); letter-spacing: .18em; color: var(--ink);
  background: rgba(8, 11, 26, .66); border: 1px solid rgba(154,151,176,.3);
  border-radius: 8px; padding: 10px 13px; cursor: pointer;
  backdrop-filter: blur(10px);
  transition: border-color .2s, color .2s;
}
.showbar button:hover { border-color: var(--amber); color: var(--amber-soft); }

.toast {
  position: fixed; top: 100px; left: 50%; transform: translateX(-50%);
  z-index: 40; font: 500 11px/1 var(--mono); letter-spacing: .16em;
  color: #10240f; background: #b6f09c; border-radius: 8px; padding: 12px 18px;
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
  animation: settle .35s ease both;
}

/* small screens */
@media (max-width: 620px) {
  .pad { flex-direction: column; }
  .launch { min-width: 100%; padding: 14px 0; }
  .tryout { padding: 14px 12px 15px; }
  .tryout-copy { font-size: 10px; }
  .chip { padding: 8px 12px; }
  .subtitle { bottom: 16vh; }
}
