/**
 * Variant CSS: features--horizontal-step-flow
 * Layer 2 — Path B features role (2026-06-06).
 *
 * Four features as a HORIZONTAL stepper. Each step has a numbered circular icon
 * node sitting on a connector hairline that runs behind the node row; the title
 * and desc stack, centred, below the node. Reads left → right as a progression
 * (1 → 2 → 3 → 4). Axis-flipped against the vertical icon timeline and
 * node-on-top against the text-only numbered rows.
 *
 * Connector technique: each node draws a left half-line (::before) and a right
 * half-line (::after) on its vertical midline; the first step suppresses its
 * left line and the last step its right line so nothing dangles past the ends.
 * The node disc keeps a solid background + raised stacking so the line never
 * crosses the icon.
 *
 * All selectors scoped to .universal-features--horizontal-step-flow — no leak.
 */

body.aibt-universal .universal-features--horizontal-step-flow {
	background: var(--background);
	color: var(--text-primary);
	border-bottom: 1px solid var(--divider-primary);
}

/* Constrained-layout safety net: every centred intro child keeps auto inline
   margins so it never left-pins inside the full-width section (A8/A9). */
body.aibt-universal .universal-features.universal-features--horizontal-step-flow .has-text-align-center {
	margin-inline: auto !important;
}

/* ── Intro ─────────────────────────────────────────────────────── */
body.aibt-universal .universal-features--horizontal-step-flow .universal-features__intro {
	margin: 0 auto var(--space-2xl) auto;
	text-align: center;
}

body.aibt-universal .universal-features--horizontal-step-flow .universal-features__kicker {
	font-family: var(--font-body) !important;
	font-size: var(--text-xs) !important;
	font-weight: 600 !important;
	letter-spacing: var(--tracking-widest) !important;
	text-transform: uppercase !important;
	color: var(--accent) !important;
	margin: 0 auto var(--space-sm) auto !important;
}

body.aibt-universal .universal-features--horizontal-step-flow h2.universal-features__headline,
body.aibt-universal .universal-features--horizontal-step-flow .universal-features__headline {
	font-family: var(--font-display) !important;
	color: var(--text-primary) !important;
	margin: 0 auto !important;
	max-width: 20ch;
}

/* Emphasised headline word picks up the accent. */
body.aibt-universal .universal-features--horizontal-step-flow .universal-features__headline em {
	color: var(--accent) !important;
	font-style: italic;
}

body.aibt-universal .universal-features--horizontal-step-flow .universal-features__deck {
	font-family: var(--font-body) !important;
	font-size: var(--text-lg) !important;
	line-height: var(--leading-relaxed) !important;
	color: var(--text-secondary) !important;
	margin: var(--space-md) auto 0 auto !important;
	max-width: 54ch;
}

/* ── Flow row ──────────────────────────────────────────────────── */
body.aibt-universal .universal-features--horizontal-step-flow .universal-features__flow {
	gap: clamp(0.75rem, 2vw, 1.75rem) !important;
	align-items: flex-start !important;
	flex-wrap: nowrap !important;
}

/* ── Step ──────────────────────────────────────────────────────── */
body.aibt-universal .universal-features--horizontal-step-flow .universal-features__step {
	flex: 1 1 0 !important;
	min-width: 0;
	display: flex !important;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: var(--space-sm);
}

/* ── Node (icon disc + number) ─────────────────────────────────── */
/* The node is the anchor for the two connector half-lines. It is wide enough
   (full step width) so the half-lines reach toward the neighbouring nodes,
   while the visible disc is centred inside it. */
body.aibt-universal .universal-features--horizontal-step-flow .universal-features__node {
	position: relative;
	width: 100%;
	display: flex !important;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	margin-bottom: var(--space-xs);
}

/* Left connector half-line — from row centre out to the left edge of the step. */
body.aibt-universal .universal-features--horizontal-step-flow .universal-features__node::before,
body.aibt-universal .universal-features--horizontal-step-flow .universal-features__node::after {
	content: "";
	position: absolute;
	top: 32px; /* vertical midline of the 64px disc */
	height: 2px;
	width: 50%;
	background: color-mix(in srgb, var(--accent) 28%, transparent);
	z-index: 0;
	pointer-events: none;
}
body.aibt-universal .universal-features--horizontal-step-flow .universal-features__node::before {
	right: 50%;
	margin-right: 32px; /* clear the disc radius */
}
body.aibt-universal .universal-features--horizontal-step-flow .universal-features__node::after {
	left: 50%;
	margin-left: 32px;
}

/* Suppress the dangling outer lines at the two ends of the row. */
body.aibt-universal .universal-features--horizontal-step-flow .universal-features__step:first-child .universal-features__node::before,
body.aibt-universal .universal-features--horizontal-step-flow .universal-features__step:last-child .universal-features__node::after {
	display: none;
}

/* Icon disc — solid surface raised above the connector line. */
body.aibt-universal .universal-features--horizontal-step-flow .universal-features__node-icon {
	position: relative;
	z-index: 1;
	width: 64px;
	height: 64px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.7rem !important;
	line-height: 1 !important;
	margin: 0 auto !important;
	border-radius: var(--decor-radius-pill, 999px);
	background: color-mix(in srgb, var(--accent) 8%, var(--background));
	border: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
	box-sizing: border-box;
	transition: transform var(--duration-fast) var(--ease-default),
		border-color var(--duration-fast) var(--ease-default);
}

body.aibt-universal .universal-features--horizontal-step-flow .universal-features__step:hover .universal-features__node-icon {
	transform: translateY(-3px);
	border-color: var(--accent);
}

/* Step number — a small accent pill clipped to the disc's bottom edge. */
body.aibt-universal .universal-features--horizontal-step-flow .universal-features__node-num {
	position: absolute;
	z-index: 2;
	bottom: -6px;
	left: 50%;
	transform: translateX(-50%);
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: var(--font-display) !important;
	font-size: var(--text-xs) !important;
	font-weight: 700 !important;
	line-height: 1 !important;
	color: var(--cta-text-primary) !important;
	background: var(--accent);
	border-radius: var(--decor-radius-pill, 999px);
	margin: 0 !important;
	box-sizing: border-box;
}

/* ── Step text ─────────────────────────────────────────────────── */
body.aibt-universal .universal-features--horizontal-step-flow h3.universal-features__step-title,
body.aibt-universal .universal-features--horizontal-step-flow .universal-features__step-title {
	font-family: var(--font-display) !important;
	font-weight: 600 !important;
	font-size: clamp(1.15rem, 1.8vw, 1.4rem) !important;
	line-height: 1.2 !important;
	letter-spacing: -0.015em !important;
	color: var(--text-primary) !important;
	margin: var(--space-xs) auto 0 auto !important;
	max-width: 16ch;
}

body.aibt-universal .universal-features--horizontal-step-flow .universal-features__step-desc {
	font-family: var(--font-body) !important;
	font-size: var(--text-sm) !important;
	line-height: var(--leading-relaxed) !important;
	color: var(--text-secondary) !important;
	margin: 0 auto !important;
	max-width: 28ch;
}

/* ── Tablet: allow a 2×2 wrap so four nodes don't crush ────────── */
@media (max-width: 900px) {
	body.aibt-universal .universal-features--horizontal-step-flow .universal-features__flow {
		flex-wrap: wrap !important;
		gap: clamp(1.5rem, 4vw, 2.5rem) !important;
	}
	body.aibt-universal .universal-features--horizontal-step-flow .universal-features__step {
		flex: 1 1 40% !important;
	}
	/* In a wrapped grid the horizontal connector no longer reads cleanly —
	   drop it so half-lines don't float between unrelated rows. */
	body.aibt-universal .universal-features--horizontal-step-flow .universal-features__node::before,
	body.aibt-universal .universal-features--horizontal-step-flow .universal-features__node::after {
		display: none;
	}
}

/* ── Mobile: single vertical stack ─────────────────────────────── */
@media (max-width: 600px) {
	body.aibt-universal .universal-features--horizontal-step-flow .universal-features__step {
		flex: 1 1 100% !important;
	}
}

/* Drop wide uppercase tracking on narrow phones so the kicker never strains (A5). */
@media (max-width: 640px) {
	body.aibt-universal .universal-features--horizontal-step-flow .universal-features__kicker {
		letter-spacing: 0 !important;
	}
}

/* Honour reduced-motion: kill the node hover lift. */
@media (prefers-reduced-motion: reduce) {
	body.aibt-universal .universal-features--horizontal-step-flow .universal-features__node-icon {
		transition: none;
	}
	body.aibt-universal .universal-features--horizontal-step-flow .universal-features__step:hover .universal-features__node-icon {
		transform: none;
	}
}
