/*
Lamy LP — Growth Engine (Phase 4 + Amendment)

Layout — Strategy H1 (single horizontal row) at >=1280px, with H2 fallback
(4 columns x 2 rows) at 768-1279px and vertical stack at <768px (mobile).

Rationale (post-amendment): The design source (lp-sections.jsx LPEngineFlow)
uses `gridTemplateColumns: repeat(8, 1fr)` — a single row of 8 nodes with a
continuous gold->purple->gold baseline behind them. The user explicitly
asked for "בשורה אחת" (in one row), matching the design's desktop intent.
H1 restores that. H2 covers tablet widths where 8-in-a-row becomes cramped.
Mobile preserves the original Phase 4 vertical stack — readability wins on
narrow screens.

Section alternation: background --bg-primary (#050505) — contrasts with
Problem (--bg-section #0A0A0A) above and the next section below.

Purple Accent B (flow lines): gold->purple->gold gradient on every line at
every breakpoint, vertical at mobile, horizontal at tablet & desktop.
Optional pulse animation, disabled under prefers-reduced-motion.
*/

/* ============================================================
   Section
   ============================================================ */
.lp-growth-engine {
	position: relative;
	overflow: hidden;
	background: var(--bg-primary);
	padding-inline: clamp(64px, 10vw, 128px);
	/* Phase 8.9.6: desktop max 96px -> 64px (round 2 spacing reduction).
	   Phase 8.9.8: round 3 reduction - clamp(48, 8vw, 64) -> clamp(32, 5vw, 40). */
	padding-block: clamp(32px, 5vw, 40px);
}

.lp-growth-engine > .lp-divider-gradient {
	height: 1px;
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
	margin-block: clamp(48px, 8vw, 96px);
	margin-block-start: 0; /* flush at section start */
	background: var(--accent-gradient);
	border: 0;
}

/* Atmospheric purple wash — Purple Accent System backdrop */
.lp-growth-engine__bg-glow {
	position: absolute;
	inset: -10%;
	background: radial-gradient(
		ellipse at center,
		var(--purple-atmosphere) 0%,
		transparent 70%
	);
	opacity: 0.10;
	filter: blur(100px);
	z-index: 0;
	pointer-events: none;
}

.lp-growth-engine .lp-container {
	position: relative;
	z-index: 1;
}

/* ============================================================
   Pill section label (scoped — matches Problem section pattern)
   ============================================================ */
.lp-growth-engine .lp-section-label {
	display: inline-block;
	font-family: 'Heebo', sans-serif;
	font-size: 14px;
	font-weight: 600;
	padding: 6px 14px;
	background: rgba(212, 175, 55, 0.1);
	border: 1px solid var(--gold-primary);
	border-radius: 999px;
	color: var(--gold-highlight);
	margin-bottom: 16px;
	letter-spacing: 0.02em;
	text-transform: none;
}

.lp-growth-engine .lp-section-label::before,
.lp-growth-engine .lp-section-label::after {
	content: none;
}

/* ============================================================
   Heading
   ============================================================ */
.lp-growth-engine__heading {
	font-family: 'Rubik', 'Heebo', sans-serif;
	font-weight: 800;
	font-size: clamp(28px, 4vw, 48px);
	color: var(--text-heading);
	text-wrap: balance;
	letter-spacing: -0.01em;
	line-height: 1.15;
	margin: 0 0 clamp(32px, 4vw, 48px) 0;
	max-width: 26ch;
}

/* ============================================================
   Stages stack — Strategy C: centered vertical column
   ============================================================ */
.lp-growth-engine__stages {
	max-width: 720px;
	margin-inline: auto;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	position: relative;
}

/* ============================================================
   Stage card
   ============================================================ */
.lp-growth-engine__stage {
	background: var(--bg-card);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 16px;
	padding: clamp(24px, 3vw, 40px);
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	position: relative;

	/* Scroll reveal — initial hidden state */
	opacity: 0;
	transform: translateY(20px);
	transition:
		opacity 0.6s ease,
		transform 0.6s ease,
		border-color 0.3s ease,
		box-shadow 0.3s ease;
	transition-delay: calc(var(--stage-index, 0) * 100ms);
	will-change: opacity, transform;
}

.lp-growth-engine__stage.is-visible {
	opacity: 1;
	transform: translateY(0);
}

.lp-growth-engine__stage.is-visible:hover {
	border-color: rgba(212, 175, 55, 0.3);
	transform: translateY(-2px);
	box-shadow: 0 8px 32px rgba(212, 175, 55, 0.08);
}

/* Stage number — "שלב 0X" (G-1 fix: Hebrew label, never English STAGE) */
.lp-growth-engine__stage-number {
	font-family: 'Rubik', 'Heebo', sans-serif;
	font-weight: 800;
	color: var(--gold-highlight);
	font-size: clamp(14px, 1.2vw, 16px);
	letter-spacing: 0.05em;
	text-transform: none;
	margin-bottom: 8px;
}

/* Stage icon */
.lp-growth-engine__stage-icon {
	display: inline-flex;
	width: 56px;
	height: 56px;
	color: var(--gold-primary);
	margin-bottom: 16px;
	transition: color 0.3s ease;
}

.lp-growth-engine__stage:hover .lp-growth-engine__stage-icon {
	color: var(--gold-highlight);
}

.lp-growth-engine__stage-icon svg {
	width: 100%;
	height: 100%;
}

/* Stage title */
.lp-growth-engine__stage-title {
	font-family: 'Rubik', 'Heebo', sans-serif;
	font-weight: 700;
	font-size: clamp(20px, 2vw, 24px);
	color: var(--text-heading);
	line-height: 1.3;
	margin: 0;
}

/* Reserved — locked copy V2.5 has no per-stage body in Phase 4. */
.lp-growth-engine__stage-body {
	font-family: 'Heebo', sans-serif;
	font-weight: 400;
	font-size: clamp(16px, 1.2vw, 18px);
	color: var(--text-body);
	line-height: 1.6;
	margin: 12px 0 0 0;
}

/* ============================================================
   Flow line — vertical gold→purple→gold (Purple Accent B)
   ============================================================ */
.lp-growth-engine__flow-line {
	width: 2px;
	height: clamp(40px, 6vw, 60px);
	margin: 0 auto;
	background: linear-gradient(
		to bottom,
		rgba(212, 175, 55, 0.6) 0%,
		rgba(138, 79, 255, 0.7) 50%,
		rgba(212, 175, 55, 0.6) 100%
	);
	border-radius: 2px;
	animation: lp-flow-pulse 7s ease-in-out infinite;
}

@keyframes lp-flow-pulse {
	0%, 100% { opacity: 0.6; }
	50%      { opacity: 1; }
}

/* ============================================================
   Supporting text (Brief §7 Section 4 — "Supporting Text" below
   the infographic)
   ============================================================ */
.lp-growth-engine__supporting-text {
	margin-top: clamp(48px, 6vw, 72px);
	margin-inline: auto;
	max-width: 760px;
	font-size: clamp(16px, 1.4vw, 17px);
	color: var(--text-body);
	line-height: 1.7;
	text-align: center;
	text-wrap: pretty;
}

/* ============================================================
   AMENDMENT — Strategy H2 (tablet 768-1279px): 4 cols x 2 rows
   ------------------------------------------------------------
   Cards laid out in a 4-column grid, RTL natural reading order
   (row 1 cards 01-04 right->left, row 2 cards 05-08 right->left).
   Intra-row flow lines hidden — proximity within each row conveys
   the connection. The 4th flow-line (the one DOM-positioned between
   card 4 and card 5) is repurposed as a horizontal between-row
   connector spanning the full grid width.
   ============================================================ */
@media (min-width: 768px) and (max-width: 1279px) {
	.lp-growth-engine__stages {
		max-width: 1100px;
		display: grid;
		grid-template-columns: repeat(4, 1fr);
		column-gap: clamp(16px, 2vw, 24px);
		row-gap: clamp(32px, 4vw, 48px);
	}

	.lp-growth-engine__stage {
		padding: clamp(16px, 1.8vw, 24px);
	}

	.lp-growth-engine__stage-icon {
		width: clamp(40px, 4vw, 48px);
		height: clamp(40px, 4vw, 48px);
	}

	.lp-growth-engine__stage-number {
		font-size: clamp(13px, 1vw, 15px);
	}

	.lp-growth-engine__stage-title {
		font-size: clamp(16px, 1.4vw, 20px);
		line-height: 1.3;
	}

	/* Hide intra-row flow lines — proximity inside each row conveys flow.
	   Container has only article+div children, so nth-of-type(N) on a div
	   selects the Nth flow-line reliably. */
	.lp-growth-engine__flow-line {
		display: none;
	}

	/* Between-row connector — 4th flow-line (between card 4 and card 5).
	   Spans full grid width, sits in its own implicit row between the two
	   card rows. */
	.lp-growth-engine__flow-line:nth-of-type(4) {
		display: block;
		grid-column: 1 / -1;
		justify-self: center;
		align-self: center;
		width: clamp(160px, 25vw, 280px);
		height: 2px;
		margin: 0;
		background: linear-gradient(
			to right,
			rgba(212, 175, 55, 0.6) 0%,
			rgba(138, 79, 255, 0.7) 50%,
			rgba(212, 175, 55, 0.6) 100%
		);
	}
}

/* ============================================================
   AMENDMENT — Strategy H1 (desktop >=1280px): single horizontal row
   ------------------------------------------------------------
   All 8 stages in one flex row, RTL natural (stage 01 right -> 08 left).
   7 horizontal flow lines interleaved between cards as flex siblings.
   Section padding tightens to make room for the wide layout.
   ============================================================ */
@media (min-width: 1280px) {
	.lp-growth-engine {
		padding-inline: clamp(24px, 3vw, 64px);
	}

	.lp-growth-engine__stages {
		max-width: 1400px;
		display: flex;
		flex-direction: row;
		align-items: stretch;
		gap: 0;
	}

	.lp-growth-engine__stage {
		flex: 1 1 0;
		min-width: 0;
		padding: clamp(12px, 1.1vw, 20px);
		text-align: center;
		align-items: center;
	}

	.lp-growth-engine__stage-number {
		font-size: clamp(12px, 0.9vw, 14px);
		margin-bottom: 6px;
	}

	.lp-growth-engine__stage-icon {
		width: clamp(36px, 3vw, 44px);
		height: clamp(36px, 3vw, 44px);
		margin-bottom: 12px;
	}

	.lp-growth-engine__stage-title {
		font-size: clamp(14px, 1.1vw, 17px);
		line-height: 1.25;
		word-wrap: break-word;
		overflow-wrap: break-word;
		text-align: center;
		max-width: 100%;
	}

	/* Horizontal flow lines as flex siblings between cards */
	.lp-growth-engine__flow-line {
		flex: 0 0 auto;
		align-self: center;
		width: clamp(12px, 1.2vw, 24px);
		height: 2px;
		margin: 0;
		background: linear-gradient(
			to right,
			rgba(212, 175, 55, 0.6) 0%,
			rgba(138, 79, 255, 0.7) 50%,
			rgba(212, 175, 55, 0.6) 100%
		);
	}
}

/* ============================================================
   Reduced motion: disable pulse + reveal animation, show immediately
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
	.lp-growth-engine__flow-line {
		animation: none;
	}
	.lp-growth-engine__stage {
		opacity: 1;
		transform: none;
		transition: none;
	}
	.lp-growth-engine__stage:hover {
		transform: none;
	}
}
