:root {
  color-scheme: dark;
  --black: #000;
  --ink: #050505;
  --ember: #b22535;
  --ember-soft: #d65b69;
  --silver: #f3eeee;
  --smoke: rgba(220, 220, 224, 0.34);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--black);
  color: var(--silver);
  font-family: "Segoe UI", Arial, sans-serif;
  overflow: hidden;
}

.scene {
  position: relative;
  display: grid;
  min-height: 100svh;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 58%, rgba(161, 27, 43, 0.28), transparent 23rem),
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.06), transparent 18rem),
    linear-gradient(180deg, #000 0%, #050203 54%, #000 100%);
}

.scene::before {
  position: absolute;
  inset: 0;
  z-index: 1;
  content: "";
  pointer-events: none;
  background-image:
    repeating-radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 7px),
    linear-gradient(110deg, transparent 0 46%, rgba(178, 37, 53, 0.08) 50%, transparent 54% 100%);
  mix-blend-mode: screen;
  opacity: 0.28;
}

.sky {
  position: absolute;
  inset: -10%;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0 38%, rgba(176, 38, 54, 0.16) 39%, transparent 42% 100%),
    linear-gradient(240deg, transparent 0 54%, rgba(255, 255, 255, 0.08) 55%, transparent 57% 100%);
  filter: blur(18px);
  opacity: 0;
  animation: skyPulse 8s ease-in-out 3s infinite;
}

.brand {
  position: relative;
  z-index: 5;
  display: grid;
  width: min(88vw, 560px);
  place-items: center;
  padding: clamp(20px, 5vw, 42px) 0;
  text-align: center;
  opacity: 0;
  transform: translateY(18px) scale(0.82);
  animation: brandEnter 980ms cubic-bezier(0.16, 1, 0.3, 1) 2.72s forwards;
}

.logo-shell {
  position: relative;
  width: clamp(230px, 48vw, 420px);
  aspect-ratio: 1;
  animation: logoFloat 6s ease-in-out 3.9s infinite;
}

.logo-shell::before {
  position: absolute;
  inset: 4%;
  z-index: -1;
  content: "";
  border: 1px solid rgba(230, 75, 88, 0.28);
  border-radius: 50%;
  transform: scale(0.68);
  opacity: 0;
  box-shadow:
    0 0 34px rgba(215, 47, 63, 0.35),
    inset 0 0 42px rgba(215, 47, 63, 0.18);
  animation: haloWake 1.4s ease-out 2.9s forwards, haloPulse 3.8s ease-in-out 4.2s infinite;
}

.logo-shell::after {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: 134%;
  height: 2px;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), rgba(210, 40, 56, 0.95), transparent);
  filter: blur(0.5px);
  opacity: 0;
  transform: translate(-50%, -50%) scaleX(0);
  animation: scanStrike 520ms ease-out 2.66s forwards;
}

.logo-shell img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: screen;
  filter:
    drop-shadow(0 0 14px rgba(245, 245, 245, 0.18))
    drop-shadow(0 0 34px rgba(184, 31, 49, 0.46));
}

.coming {
  margin: clamp(8px, 2vw, 16px) 0 0;
  color: #fff7f7;
  font-size: clamp(1.05rem, 2.8vw, 2rem);
  font-weight: 500;
  line-height: 1.18;
  letter-spacing: 0;
  text-shadow:
    0 0 10px rgba(255, 255, 255, 0.18),
    0 0 22px rgba(212, 44, 60, 0.7),
    0 2px 0 rgba(0, 0, 0, 0.95);
  animation: textCharge 4.2s ease-in-out 3.55s infinite;
}

.signal {
  width: min(56vw, 330px);
  height: 16px;
  margin-top: clamp(10px, 2vw, 18px);
  background:
    linear-gradient(90deg, transparent, var(--ember-soft), transparent) top / 100% 1px no-repeat,
    linear-gradient(90deg, transparent 0 12%, rgba(213, 69, 80, 0.95) 12% 42%, transparent 42% 58%, rgba(213, 69, 80, 0.95) 58% 88%, transparent 88% 100%) bottom / 100% 2px no-repeat;
  filter: drop-shadow(0 0 8px rgba(210, 45, 62, 0.75));
  clip-path: polygon(0 0, 47% 0, 50% 100%, 53% 0, 100% 0, 100% 100%, 0 100%);
  opacity: 0.86;
}

.smoke {
  position: absolute;
  left: 50%;
  top: 56%;
  z-index: 9;
  width: min(86vw, 720px);
  height: min(68vh, 620px);
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0;
  transform: translate(-50%, -50%);
  animation: smokeWake 400ms ease-out 560ms forwards;
}

.smoke span {
  position: absolute;
  left: calc(50% + var(--x));
  bottom: var(--bottom);
  width: calc(92px * var(--size));
  height: calc(86px * var(--size));
  border-radius: 999px;
  background:
    radial-gradient(circle at 38% 42%, rgba(255, 255, 255, 0.44), transparent 30%),
    radial-gradient(circle at 58% 50%, var(--smoke), transparent 58%),
    radial-gradient(circle at 45% 68%, rgba(135, 38, 48, 0.18), transparent 62%);
  filter: blur(calc(14px * var(--blur)));
  opacity: 0;
  transform: translate(-50%, 80px) scale(0.46) rotate(0deg);
  animation: riseSmoke var(--duration) cubic-bezier(0.22, 0.62, 0.24, 1) var(--delay) infinite;
}

.smoke span:nth-child(1) {
  --x: -92px;
  --bottom: 7%;
  --size: 1.22;
  --blur: 1.2;
  --drift: -78px;
  --turn: -18deg;
  --duration: 7.4s;
  --delay: 0.1s;
}

.smoke span:nth-child(2) {
  --x: 88px;
  --bottom: 6%;
  --size: 1.05;
  --blur: 1.35;
  --drift: 86px;
  --turn: 20deg;
  --duration: 7.9s;
  --delay: 0.28s;
}

.smoke span:nth-child(3) {
  --x: -34px;
  --bottom: 9%;
  --size: 1.5;
  --blur: 1.5;
  --drift: -28px;
  --turn: 11deg;
  --duration: 8.2s;
  --delay: 0.62s;
}

.smoke span:nth-child(4) {
  --x: 28px;
  --bottom: 2%;
  --size: 1.7;
  --blur: 1.65;
  --drift: 42px;
  --turn: -14deg;
  --duration: 8.8s;
  --delay: 0.88s;
}

.smoke span:nth-child(5) {
  --x: -145px;
  --bottom: 14%;
  --size: 0.92;
  --blur: 1.15;
  --drift: -112px;
  --turn: 28deg;
  --duration: 7.2s;
  --delay: 1.2s;
}

.smoke span:nth-child(6) {
  --x: 142px;
  --bottom: 15%;
  --size: 0.94;
  --blur: 1.18;
  --drift: 104px;
  --turn: -26deg;
  --duration: 7.6s;
  --delay: 1.42s;
}

.smoke span:nth-child(7) {
  --x: -8px;
  --bottom: 20%;
  --size: 1.36;
  --blur: 1.45;
  --drift: -54px;
  --turn: 21deg;
  --duration: 9.4s;
  --delay: 1.78s;
}

.smoke span:nth-child(8) {
  --x: 64px;
  --bottom: 22%;
  --size: 1.18;
  --blur: 1.38;
  --drift: 74px;
  --turn: -22deg;
  --duration: 8.9s;
  --delay: 2.05s;
}

.smoke span:nth-child(9) {
  --x: -64px;
  --bottom: 25%;
  --size: 1.08;
  --blur: 1.24;
  --drift: -88px;
  --turn: 17deg;
  --duration: 8.1s;
  --delay: 2.34s;
}

.smoke span:nth-child(10) {
  --x: 12px;
  --bottom: 0%;
  --size: 2.1;
  --blur: 1.8;
  --drift: 18px;
  --turn: -9deg;
  --duration: 10.2s;
  --delay: 2.72s;
}

.gate {
  position: fixed;
  inset: 0;
  z-index: 8;
  overflow: hidden;
  pointer-events: none;
  animation: gateDone 1ms linear 3s forwards;
}

.gate::before,
.gate::after {
  position: absolute;
  top: 0;
  width: 50.5%;
  height: 100%;
  content: "";
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.018), transparent 22% 78%, rgba(211, 39, 56, 0.08)),
    #000;
  box-shadow: inset 0 0 58px rgba(178, 37, 53, 0.16);
  animation-duration: 760ms;
  animation-delay: 2.18s;
  animation-timing-function: cubic-bezier(0.76, 0, 0.24, 1);
  animation-fill-mode: forwards;
}

.gate::before {
  left: 0;
  transform-origin: left center;
  animation-name: openLeft;
}

.gate::after {
  right: 0;
  transform-origin: right center;
  animation-name: openRight;
}

.cutline {
  position: absolute;
  left: 50%;
  top: 0;
  z-index: 2;
  width: 2px;
  height: 100%;
  background: linear-gradient(180deg, transparent, #fff 16%, var(--ember-soft) 48%, #fff 72%, transparent);
  box-shadow:
    0 0 18px rgba(255, 255, 255, 0.78),
    0 0 34px rgba(220, 44, 60, 0.8);
  opacity: 0;
  transform: translateX(-50%) scaleY(0);
  animation: cutlineBurn 880ms ease-out 1.35s forwards, cutlineBlast 260ms steps(2, end) 2.17s forwards;
}

.impact-flash {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  background:
    radial-gradient(circle at var(--flash-x, 50%) 18%, rgba(255, 255, 255, 0.92), transparent 18rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), transparent 50%);
  opacity: 0;
  mix-blend-mode: screen;
}

.scene.thunder .impact-flash {
  animation: flashHit 560ms steps(2, end);
}

.scene.thunder .logo-shell {
  filter: brightness(1.45) saturate(1.25);
}

.lightning-layer {
  position: absolute;
  inset: 0;
  z-index: 7;
  overflow: hidden;
  pointer-events: none;
}

.lightning-strike {
  position: absolute;
  top: -2vh;
  width: 1px;
  height: 78vh;
  opacity: 0;
  transform-origin: top center;
  filter:
    drop-shadow(0 0 8px rgba(255, 255, 255, 0.96))
    drop-shadow(0 0 22px rgba(210, 45, 62, 0.95));
  animation: lightningLive 720ms steps(2, end) forwards;
}

.lightning-strike span {
  position: absolute;
  display: block;
  width: clamp(2px, 0.45vw, 5px);
  border-radius: 999px;
  background: linear-gradient(180deg, #fff 0%, #eaf7ff 26%, #e04758 78%, transparent 100%);
  transform-origin: top center;
}

.lightning-strike span::after {
  position: absolute;
  inset: -1px;
  content: "";
  border-radius: inherit;
  background: inherit;
  filter: blur(5px);
  opacity: 0.7;
}

.lightning-strike .fork {
  width: clamp(1px, 0.28vw, 3px);
  opacity: 0.78;
}

@keyframes brandEnter {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.82);
    filter: blur(8px);
  }
  58% {
    opacity: 1;
    transform: translateY(-4px) scale(1.04);
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes haloWake {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes haloPulse {
  0%,
  100% {
    box-shadow:
      0 0 30px rgba(215, 47, 63, 0.28),
      inset 0 0 36px rgba(215, 47, 63, 0.14);
  }
  50% {
    box-shadow:
      0 0 52px rgba(255, 255, 255, 0.18),
      0 0 64px rgba(215, 47, 63, 0.42),
      inset 0 0 52px rgba(215, 47, 63, 0.22);
  }
}

@keyframes logoFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes scanStrike {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scaleX(0);
  }
  26% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scaleX(1);
  }
}

@keyframes textCharge {
  0%,
  100% {
    opacity: 0.88;
    text-shadow:
      0 0 10px rgba(255, 255, 255, 0.18),
      0 0 20px rgba(212, 44, 60, 0.62),
      0 2px 0 rgba(0, 0, 0, 0.95);
  }
  50% {
    opacity: 1;
    text-shadow:
      0 0 14px rgba(255, 255, 255, 0.32),
      0 0 34px rgba(232, 64, 80, 0.95),
      0 2px 0 rgba(0, 0, 0, 0.95);
  }
}

@keyframes smokeWake {
  to {
    opacity: 1;
  }
}

@keyframes riseSmoke {
  0% {
    opacity: 0;
    transform: translate(-50%, 86px) scale(0.38) rotate(0deg);
  }
  16% {
    opacity: 0.44;
  }
  54% {
    opacity: 0.25;
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--drift)), -380px) scale(1.9) rotate(var(--turn));
  }
}

@keyframes openLeft {
  0% {
    transform: translateX(0);
  }
  32% {
    transform: translateX(-5%);
  }
  100% {
    transform: translateX(-112%);
  }
}

@keyframes openRight {
  0% {
    transform: translateX(0);
  }
  32% {
    transform: translateX(5%);
  }
  100% {
    transform: translateX(112%);
  }
}

@keyframes cutlineBurn {
  0% {
    opacity: 0;
    transform: translateX(-50%) scaleY(0);
  }
  30% {
    opacity: 1;
  }
  100% {
    opacity: 0.88;
    transform: translateX(-50%) scaleY(1);
  }
}

@keyframes cutlineBlast {
  to {
    opacity: 0;
    width: 18px;
  }
}

@keyframes gateDone {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

@keyframes lightningLive {
  0% {
    opacity: 0;
  }
  12%,
  30% {
    opacity: 1;
  }
  18%,
  44% {
    opacity: 0.16;
  }
  52% {
    opacity: 0.95;
  }
  100% {
    opacity: 0;
  }
}

@keyframes flashHit {
  0% {
    opacity: 0;
  }
  12%,
  25% {
    opacity: 0.65;
  }
  18%,
  44% {
    opacity: 0.12;
  }
  100% {
    opacity: 0;
  }
}

@keyframes skyPulse {
  0%,
  100% {
    opacity: 0.08;
  }
  50% {
    opacity: 0.22;
  }
}

@media (max-width: 560px) {
  .brand {
    width: min(92vw, 440px);
    padding-bottom: 10svh;
  }

  .coming {
    max-width: 14ch;
  }

  .smoke {
    top: 58%;
    height: 70vh;
  }
}

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

  .gate {
    display: none;
  }

  .brand,
  .smoke {
    opacity: 1;
    transform: none;
  }
}
