/**
 * Блок «4 решения для удобного открывания».
 *
 * Десктоп: слева вертикальное видео (~38% ширины), справа — 4 карточки в стек.
 * Мобайл: видео сверху на всю ширину, карточки снизу.
 */

.mechanisms-block {
	background: #0f0f11;
	color: #fff;
	padding: clamp(3rem, 7vw, 6rem) 0;
	position: relative;
	overflow: hidden;
}

.mechanisms-block__header {
	text-align: center;
	max-width: 48rem;
	margin: 0 auto clamp(2rem, 4vw, 3rem);
	padding: 0 1rem;
}

.mechanisms-block__title {
	font-family: var(--font-serif);
	font-weight: 300;
	font-size: clamp(1.6rem, 3.5vw, 2.625rem);
	line-height: 1.15;
	letter-spacing: -0.01em;
	margin: 0 0 0.75rem;
	color: #fff;
}

.mechanisms-block__subtitle {
	margin: 0;
	font-size: clamp(0.95rem, 1.25vw, 1.0625rem);
	color: rgba(255, 255, 255, 0.7);
	line-height: 1.5;
}

/* ---------- Grid (video + cards) ---------- */
.mechanisms-block__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: clamp(1.5rem, 3vw, 2.5rem);
	align-items: start;
}

@media (min-width: 900px) {
	.mechanisms-block__grid {
		grid-template-columns: minmax(320px, 38%) 1fr;
		gap: clamp(2rem, 4vw, 3.5rem);
		align-items: stretch;
	}
}

/* ---------- Видео ---------- */
.mechanisms-block__media {
	position: relative;
	max-width: 420px;
	margin: 0 auto;
	width: 100%;
}

@media (min-width: 900px) {
	.mechanisms-block__media {
		max-width: none;
		position: sticky;
		top: 5rem;
	}
}

.mechanisms-block__video-frame {
	position: relative;
	aspect-ratio: 9 / 16;
	border-radius: 18px;
	overflow: hidden;
	background: #000;
	box-shadow:
		0 25px 60px -15px rgba(0, 0, 0, 0.65),
		0 0 0 1px rgba(255, 255, 255, 0.04);
}

.mechanisms-block__video {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Прогресс-полоски сегментов в нижней части видео */
.mechanisms-block__progress {
	position: absolute;
	left: 12px;
	right: 12px;
	bottom: 12px;
	display: flex;
	gap: 6px;
	z-index: 2;
	pointer-events: none;
}

.mechanisms-block__progress-seg {
	flex: 1;
	height: 3px;
	border-radius: 2px;
	background: rgba(255, 255, 255, 0.22);
	overflow: hidden;
}

.mechanisms-block__progress-fill {
	display: block;
	height: 100%;
	width: 0%;
	background: #fff;
	transform-origin: left center;
	transition: width 0.1s linear;
}

/* ---------- Карточки ---------- */
.mechanisms-block__cards {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	counter-reset: mech;
}

@media (min-width: 900px) {
	.mechanisms-block__cards {
		display: grid;
		grid-template-rows: repeat(4, minmax(0, 1fr));
		height: 100%;
	}
}

.mechanisms-block__card {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 1rem 1.25rem;
	padding: 1.25rem 1.4rem;
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 14px;
	cursor: pointer;
	transition:
		background 0.4s ease,
		border-color 0.4s ease,
		transform 0.4s ease;
	outline: none;
}

@media (min-width: 900px) {
	.mechanisms-block__card {
		align-items: center;
		padding: clamp(1rem, 1.8vw, 1.35rem) clamp(1.15rem, 2vw, 1.6rem);
	}
}

.mechanisms-block__card:hover,
.mechanisms-block__card:focus-visible {
	background: rgba(255, 255, 255, 0.055);
	border-color: rgba(255, 255, 255, 0.16);
}

.mechanisms-block__card.is-active {
	background: linear-gradient(135deg,
		rgba(212, 175, 110, 0.14) 0%,
		rgba(255, 255, 255, 0.045) 60%);
	border-color: rgba(212, 175, 110, 0.45);
	box-shadow:
		0 0 0 1px rgba(212, 175, 110, 0.2) inset,
		0 12px 32px -10px rgba(212, 175, 110, 0.25);
	transform: translateX(4px);
}

.mechanisms-block__card-num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(255, 255, 255, 0.15);
	font-family: var(--font-serif);
	font-size: 1.15rem;
	font-weight: 400;
	color: rgba(255, 255, 255, 0.85);
	flex-shrink: 0;
	transition: background 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}

.mechanisms-block__card.is-active .mechanisms-block__card-num {
	background: rgb(var(--color-accent, 212 175 110));
	color: #0f0f11;
	border-color: rgb(var(--color-accent, 212 175 110));
}

.mechanisms-block__card-body {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	min-width: 0;
}

.mechanisms-block__card-eyebrow {
	font-size: 0.78rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: rgb(var(--color-accent, 212 175 110));
	font-weight: 500;
}

.mechanisms-block__card-title {
	font-family: var(--font-serif);
	font-weight: 400;
	font-size: clamp(1.2rem, 1.9vw, 1.5rem);
	line-height: 1.2;
	color: #fff;
	margin: 0;
}

.mechanisms-block__card-text {
	margin: 0;
	color: rgba(255, 255, 255, 0.72);
	font-size: 0.95rem;
	line-height: 1.55;
}

/* ---------- CTA снизу ---------- */
.mechanisms-block__cta {
	margin-top: clamp(2rem, 4vw, 3rem);
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	text-align: center;
}

.mechanisms-block__cta-hint {
	color: rgba(255, 255, 255, 0.55);
	font-size: 0.875rem;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
	.mechanisms-block__video {
		display: none;
	}

	.mechanisms-block__video-frame {
		background:
			center / cover no-repeat
			url('../img/mechanisms/mechanisms-poster.webp');
	}

	.mechanisms-block__card,
	.mechanisms-block__card-num {
		transition: none;
	}
}
