/* ==========================================================================
   Testimonials
   ========================================================================== */
.ms-tst__grid {
	display: grid;
	grid-template-columns: minmax(0, .85fr) minmax(0, 1.3fr);
	gap: clamp(40px, 6vw, 100px);
	align-items: center;
}
.ms-tst--right .ms-tst__aside { order: 2; }

/* ---------- Left ---------- */
.ms-tst__title { margin-bottom: 20px; }
.ms-tst .ms-lead { max-width: 440px; margin-bottom: 34px; }

.ms-tst__rating { display: flex; align-items: center; gap: 16px; margin-bottom: 34px; }
.ms-tst__rating > strong { font-size: 3rem; font-weight: 800; letter-spacing: -0.04em; line-height: 1; color: var(--ms-dark); }
.ms-tst__rating > span { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--ms-muted); }

.ms-tst__controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 10px; margin-bottom: 30px; }
.ms-tst__nav {
	display: grid;
	place-items: center;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	border: 1px solid color-mix(in srgb, var(--ms-dark) 20%, transparent);
	background: transparent;
	color: var(--ms-dark);
	cursor: pointer;
	transition: background-color .3s var(--ms-ease), color .3s var(--ms-ease), border-color .3s var(--ms-ease);
}
.ms-tst__nav .ms-icon { width: 19px; height: 19px; }
.ms-tst__nav:hover { background: var(--ms-primary); border-color: var(--ms-primary); color: var(--ms-white); }
.ms-tst__count { margin-left: 12px; font-size: .9rem; font-weight: 600; color: var(--ms-secondary); font-variant-numeric: tabular-nums; }
.ms-tst__count b { color: var(--ms-dark); font-weight: 700; }
.ms-tst__progress { flex-basis: 100%; height: 2px; max-width: 260px; border-radius: 2px; background: var(--ms-border); overflow: hidden; }
.ms-tst__progress span { display: block; height: 100%; background: var(--ms-primary); transform: scaleX(0); transform-origin: left; }
.ms-tst__progress.is-running span { animation: msTstBar var(--ms-tst-ms) linear forwards; }
.ms-tst__grid.is-paused .ms-tst__progress span { animation-play-state: paused; }
@keyframes msTstBar { to { transform: scaleX(1); } }

.ms-tst__more { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: .92rem; }
.ms-tst__more .ms-icon { width: 16px; height: 16px; transition: transform .25s var(--ms-ease); }
.ms-tst__more:hover .ms-icon { transform: translateX(4px); }

.ms-tst__stars { display: inline-flex; gap: 3px; color: #E8A93B; }
.ms-tst__stars svg { width: 18px; height: 18px; }

/* ---------- Card ---------- */
.ms-tst__stage { position: relative; padding: 0 0 22px 22px; }
.ms-tst__deck { /* the "stack" peeking out behind the card */
	position: absolute;
	inset: 22px 22px 0 0;
	border-radius: calc(var(--ms-radius) * 1.4);
	background: color-mix(in srgb, var(--ms-primary) 10%, var(--ms-white));
	border: 1px solid var(--ms-border);
}
.ms-tst__card {
	position: relative;
	display: grid;
	padding: clamp(32px, 4vw, 56px);
	border-radius: calc(var(--ms-radius) * 1.4);
	background: var(--ms-white);
	border: 1px solid var(--ms-border);
	box-shadow: 0 40px 70px -46px rgba(22, 38, 35, .45);
	overflow: hidden;
}
.ms-tst__mark {
	position: absolute;
	top: clamp(28px, 3.6vw, 50px);
	right: clamp(28px, 3.6vw, 50px);
	width: 64px;
	height: 48px;
	color: color-mix(in srgb, var(--ms-primary) 12%, transparent);
}

.ms-tst__slide {
	grid-area: 1 / 1;
	position: relative;
	margin: 0;
	opacity: 0;
	visibility: hidden;
	transform: translateY(-10px);
	/* outgoing review leaves quickly… */
	transition: opacity .3s ease-in, transform .3s ease-in, visibility 0s .3s;
}
.ms-tst__slide.is-active {
	opacity: 1;
	visibility: visible;
	transform: none;
	/* …then the next one rises in, so the texts never overlap */
	transition: opacity .6s var(--ms-ease) .32s, transform .7s var(--ms-ease) .32s, visibility 0s;
}
.ms-tst__slide:not(.is-active) { transform: translateY(-10px); }
.ms-tst__slide.is-active ~ .ms-tst__slide:not(.is-active) { transform: translateY(14px); }

.ms-tst__quote { margin: 22px 0 34px; padding: 0; }
.ms-tst__quote p {
	margin: 0;
	font-size: clamp(1.25rem, 1rem + .8vw, 1.7rem);
	font-weight: 500;
	line-height: 1.5;
	letter-spacing: -0.015em;
	color: var(--ms-dark);
}
.ms-tst__person {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px 16px;
	padding-top: 26px;
	border-top: 1px solid var(--ms-border);
}
.ms-tst__avatar {
	display: grid;
	place-items: center;
	flex: none;
	width: 54px;
	height: 54px;
	border-radius: 50%;
	overflow: hidden;
	background: var(--ms-primary);
	color: var(--ms-white);
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: .02em;
}
.ms-tst__avatar img { width: 100%; height: 100%; object-fit: cover; }
.ms-tst__who { display: flex; flex-direction: column; font-size: .88rem; color: var(--ms-muted); line-height: 1.4; }
.ms-tst__who strong { font-size: 1.02rem; color: var(--ms-dark); }
.ms-tst__result {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-left: auto;
	padding: 8px 14px;
	border-radius: 999px;
	background: color-mix(in srgb, var(--ms-primary) 9%, var(--ms-white));
	color: var(--ms-primary);
	font-size: .8rem;
	font-weight: 700;
}
.ms-tst__result .ms-icon { width: 16px; height: 16px; }
.ms-tst__sample {
	position: absolute;
	top: -6px;
	right: 70px;
	padding: 3px 9px;
	border-radius: 6px;
	background: #FFF2D6;
	color: #8A5A00;
	font-size: .68rem;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
}

/* White section: tint the card surfaces */
.ms-bg-white .ms-tst__card { background: var(--ms-light); }
.ms-bg-white .ms-tst__result { background: var(--ms-white); }

/* Dark / teal backgrounds */
.ms-bg-dark .ms-tst__nav, .ms-bg-primary .ms-tst__nav { border-color: rgba(255, 255, 255, .25); color: var(--ms-white); }
.ms-bg-dark .ms-tst__count b, .ms-bg-primary .ms-tst__count b,
.ms-bg-dark .ms-tst__rating > strong, .ms-bg-primary .ms-tst__rating > strong { color: var(--ms-white); }
.ms-bg-dark .ms-tst__progress, .ms-bg-primary .ms-tst__progress { background: rgba(255, 255, 255, .15); }
.ms-bg-dark .ms-tst__progress span, .ms-bg-primary .ms-tst__progress span { background: var(--ms-white); }
.ms-bg-dark .ms-tst__more, .ms-bg-primary .ms-tst__more { color: var(--ms-white); }
.ms-bg-dark .ms-tst__deck, .ms-bg-primary .ms-tst__deck { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .1); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
	.ms-tst__grid { grid-template-columns: 1fr; gap: 40px; }
	.ms-tst--right .ms-tst__aside { order: 0; }
	.ms-tst__controls { order: 3; }
}
@media (max-width: 600px) {
	.ms-tst__stage { padding: 0 0 14px 14px; }
	.ms-tst__deck { inset: 14px 14px 0 0; }
	.ms-tst__mark { width: 44px; height: 33px; }
	.ms-tst__result { margin-left: 0; }
	.ms-tst__nav { width: 46px; height: 46px; }
}

/* ---------- Grid layout ---------- */
.ms-tstg__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px 60px; margin-bottom: clamp(36px, 4vw, 56px); }
.ms-tstg__head > div:first-child { max-width: 640px; }
.ms-tstg__head .ms-lead { margin-bottom: 0; }
.ms-tstg__head .ms-tst__rating { margin-bottom: 0; }
.ms-tstg__grid { columns: 3 320px; column-gap: clamp(18px, 2vw, 28px); }
.ms-tstg__item {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 18px;
	break-inside: avoid;
	margin: 0 0 clamp(18px, 2vw, 28px);
	padding: clamp(24px, 2.4vw, 32px);
	border-radius: var(--ms-radius);
	background: var(--ms-white);
	border: 1px solid var(--ms-border);
}
.ms-tstg__quote { margin: 0; padding: 0; }
.ms-tstg__quote p { margin: 0; font-size: 1rem; line-height: 1.7; color: var(--ms-text); }
.ms-tstg__item .ms-tst__result { align-self: flex-start; margin-left: 0; }
.ms-tstg__item .ms-tst__person { padding-top: 18px; }
.ms-tstg__item .ms-tst__avatar { width: 46px; height: 46px; font-size: .9rem; }
.ms-tstg__item .ms-tst__sample { top: 14px; right: 14px; }
.ms-tstg__foot { margin-top: 12px; text-align: center; }
.ms-bg-white .ms-tstg__item { background: var(--ms-light); border-color: transparent; }
.ms-tstg__grid--two { columns: 2 320px; }
