/**
 * Next — Motion Framework  — core styles
 */

/* Elements wait invisible until the engine picks them up.
   If JS fails or reduced-motion is on, the engine reveals them instantly. */
[data-next]:not([data-next="parallax"]):not([data-next="counter"]) {
	opacity: 0;
}

/* Elementor Free: CSS class triggers — hide until engine bridges them */
.next-fade-up, .next-fade-down, .next-fade-in, .next-fade-start, .next-fade-end,
.next-scale-in, .next-clip-reveal, .next-split-words, .next-split-lines,
.next-split-chars, .next-stagger {
	opacity: 0;
}

/* No-JS safety net */
.no-js [data-next],
body.elementor-editor-active [data-next] {
	opacity: 1 !important;
}

/* Split text structure */
.next-line-mask {
	overflow: hidden;
	display: block;
}
.next-word,
.next-char {
	display: inline-block;
	will-change: transform, opacity;
}

/* Brand helpers — optional utility classes driven by the Brand Panel */
.next-bg        { background-color: var(--next-bg); }
.next-text      { color: var(--next-text); }
.next-muted     { color: var(--next-muted); }
.next-primary   { color: var(--next-primary); }
.next-fill      { background-color: var(--next-primary); }
.next-heading   { font-family: var(--next-font-heading); }
.next-body      { font-family: var(--next-font-body); }

/* Reduced motion: kill everything, show everything */
@media (prefers-reduced-motion: reduce) {
	[data-next] { opacity: 1 !important; transform: none !important; clip-path: none !important; }
}

/* ── Widget safety ─────────────────────────────────────────────────────
   Next widget wrappers (nxt-*) must never be hidden.
   data-next elements INSIDE widgets start visible; the widget JS
   handles their animation independently via its own scroll triggers. */
.nxt-sticky-cards,
.nxt-sticky-cards *,
.nxt-pinned-text,
.nxt-pinned-text *,
.nxt-hs-outer,
.nxt-hs-outer *,
.nxt-hero,
.nxt-marquee,
.nxt-marquee *,
.nxt-before-after,
.nxt-before-after *,
.nxt-preloader { opacity: 1 !important; }

/* data-next inside widgets: let the widget own the animation */
.nxt-hero [data-next],
.nxt-pinned-text [data-next],
.nxt-sticky-cards [data-next] { opacity: 0; }

/* ── Sticky integrity inside Elementor ─────────────────────────
   position:sticky dies if any ancestor has overflow:hidden.
   These rules keep the chain open for Next scroll widgets only. */
.elementor-widget:has(.nxt-dive),
.elementor-widget:has(.nxt-sticky-cards),
.elementor-widget:has(.nxt-pinned-text),
.elementor-widget:has(.nxt-hs-outer),
.e-con:has(.nxt-dive),
.e-con:has(.nxt-sticky-cards),
.e-con:has(.nxt-pinned-text),
.e-con:has(.nxt-hs-outer),
.elementor-widget-wrap:has(.nxt-dive),
.elementor-widget-wrap:has(.nxt-sticky-cards),
.elementor-widget-wrap:has(.nxt-pinned-text),
.elementor-widget-wrap:has(.nxt-hs-outer) {
	overflow: visible !important;
}

/* Scroll widgets need full-bleed width — kill Elementor gutters around them */
.elementor-widget-next-dive-scenes,
.elementor-widget-next-sticky-cards,
.elementor-widget-next-horizontal-scroll,
.elementor-widget-next-hero-scrolly {
	width: 100%;
}

/* GPU hints for buttery scrub */
.nxt-dv-bg, .nxt-sc-card, .nxt-hs-track {
	transform: translateZ(0);
	backface-visibility: hidden;
}
