/**
 * SCBL — Hero block.
 *
 * Figma node 8101:62. Full-bleed image with dual gradient overlay,
 * headline + description + two CTAs (left bottom), stats (right bottom).
 */

.hero {
	position: relative;
	width: 100%;
	min-height: clamp(36rem, 90svh, 65.625rem); /* up to 1050px */
	display: flex;
	color: var(--color-white);
	background: var(--color-dark-950);
	/* The media (image + overlay) extends above the hero box by this much,
	 * so the image visually flows behind the floating site header without
	 * depending on the negative-margin lifting through theme layout styles.
	 *
	 * Formula matches the header's actual footprint at every breakpoint:
	 *   2 × .site-header padding-block (clamp 1–2.5rem)  +  bar height
	 * mobile bar = 3.5rem, desktop bar = 5.25rem. A small extra buffer
	 * absorbs sub-pixel rounding so no white seam appears at any width. */
	--hero-header-pull: calc(2 * clamp(1rem, 3vw, 2.5rem) + 4rem);
	z-index: 0;
}

@media (min-width: 64rem) {
	.hero {
		--hero-header-pull: calc(2 * clamp(1rem, 3vw, 2.5rem) + 5.75rem);
	}
}

/* Header floats above the hero image. */
.site-header { position: relative; z-index: 5; }

/* ─── Background media ───────────────────────────────────────────────── */
/* Extends ABOVE the hero box by --hero-header-pull so the image sits
 * behind the floating site header. Stays clipped with overflow: hidden so
 * it doesn't bleed past the bar. */
.hero__media {
	position: absolute;
	inset-inline: 0;
	top: calc(-1 * var(--hero-header-pull));
	bottom: 0;
	overflow: hidden;
	z-index: 0;
}

.hero__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center top;
	display: block;
}

/* When more than one slide is rendered, stack them and crossfade.
 * Single-image hero keeps the static layout above.
 *
 * Three z-index layers prevent any flash of the dark hero background
 * during the fade — the previously-active slide sits fully opaque just
 * underneath while the new slide fades in on top:
 *   active (z=2, opacity 0 → 1 via animation)
 *   prev   (z=1, opacity 1 — visible during the crossfade)
 *   rest   (z=0, opacity 1 — hidden behind the active layer) */
.hero__media--carousel .hero__image {
	position: absolute;
	inset: 0;
	opacity: 1;
	z-index: 0;
	will-change: opacity;
}

.hero__media--carousel .hero__image.is-prev {
	z-index: 1;
}

.hero__media--carousel .hero__image.is-active {
	z-index: 2;
	animation: hero-fade-in 0.8s ease forwards;
}

@keyframes hero-fade-in {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.hero__media--carousel .hero__image.is-active {
		animation: none;
	}
}

/* Bottom-of-section dark gradient + corner vignette. Sits in the media
 * stacking context (z-index 0) so the CTAs / stats (z-index 2) stay on top. */
.hero__fx {
	position: absolute;
	inset: 0;
	z-index: 3; /* above carousel slides (z-index up to 2) */
	pointer-events: none;
	background:
		radial-gradient(ellipse 95% 80% at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.55) 100%),
		linear-gradient(180deg, transparent 55%, rgba(16, 17, 20, 0.85) 100%);
}

/* Figma node 8101:62, fill_YBH1XV — exact gradient values.
 * Fade the overlay out in the top 20% and right 20% so the image stays
 * clean in the upper-right area (matches the Figma render). */
.hero__overlay {
	position: absolute;
	inset: 0;
	z-index: 3; /* above carousel slides (z-index up to 2) */
	background:
		linear-gradient(178deg, rgba(16, 17, 20, 0) 53%, rgba(24, 12, 39, 1) 82%),
		linear-gradient(198deg, rgba(16, 17, 20, 0) 5%,  rgba(95, 47, 157, 1) 76%);
	pointer-events: none;
	-webkit-mask-image:
		linear-gradient(to bottom, transparent 0%, #000 60%),
		linear-gradient(to left,   transparent 0%, #000 60%);
	mask-image:
		linear-gradient(to bottom, transparent 0%, #000 60%),
		linear-gradient(to left,   transparent 0%, #000 60%);
	-webkit-mask-composite: source-in;
	mask-composite: intersect;
}

/* ─── Inner layout ───────────────────────────────────────────────────── */
.hero__inner {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	gap: clamp(1.5rem, 4vw, 2.5rem);
	flex: 1 1 auto;
	width: 100%;
	padding-block-start: clamp(2rem, 5vw, 4rem);
	padding-block-end: clamp(2rem, 6vw, 4.5rem);
}

/* ─── Content (left column) ──────────────────────────────────────────── */
.hero__content {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	max-width: 44rem; /* 704px */
}

.hero__title {
	font-family: var(--font-primary);
	font-weight: var(--fw-semibold);
	font-size: clamp(2rem, 4vw + 0.75rem, 3.75rem); /* 32 → 60 */
	line-height: 1.05;
	letter-spacing: -0.06em;
	color: var(--color-white);
	max-width: 32rem; /* 512px — keeps the headline tight */
	margin: 0;
}

.hero__description {
	font-family: var(--font-primary);
	font-weight: var(--fw-regular);
	font-size: clamp(1rem, 1vw + 0.75rem, 1.5rem); /* 16 → 24 */
	line-height: var(--lh-snug);
	color: var(--color-white);
	max-width: 34rem; /* 544px */
	margin: 0;
}

/* ─── Buttons ────────────────────────────────────────────────────────── */
.hero__buttons {
	display: flex;
	flex-wrap: wrap;
	gap: clamp(1rem, 2vw, 2.5rem);
	margin-block-start: clamp(1rem, 2vw, 1.5rem);
}

.hero__btn {
	position: relative;
	z-index: 2; /* above the gradient overlay */
	isolation: isolate;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	padding: 1rem clamp(1.5rem, 3vw, 3.5rem);
	border-radius: 0.75rem;
	font-family: var(--font-primary);
	font-weight: var(--fw-medium);
	font-size: clamp(1rem, 0.5vw + 0.875rem, 1.25rem); /* 16 → 20 */
	line-height: var(--lh-snug);
	text-decoration: none;
	transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
	box-shadow:
		0 2rem 3.5rem rgba(16, 17, 20, 0.4),
		0 0.75rem 1rem rgba(16, 17, 20, 0.24);
	white-space: nowrap;
}

.hero__btn:focus { outline: none; }
.hero__btn:focus-visible {
	outline: 2px solid var(--color-white);
	outline-offset: 3px;
}

.hero__btn--primary {
	border: 0;
	background: var(--color-orange-500);
	color: var(--color-white);
}

.hero__btn--primary:hover {
	background: var(--color-orange-600);
	transform: translateY(-2px);
	box-shadow:
		0 2.5rem 4rem rgba(16, 17, 20, 0.45),
		0 1rem 1.25rem rgba(16, 17, 20, 0.3);
	color: var(--color-white);
}

.hero__btn--secondary {
	background: transparent;
	color: var(--color-white);
	border: 1px solid var(--color-white);
}

.hero__btn--secondary:hover {
	background: rgba(255, 255, 255, 0.1);
	transform: translateY(-2px);
	color: var(--color-white);
}

.hero__btn-label { font-family: inherit; }
.hero__btn-icon  {
	width: 2rem;
	height: 2rem;
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.hero__btn-icon svg { width: 100%; height: 100%; display: block; }

/* ─── Bottom row: buttons (left) + stats (right) on the same line ────── */
.hero__bottom-row {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: clamp(1.5rem, 3vw, 2rem);
}

/* ─── Stats ──────────────────────────────────────────────────────────── */
.hero__stats {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: clamp(0.75rem, 1.4vw, 1rem);
}

.hero__stat {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	color: var(--color-white);
}

.hero__stat-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 3rem;
	height: 3rem;
	padding: 0.5rem;
	border-radius: 0.5rem;
	background: var(--color-indigo-800);
	border: 1px solid var(--color-indigo-600);
	color: var(--color-indigo-300);
	flex-shrink: 0;
}

.hero__stat-icon img,
.hero__stat-icon svg {
	width: 100%;
	height: 100%;
	display: block;
	object-fit: contain;
}

.hero__stat-content {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.hero__stat-title {
	font-family: var(--font-primary);
	font-weight: var(--fw-medium);
	font-size: var(--fs-r3);
	line-height: var(--lh-snug);
	color: var(--color-white);
}

.hero__stat-subtitle {
	font-family: var(--font-primary);
	font-weight: var(--fw-regular);
	font-size: var(--fs-r4);
	line-height: var(--lh-snug);
	color: var(--color-dark-500);
}

/* ─── Editor preview hint ────────────────────────────────────────────── */
.hero__placeholder-note {
	position: absolute;
	bottom: 1rem;
	left: 1rem;
	right: 1rem;
	margin: 0;
	padding: 0.75rem 1rem;
	background: rgba(0, 0, 0, 0.5);
	border-radius: 0.5rem;
	color: var(--color-white);
	font-size: var(--fs-r4);
	z-index: 2;
}

/* ─── Desktop: split content (left) + stats (right) ──────────────────── */
@media (max-width: 63.9375rem) {
	.hero {
		min-height: 42rem;
	}

	.hero__stats {
		width: auto;
		max-width: 100%;
		display: grid;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		flex-direction: row;
		flex-wrap: nowrap;
		align-items: start;
		align-self: flex-start;
		justify-content: start;
		gap: clamp(0.25rem, 1.8vw, 0.625rem);
		margin-block-start: 2rem;
	}

	.hero__stat {
		min-width: 0;
		flex-direction: column;
		justify-content: flex-start;
		align-items: flex-start;
		gap: clamp(0.375rem, 1.8vw, 0.625rem);
	}

	.hero__fx {
		background:
			linear-gradient(rgba(16, 17, 20, 0.38), rgba(16, 17, 20, 0.38)),
			radial-gradient(ellipse 95% 80% at 50% 50%, transparent 45%, rgba(0, 0, 0, 0.68) 100%),
			linear-gradient(180deg, rgba(16, 17, 20, 0.18) 0%, rgba(16, 17, 20, 0.9) 100%);
	}

	.hero__inner {
		justify-content: flex-end;
		align-items: stretch;
		gap: 0.875rem;
		padding-block-start: 0;
		padding-block-end: 2rem;
		text-align: left;
	}

	.hero__content {
		align-items: flex-start;
		max-width: 100%;
	}

	.hero__title {
		max-width: 22rem;
		font-size: 1.875rem;
		letter-spacing: 0;
	}

	.hero__description {
		max-width: 21rem;
		font-size: var(--fs-r3);
	}

	.hero__btn {
		width: min(100%, 17rem);
		justify-content: space-between;
		gap: 1.25rem;
		padding-block: 0.75rem;
		font-size: var(--fs-r4);
	}

	.hero__btn-icon {
		width: 1.5rem;
		height: 1.5rem;
	}

	.hero__stat-icon {
		width: clamp(2rem, 9vw, 2.5rem);
		height: clamp(2rem, 9vw, 2.5rem);
		padding: clamp(0.3125rem, 1.6vw, 0.4375rem);
	}

	.hero__stat-title {
		font-size: clamp(0.6875rem, 3.2vw, 0.875rem);
	}

	.hero__stat-subtitle {
		font-size: clamp(0.625rem, 2.8vw, 0.75rem);
	}

	.hero__stat-title,
	.hero__stat-subtitle {
		overflow-wrap: anywhere;
	}

	.hero__bottom-row,
	.hero__buttons {
		align-items: flex-start;
		justify-content: flex-start;
	}

	.hero__buttons {
		width: 100%;
		gap: 0.75rem;
	}

	.hero__bottom-row {
		width: 100%;
		margin-block-start: 0;
		gap: 0;
	}
}

@media (min-width: 64rem) {
	.hero__inner {
		display: flex;
		flex-direction: column;
		justify-content: flex-end;
		gap: 2.5rem;
		padding-block-end: clamp(3rem, 6vw, 4.5rem);
	}

	.hero__content {
		gap: 2rem;
	}

	.hero__buttons {
		margin-block-start: 0;
	}

	/* Buttons and stats sit on a single line — buttons left, stats right. */
	.hero__bottom-row {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		gap: 3rem;
		flex-wrap: nowrap;
	}

	.hero__stats {
		justify-content: flex-end;
		flex-wrap: nowrap;
		gap: 1rem;
	}
}

@media (min-width: 80rem) {
	.hero__inner {
		gap: 4rem;
		padding-block-start: clamp(2.5rem, 4vw, 4rem);
	}
}
