/* First-load splash: hyperspeed / lightspeed (CSS-only). */

#va-splash-mount {
  z-index: 2147483000;
}

html.va-splash-pending {
  overflow: hidden;
}

html.va-splash-pending body {
  overflow: hidden;
}

.va-splash {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  overflow: hidden;
  pointer-events: auto;
}

/* Frosted tint on its own layer (no transform) — avoids WebKit glitches when
   backdrop-filter shares a layer with many animated descendants. */
.va-splash-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(
      ellipse 82% 62% at 50% 42%,
      rgba(22, 24, 44, 0.82) 0%,
      rgba(91, 128, 247, 0.07) 42%,
      rgba(10, 11, 20, 0.88) 100%
    ),
    rgba(15, 17, 35, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Tiny brand-colored specks, behind rays; transform-only drift */
.va-splash-stars {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.va-splash-star {
  position: absolute;
  left: var(--sx, 50%);
  top: var(--sy, 50%);
  width: var(--ss, 2px);
  height: var(--ss, 2px);
  margin-left: calc(var(--ss, 2px) / -2);
  margin-top: calc(var(--ss, 2px) / -2);
  border-radius: 50%;
  opacity: var(--op, 0.5);
  animation: va-splash-star-drift var(--dur, 100s) ease-in-out infinite alternate;
}

/* Same hues as --purple / --Green, lifted toward white for a brighter read */
.va-splash-star--purple {
  background: rgb(236, 200, 255);
  box-shadow:
    0 0 calc(var(--ss, 2px) * 1.6) rgba(216, 160, 255, 0.8),
    0 0 calc(var(--ss, 2px) * 3.1) rgba(170, 0, 255, 0.34);
}

.va-splash-star--green {
  background: rgb(156, 242, 230);
  box-shadow:
    0 0 calc(var(--ss, 2px) * 1.6) rgba(128, 232, 220, 0.78),
    0 0 calc(var(--ss, 2px) * 3.1) rgba(38, 166, 154, 0.33);
}

@keyframes va-splash-star-drift {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(var(--dx, 0px), var(--dy, 0px), 0);
  }
}

/* Edge darkening — sits above rays, below copy */
.va-splash::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, transparent 0%, transparent 28%, rgba(0, 0, 0, 0.52) 100%);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .va-splash-backdrop {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: radial-gradient(
        ellipse 82% 62% at 50% 42%,
        #16182c 0%,
        rgba(91, 128, 247, 0.08) 40%,
        #06060a 100%
      ),
      rgba(12, 14, 24, 0.96);
  }
}

/* After ray phase: hide streaks; frosted tint stays until full dismiss. */
.va-splash-phase-copy .va-splash-rays {
  opacity: 0;
  transition: opacity 0.45s ease;
  pointer-events: none;
}

.va-splash-rays {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 4px;
  transform: translate3d(-50%, -50%, 0);
  z-index: 2;
  /* No second scale animation here — it fought child transforms and caused flicker */
}

.va-splash-ray {
  --va-hub-gap: clamp(22px, 3.6vmin, 42px);
  position: absolute;
  left: 50%;
  bottom: 50%;
  width: var(--va-w, 2px);
  /* From hub at center: long enough to clear any corner on all aspect ratios */
  height: calc(135vmax * var(--va-len, 1));
  margin-left: calc(var(--va-w, 2px) / -2);
  transform-origin: 50% 100%;
  /* Hub at viewport center: all streaks radiate outward, only angle/length/timing vary */
  transform: rotate(var(--va-rot, 0deg)) scaleY(var(--va-s0, 0.12));
  /* Hollow center: hide the inner segment so streaks start slightly outside the hub */
  -webkit-mask-image: linear-gradient(
    to top,
    transparent 0,
    transparent var(--va-hub-gap),
    #000 var(--va-hub-gap),
    #000 100%
  );
  mask-image: linear-gradient(
    to top,
    transparent 0,
    transparent var(--va-hub-gap),
    #000 var(--va-hub-gap),
    #000 100%
  );
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  /* Like the original soft streaks: pale tints of brand (bright = glowing, not strong hue) */
  background: linear-gradient(
    to top,
    rgba(255, 255, 255, 0) 0%,
    rgba(210, 225, 255, 0.28) 20%,
    rgba(230, 210, 255, 0.26) 32%,
    rgba(200, 245, 238, 0.22) 42%,
    rgba(220, 230, 255, 0.38) 56%,
    rgba(255, 252, 255, 0.72) 76%,
    rgba(255, 255, 255, 0.88) 88%,
    rgba(255, 255, 255, 0) 100%
  );
  /* One soft halo — multi-shadow × 40 rays was a major jank source */
  box-shadow: 0 0 18px rgba(170, 190, 255, 0.28);
  opacity: 0;
  /* Do NOT animate filter on rays — animated blur on 80+ nodes causes severe glitching */
  animation: va-splash-ray-streak 0.67s cubic-bezier(0.2, 0.85, 0.36, 1) forwards;
  animation-delay: var(--va-delay, 0s);
}

.va-splash-copy {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: #f4f6ff;
  font-family: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  /* One typeface / one weight — only sizes differ (600 matches loaded IBM Plex on site) */
  font-weight: 600;
  font-style: normal;
  padding: min(2rem, 4vw);
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  animation: va-splash-copy-zoom 1.31s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.va-splash-title-row {
  position: relative;
  display: inline-block;
  margin-bottom: 0.08em;
}

.va-splash-the {
  position: absolute;
  top: -1.1em;
  left: 0.05em;
  font-size: clamp(0.55rem, 1.8vw, 0.75rem);
  font-weight: inherit;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  opacity: 1;
}

.va-splash-baap {
  display: block;
  font-size: clamp(3.5rem, 20vw, 8.5rem);
  font-weight: inherit;
  line-height: 0.92;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.va-splash-mid {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: baseline;
  column-gap: 0.38em;
  font-size: clamp(1rem, 3.8vw, 1.55rem);
  font-weight: inherit;
  letter-spacing: 0.06em;
  margin-top: 0.35em;
  opacity: 1;
  text-transform: uppercase;
}

.va-splash-mid-plain {
  font-weight: inherit;
  flex: 0 0 auto;
}

.va-splash-chat {
  display: block;
  flex: 0 0 auto;
  font-weight: inherit;
  color: #f4f6ff;
}

.va-splash-here {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: baseline;
  column-gap: 0.55em;
  margin-top: 0.85em;
  font-size: clamp(0.65rem, 2vw, 0.9rem);
  font-weight: inherit;
  text-transform: uppercase;
  opacity: 1;
}

.va-splash-here-word {
  letter-spacing: 0.28em;
  font-weight: inherit;
}

/* Glow: fewer layers = less repaint (still reads on dark glass) */
.va-splash-the,
.va-splash-baap,
.va-splash-mid-plain,
.va-splash-chat,
.va-splash-here-word {
  text-shadow:
    0 0 8px rgba(255, 255, 255, 0.5),
    0 0 22px rgba(175, 195, 255, 0.42),
    0 2px 8px rgba(0, 0, 0, 0.4);
}

/* CHAT: long white → white → purple → green (very spread stops); huge bg so motion reads soft.
   No extra text-shadow here — same glow as .va-splash-mid-plain (stronger shadow was only in this rule).
   Do not use filter: drop-shadow — breaks background-clip:text in WebKit/Blink. */
#va-splash-root #va-splash-chat-word.va-splash-chat-gradient {
  --va-splash-p: var(--purple, rgb(170, 0, 255));
  --va-splash-g: var(--Green, rgb(38, 166, 154));
  display: inline-block;
  position: relative;
  isolation: isolate;
  transform: translateZ(0);
  background-color: transparent;
  background-image: linear-gradient(
    100deg,
    #ffffff 0%,
    #ffffff 14%,
    #ffffff 34%,
    #e0ccff 42%,
    var(--va-splash-p) 52%,
    #c080ff 58%,
    #7ddccf 72%,
    var(--va-splash-g) 80%,
    #4dbdaa 88%,
    #ffffff 100%
  );
  background-size: 920% 100%;
  background-repeat: no-repeat;
  background-position: 0% 50%;
  animation: va-splash-chat-gradient-move 3s ease-in-out infinite alternate;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent !important;
  -webkit-text-fill-color: transparent !important;
}

@keyframes va-splash-chat-gradient-move {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 100% 50%;
  }
}

.va-splash.va-splash-exit {
  animation: va-splash-fade-out 0.45s ease forwards;
}

/* Short life: snap in fast, peak early, tail off so next staggered streak takes over */
@keyframes va-splash-ray-streak {
  0% {
    transform: rotate(var(--va-rot)) translateZ(0) scaleY(var(--va-s0, 0.08));
    opacity: 0;
  }
  6% {
    opacity: var(--va-op, 0.92);
  }
  28% {
    transform: rotate(var(--va-rot)) translateZ(0)
      scaleY(calc((var(--va-s0, 0.08) + var(--va-s1, 2)) * 0.55));
    opacity: 0.78;
  }
  58% {
    transform: rotate(var(--va-rot)) translateZ(0) scaleY(var(--va-s1, 2.1));
    opacity: 0.22;
  }
  100% {
    transform: rotate(var(--va-rot)) translateZ(0) scaleY(var(--va-s1, 2.1));
    opacity: 0;
  }
}

/* No filter blur — animated blur over page content caused ghosting / double vision. */
@keyframes va-splash-copy-zoom {
  0% {
    transform: scale(3.15) translateZ(0);
    opacity: 0;
  }
  100% {
    /* End at previous start size so final lockup looks huge */
    transform: scale(1.8) translateZ(0);
    opacity: 1;
  }
}

@keyframes va-splash-fade-out {
  to {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .va-splash-rays,
  .va-splash-ray,
  .va-splash-copy {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .va-splash-star {
    animation: none !important;
  }

  .va-splash-copy {
    transform: scale(1.8);
    opacity: 1;
  }

  #va-splash-root #va-splash-chat-word.va-splash-chat-gradient {
    animation: none;
    color: var(--Green, rgb(38, 166, 154)) !important;
    -webkit-text-fill-color: var(--Green, rgb(38, 166, 154)) !important;
    background: none !important;
    background-image: none !important;
    -webkit-background-clip: border-box !important;
    background-clip: border-box !important;
  }
}
