/**
 * Section layer: one block per ACF flexible-content layout.
 */

/* ======================================================================
   Hero
   ====================================================================== */

.p-hero {
	position: relative;
	overflow: hidden;
	padding-block: clamp(2.5rem, 1rem + 6vw, 5.5rem) clamp(3rem, 1rem + 7vw, 6.5rem);
	background:
		radial-gradient(120% 90% at 78% 18%, var(--p-green-100) 0%, rgba(228, 235, 228, 0) 58%),
		radial-gradient(90% 80% at 10% 92%, var(--p-gold-100) 0%, rgba(243, 234, 216, 0) 55%),
		var(--p-ivory-100);
}

.p-hero__inner {
	display: grid;
	gap: var(--p-space-7);
	align-items: center;
}

@media (min-width: 1024px) {
	.p-hero__inner {
		grid-template-columns: 1.05fr 0.95fr;
		gap: var(--p-space-8);
	}
}

.p-hero__title {
	font-size: var(--p-text-display);
	font-weight: 300;
	line-height: var(--p-leading-tight);
	letter-spacing: -0.02em;
	max-width: 14ch;
}

.p-hero__lede {
	max-width: 46ch;
	margin-top: var(--p-space-5);
	color: var(--p-text-muted);
	line-height: 1.7;
}

.p-hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--p-space-3);
	margin-top: var(--p-space-6);
}

.p-hero__trust {
	display: flex;
	flex-wrap: wrap;
	gap: var(--p-space-5);
	margin-top: var(--p-space-7);
	padding-top: var(--p-space-5);
	border-top: 1px solid var(--p-line-soft);
	font-size: var(--p-text-micro);
	color: var(--p-text-muted);
}

.p-hero__trust li {
	display: flex;
	align-items: center;
	gap: var(--p-space-2);
}

.p-hero__trust svg {
	width: 16px;
	height: 16px;
	color: var(--p-green-500);
}

/* ---- Hero art ---- */

.p-hero__art {
	position: relative;
	aspect-ratio: 1;
	max-width: 560px;
	width: 100%;
	margin-inline: auto;
}

.p-hero__disc {
	position: absolute;
	inset: 6% 6% 6% 6%;
	border-radius: 50%;
	background: linear-gradient(150deg, var(--p-green-100) 0%, var(--p-ivory-200) 100%);
}

.p-hero__leaf {
	position: absolute;
	display: block;
}

.p-hero__leaf svg {
	width: 100%;
	height: auto;
	stroke-width: 2.6;
}

.p-hero__leaf--main {
	inset: 8% 10% 4% 12%;
	color: var(--p-green-700);
}

.p-hero__leaf--back {
	inset: 2% 0 22% 30%;
	color: var(--p-green-500);
	opacity: 0.34;
	transform: rotate(14deg);
}

.p-hero__chip {
	position: absolute;
	left: 0;
	bottom: 6%;
	display: flex;
	align-items: center;
	gap: var(--p-space-3);
	padding: var(--p-space-3) var(--p-space-4);
	background: var(--p-white);
	border-radius: var(--p-radius-pill);
	box-shadow: var(--p-shadow-card);
}

.p-hero__chip-stars {
	display: inline-flex;
	gap: 1px;
	color: var(--p-gold-500);
}

.p-hero__chip-stars svg {
	width: 12px;
	height: 12px;
	fill: currentColor;
}

.p-hero__chip-text {
	font-size: var(--p-text-micro);
	line-height: 1.35;
	color: var(--p-text-muted);
}

.p-hero__chip-text strong {
	display: block;
	color: var(--p-text);
	font-weight: 600;
}

/* ======================================================================
   Rails
   ====================================================================== */

.p-rail {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: 68%;
	gap: var(--p-space-4);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	padding-bottom: var(--p-space-3);
	margin-inline: calc(var(--p-gutter) * -1);
	padding-inline: var(--p-gutter);
	scrollbar-width: none;
}

.p-rail::-webkit-scrollbar {
	display: none;
}

.p-rail > * {
	scroll-snap-align: start;
}

@media (min-width: 560px) {
	.p-rail--cats {
		grid-auto-columns: 30%;
	}

	.p-rail--products,
	.p-rail--reviews {
		grid-auto-columns: 44%;
	}
}

@media (min-width: 1024px) {
	.p-rail {
		grid-auto-flow: row;
		grid-template-columns: repeat(4, 1fr);
		overflow: visible;
		margin-inline: 0;
		padding-inline: 0;
		gap: var(--p-space-5);
	}

	.p-rail--cats {
		grid-template-columns: repeat(6, 1fr);
	}
}

/* ======================================================================
   Editorial split
   ====================================================================== */

.p-split {
	display: grid;
	gap: var(--p-space-7);
	align-items: center;
}

@media (min-width: 900px) {
	.p-split {
		grid-template-columns: 0.9fr 1.1fr;
		gap: var(--p-space-9);
	}
}

.p-split__art {
	position: relative;
	aspect-ratio: 4 / 5;
	display: grid;
	place-items: center;
	background: var(--p-green-100);
	border-radius: var(--p-radius-lg);
	overflow: hidden;
	color: var(--p-green-800);
}

.p-split__art .p-art {
	background: none;
	width: 74%;
	aspect-ratio: 1;
}

.p-split__art .p-art__svg {
	width: 100%;
	opacity: 0.9;
}

.p-split__disc {
	position: absolute;
	width: 68%;
	aspect-ratio: 1;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.5);
}

/*
 * The ambient film fills the panel. The source is 9:16 and the panel is 4:5,
 * so `cover` crops the top and bottom rather than letterboxing — the subject
 * sits in the middle third of the frame, which is what survives the crop.
 *
 * It sits under the stat card, which is positioned above it.
 */
.p-split__video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	/* The panel's own green shows through until the first frame paints. */
	background: var(--p-green-100);
}

/*
 * A wash at the foot of the panel so the white stat card keeps its contrast
 * whatever the video is doing behind it.
 */
.p-split__art::after {
	content: "";
	position: absolute;
	inset: auto 0 0 0;
	height: 45%;
	background: linear-gradient(to top, rgba(30, 58, 46, 0.28), transparent);
	pointer-events: none;
}

/* No wash when there is no video — the illustration needs no protection. */
.p-split__art:not(:has(.p-split__video))::after {
	content: none;
}

.p-split__stat {
	position: absolute;
	/* Above the video and the contrast wash, both of which precede it. */
	z-index: 1;
	left: var(--p-space-5);
	bottom: var(--p-space-5);
	right: var(--p-space-5);
	display: flex;
	align-items: center;
	gap: var(--p-space-3);
	padding: var(--p-space-4);
	background: var(--p-white);
	border-radius: var(--p-radius-md);
	box-shadow: var(--p-shadow-card);
}

.p-split__stat-num {
	font-family: var(--p-font-serif);
	font-size: 2.6rem;
	line-height: 1;
	color: var(--p-green-700);
	/* Cormorant defaults to old-style figures; a headline stat needs lining. */
	font-variant-numeric: lining-nums;
	font-feature-settings: "lnum" 1;
}

.p-split__stat-label {
	font-size: var(--p-text-micro);
	color: var(--p-text-muted);
	line-height: 1.45;
}

.p-split__title {
	font-size: var(--p-text-h1);
	max-width: 16ch;
}

.p-split__lede {
	max-width: 52ch;
	margin-top: var(--p-space-4);
	color: var(--p-text-muted);
	line-height: 1.7;
}

.p-steps {
	display: grid;
	gap: var(--p-space-5);
	margin-block: var(--p-space-6);
}

.p-steps__item {
	display: grid;
	/* 48px for a two-digit number was generous; the 12px it gives back is the
	   difference between the third step's copy fitting and not. */
	grid-template-columns: 36px 1fr;
	gap: var(--p-space-3);
	align-items: start;
	padding-top: var(--p-space-3);
	border-top: 1px solid var(--p-line-soft);
}

.p-steps__num {
	font-family: var(--p-font-serif);
	font-size: 1.2rem;
	color: var(--p-gold-600);
	font-variant-numeric: lining-nums;
	font-feature-settings: "lnum" 1;
}

.p-steps__title {
	font-size: var(--p-text-h4);
	font-weight: 500;
}

.p-steps__text {
	margin-top: 4px;
	font-size: var(--p-text-small);
	color: var(--p-text-muted);
	line-height: 1.55;
	/*
	 * No orphans. The third step was breaking with the single word "it." alone
	 * on its own line, which is what made that entry look like a mistake next
	 * to the two above it. `pretty` asks the browser to pull a word down from
	 * the previous line rather than leave one stranded; browsers without it
	 * simply wrap as before.
	 */
	text-wrap: pretty;
}

/* ======================================================================
   Shop by space
   ====================================================================== */

.p-spaces {
	display: grid;
	gap: var(--p-space-3);
}

@media (min-width: 600px) {
	.p-spaces {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 1024px) {
	.p-spaces {
		grid-template-columns: repeat(3, 1fr);
		gap: var(--p-space-4);
	}
}

.p-space {
	position: relative;
	display: block;
	padding: var(--p-space-5);
	border: 1px solid rgba(248, 246, 241, 0.16);
	border-radius: var(--p-radius-md);
	transition: background var(--p-dur-ui) var(--p-ease), border-color var(--p-dur-ui) var(--p-ease);
}

.p-space:hover {
	background: rgba(248, 246, 241, 0.05);
	border-color: var(--p-gold-500);
}

.p-space__icon {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border-radius: var(--p-radius-pill);
	background: rgba(201, 166, 107, 0.16);
	color: var(--p-gold-500);
	margin-bottom: var(--p-space-4);
}

.p-space__title {
	display: block;
	font-family: var(--p-font-serif);
	font-size: var(--p-text-h3);
	color: var(--p-ivory-100);
}

.p-space__text {
	display: block;
	margin-top: var(--p-space-2);
	font-size: var(--p-text-small);
	color: rgba(248, 246, 241, 0.66);
	max-width: 30ch;
}

.p-space__go {
	position: absolute;
	top: var(--p-space-5);
	right: var(--p-space-5);
	color: var(--p-gold-500);
	opacity: 0;
	transform: translateX(-6px);
	transition: opacity var(--p-dur-ui) var(--p-ease), transform var(--p-dur-ui) var(--p-ease);
}

.p-space:hover .p-space__go {
	opacity: 1;
	transform: none;
}

/* ======================================================================
   Promises band
   ====================================================================== */

.p-promises {
	display: grid;
	gap: var(--p-space-6);
	padding-block: var(--p-space-6);
	border-block: 1px solid var(--p-line-soft);
}

@media (min-width: 600px) {
	.p-promises {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 1024px) {
	.p-promises {
		grid-template-columns: repeat(4, 1fr);
		gap: var(--p-space-7);
	}
}

.p-promise__icon {
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	border-radius: var(--p-radius-pill);
	background: var(--p-green-100);
	color: var(--p-green-700);
	margin-bottom: var(--p-space-4);
}

.p-promise__title {
	font-family: var(--p-font-serif);
	font-size: var(--p-text-h3);
}

.p-promise__text {
	margin-top: var(--p-space-2);
	font-size: var(--p-text-small);
	color: var(--p-text-muted);
	line-height: 1.6;
	max-width: 32ch;
}

/* ======================================================================
   Delivery checker
   ====================================================================== */

.p-dc {
	display: grid;
	gap: var(--p-space-6);
	align-items: center;
}

@media (min-width: 900px) {
	.p-dc {
		grid-template-columns: 1fr 1fr;
		gap: var(--p-space-9);
	}
}

.p-dc__title {
	font-size: var(--p-text-h2);
	max-width: 16ch;
}

.p-dc__lede {
	max-width: 48ch;
	margin-top: var(--p-space-4);
	color: var(--p-text-muted);
	line-height: 1.7;
}

.p-dc__panel {
	padding: var(--p-space-6);
	background: var(--p-white);
	border: 1px solid var(--p-line-soft);
	border-radius: var(--p-radius-lg);
	box-shadow: var(--p-shadow-card);
}

.p-dc__label {
	display: block;
	margin-bottom: var(--p-space-2);
	font-size: var(--p-text-micro);
	font-weight: 500;
	letter-spacing: var(--p-track-label);
	text-transform: uppercase;
	color: var(--p-text-muted);
}

.p-dc__row {
	display: flex;
	gap: var(--p-space-2);
}

.p-dc__row .p-input {
	letter-spacing: 0.18em;
	font-size: 1rem;
}

.p-dc__hint {
	margin-top: var(--p-space-3);
	font-size: var(--p-text-micro);
	color: var(--p-gray-400);
}

.p-dc__result:not(:empty) {
	margin-top: var(--p-space-4);
	padding-top: var(--p-space-4);
	border-top: 1px solid var(--p-line-soft);
}

.p-dc__lines {
	display: grid;
	gap: var(--p-space-3);
	font-size: var(--p-text-small);
}

.p-dc__line {
	display: flex;
	align-items: center;
	gap: var(--p-space-3);
}

.p-dc__line svg {
	width: 18px;
	height: 18px;
	color: var(--p-green-500);
	flex: none;
}

.p-dc__line--off svg {
	color: var(--p-gray-400);
}

.p-dc__line--error svg {
	color: var(--p-error);
}

.p-dc__city {
	font-weight: 600;
}

/* ======================================================================
   Newsletter
   ====================================================================== */

/*
 * The newsletter band sits directly on top of the footer, and both were
 * `--p-green-900`. Two dark green blocks meeting edge to edge read as one very
 * tall footer with a form floating in it. A step to green-800 separates them
 * without introducing a colour the palette does not already have.
 */
.p-news-section {
	background: var(--p-green-800);
}

.p-news {
	display: grid;
	gap: var(--p-space-6);
	align-items: center;
}

@media (min-width: 900px) {
	.p-news {
		grid-template-columns: 1fr 1fr;
		gap: var(--p-space-9);
	}
}

.p-news__title {
	font-size: var(--p-text-h2);
	color: var(--p-ivory-100);
	max-width: 14ch;
}

.p-news__lede {
	margin-top: var(--p-space-4);
	color: rgba(248, 246, 241, 0.7);
	max-width: 46ch;
	line-height: 1.7;
}

.p-news__row {
	display: flex;
	gap: var(--p-space-2);
}

.p-news__row .p-input {
	background: rgba(255, 255, 255, 0.06);
	border-color: rgba(248, 246, 241, 0.24);
	color: var(--p-ivory-100);
}

.p-news__row .p-input::placeholder {
	color: rgba(248, 246, 241, 0.42);
}

.p-news__consent {
	margin-top: var(--p-space-3);
	font-size: var(--p-text-micro);
	color: rgba(248, 246, 241, 0.55);
	max-width: 42ch;
	line-height: 1.55;
}

.p-news__result:not(:empty) {
	margin-top: var(--p-space-3);
	font-size: var(--p-text-small);
	color: var(--p-gold-500);
}

/* ======================================================================
   Article, 404, empty states
   ====================================================================== */

.p-article__head {
	max-width: var(--p-measure);
	margin-inline: auto;
	text-align: center;
}

.p-article__title {
	font-size: var(--p-text-h1);
	margin-top: var(--p-space-3);
}

.p-article__meta {
	margin-top: var(--p-space-3);
	font-size: var(--p-text-micro);
	color: var(--p-text-muted);
}

.p-article__media {
	margin: var(--p-space-7) 0;
}

.p-article__media img {
	width: 100%;
	border-radius: var(--p-radius-lg);
}

.p-404__inner {
	max-width: 46ch;
	margin-inline: auto;
	text-align: center;
	padding-block: var(--p-space-7);
}

.p-404__title {
	font-size: var(--p-text-h1);
}

.p-404__text {
	margin-top: var(--p-space-4);
	color: var(--p-text-muted);
}

.p-404__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--p-space-3);
	margin-top: var(--p-space-6);
}

.p-empty {
	text-align: center;
	padding-block: var(--p-space-7);
}

.p-empty__text {
	color: var(--p-text-muted);
	margin-bottom: var(--p-space-5);
}

.p-404 .search-form,
.p-empty .search-form {
	display: flex;
	gap: var(--p-space-2);
	justify-content: center;
	margin-top: var(--p-space-5);
}

.p-404 .search-field,
.p-empty .search-field {
	min-height: 48px;
	padding: 0 var(--p-space-4);
	border: 1px solid var(--p-gray-300);
	border-radius: var(--p-radius-sm);
	background: var(--p-white);
}

.p-404 .search-submit,
.p-empty .search-submit {
	min-height: 48px;
	padding: 0 var(--p-space-5);
	background: var(--p-green-700);
	color: var(--p-white);
	border: 0;
	border-radius: var(--p-radius-pill);
	cursor: pointer;
}

/* ======================================================================
   Plant match — the discovery grid below the immersive hero
   ====================================================================== */

.p-match {
	position: relative;
	background: var(--p-bg);
	padding-block: clamp(4.5rem, 3rem + 7vw, 9rem);
	/* Lifts the ivory over the hero so the two sections meet without a seam. */
	border-radius: 28px 28px 0 0;
	margin-top: -28px;
	z-index: 1;
}

/* A botanical texture so faint it reads as paper grain, not pattern. */
.p-match::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	pointer-events: none;
	opacity: 0.5;
	background-image:
		radial-gradient(circle at 12% 18%, rgba(79, 143, 103, 0.05) 0, transparent 38%),
		radial-gradient(circle at 88% 72%, rgba(156, 123, 62, 0.04) 0, transparent 42%);
}

.p-match > .p-container {
	position: relative;
}

/* ---- Heading ----------------------------------------------------------- */

.p-match__head {
	max-width: 40ch;
	margin-inline: auto;
	margin-bottom: clamp(3rem, 2rem + 4vw, 5.5rem);
	text-align: center;
}

.p-match__title {
	font-size: clamp(2.1rem, 1.3rem + 3.4vw, 3.75rem);
	font-weight: 300;
	line-height: var(--p-leading-tight);
	letter-spacing: -0.015em;
	margin-bottom: var(--p-space-5);
}

.p-match__lede {
	font-size: clamp(1rem, 0.95rem + 0.35vw, 1.15rem);
	line-height: var(--p-leading-body);
	color: var(--p-text-muted);
	margin-bottom: var(--p-space-4);
}

.p-match__sub {
	font-size: var(--p-text-small);
	letter-spacing: var(--p-track-label);
	text-transform: uppercase;
	color: var(--p-green-500);
}

/* ---- Grid -------------------------------------------------------------- */

.p-match__grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: var(--p-space-5);
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (min-width: 768px) and (max-width: 1023px) {
	.p-match__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: var(--p-space-6);
	}
}

/*
 * Mobile: a swipe rail rather than a stack. Eight full-width cards would be
 * eight screens of scrolling before the rest of the page.
 */
@media (max-width: 767px) {
	.p-match__grid {
		grid-auto-flow: column;
		grid-auto-columns: 74%;
		grid-template-columns: none;
		gap: var(--p-space-4);
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		scrollbar-width: none;
		/* Bleed to the viewport edge so the rail reads as scrollable. */
		margin-inline: calc(var(--p-gutter) * -1);
		padding-inline: var(--p-gutter);
		padding-bottom: var(--p-space-3);
	}

	.p-match__grid::-webkit-scrollbar {
		display: none;
	}

	.p-match__item {
		scroll-snap-align: center;
	}
}

/* ---- Card -------------------------------------------------------------- */

.p-match__card {
	display: flex;
	flex-direction: column;
	height: 100%;
	border-radius: 28px;
	overflow: hidden;
	background: var(--p-surface);
	border: 1px solid var(--p-line-soft);
	box-shadow: 0 1px 2px rgba(30, 58, 46, 0.03);
	color: inherit;
	/* Only compositor-friendly properties animate. */
	transition:
		transform 300ms var(--p-ease),
		box-shadow 300ms var(--p-ease),
		border-color 300ms var(--p-ease);
	will-change: transform;
}

.p-match__media {
	display: block;
	position: relative;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: var(--p-ivory-200);
}

.p-match__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 620ms var(--p-ease);
}

/* The glass highlight — a single soft sheen across the image, not a gradient
   wash. It brightens fractionally on hover. */
.p-match__media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(
		168deg,
		rgba(255, 255, 255, 0.22) 0%,
		rgba(255, 255, 255, 0) 42%,
		rgba(30, 58, 46, 0.06) 100%
	);
	opacity: 0.85;
	transition: opacity 300ms var(--p-ease);
	pointer-events: none;
}

.p-match__body {
	display: flex;
	align-items: center;
	gap: var(--p-space-3);
	padding: var(--p-space-4) var(--p-space-5);
	flex: 1;
}

.p-match__icon svg {
	width: 20px;
	height: 20px;
	color: var(--p-green-500);
	flex-shrink: 0;
}

.p-match__text {
	flex: 1;
	min-width: 0;
	display: grid;
	gap: 2px;
}

.p-match__name {
	font-size: var(--p-text-small);
	font-weight: 600;
	letter-spacing: var(--p-track-btn);
}

.p-match__note {
	font-size: var(--p-text-micro);
	line-height: 1.5;
	color: var(--p-text-muted);
}

.p-match__go svg {
	width: 18px;
	height: 18px;
	color: var(--p-green-700);
	flex-shrink: 0;
	transform: translateX(-4px);
	opacity: 0;
	transition:
		transform 300ms var(--p-ease),
		opacity 300ms var(--p-ease);
}

/* ---- Hover ------------------------------------------------------------- */

.p-match__card:hover,
.p-match__card:focus-visible {
	transform: translateY(-8px);
	border-color: rgba(79, 143, 103, 0.34);
	box-shadow:
		0 2px 4px rgba(30, 58, 46, 0.05),
		0 18px 44px rgba(30, 58, 46, 0.11);
}

.p-match__card:hover .p-match__media img,
.p-match__card:focus-visible .p-match__media img {
	transform: scale(1.055);
}

.p-match__card:hover .p-match__media::after {
	opacity: 0.55;
}

.p-match__card:hover .p-match__go svg,
.p-match__card:focus-visible .p-match__go svg {
	transform: translateX(0);
	opacity: 1;
}

.p-match__card:focus-visible {
	outline: 2px solid var(--p-green-700);
	outline-offset: 3px;
}

/* ---- Entrance ---------------------------------------------------------- */

.p-match__item {
	opacity: 0;
	transform: translateY(22px);
	transition:
		opacity 620ms var(--p-ease),
		transform 620ms var(--p-ease);
	transition-delay: var(--stagger, 0ms);
}

.p-match__item.is-in {
	opacity: 1;
	transform: none;
}

.p-match__head {
	opacity: 0;
	transform: translateY(18px);
	transition:
		opacity 700ms var(--p-ease),
		transform 700ms var(--p-ease);
}

.p-match__head.is-in {
	opacity: 1;
	transform: none;
}

@media (prefers-reduced-motion: reduce) {
	.p-match__item,
	.p-match__head {
		opacity: 1;
		transform: none;
		transition: none;
	}

	.p-match__card,
	.p-match__media img,
	.p-match__go svg {
		transition: none;
	}

	.p-match__card:hover {
		transform: none;
	}
}
