/* ==========================================================================
   Block: Hero (bga/hero)
   ========================================================================== */

.bga-hero {
	position: relative;
	width: 100vw;
	margin-left: calc(-50vw + 50%);
	overflow: hidden;
	display: flex;
	align-items: flex-end;
	color: var(--color-white);
	isolation: isolate;
	background-color: var(--color-brown); /* fallback when no hero image */
}


.bga-hero--full-screen {
	min-height: 100vh;
	align-items: center;
}

.bga-hero--page {
	min-height: clamp(32rem, 60vh, 44rem);
}

.bga-hero--project {
	min-height: 100vh;
	align-items: flex-end;
}

/* Image */
.bga-hero__image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	z-index: 1;
	filter: none;
	transform: scale(1.06);
	transition: transform 1.6s cubic-bezier(0.22, 1, 0.36, 1), filter 0.9s ease;
}

.bga-hero.is-visible .bga-hero__image {
	transform: scale(1);
}

/* Overlays removed per client feedback (Row 19).
   Heroes with text retain a subtle scrim for legibility. */
.bga-hero__overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, transparent 0%, transparent 40%, rgba(16, 8, 2, 0.28) 100%);
	z-index: 2;
}

.bga-hero--full-screen .bga-hero__overlay {
	background:
		linear-gradient(180deg, rgba(16, 8, 2, 0.26) 0%, rgba(16, 8, 2, 0.14) 32%, rgba(16, 8, 2, 0.36) 100%);
}

/*
 * Page heroes (archive + CMS): title and subtext sit bottom-left on the image.
 * Default overlay stays transparent across most of the frame, so light skies and
 * busy detail wash out white type — add a left scrim + darker bottom stack.
 */
.bga-hero--page .bga-hero__overlay {
	background:
		linear-gradient(
			100deg,
			rgba(12, 6, 2, 0.53) 0%,
			rgba(16, 8, 2, 0.27) 42%,
			rgba(16, 8, 2, 0.04) 72%
		),
		linear-gradient(
			180deg,
			rgba(16, 8, 2, 0.12) 0%,
			transparent 38%,
			rgba(16, 8, 2, 0.36) 100%
		);
}

/* Content */
.bga-hero__content {
	position: relative;
	z-index: 3;
	padding-top: calc(var(--header-height) + var(--sp-48));
	padding-bottom: var(--sp-80);
	width: 100%;
	max-width: min(100%, 980px);
}

.bga-hero--full-screen .bga-hero__content {
	padding-top: 0;
	padding-bottom: 0;
	text-align: center;
	max-width: 1280px;
	margin: 0 auto;
	padding-inline: var(--sp-24);
}

/* Title */
.bga-hero__title {
	font-family: var(--font-heading);
	font-weight: var(--font-weight-regular);
	color: var(--color-white);
	margin-bottom: var(--sp-20);
	font-size: var(--text-h2);
	line-height: var(--lh-h2);
	letter-spacing: -0.025em;
	max-width: 11ch;
	text-shadow: 0 16px 40px rgba(16, 8, 2, 0.28);
}

.bga-hero--full-screen .bga-hero__title {
	font-size: clamp(1.75rem, 4.5vw, 4.1rem);
	line-height: 1.08;
	letter-spacing: -0.03em;
	font-weight: var(--font-weight-regular);
	max-width: 26ch;
	margin-inline: auto;
	text-wrap: balance;
	text-shadow:
		0 2px 8px rgba(16, 8, 2, 0.6),
		0 8px 30px rgba(16, 8, 2, 0.4);
}

.bga-hero--page .bga-hero__title {
	text-shadow:
		0 1px 2px rgba(16, 8, 2, 0.9),
		0 2px 12px rgba(16, 8, 2, 0.75),
		0 8px 36px rgba(16, 8, 2, 0.5);
}

/* Subtext */
.bga-hero__subtext {
	font-size: clamp(1rem, 1.2vw, 1.2rem);
	font-weight: var(--font-weight-light);
	max-width: 38rem;
	opacity: 0.92;
	line-height: var(--lh-lead);
	color: rgba(233, 230, 225, 0.9);
}

.bga-hero__subtext::before {
	content: "";
	display: block;
	width: 72px;
	height: 1px;
	margin-bottom: var(--sp-20);
	background: rgba(233, 230, 225, 0.4);
}

.bga-hero--full-screen .bga-hero__subtext {
	margin-left: auto;
	margin-right: auto;
}

/* Subheads use light weight + no shadow by default — too weak on photos. */
.bga-hero--page .bga-hero__subtext,
.bga-hero--full-screen .bga-hero__subtext {
	font-weight: var(--font-weight-regular);
	color: var(--color-cream);
	opacity: 1;
	text-shadow:
		0 1px 2px rgba(16, 8, 2, 0.95),
		0 2px 14px rgba(16, 8, 2, 0.75),
		0 6px 28px rgba(16, 8, 2, 0.45);
}

.bga-hero--page .bga-hero__subtext::before,
.bga-hero--full-screen .bga-hero__subtext::before {
	background: rgba(233, 230, 225, 0.65);
	box-shadow: 0 1px 2px rgba(16, 8, 2, 0.4);
}

/* CTA button */
.bga-hero__cta {
	display: inline-flex;
	align-items: center;
	gap: var(--sp-8);
	margin-top: var(--sp-32);
	padding: 14px var(--sp-32);
	background: rgba(41, 19, 5, 0.55);
	color: var(--color-cream);
	font-family: var(--font-body);
	font-size: var(--text-label);
	font-weight: var(--font-weight-regular);
	text-transform: uppercase;
	letter-spacing: 0.14em;
	line-height: 1;
	text-decoration: none;
	border: 1px solid rgba(233, 230, 225, 0.25);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	box-shadow: var(--shadow-soft);
	transition: transform var(--transition-smooth), background-color var(--transition-smooth), border-color var(--transition-smooth), opacity var(--transition-smooth);
}

.bga-hero__cta:hover {
	transform: translateY(-2px);
	background-color: var(--color-orange);
	border-color: rgba(190, 98, 44, 0.9);
	color: var(--color-cream);
}

/* Project title — plain heading, consistent with other titles (Row 33) */
.bga-hero__banner {
	display: block;
	padding: 0;
	width: auto;
	max-width: min(90%, 520px);
	backdrop-filter: none;
	-webkit-backdrop-filter: none;
	border: none;
	box-shadow: none;
	background: none !important;
}

.bga-hero__banner .bga-hero__title {
	margin-bottom: 0;
	font-size: var(--text-h1);
	font-weight: var(--font-weight-regular);
	max-width: none;
	text-shadow: 0 4px 24px rgba(16, 8, 2, 0.5);
}

/* Scroll indicator (button element) */
.bga-hero__scroll-indicator {
	position: absolute;
	bottom: var(--sp-32);
	left: 50%;
	transform: translateX(-50%);
	z-index: 3;
	color: var(--color-white);
	background: rgba(233, 230, 225, 0.08);
	border: 1px solid rgba(233, 230, 225, 0.22);
	padding: var(--sp-12);
	cursor: pointer;
	animation: bga-bounce 2s ease-in-out infinite;
	/* Promote to own layer for jank-free animation. */
	will-change: transform;
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border-radius: 0;
}

.bga-hero__scroll-indicator:focus-visible {
	outline: 2px solid var(--color-white);
	outline-offset: var(--sp-4);
	border-radius: 0;
}

@keyframes bga-bounce {
	0%, 20%, 50%, 80%, 100% {
		transform: translateX(-50%) translateY(0);
	}
	40% {
		transform: translateX(-50%) translateY(-10px);
	}
	60% {
		transform: translateX(-50%) translateY(-5px);
	}
}

/*
 * Reduced motion: stop the infinite bouncing animation.
 * The global rule in global.css sets animation-duration to 0.01ms,
 * but we explicitly handle this for clarity and to keep the element
 * visible in its static centered position.
 */
@media (prefers-reduced-motion: reduce) {
	.bga-hero__scroll-indicator {
		animation: none;
		will-change: auto;
	}
}

/* Responsive */
@media (min-width: 768px) {
	.bga-hero__title {
		font-size: var(--text-h1);
		line-height: var(--lh-h1);
	}

	.bga-hero__content {
		padding-top: calc(var(--header-height) + var(--sp-64));
		padding-bottom: var(--sp-96);
	}
}

