/* Em-8ER "New Portal In Progress" page. Palette from the backer site theme
   (#0f1218 / #232b37 / #2b3444) plus the legendary-rarity ember orange. */

@font-face { font-family: "Chakra Petch"; font-weight: 500; font-display: swap; src: url("/assets/fonts/ChakraPetch-500.woff2") format("woff2"); }
@font-face { font-family: "Chakra Petch"; font-weight: 600; font-display: swap; src: url("/assets/fonts/ChakraPetch-600.woff2") format("woff2"); }
@font-face { font-family: "Chakra Petch"; font-weight: 700; font-display: swap; src: url("/assets/fonts/ChakraPetch-700.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 400 600; font-display: swap; src: url("/assets/fonts/Inter-var.woff2") format("woff2"); }

:root {
  --space: #05070c;
  --navy: #0f1218;
  --steel: #232b37;
  --slate: #2b3444;
  --ink: #eef2f7;
  --muted: #9aa6b8;
  --dim: #5d6879;
  --ember: #ff7a1a;
  --ember-deep: #e67300;
  --ember-hot: #ffb347;
  --atmo: #6fd3ff;
  --ok: #4ade80;
  --display: "Chakra Petch", "Rajdhani", "Segoe UI", sans-serif;
  --body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  font: 400 16px/1.6 var(--body);
  background:
    radial-gradient(1200px 600px at 50% 8%, rgba(111, 211, 255, 0.07), transparent 70%),
    radial-gradient(900px 500px at 80% 110%, rgba(255, 122, 26, 0.12), transparent 70%),
    var(--space);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------- backdrop: stars, meteor, planet ---------- */

.sky { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.sky canvas { width: 100%; height: 100%; display: block; }

.meteor {
  position: absolute;
  top: 9%;
  left: 62%;
  width: 220px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(255, 179, 71, 0), rgba(255, 179, 71, 0.85) 70%, #fff);
  box-shadow: 0 0 12px 2px rgba(255, 122, 26, 0.55);
  transform: rotate(-16deg) translateX(0);
  opacity: 0;
  animation: meteor 13s cubic-bezier(.3, .1, .3, 1) 2.5s infinite;
}

@keyframes meteor {
  0%   { opacity: 0; transform: rotate(-16deg) translate3d(260px, 0, 0); }
  2%   { opacity: 1; }
  9%   { opacity: 0; transform: rotate(-16deg) translate3d(-520px, 0, 0); }
  100% { opacity: 0; transform: rotate(-16deg) translate3d(-520px, 0, 0); }
}

.planet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  height: min(62vh, 56vw);
  pointer-events: none;
}

.planet img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 58% 100%;
  -webkit-mask-image: linear-gradient(to top, #000 55%, transparent 100%);
          mask-image: linear-gradient(to top, #000 55%, transparent 100%);
  filter: saturate(1.05) brightness(0.92);
  animation: drift 40s ease-in-out infinite alternate;
  transform-origin: 58% 100%;
}

@keyframes drift {
  from { transform: scale(1.02) translateY(0); }
  to   { transform: scale(1.07) translateY(-1.2%); }
}

/* darken the art behind the copy so text stays readable */
.planet::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(48% 80% at 50% 0%, rgba(5, 7, 12, 0.9), rgba(5, 7, 12, 0.45) 55%, transparent 80%);
}

/* ---------- content ---------- */

.stage {
  position: relative;
  z-index: 1;
  flex: 1;
  width: min(100% - 32px, 760px);
  margin: 0 auto;
  padding: clamp(36px, 8vh, 88px) 0 clamp(48px, 8vh, 96px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.logo {
  width: clamp(240px, 46vw, 520px);
  height: auto;
  filter:
    drop-shadow(0 0 1px rgba(255, 255, 255, 0.6))
    drop-shadow(0 0 22px rgba(255, 122, 26, 0.45))
    drop-shadow(0 0 60px rgba(255, 122, 26, 0.18));
  animation: rise 1.1s cubic-bezier(.2, .7, .2, 1) both, smolder 6s ease-in-out 1.2s infinite;
}

@keyframes smolder {
  0%, 100% { filter: drop-shadow(0 0 1px rgba(255,255,255,.6)) drop-shadow(0 0 22px rgba(255,122,26,.45)) drop-shadow(0 0 60px rgba(255,122,26,.18)); }
  50%      { filter: drop-shadow(0 0 1px rgba(255,255,255,.7)) drop-shadow(0 0 30px rgba(255,122,26,.6))  drop-shadow(0 0 90px rgba(255,122,26,.28)); }
}

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

.eyebrow {
  margin: clamp(20px, 4vh, 34px) 0 6px;
  font: 600 13px/1 var(--display);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--atmo);
  animation: rise 1s .15s cubic-bezier(.2, .7, .2, 1) both;
}
.eyebrow .sep { margin: 0 0.8em; color: var(--dim); letter-spacing: 0; }
.eyebrow [lang="ja"] { letter-spacing: 0.18em; }

.headline {
  margin: 0;
  font: 700 clamp(34px, 6.4vw, 64px)/1.05 var(--display);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-wrap: balance;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.6);
  animation: rise 1s .25s cubic-bezier(.2, .7, .2, 1) both;
}

.headline .ember {
  display: inline-block;
  background: linear-gradient(100deg, var(--ember-hot), var(--ember) 45%, var(--ember-deep) 70%, var(--ember-hot));
  background-size: 220% 100%;
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  animation: molten 7s linear infinite;
}

@keyframes molten { to { background-position: -220% 0; } }

.lede {
  max-width: 34em;
  margin: 18px 0 0;
  color: #b6c0cf;
  font-size: clamp(15px, 1.9vw, 17.5px);
  text-wrap: pretty;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9), 0 0 18px rgba(5, 7, 12, 0.95);
  animation: rise 1s .35s cubic-bezier(.2, .7, .2, 1) both;
}

/* ---------- status panel (game-HUD style) ---------- */

.status {
  --cut: 14px;
  width: min(100%, 520px);
  margin-top: clamp(26px, 5vh, 40px);
  padding: 18px 20px 14px;
  text-align: left;
  background: linear-gradient(180deg, rgba(43, 52, 68, 0.62), rgba(15, 18, 24, 0.78));
  border: 1px solid rgba(111, 211, 255, 0.16);
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  -webkit-backdrop-filter: blur(10px);
          backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: rise 1s .45s cubic-bezier(.2, .7, .2, 1) both;
}

.status-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.status h2 {
  margin: 0;
  font: 600 12px/1 var(--display);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
}

.status-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 700 12px/1 var(--display);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ember);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ember);
  box-shadow: 0 0 0 0 rgba(255, 122, 26, 0.6);
  animation: ping 1.8s ease-out infinite;
}

@keyframes ping {
  0%   { box-shadow: 0 0 0 0 rgba(255, 122, 26, 0.6); }
  80%, 100% { box-shadow: 0 0 0 9px rgba(255, 122, 26, 0); }
}

.scan {
  position: relative;
  height: 4px;
  margin: 14px 0 6px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
}
.scan span {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 38%;
  background: linear-gradient(90deg, transparent, var(--ember-deep), var(--ember-hot), transparent);
  animation: scan 2.4s cubic-bezier(.45, 0, .55, 1) infinite;
}
@keyframes scan { from { left: -40%; } to { left: 102%; } }

.steps { list-style: none; margin: 0; padding: 0; }

.steps li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 15px;
}
.steps li:first-child { border-top: 0; }

.step-name { display: inline-flex; align-items: center; gap: 10px; }
.step-name::before {
  content: "";
  width: 10px;
  height: 10px;
  flex: none;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: currentColor;
}

.chip {
  flex: none;
  padding: 4px 9px;
  font: 600 11px/1 var(--display);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border: 1px solid currentColor;
}

.steps .done   { color: var(--ink); }
.steps .done .step-name::before, .steps .done .chip { color: var(--ok); }
.steps .active .step-name::before, .steps .active .chip { color: var(--ember); }
.steps .active .chip { background: rgba(255, 122, 26, 0.1); animation: flicker 2.6s ease-in-out infinite; }
.steps .next   { color: var(--muted); }
.steps .next .step-name::before, .steps .next .chip { color: var(--dim); }

@keyframes flicker { 50% { background: rgba(255, 122, 26, 0.22); } }

/* ---------- actions ---------- */

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 26px;
  animation: rise 1s .55s cubic-bezier(.2, .7, .2, 1) both;
}

.btn {
  --cut: 10px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 24px;
  font: 700 14px/1 var(--display);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  transition: transform .2s ease, filter .2s ease, background-color .2s ease, color .2s ease;
}
.btn svg { width: 20px; height: 20px; fill: currentColor; }

.btn.primary {
  color: #1a0d03;
  background: linear-gradient(180deg, var(--ember-hot), var(--ember) 55%, var(--ember-deep));
  filter: drop-shadow(0 6px 18px rgba(255, 122, 26, 0.35));
}
.btn.primary:hover { transform: translateY(-2px); filter: drop-shadow(0 10px 26px rgba(255, 122, 26, 0.55)) brightness(1.05); }

.btn.ghost {
  color: var(--ink);
  background: rgba(10, 13, 19, 0.78);
  box-shadow: inset 0 0 0 1px rgba(111, 211, 255, 0.45);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
}
.btn.ghost:hover { transform: translateY(-2px); background: rgba(22, 34, 48, 0.9); }

.btn:focus-visible { outline: 2px solid var(--atmo); outline-offset: 4px; }

/* ---------- footer ---------- */

.foot {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 16px;
  width: min(100% - 32px, 1200px);
  margin: 0 auto;
  padding: 16px 0 calc(16px + env(safe-area-inset-bottom));
  font: 500 12px/1.4 var(--display);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(238, 242, 247, 0.62);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9);
}
.foot::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -40px -50vw 0;
  background: linear-gradient(to top, rgba(5, 7, 12, 0.88), rgba(5, 7, 12, 0.55) 55%, transparent);
}
.foot .tag { color: rgba(255, 179, 71, 0.85); }

.copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

/* ---------- pilot card (wide screens only) ---------- */

.pilot { display: none; margin: 0; }

.pilot-frame {
  --cut: 22px;
  position: relative;
  aspect-ratio: 520 / 811;
  max-height: calc(100svh - 170px);
  overflow: hidden;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  background: var(--steel);
}

.pilot-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
  filter: saturate(0.95) contrast(1.06) brightness(0.84);
}

/* hangar lighting tied into the scene: cool at the top, ember glow at the base */
.pilot-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(5, 7, 12, 0.35), transparent 28%, transparent 62%, rgba(5, 7, 12, 0.85)),
    radial-gradient(90% 40% at 50% 105%, rgba(255, 122, 26, 0.35), transparent 70%);
}

.pilot-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  clip-path: inherit;
  box-shadow: inset 0 0 0 1px rgba(111, 211, 255, 0.35), inset 0 0 40px rgba(111, 211, 255, 0.12);
}

.pilot-scan {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
}
.pilot-scan::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 18%;
  background: linear-gradient(180deg, transparent, rgba(111, 211, 255, 0.10), transparent);
  animation: sweep 6s linear infinite;
}
@keyframes sweep { from { top: -20%; } to { top: 110%; } }

.pilot figcaption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  font: 600 12px/1 var(--display);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95), 0 0 14px rgba(5, 7, 12, 0.95);
}
.pilot-id { color: var(--atmo); }
.pilot-state { color: var(--ember); }
.pilot-state::before { content: "\25CF  "; animation: flicker-text 2.6s ease-in-out infinite; }
@keyframes flicker-text { 50% { opacity: 0.35; } }

@media (min-width: 1100px) {
  .stage {
    width: min(100% - 64px, 1180px);
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: clamp(40px, 5vw, 84px);
    text-align: left;
  }
  .copy { flex: 1 1 0; max-width: 620px; align-items: flex-start; }
  .lede { max-width: 32em; }
  .status { width: 100%; max-width: 560px; }
  .actions { justify-content: flex-start; }
  .pilot {
    display: block;
    flex: 0 0 clamp(300px, 27vw, 400px);
    animation: rise 1.1s .35s cubic-bezier(.2, .7, .2, 1) both;
  }
  /* on wide screens the copy sits left, so shade the planet from the left instead of the centre */
  .planet::after {
    background:
      linear-gradient(90deg, rgba(5, 7, 12, 0.75), rgba(5, 7, 12, 0.35) 45%, transparent 70%),
      radial-gradient(60% 70% at 30% 0%, rgba(5, 7, 12, 0.85), transparent 75%);
  }
}

/* ---------- short desktop screens (laptops) ---------- */

@media (min-width: 700px) and (max-height: 960px) {
  .stage { padding-top: clamp(24px, 5vh, 48px); }
  .logo { width: clamp(240px, 34vw, 420px); }
  .eyebrow { margin-top: 18px; }
  .status { margin-top: 22px; }
  .steps li { padding: 8px 0; }
  .actions { margin-top: 20px; }
}

/* ---------- small screens ---------- */

@media (max-width: 699px) {
  .planet { height: 48vh; }
  .planet img { object-position: 62% 100%; }
  .meteor { width: 140px; left: 55%; }
  .stage { padding-bottom: 120px; }
  .status { padding: 16px 16px 12px; }
  .steps li { font-size: 14px; }
  .actions { width: 100%; }
  .btn { flex: 1 1 100%; justify-content: center; }
  .foot { justify-content: center; text-align: center; }
}

/* ---------- motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .meteor { display: none; }
  .scan span { left: 31%; }
}
