/*
 * Virtina child: home page industries section.
 *
 * Desktop (1200px and up): the arc layout. Every position comes from the 1728 x 1043 Figma
 * frame. The stage is a container, so 100cqw is 1/100 of its width and every value scales with it.
 * Below 1200px: the icons run in two marquee rows, one drifting left and one right.
 */

.vch-industries {
	font-family: 'Inter', sans-serif;
}

.vch-industries__stage {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 40px;
	padding-block: 64px;
}

.vch-industries__arc,
.vch-industries__logo {
	display: none;
}

.vch-industries__list {
	display: flex;
	width: max-content;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Each layer (outer arc, inner arc) is its own wrapper. Below 1200px each layer is a marquee row:
   the outer row drifts left, the inner row drifts right (js/vch-industries-marquee.js repeats the items
   so the loop has no gap). The edges fade out. */
.vch-industries__layer {
	width: calc(100% + 40px);
	margin-inline: -20px;
	overflow-x: auto;
	scrollbar-width: none;
	-webkit-mask-image: linear-gradient(to right, transparent, #000 48px, #000 calc(100% - 48px), transparent);
	mask-image: linear-gradient(to right, transparent, #000 48px, #000 calc(100% - 48px), transparent);
}

.vch-industries__layer::-webkit-scrollbar {
	display: none;
}

.vch-industries--marquee .vch-industries__layer {
	overflow: hidden;
}

.vch-industries--marquee .vch-industries__list {
	animation: vch-industries-drift var(--vch-marquee-duration, 40s) linear infinite;
}

.vch-industries--marquee .vch-industries__layer--inner .vch-industries__list {
	animation-direction: reverse;
}

.vch-industries--marquee .vch-industries__layer:hover .vch-industries__list,
.vch-industries--marquee .vch-industries__layer:focus-within .vch-industries__list {
	animation-play-state: paused;
}

@keyframes vch-industries-drift {
	to {
		transform: translateX(-50%);
	}
}

@media (prefers-reduced-motion: reduce) {
	.vch-industries--marquee .vch-industries__list {
		animation: none;
	}
}

.vch-industries__item {
	display: flex;
	flex: 0 0 auto;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	width: 132px;
	padding-inline: 16px;
	box-sizing: content-box;
	text-align: center;
}

.vch-industries__icon {
	display: block;
	width: 56px;
	height: auto;
}

.vch-industries__label {
	font-family: 'Archivo', sans-serif;
	font-weight: 400;
	font-size: 14px;
	line-height: 1.2;
	color: var(--vch-color-text-label);
	white-space: nowrap;
}

.vch-industries__intro {
	display: flex;
	flex-direction: column;
	align-items: center;
	order: -1;
	width: 100%;
	max-width: 720px;
	text-align: center;
}

.vch-industries__title {
	margin: 0;
	font-family: 'Archivo', sans-serif;
	font-weight: 500;
	font-size: clamp(2rem, 1.6rem + 2vw, 2.625rem);
	line-height: 1.2;
	color: var(--vch-color-text);
}

.vch-industries__text {
	margin: 20px 0 0;
	max-width: 576px;
	font-size: 16px;
	line-height: 1.5;
	letter-spacing: -0.48px;
	color: var(--vch-color-text-muted);
}

.vch-industries__cta {
	margin-top: 32px;
}

/* Desktop: the arc layout. */
@media (min-width: 1200px) {
	/* The arc stage has no padding of its own on desktop, so the bottom space comes from here. */
	.vch-industries {
		padding: 0 0 64px;
	}

	.vch-industries__stage {
		display: block;
		container-type: inline-size;
		aspect-ratio: 1728 / 1043;
		gap: 0;
		padding-block: 0;
	}

	.vch-industries__arc,
	.vch-industries__logo {
		position: absolute;
		display: block;
		left: calc(var(--vch-x) * 100cqw / 1728);
		top: calc(var(--vch-y) * 100cqw / 1728);
		width: calc(var(--vch-w) * 100cqw / 1728);
		height: auto;
	}

	.vch-industries__logo {
		width: calc(var(--vch-w) * 100cqw / 1728);
	}

	/* The arc lines fade out at their lower ends, so the rows read as carrying on past the last icon. */
	.vch-industries__arc {
		-webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 55%, transparent 100%);
		mask-image: linear-gradient(to bottom, #000 0%, #000 55%, transparent 100%);
	}

	/* The layer wrappers take no space, so the items position against the stage as before. */
	.vch-industries__layer {
		display: contents;
	}

	.vch-industries__list {
		display: block;
		width: auto;
		max-width: none;
		gap: 0;
		animation: none;
		transform: none;
	}

	.vch-industries__item {
		position: absolute;
		padding-inline: 0;
		box-sizing: border-box;
		left: calc(var(--vch-x) * 100cqw / 1728);
		top: calc(var(--vch-y) * 100cqw / 1728);
		width: calc(var(--vch-w) * 100cqw / 1728);
		display: block;
		gap: 0;
	}

	/* The lower an icon sits on the arc, the more it fades: Technology and Packaging at the feet of the
	   outer arc most, Machinery and Hardware less, and everything above Food not at all. */
	.vch-industries__item {
		opacity: clamp(0.35, calc(1 - (var(--vch-y) - 450) / 300), 1);
	}

	.vch-industries__icon {
		width: 100%;
	}

	.vch-industries__label {
		position: absolute;
		left: calc(var(--vch-dx) * 100cqw / 1728);
		top: calc(var(--vch-dy) * 100cqw / 1728);
		transform: translateX(-50%);
	}

	.vch-industries__intro {
		order: 0;
		position: absolute;
		top: calc(636 * 100cqw / 1728);
		left: 50%;
		width: 720px;
		transform: translateX(-50%);
	}

	.vch-industries__text {
		margin-top: 35px;
	}

	.vch-industries__cta {
		margin-top: 36px;
	}
}

/* Scroll reveal: the arc fades up layer by layer, then the text block (see js/vch-industries.js).
   The hidden state applies only once the script has run, so no-JS visitors see everything. */
.vch-industries--js .vch-industries__item,
.vch-industries--js .vch-industries__arc,
.vch-industries--js .vch-industries__logo,
.vch-industries--js .vch-industries__intro {
	transition: opacity 0.5s ease, translate 0.5s ease;
	transition-delay: var(--vch-delay, 0s);
}

.vch-industries--js:not(.vch-industries--revealed) .vch-industries__item,
.vch-industries--js:not(.vch-industries--revealed) .vch-industries__arc,
.vch-industries--js:not(.vch-industries--revealed) .vch-industries__logo,
.vch-industries--js:not(.vch-industries--revealed) .vch-industries__intro {
	opacity: 0;
	translate: 0 24px;
}

/* Outer arc first, then the inner arc once the outer items have finished, then the logo and text block. */
.vch-industries--js .vch-industries__arc--outer {
	--vch-delay: 0s;
}

.vch-industries--js .vch-industries__arc--inner {
	--vch-delay: 0.8s;
}

.vch-industries--js .vch-industries__logo,
.vch-industries--js .vch-industries__intro {
	--vch-delay: 1.3s;
}

.vch-industries--js .vch-industries__intro {
	transition-delay: 1.3s;
}

@media (prefers-reduced-motion: reduce) {
	.vch-industries--js .vch-industries__item,
	.vch-industries--js .vch-industries__arc,
	.vch-industries--js .vch-industries__logo,
	.vch-industries--js .vch-industries__intro {
		transition: none;
	}
}
