/**
 * Section 9: Testimonials — Deepak Sales.
 *
 * Mobile-first. Depends on tokens.css + base.css. Reuses existing design
 * tokens only (oxblood, gold, ivory) — no new global variables. Centered
 * single-card carousel + controls + trust stats. Entrance animation is
 * CSS-only and respects prefers-reduced-motion.
 */

/* ==========================================================================
   1. Section shell + backdrop
   ========================================================================== */
.ds-tst {
	position: relative;
	overflow: clip;
	padding-block: var(--ds-section-y);
	background-color: var(--ds-paper-2);
	isolation: isolate;
}

.ds-tst__backdrop {
	position: absolute;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	overflow: clip;
}

.ds-tst__glow {
	position: absolute;
	top: -16%;
	left: 50%;
	width: 40rem;
	height: 40rem;
	transform: translateX(-50%);
	border-radius: 50%;
	filter: blur(75px);
	opacity: 0.4;
	background: radial-gradient(circle, color-mix(in srgb, var(--ds-gold) 30%, transparent), transparent 66%);
}

/* ==========================================================================
   2. Header (centered)
   ========================================================================== */
.ds-tst__head {
	max-width: 42rem;
	margin-inline: auto;
	margin-bottom: clamp(2rem, 1.25rem + 2.5vw, 3.5rem);
	text-align: center;
}

.ds-tst__eyebrow {
	margin-bottom: var(--ds-space-sm);
	font-family: var(--ds-font-mono);
	font-size: var(--ds-fs-eyebrow);
	font-weight: var(--ds-fw-label);
	letter-spacing: var(--ds-ls-wide);
	text-transform: uppercase;
	color: var(--ds-oxblood);
}

.ds-tst__title {
	margin-bottom: var(--ds-space-md);
	font-family: var(--ds-font-display);
	font-size: var(--ds-fs-h2);
	font-weight: var(--ds-fw-section);
	line-height: var(--ds-lh-snug);
	letter-spacing: -0.02em;
	color: var(--ds-heading);
}

.ds-tst__lead {
	font-size: var(--ds-fs-lead);
	line-height: var(--ds-lh-body);
	color: var(--ds-muted);
}

/* ==========================================================================
   3. Carousel
   ========================================================================== */
.ds-tst__carousel {
	max-width: 48rem;
	margin-inline: auto;
}

.ds-tst__viewport {
	overflow: hidden;
	border-radius: var(--ds-radius-lg);
}

.ds-tst__track {
	display: flex;
	touch-action: pan-y;
	cursor: grab;
	transition: transform var(--ds-dur-slow) var(--ds-ease);
}

.ds-tst__track.is-dragging {
	cursor: grabbing;
	transition: none;
	user-select: none;
}

.ds-tst__slide {
	flex: 0 0 100%;
	min-width: 100%;
}

/* ---- Card ----------------------------------------------------------------- */
.ds-tst__card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: var(--ds-space-lg);
	height: 100%;
	margin: 0;
	padding: clamp(1.75rem, 1.2rem + 2.5vw, 3rem);
	border: 1px solid var(--ds-line);
	border-radius: var(--ds-radius-lg);
	background-color: var(--ds-surface);
	box-shadow: var(--ds-shadow-lg);
	transition:
		transform var(--ds-dur) var(--ds-ease),
		box-shadow var(--ds-dur) var(--ds-ease);
}

.ds-tst__card:hover {
	transform: translateY(-4px);
	box-shadow: 0 28px 60px rgba(74, 12, 23, .18);
}

.ds-tst__quote-mark {
	font-family: var(--ds-font-display);
	font-size: 4rem;
	line-height: 0.6;
	color: color-mix(in srgb, var(--ds-gold) 65%, transparent);
	user-select: none;
	opacity: .35;
}

.ds-tst__quote {
	margin: 0;
	max-width: 60ch;
}

.ds-tst__quote p {
	font-family: var(--ds-font-display);
	font-size: clamp(1.15rem, 0.95rem + 1.1vw, 1.6rem);
	font-weight: 400;
	font-style: italic;
	line-height: 1.5;
	color: var(--ds-ink);
	text-wrap: pretty;
}

/* ---- Author --------------------------------------------------------------- */
.ds-tst__author {
	display: flex;
	align-items: center;
	gap: var(--ds-space-md);
	margin-top: auto;
	padding-top: var(--ds-space-md);
	border-top: 1px solid var(--ds-line);
}

.ds-tst__avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 3rem;
	height: 3rem;
	flex: 0 0 auto;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--ds-oxblood), var(--ds-oxblood-deep));
	color: var(--ds-gold-soft);
	font-family: var(--ds-font-display);
	font-size: 1.15rem;
	font-weight: 600;
}

.ds-tst__meta {
	display: flex;
	flex-direction: column;
	margin-right: auto;
}

.ds-tst__name {
	font-family: var(--ds-font-display);
	font-size: var(--ds-fs-body);
	font-weight: 600;
	color: var(--ds-ink);
}

.ds-tst__biz {
	font-family: var(--ds-font-mono);
	font-size: 0.72rem;
	letter-spacing: 0.02em;
	color: var(--ds-muted);
}

.ds-tst__years {
	flex: 0 0 auto;
	padding: 0.35rem 0.7rem;
	border-radius: var(--ds-radius-pill);
	background: var(--ds-gold-tint);
	color: var(--ds-oxblood);
	font-family: var(--ds-font-mono);
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: var(--ds-ls-wide);
	text-transform: uppercase;
	white-space: nowrap;
}

/* ==========================================================================
   4. Controls (prev · dots · next)
   ========================================================================== */
.ds-tst__controls {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--ds-space-md);
	margin-top: clamp(1.25rem, 0.8rem + 1.5vw, 2rem);
}

/* 40px, trimmed from 44px to match the same circular-control size used
   for the product-card wishlist/qty-stepper buttons (collection.css). */
.ds-tst__nav {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	flex: 0 0 auto;
	border: 1px solid var(--ds-line-strong);
	border-radius: 50%;
	background-color: var(--ds-surface);
	color: var(--ds-oxblood);
	transition:
		transform var(--ds-dur-fast) var(--ds-ease),
		background-color var(--ds-dur) var(--ds-ease),
		color var(--ds-dur) var(--ds-ease),
		border-color var(--ds-dur) var(--ds-ease);
}

.ds-tst__nav:hover {
	transform: translateY(-1px);
	background-color: var(--ds-oxblood);
	border-color: var(--ds-oxblood);
	color: var(--ds-on-accent);
}

.ds-tst__nav:focus-visible,
.ds-tst__dot:focus-visible {
	outline: 2px solid var(--ds-gold);
	outline-offset: 3px;
}

.ds-tst__dots {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
}

.ds-tst__dot {
	width: 0.55rem;
	height: 0.55rem;
	padding: 0;
	border-radius: var(--ds-radius-pill);
	background-color: var(--ds-line-strong);
	transition:
		width var(--ds-dur) var(--ds-ease),
		background-color var(--ds-dur) var(--ds-ease);
}

.ds-tst__dot:hover {
	background-color: var(--ds-oxblood);
}

.ds-tst__dot.is-active {
	width: 1.6rem;
	background-color: var(--ds-oxblood);
}

/* ==========================================================================
   5. Trust stats
   ========================================================================== */
.ds-tst__stats {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: var(--ds-space-md);
	max-width: 52rem;
	margin: clamp(2.5rem, 1.5rem + 3vw, 4rem) auto 0;
	padding: clamp(1.25rem, 0.8rem + 1.5vw, 2rem);
	border: 1px solid var(--ds-line);
	border-radius: var(--ds-radius-lg);
	background-color: var(--ds-surface);
	box-shadow: var(--ds-shadow-sm);
}

.ds-tst__stat {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.15rem;
	text-align: center;
}

.ds-tst__stat-value {
	font-family: var(--ds-font-display);
	font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.4rem);
	font-weight: 600;
	line-height: 1;
	color: var(--ds-oxblood);
}

.ds-tst__stat-label {
	font-family: var(--ds-font-mono);
	font-size: 0.66rem;
	font-weight: 700;
	letter-spacing: var(--ds-ls-wide);
	text-transform: uppercase;
	color: var(--ds-muted);
}

/* ==========================================================================
   6. Entrance animation (fade up — CSS only).
   ========================================================================== */
@keyframes ds-tst-rise {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

.ds-tst__head,
.ds-tst__carousel,
.ds-tst__stats {
	animation: ds-tst-rise 0.6s var(--ds-ease) both;
}

.ds-tst__carousel { animation-delay: 0.1s; }
.ds-tst__stats { animation-delay: 0.2s; }

/* ==========================================================================
   7. Responsive
   ========================================================================== */
@media (min-width: 48em) {
	.ds-tst__stats {
		grid-template-columns: repeat(4, 1fr);
	}

	.ds-tst__stat {
		position: relative;
	}

	/* Hairline dividers between stats on wider screens */
	.ds-tst__stat + .ds-tst__stat::before {
		content: "";
		position: absolute;
		left: calc(var(--ds-space-md) * -1);
		top: 50%;
		transform: translateY(-50%);
		width: 1px;
		height: 2.4rem;
		background: var(--ds-line);
	}
}

/* ==========================================================================
   8. Reduced motion — no autoplay motion, settle to visible state.
   JS also disables autoplay when this is set.
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
	.ds-tst__head,
	.ds-tst__carousel,
	.ds-tst__stats {
		animation: none;
		opacity: 1;
		transform: none;
	}

	.ds-tst__track {
		transition: none;
	}

	.ds-tst__nav:hover,
	.ds-tst__dot {
		transform: none;
	}
}