/* Hero logo carousel in two sets: "Companies we've worked with" first, then
   "Supports all your favourite models". The sets share one grid cell and hand
   over with a left-to-right swoosh: a soft-edged wipe erases the outgoing set
   while drifting it right, and the incoming set follows the same sweep in from
   the left. A hidden set's belt pauses where it stopped, so over time every
   logo gets its turn. The existing pause button stops both the belts and the
   switching (assets/js/hero-logo-sets.js). */

.logo-sets {
	display: grid;
}

/* The wipe masks are 250% wide with a soft edge (20% of the mask, about half
   the set's width), so the sweep reads as a gentle wave rather than a hard line. */
.logo-set {
	grid-area: 1 / 1;
	min-width: 0;
	visibility: hidden;
	pointer-events: none;
	-webkit-mask-size: 250% 100%;
	mask-size: 250% 100%;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	will-change: transform, filter;
}

.logo-set.is-active {
	visibility: visible;
	pointer-events: auto;
	-webkit-mask-image: linear-gradient(90deg, #000 0%, #000 40%, transparent 60%, transparent 100%);
	mask-image: linear-gradient(90deg, #000 0%, #000 40%, transparent 60%, transparent 100%);
	animation: logo-set-swoosh-in 1.5s cubic-bezier(0.22, 1, 0.36, 1) 0.32s both;
}

.logo-set.is-leaving {
	visibility: visible;
	-webkit-mask-image: linear-gradient(90deg, transparent 0%, transparent 40%, #000 60%, #000 100%);
	mask-image: linear-gradient(90deg, transparent 0%, transparent 40%, #000 60%, #000 100%);
	animation: logo-set-swoosh-out 1.15s cubic-bezier(0.65, 0, 0.35, 1) both;
}

/* Arriving: the reveal sweeps in from the left while the set settles from a slight lean and blur. */
@keyframes logo-set-swoosh-in {
	from {
		-webkit-mask-position: 100% 0;
		mask-position: 100% 0;
		transform: translateX(-28px);
		filter: blur(4px);
	}
	to {
		-webkit-mask-position: 0 0;
		mask-position: 0 0;
		transform: none;
		filter: blur(0);
	}
}

/* Leaving: the same sweep erases it from the left while it drifts off to the right. */
@keyframes logo-set-swoosh-out {
	from {
		-webkit-mask-position: 100% 0;
		mask-position: 100% 0;
		transform: none;
		filter: blur(0);
	}
	to {
		-webkit-mask-position: 0 0;
		mask-position: 0 0;
		transform: translateX(28px);
		filter: blur(4px);
	}
}

/* The swoosh carries the headings in and out, so they keep only their slow shading. */
.logo-sets .hero-models-heading {
	animation: none;
}

@supports ((background-clip: text) or (-webkit-background-clip: text)) {
	.logo-sets .hero-models-heading {
		animation: model-heading-shades 7s ease-in-out infinite;
	}
}

/* Off stage: the belt and the shading wait. */
.logo-set:not(.is-active):not(.is-leaving) .model-track,
.logo-set:not(.is-active):not(.is-leaving) .model-logo,
.logo-set:not(.is-active):not(.is-leaving) .hero-models-heading {
	animation-play-state: paused;
}

/* The pause button now sits beside the sets rather than the window. */
.model-pause:checked ~ .logo-sets .model-track,
.model-pause:checked ~ .logo-sets .model-logo {
	animation-play-state: paused;
}

/* Company belt: 7 logos travel at the same speed as the 9 model logos (~30px/s).
   It starts with Mercedes-Benz just clear of the window's soft left edge (86px,
   12% of the 720px window) and eases into motion, ending at drift speed, so the
   first logo lingers in full view before the steady drift takes over. */
.client-track {
	animation:
		client-belt-intro 5.8s cubic-bezier(0.11, 0, 0.5, 0) both,
		model-drift 39s linear 5.8s infinite;
}

@keyframes client-belt-intro {
	from { transform: translateX(86px); }
	to { transform: translateX(0); }
}

/* Company logos: sized by eye to sit with the model logos, in the same grey and shading. */
.client-logo {
	width: auto;
}

.client-logo svg {
	max-width: none;
}

.client-logo--mercedes-benz .client-mark { width: 27px; height: 27px; }
.client-logo--mercedes-benz .client-wordmark { height: 17px; }
.client-logo--bmw .client-mark { width: 32px; height: 32px; }
.client-logo--thyssenkrupp .client-mark { width: 26px; height: 26px; }
.client-logo--thyssenkrupp .client-wordmark { height: 22px; }
.client-logo--atlas-elektronik .client-mark { width: 25px; height: 25px; }
.client-logo--atlas-elektronik .client-wordmark { height: 15px; }
.client-logo--adidas .client-lockup { height: 38px; }
.client-logo--sap .client-wordmark { height: 26px; }
.client-logo--sparkasse .client-mark { width: 26px; height: 26px; }
.client-logo--sparkasse .client-text { height: 25px; }

@media (max-width: 600px) {
	.client-logo { width: auto; }
	.client-logo svg { max-width: none; }
}

/* Without motion: both sets stay on the page, one under the other. */
@media (prefers-reduced-motion: reduce) {
	.logo-sets { display: block; }
	.logo-set,
	.logo-set.is-active,
	.logo-set.is-leaving {
		visibility: visible;
		pointer-events: auto;
		-webkit-mask-image: none;
		mask-image: none;
		animation: none;
		transform: none;
		filter: none;
	}
	.logo-set + .logo-set { margin-top: 28px; }
	.logo-sets .hero-models-heading,
	.client-track { animation: none; }
}
