/* Hero banner. */

.hero {
	position: relative;
	min-height: 778px;
	/* The bottom curve is a huge ellipse that has to be clipped by the banner. */
	overflow: hidden;
	background-color: var(--color-surface-brand);
	/*
	 * In the Figma frame the menu and the banner both start at y=0, so the banner is
	 * pulled up under the sticky header instead of stacking below it.
	 */
	margin-block-start: calc(var(--header-height) * -1);
}

/*
 * The Figma bottom curve is a 3761x2461 white ellipse whose top arc crosses the banner.
 * The -1px avoids a subpixel seam between the red and the white below.
 */
.hero::after {
	position: absolute;
	bottom: -1px;
	left: 50%;
	width: 260%;
	height: 94px;
	background-image: url('../../img/banner-hero-bottom-curve.svg');
	background-repeat: no-repeat;
	background-position: top center;
	/*
	 * The ellipse is 260% wide, so at the screen edge the curve has dropped 1/26 of its
	 * height. With "100% auto" that height grows with the width (1.70 x), and above about
	 * 1440 the drop is deeper than the box: the curve was cut at the bottom and left a flat
	 * stretch before the corner. Capping the height keeps the drop at about 93px, so the
	 * curve always ends at the corner; up to ~1425px 170vw is the same height as before
	 * (change banner-curve-wide-screens).
	 */
	background-size: 100% min(170vw, 2420px);
	transform: translateX(-50%);
	content: '';
}

.hero__inner {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-6);
	padding-block-start: 136px;
}

.hero__text {
	display: flex;
	flex-direction: column;
	gap: var(--space-4);
	max-width: 598px;
}

.hero__title {
	color: var(--color-text-on-brand);
}

.hero__description {
	max-width: 590px;
	/* Light Gray in the final state of 606:16801; Gray 20 is only its start state (desktop-fidelity G3). */
	color: var(--color-light-gray);
	font-size: var(--font-p1);
	line-height: 1.4;
}

.hero__media {
	position: relative;
	flex: none;
	width: 515px;
	height: 500px;
	border-radius: var(--radius-card);
	overflow: hidden;
}

/*
 * The photos of the carousel are stacked in the same box, so changing photo never moves
 * the layout. The incoming photo fades in on top; the outgoing one stays opaque under it
 * and only leaves (out of the accessibility tree too) once the fade is over.
 */
.hero__image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0;
	visibility: hidden;
	transition:
		opacity 0s linear var(--duration-enter),
		visibility 0s linear var(--duration-enter);
}

.hero__image.is-active {
	z-index: 1;
	opacity: 1;
	visibility: visible;
	transition: opacity var(--duration-enter) var(--ease-out);
}

.hero__image[hidden] {
	display: none;
}

@media (prefers-reduced-motion: reduce) {
	.hero__image,
	.hero__image.is-active {
		transition: none;
	}
}

@media (max-width: 1279px) {
	.hero {
		min-height: 0;
	}

	.hero__inner {
		padding-block: 136px 160px;
	}

	.hero__media {
		flex: 0 1 40%;
		width: auto;
		height: 420px;
	}
}

@media (max-width: 1023px) {
	.hero__inner {
		padding-block: 120px 140px;
	}

	.hero__media {
		height: 340px;
	}
}

@media (max-width: 767px) {
	.hero::after {
		height: 60px;
	}

	.hero__inner {
		flex-direction: column;
		align-items: stretch;
		padding-block: 104px 96px;
	}

	.hero__media {
		flex: none;
		width: 100%;
		height: 260px;
	}
}
