/* V89 — global motion layer (paired with assets/js/nexus-motion.js).
   Three ingredients, loaded on every layout page:
     1. #nx-ambient — living background: two brand-tinted aurora blobs drifting
        behind all content (transform-only, GPU composited, no blur filters).
     2. Scroll reveals — elements fade/rise as they enter the viewport. The
        hidden initial state only applies under html.nx-motion-on, which the JS
        sets before first paint, so pages without JS (or with reduced motion)
        render fully visible.
     3. Hover polish — cursor spotlight on cards, breathing glow on primary CTAs.
   Everything degrades to static under prefers-reduced-motion. */

/* ---------- 1. ambient background ---------- */
#nx-ambient { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
#nx-ambient i {
  position: absolute; display: block; border-radius: 50%;
  will-change: transform;
}
#nx-ambient .nx-amb-a {
  width: 62vw; height: 62vw; left: -18vw; top: -24vw;
  background: radial-gradient(circle, rgba(69, 248, 130, 0.075), transparent 62%);
  animation: nxAmbA 76s ease-in-out infinite alternate;
}
#nx-ambient .nx-amb-b {
  width: 56vw; height: 56vw; right: -20vw; bottom: -26vw;
  background: radial-gradient(circle, rgba(77, 120, 255, 0.06), transparent 62%);
  animation: nxAmbB 94s ease-in-out infinite alternate;
}
#nx-ambient .nx-amb-c {
  width: 30vw; height: 30vw; left: 38vw; top: 30vh;
  background: radial-gradient(circle, rgba(69, 248, 130, 0.035), transparent 60%);
  animation: nxAmbA 112s ease-in-out infinite alternate-reverse;
}
@keyframes nxAmbA {
  from { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(9vw, 6vh, 0) scale(1.12); }
  to   { transform: translate3d(-5vw, 11vh, 0) scale(0.94); }
}
@keyframes nxAmbB {
  from { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(-8vw, -7vh, 0) scale(1.1); }
  to   { transform: translate3d(6vw, -12vh, 0) scale(0.92); }
}

/* ---------- 2. scroll reveals (scoped: only when JS armed them) ---------- */
@media (min-width: 768px) and (pointer: fine) {
  html.nx-motion-on .nx-reveal {
    opacity: 0; transform: translateY(16px);
    transition: opacity 0.55s cubic-bezier(0.22, 0.61, 0.36, 1),
                transform 0.55s cubic-bezier(0.22, 0.61, 0.36, 1);
  }
  html.nx-motion-on .nx-reveal.nx-in { opacity: 1; transform: none; }
}
/* Phones/tablets/touch: content is never hidden waiting for an observer. */
@media (max-width: 767px), (pointer: coarse) {
  html.nx-motion-on .nx-reveal { opacity: 1 !important; transform: none !important; }
}

/* ---------- 3. hover polish ---------- */
@media (pointer: fine) {
  .nx-spot { position: relative; }
  .nx-spot::after {
    content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
    background: radial-gradient(300px 180px at var(--nx-mx, 50%) var(--nx-my, -30%),
                rgba(69, 248, 130, 0.09), transparent 65%);
    opacity: 0; transition: opacity 0.25s ease;
  }
  .nx-spot:hover::after { opacity: 1; }
}

@keyframes nxCtaBreathe {
  0%, 100% { box-shadow: 0 12px 30px rgba(48, 235, 121, 0.18); }
  50%      { box-shadow: 0 14px 38px rgba(48, 235, 121, 0.34); }
}
html.nx-motion-on .nx40-btn-primary,
html.nx-motion-on .th-btn.style1 { animation: nxCtaBreathe 3.6s ease-in-out infinite; }
html.nx-motion-on .nx40-btn-primary:active,
html.nx-motion-on .th-btn.style1:active { transform: translateY(1px) scale(0.99); }

@media (prefers-reduced-motion: reduce) {
  #nx-ambient i { animation: none !important; }
  html.nx-motion-on .nx-reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  html.nx-motion-on .nx40-btn-primary, html.nx-motion-on .th-btn.style1 { animation: none !important; }
}

/* ---------- 4. micro cores (V91): tiny green motes rising through the void ---------- */
#nx-cores { position: absolute; inset: 0; }

/* Phones: keep the aurora tint but drop every animation frame of background work.
   The owner's call: the heavy background is not worth battery/jank on mobile. */
@media (max-width: 767px) {
  #nx-ambient i { animation: none !important; }
  #nx-ambient .nx-amb-c { display: none; }
  /* V93: the interactive cores DO run on phones (14 motes, transform-free canvas). */
}
