/**
 * Hero Section Styles
 *
 * Full-screen hero with background image, gradient overlay,
 * glass badge, headline, CTAs, scroll indicator.
 * Animated canvas mode (scroll-driven 300vh container).
 */

/* ── Scroll Container (animated hero) ─────────────────── */

.hero-scroll-container {
	position: relative;
	height: 300vh;
	width: 100%;
	max-width: 100vw;
	overflow-x: hidden;
	margin-bottom: -2px; /* prevent line between sections */
}

/* ── Canvas Wrapper (sticky) ───────────────────────────── */

.hero-canvas-wrapper {
	position: sticky;
	top: 0;
	left: 0;
	width: 100%;
	min-height: 100vh;
	overflow: hidden;
	background: var(--color-bg);
	box-sizing: border-box;
}

#hero-canvas {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	display: block;
}

/* Gradient overlay - matches static hero style */
.hero-vignette {
	position: absolute;
	inset: 0;
	z-index: 5;
	pointer-events: none;
	overflow: hidden;
	box-sizing: border-box;
	background: linear-gradient(
		to bottom,
		rgba(var(--color-brand-rgb), 0.4) 0%,
		rgba(var(--color-brand-rgb), 0.05) 35%,
		transparent 55%,
		rgba(var(--color-bg-rgb), 0.5) 85%,
		var(--color-bg) 100%
	);
}

/* ── UI Overlay ────────────────────────────────────────── */

.hero-ui-overlay {
	position: absolute;
	inset: 0;
	z-index: 10;
	pointer-events: none;
	overflow: hidden;
	box-sizing: border-box;
}

.hero-text-block {
	position: absolute;
	width: auto;
	max-width: min(620px, 82vw);
	max-width: min(620px, 90vw);
	box-sizing: border-box;
	text-align: center;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	opacity: 0;
	pointer-events: none;
	padding: 1rem 1.5rem;
}

.hero-text-block--final {
	pointer-events: auto;
}

.hero-text-block h1 {
	font-family: var(--font-primary);
	font-size: clamp(1.8rem, 4vw, 3.2rem);
	font-weight: 900;
	letter-spacing: 0;
	color: #ffffff;
	line-height: 1.15;
	word-wrap: break-word;
	overflow-wrap: break-word;
	text-shadow:
		0 2px 10px rgba(0, 0, 0, 0.3);
}

.hero-glow-text {
	color: #ffffff;
	text-shadow:
		0 2px 10px rgba(0, 0, 0, 0.3);
}

.hero-subtext {
	font-size: clamp(1.5rem, 3.5vw, 2.4rem);
	font-weight: 800;
	letter-spacing: 0;
	color: rgba(255, 255, 255, 0.95);
	line-height: 1.4;
	word-wrap: break-word;
	overflow-wrap: break-word;
	text-shadow:
		0 2px 8px rgba(0, 0, 0, 0.25);
}

.hero-tagline {
	margin-top: 0.5rem;
	font-size: clamp(0.82rem, 1.6vw, 1.05rem);
	letter-spacing: 0;
	color: rgba(255, 255, 255, 0.9);
	font-weight: 500;
	text-shadow: 0 1px 6px rgba(0, 0, 0, 0.3);
}

/* ── CTA Button ────────────────────────────────────────── */

.hero-cta-btn {
	margin-top: 1.4rem;
	display: inline-block;
	padding: 0.75rem 2rem;
	max-width: 100%;
	box-sizing: border-box;
	font-family: var(--font-primary);
	font-size: 0.9rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	color: #ffffff;
	text-decoration: none;
	outline: none;
	cursor: pointer;
	border-radius: var(--radius-full);
	background: var(--color-brand);
	box-shadow: var(--shadow-lg);
	transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hero-cta-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 30px rgba(var(--color-brand-rgb), 0.35);
}

/* ── Scroll Indicator ──────────────────────────────────── */

.hero-scroll-indicator {
	position: absolute;
	bottom: 6vh;
	left: 50%;
	transform: translateX(-50%);
	z-index: 20;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.75rem;
}

.hero-scroll-indicator p {
	font-size: 0.6rem;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--color-brand);
	direction: ltr;
	opacity: 0.7;
}

.hero-scroll-line {
	display: block;
	width: 1px;
	height: 48px;
	background: linear-gradient(to bottom, var(--color-brand), transparent);
	transform-origin: top center;
	animation: hero-line-pulse 2.2s ease-in-out infinite;
}

@keyframes hero-line-pulse {
	0%   { transform: scaleY(0); opacity: 0; transform-origin: top; }
	40%  { transform: scaleY(1); opacity: 1; transform-origin: top; }
	60%  { transform: scaleY(1); opacity: 1; transform-origin: bottom; }
	100% { transform: scaleY(0); opacity: 0; transform-origin: bottom; }
}

/* ── Loading Screen ────────────────────────────────────── */

.hero-loading {
	position: fixed;
	inset: 0;
	z-index: 1000;
	background: var(--color-bg);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	gap: 1.5rem;
	overflow: hidden;
	max-width: 100vw;
	box-sizing: border-box;
	transition: opacity 0.7s ease, visibility 0.7s ease;
}

.hero-loading.hidden {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

.hero-loading__inner {
	text-align: center;
	max-width: 100%;
	overflow: hidden;
}

.hero-loading__bar-track {
	width: 240px;
	max-width: 80vw;
	height: 2px;
	background: rgba(var(--color-brand-rgb), 0.15);
	position: relative;
	overflow: hidden;
}

.hero-loading__bar-fill {
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	width: 0%;
	background: var(--color-brand);
	transition: width 0.1s linear;
}

.hero-loading__label {
	font-size: 0.75rem;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	letter-spacing: 0.18em;
	color: var(--color-brand);
	opacity: 0.6;
	font-weight: 600;
	text-transform: uppercase;
	direction: ltr;
}

/* ── Static Hero (non-canvas) ──────────────────────────── */

.hero-home {
	position: relative;
	min-height: 110dvh;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.hero-home__bg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	z-index: 0;
}

.hero-home__overlay {
	position: absolute;
	inset: 0;
	z-index: 1;
	background: linear-gradient(
		to bottom,
		rgba(var(--color-brand-rgb), 0.4) 0%,
		transparent 50%,
		var(--color-bg) 100%
	);
}

.hero-home__content {
	position: relative;
	z-index: 10;
	text-align: start;
	max-width: 56rem;
	width: 100%;
	padding: 0 var(--container-padding);
}

.hero-home__badge {
	display: inline-block;
	margin-bottom: 1.5rem;
	padding: 0.5rem 1rem;
	border-radius: var(--radius-full);
	background: var(--glass-bg);
	backdrop-filter: var(--glass-blur);
	-webkit-backdrop-filter: var(--glass-blur);
	border: 1px solid rgba(255, 255, 255, 0.3);
	color: var(--color-brand);
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	font-size: var(--fs-small);
}

.hero-home__headline {
	font-size: var(--fs-hero);
	font-weight: 900;
	color: var(--color-text);
	margin-bottom: 1.5rem;
	line-height: var(--lh-heading);
}

.hero-home__headline span,
.hero-home__headline .text-brand {
	color: var(--color-brand);
	font-style: italic;
}

.hero-home__tagline {
	font-size: clamp(1.125rem, 2vw, 1.5rem);
	color: var(--color-text-light);
	margin-bottom: 2.5rem;
	max-width: 40rem;
	font-weight: 500;
	line-height: var(--lh-body);
}

.hero-home__ctas {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	justify-content: flex-start;
}

.hero-home__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 1rem 2.5rem;
	border-radius: var(--radius-full);
	font-weight: 900;
	font-size: clamp(1rem, 1.5vw, 1.125rem);
	text-decoration: none;
	transition: all var(--transition-base);
	cursor: pointer;
}

.hero-home__cta--primary {
	background: var(--color-brand);
	color: #fff;
	box-shadow: var(--shadow-lg);
}

.hero-home__cta--primary:hover {
	box-shadow: 0 8px 40px rgba(var(--color-brand-rgb), 0.4);
	transform: translateY(-2px);
}

.hero-home__cta--secondary {
	background: rgba(255, 255, 255, 0.1);
	color: var(--color-text);
	border: 1px solid rgba(var(--color-brand-rgb), 0.2);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
}

.hero-home__cta--secondary:hover {
	background: rgba(255, 255, 255, 0.2);
}

.hero-home__scroll {
	position: absolute;
	bottom: 2.5rem;
	left: 50%;
	transform: translateX(-50%);
	z-index: 10;
	color: var(--color-brand);
	animation: hero-bounce 2s infinite;
	transition: opacity 0.3s var(--ease-out);
}

.hero-home__scroll.is-hidden {
	opacity: 0;
	pointer-events: none;
}

.hero-home__scroll-icon {
	display: block;
	font-size: 1.75rem;
}

@keyframes hero-bounce {
	0%, 20%, 50%, 80%, 100% {
		transform: translateX(-50%) translateY(0);
	}
	40% {
		transform: translateX(-50%) translateY(-12px);
	}
	60% {
		transform: translateX(-50%) translateY(-6px);
	}
}

/* ── Responsive ───────────────────────────────────────── */

@media (max-width: 768px) {
	.hero-home__content {
		text-align: start;
	}

	.hero-home__ctas {
		flex-direction: column;
		align-items: stretch;
		justify-content: center;
	}

	.hero-home__cta {
		text-align: center;
	}

	.hero-home__badge {
		font-size: var(--fs-xs);
	}

	/* Animated hero text blocks - mobile */
	.hero-text-block {
		max-width: 94vw;
		padding: 0.5rem 0.75rem;
		text-align: center;
	}

	.hero-text-block h1 {
		font-size: clamp(1.4rem, 6vw, 2.2rem);
	}

	.hero-subtext {
		font-size: clamp(1.1rem, 5vw, 1.6rem);
		color: #ffffff;
	}

	.hero-tagline {
		font-size: clamp(0.7rem, 2.8vw, 0.9rem);
		color: rgba(255, 255, 255, 0.9);
	}

	.hero-cta-btn {
		padding: 0.6rem 1.6rem;
		font-size: 0.85rem;
	}

	.hero-scroll-indicator {
		bottom: 4vh;
	}

	.hero-scroll-indicator p {
		font-size: 0.55rem;
	}

	.hero-scroll-line {
		height: 36px;
	}
}

@media (max-width: 480px) {
	.hero-home__badge {
		font-size: var(--fs-xs);
	}
}

@media (prefers-reduced-motion: reduce) {
	.hero-scroll-line {
		animation: none;
	}

	.hero-home__scroll {
		animation: none;
	}
}
