/* ==========================================================================
   CM Digital — Sección 02: El Problema
   ========================================================================== */

.problem {
	background: var(--bg-primary);
}

.problem__intro .btn {
	margin-top: var(--space-md);
}

/* ---- Data spine ---- */

.problem__spine {
	position: relative;
	z-index: 1;
	padding-block: var(--space-3xl) var(--space-md);
}

.problem__line {
	position: absolute;
	left: 0;
	right: 0;
	top: 50%;
	height: 2px;
	background: linear-gradient(90deg, rgba(47, 111, 255, 0) 0%, var(--accent-500) 15%, var(--accent-400) 50%, var(--accent-500) 85%, rgba(47, 111, 255, 0) 100%);
	transform: scaleX(1);
	transform-origin: center;
}

.problem__spine.reveal-armed .problem__line {
	transform: scaleX(0);
}

.problem__spine.reveal-armed.is-visible .problem__line {
	transform: scaleX(1);
	transition: transform 1.1s cubic-bezier(0.16, 1, 0.3, 1);
}

.problem__nodes {
	position: relative;
	z-index: 1;
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: var(--space-xl) var(--space-md);
}

.problem__node {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--space-2xs);
	width: 15%;
	min-width: 96px;
	text-align: center;
}

.problem__node::before {
	content: "";
	position: absolute;
	left: 50%;
	width: 1px;
	background: var(--border-strong);
}

.problem__node::after {
	content: "";
	position: absolute;
	left: 50%;
	transform: translateX(-50%);
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--accent-400);
	box-shadow: 0 0 10px 2px var(--accent-glow);
}

.problem__node--up {
	transform: translateY(-34px);
}

.problem__node--up::before {
	bottom: -34px;
	height: 34px;
}

.problem__node--up::after {
	bottom: -37px;
}

.problem__node--down {
	transform: translateY(34px);
}

.problem__node--down::before {
	top: -34px;
	height: 34px;
}

.problem__node--down::after {
	top: -37px;
}

.problem__node-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	flex-shrink: 0;
	border-radius: 50%;
	background: rgba(47, 111, 255, 0.09);
	color: var(--accent-400);
	margin-bottom: var(--space-3xs);
}

.problem__node-icon svg {
	width: 16px;
	height: 16px;
}

.problem__node-index {
	font-size: var(--fs-body-sm);
	font-weight: var(--fw-semibold);
	color: var(--accent-300);
	letter-spacing: var(--ls-wide);
}

.problem__node-label {
	font-size: var(--fs-body-sm);
	font-weight: var(--fw-medium);
	color: var(--text-primary);
}

/* Staggered fade for the nodes once the spine reveals */

.problem__spine.reveal-armed .problem__node {
	opacity: 0;
	transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.problem__spine.reveal-armed.is-visible .problem__node {
	opacity: 1;
}

.problem__spine.reveal-armed.is-visible .problem__node:nth-child(1) {
	transition-delay: 0.25s;
}
.problem__spine.reveal-armed.is-visible .problem__node:nth-child(2) {
	transition-delay: 0.4s;
}
.problem__spine.reveal-armed.is-visible .problem__node:nth-child(3) {
	transition-delay: 0.55s;
}
.problem__spine.reveal-armed.is-visible .problem__node:nth-child(4) {
	transition-delay: 0.7s;
}
.problem__spine.reveal-armed.is-visible .problem__node:nth-child(5) {
	transition-delay: 0.85s;
}
.problem__spine.reveal-armed.is-visible .problem__node:nth-child(6) {
	transition-delay: 1s;
}

/* ---- Mobile: vertical spine ---- */

/* 899.98, not 767.98 — matches Método CM's mobile breakpoint so the
   horizontal-spine-to-vertical switch happens at the same width as the
   Hero's nav switch (960) and Método's timeline switch (900); otherwise
   this section alone renders its cramped desktop layout at 768-899px
   while its neighbors are already in mobile mode. */
@media (max-width: 899.98px) {
	.problem__line {
		left: 20px;
		right: auto;
		top: 0;
		bottom: 0;
		width: 2px;
		height: auto;
		background: linear-gradient(180deg, rgba(47, 111, 255, 0) 0%, var(--accent-500) 12%, var(--accent-400) 50%, var(--accent-500) 88%, rgba(47, 111, 255, 0) 100%);
		transform: scaleY(1);
		transform-origin: top;
	}

	.problem__spine.reveal-armed .problem__line {
		transform: scaleY(0);
	}

	.problem__spine.reveal-armed.is-visible .problem__line {
		transform: scaleY(1);
		transition: transform 1.1s cubic-bezier(0.16, 1, 0.3, 1);
	}

	.problem__nodes {
		flex-direction: column;
		gap: var(--space-lg);
		padding-left: 44px;
	}

	.problem__node {
		width: 100%;
		min-width: 0;
		flex-direction: row;
		align-items: center;
		gap: var(--space-sm);
		text-align: left;
		transform: none !important;
	}

	.problem__node::before {
		left: -24px;
		top: 50%;
		width: 24px;
		height: 1px;
		background: var(--border-strong);
	}

	.problem__node::after {
		left: -28px;
		top: 50%;
		transform: translateY(-50%);
	}

	.problem__node-icon {
		margin-bottom: 0;
	}

	.problem__node-index {
		min-width: 2.2ch;
	}
}
