/* ==========================================================================
   CM Digital — Sección 04: Método CM
   ========================================================================== */

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

/* ---- Timeline shell ---- */

.method__timeline {
	position: relative;
	z-index: 1;
}

.method__track {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 2px;
	background: var(--border);
	border-radius: var(--radius-full);
	overflow: hidden;
}

.method__progress {
	position: absolute;
	inset: 0;
	transform-origin: left center;
	transform: scaleX(1);
	background: linear-gradient(90deg, var(--accent-600), var(--accent-400));
}

.method__timeline.reveal-armed .method__progress {
	transform: scaleX(0);
}

.method__timeline.reveal-armed.is-visible .method__progress {
	transform: scaleX(1);
	transition: transform 1.6s 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---- Stages ---- */

.method__stages {
	display: flex;
	gap: var(--space-lg);
}

.method__stage {
	position: relative;
	flex: 1;
	min-width: 0;
	padding-top: 36px;
	padding-right: var(--space-md);
}

.method__stage-dot {
	/* Absolutely positioned so its center always lands exactly on
	   .method__track's center (top:0, height:2px → center at 1px), instead
	   of wherever normal document flow happened to push it — verified via
	   getBoundingClientRect() that these two were 48px apart before. */
	position: absolute;
	top: -6px;
	left: 0;
	z-index: 1;
	display: block;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: var(--accent-500);
	border: 2px solid var(--accent-300);
	box-shadow: 0 0 12px 2px var(--accent-glow);
}

.method__timeline.reveal-armed .method__stage-dot {
	background: var(--surface-elevated);
	border-color: var(--border-strong);
	box-shadow: none;
	transition: background-color 0.5s, border-color 0.5s, box-shadow 0.5s;
}

.method__timeline.reveal-armed.is-visible .method__stage-dot {
	background: var(--accent-500);
	border-color: var(--accent-300);
	box-shadow: 0 0 12px 2px var(--accent-glow);
	transition-delay: calc(var(--i, 0) * 0.35s + 0.3s);
}

.method__stage-index {
	display: block;
	font-size: var(--fs-body-sm);
	font-weight: var(--fw-semibold);
	letter-spacing: var(--ls-wide);
	color: var(--accent-300);
	margin-bottom: var(--space-2xs);
}

/* Oversized watermark numeral behind each stage's copy — a common editorial
   device for premium step-by-step layouts; kept low-contrast enough to
   never compete with the real (accessible) index above. */
.method__stage::after {
	content: attr(data-index);
	position: absolute;
	z-index: -1;
	top: 28px;
	right: var(--space-md);
	font-size: 6rem;
	font-weight: var(--fw-bold);
	line-height: 1;
	color: rgba(255, 255, 255, 0.035);
	pointer-events: none;
}

.method__stage-title {
	font-size: var(--fs-h3);
	font-weight: var(--fw-semibold);
	color: var(--text-primary);
	text-transform: uppercase;
	margin-bottom: var(--space-xs);
}

.method__stage-desc {
	font-size: var(--fs-body-sm);
	line-height: var(--lh-body);
	color: var(--text-secondary);
	max-width: 38ch;
}

/* ---- Mobile: vertical timeline ---- */

@media (max-width: 899.98px) {
	.method__timeline {
		padding-top: 0;
		padding-left: 34px;
	}

	.method__track {
		top: 6px;
		bottom: 6px;
		left: 6px;
		right: auto;
		width: 2px;
		height: auto;
	}

	.method__progress {
		transform-origin: top center;
	}

	.method__timeline.reveal-armed .method__progress {
		transform: scaleY(0);
	}

	.method__timeline.reveal-armed.is-visible .method__progress {
		transform: scaleY(1);
		transition: transform 1.6s 0.2s cubic-bezier(0.16, 1, 0.3, 1);
	}

	.method__stages {
		flex-direction: column;
		gap: var(--space-2xl);
	}

	.method__stage {
		padding-right: 0;
	}

	.method__stage-dot {
		position: absolute;
		left: -34px;
		top: 2px;
		margin-bottom: 0;
	}

	.method__stage-desc {
		max-width: none;
	}

	.method__stage::after {
		font-size: 4rem;
		top: 4px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.method__stage-dot {
		transition-delay: 0s !important;
	}
}
