/* Section: How we work. Four steps on a wavy flight path drawn by a paper plane (assets/js/abs-how.js). */

.abs-how {
	--how-bg: #fcfcfc;
	--how-ink: #000000;
	--how-muted: #525252;
	--how-line: #c4c4c4;
	--how-art-line: #d4d4d4;
	--how-disc: #f3f3f3;
	--how-disc-hover: #ebebeb;
	--px: 0;
	--py: 0;

	position: relative;
	isolation: isolate;
	overflow: hidden;
	background: var(--how-bg);
	color: var(--how-ink);
	padding-block: clamp(64px, 6vw, 92px) clamp(72px, 7vw, 104px);
	padding-inline: 24px;
}

/* ---------- Side art ---------- */

.abs-how__art {
	position: absolute;
	z-index: -2;
	top: 0;
	height: auto;
	overflow: visible;
	pointer-events: none;
}

.abs-how__art--left {
	left: 0;
	width: clamp(160px, calc((100vw - 1100px) / 2 + 40px), 300px);
	aspect-ratio: 300 / 640;
}

.abs-how__art--right {
	right: 0;
	width: clamp(160px, calc((100vw - 1100px) / 2 + 40px), 300px);
	aspect-ratio: 300 / 640;
}

.abs-how__layer {
	transform: translate(calc(var(--px) * 10px), calc(var(--py) * 8px));
	transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.abs-how__layer--deep {
	transform: translate(calc(var(--px) * 4px), calc(var(--py) * 3px));
}

.abs-how__arc {
	fill: none;
	stroke: var(--how-art-line);
	stroke-width: 1;
	stroke-dasharray: 3 5;
	vector-effect: non-scaling-stroke;
}

.abs-how__spin {
	transform-box: view-box;
	transform-origin: var(--x) var(--y);
}

.abs-how__art-dot { fill: var(--how-ink); }

/* ---------- Flight path (drawn by script) ---------- */

.abs-how__flow {
	position: absolute;
	inset: 0;
	z-index: -1;
	width: 100%;
	height: 100%;
	overflow: visible;
	pointer-events: none;
}

.abs-how__path {
	fill: none;
	stroke: var(--how-line);
	stroke-width: 1.3;
	stroke-linecap: round;
}

.abs-how__mid { fill: var(--how-ink); }

.abs-how__packet {
	fill: var(--how-ink);
	opacity: 0;
}

.abs-how__packet-halo {
	fill: var(--how-ink);
	opacity: 0;
}

.abs-how__plane path { fill: var(--how-ink); }
.abs-how__plane .abs-how__plane-fold { fill: none; stroke: var(--how-bg); stroke-width: 1.2; stroke-linecap: round; }

/* ---------- Content ---------- */

.abs-how__inner {
	position: relative;
	max-width: 1100px;
	margin-inline: auto;
}

.abs-how__label {
	display: inline-flex;
	align-items: center;
	gap: 14px;
	margin: 0;
	font-family: var(--font-label);
	font-size: 15px;
	font-weight: 500;
	line-height: 1;
	color: #262626;
}

.abs-how__label::before {
	content: "";
	width: 28px;
	height: 1px;
	background: currentColor;
}

.abs-how__heading {
	margin: 20px 0 0;
	font-family: var(--font-head);
	font-size: clamp(36px, 4vw, 56px);
	font-weight: 700;
	line-height: 1.05;
	letter-spacing: -0.045em;
	text-wrap: balance;
}

.abs-how__steps {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 32px;
	margin: clamp(44px, 5vw, 64px) 0 0;
	padding: 0;
	list-style: none;
}

.abs-how__step {
	min-width: 0;
	transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.abs-how__disc {
	position: relative;
	display: grid;
	place-items: center;
	width: clamp(84px, 7.2vw, 104px);
	aspect-ratio: 1;
	border-radius: 50%;
	background: var(--how-disc);
	box-shadow: 0 0 0 10px var(--how-bg);
	transition: background-color 0.3s ease;
}

.abs-how__disc .abs-icon {
	width: 44%;
	height: 44%;
	color: var(--how-ink);
	transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.abs-how__step:hover .abs-how__disc { background: var(--how-disc-hover); }
.abs-how__step:hover .abs-how__disc .abs-icon { transform: scale(1.08); }

.abs-how__num {
	position: absolute;
	right: -10px;
	bottom: -6px;
	display: grid;
	place-items: center;
	width: 42%;
	aspect-ratio: 1;
	border: 1px solid var(--how-ink);
	border-radius: 50%;
	background: var(--how-bg);
	font-family: var(--font-label);
	font-size: clamp(13px, 1.1vw, 15px);
	font-weight: 600;
	line-height: 1;
	font-variant-numeric: tabular-nums;
	transition: background-color 0.35s ease, color 0.35s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.abs-how__title {
	margin: 24px 0 0;
	font-family: var(--font-head);
	font-size: clamp(22px, 2vw, 26px);
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.03em;
}

.abs-how__text {
	max-width: 29ch;
	margin: 10px 0 0;
	font-size: 16px;
	line-height: 1.6;
	color: var(--how-muted);
}

/* ---------- Entrance: steps light up as the plane passes ---------- */

.abs-how.is-armed .abs-how__step:not(.is-on) {
	opacity: 0.3;
	transform: translateY(8px);
}

.abs-how .abs-how__step.is-lit .abs-how__num {
	background: var(--how-ink);
	color: var(--how-bg);
	transform: scale(1.12);
}

/* ---------- Narrower screens ---------- */

@media (max-width: 1240px) {
	.abs-how__art { opacity: 0.6; }
}

@media (max-width: 900px) {
	.abs-how__flow,
	.abs-how__art--left { display: none; }

	.abs-how__art--right { width: 200px; transform: translateX(40%); opacity: 0.6; }

	.abs-how__steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 48px; }
}

@media (max-width: 560px) {
	.abs-how__steps {
		position: relative;
		grid-template-columns: 1fr;
		row-gap: 36px;
	}

	/* A vertical rail joins the steps on phones */
	.abs-how__steps::before {
		content: "";
		position: absolute;
		top: 42px;
		bottom: 42px;
		left: 41px;
		width: 1px;
		background: var(--how-line);
	}

	.abs-how__step {
		display: grid;
		grid-template-columns: 84px 1fr;
		column-gap: 24px;
		align-items: start;
	}

	.abs-how__disc { grid-row: span 2; }
	.abs-how__title { margin-top: 12px; }
	.abs-how__text { margin-top: 6px; }
}

@media (prefers-reduced-motion: reduce) {
	.abs-how__step,
	.abs-how__num,
	.abs-how__disc,
	.abs-how__disc .abs-icon,
	.abs-how__layer { transition: none; }
}

@media (prefers-reduced-motion: no-preference) {
	.abs-how.is-in .abs-how__spin { animation: abs-how-spin var(--dur) linear infinite; }
	.abs-how.is-in .abs-how__orbit { animation: abs-how-swing var(--dur) ease-in-out infinite alternate; }
	.abs-how.is-in .abs-how__float { animation: abs-how-float var(--dur) ease-in-out infinite alternate; }
}

.abs-how__orbit {
	transform-box: view-box;
	transform-origin: var(--x) var(--y);
	transform: rotate(var(--from));
}

@keyframes abs-how-spin { to { transform: rotate(360deg); } }
@keyframes abs-how-swing { from { transform: rotate(var(--from)); } to { transform: rotate(var(--to)); } }
@keyframes abs-how-float { from { transform: translateY(0); } to { transform: translateY(var(--dy)); } }

.abs-how__step:focus-within .abs-how__disc { outline: 2px solid var(--how-ink); outline-offset: 4px; }

.abs-how__disc .abs-icon { stroke-width: 1.4; object-fit: contain; }

.abs-how__sr {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}
