/* 3D depth for every public marketing page (driven by site-3d.js).
   Everything is gated on html.s3d, which the script sets only when motion is allowed,
   so without JavaScript or with reduced motion every page renders flat and complete. */
@media (prefers-reduced-motion:no-preference){
  /* Homepage hero: the live-site screens become a 3D scene that swings in on load,
     follows the pointer and leans back as the visitor scrolls. */
  html.s3d .hero{perspective:1600px}
  html.s3d .hero-stage{transform-style:preserve-3d;transform:rotateX(var(--s3d-rx,0deg)) rotateY(var(--s3d-ry,0deg));will-change:transform}
  html.s3d .hero-stage.s3d-intro{animation:s3d-swing 1.7s cubic-bezier(.16,1,.3,1) both}
  @keyframes s3d-swing{from{opacity:.2;transform:rotateX(38deg) rotateY(-34deg) translate3d(40px,80px,-240px)}to{opacity:1;transform:rotateX(var(--s3d-rx,0deg)) rotateY(var(--s3d-ry,0deg))}}
  html.s3d .hero-stage>.preview-halo{translate:0 0 -140px}
  html.s3d .hero-stage>.preview-caption{translate:0 0 50px}
  html.s3d .hero-stage>.phone-preview{translate:0 0 var(--s3d-pz,100px);box-shadow:0 50px 70px -20px #000b}
  html.s3d .hero-stage>.preview-note{translate:0 0 calc(var(--s3d-pz,100px) + 20px);box-shadow:0 30px 50px -20px #000c}

  @media (max-width:760px){html.s3d .hero-stage>.preview-note{translate:none}}

  /* A moving 3D grid floor under the top of each page. */
  html.s3d .hero::after,html.s3d .page-hero::after{content:"";position:absolute;z-index:-1;left:-25%;right:-25%;bottom:-18%;height:62%;pointer-events:none;background-image:linear-gradient(#6c98ff45 1px,transparent 1px),linear-gradient(90deg,#6c98ff45 1px,transparent 1px);background-size:64px 64px;transform:perspective(520px) rotateX(64deg);transform-origin:50% 100%;-webkit-mask-image:linear-gradient(to top,#000 0%,#0008 40%,transparent 88%);mask-image:linear-gradient(to top,#000 0%,#0008 40%,transparent 88%);animation:s3d-floor 5s linear infinite}
  html.s3d .hero::after{opacity:.8;bottom:0;height:55%}
  @keyframes s3d-floor{to{background-position:0 64px,0 0}}

  /* Cards tilt toward the pointer with a moving highlight; their icons and titles sit
     forward in depth. Transform is the card's own; the hover lift is folded in via --lift. */
  html.s3d .s3d-tilt{position:relative;transform-style:preserve-3d;transform:perspective(900px) rotateX(var(--tx,0deg)) rotateY(var(--ty,0deg)) translate3d(0,var(--lift,0px),0);transition:transform .6s cubic-bezier(.16,1,.3,1)}
  html.s3d .s3d-tilt.s3d-active{transition:transform .12s linear}
  html.s3d .s3d-glare{position:absolute;inset:0;z-index:3;border-radius:inherit;pointer-events:none;background:radial-gradient(circle at var(--gx,50%) var(--gy,50%),#b4cbff2e,transparent 58%);opacity:0;transition:opacity .45s}
  html.s3d .s3d-tilt.s3d-active .s3d-glare{opacity:1}
  html.s3d .s3d-tilt .service-icon,html.s3d .s3d-tilt .promise-check{translate:0 0 42px}
  html.s3d .s3d-tilt h3{translate:0 0 26px}

  /* Card grids rise and unfold into place, tied directly to the scroll position. */
  html.s3d .s3d-unfold{transform:perspective(1400px) rotateX(var(--ux,0deg)) translate3d(0,var(--uy,0px),0);transform-origin:50% 100%}

  /* Primary buttons lean toward the pointer. */
  html.s3d .s3d-magnet{transition:translate .5s cubic-bezier(.16,1,.3,1)}
  html.s3d .s3d-magnet.s3d-pull{transition:translate .1s linear}
}
