/* =====================================================
   VRISVA LAUNCH EXPERIENCE — launch.css
   Cinematic preloader, scroll reveals, hero kinetics,
   and micro-interactions for the homepage.
===================================================== */

:root {
  --vl-mono: 'JetBrains Mono', 'SF Mono', Consolas, 'Courier New', monospace;
  --vl-amber: #f59e0b;
  --vl-blue: #3b82f6;
}

/* ── Preloader overlay ── */
#v-launch {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #030610;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: transform 0.95s cubic-bezier(0.76, 0, 0.24, 1);
  will-change: transform;
}
#v-launch.v-liftoff { transform: translateY(-102%); }
#v-launch.v-fadeout { transition: opacity 0.4s ease; opacity: 0; }
/* pure-CSS backstop: if JS never runs, the overlay clears itself */
#v-launch { animation: vl-backstop 0.6s ease 9s forwards; }
@keyframes vl-backstop {
  to { opacity: 0; visibility: hidden; }
}

/* faint grid backdrop */
#v-launch::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(59,130,246,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59,130,246,0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 75% 65% at 50% 50%, black 30%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 50%, black 30%, transparent 78%);
}

/* ignition flash from the pad */
#v-launch .vl-flash {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 45%;
  background: linear-gradient(to top, rgba(245,158,11,0.55), rgba(249,115,22,0.18) 45%, transparent);
  opacity: 0;
  pointer-events: none;
}
#v-launch.v-ignite .vl-flash { animation: vl-flash 0.85s ease-out forwards; }
@keyframes vl-flash {
  0%   { opacity: 0; }
  18%  { opacity: 1; }
  100% { opacity: 0.55; }
}
#v-launch.v-ignite .vl-stage { animation: vl-shake 0.5s linear; }
@keyframes vl-shake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-2px, 1px); }
  40% { transform: translate(2px, -1px); }
  60% { transform: translate(-1px, -2px); }
  80% { transform: translate(1px, 2px); }
}

.vl-stage {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
}
.vl-logo {
  height: 72px;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: 0;
  animation: vl-in 0.7s ease 0.15s forwards;
}
.vl-count {
  font-family: var(--vl-mono);
  font-size: clamp(4.5rem, 14vw, 9rem);
  font-weight: 800;
  line-height: 1;
  color: #f1f5f9;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  opacity: 0;
  animation: vl-in 0.7s ease 0.3s forwards;
}
.vl-count sup {
  font-size: 0.22em;
  font-weight: 600;
  color: #475569;
  letter-spacing: 0.1em;
  vertical-align: super;
}
.vl-bar {
  width: min(300px, 60vw);
  height: 2px;
  background: rgba(59,130,246,0.15);
  border-radius: 2px;
  overflow: hidden;
  opacity: 0;
  animation: vl-in 0.7s ease 0.4s forwards;
}
.vl-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--vl-blue), #818cf8);
  border-radius: 2px;
  transition: width 0.15s linear;
}
.vl-status {
  font-family: var(--vl-mono);
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #64748b;
  min-height: 1.2em;
  opacity: 0;
  animation: vl-in 0.7s ease 0.5s forwards;
}
.vl-status.vl-go { color: #10b981; }

/* big countdown digit (replaces counter at T-minus) */
.vl-tminus {
  font-family: var(--vl-mono);
  font-size: clamp(5rem, 16vw, 10rem);
  font-weight: 800;
  line-height: 1;
  color: #fff;
  letter-spacing: -0.02em;
  animation: vl-digit 0.38s cubic-bezier(0.16, 1, 0.3, 1);
}
.vl-tminus.vl-ignition-word {
  font-size: clamp(2.2rem, 7vw, 4.5rem);
  letter-spacing: 0.18em;
  color: var(--vl-amber);
  text-shadow: 0 0 42px rgba(245,158,11,0.55);
}
@keyframes vl-digit {
  from { opacity: 0; transform: scale(1.5); }
  to   { opacity: 1; transform: scale(1); }
}

/* telemetry log — bottom-left */
.vl-telemetry {
  position: absolute;
  left: 34px;
  bottom: 30px;
  font-family: var(--vl-mono);
  font-size: 0.66rem;
  line-height: 1.85;
  color: #475569;
  text-align: left;
  letter-spacing: 0.06em;
  z-index: 2;
}
.vl-telemetry .vl-line {
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  white-space: nowrap;
}
.vl-telemetry .vl-line.vl-on { opacity: 1; transform: translateX(0); }
.vl-telemetry .vl-ok { color: #10b981; font-weight: 700; }
.vl-telemetry .vl-sys { color: #94a3b8; }

/* skip — bottom-right */
.vl-skip {
  position: absolute;
  right: 34px;
  bottom: 30px;
  z-index: 3;
  background: none;
  border: 1px solid rgba(148,163,184,0.25);
  border-radius: 6px;
  color: #64748b;
  font-family: var(--vl-mono);
  font-size: 0.64rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 8px 16px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.vl-skip:hover { color: #e2e8f0; border-color: rgba(148,163,184,0.6); }

@keyframes vl-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Hero headline kinetic reveal ── */
.hero-title .hl-mask {
  display: block;
  overflow: hidden;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}
.hero-title .hl-line {
  display: block;
  background: linear-gradient(165deg, #ffffff 20%, #bfdbfe 55%, #a5b4fc 88%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  transform: translateY(112%);
}
.v-launched .hero-title .hl-line {
  animation: hl-rise 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: calc(0.12s + var(--hl-i, 0) * 0.13s);
}
@keyframes hl-rise {
  to { transform: translateY(0); }
}
/* hero secondary elements fade up after the title
   (hidden only once JS has confirmed it is running via body.v-js) */
.v-js .hero-tag, .v-js .hero-sub, .v-js .hero-btns, .v-js .trust-bar { opacity: 0; }
.v-launched .hero-tag,
.v-launched .hero-sub,
.v-launched .hero-btns,
.v-launched .trust-bar {
  animation: vl-in 0.8s ease forwards;
}
.v-launched .hero-tag   { animation-delay: 0.55s; }
.v-launched .hero-sub   { animation-delay: 0.72s; }
.v-launched .hero-btns  { animation-delay: 0.86s; }
.v-launched .trust-bar  { animation-delay: 1.05s; }
/* no-launch (reduced-motion / missing overlay) safety: show everything */
.v-no-launch .hero-tag, .v-no-launch .hero-sub,
.v-no-launch .hero-btns, .v-no-launch .trust-bar { opacity: 1 !important; animation: none; }
.v-no-launch .hero-title .hl-line { transform: none; animation: none; }

/* ── Scroll reveals (only hidden when JS is confirmed running) ── */
.v-js .v-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--vr-d, 0s);
  will-change: opacity, transform;
}
.v-js .v-reveal.v-in {
  opacity: 1;
  transform: translateY(0);
}

/* ── Scroll progress beam ── */
#v-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 100%;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--vl-blue), #818cf8, #06b6d4);
  z-index: 300;
  pointer-events: none;
}

/* ── Nav deepens on scroll ── */
.vrisva-nav {
  transition: box-shadow 0.3s ease, background 0.3s ease;
}
.vrisva-nav.v-scrolled {
  background: rgba(2, 4, 12, 0.97);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
}

/* ── Cursor glow (desktop, fine pointers only) ── */
#v-cursor-glow {
  position: fixed;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59,130,246,0.09) 0%, transparent 62%);
  pointer-events: none;
  z-index: 90;
  transform: translate(-50%, -50%);
  mix-blend-mode: screen;
}
@media (pointer: coarse) {
  #v-cursor-glow { display: none; }
}

/* ── Micro-interaction polish ── */
.v-btn { transition: transform 0.18s ease, box-shadow 0.25s ease, background 0.2s, border-color 0.2s, color 0.2s; }
.v-btn-primary:hover { box-shadow: 0 6px 28px rgba(59,130,246,0.45); }

.fc-hero, .fc-small {
  transition: background 0.3s ease;
}
.fc-hero:hover, .fc-small:hover { background: rgba(10, 20, 46, 0.95); }
.fc-hero-img { transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
.fc-hero:hover .fc-hero-img { transform: scale(1.025); }
.fc-small-img img { transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
.fc-small:hover .fc-small-img img { transform: scale(1.05); }

.cap-item { transition: background 0.2s, transform 0.25s ease; }
.cap-item:hover { transform: translateY(-3px); }

/* rocket idle float */
@media (prefers-reduced-motion: no-preference) {
  .rocket-svg-wrap svg {
    animation: v-rocket-float 7s ease-in-out infinite;
  }
}
@keyframes v-rocket-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-9px); }
}

/* ── Reduced motion: neutralize everything ── */
@media (prefers-reduced-motion: reduce) {
  #v-launch { display: none !important; }
  .v-js .v-reveal { opacity: 1; transform: none; transition: none; }
  .v-js .hero-tag, .v-js .hero-sub, .v-js .hero-btns, .v-js .trust-bar { opacity: 1; animation: none !important; }
  .hero-title .hl-line { transform: none !important; animation: none !important; }
  #v-cursor-glow { display: none; }
  .fc-hero-img, .fc-small-img img, .cap-item, .v-btn { transition: none; }
}

@media (max-width: 768px) {
  .vl-telemetry { left: 18px; bottom: 74px; font-size: 0.6rem; }
  .vl-skip { right: 18px; bottom: 22px; }
}
