/* SHODIRA 3D layer: hero orbit scene, perspective grid floor, card tilt, depth reveal on scroll.
   Pure CSS transforms (no 3D library), so it stays light on mobile data.
   Everything here switches off for visitors who ask their device for reduced motion. */

/* ---------- Hero: grid floor running towards the viewer ---------- */
.hero::after {
  inset: auto -60% -2% -60%; height: 58%; opacity: .75;
  background-image: linear-gradient(rgba(42,140,255,.32) 1px, transparent 1px), linear-gradient(90deg, rgba(42,140,255,.32) 1px, transparent 1px);
  transform: perspective(520px) rotateX(64deg); transform-origin: 50% 100%;
  mask-image: linear-gradient(to top, #000 0%, rgba(0,0,0,.6) 40%, transparent 92%);
  -webkit-mask-image: linear-gradient(to top, #000 0%, rgba(0,0,0,.6) 40%, transparent 92%);
  animation: fx-floor 3.2s linear infinite;
}
@keyframes fx-floor { to { background-position: 0 48px, 0 0; } }

/* Floating light particles at three depths (made by fx3d.js) */
.fx-stars { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.fx-stars i {
  position: absolute; left: 0; top: 0; width: 2px; height: 2px; border-radius: 50%; background: transparent;
  transform: translate3d(var(--px, 0px), var(--py, 0px), 0); transition: transform .6s cubic-bezier(.2,.7,.2,1);
}

/* ---------- Hero: logo inside a 3D orbit ---------- */
.hero-logo.fx-on { perspective: 1100px; }
.fx-sway, .fx-tilt { position: absolute; inset: 0; transform-style: preserve-3d; }
.fx-sway { animation: fx-sway 12s ease-in-out infinite; }
.fx-tilt { transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .5s cubic-bezier(.2,.7,.2,1); }
@keyframes fx-sway { 0%,100% { transform: rotateY(-9deg) rotateX(4deg); } 50% { transform: rotateY(9deg) rotateX(-3deg); } }
.fx-core { position: absolute; inset: 12%; transform: translateZ(10px); transform-style: preserve-3d; }
.hero-logo.fx-on .fx-core img { display: block; }
.fx-halo {
  position: absolute; inset: 18%; border-radius: 50%; transform: translateZ(-60px);
  background: radial-gradient(circle, rgba(42,140,255,.55), rgba(42,140,255,0) 68%); filter: blur(6px);
}
.fx-ring {
  position: absolute; inset: 0; border-radius: 50%; transform-style: preserve-3d;
  border: 1.5px solid rgba(111,214,255,.55);
  box-shadow: 0 0 14px rgba(42,140,255,.45), inset 0 0 14px rgba(42,140,255,.3);
  animation: fx-orbit var(--spd, 9s) linear infinite;
}
.fx-ring i {
  position: absolute; top: -5px; left: 50%; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 10px 3px var(--cyan), 0 0 24px 6px rgba(42,140,255,.8);
}
.fx-ring-1 { --tilt: rotateX(68deg); --spd: 8s; }
.fx-ring-2 { --tilt: rotateY(58deg) rotateX(68deg); --spd: 11s; inset: -3%; border-color: rgba(42,140,255,.5); }
.fx-ring-3 { --tilt: rotateY(-58deg) rotateX(68deg); --spd: 14s; inset: 4%; border-width: 1px; border-color: rgba(111,214,255,.35); }
@media (max-width: 600px) { .hero .fx-ring { border-width: 2px; } }
@keyframes fx-orbit { from { transform: var(--tilt) rotateZ(0deg); } to { transform: var(--tilt) rotateZ(360deg); } }
.fx-paused .fx-ring, .fx-paused .fx-sway, .fx-paused::after, .fx-paused .fx-core img { animation-play-state: paused; }

/* Small orbit on the banner of inner pages (wide screens only) */
.page-hero { position: relative; overflow: hidden; }
.fx-mini { position: absolute; right: 6%; top: 50%; width: 190px; height: 190px; margin-top: -95px; perspective: 800px; pointer-events: none; opacity: .85; }
.fx-mini .fx-sway { animation-duration: 10s; }
.fx-mini .fx-ring-1 { inset: 0; }
.fx-mini .fx-ring-2 { inset: 8%; }
.fx-mini .fx-ring-3 { display: none; }
.fx-mini .fx-dot { position: absolute; inset: 40%; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff, var(--cyan) 30%, var(--blue) 65%, transparent 72%); box-shadow: 0 0 40px rgba(42,140,255,.7); }
@media (max-width: 900px) { .fx-mini { display: none; } }

/* ---------- Cards: tilt towards the pointer, with a light glare (mouse and trackpad only) ---------- */
.fx-tiltable { transform-style: preserve-3d; will-change: transform; }
.fx-tiltable::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255,255,255,.16), rgba(111,214,255,.06) 30%, transparent 60%);
}
.fx-tiltable.fx-tilting { transition: transform .12s ease-out, border-color .2s, box-shadow .2s; box-shadow: 0 24px 50px rgba(0,0,0,.45), 0 0 0 1px rgba(42,140,255,.35), 0 0 34px rgba(42,140,255,.18); }
.fx-tiltable.fx-tilting::after { opacity: 1; }
.fx-tiltable:not(.product-card) .icon, .fx-tiltable:not(.product-card) h3 { transition: transform .3s cubic-bezier(.2,.7,.2,1); }
.fx-tiltable.fx-tilting:not(.product-card) .icon { transform: translateZ(36px); }
.fx-tiltable.fx-tilting:not(.product-card) h3 { transform: translateZ(18px); }

/* ---------- Depth reveal: blocks rise out of the page as they scroll into view ---------- */
.fx-rev { opacity: 0; transform: perspective(900px) translate3d(0, 44px, -60px) rotateX(16deg); }
.fx-rev.fx-in {
  opacity: 1; transform: none;
  transition: opacity .7s ease var(--fx-d, 0s), transform .8s cubic-bezier(.16,.84,.3,1) var(--fx-d, 0s);
}

/* ---------- Reduced motion: keep it still ---------- */
@media (prefers-reduced-motion: reduce) {
  .hero::after, .fx-sway, .fx-ring, .fx-core img { animation: none !important; }
  .fx-stars i, .fx-tilt { transition: none; }
  .fx-rev { opacity: 1; transform: none; }
}
