/* =================================================================
   Webe Wow Layer — starfield, cursor, parallax, reveal, orbits
   Loaded after design-system.css.
   ================================================================= */

/* ---------- Page loader (warp) ---------- */
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: var(--space-void);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.4rem;
  pointer-events: none;
  transition: opacity 0.7s ease, visibility 0.7s ease;
}
.page-loader.is-hidden { opacity: 0; visibility: hidden; }
.page-loader__mark {
  font-family: var(--font-heading);
  font-size: clamp(2.6rem, 7vw, 5.5rem);
  font-weight: var(--fw-xbold);
  letter-spacing: -0.03em;
  color: var(--white);
  position: relative;
  overflow: hidden;
}
.page-loader__mark .dot { color: var(--cyan); }
.page-loader__mark::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--space-void);
  transform: translateX(0);
  transition: transform 0.8s cubic-bezier(0.76, 0, 0.24, 1) 0.1s;
}
.page-loader.is-loading .page-loader__mark::after { transform: translateX(102%); }
.page-loader__mark--img img {
  display: block;
  height: clamp(42px, 7vw, 64px);
  width: auto;
  filter: drop-shadow(0 4px 24px rgba(61, 219, 240, 0.3));
}
.page-loader__orbit {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  border: 1px solid rgba(148, 184, 255, 0.15);
  position: relative;
  animation: loaderSpin 1.6s linear infinite;
}
.page-loader__orbit::before {
  content: '';
  position: absolute;
  top: -4px;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 14px var(--cyan);
}
@keyframes loaderSpin { to { transform: rotate(360deg); } }
.page-loader__bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  width: 100%;
  background: var(--gradient-brand);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.9s cubic-bezier(0.65, 0, 0.35, 1);
}
.page-loader.is-loading .page-loader__bar { transform: scaleX(1); }

/* ---------- Starfield canvas ---------- */
.starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
/* All page content must sit above the starfield */
main, .nav, .footer { position: relative; z-index: 1; }

/* ---------- Custom cursor (comet) ---------- */
@media (hover: hover) and (pointer: fine) {
  html.has-cursor,
  html.has-cursor body,
  html.has-cursor a,
  html.has-cursor button,
  html.has-cursor [role="button"] { cursor: none !important; }

  .cursor-ring,
  .cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 99998;
    will-change: transform;
  }
  .cursor-ring {
    width: 38px;
    height: 38px;
    border: 1.5px solid rgba(111, 242, 255, 0.65);
    border-radius: 50%;
    margin: -19px 0 0 -19px;
    transition: width 0.28s ease, height 0.28s ease, margin 0.28s ease,
                background 0.28s ease, border-color 0.28s ease, opacity 0.3s ease;
  }
  .cursor-dot {
    width: 6px;
    height: 6px;
    background: var(--cyan-bright);
    box-shadow: 0 0 12px var(--cyan);
    border-radius: 50%;
    margin: -3px 0 0 -3px;
    transition: opacity 0.3s ease;
  }
  html.has-cursor .cursor-ring.is-hover {
    width: 66px;
    height: 66px;
    margin: -33px 0 0 -33px;
    background: rgba(61, 219, 240, 0.1);
    border-color: var(--cyan);
  }
}

/* ---------- Magnetic ---------- */
[data-magnetic] {
  display: inline-flex;
  will-change: transform;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Tilt ---------- */
[data-tilt] {
  transform-style: preserve-3d;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}
[data-tilt-content] {
  transform-style: preserve-3d;
  transform: translateZ(36px);
}

/* ---------- Parallax ---------- */
[data-parallax] {
  will-change: transform;
  transform: translate3d(0, var(--py, 0), 0);
}
[data-parallax-x] {
  will-change: transform;
  transform: translate3d(var(--px, 0), 0, 0);
}

/* ---------- Reveal on scroll ---------- */
.js .reveal,
.js .reveal-fade,
.js .reveal-left,
.js .reveal-right,
.js .reveal-scale {
  opacity: 0;
  transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.js .reveal { transform: translateY(46px); }
.js .reveal-left { transform: translateX(-46px); }
.js .reveal-right { transform: translateX(46px); }
.js .reveal-scale { transform: scale(0.93); }
.reveal.is-in, .reveal-fade.is-in, .reveal-left.is-in,
.reveal-right.is-in, .reveal-scale.is-in {
  opacity: 1;
  transform: none;
}
[data-delay="1"] { transition-delay: 0.08s; }
[data-delay="2"] { transition-delay: 0.16s; }
[data-delay="3"] { transition-delay: 0.24s; }
[data-delay="4"] { transition-delay: 0.32s; }
[data-delay="5"] { transition-delay: 0.4s; }
[data-delay="6"] { transition-delay: 0.48s; }

/* ---------- Split text ---------- */
.split-word {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}
.split-char {
  display: inline-block;
  transform: translateY(108%);
  transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}
.split-char.is-in { transform: translateY(0); }
/* Gradient text split into chars: clip must be applied per-char,
   background-clip:text on the parent ignores transformed descendants */
.grad-text .split-char {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ---------- Marquee ---------- */
.marquee {
  position: relative;
  overflow: hidden;
  --marquee-gap: var(--space-3xl);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee__track {
  display: flex;
  align-items: center;
  gap: var(--marquee-gap);
  width: max-content;
  animation: marquee 36s linear infinite;
  padding-right: var(--marquee-gap);
}
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee--reverse .marquee__track { animation-direction: reverse; }
.marquee--fast .marquee__track { animation-duration: 22s; }
@keyframes marquee {
  0%   { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-50%, 0, 0); }
}

/* ---------- Scroll progress ---------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 100%;
  background: rgba(148, 184, 255, 0.05);
  z-index: 9999;
}
.scroll-progress__bar {
  height: 100%;
  background: var(--gradient-brand);
  transform-origin: left;
  transform: scaleX(0);
}

/* ---------- Counters ---------- */
.counter { font-variant-numeric: tabular-nums; }

/* ---------- Nebula / planet decor ---------- */
.nebula {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
}
.nebula--cyan { background: radial-gradient(circle, rgba(61,219,240,0.22) 0%, transparent 70%); }
.nebula--violet { background: radial-gradient(circle, rgba(139,108,246,0.24) 0%, transparent 70%); }
.nebula--teal { background: radial-gradient(circle, rgba(16,111,126,0.35) 0%, transparent 70%); }

.planet {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
.planet--ringed::after {
  content: '';
  position: absolute;
  inset: 26% -46%;
  border-radius: 50%;
  border: 2px solid rgba(148, 184, 255, 0.22);
  transform: rotate(-22deg);
}

/* Orbit ring decorations */
.orbit-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px dashed rgba(148, 184, 255, 0.12);
  pointer-events: none;
  animation: orbitSpin 60s linear infinite;
}
.orbit-ring::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--violet);
  box-shadow: 0 0 16px var(--violet);
}
.orbit-ring--cyan::before { background: var(--cyan); box-shadow: 0 0 16px var(--cyan); }
.orbit-ring--slow { animation-duration: 95s; }
.orbit-ring--reverse { animation-direction: reverse; }
@keyframes orbitSpin { to { transform: rotate(360deg); } }

/* Floating animation */
.float { animation: floatY 7s ease-in-out infinite alternate; }
.float--slow { animation-duration: 11s; }
@keyframes floatY {
  from { transform: translateY(-10px); }
  to   { transform: translateY(14px); }
}

/* Pulse dot (live) */
.pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  animation: pulseDot 1.8s ease-in-out infinite;
}
@keyframes pulseDot {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.35); }
}

/* ---------- Glow button halo ---------- */
.btn-glow {
  position: relative;
  isolation: isolate;
}
.btn-glow::after {
  content: '';
  position: absolute;
  inset: -2px;
  background: var(--gradient-brand);
  border-radius: inherit;
  filter: blur(22px);
  opacity: 0;
  z-index: -1;
  transition: opacity 0.4s ease;
}
.btn-glow:hover::after { opacity: 0.55; }

/* ---------- Image / screenshot frame ---------- */
.img-frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  isolation: isolate;
  border: var(--border-thin);
}
.img-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 1.1s cubic-bezier(0.16, 1, 0.3, 1), filter 0.6s ease;
}
.img-frame:hover img { transform: scale(1.05); }
.img-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(3, 5, 16, 0.85) 100%);
  z-index: 1;
  pointer-events: none;
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(3, 5, 16, 0.95);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99990;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox__img {
  max-width: 90vw;
  max-height: 86vh;
  object-fit: contain;
  border: 1px solid rgba(61, 219, 240, 0.4);
  border-radius: var(--radius-md);
  box-shadow: 0 30px 80px rgba(0,0,0,0.6), 0 0 60px rgba(61, 219, 240, 0.18);
  transform: scale(0.96);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.lightbox.is-open .lightbox__img { transform: scale(1); }
.lightbox__close,
.lightbox__nav {
  position: absolute;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1.4rem;
  backdrop-filter: blur(10px);
}
.lightbox__close:hover,
.lightbox__nav:hover { background: var(--cyan); border-color: var(--cyan); color: var(--space-void); }
.lightbox__close { top: 24px; right: 24px; }
.lightbox__nav--prev { left: 24px; top: 50%; transform: translateY(-50%); }
.lightbox__nav--next { right: 24px; top: 50%; transform: translateY(-50%); }

/* ---------- Shooting star (CSS decoration) ---------- */
.shooting-star {
  position: absolute;
  width: 130px;
  height: 1.5px;
  background: linear-gradient(90deg, var(--cyan-bright), transparent);
  border-radius: 2px;
  opacity: 0;
  transform: rotate(-32deg);
  animation: shoot 9s ease-in infinite;
  pointer-events: none;
}
.shooting-star:nth-child(2n) { animation-delay: 4.2s; animation-duration: 11s; }
@keyframes shoot {
  0%   { opacity: 0; transform: rotate(-32deg) translateX(0); }
  3%   { opacity: 0.9; }
  9%   { opacity: 0; transform: rotate(-32deg) translateX(-340px); }
  100% { opacity: 0; transform: rotate(-32deg) translateX(-340px); }
}

/* ---------- Custom mascot: Owl (SVG) ---------- */
.owl {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 20px 55px rgba(61, 219, 240, 0.22));
  overflow: visible;
}
.owl__pupil {
  transition: transform 0.16s ease-out;
  will-change: transform;
}
.owl__lid {
  transform: scaleY(0);
  transform-box: fill-box;
  transform-origin: center;
  animation: owlBlink 5.4s ease-in-out infinite;
}
.owl__lid--r { animation-delay: 0.05s; }
@keyframes owlBlink {
  0%, 91%, 97%, 100% { transform: scaleY(0); }
  93%, 95% { transform: scaleY(1); }
}
.owl__ring {
  transform-box: fill-box;
  transform-origin: center;
  animation: orbitSpin 40s linear infinite;
}

/* ---------- Custom rocket (SVG) ---------- */
.rocket {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 20px 55px rgba(139, 108, 246, 0.28));
  overflow: visible;
}
.rocket__flame {
  transform-box: fill-box;
  transform-origin: 50% 0%;
  animation: flameFlick 0.22s ease-in-out infinite alternate;
}
@keyframes flameFlick {
  from { transform: scaleY(0.82) scaleX(0.94); opacity: 0.85; }
  to   { transform: scaleY(1.12) scaleX(1.06); opacity: 1; }
}
.rocket__puff {
  animation: puffFade 2.4s ease-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes puffFade {
  0% { opacity: 0.5; transform: translateY(0) scale(0.7); }
  100% { opacity: 0; transform: translateY(26px) scale(1.5); }
}

/* ---------- Animated service SVGs ---------- */
/* Browser skeleton shimmer */
.shimmer {
  animation: shimmerPulse 2.2s ease-in-out infinite;
}
.shimmer.s2 { animation-delay: 0.35s; }
.shimmer.s3 { animation-delay: 0.7s; }
@keyframes shimmerPulse {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 0.9; }
}
/* Self-drawing strokes */
.draw-line {
  stroke-dasharray: 240;
  stroke-dashoffset: 240;
  animation: drawIn 3.4s ease-in-out infinite alternate;
}
@keyframes drawIn {
  to { stroke-dashoffset: 0; }
}
/* Gears */
.gear {
  transform-box: fill-box;
  transform-origin: center;
  animation: gearSpin 10s linear infinite;
}
.gear--rev { animation-direction: reverse; animation-duration: 7s; }
@keyframes gearSpin { to { transform: rotate(360deg); } }
/* Chat bubbles */
.bub {
  transform-box: fill-box;
  transform-origin: center;
  animation: bubFloat 4.5s ease-in-out infinite alternate;
}
.bub.b2 { animation-delay: 0.8s; }
.bub.b3 { animation-delay: 1.6s; }
@keyframes bubFloat {
  from { transform: translateY(3px); }
  to   { transform: translateY(-5px); }
}
.bub .dot { animation: typingDot 1.3s ease-in-out infinite; }
.bub .dot.d2 { animation-delay: 0.18s; }
.bub .dot.d3 { animation-delay: 0.36s; }
@keyframes typingDot {
  0%, 60%, 100% { opacity: 0.35; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}
/* Heart pop */
.heart-pop {
  transform-box: fill-box;
  transform-origin: center;
  animation: heartPop 3.6s ease-in-out infinite;
}
@keyframes heartPop {
  0%, 70%, 100% { transform: scale(1); }
  76% { transform: scale(1.3); }
  82% { transform: scale(1); }
  88% { transform: scale(1.18); }
}

/* ---------- Rocket launch overlay (form submit) ---------- */
.launch-overlay {
  position: fixed;
  inset: 0;
  z-index: 99995;
  background: rgba(3, 5, 16, 0.97);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}
.launch-overlay.is-active { opacity: 1; visibility: visible; }
.launch-overlay__streak {
  position: absolute;
  top: -22vh;
  width: 2px;
  height: 18vh;
  border-radius: 2px;
  background: linear-gradient(180deg, transparent, rgba(111, 242, 255, 0.7));
  opacity: 0;
}
.launch-overlay.is-flying .launch-overlay__streak {
  animation: streakFall 0.7s linear infinite;
}
@keyframes streakFall {
  0% { transform: translateY(0); opacity: 0; }
  12% { opacity: 0.9; }
  100% { transform: translateY(140vh); opacity: 0; }
}
.launch-overlay__rocket {
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(110px, 14vw, 150px);
  transform: translate(-50%, -46%);
  transition: transform 0.5s ease;
}
.launch-overlay.is-active .launch-overlay__rocket { transform: translate(-50%, -50%); }
.launch-overlay.is-flying .launch-overlay__rocket {
  animation: rocketLaunch 1.7s cubic-bezier(0.55, 0, 0.85, 0.4) forwards;
}
@keyframes rocketLaunch {
  0%   { transform: translate(-50%, -50%); }
  10%  { transform: translate(calc(-50% - 3px), -51%); }
  20%  { transform: translate(calc(-50% + 3px), -53%); }
  30%  { transform: translate(calc(-50% - 2px), -57%); }
  100% { transform: translate(-50%, -190vh); }
}
.launch-overlay__msg {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  text-align: center;
  padding: var(--gutter);
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}
.launch-overlay.is-done .launch-overlay__msg {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.launch-overlay__msg h3 {
  font-size: var(--fs-h2);
  font-weight: var(--fw-xbold);
}
.launch-overlay__msg p {
  color: var(--gray-300);
  max-width: 420px;
}
.launch-overlay__msg .btn { margin-top: var(--space-lg); }

/* ---------- Mobile / reduced motion ---------- */
@media (hover: none), (pointer: coarse) {
  .cursor-ring, .cursor-dot { display: none !important; }
  [data-tilt], [data-magnetic] { transform: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  [data-parallax], [data-parallax-x] { transform: none !important; }
  .starfield { display: none; }
}
