/**
 * MozartOS Metrics Dashboard
 *
 * Design system:
 *   - Background: transparent (dark page), data-grid overlay
 *   - Glassmorphism cards: rgba(16, 16, 16, 0.28) + blur(16px) saturate(1.2)
 *   - Full viewport: 100vh centered
 *   - Large counters: Manrope 700, 64px
 *   - Fonts: Manrope 700 (values), Helvetica (labels), Helvetica 600 uppercase 13px (accents)
 *   - Container: 1220px, border-radius: 0
 */

/* ------------------------------------------------
   Section — full viewport
   ------------------------------------------------ */

.stg-mzm {
	position: relative;
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

/* Data grid background — mission control aesthetic */
.stg-mzm__grid-bg {
	position: absolute;
	inset: 0;
	background-image:
		linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
		linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
	background-size: 80px 80px;
	pointer-events: none;
	opacity: 0;
	animation: stg-mzm-fade 2s ease-out 0.3s forwards;
}

@keyframes stg-mzm-fade {
	to { opacity: 1; }
}

/* ------------------------------------------------
   Inner
   ------------------------------------------------ */

.stg-mzm__inner {
	position: relative;
	z-index: 2;
	max-width: 1220px;
	width: 100%;
	margin: 0 auto;
	padding: 80px 24px;
	display: flex;
	flex-direction: column;
	gap: 56px;
}

/* ------------------------------------------------
   Header
   ------------------------------------------------ */

.stg-mzm__header {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 16px;
	opacity: 0;
	transform: translateY(16px);
	animation: stg-mzm-up 0.7s ease-out 0.15s forwards;
}

@keyframes stg-mzm-up {
	to { opacity: 1; transform: translateY(0); }
}

.stg-mzm__badge {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-family: 'Helvetica', 'Arial', sans-serif;
	font-weight: 600;
	font-size: 13px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.7);
	background: rgba(16, 16, 16, 0.3);
	backdrop-filter: blur(14px) saturate(1.2);
	-webkit-backdrop-filter: blur(14px) saturate(1.2);
	border: 1px solid rgba(255, 255, 255, 0.08);
	padding: 10px 22px;
}

.stg-mzm__badge-dot {
	width: 5px;
	height: 5px;
	background: rgba(255, 255, 255, 0.6);
	border-radius: 50%;
	box-shadow: 0 0 8px rgba(255, 255, 255, 0.25);
	animation: stg-mzm-pulse-dot 2.5s ease-in-out infinite;
}

@keyframes stg-mzm-pulse-dot {
	0%, 100% { opacity: 0.4; box-shadow: 0 0 4px rgba(255, 255, 255, 0.15); }
	50%      { opacity: 1;   box-shadow: 0 0 12px rgba(255, 255, 255, 0.35); }
}

.stg-mzm__title {
	font-family: 'Manrope', sans-serif;
	font-weight: 700;
	font-size: clamp(28px, 4vw, 48px);
	line-height: 1.08;
	letter-spacing: -0.03em;
	color: #FFFFFF;
	margin: 0;
}

.stg-mzm__title em {
	font-style: italic;
	font-weight: 700;
}

/* ------------------------------------------------
   Grid — 2×2
   ------------------------------------------------ */

.stg-mzm__grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 20px;
}

/* ------------------------------------------------
   Card — glassmorphism
   ------------------------------------------------ */

.stg-mzm__card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 20px;
	padding: 48px 44px;
	background: rgba(16, 16, 16, 0.28);
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
	backdrop-filter: blur(16px) saturate(1.2);
	-webkit-backdrop-filter: blur(16px) saturate(1.2);
	border: 1px solid rgba(255, 255, 255, 0.06);
	overflow: hidden;
	opacity: 0;
	transform: translateY(24px);
	animation: stg-mzm-up 0.65s ease-out forwards;
	transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.stg-mzm__card:nth-child(1) { animation-delay: 0.3s; }
.stg-mzm__card:nth-child(2) { animation-delay: 0.45s; }
.stg-mzm__card:nth-child(3) { animation-delay: 0.6s; }
.stg-mzm__card:nth-child(4) { animation-delay: 0.75s; }

.stg-mzm__card:hover {
	background: rgba(16, 16, 16, 0.35);
	backdrop-filter: blur(20px) saturate(1.3);
	-webkit-backdrop-filter: blur(20px) saturate(1.3);
	border-color: rgba(255, 255, 255, 0.1);
	transform: translateY(-3px);
	box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
}

/* ------------------------------------------------
   Card top — value + visual indicator
   ------------------------------------------------ */

.stg-mzm__card-top {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
}

.stg-mzm__value-wrap {
	display: flex;
	align-items: baseline;
	gap: 6px;
}

.stg-mzm__value {
	font-family: 'Manrope', sans-serif;
	font-weight: 700;
	font-size: 64px;
	line-height: 1;
	letter-spacing: -0.04em;
	color: #FFFFFF;
	font-variant-numeric: tabular-nums;
}

.stg-mzm__unit {
	font-family: 'Helvetica', 'Arial', sans-serif;
	font-weight: 600;
	font-size: 20px;
	color: rgba(255, 255, 255, 0.3);
	letter-spacing: 0.02em;
}

/* ------------------------------------------------
   Label
   ------------------------------------------------ */

.stg-mzm__label {
	font-family: 'Helvetica', 'Arial', sans-serif;
	font-weight: 400;
	font-size: 14px;
	line-height: 1.5;
	color: rgba(255, 255, 255, 0.35);
	margin: 0;
	max-width: 300px;
}

/* ------------------------------------------------
   Progress bar
   ------------------------------------------------ */

.stg-mzm__bar {
	height: 2px;
	background: rgba(255, 255, 255, 0.06);
	position: relative;
	overflow: hidden;
}

.stg-mzm__bar-fill {
	height: 100%;
	background: linear-gradient(90deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.4));
	width: 0;
	transition: width 2.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.stg-mzm--visible .stg-mzm__bar-fill {
	width: var(--bar-width);
}

/* ------------------------------------------------
   Visual — Progress Ring
   ------------------------------------------------ */

.stg-mzm__ring {
	width: 100px;
	height: 100px;
	transform: rotate(-90deg);
	flex-shrink: 0;
}

.stg-mzm__ring-fill {
	transition: stroke-dashoffset 2.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ------------------------------------------------
   Visual — Timeline
   ------------------------------------------------ */

.stg-mzm__timeline {
	width: 100px;
	height: 80px;
	position: relative;
	display: flex;
	align-items: center;
	flex-shrink: 0;
}

.stg-mzm__timeline-line {
	position: absolute;
	left: 12px;
	right: 12px;
	top: 50%;
	height: 1px;
	background: linear-gradient(90deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.08));
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 2s cubic-bezier(0.4, 0, 0.2, 1) 0.5s;
}

.stg-mzm--visible .stg-mzm__timeline-line {
	transform: scaleX(1);
}

.stg-mzm__timeline-dot {
	width: 8px;
	height: 8px;
	background: #FFFFFF;
	border-radius: 50%;
	position: absolute;
	left: 8px;
	top: 50%;
	transform: translateY(-50%) scale(0);
	transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s;
	box-shadow: 0 0 12px rgba(255, 255, 255, 0.3);
}

.stg-mzm__timeline-dot--end {
	left: auto;
	right: 8px;
	width: 6px;
	height: 6px;
	background: rgba(255, 255, 255, 0.3);
	box-shadow: none;
	transition-delay: 2.2s;
}

.stg-mzm--visible .stg-mzm__timeline-dot {
	transform: translateY(-50%) scale(1);
}

/* ------------------------------------------------
   Visual — Pulse
   ------------------------------------------------ */

.stg-mzm__pulse {
	width: 100px;
	height: 80px;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.stg-mzm__pulse-dot {
	width: 10px;
	height: 10px;
	background: #FFFFFF;
	border-radius: 50%;
	position: relative;
	z-index: 2;
	box-shadow: 0 0 12px rgba(255, 255, 255, 0.4);
	opacity: 0;
	transition: opacity 0.5s ease 0.5s;
}

.stg-mzm--visible .stg-mzm__pulse-dot {
	opacity: 1;
}

.stg-mzm__pulse-ring {
	position: absolute;
	width: 36px;
	height: 36px;
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 50%;
	opacity: 0;
}

.stg-mzm--visible .stg-mzm__pulse-ring {
	animation: stg-mzm-pulse-ring 3s ease-out 0.8s infinite;
}

.stg-mzm__pulse-ring--2 {
	width: 28px;
	height: 28px;
}

.stg-mzm--visible .stg-mzm__pulse-ring--2 {
	animation-delay: 1.8s;
}

@keyframes stg-mzm-pulse-ring {
	0%   { transform: scale(1); opacity: 0.5; }
	100% { transform: scale(3); opacity: 0; }
}

/* ------------------------------------------------
   Responsive — Tablet
   ------------------------------------------------ */

@media (max-width: 1024px) {
	.stg-mzm__inner {
		padding: 64px 24px;
		gap: 40px;
	}

	.stg-mzm__card {
		padding: 36px 32px;
		gap: 16px;
	}

	.stg-mzm__value {
		font-size: 52px;
	}

	.stg-mzm__unit {
		font-size: 17px;
	}

	.stg-mzm__ring {
		width: 80px;
		height: 80px;
	}

	.stg-mzm__timeline,
	.stg-mzm__pulse {
		width: 80px;
		height: 64px;
	}
}

/* ------------------------------------------------
   Responsive — Small Tablet
   ------------------------------------------------ */

@media (max-width: 900px) {
	.stg-mzm {
		min-height: auto;
	}

	.stg-mzm__grid {
		grid-template-columns: 1fr;
		max-width: 560px;
		margin: 0 auto;
		gap: 16px;
	}

	.stg-mzm__inner {
		padding: 64px 24px;
	}

	.stg-mzm__value {
		font-size: 56px;
	}
}

/* ------------------------------------------------
   Responsive — Mobile
   ------------------------------------------------ */

@media (max-width: 767px) {
	.stg-mzm__inner {
		padding: 48px 20px;
		gap: 32px;
	}

	.stg-mzm__card {
		padding: 32px 28px;
		gap: 14px;
	}

	.stg-mzm__value {
		font-size: 48px;
	}

	.stg-mzm__unit {
		font-size: 15px;
	}

	.stg-mzm__title {
		font-size: clamp(24px, 6vw, 32px);
	}

	.stg-mzm__ring {
		width: 64px;
		height: 64px;
	}

	.stg-mzm__timeline,
	.stg-mzm__pulse {
		width: 64px;
		height: 56px;
	}

	.stg-mzm__label {
		font-size: 13px;
	}
}

/* ------------------------------------------------
   Reduced Motion
   ------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
	.stg-mzm__badge-dot {
		animation: none;
	}

	.stg-mzm__card,
	.stg-mzm__header,
	.stg-mzm__grid-bg {
		opacity: 1;
		transform: none;
		animation: none;
	}

	.stg-mzm__card:hover {
		transform: none;
		transition: none;
	}

	.stg-mzm__bar-fill {
		transition: none;
	}

	.stg-mzm--visible .stg-mzm__bar-fill {
		width: var(--bar-width);
	}

	.stg-mzm__ring-fill {
		transition: none;
	}

	.stg-mzm__timeline-line {
		transform: scaleX(1);
		transition: none;
	}

	.stg-mzm__timeline-dot {
		transform: translateY(-50%) scale(1);
		transition: none;
	}

	.stg-mzm__pulse-dot {
		opacity: 1;
		transition: none;
	}

	.stg-mzm__pulse-ring {
		animation: none;
		opacity: 0.2;
		transform: scale(2);
	}
}
