.le-home-hero {
	/* Cap height of the headline; everything in the lockup is sized from it. */
	--cap: min(7.74rem, 9.7vw);
	/* How far the approach has gone, 0 to 1, set by the script as the runway scrolls. */
	--approach: 0;

	position: relative;
	color: var(--le-200);
	background: var(--le-black);
}

.le-home-hero__stage {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	/* Fills the viewport below the 4rem sticky navbar; the uneven padding keeps the headline centred on the viewport. */
	min-height: max(100svh - 4rem, 35rem);
	padding: 7.375rem var(--le-gutter) 11.375rem;
	overflow: hidden;
}

/* Portal scroll (larger screens; the script adds .is-portal) ----------------------------------------------
 * The hero is a runway several screens tall, and the stage stays pinned under the navbar while it scrolls past.
 * The donut is drawn on a full-screen canvas over everything but the navbar, so it can grow past the screen
 * and be flown through. Once through, a veil drawn with it hides the page except through the donut's hole. */
.le-home-hero.is-portal {
	height: calc(var(--runway, 2.5) * 100svh);
}

.le-home-hero.is-portal .le-home-hero__stage {
	position: sticky;
	top: 4rem;
	height: calc(100svh - 4rem);
	min-height: 0;
	padding-block: 3.375rem 7.375rem;
}

.le-home-hero__portal {
	position: fixed;
	z-index: 50;
	inset: 0;
	display: none;
	pointer-events: none;
}

.le-home-hero.is-portal-live .le-home-hero__portal {
	display: block;
}

.le-home-hero__portal-canvas {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

/* With an image cycle after the hero as its backdrop (tucked up underneath it), the hero turns see-through once the
   dive starts, so the backdrop is what shows through the portal. */
.le-home-hero.is-portal.has-backdrop.is-through {
	background: transparent;
}

.le-home-hero.is-portal.has-backdrop.is-through .le-home-hero__stage {
	visibility: hidden;
}

/* The donut leaves its place in the headline for the portal. */
.le-home-hero.is-portal .le-home-hero__donut canvas {
	visibility: hidden;
}

/* As it approaches, the headline stays put under the growing donut and fades, and the copy goes first. */
.le-home-hero.is-portal .le-home-hero__words {
	opacity: clamp(0, 1 - var(--approach) * 1.6, 1);
}

.le-home-hero.is-portal .le-home-hero__copy > * {
	opacity: clamp(0, 1 - var(--approach) * 4, 1);
}

/* The photo is the phone layout's background; larger screens show the donut instead. */
.le-home-hero__photo {
	display: none;
}

.le-home-hero__headline {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: calc(var(--cap) * 0.3) calc(var(--cap) * 0.26);
	margin: 0;
	font-family: var(--le-font-display);
	font-size: calc(var(--cap) / var(--le-display-cap));
	font-weight: 600;
	line-height: 1;
	color: inherit;
	text-transform: uppercase;
	white-space: nowrap;
}

.le-home-hero__words {
	position: relative;
	display: block;
	text-box: trim-both cap alphabetic;
}

.le-home-hero__words .le-w {
	/* Room for the clipped glyphs when the line box is trimmed to cap height. */
	padding-block: 0.2em 0.08em;
	margin-block: -0.2em -0.08em;
}

.le-home-hero__tm {
	position: absolute;
	top: 0;
	left: calc(100% + var(--cap) * 0.067);
	font-size: 0.161em;
	line-height: 1;
	text-box: trim-both cap alphabetic;
	vertical-align: baseline;
}

/* The slot reserves the donut's footprint in the lockup; the canvas overflows it so the donut can turn freely. */
.le-home-hero__donut {
	position: relative;
	width: calc(var(--cap) * 1.41);
	height: var(--cap);
}

.le-home-hero__donut canvas {
	position: absolute;
	top: 50%;
	left: 50%;
	width: calc(var(--cap) * 2.6);
	height: calc(var(--cap) * 2.6);
	max-width: none;
	transform: translate(-50%, -50%);
	pointer-events: none;
}

.le-home-hero__copy {
	position: absolute;
	bottom: 1.6875rem;
	left: var(--le-gutter);
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	width: min(21rem, calc(100% - var(--le-gutter) * 2));
}

.le-home-hero__copy .le-p {
	text-box: trim-both cap alphabetic;
}

.le-home-hero__buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 1.125rem;
}

.le-js .le-home-hero__copy {
	opacity: 0;
	transform: translateY(0.75rem);
	transition: opacity 0.9s 0.9s, transform 1.1s var(--le-ease-out) 0.9s;
}

.le-js .le-home-hero.is-ready .le-home-hero__copy {
	opacity: 1;
	transform: none;
}

/* Small screens: the second half of the headline drops to its own line. */
/* Phones: no donut. A photo fills the top of the hero and fades to black, with the headline, copy and buttons stacked at the bottom left. */
@media (max-width: 880px) {
	.le-home-hero__stage {
		flex-direction: column;
		align-items: flex-start;
		justify-content: flex-end;
		gap: 1.5rem;
		min-height: max(100svh - 4rem, 40rem);
		padding: 1.5rem var(--le-gutter);
		isolation: isolate;
	}

	.le-home-hero__photo {
		position: absolute;
		z-index: -1;
		inset: 0;
		display: block;
	}

	.le-home-hero__photo img {
		width: 100%;
		height: 84%;
		object-fit: cover;
		object-position: 50% 0;
	}

	.le-home-hero__photo::after {
		position: absolute;
		inset: 0;
		background: linear-gradient(to bottom, transparent 0%, var(--le-black) 78%);
		content: "";
	}

	.le-home-hero__headline {
		display: block;
		font-size: 6.75rem;
		line-height: 5.375rem;
		white-space: normal;
	}

	.le-home-hero__words {
		width: fit-content;
	}

	/* Each line is trimmed to its capitals, so the gap between lines is set here. */
	.le-home-hero__words ~ .le-home-hero__words {
		margin-top: 0.65rem;
	}

	.le-home-hero__donut,
	.le-home-hero__tm {
		display: none;
	}

	.le-home-hero__copy {
		position: static;
		width: min(21rem, 100%);
	}
}

@media (prefers-reduced-motion: reduce) {
	.le-js .le-home-hero__copy {
		transform: none;
		transition: opacity 0.3s;
	}
}

/* Dragging turns the donut (donut.js). */
.le-home-hero.is-dragging {
	cursor: grabbing;
	user-select: none;
}
