/* ==========================================================================
   Services Page
   ========================================================================== */

/*
 * --header-h : real fixed-header height, set from JS (fallback 0px).
 * --card-h   : each card's measured pixel height, set from JS per card.
 *              Drives the smart-sticky `top` below.
 */
:root {
	--header-h: 0px;
}

/* Services Hero
--------------------------------------------- */
.services-hero {
	background: #fff;
	padding: 70px 0;
	border-bottom: 1px solid rgba(76, 70, 69, 0.2);
}

.services-hero__grid {
	display: grid;
	grid-template-columns: 1fr 3fr;
	gap: 2rem;
	align-items: center;
}

.services-hero__label {
	font-family: "Geist", sans-serif;
	font-size: clamp(1rem, 1.5vw, 1.375rem);
	font-weight: 300;
	color: #4C4645;
	border: 1px solid #4C4645;
	border-radius: 100px;
	padding: 8px 20px;
	white-space: nowrap;
	align-self: center;
	justify-self: start;
}

.services-hero__heading {
	font-family: "Geist", sans-serif;
	font-size: clamp(2.25rem, 5.5vw, 5rem);
	font-weight: 300;
	color: #4C4645;
	line-height: 1.1;
	margin: 0;
}

/* Services — Smart Sticky Stack
--------------------------------------------- */

/*
 * Cards are direct siblings, all position:sticky. The sticky `top` is
 * computed per card from its measured height:
 *
 *   top: min(--header-h, 100vh - --card-h)
 *
 *   • Short card (fits the viewport): 100vh - card-h is positive, so
 *     min() picks --header-h  ->  pins just under the header, title
 *     anchored at the top (the original stacking feel).
 *
 *   • Tall card (taller than viewport): 100vh - card-h is negative, so
 *     min() picks that negative value  ->  the card scrolls ALL the way
 *     through (its bottom reaches the viewport edge, i.e. you've read
 *     everything) and ONLY THEN pins, while the next card climbs over
 *     it. Nothing is ever clipped, at any screen height.
 *
 * z-index is set ascending per card from JS so every card — last one
 * included — overlays the one before it.
 */
.services {
	min-height: 100vh;
}

.service {
	position: sticky;
	top: min(var(--header-h, 0px), calc(100vh - var(--card-h, 100vh)));
	min-height: calc(100vh - var(--header-h, 0px));
	padding: clamp(2rem, 6vh, 6rem) 0 clamp(2rem, 5vh, 5rem);
	margin-bottom: 14vh; /* dwell before the next card overlaps */
	background: #fff;
	display: flex;
	align-items: flex-start;
	z-index: 1; /* JS overrides with an ascending value per card */
}

.service:last-child {
	margin-bottom: 0;
}

/* Divider between stacked cards (works for any number of cards) */
.service + .service {
	border-top: 1px solid rgba(76, 70, 69, 0.2);
}

/* Number — right-aligned within the media column */
.service__number {
	font-family: "Geist", sans-serif;
	font-size: clamp(2.5rem, 4vw, 3.75rem);
	font-weight: 300;
	color: #4C4645;
	line-height: 1;
	margin: 0;
	padding-bottom: 40px;
}

/* Two-column layout: content + number column */
.service__grid {
	display: grid;
	grid-template-columns: 1fr 450px;
	gap: 3rem;
	align-items: flex-start;
	margin-top: 0;
}

.service__title {
	font-family: "Geist", sans-serif;
	font-size: clamp(1.875rem, 3.4vw, 3.25rem);
	font-weight: 300;
	color: #4C4645;
	line-height: 1.1;
	margin-bottom: 32px;
	margin-top: 0;
}

.service__title a {
	font-family: inherit;
	font-size: inherit;
	color: inherit;
	text-decoration: none;
}

.service__media {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
}

.service__img {
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	display: block;
}

.service__desc {
	font-family: "Geist", sans-serif;
	font-size: clamp(0.95rem, 1.25vw, 1.1875rem);
	font-weight: 400;
	color: #4C4645;
	line-height: 1.5;
	max-width: 490px;
	margin-bottom: 1.5rem;
}

.service__desc p {
	margin: 0 0 0.85rem;
}

/* Content blocks inside the description */
.service__tagline {
	font-weight: 500;
	margin-bottom: 1rem;
}

.service__subtitle {
	font-family: "Geist", sans-serif;
	font-size: clamp(0.95rem, 1.1vw, 1.125rem);
	font-weight: 500;
	color: #4C4645;
	line-height: 1.2;
	margin: 1.25rem 0 0.5rem;
}

.service__list {
	font-size: clamp(0.9rem, 1vw, 1.1rem);
	line-height: 1.5;
	margin: 0 0 1.5rem;
	padding-left: 1.1rem;
	columns: 1;
	column-gap: 2.5rem;
}

.service__list li {
	margin-bottom: 0.3rem;
	break-inside: avoid;
}

.service__cta-lead {
	font-size: clamp(0.95rem, 1.2vw, 1.125rem);
	line-height: 1.5;
	margin-top: 1.25rem;
}

.service__note {
	font-size: clamp(0.8rem, 0.95vw, 0.95rem);
	line-height: 1.5;
	color: rgba(76, 70, 69, 0.7);
	margin: 1rem 0;
}

.btn--dark {
	font-family: "Geist", sans-serif;
	font-size: 1rem;
	font-weight: 400;
	color: #fff;
	background: #4C4645;
	border: 1px solid #4C4645;
	border-radius: 100px;
	padding: 0.5rem 1.5rem;
	text-decoration: none;
	display: inline-block;
	transition: all 0.2s ease;
}

.btn--dark:hover {
	background: transparent;
	color: #4C4645;
}

/*
 * Single-column breakpoint: the ONLY place the stack is switched off.
 * Down to 768px the smart-sticky stacking stays fully active; at 768px
 * the layout flips to image/number on top, text below — at which point
 * stacking no longer makes sense, so cards become normal sections.
 */
@media (max-width: 768px) {
	.services-hero__grid {
		grid-template-columns: 1fr;
		gap: 1.5rem;
	}

	.service {
		position: static;
		top: auto;
		min-height: 0;
		margin-bottom: 0;
		padding: 3rem 0;
		z-index: auto;
		border-top: 1px solid rgba(76, 70, 69, 0.2);
	}

	.service:first-child {
		border-top: 0;
	}

	/* Single column, reversed: image/number block sits on top,
	   text below. flex column-reverse is more robust here than
	   relying on `order` on grid items. */
	.service__grid {
		display: flex;
		flex-direction: column-reverse;
		align-items: stretch;
		gap: 2rem;
	}

	.service__list {
		columns: 1;
	}

	.service__number {
		font-size: 2rem;
	}
}