/**
 * Clients — two-row logo marquee.
 *
 * Rows drift in opposite directions; the track holds two identical halves and slides exactly one
 * half (-50%), so the loop is seamless. Pauses on hover / focus; stops for reduced motion.
 * Selectors use two classes so page-builder img/link rules cannot win.
 */

.ki-clients {
	position: relative;
	overflow: hidden;
	padding: 90px 0 100px;
	background: var(--ki-color-sand, #f4e8d0);
}

/* Optional faint photo behind the section (bg_url). */
.ki-clients__bg {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 0;
	pointer-events: none;
}

.ki-clients__bg img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0.1;
	filter: grayscale(1);
}

.ki-clients__head,
.ki-clients__rows {
	position: relative;
	z-index: 1;
}

.ki-clients__head {
	max-width: 760px;
	margin: 0 auto 64px;
	padding: 0 24px;
	text-align: center;
}

.ki-clients .ki-clients__eyebrow {
	position: relative;
	display: inline-block;
	margin-bottom: 24px;
	padding-bottom: 14px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.3em;
	text-transform: uppercase;
	color: var(--ki-color-ink, #353535);
}

.ki-clients__eyebrow::before {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	width: 100%;
	height: 1px;
	background: var(--ki-color-accent, #7cb8ae);
	opacity: 0.6;
}

.ki-clients__eyebrow::after {
	content: "";
	position: absolute;
	right: 0;
	bottom: -1px;
	width: 52px;
	height: 4px;
	background: var(--ki-color-accent, #7cb8ae);
}

.ki-clients .ki-clients__heading {
	margin: 0;
	font-size: clamp(2rem, 3.6vw, 3.2rem);
	font-weight: 300;
	line-height: 1.14;
	letter-spacing: 0.01em;
	text-transform: uppercase;
	color: #1a1a1a;
}

.ki-clients .ki-clients__heading strong {
	display: block;
	font-weight: 800;
}

.ki-clients .ki-clients__subtitle {
	margin: 20px auto 0;
	max-width: 640px;
	font-size: 1.05rem;
	line-height: 1.85;
	color: #555555;
}

/* ---------- Rows ---------- */

.ki-clients__rows {
	display: flex;
	flex-direction: column;
	gap: 28px;
	/* Logos fade in/out at the screen edges. */
	-webkit-mask-image: linear-gradient(90deg, transparent 0, #000 9%, #000 91%, transparent 100%);
	mask-image: linear-gradient(90deg, transparent 0, #000 9%, #000 91%, transparent 100%);
}

.ki-clients__row {
	overflow: hidden;
	/* Room for the hover lift and tile shadow. */
	padding: 16px 0 20px;
}

.ki-clients__track {
	display: flex;
	width: max-content;
	animation: ki-clients-slide var(--ki-clients-duration, 60s) linear infinite;
	will-change: transform;
}

.ki-clients__track.is-reverse {
	animation-direction: reverse;
}

.ki-clients__rows:hover .ki-clients__track,
.ki-clients__rows:focus-within .ki-clients__track {
	animation-play-state: paused;
}

.ki-clients__half {
	display: flex;
	flex: none;
	gap: 28px;
	padding-right: 28px; /* matches the gap so the seam is invisible */
}

@keyframes ki-clients-slide {
	from {
		transform: translateX(0);
	}

	to {
		transform: translateX(-50%);
	}
}

/* ---------- Tile ---------- */

.ki-clients .ki-clients__half .ki-clients__tile {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 190px;
	height: 190px;
	padding: 18px;
	box-sizing: border-box;
	border-radius: 24px;
	background: #ffffff;
	box-shadow: 0 8px 22px rgba(53, 53, 53, 0.08);
	text-decoration: none;
	transform: translateY(0);
	transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.45s ease;
}

.ki-clients .ki-clients__half .ki-clients__tile .ki-clients__logo {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	filter: grayscale(1);
	opacity: 0.7;
	transition: filter 0.45s ease, opacity 0.45s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.ki-clients .ki-clients__half .ki-clients__tile:hover,
.ki-clients .ki-clients__half .ki-clients__tile:focus-visible {
	transform: translateY(-10px);
	box-shadow: 0 20px 38px rgba(20, 97, 49, 0.2), 0 0 0 2px var(--ki-color-accent, #7cb8ae);
}

.ki-clients .ki-clients__half .ki-clients__tile:hover .ki-clients__logo,
.ki-clients .ki-clients__half .ki-clients__tile:focus-visible .ki-clients__logo {
	filter: none;
	opacity: 1;
	transform: scale(1.04);
}

/* Touch screens: no hover, so show the logos in full colour. */
@media (hover: none) {
	.ki-clients .ki-clients__half .ki-clients__tile .ki-clients__logo {
		filter: none;
		opacity: 1;
	}
}

@media (max-width: 767px) {
	.ki-clients {
		padding: 64px 0 72px;
	}

	.ki-clients__head {
		margin-bottom: 40px;
	}

	.ki-clients__half {
		gap: 16px;
		padding-right: 16px;
	}

	.ki-clients .ki-clients__half .ki-clients__tile {
		width: 124px;
		height: 124px;
		padding: 12px;
		border-radius: 18px;
	}

	.ki-clients__rows {
		gap: 14px;
	}
}

/* Reduced motion: no drifting; the row can be scrolled by hand instead. */
@media (prefers-reduced-motion: reduce) {
	.ki-clients__track {
		animation: none;
	}

	.ki-clients__row {
		overflow-x: auto;
	}

	.ki-clients__half[aria-hidden],
	.ki-clients__tile[aria-hidden="true"] {
		display: none;
	}
}
