body {
  min-height: 100vh;
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at 20% 20%, rgba(63, 146, 255, 0.28), transparent 24%),
    radial-gradient(circle at 80% 10%, rgba(255, 221, 77, 0.12), transparent 22%),
    linear-gradient(135deg, #050713 0%, #121629 45%, #050713 100%);
  color: #f8e86a;
  text-align: center;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(#ffffff 1px, transparent 1px),
    radial-gradient(#9ec8ff 1px, transparent 1px);
  background-position: 0 0, 38px 62px;
  background-size: 82px 82px, 118px 118px;
  opacity: 0.35;
  pointer-events: none;
  animation: star-drift 18s linear infinite;
}

body::after {
  content: "";
  position: fixed;
  inset: -80px;
  background:
    linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.18) 50%, transparent 100%);
  opacity: 0;
  transform: translateX(-120%) rotate(-18deg);
  pointer-events: none;
  animation: hyperspace-flash 7s ease-in-out infinite;
}

.galaxy {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px 20px;
}

.cinematic-intro {
  width: min(980px, 100%);
  height: clamp(260px, 42vw, 430px);
  margin: 0 auto 28px;
  border: 2px solid rgba(75, 160, 255, 0.55);
  border-radius: 8px;
  background:
    radial-gradient(circle at 78% 18%, rgba(248, 232, 106, 0.22), transparent 18%),
    radial-gradient(circle at 18% 82%, rgba(75, 160, 255, 0.22), transparent 20%),
    linear-gradient(180deg, rgba(3, 7, 20, 0.4), rgba(3, 7, 20, 0.92));
  box-shadow:
    0 0 30px rgba(75, 160, 255, 0.42),
    inset 0 0 40px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  animation: scene-fade 5.8s ease-in-out both;
}

.space-battle {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.planet {
  position: absolute;
  right: -70px;
  top: -90px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 30%, #fff3a2, #c26a36 36%, #43142a 68%);
  box-shadow: 0 0 46px rgba(248, 232, 106, 0.38);
  opacity: 0.62;
}

.ship {
  position: absolute;
  width: 0;
  height: 0;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  border-left: 42px solid #d8e7ff;
  filter: drop-shadow(0 0 10px rgba(75, 160, 255, 0.9));
}

.ship::after {
  content: "";
  position: absolute;
  left: -54px;
  top: -4px;
  width: 20px;
  height: 8px;
  background: #4ba0ff;
  box-shadow: 0 0 14px #4ba0ff;
}

.ship-one {
  top: 18%;
  left: -80px;
  animation: ship-pass-one 4.8s ease-in-out both;
}

.ship-two {
  top: 34%;
  right: -80px;
  transform: rotate(180deg);
  animation: ship-pass-two 4.6s ease-in-out 450ms both;
}

.laser {
  position: absolute;
  width: 170px;
  height: 3px;
  border-radius: 999px;
  opacity: 0;
}

.laser-one {
  top: 24%;
  left: 8%;
  background: #ff334f;
  box-shadow: 0 0 14px #ff334f;
  --laser-angle: 12deg;
  transform: rotate(var(--laser-angle));
  animation: laser-shot 850ms linear 900ms 5;
}

.laser-two {
  top: 31%;
  right: 12%;
  background: #4ba0ff;
  box-shadow: 0 0 14px #4ba0ff;
  --laser-angle: 164deg;
  transform: rotate(var(--laser-angle));
  animation: laser-shot 780ms linear 1.2s 5;
}

.laser-three {
  top: 45%;
  left: 38%;
  width: 230px;
  background: #f8e86a;
  box-shadow: 0 0 16px #f8e86a;
  --laser-angle: -8deg;
  transform: rotate(var(--laser-angle));
  animation: laser-shot 700ms linear 2s 4;
}

.battlefield {
  position: absolute;
  inset: auto 0 0;
  height: 54%;
  background:
    linear-gradient(180deg, transparent, rgba(3, 7, 20, 0.86) 58%),
    linear-gradient(90deg, rgba(75, 160, 255, 0.14), rgba(248, 232, 106, 0.12));
}

.soldier,
.warrior {
  position: absolute;
  bottom: 18px;
  width: 42px;
  height: 86px;
  border-radius: 18px 18px 8px 8px;
  background: linear-gradient(180deg, #d8e7ff, #3f5f85 45%, #111827);
  box-shadow: 0 0 18px rgba(216, 231, 255, 0.36);
}

.soldier::before,
.warrior::before {
  content: "";
  position: absolute;
  left: 9px;
  bottom: -18px;
  width: 8px;
  height: 24px;
  background: #121827;
  box-shadow: 16px 0 0 #121827;
}

.helmet,
.hood {
  position: absolute;
  left: 6px;
  top: -24px;
  width: 30px;
  height: 30px;
  border-radius: 50% 50% 42% 42%;
  background: #eef4ff;
  box-shadow: inset 0 -8px 0 #26364e;
}

.rifle {
  position: absolute;
  right: -48px;
  top: 28px;
  width: 66px;
  height: 6px;
  border-radius: 999px;
  background: #121827;
  transform: rotate(-10deg);
  transform-origin: left center;
}

.rifle::after {
  content: "";
  position: absolute;
  right: -24px;
  top: 1px;
  width: 24px;
  height: 3px;
  background: #ff334f;
  box-shadow: 0 0 12px #ff334f;
  animation: muzzle-flash 600ms linear 900ms 7;
}

.soldier-one {
  left: 14%;
  animation: soldier-charge 4.8s ease-in-out both;
}

.soldier-two {
  left: 25%;
  transform: scale(0.9);
  animation: soldier-charge 4.8s ease-in-out 260ms both;
}

.warrior {
  background: linear-gradient(180deg, #171b2a, #090b16);
  box-shadow: 0 0 18px rgba(248, 232, 106, 0.25);
}

.hood {
  background: #0a1020;
  box-shadow: inset 0 -8px 0 #26364e;
}

.energy-sword {
  position: absolute;
  left: -16px;
  top: 16px;
  width: 9px;
  height: 104px;
  border-radius: 999px;
  transform-origin: bottom center;
}

.sword-blue {
  background: #73d8ff;
  box-shadow: 0 0 16px #73d8ff, 0 0 28px #4ba0ff;
}

.sword-red {
  background: #ff334f;
  box-shadow: 0 0 16px #ff334f, 0 0 28px #ff334f;
}

.warrior-one {
  right: 26%;
  animation: warrior-duel-one 4.8s ease-in-out both;
}

.warrior-one .energy-sword {
  transform: rotate(48deg);
  animation: sword-swing-one 1.2s ease-in-out 1s 3;
}

.warrior-two {
  right: 13%;
  transform: scale(0.92);
  animation: warrior-duel-two 4.8s ease-in-out 320ms both;
}

.warrior-two .energy-sword {
  left: 40px;
  transform: rotate(-46deg);
  animation: sword-swing-two 1.1s ease-in-out 1.15s 3;
}

.impact {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  opacity: 0;
  background: #ffffff;
  box-shadow: 0 0 24px #f8e86a, 0 0 46px #4ba0ff;
}

.impact-one {
  left: 57%;
  top: 40%;
  animation: impact-burst 700ms ease-out 1.4s 4;
}

.impact-two {
  left: 70%;
  top: 48%;
  animation: impact-burst 680ms ease-out 2.2s 3;
}

.hero {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: minmax(240px, 340px) 1fr;
  gap: 42px;
  align-items: center;
  animation: hero-arrive 900ms ease-out both;
}

.portrait-card {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 5;
  min-height: 360px;
  border: 2px solid rgba(248, 232, 106, 0.75);
  border-radius: 8px;
  background: rgba(4, 8, 20, 0.72);
  box-shadow:
    0 0 24px rgba(75, 160, 255, 0.5),
    inset 0 0 28px rgba(248, 232, 106, 0.12);
  overflow: hidden;
  animation: force-glow 3.6s ease-in-out infinite;
}

.profile-photo {
  width: 100%;
  height: 100%;
  min-height: 360px;
  object-fit: cover;
}

.profile-photo.missing-photo {
  display: none;
}

.photo-fallback {
  position: absolute;
  color: #d8e7ff;
  font-size: 1rem;
  line-height: 1.6;
  letter-spacing: 0;
}

.profile-photo:not(.missing-photo) + .photo-fallback {
  display: none;
}

.photo-fallback strong {
  color: #f8e86a;
}

.intro {
  padding: 30px;
  border-left: 3px solid #4ba0ff;
  text-align: left;
  text-shadow: 0 0 14px rgba(248, 232, 106, 0.4);
}

.episode {
  margin: 0 0 8px;
  color: #4ba0ff;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 18px;
  color: #f8e86a;
  font-size: clamp(2.2rem, 8vw, 5rem);
  line-height: 0.95;
  letter-spacing: 0;
  text-transform: uppercase;
}

p {
  max-width: 620px;
  color: #eef4ff;
  font-size: 1.08rem;
  line-height: 1.7;
}

.crawl-text {
  color: #f8e86a;
  font-weight: 700;
  animation: crawl-pulse 2.8s ease-in-out infinite;
}

[data-assemble] {
  display: block;
}

.assemble-letter {
  display: inline-block;
  opacity: 0;
  animation: letter-assemble 900ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  will-change: opacity, transform, filter;
}

.fly-0 {
  --fly-x: -180px;
  --fly-y: -120px;
  --fly-rotate: -28deg;
}

.fly-1 {
  --fly-x: 170px;
  --fly-y: -95px;
  --fly-rotate: 24deg;
}

.fly-2 {
  --fly-x: -140px;
  --fly-y: 110px;
  --fly-rotate: 20deg;
}

.fly-3 {
  --fly-x: 190px;
  --fly-y: 120px;
  --fly-rotate: -24deg;
}

.fixed-letter {
  opacity: 1;
  animation: none;
  transform: none;
  filter: none;
}

button {
  margin-top: 18px;
  background: #f8e86a;
  color: #090b16;
  border: 2px solid #fff6a6;
  border-radius: 8px;
  padding: 14px 22px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 0 18px rgba(248, 232, 106, 0.55);
}

button:hover {
  background: #ffffff;
  box-shadow: 0 0 28px rgba(75, 160, 255, 0.85);
  transform: translateY(-2px);
}

@keyframes star-drift {
  from {
    background-position: 0 0, 38px 62px;
  }

  to {
    background-position: 82px 164px, 156px 298px;
  }
}

@keyframes hyperspace-flash {
  0%, 72%, 100% {
    opacity: 0;
    transform: translateX(-120%) rotate(-18deg);
  }

  78% {
    opacity: 0.5;
  }

  86% {
    opacity: 0;
    transform: translateX(120%) rotate(-18deg);
  }
}

@keyframes scene-fade {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }

  12%, 78% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  100% {
    opacity: 0.2;
    transform: translateY(-12px) scale(0.96);
  }
}

@keyframes ship-pass-one {
  0% {
    transform: translateX(0) translateY(16px);
  }

  100% {
    transform: translateX(1120px) translateY(-40px);
  }
}

@keyframes ship-pass-two {
  0% {
    transform: rotate(180deg) translateX(0) translateY(-8px);
  }

  100% {
    transform: rotate(180deg) translateX(1120px) translateY(38px);
  }
}

@keyframes laser-shot {
  0% {
    opacity: 0;
    transform: translateX(-30px) rotate(var(--laser-angle, 12deg)) scaleX(0.2);
  }

  15%, 65% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translateX(180px) rotate(var(--laser-angle, 12deg)) scaleX(1);
  }
}

@keyframes soldier-charge {
  0% {
    transform: translateX(-70px) scale(0.94);
  }

  45% {
    transform: translateX(34px) scale(1);
  }

  100% {
    transform: translateX(52px) scale(0.98);
  }
}

@keyframes warrior-duel-one {
  0% {
    transform: translateX(80px);
  }

  45%, 100% {
    transform: translateX(-42px);
  }
}

@keyframes warrior-duel-two {
  0% {
    transform: translateX(74px) scale(0.92);
  }

  45%, 100% {
    transform: translateX(-30px) scale(0.92);
  }
}

@keyframes sword-swing-one {
  0%, 100% {
    transform: rotate(48deg);
  }

  50% {
    transform: rotate(102deg);
  }
}

@keyframes sword-swing-two {
  0%, 100% {
    transform: rotate(-46deg);
  }

  50% {
    transform: rotate(-96deg);
  }
}

@keyframes muzzle-flash {
  0%, 100% {
    opacity: 0;
    transform: scaleX(0.2);
  }

  35% {
    opacity: 1;
    transform: scaleX(1.3);
  }
}

@keyframes impact-burst {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }

  35% {
    opacity: 1;
    transform: scale(1.8);
  }

  100% {
    opacity: 0;
    transform: scale(3.4);
  }
}

@keyframes hero-arrive {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes force-glow {
  0%, 100% {
    box-shadow:
      0 0 20px rgba(75, 160, 255, 0.42),
      inset 0 0 28px rgba(248, 232, 106, 0.12);
  }

  50% {
    box-shadow:
      0 0 34px rgba(248, 232, 106, 0.58),
      inset 0 0 34px rgba(75, 160, 255, 0.16);
  }
}

@keyframes title-rise {
  from {
    opacity: 0;
    transform: perspective(500px) rotateX(24deg) translateY(24px);
  }

  to {
    opacity: 1;
    transform: perspective(500px) rotateX(0) translateY(0);
  }
}

@keyframes letter-assemble {
  0% {
    opacity: 0;
    filter: blur(10px);
    transform:
      translate(var(--fly-x), var(--fly-y))
      rotate(var(--fly-rotate))
      scale(1.8);
  }

  70% {
    opacity: 1;
    filter: blur(1px);
    transform: translate(0, 0) rotate(0) scale(1.05);
  }

  100% {
    opacity: 1;
    filter: blur(0);
    transform: translate(0, 0) rotate(0) scale(1);
  }
}

@keyframes crawl-pulse {
  0%, 100% {
    text-shadow: 0 0 8px rgba(248, 232, 106, 0.25);
  }

  50% {
    text-shadow: 0 0 18px rgba(248, 232, 106, 0.75);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 760px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .intro {
    padding: 24px 0 0;
    border-left: 0;
    border-top: 3px solid #4ba0ff;
    text-align: center;
  }

  p {
    margin-left: auto;
    margin-right: auto;
  }
}
