/* =========================================================
   TESTIMONIALS
========================================================= */

.testimonials {
	position: relative;
	width: 100%;
	padding: clamp(6rem, 10vw, 10rem) 0;
	background: #f8f7f4;
	color: #18181b;
	overflow: hidden;
}

.testimonials__container {
	width: min(100% - 3rem, 1380px);
	margin-inline: auto;
}


/* =========================================================
   HEADER
========================================================= */

.testimonials__header {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(220px, 280px) auto;
	align-items: end;
	gap: 3rem;
	margin-bottom: clamp(4rem, 7vw, 7rem);
}

.testimonials__heading-wrap {
	max-width: 760px;
}

.testimonials__eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 0.55rem;
	margin-bottom: 1.5rem;
	font-size: 0.68rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	line-height: 1;
	text-transform: uppercase;
	color: #14532d;
}

.testimonials__eyebrow-dot {
	width: 6px;
	height: 6px;
	flex: 0 0 auto;
	border-radius: 50%;
	background: #14532d;
}

.testimonials__heading {
	max-width: 760px;
	margin: 0;
	font-size: clamp(2rem, 3vw, 3rem);
	font-weight: var(--fw-bold);
	letter-spacing: -0.055em;
	line-height: 0.98;
}

.testimonials__description-wrap {
	align-self: end;
	padding-bottom: 0.35rem;
}

.testimonials__description {
	max-width: 270px;
	margin: 0;
	font-size: 0.82rem;
	font-weight: 400;
	line-height: 1.7;
	color: #18181b;
}


/* =========================================================
   NAVIGATION
========================================================= */

.testimonials__navigation {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	padding-bottom: 0.2rem;
}

.testimonials__nav {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	padding: 0;
	border: 1px solid rgba(24, 24, 27, 0.18);
	border-radius: 50%;
	background: transparent;
	color: #18181b;
	font-family: inherit;
	font-size: 1rem;
	cursor: pointer;
	transition:
		background 0.35s ease,
		color 0.35s ease,
		border-color 0.35s ease,
		transform 0.35s ease;
}

.testimonials__nav:hover {
	border-color: #14532d;
	background: #14532d;
	color: #f8f7f4;
	transform: translateY(-2px);
}


/* =========================================================
   STAGE
========================================================= */

.testimonials__stage {
	position: relative;
	min-height: 580px;
}

.testimonials__cards {
	position: relative;
	width: 100%;
	height: 540px;
}


/* =========================================================
   CARD BASE
========================================================= */

.testimonials__card {
	position: absolute;
	top: 0;
	left: 50%;
	width: min(24%, 330px);
	height: 430px;
	opacity: 0;
	pointer-events: none;
	transform-origin: center center;

	transition:
		left 1.2s cubic-bezier(0.22, 1, 0.36, 1),
		transform 1.2s cubic-bezier(0.22, 1, 0.36, 1),
		opacity 0.9s ease,
		filter 0.9s ease;
}

.testimonials__card.is-visible {
	opacity: 1;
	pointer-events: auto;
}


/* =========================================================
   DESKTOP
   DEFAULT = 5 SCATTERED CARDS
========================================================= */

/*
 * Position 01
 */

.testimonials__card[data-position="0"] {
	left: 7%;
	transform:
		translateY(25px)
		rotate(-8deg);
	z-index: 1;
}

/*
 * Position 02
 */

.testimonials__card[data-position="1"] {
	left: 28%;
	transform:
		translateY(-15px)
		rotate(-3deg);
	z-index: 2;
}

/*
 * Position 03
 */

.testimonials__card[data-position="2"] {
	left: 50%;
	transform:
		translateX(-50%)
		translateY(25px)
		rotate(2deg);
	z-index: 3;
}

/*
 * Position 04
 */

.testimonials__card[data-position="3"] {
	left: 60%;
	transform:
		translateY(-5px)
		rotate(5deg);
	z-index: 4;
}

/*
 * Position 05
 */

.testimonials__card[data-position="4"] {
	left: 91%;
	transform:
		translateX(-100%)
		translateY(30px)
		rotate(9deg);
	z-index: 5;
}


/* =========================================================
   CARD INNER
========================================================= */

.testimonials__card-inner {
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
	padding: 2rem;
	border: 1px solid rgba(24, 24, 27, 0.1);
	border-radius: 1rem;
	background: #f8f7f4;
	box-shadow:
		0 20px 60px rgba(24, 24, 27, 0.06),
		0 5px 20px rgba(24, 24, 27, 0.025);
	overflow: hidden;
}

.testimonials__quote-mark {
	display: block;
	margin-bottom: 1.2rem;
	font-size: 3rem;
	font-weight: 600;
	line-height: 0.7;
	color: #14532d;
}

.testimonials__quote {
	max-width: 300px;
	margin: 0;
	font-size: clamp(0.9rem, 1vw, 1.05rem);
	font-weight: 400;
	letter-spacing: -0.02em;
	line-height: 1.65;
}


/* =========================================================
   CLIENT
========================================================= */

.testimonials__client {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-top: auto;
	padding-top: 1.5rem;
	border-top: 1px solid rgba(24, 24, 27, 0.1);
}

.testimonials__client-image {
	width: 40px;
	height: 40px;
	flex: 0 0 auto;
	overflow: hidden;
	border-radius: 50%;
	background: #e8e6df;
}

.testimonials__client-image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.testimonials__client-info {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
}

.testimonials__client-name {
	margin: 0;
	font-size: 0.7rem;
	font-weight: 600;
	line-height: 1.3;
}

.testimonials__client-role {
	font-size: 0.6rem;
	font-weight: 400;
	line-height: 1.4;
	color: rgba(24, 24, 27, 0.6);
}


/* =========================================================
   COMPANY
========================================================= */

.testimonials__company {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-top: 1.2rem;
}

.testimonials__company-logo {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 21px;
	height: 21px;
	flex: 0 0 auto;
}

.testimonials__company-logo img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.testimonials__company-name {
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: -0.02em;
}


/* =========================================================
   VIEW STORY
========================================================= */

.testimonials__story {
	position: absolute;
	right: 0.1rem;
	bottom: 0.1rem;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 70px;
	height: 70px;
	padding: 1rem;
	border-radius: 50%;
	background: #14532d;
	color: #f8f7f4;
	text-decoration: none;
	text-align: center;
	box-shadow: 0 15px 35px rgba(20, 83, 45, 0.18);

	opacity: 0;
	transform: scale(0.8);

	transition:
		opacity 0.4s ease,
		transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.testimonials__story-text {
	/* max-width: 100%; */
	font-size: 0.56rem;
	font-weight: 600;
	line-height: 1.15;
	text-transform: uppercase;
}

.testimonials__story-arrow {
	position: absolute;
	top: 10px;
	right: 11px;
	font-size: 0.8rem;
}

.testimonials__card:hover .testimonials__story,
.testimonials__card.is-active .testimonials__story {
	opacity: 1;
	transform: scale(1);
}


/* =========================================================
   DESKTOP HOVER
   5 SCATTERED → 3 ALIGNED
========================================================= */

/*
 * First visible card
 */

.testimonials__cards:hover .testimonials__card[data-position="0"] {
	left: 25%;
	transform:
		translateX(-50%)
		translateY(0)
		rotate(0deg);
	z-index: 5;
}

/*
 * Second visible card
 */

.testimonials__cards:hover .testimonials__card[data-position="1"] {
	left: 50%;
	transform:
		translateX(-50%)
		translateY(0)
		rotate(0deg);
	z-index: 6;
}

/*
 * Third visible card
 */

.testimonials__cards:hover .testimonials__card[data-position="2"] {
	left: 75%;
	transform:
		translateX(-50%)
		translateY(0)
		rotate(0deg);
	z-index: 5;
}

/*
 * Fourth and fifth cards move outward
 * and become secondary.
 */

.testimonials__cards:hover .testimonials__card[data-position="3"] {
	left: 100%;
	transform:
		translateX(-50%)
		translateY(20px)
		rotate(9deg)
		scale(0.82);
	opacity: 0.25;
	filter: blur(1px);
	z-index: 1;
}

.testimonials__cards:hover .testimonials__card[data-position="4"] {
	left: 0%;
	transform:
		translateX(-50%)
		translateY(20px)
		rotate(-9deg)
		scale(0.82);
	opacity: 0.25;
	filter: blur(1px);
	z-index: 1;
}


/* =========================================================
   PAGINATION
========================================================= */

.testimonials__pagination {
	position: absolute;
	left: 50%;
	bottom: 0;
	display: flex;
	align-items: center;
	gap: 0.45rem;
	transform: translateX(-50%);
	font-size: 0.72rem;
	font-weight: 500;
}

.testimonials__pagination-current {
	color: #14532d;
}

.testimonials__pagination-divider {
	color: rgba(24, 24, 27, 0.3);
}

.testimonials__pagination-total {
	color: rgba(24, 24, 27, 0.55);
}


/* =========================================================
   DOTS
========================================================= */

.testimonials__dots {
	display: none;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	margin-top: 1.25rem;
}

.testimonials__dot {
	width: 6px;
	height: 6px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(24, 24, 27, 0.18);
	cursor: pointer;

	transition:
		background 0.3s ease,
		transform 0.3s ease;
}

.testimonials__dot.is-active {
	background: #14532d;
	transform: scale(1.25);
}


/* =========================================================
   TABLET
   DEFAULT = 3
   HOVER = 2
========================================================= */

@media (max-width: 1024px) {

	.testimonials {
		padding: 7rem 0;
	}

	.testimonials__container {
		width: min(100% - 2.5rem, 900px);
	}

	.testimonials__header {
		grid-template-columns: minmax(0, 1fr) auto;
		gap: 1.5rem;
		margin-bottom: 4rem;
	}

	.testimonials__description-wrap {
		grid-column: 1;
		grid-row: 2;
	}

	.testimonials__navigation {
		grid-column: 2;
		grid-row: 1;
	}

	.testimonials__description {
		max-width: 360px;
	}

	.testimonials__stage {
		min-height: 500px;
	}

	.testimonials__cards {
		height: 460px;
	}

	.testimonials__card {
		width: min(34%, 320px);
		height: 410px;
	}

	/*
	 * Default 3-card arrangement.
	 */

	.testimonials__card[data-position="0"] {
		left: 20%;
		transform:
			translateX(-50%)
			translateY(20px)
			rotate(-5deg);
	}

	.testimonials__card[data-position="1"] {
		left: 50%;
		transform:
			translateX(-50%)
			translateY(-5px)
			rotate(0deg);
	}

	.testimonials__card[data-position="2"] {
		left: 80%;
		transform:
			translateX(-50%)
			translateY(20px)
			rotate(5deg);
	}

	/*
	 * Hide positions 04 and 05 on tablet.
	 */

	.testimonials__card[data-position="3"],
	.testimonials__card[data-position="4"] {
		display: none;
	}

	/*
	 * Tablet hover → 2 aligned cards.
	 */

	.testimonials__cards:hover .testimonials__card[data-position="0"] {
		left: 30%;
		transform:
			translateX(-50%)
			translateY(0)
			rotate(0deg);
	}

	.testimonials__cards:hover .testimonials__card[data-position="1"] {
		left: 70%;
		transform:
			translateX(-50%)
			translateY(0)
			rotate(0deg);
	}

	.testimonials__cards:hover .testimonials__card[data-position="2"] {
		left: 100%;
		transform:
			translateX(-50%)
			translateY(20px)
			rotate(5deg)
			scale(0.8);
		opacity: 0;
	}

	.testimonials__dots {
		display: flex;
	}

	.testimonials__pagination{
		margin-bottom: 2rem;
	}

}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 767px) {

	.testimonials {
		padding: 5rem 0;
	}

	.testimonials__container {
		width: min(100% - 2rem, 520px);
	}

	.testimonials__header {
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto;
		gap: 1.5rem;
		margin-bottom: 3rem;
	}

	.testimonials__heading-wrap {
		grid-column: 1 / -1;
	}

	.testimonials__eyebrow {
		margin-bottom: 1.2rem;
		font-size: 0.62rem;
	}

	.testimonials__heading {
		max-width: 100%;
		font-size: clamp(2.4rem, 10vw, 3.6rem);
		line-height: 0.98;
	}

	.testimonials__description-wrap {
		grid-column: 1;
		grid-row: auto;
	}

	.testimonials__description {
		max-width: 240px;
		font-size: 0.75rem;
		line-height: 1.65;
	}

	.testimonials__navigation {
		grid-column: 2;
		grid-row: auto;
		align-self: end;
	}

	.testimonials__nav {
		width: 38px;
		height: 38px;
		font-size: 0.9rem;
	}

	.testimonials__stage {
		min-height: 500px;
	}

	.testimonials__cards {
		height: 420px;
	}

	.testimonials__card {
		left: 50%;
		width: min(82vw, 340px);
		height: 390px;
	}

	/*
	 * Mobile shows two layered cards.
	 */

	.testimonials__card[data-position="0"] {
		left: 50%;
		transform:
			translateX(-50%)
			translateY(15px)
			rotate(-4deg);
		z-index: 2;
	}

	.testimonials__card[data-position="1"] {
		left: 50%;
		transform:
			translateX(-50%)
			translateY(0)
			rotate(3deg);
		z-index: 3;
	}

	.testimonials__card[data-position="2"],
	.testimonials__card[data-position="3"],
	.testimonials__card[data-position="4"] {
		display: none;
	}

	/*
	 * Active card.
	 */

	.testimonials__card.is-active {
		z-index: 10;
	}

	.testimonials__card.is-active .testimonials__card-inner {
		box-shadow:
			0 25px 70px rgba(24, 24, 27, 0.1),
			0 8px 25px rgba(24, 24, 27, 0.04);
	}

	.testimonials__card-inner {
		padding: 1.6rem;
		border-radius: 0.85rem;
	}

	.testimonials__quote-mark {
		margin-bottom: 1rem;
		font-size: 2.8rem;
	}

	.testimonials__quote {
		font-size: 0.95rem;
		line-height: 1.65;
	}

	.testimonials__client {
		padding-top: 1.5rem;
	}

	.testimonials__client-image {
		width: 38px;
		height: 38px;
	}

	.testimonials__company {
		margin-top: 1.15rem;
	}

	.testimonials__company-name {
		font-size: 0.78rem;
	}

	.testimonials__story {
		right: -0.6rem;
		bottom: -0.6rem;
		width: 76px;
		height: 76px;
	}

	.testimonials__pagination {
		position: relative;
		left: 50%;
		bottom: auto;
		justify-content: center;
		transform: none;
		margin-top: 1.25rem;
	}

	.testimonials__dots {
		display: flex;
		margin-top: 1rem;
	}

}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 480px) {

	.testimonials__heading {
		font-size: clamp(2.2rem, 11vw, 3rem);
	}

	.testimonials__stage {
		min-height: 470px;
	}

	.testimonials__cards {
		height: 395px;
	}

	.testimonials__card {
		width: min(84vw, 320px);
		height: 370px;
	}

	.testimonials__card-inner {
		padding: 1.4rem;
	}

}


/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

	.testimonials__card,
	.testimonials__story,
	.testimonials__nav,
	.testimonials__dot {
		transition: none;
	}

}