/* =========================================================
   DIMMING
   ========================================================= */

.constellation-dim {
  position: absolute;
  inset: 0;
  z-index: 3;

  background: rgba(2, 6, 18, 0);
  pointer-events: none;

  transition: background 500ms ease;
}

.landing.constellation-active .constellation-dim {
  background: rgba(2, 6, 18, 0.48);
}


/* =========================================================
   FOOT SHADOW
   ========================================================= */

.foot-shadow {
  position: absolute;

  left: 30%;
  bottom: -0.15%;

  width: 300px;
  height: 24px;

  z-index: 1;
  pointer-events: none;

  background: rgba(0, 0, 0, 0.62);
  border-radius: 50%;
  filter: blur(10px);

  transform: rotate(-3deg);
  transform-origin: right center;

  transition:
    opacity 500ms ease,
    transform 500ms ease;
}

.landing.constellation-active .foot-shadow {
  opacity: 0.48;
  transform: rotate(-3deg) scale(0.92);
}


/* =========================================================
   FIGURE LEVITATION
   ========================================================= */

@keyframes constellationLevitate {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }

  50% {
    transform: translateX(-50%) translateY(-32px);
  }
}

.landing.constellation-active .figure {
  z-index: 5;

  animation:
    constellationLevitate
    3.2s
    ease-in-out
    infinite;

  filter:
    brightness(1.16)
    saturate(1.04)
    contrast(1.02);
}


/* =========================================================
   STARLIGHT ON FIGURE
   ========================================================= */

.starlight-wash {
  position: absolute;
  inset: 0;

  z-index: 4;
  pointer-events: none;

  opacity: 0;

  mix-blend-mode: screen;
  filter: blur(7px);

  transition: opacity 700ms ease;
}

.landing.constellation-active .starlight-wash {
  opacity: 1;

  background:
    radial-gradient(
      ellipse 20% 38% at 43% 51%,
      rgba(225, 242, 255, 0.30) 0%,
      rgba(130, 195, 255, 0.20) 30%,
      rgba(65, 135, 225, 0.10) 52%,
      transparent 74%
    ),
    linear-gradient(
      132deg,
      transparent 28%,
      rgba(190, 225, 255, 0.04) 38%,
      rgba(130, 195, 255, 0.16) 48%,
      rgba(65, 135, 225, 0.08) 58%,
      transparent 69%
    );
}


/* =========================================================
   STATIC LABELS
   ========================================================= */

.static-star-label {
  position: absolute;

  left: calc(var(--x) * 1%);
  top: calc(var(--y) * 1%);

  transform: translate(-50%, -24px);

  font-family:
    "Bodoni 72",
    Didot,
    Baskerville,
    "Iowan Old Style",
    Georgia,
    serif;

  font-style: italic;
  font-size: 15px;
  font-weight: 400;

  letter-spacing: 0.015em;
  text-transform: lowercase;
  white-space: nowrap;

  color: rgba(246, 248, 255, 0.94);

  text-shadow:
    0 0 6px rgba(180, 220, 255, 0.38),
    0 1px 4px rgba(0, 0, 0, 0.7);

  opacity: 0;
  pointer-events: none;

  transition: opacity 450ms ease;
}

.landing.constellation-active .static-star-label {
  opacity: 1;
}

.static-star-label[data-label="engineering"],
.static-star-label[data-label="community"] {
  transform: translate(-50%, 18px);
}


/* =========================================================
   BLUE-FIRE CONSTELLATION
   ========================================================= */

.landing.constellation-active .constellation-line {
  stroke-width: 2.1px;

  animation:
    deepBlueRadiance
    1.35s
    ease-in-out
    infinite;
}


/* =========================================================
   ACTIVE STAR RADIANCE
   ========================================================= */

@keyframes activeStarRadiance {
  0%,
  100% {
    opacity: 0.9;
    transform: translate(-50%, -50%) scale(1);
  }

  42% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.25);
  }

  67% {
    opacity: 0.94;
    transform: translate(-50%, -50%) scale(1.08);
  }
}

.landing.constellation-active .portfolio-star {
  animation:
    activeStarRadiance
    1.45s
    ease-in-out
    infinite !important;

  box-shadow:
    0 0 5px rgba(255, 255, 255, 1),
    0 0 13px rgba(185, 225, 255, 1),
    0 0 28px rgba(75, 165, 250, 0.95),
    0 0 48px rgba(35, 105, 225, 0.72),
    0 0 70px rgba(20, 70, 180, 0.42);
}

.landing.constellation-active .portfolio-star::before,
.landing.constellation-active .portfolio-star::after {
  filter:
    brightness(1.7)
    drop-shadow(0 0 4px rgba(220, 245, 255, 1))
    drop-shadow(0 0 10px rgba(105, 190, 255, 1))
    drop-shadow(0 0 20px rgba(40, 130, 235, 0.82));
}

/* Irregular directional blue-fire flow */
@keyframes directionalBlueFire {
  0% {
    stroke: rgb(42, 105, 215);
    filter:
      drop-shadow(-5px -2px 5px rgba(220, 245, 255, 1))
      drop-shadow(-10px -4px 14px rgba(90, 185, 255, 1))
      drop-shadow(-18px -7px 32px rgba(35, 115, 245, 0.85))
      drop-shadow(3px 2px 10px rgba(25, 80, 200, 0.35));
  }

  19% {
    stroke: rgb(90, 175, 250);
    filter:
      drop-shadow(-8px -3px 7px rgba(245, 253, 255, 1))
      drop-shadow(-15px -5px 19px rgba(100, 200, 255, 1))
      drop-shadow(-25px -8px 42px rgba(35, 125, 255, 0.95))
      drop-shadow(4px 2px 8px rgba(20, 70, 185, 0.25));
  }

  43% {
    stroke: rgb(120, 195, 255);
    filter:
      drop-shadow(-2px 0 9px rgba(200, 240, 255, 0.75))
      drop-shadow(0 0 24px rgba(65, 165, 255, 0.75))
      drop-shadow(3px 1px 40px rgba(30, 105, 235, 0.65));
  }

  61% {
    stroke: rgb(75, 160, 245);
    filter:
      drop-shadow(7px 3px 7px rgba(245, 253, 255, 1))
      drop-shadow(14px 5px 19px rgba(105, 200, 255, 1))
      drop-shadow(25px 8px 43px rgba(35, 125, 255, 0.95))
      drop-shadow(-4px -2px 8px rgba(20, 70, 185, 0.25));
  }

  82% {
    stroke: rgb(48, 120, 225);
    filter:
      drop-shadow(5px 2px 5px rgba(220, 245, 255, 1))
      drop-shadow(11px 4px 15px rgba(85, 180, 255, 0.95))
      drop-shadow(19px 7px 34px rgba(30, 110, 245, 0.85))
      drop-shadow(-3px -2px 10px rgba(20, 70, 185, 0.3));
  }

  100% {
    stroke: rgb(42, 105, 215);
    filter:
      drop-shadow(-5px -2px 5px rgba(220, 245, 255, 1))
      drop-shadow(-10px -4px 14px rgba(90, 185, 255, 1))
      drop-shadow(-18px -7px 32px rgba(35, 115, 245, 0.85))
      drop-shadow(3px 2px 10px rgba(25, 80, 200, 0.35));
  }
}

.landing.constellation-active .constellation-line {
  stroke-width: 2.1px;
  animation: directionalBlueFire 2.15s ease-in-out infinite;
}

/* Each segment burns at a slightly different phase */
.landing.constellation-active .constellation-line:nth-child(2) {
  animation-delay: -0.73s;
  animation-duration: 1.87s;
}

.landing.constellation-active .constellation-line:nth-child(3) {
  animation-delay: -1.31s;
  animation-duration: 2.43s;
}

.landing.constellation-active .constellation-line:nth-child(4) {
  animation-delay: -0.41s;
  animation-duration: 1.72s;
}
