/*--------------------------------------------------------------
# How It Works (flight path)
# Earn → Transfer → Fly under a dotted route a plane flies on scroll.
--------------------------------------------------------------*/

.hiw {
	/* No padding of its own: the section above ends with bottom padding
	   (the one exception is handled just below), and Membership below
	   brings its own 160px top margin. */
	padding: 0;
}

/* At 1280px+ the services grid drops its bottom padding when this section
   follows it, so the gap above moves here. */
@media screen and (min-width: 1280px) {
	.services-grid + .hiw {
		padding-top: 120px;
	}
}

.hiw__container {
	width: 100%;
	max-width: var(--tpp-container-max);
	margin: 0 auto;
	padding: 0 var(--tpp-container-padding);
}


/* ── Header ── */
.hiw__header {
	text-align: center;
}

.hiw__title {
	font-family: var(--tpp-font-heading);
	font-size: clamp(2rem, 4vw + 0.5rem, 3.25rem);
	font-weight: 600;
	line-height: 1.15;
	letter-spacing: -0.03em;
	color: var(--tpp-black);
	margin: 0;
}


/* ── Route ── */
.hiw__path {
	position: relative;
	margin-top: 64px;
}

.hiw__svg {
	display: block;
	width: 100%;
	height: auto;
	overflow: visible;
}

.hiw__route {
	fill: none;
	stroke: var(--tpp-black);
	stroke-width: 2;
	stroke-dasharray: 2 10;
	stroke-linecap: round;
}

.hiw__trail {
	fill: none;
	stroke: var(--tpp-accent-dark);
	stroke-width: 3;
	stroke-linecap: round;
}

.hiw__plane {
	fill: var(--tpp-black);
}

.hiw__dot {
	fill: var(--tpp-white);
	stroke: var(--tpp-black);
	stroke-width: 2;
	transition: fill 0.4s ease;
}

.hiw__dot.is-on {
	fill: var(--tpp-accent);
}


/* ── Steps ── */
.hiw__steps {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
	list-style: none;
	margin: 8px 0 0;
	padding: 0;
}

.hiw__step {
	text-align: center;
	padding: 28px 24px 32px;
	border-radius: 20px;
	background: var(--tpp-off-white);
	border: 1px solid var(--tpp-border-light);

	/* Scroll-reveal, timed to the plane reaching each stop. */
	opacity: 0;
	transform: translateY(24px);
	transition:
		opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
		transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
	transition-delay: calc(var(--step-index, 0) * 0.5s + 0.3s);
}

.hiw__path.is-visible .hiw__step {
	opacity: 1;
	transform: none;
}

.hiw__art {
	display: block;
	width: 168px;
	height: 126px;
	object-fit: contain;
	margin: 0 auto 16px;
}

/* The wallet cutout fills its box more than the other two, so it is drawn
   8px smaller. Padding shrinks the image inside the same 168 x 126 box,
   so the three cards still line up. */
.hiw__step:first-child .hiw__art {
	padding: 4px;
	box-sizing: border-box;
}

.hiw__num {
	font-family: var(--tpp-font-heading);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	color: var(--tpp-text-light);
}

.hiw__step-title {
	font-family: var(--tpp-font-heading);
	font-size: 1.375rem;
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: -0.02em;
	color: var(--tpp-black);
	margin: 6px 0 8px;
}

.hiw__step-desc {
	margin: 0;
	font-family: var(--tpp-font-body);
	font-size: 0.9375rem;
	line-height: 1.6;
	color: var(--tpp-text-light);
}


/* ── Mobile (≤767px): no route, cards stack ── */
@media screen and (max-width: 767px) {
	.hiw__path {
		margin-top: 40px;
	}

	.hiw__svg {
		display: none;
	}

	.hiw__steps {
		grid-template-columns: 1fr;
		gap: 14px;
	}

	/* Stacked cards don't wait on the plane. */
	.hiw__step {
		transition-delay: calc(var(--step-index, 0) * 0.12s);
	}
}


/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
	.hiw__step,
	.hiw__dot {
		transition: none;
	}

	.hiw__step {
		opacity: 1;
		transform: none;
	}
}
