/*
 * AWR homepage sections (everything after the hero).
 * Scoped to .awr-hs so it cannot affect other pages or the hero.
 * Tokens fall back to AWR brand values when the active theme does not define them.
 */

.awr-hs {
	--awr-slate: #1E2A38;
	--awr-slate-muted: #55606E;
	--awr-blue: #0178FF;        /* lines, nodes, accents (non-text) */
	--awr-blue-ink: #0061D9;    /* blue used for small text and button fills (WCAG AA on white) */
	--awr-line: #D7DEE6;
	--awr-line-soft: #E8EDF2;
	--awr-surface: #F5F7FA;
	--awr-radius: 6px;
	--awr-section-pad: clamp(4rem, 9vw, 7.5rem);
	--awr-gap: clamp(1.5rem, 3vw, 2.5rem);

	color: var(--awr-slate);
	padding-top: var(--awr-section-pad);
	padding-bottom: var(--awr-section-pad);
	margin-top: 0 !important;
	margin-bottom: 0 !important;
	background: #fff;
}

/* Neutralise flow-layout margins inside our grids. */
.awr-hs .awr-indicators > *,
.awr-hs .awr-system > *,
.awr-hs .awr-problems > *,
.awr-hs .awr-cycle > * { margin-block: 0; }

/* ---------- Shared typography ---------- */

.awr-hs .awr-eyebrow {
	margin: 0 0 1rem;
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--awr-blue-ink);
	display: flex;
	align-items: center;
	gap: 0.75rem;
}
.awr-hs .awr-eyebrow::before {
	content: "";
	width: 2rem;
	height: 1px;
	background: var(--awr-blue);
	flex: none;
}

.awr-hs h2,
.awr-hs h3 { hyphens: manual; -webkit-hyphens: manual; overflow-wrap: normal; }

.awr-hs .awr-hs__title {
	margin: 0;
	color: var(--awr-slate);
	font-size: clamp(1.875rem, 1.2rem + 2.4vw, 3rem);
	line-height: 1.12;
	letter-spacing: -0.015em;
	font-weight: 700;
	max-width: 22ch;
	text-wrap: balance;
}

.awr-hs .awr-hs__lead {
	font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
	line-height: 1.55;
	color: var(--awr-slate-muted);
	max-width: 46rem;
	margin-top: 1.25rem;
}

.awr-hs p { line-height: 1.6; }

.awr-hs__head { margin-bottom: clamp(2.5rem, 5vw, 4rem); }

/* ---------- Buttons ---------- */

.awr-hs .awr-actions { margin-top: 2.25rem; gap: 0.75rem; }

.awr-hs .awr-btn .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	min-height: 48px;
	padding: 0.8rem 1.4rem;
	border-radius: var(--awr-radius);
	clip-path: none;
	font-size: 0.9375rem;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: 0.01em;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.awr-hs .awr-btn .wp-block-button__link::after {
	content: "→";
	content: "→" / "";
	transition: transform 0.2s ease;
}
.awr-hs .awr-btn .wp-block-button__link:hover::after { transform: translateX(3px); }

.awr-hs .awr-btn--primary .wp-block-button__link {
	background: var(--awr-blue-ink);
	color: #fff;
	border: 1px solid var(--awr-blue-ink);
}
.awr-hs .awr-btn--primary .wp-block-button__link:hover { background: #004FB3; border-color: #004FB3; }

.awr-hs .awr-btn--secondary .wp-block-button__link {
	background: transparent;
	color: var(--awr-slate);
	border: 1px solid var(--awr-slate);
}
.awr-hs .awr-btn--secondary .wp-block-button__link:hover { background: var(--awr-slate); color: #fff; }

.awr-hs .awr-btn--ghost .wp-block-button__link {
	background: transparent;
	color: #fff;
	border: 1px solid rgba(255, 255, 255, 0.45);
}
.awr-hs .awr-btn--ghost .wp-block-button__link:hover { border-color: #fff; background: rgba(255, 255, 255, 0.08); }

.awr-hs .wp-block-button__link:focus-visible {
	outline: 2px solid var(--awr-blue);
	outline-offset: 3px;
}

/* ---------- 1. Selected engagement ---------- */

.awr-hs--engagement { border-top: 1px solid var(--awr-line-soft); }

.awr-engagement { gap: clamp(2.5rem, 6vw, 5.5rem) !important; align-items: center; }

.awr-indicators {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0;
	margin-top: 2.5rem;
	border-top: 1px solid var(--awr-line);
}
.awr-indicator {
	padding: 1.25rem 1.5rem 1.25rem 0;
	border-bottom: 1px solid var(--awr-line);
}
.awr-indicator:nth-child(even) { padding-left: 1.5rem; padding-right: 0; border-left: 1px solid var(--awr-line); }
.awr-hs .awr-indicator__title {
	margin: 0 0 0.4rem;
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--awr-slate);
}
.awr-indicator p { margin: 0; font-size: 0.9375rem; color: var(--awr-slate-muted); }

/* Flow card: Customer behavior → Intelligence → Commercial action → Revenue */
.awr-flowcard {
	position: relative;
	padding: clamp(1.75rem, 3vw, 2.5rem);
	border: 1px solid var(--awr-line);
	border-radius: var(--awr-radius);
	background-color: #fff;
	background-image:
		linear-gradient(var(--awr-line-soft) 1px, transparent 1px),
		linear-gradient(90deg, var(--awr-line-soft) 1px, transparent 1px);
	background-size: 28px 28px;
	background-position: -1px -1px;
	overflow: hidden;
}
.awr-hs .awr-flowcard__kicker {
	margin: 0 0 1.75rem;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--awr-slate-muted);
}

.awr-hs .awr-flow {
	list-style: none;
	margin: 0;
	padding: 0;
	position: relative;
	counter-reset: awr-flow;
}
/* Vertical rail */
.awr-hs .awr-flow::before {
	content: "";
	position: absolute;
	left: 11px;
	top: 12px;
	bottom: 12px;
	width: 1px;
	background: var(--awr-line);
}
/* Travelling signal along the rail: one pass (under 5 s) when the card comes into view */
.awr-hs .awr-flow::after {
	content: "";
	position: absolute;
	left: 9px;
	top: 12px;
	width: 5px;
	height: 28px;
	border-radius: 3px;
	background: linear-gradient(to bottom, transparent, var(--awr-blue));
	opacity: 0;
}
.awr-hs .awr-flow.is-playing::after { animation: awr-signal 4.5s cubic-bezier(0.45, 0, 0.55, 1) 1 both; }
@keyframes awr-signal {
	0%   { transform: translateY(0); opacity: 0; }
	10%  { opacity: 0.85; }
	85%  { opacity: 0.85; }
	100% { transform: translateY(calc(var(--awr-flow-h, 236px) - 40px)); opacity: 0; }
}

.awr-hs .awr-flow li {
	counter-increment: awr-flow;
	position: relative;
	display: flex;
	align-items: center;
	min-height: 48px;
	margin: 0 0 1.25rem 2.75rem;
	padding: 0.85rem 1rem 0.85rem 1.25rem;
	background: #fff;
	border: 1px solid var(--awr-line);
	border-radius: var(--awr-radius);
	font-size: 0.875rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--awr-slate);
}
.awr-hs .awr-flow li:last-child { margin-bottom: 0; }
/* Node on the rail, linked to its box by a short tick */
.awr-hs .awr-flow li::before {
	content: "";
	position: absolute;
	left: calc(-2.75rem - 1px);
	top: 50%;
	width: 24px;
	height: 24px;
	transform: translateY(-50%);
	box-sizing: border-box;
	border: 1px solid var(--awr-blue);
	border-radius: 50%;
	background: radial-gradient(circle, var(--awr-blue) 0 4px, #fff 5px);
}
/* Index number */
.awr-hs .awr-flow li::after {
	content: counter(awr-flow, decimal-leading-zero);
	flex: none;
	white-space: nowrap;
	margin-left: auto;
	padding-left: 1rem;
	font-size: 0.75rem;
	letter-spacing: 0.08em;
	color: var(--awr-slate-muted);
	font-weight: 500;
}
/* Final node = outcome */
.awr-hs .awr-flow li:last-child {
	background: var(--awr-slate);
	border-color: var(--awr-slate);
	color: #fff;
}
.awr-hs .awr-flow li:last-child::before { background: var(--awr-blue); box-shadow: 0 0 0 5px rgba(1, 120, 255, 0.14); }
.awr-hs .awr-flow li:last-child::after { color: #C9D2DC; }

.awr-hs .awr-flowcard__caption {
	margin: 1.75rem 0 0;
	padding-top: 1.25rem;
	border-top: 1px solid var(--awr-line);
	font-size: 0.875rem;
	line-height: 1.5;
	color: var(--awr-slate-muted);
}
.awr-hs .awr-flowcard__caption strong { color: var(--awr-slate); font-weight: 700; }

/* ---------- 2. What we do: one operating system ---------- */

.awr-hs--system { background: var(--awr-surface); }

.awr-system {
	position: relative;
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 0;
	border: 1px solid var(--awr-line);
	border-radius: var(--awr-radius);
	background: #fff;
}
.awr-system__part {
	position: relative;
	padding: clamp(1.5rem, 2.5vw, 2.25rem);
	padding-top: 2.75rem;
}
.awr-system__part + .awr-system__part { border-left: 1px solid var(--awr-line); }
/* Shared rail across the top of all four parts */
.awr-system::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: 1.25rem;
	height: 1px;
	background: var(--awr-line);
}
/* Node per part, sitting on the rail */
.awr-system__part::before {
	content: "";
	position: absolute;
	top: calc(1.25rem - 4px);
	left: clamp(1.5rem, 2.5vw, 2.25rem);
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--awr-blue);
	box-shadow: 0 0 0 4px #fff;
}
.awr-hs .awr-system__index {
	margin: 0 0 0.75rem;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	color: var(--awr-blue-ink);
}
.awr-hs .awr-system__title {
	margin: 0 0 0.75rem;
	font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
	font-weight: 700;
	letter-spacing: -0.01em;
	color: var(--awr-slate);
}
.awr-system__part p:last-child { margin: 0; font-size: 0.9375rem; color: var(--awr-slate-muted); }

/* Outcome bar the four parts converge into */
.awr-hs .awr-system__outcome {
	grid-column: 1 / -1;
	position: relative;
	margin: 0;
	padding: 1.1rem 1.5rem;
	border-top: 1px solid var(--awr-line);
	background: var(--awr-slate);
	color: #fff;
	text-align: center;
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	border-bottom-left-radius: var(--awr-radius);
	border-bottom-right-radius: var(--awr-radius);
}
/* Each part drops a line into the outcome bar */
.awr-system__part::after {
	content: "";
	position: absolute;
	left: calc(clamp(1.5rem, 2.5vw, 2.25rem) + 4px);
	bottom: 0;
	width: 1px;
	height: 1.5rem;
	background: var(--awr-blue);
	opacity: 0.55;
}
.awr-system__part { padding-bottom: calc(clamp(1.5rem, 2.5vw, 2.25rem) + 1.25rem); }

/* ---------- 3. Where we create value ---------- */

.awr-hs--problems {
	background-color: #fff;
	background-image: radial-gradient(var(--awr-line) 1px, transparent 1px);
	background-size: 24px 24px;
	background-position: 0 0;
}
.awr-hs--problems .awr-hs__head,
.awr-hs--problems .awr-problems { position: relative; }

.awr-problems {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1px;
	background: var(--awr-line);
	border: 1px solid var(--awr-line);
	border-radius: var(--awr-radius);
	overflow: hidden;
	counter-reset: awr-problem;
}
.awr-problem {
	counter-increment: awr-problem;
	position: relative;
	padding: clamp(1.75rem, 3.5vw, 3rem);
	background: #fff;
}
.awr-problem::before {
	content: counter(awr-problem, decimal-leading-zero);
	display: block;
	margin-bottom: 1.5rem;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	color: var(--awr-blue-ink);
}
/* Analytical corner tick */
.awr-problem::after {
	content: "";
	position: absolute;
	top: clamp(1.75rem, 3.5vw, 3rem);
	right: clamp(1.75rem, 3.5vw, 3rem);
	width: 14px;
	height: 14px;
	border-top: 1px solid var(--awr-blue);
	border-right: 1px solid var(--awr-blue);
	opacity: 0.6;
}
.awr-hs .awr-problem__title {
	margin: 0 0 0.75rem;
	font-size: 0.9375rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--awr-slate);
}
.awr-problem p { margin: 0; max-width: 34rem; color: var(--awr-slate-muted); }

/* ---------- 4. The AWR Intelligence Cycle ---------- */

.awr-hs--cycle { background: var(--awr-surface); }

.awr-cycle {
	--awr-progress: 0;
	position: relative;
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: var(--awr-gap);
	padding-top: 2.5rem;
}
/* Track */
.awr-cycle::before,
.awr-cycle::after {
	content: "";
	position: absolute;
	top: 11px;
	left: 0;
	right: 0;
	height: 1px;
	background: var(--awr-line);
}
/* Progress fill */
.awr-cycle::after {
	height: 2px;
	top: 10px;
	background: var(--awr-blue);
	transform-origin: left center;
	transform: scaleX(var(--awr-progress));
	transition: transform 0.9s cubic-bezier(0.3, 0, 0.2, 1);
}
.awr-cycle__stage { position: relative; }
/* Node */
.awr-cycle__stage::before {
	content: "";
	position: absolute;
	top: calc(-2.5rem + 3px);
	left: 0;
	width: 17px;
	height: 17px;
	box-sizing: border-box;
	border-radius: 50%;
	border: 1px solid var(--awr-slate-muted);
	background: var(--awr-surface);
	z-index: 1;
	transition: background-color 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}
.awr-cycle__stage.is-active::before {
	border-color: var(--awr-blue);
	background: var(--awr-blue);
	box-shadow: 0 0 0 5px rgba(1, 120, 255, 0.14);
}
.awr-hs .awr-cycle__step {
	margin: 0 0 0.75rem;
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--awr-slate);
}
.awr-hs .awr-cycle__num { color: var(--awr-blue-ink); margin-right: 0.35rem; }
.awr-hs .awr-cycle__title {
	margin: 0 0 0.75rem;
	font-size: clamp(1.125rem, 1rem + 0.45vw, 1.375rem);
	line-height: 1.3;
	font-weight: 700;
	color: var(--awr-slate);
}
.awr-cycle__stage p:last-child { margin: 0; font-size: 0.9375rem; color: var(--awr-slate-muted); }

/* ---------- 5. Final CTA ---------- */

.awr-hs--cta {
	background-color: var(--awr-slate);
	background-image:
		linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
		linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
	background-size: 48px 48px;
	color: #fff;
}
.awr-hs--cta .awr-hs__title { color: #fff; max-width: 24ch; }
.awr-hs--cta .awr-hs__lead { color: #C9D2DC; }
.awr-hs--cta .awr-eyebrow { color: #8CC2FF; }
.awr-hs--cta .awr-eyebrow::before { background: #8CC2FF; }
.awr-hs--cta .awr-btn--primary .wp-block-button__link { background: var(--awr-blue-ink); border-color: var(--awr-blue-ink); }
.awr-hs--cta .awr-btn--primary .wp-block-button__link:hover { background: #fff; color: var(--awr-slate); border-color: #fff; }
.awr-hs .awr-chain {
	margin: 3rem 0 0;
	padding-top: 1.5rem;
	border-top: 1px solid rgba(255, 255, 255, 0.14);
	font-size: 0.8125rem;
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #AEB9C5;
}

/* ---------- Responsive ---------- */

@media (max-width: 1023px) {
	.awr-system { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.awr-system__part:nth-child(3) { border-left: 0; }
	.awr-system__part:nth-child(n+3) { border-top: 1px solid var(--awr-line); }
	.awr-system::before { display: none; }
	.awr-system__part::before { top: 1.25rem; }
	/* only the bottom row drops into the outcome bar */
	.awr-system__part:nth-child(-n+2)::after { display: none; }
}

@media (max-width: 781px) {
	.awr-indicators { grid-template-columns: 1fr; }
	.awr-indicator,
	.awr-indicator:nth-child(even) { padding-left: 0; padding-right: 0; border-left: 0; }

	.awr-system { grid-template-columns: 1fr; }
	.awr-system__part + .awr-system__part { border-left: 0; border-top: 1px solid var(--awr-line); }
	.awr-system__part { padding-top: 2.5rem; }
	.awr-system__part:nth-child(-n+3)::after { display: none; }

	.awr-problems { grid-template-columns: 1fr; }

	/* Cycle becomes a vertical timeline */
	.awr-cycle {
		grid-template-columns: 1fr;
		gap: 2.25rem;
		padding-top: 0;
		padding-left: 2.5rem;
	}
	.awr-cycle::before,
	.awr-cycle::after {
		top: 0;
		bottom: 0;
		left: 8px;
		right: auto;
		width: 1px;
		height: auto;
	}
	.awr-cycle::after {
		width: 2px;
		left: 7px;
		transform-origin: center top;
		transform: scaleY(var(--awr-progress));
	}
	.awr-cycle__stage::before { top: 2px; left: -2.5rem; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
	.awr-hs .awr-flow::after { animation: none; display: none; }
	.awr-cycle::after { transition: none; }
	.awr-cycle__stage::before { transition: none; }
	.awr-hs .awr-btn .wp-block-button__link,
	.awr-hs .awr-btn .wp-block-button__link::after { transition: none; }
}
