/* ==================================================================
   AIS Web Studio — PROCESS section (dark)
   Horizontal connected timeline on desktop, vertical on mobile.
   Big orange auto-numbered markers, staggered reveal, tasteful hover.
   Scoped under .ais-process. Design tokens only — no raw hex.
   ================================================================== */

.ais-process {
	--ais-process-node: 92px;          /* marker diameter                 */
	--ais-process-badge: 40px;         /* icon badge diameter             */
	position: relative;
	overflow: hidden;
}

/* Soft brand glow behind the timeline so the dark band feels premium */
.ais-process::before {
	content: "";
	position: absolute;
	left: 50%;
	top: 38%;
	width: min(900px, 80%);
	height: 320px;
	transform: translate(-50%, -50%);
	background: radial-gradient(
		ellipse at center,
		color-mix(in srgb, var(--ais-orange) 16%, transparent),
		transparent 70%
	);
	opacity: .55;
	pointer-events: none;
	z-index: 0;
}

.ais-process > .ais-container {
	position: relative;
	z-index: 1;
}

/* ------------------------------------------------------------------ */
/* Timeline track                                                     */
/* ------------------------------------------------------------------ */
.ais-process__timeline {
	list-style: none;
	/* Gap below the section head is owned by .ais-section__head margin-bottom
	   (matches services/testimonials); no extra top margin here. */
	margin: 0;
	padding: 0;
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: 1fr;
	gap: var(--ais-grid-gap);
}

.ais-process__step {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
}

/* ------------------------------------------------------------------ */
/* Connecting line — desktop: horizontal, node-centre to node-centre  */
/* ------------------------------------------------------------------ */
.ais-process__connector {
	position: absolute;
	top: calc(var(--ais-process-node) / 2);
	left: 50%;
	width: calc(100% + var(--ais-grid-gap));
	height: 2px;
	transform: translateY(-50%);
	background: linear-gradient(
		90deg,
		color-mix(in srgb, var(--ais-orange) 75%, transparent),
		color-mix(in srgb, var(--ais-orange) 12%, transparent)
	);
	z-index: 0;
}
.ais-process__step:last-child .ais-process__connector {
	display: none;
}

/* ------------------------------------------------------------------ */
/* Marker — big orange number + icon badge                            */
/* ------------------------------------------------------------------ */
.ais-process__node {
	position: relative;
	z-index: 1;
	width: var(--ais-process-node);
	height: var(--ais-process-node);
	display: grid;
	place-items: center;
	border-radius: var(--ais-radius-pill);
	background:
		radial-gradient(circle at 50% 30%, var(--ais-dark-3), var(--ais-dark-2));
	border: 1.5px solid color-mix(in srgb, var(--ais-orange) 32%, var(--ais-border));
	box-shadow:
		inset 0 1px 0 color-mix(in srgb, var(--ais-white) 6%, transparent),
		0 18px 40px -22px var(--ais-glow);
	transition:
		transform .45s var(--ais-ease),
		border-color .45s var(--ais-ease),
		box-shadow .45s var(--ais-ease);
}

.ais-process__num {
	font-family: var(--ais-heading-font);
	font-size: var(--ais-fs-h2);
	font-weight: var(--ais-display-weight);
	line-height: 1;
	letter-spacing: var(--ais-tracking-display);
	color: var(--ais-orange);
	text-shadow: 0 0 24px var(--ais-glow);
}

.ais-process__icon {
	position: absolute;
	top: -6px;
	right: -6px;
	width: var(--ais-process-badge);
	height: var(--ais-process-badge);
	display: grid;
	place-items: center;
	border-radius: var(--ais-radius-pill);
	background: var(--ais-orange);
	color: var(--ais-on-primary);
	border: 3px solid var(--ais-dark);
	box-shadow: 0 10px 22px -10px var(--ais-glow);
	transition: transform .45s var(--ais-ease);
}
.ais-process__icon .ais-icon {
	width: 20px;
	height: 20px;
}

/* ------------------------------------------------------------------ */
/* Body                                                               */
/* ------------------------------------------------------------------ */
.ais-process__body {
	margin-top: clamp(22px, 2.4vw, 30px);
	max-width: 230px;
}
.ais-process__title {
	margin: 0;
	font-family: var(--ais-heading-font);
	font-size: var(--ais-fs-h3);
	font-weight: var(--ais-heading-weight);
	letter-spacing: var(--ais-tracking-tight);
	color: var(--ais-text);
}
.ais-process__desc {
	margin: var(--ais-space-3) 0 0;
	font-size: var(--ais-fs-sm);
	line-height: var(--ais-leading-body);
	color: var(--ais-text-muted);
}

/* ------------------------------------------------------------------ */
/* Hover polish (works regardless of body.ais-hover-lift)             */
/* ------------------------------------------------------------------ */
.ais-process__step:hover .ais-process__node {
	transform: translateY(-5px);
	border-color: var(--ais-orange);
	box-shadow:
		inset 0 1px 0 color-mix(in srgb, var(--ais-white) 8%, transparent),
		0 0 0 4px var(--ais-glow),
		0 26px 50px -24px var(--ais-glow);
}
.ais-process__step:hover .ais-process__icon {
	transform: scale(1.08) rotate(-4deg);
}
.ais-process__step:hover .ais-process__title {
	color: var(--ais-orange-soft);
}

/* ------------------------------------------------------------------ */
/* Many steps (>6): keep the single horizontal row but let it scroll   */
/* instead of crushing the nodes (FIX R4). Desktop only — the <=1024    */
/* tier already stacks the timeline vertically. Modifier added in PHP   */
/* when the step count exceeds the comfortable single-row threshold.    */
/* ------------------------------------------------------------------ */
@media (min-width: 1025px) {
	.ais-process__timeline--scroll {
		grid-auto-columns: minmax(clamp(160px, 18vw, 200px), 1fr);
		overflow-x: auto;
		/* overflow-x:auto forces overflow-y to clip too, so pad the box so
		   the offset icon badge + hover lift are not cut off. */
		padding-top: var(--ais-space-4);
		padding-bottom: var(--ais-space-5);
		scroll-snap-type: x proximity;
		overscroll-behavior-x: contain;
		scrollbar-width: thin;
		scrollbar-color: color-mix(in srgb, var(--ais-orange) 55%, transparent) transparent;
	}
	.ais-process__timeline--scroll .ais-process__step {
		scroll-snap-align: start;
	}
	.ais-process__timeline--scroll::-webkit-scrollbar {
		height: 8px;
	}
	.ais-process__timeline--scroll::-webkit-scrollbar-thumb {
		background: color-mix(in srgb, var(--ais-orange) 55%, transparent);
		border-radius: var(--ais-radius-pill);
	}
	.ais-process__timeline--scroll::-webkit-scrollbar-track {
		background: transparent;
	}
}

/* ------------------------------------------------------------------ */
/* Responsive — vertical timeline                                     */
/* ------------------------------------------------------------------ */
@media (max-width: 1024px) {
	.ais-process__timeline {
		grid-auto-flow: row;
		grid-auto-columns: auto;
		max-width: 620px;
		margin-inline: auto;
		gap: 0;
	}
	.ais-process__step {
		flex-direction: row;
		align-items: flex-start;
		text-align: start;
		gap: clamp(18px, 5vw, 30px);
		padding-bottom: clamp(30px, 6vw, 48px);
	}
	.ais-process__step:last-child {
		padding-bottom: 0;
	}

	/* Connector flips to a vertical rail down the marker centre */
	.ais-process__connector {
		top: var(--ais-process-node);
		bottom: 0;
		left: calc(var(--ais-process-node) / 2);
		width: 2px;
		height: auto;
		transform: translateX(-50%);
		background: linear-gradient(
			180deg,
			color-mix(in srgb, var(--ais-orange) 75%, transparent),
			color-mix(in srgb, var(--ais-orange) 10%, transparent)
		);
	}

	.ais-process__node {
		flex: none;
	}
	.ais-process__body {
		margin-top: 0;
		padding-top: var(--ais-space-2);
		max-width: none;
	}
	.ais-process__step:hover .ais-process__node {
		transform: translateX(4px);
	}
}

@media (max-width: 640px) {
	.ais-process {
		--ais-process-node: 70px;
		--ais-process-badge: 34px;
	}
	.ais-process__icon .ais-icon {
		width: 17px;
		height: 17px;
	}
}

/* Respect reduced-motion: neutralise hover transforms */
@media (prefers-reduced-motion: reduce) {
	.ais-process__node,
	.ais-process__icon {
		transition: none;
	}
	.ais-process__step:hover .ais-process__node,
	.ais-process__step:hover .ais-process__icon {
		transform: none;
	}
}

/* ------------------------------------------------------------------ */
/* RTL — the timeline's grid (column flow desktop, row flow mobile)    */
/* reverses automatically under dir=rtl, so only the absolutely-placed */
/* connector rail + corner icon badge need explicit mirroring.         */
/* LTR is byte-for-byte unchanged.                                     */
/* ------------------------------------------------------------------ */
[dir="rtl"] .ais-process__icon {
	right: auto;
	left: -6px;
}
@media (min-width: 1025px) {
	[dir="rtl"] .ais-process__connector {
		left: auto;
		right: 50%;
		background: linear-gradient(
			270deg,
			color-mix(in srgb, var(--ais-orange) 75%, transparent),
			color-mix(in srgb, var(--ais-orange) 12%, transparent)
		);
	}
}
@media (max-width: 1024px) {
	[dir="rtl"] .ais-process__connector {
		left: auto;
		right: calc(var(--ais-process-node) / 2);
		transform: translateX(50%);
	}
}
