:root {
  color-scheme: dark;
  --logo-size: clamp(64px, 9.6vw, 112px);
  --logo-left: clamp(18px, 3.7vw, 54px);
  --logo-top: clamp(16px, 3.6vw, 46px);
  --letter-size: clamp(42px, 8.4vw, 96px);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: #03040b;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

.stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-height: 520px;
  overflow: hidden;
  background:
    radial-gradient(circle at 72% 18%, rgba(57, 85, 143, 0.13), transparent 31%),
    radial-gradient(circle at 18% 80%, rgba(82, 45, 86, 0.09), transparent 34%),
    linear-gradient(145deg, #01030a 0%, #050815 48%, #010207 100%);
  isolation: isolate;
  transition: background 900ms ease;
}

.stage.clean {
  background:
    radial-gradient(circle at 72% 18%, rgba(80, 123, 190, 0.22), transparent 28%),
    radial-gradient(circle at 18% 74%, rgba(182, 65, 101, 0.14), transparent 30%),
    linear-gradient(145deg, #02030a 0%, #090a19 46%, #03040b 100%);
}

#stars,
#burstCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#stars {
  z-index: 1;
  opacity: 0.86;
  transition: opacity 900ms ease;
}

.stage.clean #stars {
  opacity: 1;
}

#burstCanvas {
  z-index: 7;
  pointer-events: none;
}

.nebula {
  position: absolute;
  inset: -20%;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 58% 46%, rgba(75, 126, 189, 0.18), transparent 35%),
    radial-gradient(ellipse at 35% 38%, rgba(232, 122, 90, 0.11), transparent 28%);
  filter: blur(18px);
  opacity: 0;
  transition: opacity 900ms ease;
}

.stage.clean .nebula {
  opacity: 0.65;
}

.black-hole {
  position: absolute;
  left: 50%;
  top: 52%;
  width: clamp(270px, 36vw, 520px);
  aspect-ratio: 1;
  z-index: 4;
  transform: translate(-50%, -50%);
  filter: none;
  opacity: 1;
  pointer-events: none;
  transition:
    opacity 700ms ease,
    transform 700ms ease,
    filter 700ms ease;
}

.black-hole.vanish {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.82);
  filter: blur(10px) drop-shadow(0 0 0 transparent);
}

.black-hole::before,
.black-hole::after {
  position: absolute;
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.black-hole::before {
  display: none;
}

.black-hole::after {
  display: none;
}

.black-hole-art {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: 132%;
  height: 132%;
  object-fit: cover;
  opacity: 1;
  transform: translate(-50%, -50%) rotate(-4deg) scale(1.02);
  filter: contrast(1.08) saturate(1.08);
  -webkit-mask-image: radial-gradient(ellipse at 50% 52%, #000 0 58%, rgba(0, 0, 0, 0.92) 73%, transparent 91%);
  mask-image: radial-gradient(ellipse at 50% 52%, #000 0 58%, rgba(0, 0, 0, 0.92) 73%, transparent 91%);
  animation: blackHoleFloat 7s ease-in-out infinite alternate;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-user-select: none;
}

.letters {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}

.letter {
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  width: calc(var(--letter-size) * 1.05);
  height: calc(var(--letter-size) * 1.05);
  place-items: center;
  opacity: 0;
  transform: translate3d(-50%, -50%, 0);
  color: #f7fbff;
  font-size: var(--letter-size);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  text-shadow:
    0 0 7px rgba(255, 255, 255, 0.95),
    0 0 24px rgba(84, 164, 255, 0.74),
    0 0 48px rgba(255, 167, 82, 0.36);
  will-change: transform, opacity, filter;
}

.letter::after {
  position: absolute;
  inset: -22%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(78, 160, 255, 0.26), transparent 67%);
  content: "";
  opacity: 0.8;
}

.constellation,
.constellation-lines {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(88vw, calc(78vh * 1.9), 1120px);
  aspect-ratio: 1.9;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, -50%) translateY(14px) scale(0.96);
  transition:
    opacity 900ms ease 360ms,
    transform 900ms cubic-bezier(0.18, 0.8, 0.2, 1) 360ms;
}

.constellation {
  z-index: 5;
}

.constellation-lines {
  z-index: 4;
  overflow: visible;
  filter:
    drop-shadow(0 0 5px rgba(153, 210, 255, 0.54))
    drop-shadow(0 0 12px rgba(255, 255, 255, 0.16));
}

.stage.clean .constellation,
.stage.clean .constellation-lines {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.constellation-lines polyline {
  fill: none;
  stroke: rgba(188, 224, 255, 0.42);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4.8px;
  vector-effect: non-scaling-stroke;
}

.constellation-star {
  position: absolute;
  width: var(--size);
  height: var(--size);
  object-fit: contain;
  pointer-events: auto;
  transform: translate(-50%, -50%) rotate(0deg) scale(1);
  user-select: none;
  -webkit-user-drag: none;
  -webkit-user-select: none;
  transition:
    transform 260ms cubic-bezier(0.18, 0.8, 0.2, 1),
    filter 260ms ease;
  filter:
    drop-shadow(0 0 10px rgba(255, 255, 255, 0.88))
    drop-shadow(0 0 22px rgba(121, 187, 255, 0.48));
}

.constellation-star:hover {
  transform: translate(-50%, -50%) rotate(var(--hover-rotate)) scale(1.24);
  filter:
    drop-shadow(0 0 14px rgba(255, 255, 255, 0.95))
    drop-shadow(0 0 34px rgba(121, 187, 255, 0.64));
}

.star-one {
  left: 8%;
  top: 66.5%;
  --size: clamp(52px, 7.4vw, 124px);
  --hover-rotate: -9deg;
}

.star-two {
  left: 28%;
  top: 39.5%;
  --size: clamp(48px, 6.8vw, 112px);
  --hover-rotate: 8deg;
}

.star-three {
  left: 49%;
  top: 61.5%;
  --size: clamp(56px, 7.8vw, 132px);
  --hover-rotate: -7deg;
}

.star-four {
  left: 70%;
  top: 33.5%;
  --size: clamp(50px, 7vw, 118px);
  --hover-rotate: 9deg;
}

.star-five {
  left: 92%;
  top: 51.5%;
  --size: clamp(54px, 7.6vw, 128px);
  --hover-rotate: -8deg;
}

.final-logo {
  position: absolute;
  left: var(--logo-left);
  top: var(--logo-top);
  z-index: 8;
  width: var(--logo-size);
  height: var(--logo-size);
  object-fit: contain;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate3d(0, 0, 0) scale(0.72);
  filter: drop-shadow(0 0 0 rgba(255, 255, 255, 0));
  user-select: none;
  -webkit-user-drag: none;
  -webkit-user-select: none;
  transition:
    opacity 500ms ease,
    transform 640ms cubic-bezier(0.18, 0.8, 0.2, 1),
    filter 640ms ease;
}

.final-logo.show {
  opacity: 1;
  visibility: visible;
  transform: translate3d(0, 0, 0) scale(1);
  filter:
    drop-shadow(0 0 12px rgba(255, 255, 255, 0.8))
    drop-shadow(0 0 32px rgba(92, 168, 255, 0.45));
}

.logo-burst {
  position: absolute;
  left: calc(var(--logo-left) + (var(--logo-size) / 2));
  top: calc(var(--logo-top) + (var(--logo-size) / 2));
  z-index: 7;
  width: clamp(128px, 18vw, 248px);
  height: clamp(128px, 18vw, 248px);
  pointer-events: none;
  border-radius: 50%;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.08);
  background:
    radial-gradient(circle, #fff 0 6%, rgba(197, 232, 255, 0.92) 18%, rgba(255, 190, 94, 0.34) 38%, transparent 72%);
  box-shadow:
    0 0 26px 8px rgba(255, 255, 255, 0.7),
    0 0 58px 18px rgba(106, 173, 255, 0.32);
  filter: blur(0.2px);
}

.logo-burst.flash {
  animation: flash 980ms cubic-bezier(0.16, 0.74, 0.24, 1) forwards;
}

@keyframes blackHoleFloat {
  to {
    transform: translate(-50%, -50%) rotate(-2deg) scale(1.055);
  }
}

@keyframes flash {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.08);
  }

  16% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.32);
  }

  54% {
    opacity: 0.58;
    transform: translate(-50%, -50%) scale(0.9);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.34);
  }
}

@media (max-width: 640px) {
  :root {
    --logo-size: clamp(58px, 16vw, 82px);
    --logo-left: 16px;
    --logo-top: 16px;
    --letter-size: clamp(34px, 12vw, 64px);
  }

  .stage {
    min-height: 100svh;
  }

  .black-hole {
    top: 55%;
    width: min(88vw, 380px);
  }

  .constellation,
  .constellation-lines {
    left: 50%;
    top: 50%;
    width: min(94vw, calc(76svh * 0.82));
    aspect-ratio: 0.82;
  }

  .constellation-lines polyline {
    stroke-width: 4.2px;
  }

  .star-one {
    --size: clamp(58px, 17vw, 82px);
  }

  .star-two {
    --size: clamp(54px, 15.5vw, 76px);
  }

  .star-three {
    --size: clamp(62px, 18vw, 88px);
  }

  .star-four {
    --size: clamp(56px, 16vw, 80px);
  }

  .star-five {
    --size: clamp(60px, 17.5vw, 86px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .black-hole,
  .black-hole-art {
    animation-duration: 18s;
  }

  .final-logo {
    transition-duration: 240ms;
  }
}
