/**
 * Component: How It Works — styles
 * Scoped to .how-it-works (BEM root). All rules confined to this component —
 * no global/site-wide selectors. Site-wide tokens from style.css via var(--*).
 *
 * Centered head, then three two-column rows. Even rows flip (mockup left, copy
 * right). Below 900px every row stacks copy-first.
 */

/* ── Root ─────────────────────────────────────────────────────── */
.how-it-works {
	background: var(--color-bg);
	color: var(--color-text-pri);
	padding-block: clamp(3.5rem, 7vw, 6rem);
	padding-inline: var(--space-lg);
}

.how-it-works__inner {
	max-width: 1100px;
	margin-inline: auto;
}

/* ── Head ─────────────────────────────────────────────────────── */
.how-it-works__head {
	text-align: center;
}

.how-it-works__heading {
	margin: 0;
	font-family: var(--font-title);
	font-size: clamp(2rem, 4vw, 3.5rem);
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -0.03em;
	color: var(--color-text-pri);
}

.how-it-works__intro {
	max-width: 700px;
	margin: var(--space-xl) auto 0;
	font-family: var(--font-body);
	font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
	line-height: 1.5;
	color: var(--color-text-sec);
}

/* ── Steps ────────────────────────────────────────────────────── */
.how-it-works__steps {
	list-style: none;
	margin: clamp(2.5rem, 6vw, 5rem) 0 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: clamp(2.5rem, 5vw, 4rem);
}

.how-it-works__step {
	display: grid;
	grid-template-columns: 1fr 1fr;
	align-items: center;
	gap: clamp(2rem, 6vw, 5.5rem);
	margin: 0;
}

/* Even rows: mockup left, copy right. */
.how-it-works__step:nth-child(even) .how-it-works__copy {
	order: 2;
}

.how-it-works__copy {
	max-width: 510px;
}

/* ── Number badge ─────────────────────────────────────────────── */
.how-it-works__badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 76px;
	height: 76px;
	border-radius: 50%;
	background: var(--color-panel-bottom);
	box-shadow: 4px 8px 16px rgba(6, 63, 120, 0.18);
	font-family: var(--font-title);
	font-size: 2.25rem;
	font-weight: 700;
	line-height: 1;
	color: var(--color-brand);
}

.how-it-works__title {
	margin: var(--space-2xl) 0 0;
	font-family: var(--font-title);
	font-size: clamp(1.75rem, 3vw, 2.5rem);
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.04em;
	color: var(--color-text-pri);
}

.how-it-works__body {
	margin: var(--space-xl) 0 0;
	font-family: var(--font-body);
	font-size: var(--text-body-lg);
	line-height: 1.75;
	color: var(--color-text-sec);
}

/* ── Mockup ───────────────────────────────────────────────────── */
.how-it-works__media {
	display: flex;
	justify-content: center;
}

.how-it-works__image {
	display: block;
	width: 100%;
	max-width: 510px;
	height: auto;
}

/* ── Tablet ≤900px — stack, copy first ────────────────────────── */
@media (max-width: 900px) {
	.how-it-works {
		padding-inline: var(--space-2xl);
	}

	.how-it-works__step {
		grid-template-columns: 1fr;
		gap: var(--space-2xl);
	}

	.how-it-works__step:nth-child(even) .how-it-works__copy {
		order: 0;
	}

	.how-it-works__copy {
		max-width: 600px;
		margin-inline: auto;
		text-align: center;
	}

	.how-it-works__image {
		max-width: 420px;
	}
}

/* ── Mobile ≤480px ────────────────────────────────────────────── */
@media (max-width: 480px) {
	.how-it-works {
		padding-inline: var(--space-lg);
	}

	.how-it-works__badge {
		width: 60px;
		height: 60px;
		font-size: 1.75rem;
	}

	.how-it-works__title {
		margin-top: var(--space-xl);
	}

	.how-it-works__body {
		margin-top: var(--space-lg);
		font-size: var(--text-body);
	}
}

/* ── Scroll-in reveal ─────────────────────────────────────────── */
/* CSS scroll-driven animation: each step fades up as it enters the viewport.
   No JS. Browsers without animation-timeline (Firefox today) skip the block
   and show the static layout; reduced-motion users skip it too. */
@media (prefers-reduced-motion: no-preference) {
	@supports (animation-timeline: view()) {
		@keyframes how-it-works-rise {
			from { opacity: 0; transform: translateY(32px); }
		}

		.how-it-works__head,
		.how-it-works__step {
			animation: how-it-works-rise linear both;
			animation-timeline: view();
			animation-range: entry 10% entry 70%;
		}
	}
}
