/* LogiPhex Scroll Cards
 *
 * Behaviour: the section holds exactly one viewport. While it's fully
 * covering the viewport, wheel/touch scroll steps through the cards
 * instead of moving the page. The moment you'd go past the first or
 * last card, the script stops intercepting and the page scrolls
 * normally again — see script.js for the release logic. This file
 * itself never sets overflow:hidden on html/body.
 */

.lsc-wrap {
	--lsc-ink: #12151c;
	--lsc-muted: #6b7280;
	--lsc-line: #e5e7eb;
	--lsc-accent: #2f6fed;
	--lsc-bg-card: #ffffff;
	font-family: 'Inter', system-ui, sans-serif;
	color: var(--lsc-ink);
}

/* Section is exactly one viewport tall — no artificial extra scroll
   height. The "pinned" feel comes from the script briefly intercepting
   scroll while this fills the viewport, not from layout height. */
.lsc-section {
	position: relative;
	height: 100vh;
}

.lsc-sticky {
	position: relative;
	height: 100vh;
	overflow: hidden; /* clips the card stack only — NOT the page */
	display: flex;
	align-items: center;
}

.lsc-grid {
	display: grid;
	grid-template-columns: 320px 1fr;
	gap: 48px;
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 32px;
	align-items: center;
}

/* ---------- Left rail ---------- */
.lsc-rail-panel {
	display: flex;
	flex-direction: column;
	gap: 32px;
}

.lsc-route {
	display: flex;
	gap: 20px;
}

.lsc-route-line {
	position: relative;
	width: 2px;
	background: var(--lsc-line);
	border-radius: 2px;
}

.lsc-route-progress {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 0%;
	background: var(--lsc-accent);
	border-radius: 2px;
	transition: height 0.15s linear;
}

.lsc-route-marker {
	position: absolute;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--lsc-line);
	border: 2px solid #fff;
	transition: background 0.2s ease;
}

.lsc-route-marker.is-active {
	background: var(--lsc-accent);
}

.lsc-stop-list {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	min-height: 220px;
}

.lsc-stop {
	display: flex;
	align-items: baseline;
	gap: 10px;
	opacity: 0.4;
	transition: opacity 0.2s ease;
}

.lsc-stop.is-active {
	opacity: 1;
}

.lsc-num {
	font-family: 'IBM Plex Mono', monospace;
	font-size: 12px;
	color: var(--lsc-muted);
}

.lsc-label {
	font-family: 'Space Grotesk', sans-serif;
	font-weight: 600;
	font-size: 15px;
}

.lsc-rail-counter {
	font-family: 'IBM Plex Mono', monospace;
	font-size: 12px;
	color: var(--lsc-muted);
}

.lsc-cur {
	color: var(--lsc-ink);
	font-weight: 600;
}

/* ---------- Card stage ----------
 * Height is set inline by JS to match whichever card is active, so the
 * box always fits its content (no more clipped/hidden text on longer
 * cards like "Courier & Logistics Partners"). The transition here is
 * what makes that height change animate smoothly instead of snapping.
 */
.lsc-card-stage {
	position: relative;
	transition: height 0.35s ease;
}

.lsc-card {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	/* no bottom/height — each card's own content determines its height,
	   which is what JS reads to size .lsc-card-stage */
	background: var(--lsc-bg-card);
	border: 1px solid var(--lsc-line);
	border-radius: 16px;
	padding: 40px;
	box-sizing: border-box;
	opacity: 0;
	transform: translateY(24px);
	pointer-events: none;
	transition: opacity 0.35s ease, transform 0.35s ease;
}

.lsc-card.is-active {
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
}

.lsc-tag {
	display: inline-block;
	font-family: 'IBM Plex Mono', monospace;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--lsc-accent);
	margin-bottom: 16px;
}

.lsc-card h3 {
	font-family: 'Space Grotesk', sans-serif;
	font-size: 28px;
	line-height: 1.25;
	margin: 0 0 16px;
}

.lsc-intro,
.lsc-sub {
	color: var(--lsc-muted);
	line-height: 1.6;
	margin: 0 0 16px;
}

.lsc-card ul {
	margin: 0;
	padding-left: 20px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.lsc-card li {
	line-height: 1.5;
}

/* ---------- Bottom progress bar ---------- */
.lsc-progress-bar {
	position: absolute;
	left: 0;
	bottom: 0;
	width: 100%;
	height: 3px;
	background: var(--lsc-line);
}

.lsc-progress-bar-fill {
	height: 100%;
	width: 0%;
	background: var(--lsc-accent);
	transition: width 0.15s linear;
}

/* ---------- Mobile fallback ----------
 * Sticky-pin effects are the most common source of "stuck scroll" bugs on
 * mobile browsers (Safari in particular). Below 820px we disable pinning
 * entirely and fall back to a plain stacked layout, which is 100% safe.
 */
@media (max-width: 820px) {
	.lsc-sticky {
		position: static;
		height: auto;
		overflow: hi; /* the desktop rule clips at 100vh — on mobile the box must be free to grow with its content, never clip it */
		display: block;
		padding: 48px 0;
	}

	.lsc-grid {
		grid-template-columns: 1fr;
		gap: 24px;
		padding: 0 20px;
	}

	.lsc-rail-panel {
		display: none; /* route rail only makes sense alongside the pinned effect */
	}

	.lsc-card-stage {
		height: auto !important; /* guards against a stale inline height left over from a desktop-width JS run before the viewport was resized down */
		display: flex;
		flex-direction: column;
		gap: 20px;
		overflow: visible;
	}

	.lsc-card {
		position: static;
		opacity: 1;
		transform: none;
		pointer-events: auto;
		overflow: visible;
	}

	.lsc-wrap {
		padding-bottom: 40px; /* breathing room so the last card's text never sits flush against whatever follows on the page (e.g. a floating chat widget) */
	}

	.lsc-progress-bar {
		display: none;
	}
}

/* ---------- Tablet refinement (821px – 1100px) ----------
 * Nothing here changes desktop/laptop behavior — the pinned
 * hover-scroll interaction from script.js still applies above 820px.
 * This block only trims the rail width and spacing so the layout
 * doesn't feel cramped on tablets and narrower laptop windows.
 */
@media (min-width: 821px) and (max-width: 1100px) {
	.lsc-grid {
		grid-template-columns: 260px 1fr;
		gap: 32px;
		padding: 0 24px;
	}

	.lsc-card {
		padding: 32px;
	}

	.lsc-card h3 {
		font-size: 24px;
	}
}

/* ---------- Small phones (≤ 480px) ----------
 * Extra refinement on top of the existing ≤820px mobile fallback
 * above — layout and behavior (stacked cards, no hover-scroll pin)
 * stay the same; this only tightens padding and type size so content
 * doesn't feel oversized on narrow screens.
 */
@media (max-width: 480px) {
	.lsc-grid {
		padding: 0 16px;
		gap: 16px;
	}

	.lsc-card {
		padding: 24px;
	}

	.lsc-card h3 {
		font-size: 22px;
	}

	.lsc-tag {
		font-size: 11px;
	}

	.lsc-intro,
	.lsc-sub,
	.lsc-card li {
		font-size: 14px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.lsc-card,
	.lsc-route-progress,
	.lsc-progress-bar-fill {
		transition: none;
	}
}
