/**
 * Homepage Hero (Ceremony) block — frontend styles.
 * ScrollTrigger pin; grid-stacked frames; mobile 3-line hero and final.
 */

/* Contain stacking so pinned hero and animated layers stay below header/nav (header uses z-index 600) */
.wp-block-colab-homepage-hero.colab-hero-ceremony {
	height: auto;
	position: relative;
	z-index: 0;
	isolation: isolate;
	background: var(--wp--preset--color--navy);
}
.wp-block-colab-homepage-hero.colab-hero-ceremony:before {
	content: '';
	position: absolute;
	top: -2px;
	left: 0;
	width: 100%;
	height: 4px;
	background: var(--wp--preset--color--navy);
}

.colab-hero-ceremony__scroll-wrap {
	display: block;
	position: relative;
}

/* FOUC: hide frame 1 until JS has run (positioning, header height, etc.); .no-js removed in initBlock */
.colab-hero-ceremony.no-js .colab-hero-ceremony__hero,
.colab-hero-ceremony.no-js .colab-hero-ceremony__scroll-hint {
	visibility: hidden;
}

/* Height = viewport minus header; use 100dvh on mobile so no gap when browser chrome shows/hides.
   Fallback 80px reduces vertical shift until theme script sets --colab-header-height. */
.colab-hero-ceremony__group {
	display: grid;
	height: calc(100vh - var(--colab-header-height, 80px));
	height: calc(100dvh - var(--colab-header-height, 80px));
	overflow: hidden;
}

.colab-hero-ceremony__group > .colab-hero-ceremony__hero,
.colab-hero-ceremony__group > .colab-hero-ceremony__expand-wrap,
.colab-hero-ceremony__group > .colab-hero-ceremony__gradient-overlay,
.colab-hero-ceremony__group > .colab-hero-ceremony__final {
	grid-area: 1 / 1;
	min-height: 0;
	height: 100%;
}

/* Sticky scroll hint: on top in every frame, bottom center; fades out in last frame (opacity set by JS) */
.colab-hero-ceremony__scroll-hint {
	grid-area: 1 / 1;
	z-index: 500;
	align-self: end;
	justify-self: center;
	margin-bottom: 1.5rem;
	padding: 0.5rem 0.75rem;
	background: none;
	border: none;
	border-radius: 0;
	color: #fff;
	cursor: pointer;
	pointer-events: auto;
	transition: opacity 0.4s ease;
}

.colab-hero-ceremony__scroll-hint:focus-visible {
	outline: none;
}

.colab-hero-ceremony__scroll-hint-arrow {
	display: inline-block;
	font-family: "DM Sans", sans-serif;
	font-weight: 300;
	font-size: 2.5rem;
	line-height: 1;
	rotate: 135deg;
}

.colab-hero-ceremony__hero {
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--wp--preset--color--navy);
}

.colab-hero-ceremony__hero-line {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 0;
	margin: 0;
	font-size: inherit;
	font-weight: inherit;
}

.colab-hero-ceremony__word {
	font-size: clamp(32px, 4.6vw, 68px);
	font-weight: 300;
	color: #fff;
	line-height: 1.2;
	white-space: nowrap;
	padding-left: 0.25rem;
	padding-right: 0.25rem;
	-webkit-mask-image: linear-gradient(90deg, #fff 33.3%, rgba(255, 255, 255, 0.04) 66.6%);
	mask-image: linear-gradient(90deg, #fff 33.3%, rgba(255, 255, 255, 0.04) 66.6%);
	-webkit-mask-size: 300% 100%;
	mask-size: 300% 100%;
	-webkit-mask-position: 100% 0;
	mask-position: 100% 0;
}

@media (min-width: 768px) {
	.colab-hero-ceremony__hero-line .colab-hero-ceremony__word {
		padding-left: 0.5rem;
		padding-right: 0.5rem;
	}
}

.colab-hero-ceremony__word.is-revealed {
	-webkit-mask-position: 0 0;
	mask-position: 0 0;
}

/* No horizontal margin when closed so desktop reads as one sentence; match word spacing when open */
.colab-hero-ceremony__img-token {
	display: inline-flex;
	align-items: center;
	height: clamp(32px, 4.6vw, 68px);
	margin-left: 0;
	margin-right: 0;
}

.colab-hero-ceremony__img-token.is-open {
	margin-left: 0.25rem;
	margin-right: 0.25rem;
}

.colab-hero-ceremony__img-window {
	display: inline-block;
	width: 0;
	height: 100%;
	border-radius: 8px;
	overflow: hidden;
	opacity: 0;
	flex-shrink: 0;
}

.colab-hero-ceremony__img-window img,
.colab-hero-ceremony__img-placeholder {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: inherit;
	display: block;
}

.colab-hero-ceremony__img-placeholder {
	background: rgba(255, 255, 255, 0.15);
	min-width: 50px;
	min-height: 100%;
}

.colab-hero-ceremony__img-token.is-open .colab-hero-ceremony__img-window {
	width: clamp(50px, 7vw, 105px);
	opacity: 1;
}

.colab-hero-ceremony__expand-wrap {
	position: relative;
	width: 100%;
	height: 100%;
	z-index: 2;
	pointer-events: none;
	display: flex;
	align-items: center;
	justify-content: center;
	visibility: hidden;
}

.colab-hero-ceremony__scale-el {
	position: absolute;
	border-radius: 8px;
}

.colab-hero-ceremony__scale-photo {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: inherit;
}

/* Navy by default; animated gradient only when JS adds .is-visible (avoids FOUC). */
.colab-hero-ceremony__gradient-overlay {
	position: relative;
	width: 100%;
	height: 100%;
	z-index: 3;
	pointer-events: none;
	opacity: 0;
	visibility: hidden;
	background: var(--wp--preset--color--navy);
	overflow: hidden;
}

/* Fallback gradient when WebGL is unavailable; same colors as mesh (navy, blue, coral, tan). */
.colab-hero-ceremony__gradient-fallback {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	background: linear-gradient(
		135deg,
		var(--wp--preset--color--navy) 0%,
		var(--wp--preset--color--blue) 33%,
		var(--wp--preset--color--coral) 66%,
		var(--wp--preset--color--tan) 100%
	);
}

/* When WebGL canvas is active, hide the fallback so the mesh is visible. */
.colab-hero-ceremony__gradient-overlay.has-canvas .colab-hero-ceremony__gradient-fallback {
	visibility: hidden;
	pointer-events: none;
}

/* WebGL gradient canvas: noise-based flowing gradient (navy, blue, coral, tan). */
.colab-hero-ceremony__gradient-canvas {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	display: block;
}

.colab-hero-ceremony__final {
	position: relative;
	width: 100%;
	height: 100%;
	z-index: 4;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: visible;
	opacity: 0;
	visibility: hidden;
}

/* Transparent so the animated gradient overlay shows through the final frame. */
.colab-hero-ceremony__aurora-bg {
	position: absolute;
	inset: 0;
	background: transparent;
}

.colab-hero-ceremony__final-content {
	position: relative;
	z-index: 10;
	text-align: center;
	padding: 0 40px;
}

.colab-hero-ceremony__final-headline {
	font-size: clamp(28px, 4.4vw, 64px);
	font-weight: 300;
	color: #fff;
	line-height: 1.3;
	opacity: 0;
	transform: translateY(24px);
	margin: 0;
	transition: opacity 1s ease, transform 1s ease;
}

.colab-hero-ceremony__final-headline span,
.colab-hero-ceremony__final-headline-line {
	display: block;
}

.colab-hero-ceremony__final-headline.is-visible {
	opacity: 1;
	transform: translateY(0);
}

.colab-hero-ceremony__final-headline-line {
	opacity: 0;
	transform: translateY(16px);
	transition: opacity 0.5s ease, transform 0.5s ease;
}

/* Final frame: lines are animated by GSAP timeline (sequential reveal); no transition so GSAP controls them */
.colab-hero-ceremony__final-headline-line {
	transition: none;
}

.colab-hero-ceremony__final-headline-line.is-visible {
	opacity: 1;
	transform: translateY(0);
}

.colab-hero-ceremony__chat-cta {
	position: absolute;
	z-index: 400;
	width: 120px;
	height: 120px;
	border-radius: 50%;
	background: #deb282;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: .75rem 0.5rem 0;
	text-align: center;
	font-size: 1rem;
	font-weight: 400;
	color: var(--wp--preset--color--navy);
	line-height: 1.1;
	text-decoration: none;
	opacity: 0;
	pointer-events: none;
	transform: translate(-50%, -50%) scale(0.85);
	transition: opacity 0.7s ease 0.4s, transform 0.15s ease;
	will-change: transform, left, top;
	cursor: pointer;
}

.colab-hero-ceremony__chat-cta.is-visible {
	opacity: 1;
	pointer-events: all;
}

.colab-hero-ceremony__chat-cta.is-hovered {
	transform: translate(-50%, -50%) scale(1.12);
}

.colab-hero-ceremony__chat-cta-label {
	display: block;
}

.colab-hero-ceremony__chat-cta-arrow {
	display: block;
	margin-top: 4px;
	font-size: 1em;
	line-height: 1;
}

.colab-hero-ceremony__chat-cta:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 4px;
}

body.colab-hero-cursor-hidden,
body.colab-hero-cursor-hidden * {
	cursor: none !important;
}

/* Hide custom cursor (CTA) when user has left the section; it reappears on re-enter */
.colab-hero-ceremony--cursor-hidden .colab-hero-ceremony__chat-cta {
	visibility: hidden !important;
	opacity: 0 !important;
	pointer-events: none !important;
}

@media (max-width: 767px) {
	.colab-hero-ceremony__hero-line {
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 0.4em;
	}

	.colab-hero-ceremony__hero-line-before,
	.colab-hero-ceremony__hero-line-after {
		display: block;
		text-align: center;
	}

	.colab-hero-ceremony__hero-line-before .colab-hero-ceremony__word,
	.colab-hero-ceremony__hero-line-after .colab-hero-ceremony__word {
		-webkit-mask-image: none;
		mask-image: none;
		display: inline;
		white-space: normal;
	}

	.colab-hero-ceremony__img-token {
		display: flex;
		align-items: center;
		justify-content: center;
		overflow: hidden;
		min-height: 0;
		height: 0;
	}

	.colab-hero-ceremony__img-token.is-open {
		height: clamp(40px, 12vw, 80px);
	}

	.colab-hero-ceremony__img-token.is-open .colab-hero-ceremony__img-window {
		width: clamp(60px, 18vw, 120px);
	}

	.colab-hero-ceremony__final-headline-line:nth-child(1) { transition-delay: 0s; }
	.colab-hero-ceremony__final-headline-line:nth-child(2) { transition-delay: 0.15s; }
	.colab-hero-ceremony__final-headline-line:nth-child(3) { transition-delay: 0.3s; }

	/* Never show the custom cursor (CTA) on mobile */
	.colab-hero-ceremony__chat-cta {
		display: none !important;
	}
}

.colab-hero-ceremony.no-js .colab-hero-ceremony__word {
	-webkit-mask-position: 0 0;
	mask-position: 0 0;
}

.colab-hero-ceremony.no-js .colab-hero-ceremony__img-token .colab-hero-ceremony__img-window {
	width: clamp(50px, 7vw, 105px);
	opacity: 1;
}

/* no-js: keep final frame hidden so we don't FOUC the gradient; hero (navy) remains the only visible frame */
