/* ===== Motion layer: 3D floating hero, AI badges, circuit lines, scroll pop-ups =====
   Everything here is decorative. With prefers-reduced-motion the page stays still. */

/* ---------- Hero: neural network canvas ---------- */
.rv-neural{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;}

/* ---------- Hero: 3D scene that tilts with the pointer ---------- */
.rv-stage3{perspective:1600px;}
.rv-scene{position:absolute;inset:0;transform-style:preserve-3d;transform:rotateX(var(--rx,0deg)) rotateY(var(--ry,0deg));transition:transform .5s cubic-bezier(.2,.7,.2,1);}
.rv-fly{position:absolute;}
.rv-fly img{display:block;width:100%;height:auto;}
.rv-fly-laptop{left:4%;top:56px;width:82%;z-index:2;transform:translateZ(0);}
.rv-fly-laptop .rv-hero-laptop{position:static;width:100%;filter:drop-shadow(0 46px 44px rgba(18,11,46,.32));}
.rv-fly-phone{right:1%;top:210px;width:21%;z-index:4;transform:translateZ(70px);}
.rv-fly-phone img{filter:drop-shadow(0 30px 30px rgba(18,11,46,.38));}
.rv-tile{transform:translateZ(110px);}

/* data links from each tile into the laptop */
.rv-datalinks{position:absolute;inset:0;width:100%;height:100%;z-index:1;overflow:visible;}
.rv-link{fill:none;stroke:rgba(167,139,250,.5);stroke-width:1.4;stroke-dasharray:2 6;vector-effect:non-scaling-stroke;}
.rv-pulse{fill:none;stroke:#C4B5FD;stroke-width:3;stroke-linecap:round;stroke-dasharray:7 100;stroke-dashoffset:107;vector-effect:non-scaling-stroke;filter:drop-shadow(0 0 5px #A78BFA);}

/* orbit ring around the pedestal */
.rv-orbit{position:absolute;left:50%;top:70%;width:92%;aspect-ratio:1;margin-left:-46%;margin-top:-46%;border-radius:50%;border:1.5px dashed rgba(167,139,250,.45);transform:rotateX(76deg);z-index:1;pointer-events:none;}
.rv-orbit span{position:absolute;width:12px;height:12px;margin:-6px 0 0 -6px;border-radius:50%;background:#A78BFA;box-shadow:0 0 14px 4px rgba(167,139,250,.75);}
.rv-orbit span:nth-child(1){left:50%;top:0;}
.rv-orbit span:nth-child(2){left:6.7%;top:75%;}
.rv-orbit span:nth-child(3){left:93.3%;top:75%;background:#fff;}

/* floating AI badges */
.rv-ai{position:absolute;z-index:5;display:grid;place-items:center;width:48px;height:48px;border-radius:15px;color:#fff;background:linear-gradient(145deg,#8B5CF6,#6D28D9);box-shadow:0 0 0 6px rgba(167,139,250,.16),0 16px 30px -12px rgba(76,29,149,.85);transform:translateZ(140px);}
.rv-ai svg{width:24px;height:24px;fill:currentColor;}
.rv-ai-spark{left:40%;top:-4px;}
.rv-ai-chip{right:24%;top:8px;font:800 15px/1 var(--display);letter-spacing:.02em;}
.rv-ai-chip::after{content:"";position:absolute;inset:-6px;border-radius:19px;border:2px solid rgba(167,139,250,.7);opacity:0;}
.rv-ai-typing{left:21%;bottom:46px;width:66px;height:36px;border-radius:18px 18px 18px 6px;background:#fff;display:flex;gap:5px;justify-content:center;align-items:center;box-shadow:0 16px 30px -12px rgba(18,11,46,.5);}
.rv-ai-typing i{width:7px;height:7px;border-radius:50%;background:#7C3AED;}
.rv-ai-brain{right:30%;bottom:6px;background:#fff;color:#7C3AED;}
.rv-ai-brain svg{fill:none;}
.rv-ai-bolt{left:26%;top:150px;width:36px;height:36px;border-radius:11px;}
.rv-ai-bolt svg{width:18px;height:18px;}

/* ---------- Scroll progress line ---------- */
.rv-progress{position:fixed;left:0;top:0;z-index:200;height:3px;width:100%;transform-origin:0 50%;transform:scaleX(var(--p,0));background:linear-gradient(90deg,#7C3AED,#A78BFA,#C4B5FD);box-shadow:0 0 12px rgba(167,139,250,.8);pointer-events:none;}

/* ---------- Section circuit lines ---------- */
.rv-sec,.rv-band{position:relative;overflow:clip;}
.rv-sec > .rv-wrap{position:relative;z-index:1;}
.rv-circuit{position:absolute;top:56px;width:240px;height:440px;pointer-events:none;z-index:0;opacity:.75;}
.rv-circuit.is-left{left:0;}
.rv-circuit.is-right{right:0;transform:scaleX(-1);}
.rv-circuit path{fill:none;stroke:rgba(124,58,237,.28);stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round;}
.rv-circuit circle{fill:#fff;stroke:rgba(124,58,237,.5);stroke-width:1.4;}
.rv-circuit .rv-c-pulse{stroke:#8B5CF6;stroke-width:2.6;stroke-dasharray:6 100;stroke-dashoffset:106;filter:drop-shadow(0 0 4px rgba(139,92,246,.9));}
.rv-final .rv-circuit path,.rv-final-cta .rv-circuit path{stroke:rgba(196,181,253,.35);}

@media (prefers-reduced-motion:no-preference){
  /* hero entrance */
  .rv-hero3-copy > *{animation:rvRise .8s cubic-bezier(.2,.7,.2,1) both;}
  .rv-hero3-copy > :nth-child(2){animation-delay:.08s;}
  .rv-hero3-copy > :nth-child(3){animation-delay:.16s;}
  .rv-hero3-copy > :nth-child(4){animation-delay:.24s;}
  .rv-hero3-copy > :nth-child(5){animation-delay:.32s;}
  .rv-stage3{animation:rvStageIn 1.1s .15s cubic-bezier(.2,.7,.2,1) both;}

  /* floating, each piece on its own rhythm */
  .rv-fly-laptop{animation:rvBob 7s ease-in-out infinite;}
  .rv-fly-phone{animation:rvBob 5.6s ease-in-out -2.2s infinite;}
  .rv-tile-1{animation:rvBob 6.2s ease-in-out -1s infinite;}
  .rv-tile-2{animation:rvBob 7.4s ease-in-out -3s infinite;}
  .rv-tile-3{animation:rvBob 6.8s ease-in-out -5s infinite;}
  .rv-tile-4{animation:rvBob 6.4s ease-in-out -2s infinite;}
  .rv-tile-5{animation:rvBob 7.8s ease-in-out -4s infinite;}
  .rv-ai-spark{animation:rvBob 4.6s ease-in-out infinite;}
  .rv-ai-spark svg{animation:rvTwinkle 3s ease-in-out infinite;}
  .rv-ai-chip{animation:rvBob 5.2s ease-in-out -1.4s infinite;}
  .rv-ai-chip::after{animation:rvPing 2.4s cubic-bezier(.2,.7,.2,1) infinite;}
  .rv-ai-typing{animation:rvBob 4.8s ease-in-out -2.6s infinite;}
  .rv-ai-typing i{animation:rvDot 1.2s ease-in-out infinite;}
  .rv-ai-typing i:nth-child(2){animation-delay:.15s;}
  .rv-ai-typing i:nth-child(3){animation-delay:.3s;}
  .rv-ai-brain{animation:rvBob 5.8s ease-in-out -.8s infinite;}
  .rv-ai-brain circle{animation:rvNode 2.4s ease-in-out infinite;}
  .rv-ai-brain circle:nth-child(3){animation-delay:.6s;}
  .rv-ai-brain circle:nth-child(odd){animation-delay:1.2s;}
  .rv-ai-bolt{animation:rvBob 4.2s ease-in-out -3.2s infinite;}
  .rv-orbit{animation:rvOrbit 26s linear infinite;}
  .rv-pulse{animation:rvPulse 3.4s linear infinite;}
  .rv-pulse:nth-of-type(7){animation-delay:-.7s;}
  .rv-pulse:nth-of-type(8){animation-delay:-1.4s;}
  .rv-pulse:nth-of-type(9){animation-delay:-2.1s;}
  .rv-pulse:nth-of-type(10){animation-delay:-2.8s;}

  /* circuits draw in when their section arrives, then carry pulses */
  .js-reveal .rv-circuit path:not(.rv-c-pulse){stroke-dasharray:100;stroke-dashoffset:100;transition:stroke-dashoffset 1.6s cubic-bezier(.4,0,.2,1);}
  .js-reveal .rv-circuit circle{opacity:0;transform-box:fill-box;transform-origin:center;transform:scale(0);transition:opacity .4s 1.1s,transform .5s 1.1s cubic-bezier(.3,1.6,.5,1);}
  .js-reveal .rv-circuit.is-in path:not(.rv-c-pulse){stroke-dashoffset:0;}
  .js-reveal .rv-circuit.is-in circle{opacity:1;transform:none;}
  .rv-circuit.is-in .rv-c-pulse{animation:rvPulseC 3.6s 1.4s linear infinite;}
  .rv-circuit.is-in .rv-c-pulse + .rv-c-pulse{animation-delay:2.6s;}

  /* scroll pop-ups: a different entrance for each kind of block */
  .js-reveal [data-anim]{opacity:0;transition:opacity .7s cubic-bezier(.2,.7,.2,1),transform .8s cubic-bezier(.2,.7,.2,1),filter .7s cubic-bezier(.2,.7,.2,1),clip-path 1s cubic-bezier(.6,0,.2,1);transition-delay:calc(var(--d,0) * 90ms);}
  .js-reveal [data-anim="rise"]{transform:translateY(28px);filter:blur(6px);}
  .js-reveal [data-anim="pop"]{transform:translateY(30px) scale(.86);}
  .js-reveal [data-anim="slide"]{transform:translateX(56px);}
  .js-reveal [data-anim="slide-l"]{transform:translateX(-40px);}
  .js-reveal [data-anim="flip"]{transform:perspective(900px) rotateX(-62deg);transform-origin:50% 0;}
  .js-reveal [data-anim="zoom"]{transform:scale(.7) rotate(-4deg);}
  .js-reveal [data-anim="scan"]{opacity:1;clip-path:inset(0 0 100% 0);}
  .js-reveal [data-anim].is-in{opacity:1;transform:none;filter:none;clip-path:inset(0 0 0 0);}

  /* scan line that sweeps photos as they appear */
  [data-anim="scan"]{position:relative;}
  [data-anim="scan"]::after{content:"";position:absolute;left:0;right:0;top:0;height:3px;background:#A78BFA;box-shadow:0 0 18px 6px rgba(167,139,250,.6);opacity:0;pointer-events:none;z-index:2;}
  [data-anim="scan"].is-in::after{animation:rvScan 1.1s cubic-bezier(.6,0,.2,1) forwards;}

  /* step rules draw across once the step is in */
  .js-reveal .rv-step .rv-step-rule{transform:scaleX(0);transform-origin:0 50%;transition:transform 1s cubic-bezier(.4,0,.2,1);transition-delay:calc(var(--d,0) * 90ms + 300ms);}
  .js-reveal .rv-step.is-in .rv-step-rule{transform:none;}
  .js-reveal .rv-step .rv-step-num{transition:transform .5s cubic-bezier(.3,1.6,.5,1);transition-delay:calc(var(--d,0) * 90ms + 150ms);transform:scale(0);}
  .js-reveal .rv-step.is-in .rv-step-num{transform:none;}

  /* icons inside cards give a small glow once they land */
  .rv-scard.is-in .rv-scard-ic,.rv-leak.is-in .rv-leak-ic{animation:rvGlow 1.2s calc(var(--d,0) * 90ms + 400ms) ease-out both;}
}

@keyframes rvRise{from{opacity:0;transform:translateY(24px);filter:blur(6px);}to{opacity:1;transform:none;filter:none;}}
@keyframes rvStageIn{from{opacity:0;transform:translateY(40px) scale(.94);}to{opacity:1;transform:none;}}
@keyframes rvBob{0%,100%{translate:0 0;}50%{translate:0 -14px;}}
@keyframes rvTwinkle{0%,100%{transform:rotate(0) scale(1);}50%{transform:rotate(18deg) scale(.86);}}
@keyframes rvPing{0%{opacity:.9;transform:scale(.9);}100%{opacity:0;transform:scale(1.45);}}
@keyframes rvDot{0%,100%{transform:translateY(0);opacity:.45;}40%{transform:translateY(-5px);opacity:1;}}
@keyframes rvNode{0%,100%{fill:none;}50%{fill:#C4B5FD;}}
@keyframes rvOrbit{from{transform:rotateX(76deg) rotateZ(0);}to{transform:rotateX(76deg) rotateZ(360deg);}}
@keyframes rvPulse{to{stroke-dashoffset:0;}}
@keyframes rvPulseC{to{stroke-dashoffset:0;}}
@keyframes rvScan{0%{top:0;opacity:1;}90%{opacity:1;}100%{top:100%;opacity:0;}}
@keyframes rvGlow{0%{box-shadow:0 0 0 0 rgba(139,92,246,.55);}100%{box-shadow:0 0 0 14px rgba(139,92,246,0);}}

@media (max-width:1080px){
  .rv-circuit{display:none;}
}
@media (max-width:640px){
  .rv-fly-laptop{left:0;width:88%;top:20px;}
  .rv-fly-phone{right:0;top:96px;width:26%;}
  .rv-datalinks,.rv-ai-bolt,.rv-ai-brain{display:none;}
  .rv-ai{width:38px;height:38px;border-radius:12px;}
  .rv-ai svg{width:19px;height:19px;}
  .rv-ai-chip{font-size:13px;right:30%;top:-6px;}
  .rv-ai-spark{left:6%;top:-10px;}
  .rv-ai-typing{left:4%;bottom:6px;width:56px;height:30px;}
}

/* layout tuning: keep the phone clear of the tiles */
@media (min-width:641px){
  .rv-fly-phone{right:-4%;top:200px;}
  .rv-tile-4{right:-1%;top:44px;}
  .rv-tile-5{right:auto;left:43%;top:448px;}
  .rv-ai-brain{right:2%;bottom:auto;top:-34px;}
  .rv-ai-typing{left:27%;bottom:34px;}
}
.rv-circuit{width:150px;height:275px;}
@media (max-width:1320px){.rv-circuit{display:none;}}
@media (max-width:640px){
  .rv-stage3{height:330px;margin-top:20px;}
  .rv-ai-spark,.rv-ai-chip{top:0;}
  .rv-fly-laptop{top:44px;}
  .rv-fly-phone{top:100px;right:-2%;}
  .rv-example3{bottom:-30px;right:0;}
}
