/* Nexus intro splash - white bg, crimson motion */

.nexus-splash {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: grid;
  place-items: center;
  background: #fff;
  overflow: hidden;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.55s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0.55s step-end;
}

.nexus-splash.is-exit {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.55s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0.55s step-end;
}

.nexus-splash.is-done {
  display: none;
}

.nexus-splash__grid {
  position: absolute;
  inset: -20%;
  background-image:
    linear-gradient(rgba(139, 0, 0, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 0, 0, 0.1) 1px, transparent 1px);
  background-size: 56px 56px;
  transform: perspective(600px) rotateX(58deg) scale(1.4);
  transform-origin: center 70%;
  opacity: 0;
}

.nexus-splash.is-enter .nexus-splash__grid {
  animation: splash-grid-in 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.nexus-splash.is-exit .nexus-splash__grid {
  animation: splash-grid-out 0.5s ease-in forwards;
}

.nexus-splash__glow {
  position: absolute;
  width: min(70vw, 480px);
  height: min(70vw, 480px);
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(139, 0, 0, 0.28) 0%,
    rgba(139, 0, 0, 0.1) 42%,
    transparent 70%
  );
  filter: blur(8px);
  opacity: 0;
  transform: scale(0.6);
}

.nexus-splash.is-enter .nexus-splash__glow {
  animation: splash-glow-in 0.85s cubic-bezier(0.16, 1, 0.3, 1) 0.08s forwards;
}

.nexus-splash.is-exit .nexus-splash__glow {
  animation: splash-glow-out 0.5s ease-in forwards;
}

.nexus-splash__stage {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
  padding: 24px;
  text-align: center;
}

.nexus-splash__logo-wrap {
  position: relative;
  width: min(42vw, 168px);
  height: min(42vw, 168px);
  display: grid;
  place-items: center;
  opacity: 0;
  transform: scale(0.55) translateY(18px);
  filter: blur(10px);
}

.nexus-splash.is-enter .nexus-splash__logo-wrap {
  animation: splash-logo-in 0.75s cubic-bezier(0.16, 1, 0.3, 1) 0.12s forwards;
}

.nexus-splash.is-exit .nexus-splash__logo-wrap {
  animation: splash-logo-out 0.45s ease-in forwards;
}

.nexus-splash__logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.nexus-splash__logo-fill,
.nexus-splash__logo-solid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.nexus-splash__logo-outline {
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 0 14px rgba(139, 0, 0, 0.4));
}

.nexus-splash__logo-solid {
  opacity: 0;
  transition: none;
}

.nexus-splash.is-filling .nexus-splash__logo-wrap {
  filter: drop-shadow(0 0 28px rgba(139, 0, 0, 0.35));
}

.nexus-splash__ring {
  position: absolute;
  inset: -14%;
  border-radius: 50%;
  border: 1px solid rgba(139, 0, 0, 0.45);
  box-shadow:
    0 0 24px rgba(139, 0, 0, 0.2),
    inset 0 0 24px rgba(139, 0, 0, 0.08);
  opacity: 0;
  transform: scale(0.8) rotate(-18deg);
}

.nexus-splash.is-enter .nexus-splash__ring {
  animation: splash-ring-in 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
}

.nexus-splash.is-exit .nexus-splash__ring {
  animation: splash-ring-out 0.45s ease-in forwards;
}

.nexus-splash__ring::after {
  content: "";
  position: absolute;
  inset: 10%;
  border-radius: 50%;
  border: 1px dashed rgba(212, 90, 90, 0.4);
}

.nexus-splash.is-enter .nexus-splash__ring::after {
  animation: splash-spin 8s linear infinite;
}

.nexus-splash__tagline {
  margin: 0;
  font-family: Orbitron, "Segoe UI", sans-serif;
  font-weight: 600;
  font-size: clamp(0.95rem, 2.8vw, 1.35rem);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #8b0000;
  text-shadow: 0 0 18px rgba(139, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(16px);
  filter: blur(6px);
}

.nexus-splash.is-enter .nexus-splash__tagline {
  animation: splash-tag-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.35s forwards;
}

.nexus-splash.is-exit .nexus-splash__tagline {
  animation: splash-tag-out 0.4s ease-in forwards;
}

.nexus-splash__tagline span {
  display: inline-block;
  background: linear-gradient(
    90deg,
    #8b0000 0%,
    #d45a5a 35%,
    #5a0000 50%,
    #d45a5a 65%,
    #8b0000 100%
  );
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nexus-splash.is-enter .nexus-splash__tagline span {
  animation: splash-shimmer 2.4s ease-in-out infinite;
}

.nexus-splash__scan {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(139, 0, 0, 0.85),
    transparent
  );
  box-shadow: 0 0 18px rgba(139, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
}

.nexus-splash.is-enter .nexus-splash__scan {
  animation: splash-scan 1.1s ease-in-out 0.2s forwards;
}

.nexus-splash.is-exit .nexus-splash__scan {
  opacity: 0;
  animation: none;
}

html.splash-lock,
html.splash-lock body {
  overflow: hidden;
}

html.splash-lock body > :not(.nexus-splash) {
  visibility: hidden;
}

html.splash-skip #nexus-splash {
  display: none !important;
}

@keyframes splash-grid-in {
  to {
    opacity: 0.55;
  }
}

@keyframes splash-grid-out {
  to {
    opacity: 0;
    transform: perspective(600px) rotateX(58deg) scale(1.8);
  }
}

@keyframes splash-glow-in {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes splash-glow-out {
  to {
    opacity: 0;
    transform: scale(1.2);
  }
}

@keyframes splash-logo-in {
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0);
  }
}

@keyframes splash-logo-out {
  to {
    opacity: 0;
    transform: scale(1.08) translateY(-10px);
    filter: blur(8px);
  }
}

@keyframes splash-ring-in {
  to {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

@keyframes splash-ring-out {
  to {
    opacity: 0;
    transform: scale(1.2) rotate(12deg);
  }
}

@keyframes splash-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes splash-tag-in {
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes splash-tag-out {
  to {
    opacity: 0;
    transform: translateY(-8px);
    filter: blur(4px);
  }
}

@keyframes splash-shimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes splash-scan {
  0% {
    top: 18%;
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  100% {
    top: 78%;
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nexus-splash__grid,
  .nexus-splash__glow,
  .nexus-splash__logo-wrap,
  .nexus-splash__ring,
  .nexus-splash__ring::after,
  .nexus-splash__tagline,
  .nexus-splash__tagline span,
  .nexus-splash__scan {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
}
