/* Scroll Video Animation - front end styles */

.sva-container {
	position: relative;
	height: var(--sva-scroll-length, 300vh);
	background: var(--sva-bg, #000);
}

/* When pinned, the video sticks to the top of the viewport for the
   entire scroll-length of its parent, then releases naturally when
   the parent's bottom edge reaches the viewport top. */
.sva-container[data-pin="1"] .sva-sticky {
	position: sticky;
	top: 0;
	height: 100vh;
	width: 100%;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Non-pinned mode: video just plays inline as it scrolls through view. */
.sva-container[data-pin="0"] .sva-sticky {
	position: relative;
	height: 100vh;
	width: 100%;
	overflow: hidden;
}

.sva-video {
	width: 100%;
	height: 100%;
	display: block;
	/* object-fit is set inline (cover/contain) per-instance so it is not overridden here */
	background: var(--sva-bg, #000);

	/* GPU-friendly, does not touch pixel data / re-encode, so original
	   video sharpness is fully preserved. */
	will-change: auto;
	backface-visibility: hidden;
}

.sva-loading {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
	opacity: 1;
	transition: opacity 0.4s ease;
}

.sva-container.sva-ready .sva-loading {
	opacity: 0;
}

.sva-loading span {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: 3px solid rgba(255, 255, 255, 0.25);
	border-top-color: rgba(255, 255, 255, 0.9);
	animation: sva-spin 0.9s linear infinite;
}

@keyframes sva-spin {
	to {
		transform: rotate(360deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.sva-container {
		height: auto;
	}
	.sva-container[data-pin="1"] .sva-sticky,
	.sva-container[data-pin="0"] .sva-sticky {
		position: relative;
		height: auto;
	}
	.sva-video {
		height: auto;
	}
}
