/*
 * Orbit Hero component (SDB One Foundation).
 *
 * Colour, type, spacing, buttons and shadow come from the ACSS / Frames
 * classes on the elements (bg--primary, fr-hero, grid--2 grid--m-1, fr-lede,
 * fr-cta-links-alpha, btn--*, box-shadow--xl). These rules add only what ACSS
 * has no class for — the blob frame, eyebrow pill, stickers, the ring and
 * circle behind, the wave edge — always in ACSS tokens, plus the ambient
 * motion.
 *
 * Motion is deliberately small: long, eased, alternating loops of a few
 * pixels or degrees. It uses the individual translate / rotate / scale
 * properties, which compose with the transform Page Motion's GSAP load-in
 * sets on the same elements instead of overriding it.
 */

.sdb-orbit-hero {
	/* The light tint, not the colour itself: brands whose secondary is their
	   primary would otherwise lose the ring against the background. */
	--sdb-orbit-ring: var(--secondary-light);
	--sdb-orbit-circle: var(--primary-dark);
	/* Sticker 2 follows the hero's CTA colour (set inline when there is one);
	   otherwise the secondary's dark shade, which stands off the primary even
	   where a brand's secondary is its primary. */
	--sdb-hero-pop: var(--secondary-dark);
	--sdb-hero-pop-text: var(--white);
	/* Matched to the next section's background by the footer script. */
	--sdb-hero-edge: var(--white);
	--sdb-orbit-wave-height: clamp(3em, 6vw, 6.5em);

	position: relative;
	isolation: isolate;
	overflow: hidden;
	color: var(--text-light);
	padding-block-end: calc(var(--section-space-l) + var(--sdb-orbit-wave-height));
}

/* ── Layout ──────────────────────────────────────────────────────────────── */

.sdb-orbit-hero__inner {
	position: relative;
	z-index: 1;
	align-items: center;
	column-gap: var(--container-gap);
	row-gap: var(--container-gap);
}

/* A little more room for the copy than the photo, as in the reference. */
@media (min-width: 992px) {
	.sdb-orbit-hero__inner {
		grid-template-columns: 1.1fr 0.9fr;
	}
}

.sdb-orbit-hero__inner > * {
	min-width: 0;
}

.sdb-orbit-hero__content {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	row-gap: var(--content-gap);
}

/* bg--primary colours the background only; ACSS headings bring their own
   dark colour, so the copy is set to the light-text token. */
.sdb-orbit-hero__heading {
	color: var(--text-light);
}

/* Highlighted words: <em> in the heading, in the secondary's light variant
   (a brand without a secondary of its own gets primary's, which also reads). */
.sdb-orbit-hero__heading em {
	color: var(--secondary-light);
}

.sdb-orbit-hero .fr-cta-links-alpha {
	margin-block-start: var(--space-xs);
}

/* ── Eyebrow pill ────────────────────────────────────────────────────────── */

.sdb-orbit-hero__eyebrow {
	display: inline-block;
	margin: 0;
	padding: 0.4em 1.1em;
	border-radius: var(--radius-circle);
	background: var(--white-trans-20);
	color: var(--white);
	font-size: var(--text-s);
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	line-height: 1.4;
}

/* ── Photo in a blob ─────────────────────────────────────────────────────── */

.sdb-orbit-hero__media {
	position: relative;
	justify-self: center;
	width: min(27em, 100%);
}

.sdb-orbit-hero__blob {
	position: relative;
	aspect-ratio: 1;
	overflow: hidden;
	border: 0.6em solid var(--white);
	border-radius: 46% 54% 42% 58% / 55% 44% 56% 45%;
	background: var(--primary-dark);
	animation: sdb-orbit-blob 16s ease-in-out infinite alternate;
}

.sdb-orbit-hero .sdb-hero-image,
.sdb-orbit-hero .sdb-hero-image__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

.sdb-orbit-hero .sdb-hero-image__img {
	display: block;
	max-width: none;
	object-fit: cover;
	/* The Focal Point Picker's point, set on the <img> itself. */
	object-position: calc(var(--focal-point-left, 0.5) * 100%) calc(var(--focal-point-top, 0.5) * 100%);
	animation: sdb-orbit-drift 22s ease-in-out infinite alternate;
}

/* ── Stickers ────────────────────────────────────────────────────────────── */

.sdb-orbit-hero__sticker {
	position: absolute;
	z-index: 1;
	margin: 0;
	padding: 0.75em 1.15em;
	border-radius: var(--radius-l);
	background: var(--white);
	color: var(--text-dark);
	box-shadow: 0 0.6em 1.6em var(--black-trans-20);
	font-size: var(--text-s);
	font-weight: 800;
	line-height: 1.2;
	white-space: nowrap;
	animation: sdb-orbit-bob 6s ease-in-out infinite alternate;
}

.sdb-orbit-hero__sticker--1 {
	inset-block-start: 4%;
	inset-inline-start: -1.5em;
	rotate: -6deg;
}

.sdb-orbit-hero__sticker--2 {
	inset-block-end: 8%;
	inset-inline-end: -1em;
	rotate: 5deg;
	background: var(--sdb-hero-pop);
	color: var(--sdb-hero-pop-text);
	animation-duration: 7s;
	animation-delay: -3s;
}

/* ── Ring, circle and wave ───────────────────────────────────────────────── */

.sdb-orbit-hero__decor {
	position: absolute;
	inset: 0;
	z-index: 0;
	pointer-events: none;
}

/* A wide tilted ring swinging behind the photo. */
.sdb-orbit-hero__decor::before {
	content: "";
	position: absolute;
	inset-block-start: 20%;
	inset-inline-end: -14%;
	width: min(62em, 120vw);
	aspect-ratio: 3.5;
	border: 0.6em solid var(--sdb-orbit-ring);
	border-radius: 50%;
	opacity: 0.85;
	rotate: -14deg;
	animation: sdb-orbit-ring 18s ease-in-out infinite alternate;
}

/* A deeper circle low on the copy side. */
.sdb-orbit-hero__decor::after {
	content: "";
	position: absolute;
	inset-block-end: -10em;
	inset-inline-start: -10em;
	width: 26em;
	aspect-ratio: 1;
	border-radius: 50%;
	background: var(--sdb-orbit-circle);
	animation: sdb-orbit-float 20s ease-in-out infinite alternate;
}

/* The wave into the next section. */
.sdb-orbit-hero::after {
	content: "";
	position: absolute;
	inset-inline: 0;
	inset-block-end: -1px;
	z-index: 1;
	height: var(--sdb-orbit-wave-height);
	background: var(--sdb-hero-edge);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 110' preserveAspectRatio='none'%3E%3Cpath d='M0,60 C240,120 480,0 720,40 C960,80 1200,20 1440,60 L1440,110 L0,110 Z'/%3E%3C/svg%3E") no-repeat 0 100% / 100% 100%;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 110' preserveAspectRatio='none'%3E%3Cpath d='M0,60 C240,120 480,0 720,40 C960,80 1200,20 1440,60 L1440,110 L0,110 Z'/%3E%3C/svg%3E") no-repeat 0 100% / 100% 100%;
}

/* ── Phones and tablets ──────────────────────────────────────────────────── */

@media (max-width: 991px) {
	.sdb-orbit-hero__media {
		width: min(24em, 86%);
		margin-block-start: var(--space-s);
	}

	.sdb-orbit-hero__decor::after {
		width: 16em;
		inset-block-end: -6em;
		inset-inline-start: -6em;
	}

	.sdb-orbit-hero__decor::before {
		inset-block-start: auto;
		inset-block-end: 22%;
		inset-inline-end: -55%;
		width: 44em;
	}
}

@media (max-width: 478px) {
	.sdb-orbit-hero__sticker--1 {
		inset-inline-start: -0.5em;
	}

	.sdb-orbit-hero__sticker--2 {
		inset-inline-end: -0.5em;
	}
}

/* ── Motion ──────────────────────────────────────────────────────────────── */

@keyframes sdb-orbit-blob {
	to {
		border-radius: 54% 46% 57% 43% / 46% 56% 44% 54%;
	}
}

@keyframes sdb-orbit-drift {
	from {
		scale: 1.03;
		translate: -0.5% 0;
	}

	to {
		scale: 1.08;
		translate: 0.5% -1%;
	}
}

@keyframes sdb-orbit-bob {
	from {
		translate: 0 0;
	}

	to {
		translate: 0 -0.4em;
	}
}

@keyframes sdb-orbit-ring {
	from {
		rotate: -15deg;
		translate: 0 0;
	}

	to {
		rotate: -11deg;
		translate: -1.5em 0.75em;
	}
}

@keyframes sdb-orbit-float {
	from {
		translate: 0 0;
	}

	to {
		translate: 1.5em -1em;
	}
}

@media (prefers-reduced-motion: reduce) {
	.sdb-orbit-hero__blob,
	.sdb-orbit-hero .sdb-hero-image__img,
	.sdb-orbit-hero__sticker,
	.sdb-orbit-hero__decor::before,
	.sdb-orbit-hero__decor::after {
		animation: none;
	}
}
