/*
 * Components shared by the Home page and the inner pages:
 * page banner, text-and-image intro, figures grid, founder block and the
 * testimonial carousel (moved here unchanged from home.css).
 */

.page-sections > section {
	position: relative;
}

/* ------------------------------------------------------------ Page banner */
.page-banner {
	overflow: hidden;
	padding-block: clamp(50px, 34px + 3.5vw, 100px) clamp(60px, 52px + 2vw, 90px);
	text-align: center;
}

.page-banner::before {
	content: '';
	position: absolute;
	top: clamp(-497px, -40px - 23.8vw, -60px);
	left: 50%;
	z-index: 0;
	width: max(1100px, 114vw);
	aspect-ratio: 2188.9 / 926.61;
	background: url('../images/decor/hero-curve.svg') center top / 100% auto no-repeat;
	transform: translateX(-50%);
	pointer-events: none;
}

.grid-patch--banner-right {
	top: -40px;
	right: -60px;
	width: 420px;
	height: 420px;
}

.page-banner__inner {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.page-banner__inner > .badge {
	margin-bottom: clamp(12px, 9px + 0.8vw, 24px);
}

.page-banner__title {
	font-size: var(--fs-h2);
	font-weight: 500;
	line-height: 1.2;
	color: var(--c-black);
	text-wrap: balance;
}

.page-banner__text {
	max-width: 760px;
	margin-top: clamp(10px, 8px + 0.6vw, 20px);
	text-wrap: pretty;
}

.page-banner__buttons {
	margin-top: clamp(18px, 14px + 1vw, 30px);
}

/* ------------------------------------------------- Text and image intro */
.split-intro {
	padding-block: clamp(20px, 10px + 2.5vw, 50px);
}

.split-intro__inner {
	display: grid;
	gap: clamp(28px, 20px + 2vw, 60px);
	align-items: center;
}

.split-intro__body {
	text-align: center;
}

.split-intro__title {
	margin-bottom: clamp(16px, 12px + 1vw, 34px);
	font-size: var(--fs-h2);
	font-weight: 500;
	line-height: 1.2;
}

.split-intro__body p {
	line-height: 1.7;
	text-wrap: pretty;
}

.split-intro__body p + p {
	margin-top: clamp(14px, 12px + 0.5vw, 22px);
}

.split-intro__media {
	justify-self: center;
	width: min(68%, 371px);
}

.split-intro__media img {
	width: 100%;
}

@media (min-width: 1024px) {
	.split-intro__inner {
		grid-template-columns: minmax(0, 648px) auto;
		justify-content: space-between;
		padding-inline: clamp(0px, -40px + 3.5vw, 25px) clamp(0px, -110px + 10.3vw, 86px);
	}

	.split-intro__body {
		text-align: left;
	}

	.split-intro__media {
		width: clamp(300px, 100px + 14vw, 371px);
	}
}

/* -------------------------------------------------------- Figures grid */
.stat-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	grid-template-rows: repeat(2, minmax(0, 1fr));
	width: clamp(244px, 179px + 16.1vw, 384px);
	aspect-ratio: 384 / 306.6;
	background: url('../images/decor/stats-cross.svg') center / 100% 100% no-repeat;
}

.stat-grid__item {
	display: flex;
	flex-direction: column-reverse;
	align-items: center;
	gap: clamp(8px, 6px + 0.4vw, 12px);
	padding-inline: 8px;
	text-align: center;
}

.stat-grid__item:nth-child(-n + 2) {
	justify-content: flex-start;
	padding-bottom: clamp(18px, 12px + 1.5vw, 36px);
}

.stat-grid__item:nth-child(n + 3) {
	flex-direction: column-reverse;
	justify-content: flex-end;
	padding-top: clamp(18px, 12px + 1.5vw, 36px);
}

.stat-grid__value {
	font-family: var(--f-head);
	font-size: clamp(25px, 21.03px + 0.988vw, 40px);
	font-weight: 700;
	line-height: 1;
	color: var(--c-primary);
}

.stat-grid__label {
	max-width: 9.5em;
	font-size: clamp(12px, 11.74px + 0.066vw, 13px);
	line-height: 1.321;
	color: var(--c-black);
}

/* --------------------------------------------------------- Founder block */
.founder {
	--size: clamp(260px, 180px + 15vw, 469px);
	display: grid;
	justify-items: center;
	gap: clamp(24px, 16px + 2vw, 56px);
	text-align: center;
}

.founder + .founder {
	margin-top: 50px;
}

.founder__media {
	position: relative;
	width: var(--size);
	height: var(--size);
	margin-top: calc(var(--size) * 0.147);
}

.founder__glow {
	position: absolute;
	inset: -31.34%;
	background: url('../images/decor/founder-glow.svg') center / 100% 100% no-repeat;
	pointer-events: none;
}

.founder__rings {
	position: absolute;
	top: -2.56%;
	left: 0;
	width: 98.08%;
	height: 98.93%;
	background: url('../images/decor/founder-rings.svg') center / 100% 100% no-repeat;
}

.founder__circle {
	position: absolute;
	top: 2.99%;
	left: 4.69%;
	width: 90.62%;
	aspect-ratio: 1;
	border-radius: 50%;
	background: var(--c-primary);
}

.founder__photo {
	position: absolute;
	bottom: 6.4%;
	left: 4.69%;
	width: 90.62%;
	height: auto;
}

.founder__body {
	position: relative;
	z-index: 1;
	max-width: 646px;
}

.founder__title {
	margin-bottom: clamp(14px, 10px + 1vw, 34px);
	font-size: var(--fs-h3);
	font-weight: 500;
	line-height: 1.33;
	color: var(--c-black);
}

.founder__text {
	text-wrap: pretty;
}

.founder__text + .founder__text {
	margin-top: clamp(10px, 8px + 0.5vw, 20px);
}

.founder__btn {
	margin-top: clamp(22px, 16px + 1.6vw, 46px);
	text-transform: uppercase;
	font-weight: 700;
}

@media (min-width: 1024px) {
	.founder {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		align-items: center;
		justify-items: start;
		gap: clamp(40px, -60px + 7.5vw, 84px);
		text-align: left;
	}

	/* Offsets from the Figma frame, scaled with the photo size. */
	.founder__media {
		margin-left: calc(var(--size) * 0.07);
	}

	.founder--reverse .founder__media {
		order: 2;
		margin-left: calc(var(--size) * 0.318);
	}

	.founder--reverse .founder__body {
		max-width: 573px;
		margin-left: calc(var(--size) * 0.13);
	}
}

/* ----------------------------------------------------------- Testimonials */
.testimonials {
	overflow: hidden;
	padding-block: clamp(40px, 30px + 2.5vw, 64px) clamp(50px, 38px + 3vw, 90px);
	background: linear-gradient(180deg, #fff 0%, #f6f6f6 45%, #fff 100%);
}

.grid-patch--testimonials {
	bottom: 20px;
	left: -60px;
	width: 360px;
	height: 360px;
}

.testimonials .container,
.carousel {
	position: relative;
	z-index: 1;
}

.carousel {
	--card-w: min(1064px, 100vw - 2 * var(--gutter));
	margin-top: clamp(24px, 16px + 2vw, 50px);
}

.carousel__track {
	display: grid;
	gap: 20px;
	width: min(100% - 2 * var(--gutter), 1064px);
	margin-inline: auto;
}

.testimonial-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	padding: 24px 20px;
	background: linear-gradient(173.6deg, rgba(182, 210, 230, 0.35) 0%, #fff 60%);
	border: 1px solid var(--c-primary);
	border-radius: 20px;
}

.testimonial-card__quote {
	order: 2;
	font-size: clamp(13px, 11.15px + 0.461vw, 20px);
	line-height: 1.5;
	color: var(--c-black);
}

.testimonial-card__quote p + p {
	margin-top: 0.6em;
}

.stars {
	order: 1;
	display: flex;
	gap: 4px;
	margin-bottom: 18px;
	color: var(--c-star);
}

.stars__star {
	width: 18px;
	height: auto;
}

.stars__star--off {
	color: #d9d9d9;
}

.testimonial-card__author {
	order: 3;
	display: flex;
	flex-direction: column;
	margin-top: 26px;
}

.testimonial-card__name {
	font-family: var(--f-head);
	font-size: var(--fs-card-title);
	font-weight: 500;
	line-height: 1.3;
	color: var(--c-primary);
}

.testimonial-card__role {
	margin-top: 4px;
	font-size: clamp(14px, 13.5px + 0.13vw, 16px);
	color: var(--c-black);
}

.carousel__controls {
	display: none;
}

/* With JavaScript: one card in the middle, neighbours peeking at the sides. */
.js .carousel__track {
	grid-template-columns: minmax(0, 1fr);
	gap: 0;
	width: var(--card-w);
	touch-action: pan-y;
}

.js .carousel__slide {
	grid-area: 1 / 1;
	visibility: hidden;
	opacity: 0;
	transition: transform 0.7s var(--ease), opacity 0.7s var(--ease), translate 0.4s var(--ease), visibility 0s linear 0.7s;
}

.js .carousel__slide.is-active {
	z-index: 2;
	visibility: visible;
	opacity: 1;
	transition-delay: 0s;
}

.js .carousel__controls {
	display: flex;
	justify-content: center;
	gap: 12px;
	margin-top: 20px;
}

.carousel__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	color: var(--c-black);
	border: 1px solid var(--c-black);
	border-radius: 50%;
	transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}

.carousel__btn:hover {
	color: var(--c-white);
	background: var(--c-black);
}

.carousel__btn-icon {
	width: 13px;
	height: 17px;
	transform: rotate(90deg);
}

.carousel__btn-icon--prev {
	transform: rotate(-90deg);
}

@media (min-width: 768px) {
	.testimonial-card {
		padding: clamp(30px, 18px + 1.6vw, 48px) clamp(30px, 18px + 1.8vw, 52px) clamp(24px, 16px + 1vw, 34px);
		background: linear-gradient(173.6deg, #b6d2e6 10%, #fff 49%);
		border: 0;
		border-radius: var(--radius-card);
		box-shadow: 0 4px 250px rgba(0, 0, 0, 0.2);
	}

	.testimonial-card__quote {
		order: 1;
	}

	.stars {
		order: 2;
		margin: 16px 0 0;
	}

	.testimonial-card__author {
		margin-top: auto;
		padding-top: 30px;
	}

	.js .carousel__slide {
		min-height: clamp(260px, 200px + 6vw, 312px);
	}

	.js .carousel__slide.is-prev,
	.js .carousel__slide.is-next {
		z-index: 1;
		visibility: visible;
		opacity: 1;
		cursor: pointer;
		transition-delay: 0s;
	}

	.js .carousel__slide.is-prev {
		transform: translateX(calc(-1 * (var(--card-w) * 0.9418 + 20px))) scale(0.8835);
	}

	.js .carousel__slide.is-next {
		transform: translateX(calc(var(--card-w) * 0.9418 + 20px)) scale(0.8835);
	}

	.js .carousel__slide.is-prev .testimonial-card,
	.js .carousel__slide.is-next .testimonial-card {
		background: #fff;
		box-shadow: 0 4px 60px rgba(0, 0, 0, 0.08);
	}

	.js .carousel__controls {
		margin-top: clamp(24px, 16px + 1vw, 36px);
	}

	.js .carousel__btn {
		background: var(--c-white);
	}
}

/* Dots between the arrows: the current one is a short bar. */
.carousel__controls {
	align-items: center;
}

.carousel__dots {
	display: flex;
	gap: 8px;
	margin-inline: 6px;
}

.carousel__dot {
	position: relative;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: rgba(84, 162, 217, 0.35);
	transition: width 0.25s var(--ease), background-color 0.25s var(--ease);
}

.carousel__dot::before {
	content: '';
	position: absolute;
	inset: -8px -4px;
}

.carousel__dot[aria-current='true'] {
	width: 22px;
	border-radius: 4px;
	background: var(--c-primary);
}

/* Mouse drag and touch swipe: the cards follow the pointer. */
.js .carousel__track {
	cursor: grab;
	user-select: none;
}

.js .carousel__slide {
	translate: var(--drag, 0px) 0;
}

.carousel.is-dragging .carousel__track {
	cursor: grabbing;
}

.carousel.is-dragging .carousel__slide {
	transition: none;
}

.testimonials__cta {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: clamp(16px, 12px + 1vw, 28px);
	margin-top: clamp(26px, 18px + 2vw, 44px);
	text-align: center;
}

.testimonials__cta p {
	font-size: var(--fs-body);
	color: var(--c-text);
}

/* Reduced motion: cards switch at once, without sliding. */
@media (prefers-reduced-motion: reduce) {
	.js .carousel__slide,
	.js .carousel__slide .testimonial-card {
		transition: none;
	}
}
