/* Revvnue Section Stacking. A section pins to the top of the screen while the next section
   slides over it, like cards laid on top of each other. Optional effects darken, shrink, tilt,
   fade or drift the section underneath. Scroll progress comes from assets/js/stack.js, which
   sets --rv-cover (0 to 1) on each pinned section. */

/* The section after a pinned one must sit above it. Listed first so a pinned section that
   follows another pinned section keeps its own sticky rule below. */
.rv-sec-cover + *, .rv-sec-cover-dim + *, .rv-sec-cover-shrink + *, .rv-sec-cover-tilt + *,
.rv-sec-cover-fade + *, .rv-sec-cover-drift + *, .rv-sec-peek + * { position: relative; z-index: 2; }

.rv-sec-cover, .rv-sec-cover-dim, .rv-sec-cover-shrink, .rv-sec-cover-tilt,
.rv-sec-cover-fade, .rv-sec-cover-drift, .rv-sec-peek {
	--rv-sec-off: 0px; --rv-cover: 0;
	--rv-dim: .4; --rv-shrink: .06; --rv-round: 28px; --rv-blur: 8px; --rv-drift: .3; --rv-tilt: 5deg; --rv-peek: 28px;
	position: sticky; top: var(--rv-sec-off); z-index: 1;
	transform-origin: 50% 0;
}

/* Darken: a black layer that fades in as the next section covers this one */
.rv-sec-cover-dim::after, .rv-sec-cover-shrink::after, .rv-sec-cover-tilt::after,
.rv-sec-cover-drift::after, .rv-sec-peek::after {
	content: ""; position: absolute; inset: 0; z-index: 99; pointer-events: none; border-radius: inherit;
	background: #000; opacity: calc(var(--rv-dim) * var(--rv-cover));
}

/* 2. Slide over and darken: default amount is the base --rv-dim */

/* 3. Slide over and shrink back, corners round as it goes */
.rv-sec-cover-shrink { --rv-dim: .25; overflow: clip;
	transform: scale(calc(1 - var(--rv-shrink) * var(--rv-cover)));
	border-radius: calc(var(--rv-round) * var(--rv-cover)); }

/* 4. Slide over and tilt back, like a card leaning away */
.rv-sec-cover-tilt { --rv-dim: .25; overflow: clip; transform-origin: 50% 100%;
	transform: perspective(1400px) rotateX(calc(var(--rv-tilt) * var(--rv-cover))) scale(calc(1 - var(--rv-shrink) * var(--rv-cover)));
	border-radius: calc(var(--rv-round) * var(--rv-cover)); }

/* 5. Slide over and fade, with a soft blur */
.rv-sec-cover-fade { --rv-dim: .8;
	opacity: calc(1 - var(--rv-dim) * var(--rv-cover));
	filter: blur(calc(var(--rv-blur) * var(--rv-cover))); }

/* 6. Slide over with a slow upward drift (a curtain effect) */
.rv-sec-cover-drift { --rv-dim: .15;
	transform: translateY(calc(var(--rv-h, 0px) * var(--rv-drift) * var(--rv-cover) * -1)); }

/* 7. Stack with peek strips: each earlier section leaves a strip showing, like folder tabs */
.rv-sec-peek { --rv-dim: .2; --rv-round: 24px; overflow: clip;
	border-radius: var(--rv-round) var(--rv-round) 0 0; }

/* Never pin the last section on the page, and never pin while editing */
.rv-sec-last { position: relative !important; transform: none !important; filter: none !important; opacity: 1 !important; }
.rv-sec-last::after { display: none !important; }
.elementor-editor-active [class*="rv-sec-"] { position: relative !important; top: auto !important; transform: none !important; filter: none !important; opacity: 1 !important; border-radius: 0 !important; }
.elementor-editor-active [class*="rv-sec-"]::after { display: none !important; }

/* Turn off on smaller screens (the Turn off setting) */
@media (max-width: 1024px) {
	.rv-sec-off-tablet { position: relative !important; top: auto !important; transform: none !important; filter: none !important; opacity: 1 !important; border-radius: 0 !important; }
	.rv-sec-off-tablet::after { display: none !important; }
}
@media (max-width: 767px) {
	.rv-sec-off-mobile { position: relative !important; top: auto !important; transform: none !important; filter: none !important; opacity: 1 !important; border-radius: 0 !important; }
	.rv-sec-off-mobile::after { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
	.rv-sec-cover, .rv-sec-cover-dim, .rv-sec-cover-shrink, .rv-sec-cover-tilt,
	.rv-sec-cover-fade, .rv-sec-cover-drift, .rv-sec-peek { position: relative !important; top: auto !important; transform: none !important; filter: none !important; opacity: 1 !important; border-radius: 0 !important; }
	[class*="rv-sec-"]::after { display: none !important; }
}
