/* ==========================================================================
   nexus-store — page smoke + footer edge — nx-smoke.rN.css (behaviour: nx-smoke.rN.js)
   2026-10-16, Rich: "more smoke in key places without going over the top, maybe scroll related"; "the footer needs
   a fade at the bottom". Same soft-blob smoke as the shelves panel (radial gradients, transform/opacity only).
   ".rN" = Cloudflare cache-buster: bump N (file name + config/theme.yml) on every change.
     1 tokens      3 hero smoke (scroll)      5 footer smoke bank
     2 footer edge 4 section-title puff       6 phone / reduced motion
   Every smoke layer is added by the script (aria-hidden, pointer-events none); without it only §2 applies.
   ========================================================================== */

/* 1. Tokens: literal colours live only here */
:root {
  --nxsm-smoke: rgba(200, 215, 190, .10);
  --nxsm-smoke-green: rgba(142, 179, 100, .12);
  --nxsm-fade: rgba(3, 5, 3, .92);           /* the page's darkest green-black, the footer fades into it */
}

/* 2. Footer edge. blockwishlist parks its (fixed-position) dialog holders after the CE footer; the empty inline-flex
   one with a 12px margin made a ~23px strip of bare page texture under the footer. Take them out of the flow (their
   dialogs are position: fixed, so they still open), and fade the footer's last 160px into the page's darkest tone. */
#footer > .wishlist-add-to,
#footer > .wishlist-delete,
#footer > .wishlist-create,
#footer > .wishlist-login { position: absolute; left: 0; bottom: 0; margin: 0; }
#footer.nx-footer {
  position: relative;
  isolation: isolate;
  background: linear-gradient(to bottom, transparent calc(100% - 160px), var(--nxsm-fade));
}

/* shared: a layer of soft blobs */
.nx-smoke { position: absolute; pointer-events: none; overflow: hidden; }
.nx-smoke i {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--nxsm-smoke), transparent);
  will-change: transform;
  animation: nxsm-drift 24s ease-in-out infinite alternate;
  animation-play-state: paused;              /* runs only while the layer is on screen (.is-on, set by the script) */
}
.nx-smoke.is-on i { animation-play-state: running; }
.nx-smoke i:nth-child(2) { background: radial-gradient(closest-side, var(--nxsm-smoke-green), transparent); animation-duration: 30s; animation-delay: -8s; }
.nx-smoke i:nth-child(3) { animation-duration: 27s; animation-delay: -15s; }
@keyframes nxsm-drift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(80px, -25px, 0) scale(1.12); }
  100% { transform: translate3d(-60px, 20px, 0) scale(.95); }
}

/* 3. Hero: a bank of smoke along the bottom of the hero that rises, thickens and then thins as the page scrolls
   (--nxsm-p: 0 at the top, 1 once the hero has scrolled away; set by the script, one write per frame) */
.nx-smoke--hero {
  --nxsm-p: 0;
  inset: 0;
  z-index: 0;
}
.nx-smoke--hero ~ .elementor-container { position: relative; z-index: 1; }
.nx-smoke--hero .nx-smoke__lift {
  position: absolute;
  inset: 0;
  transform: translate3d(0, calc(var(--nxsm-p) * -180px), 0) scale(calc(1 + var(--nxsm-p) * .35));
  opacity: calc(.55 + var(--nxsm-p) * (1 - var(--nxsm-p)) * 1.8);
}
.nx-smoke--hero i { width: 760px; height: 340px; bottom: -150px; }
.nx-smoke--hero i:nth-child(1) { left: -160px; }
.nx-smoke--hero i:nth-child(2) { left: 32%; bottom: -190px; }
.nx-smoke--hero i:nth-child(3) { right: -200px; }

/* 4. Section titles: one soft puff blooms behind the title the first time it scrolls into view, then clears */
.nx-smoke-host { position: relative; isolation: isolate; }
.nx-smoke-puff {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  z-index: -1;
  pointer-events: none;
}
.nx-smoke-puff i {
  position: absolute;
  left: -230px;
  top: -90px;
  width: 460px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--nxsm-smoke), transparent);
  opacity: 0;
}
.nx-smoke-puff i:nth-child(2) { left: -150px; top: -70px; width: 300px; height: 140px; background: radial-gradient(closest-side, var(--nxsm-smoke-green), transparent); }
.nx-smoke-host.is-puffed .nx-smoke-puff i { animation: nxsm-puff 3.2s ease-out both; }
.nx-smoke-host.is-puffed .nx-smoke-puff i:nth-child(2) { animation-delay: .25s; }
@keyframes nxsm-puff {
  0%   { opacity: 0; transform: translate3d(0, 24px, 0) scale(.55); }
  35%  { opacity: 1; }
  100% { opacity: 0; transform: translate3d(0, -34px, 0) scale(1.5); }
}

/* 5. Footer: a low smoke bank drifting along the footer's top edge (clipped to its own box: no sideways scroll) */
.nx-smoke--footer { left: 0; right: 0; top: -140px; height: 300px; z-index: -1; }
.nx-smoke--footer i { width: 680px; height: 260px; top: 30px; }
.nx-smoke--footer i:nth-child(1) { left: -120px; }
.nx-smoke--footer i:nth-child(2) { left: 38%; top: 60px; }
.nx-smoke--footer i:nth-child(3) { right: -160px; top: 10px; }

/* 6. Phones: smaller and two blobs; reduced motion: no smoke layers at all (the footer edge stays) */
@media (max-width: 767px) {
  .nx-smoke i:nth-child(3) { display: none; }
  .nx-smoke--hero i { width: 420px; height: 220px; bottom: -110px; }
  .nx-smoke--footer i { width: 380px; height: 180px; }
  .nx-smoke-puff i { left: -150px; width: 300px; }
}
@media (prefers-reduced-motion: reduce) {
  .nx-smoke, .nx-smoke-puff { display: none !important; }
}
