/**
 * Scroll Cinema — sticky pin, full-bleed → inset morph card.
 */

/* Widget wrappers must not clip the tall scroll track / pin. */
.elementor-widget-eaw-scroll-cinema,
.elementor-widget-eaw-scroll-cinema > .elementor-widget-container,
.eaw-sc,
.eaw-sc__track {
	overflow: visible !important;
}

.eaw-sc {
	--eaw-sc-scroll: 380vh;
	--eaw-sc-radius: 32px;
	--eaw-sc-inset: 24px;
	--eaw-sc-mobile-end: 78vh;
	--eaw-sc-p-radius: 0px;
	--eaw-sc-p-scale: 1;
	--eaw-sc-p-video: 0;
	--eaw-sc-p-poster: 1;
	--eaw-sc-p-veil: 0;
	--eaw-sc-p-c1: 0;
	--eaw-sc-p-c2: 0;
	--eaw-sc-p-c3: 0;
	display: block;
	width: 100%;
	isolation: isolate;
}

.eaw-sc__track {
	position: relative;
	height: var(--eaw-sc-scroll);
	width: 100%;
}

.eaw-sc__sticky {
	position: sticky;
	top: 0;
	height: 100vh;
	height: 100dvh;
	width: 100%;
	overflow: hidden;
	display: flex;
	align-items: stretch;
	justify-content: center;
	box-sizing: border-box;
}

/* JS pin mode — absolute/fixed is driven by scroll-cinema.js (Elementor-safe). */
.eaw-sc--js-pin .eaw-sc__sticky {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100vh;
	height: 100dvh;
	margin: 0;
	max-width: 100%;
	box-sizing: border-box;
}

.eaw-sc--js-pin .eaw-sc__sticky.is-pinned {
	position: fixed;
	right: auto;
	bottom: auto;
}

.eaw-sc--js-pin .eaw-sc__sticky.is-after-mobile {
	/* Height eased in JS — keep width full track, mild scale only */
	max-width: 100%;
}

@media (max-width: 767px) {
	.eaw-sc {
		--eaw-sc-p-scale: 1;
	}

	.eaw-sc.is-mobile-end .eaw-sc__stage,
	.eaw-sc.is-finished .eaw-sc__stage {
		/* Soften final scale on phones (JS also caps ~0.94+) */
		transform: scale(max(0.94, var(--eaw-sc-p-scale)));
	}
}

.eaw-sc__stage {
	position: relative;
	flex: 1 1 auto;
	width: 100%;
	height: 100%;
	min-height: 100%;
	margin: auto;
	border-radius: var(--eaw-sc-p-radius);
	overflow: hidden;
	background: #221e1f;
	transform: scale(var(--eaw-sc-p-scale));
	transform-origin: center center;
	will-change: transform, border-radius;
	backface-visibility: hidden;
}

.eaw-sc__media {
	position: absolute;
	inset: 0;
	z-index: 0;
	width: 100%;
	height: 100%;
	overflow: hidden;
}

.eaw-sc__video,
.eaw-sc__poster,
.eaw-sc__end {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	min-width: 100%;
	min-height: 100%;
	object-fit: cover;
	object-position: center center;
	display: block;
}

/* Layers: end (bottom) → poster → video (top) */
.eaw-sc__end {
	opacity: 1;
	z-index: 0;
	pointer-events: none;
}

.eaw-sc__poster {
	z-index: 1;
	opacity: var(--eaw-sc-p-poster);
	pointer-events: none;
	transition: opacity 0.35s ease;
}

.eaw-sc__video {
	z-index: 2;
	opacity: var(--eaw-sc-p-video);
	background: transparent;
	transition: opacity 0.35s ease;
}

/* Until video has frames: keep poster fully visible. */
.eaw-sc--video-loading {
	--eaw-sc-p-video: 0;
	--eaw-sc-p-poster: 1;
}

.eaw-sc--video-loading .eaw-sc__video {
	opacity: 0 !important;
}

.eaw-sc--no-video .eaw-sc__video {
	display: none;
}

.eaw-sc:not(:has(.eaw-sc__poster)) {
	--eaw-sc-p-poster: 0;
}

.eaw-sc__end--empty {
	background: linear-gradient(160deg, #221e1f 0%, #2a4544 55%, #35b3af 140%);
}

.eaw-sc__veil {
	position: absolute;
	inset: 0;
	z-index: 2;
	background: linear-gradient(
		180deg,
		rgba(34, 30, 31, 0.15) 0%,
		rgba(34, 30, 31, 0.35) 45%,
		rgba(34, 30, 31, 0.72) 100%
	);
	opacity: var(--eaw-sc-p-veil);
	pointer-events: none;
}

.eaw-sc__content {
	position: relative;
	z-index: 2;
	height: 100%;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	justify-content: center;
	gap: 1rem;
	padding: clamp(1.25rem, 4vw, 2.5rem);
	margin-inline: auto;
	box-sizing: border-box;
	pointer-events: none;
}

.eaw-sc.is-finished .eaw-sc__content,
.eaw-sc.has-content .eaw-sc__content,
.eaw-sc--preview-finished .eaw-sc__content,
.eaw-sc--preview-mid .eaw-sc__content {
	pointer-events: auto;
}

/* Staggered enter: title → description → button */
.eaw-sc__title,
.eaw-sc__desc,
.eaw-sc__btn {
	opacity: 0;
	transform: translate3d(0, 22px, 0);
	will-change: opacity, transform;
}

.eaw-sc__title {
	margin: 0;
	width: 100%;
	font-size: clamp(1.6rem, 4.2vw, 2.75rem);
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: -0.02em;
	text-align: center;
	opacity: var(--eaw-sc-p-c1);
	transform: translate3d(0, calc((1 - var(--eaw-sc-p-c1)) * 22px), 0);
}

.eaw-sc__desc {
	margin: 0;
	width: 100%;
	font-size: clamp(0.95rem, 2vw, 1.125rem);
	line-height: 1.7;
	max-width: 36em;
	text-align: center;
	opacity: var(--eaw-sc-p-c2);
	transform: translate3d(0, calc((1 - var(--eaw-sc-p-c2)) * 22px), 0);
}

.eaw-sc__content .eaw-sc__desc {
	/* keep subtitle readable when left/right aligned */
	max-width: 100%;
}

.eaw-sc__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	align-self: center;
	width: fit-content;
	max-width: 100%;
	margin-top: 0.5rem;
	text-decoration: none;
	font-weight: 600;
	line-height: 1.2;
	border-style: solid;
	border-width: 0;
	border-color: transparent;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
	opacity: var(--eaw-sc-p-c3);
	transform: translate3d(0, calc((1 - var(--eaw-sc-p-c3)) * 18px), 0);
	pointer-events: none;
	box-sizing: border-box;
}

.eaw-sc__btn--normal {
	background-color: #35b3af;
	color: #fff;
	border-width: 0;
	box-shadow: 0 8px 24px rgba(53, 179, 175, 0.35);
}

.eaw-sc__btn--glass {
	background-color: rgba(255, 255, 255, 0.18);
	color: #fff;
	border-width: 1px;
	border-color: rgba(255, 255, 255, 0.45);
	backdrop-filter: blur(16px) saturate(160%);
	-webkit-backdrop-filter: blur(16px) saturate(160%);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.35),
		0 10px 28px rgba(0, 0, 0, 0.12);
}

.eaw-sc.has-content .eaw-sc__btn,
.eaw-sc.is-finished .eaw-sc__btn {
	pointer-events: auto;
}

.eaw-sc__btn--normal:hover {
	filter: brightness(1.05);
}

.eaw-sc__btn--glass:hover {
	filter: none;
	background-color: rgba(255, 255, 255, 0.28);
}

@media (max-width: 767px) {
	.eaw-sc.is-mobile-end .eaw-sc__stage {
		min-height: 100%;
	}
}

.eaw-sc__btn:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 3px;
}

/* Elementor editor: always show finished card + live content */
.eaw-sc--edit .eaw-sc__track {
	height: min(var(--eaw-sc-scroll), 70vh);
	min-height: 420px;
}

.eaw-sc--edit .eaw-sc__sticky {
	position: relative;
	height: 100%;
	min-height: 420px;
}

.eaw-sc--edit {
	--eaw-sc-p-radius: var(--eaw-sc-radius);
	--eaw-sc-p-scale: 0.88;
	--eaw-sc-p-video: 0;
	--eaw-sc-p-poster: 0;
	--eaw-sc-p-veil: 1;
	--eaw-sc-p-c1: 1;
	--eaw-sc-p-c2: 1;
	--eaw-sc-p-c3: 1;
}

.eaw-sc--edit .eaw-sc__content {
	pointer-events: auto !important;
}

.eaw-sc--edit .eaw-sc__title,
.eaw-sc--edit .eaw-sc__desc,
.eaw-sc--edit .eaw-sc__btn {
	opacity: 1 !important;
	transform: none !important;
}

.eaw-sc--edit .eaw-sc__video,
.eaw-sc--edit .eaw-sc__poster {
	display: none !important;
}

.eaw-sc--edit .eaw-sc__end {
	opacity: 1 !important;
}

.eaw-sc--edit.eaw-sc--edit-no-media .eaw-sc__stage {
	background: #221e1f;
}

.eaw-sc--edit.eaw-sc--edit-no-media .eaw-sc__end--empty {
	display: none !important;
}

.eaw-sc--preview-finished,
.eaw-sc.is-finished,
.eaw-sc.is-reduced {
	--eaw-sc-p-radius: var(--eaw-sc-radius);
	--eaw-sc-p-scale: 0.88;
	--eaw-sc-p-video: 0;
	--eaw-sc-p-poster: 0;
	--eaw-sc-p-veil: 1;
	--eaw-sc-p-c1: 1;
	--eaw-sc-p-c2: 1;
	--eaw-sc-p-c3: 1;
}

.eaw-sc--no-video {
	--eaw-sc-p-video: 0;
}

.eaw-sc.is-finished .eaw-sc__video,
.eaw-sc.is-reduced .eaw-sc__video,
.eaw-sc--no-video .eaw-sc__video {
	opacity: 0;
}

.eaw-sc.is-finished .eaw-sc__poster,
.eaw-sc.is-reduced .eaw-sc__poster {
	opacity: 0;
}

.eaw-sc.is-reduced .eaw-sc__track {
	height: auto;
	min-height: 100vh;
	min-height: 100dvh;
}

.eaw-sc.is-reduced .eaw-sc__sticky {
	position: relative;
}

@media (prefers-reduced-motion: reduce) {
	.eaw-sc:not(.eaw-sc--edit) {
		--eaw-sc-p-radius: var(--eaw-sc-radius);
		--eaw-sc-p-scale: 0.88;
		--eaw-sc-p-video: 0;
		--eaw-sc-p-poster: 0;
		--eaw-sc-p-veil: 1;
		--eaw-sc-p-c1: 1;
		--eaw-sc-p-c2: 1;
		--eaw-sc-p-c3: 1;
	}

	.eaw-sc:not(.eaw-sc--edit) .eaw-sc__track {
		height: auto;
		min-height: 100vh;
		min-height: 100dvh;
	}

	.eaw-sc:not(.eaw-sc--edit) .eaw-sc__sticky {
		position: relative;
	}

	.eaw-sc:not(.eaw-sc--edit) .eaw-sc__video {
		opacity: 0;
	}

	.eaw-sc:not(.eaw-sc--edit) .eaw-sc__content {
		pointer-events: auto;
	}

	.eaw-sc:not(.eaw-sc--edit) .eaw-sc__title,
	.eaw-sc:not(.eaw-sc--edit) .eaw-sc__desc,
	.eaw-sc:not(.eaw-sc--edit) .eaw-sc__btn {
		transform: none;
	}
}
