/* ================================================================
   STATS — animated hero bottom strip
   ================================================================ */
.stats {
	position: relative;
	overflow: hidden;
	background: var(--color-bg-primary);
	border-top: 1px solid rgba(255, 255, 255, 0.07);
	border-bottom: 1px solid rgba(255, 255, 255, 0.07);
	direction: ltr;
	text-align: left;
	isolation: isolate;
}

/* Ambient */
.stats__ambient {
	position: absolute;
	inset: 0;
	pointer-events: none;
	overflow: hidden;
}

.stats__ambient-glow {
	position: absolute;
	inset: 0;
	background:
		radial-gradient(ellipse 80% 120% at 20% 50%, rgba(214, 255, 47, 0.07), transparent 55%),
		radial-gradient(ellipse 80% 120% at 80% 50%, rgba(120, 130, 255, 0.05), transparent 55%);
	opacity: 0.8;
	animation: stats-glow-breathe 6s ease-in-out infinite;
}

@keyframes stats-glow-breathe {
	0%, 100% { opacity: 0.55; transform: scale(1); }
	50% { opacity: 1; transform: scale(1.02); }
}

.stats__scan {
	position: absolute;
	top: 0;
	left: -30%;
	width: 30%;
	height: 100%;
	background: linear-gradient(90deg, transparent, rgba(214, 255, 47, 0.06), transparent);
	transform: skewX(-18deg);
	animation: stats-scan 7s ease-in-out infinite;
}

@keyframes stats-scan {
	0% { left: -35%; opacity: 0; }
	15% { opacity: 1; }
	85% { opacity: 1; }
	100% { left: 105%; opacity: 0; }
}

/* Edge chevrons */
.stats__edge {
	position: absolute;
	top: 50%;
	width: 16px;
	height: 16px;
	border-top: 1.5px solid rgba(214, 255, 47, 0.55);
	border-right: 1.5px solid rgba(214, 255, 47, 0.55);
	pointer-events: none;
	z-index: 2;
}

.stats__edge--left {
	left: clamp(0.75rem, 2.5vw, 2rem);
	transform: translateY(-50%) rotate(45deg);
}

.stats__edge--right {
	right: clamp(0.75rem, 2.5vw, 2rem);
	transform: translateY(-50%) rotate(-135deg);
}

.stats.stats--live .stats__edge {
	animation: stats-edge-pulse 2.4s ease-in-out infinite;
}

@keyframes stats-edge-pulse {
	0%, 100% { opacity: 0.45; filter: drop-shadow(0 0 0 transparent); }
	50% { opacity: 1; filter: drop-shadow(0 0 8px rgba(214, 255, 47, 0.45)); }
}

/* Grid */
.stats__inner {
	position: relative;
	z-index: 1;
}

.stats__grid {
	display: grid;
	grid-template-columns: repeat(var(--stats-count, 4), minmax(0, 1fr));
}

.stats__item {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	padding: clamp(1.65rem, 3.5vh, 2.35rem) 1rem;
	overflow: hidden;
	cursor: default;
}

.stats__item-glow {
	position: absolute;
	inset: 0;
	background: radial-gradient(circle at 50% 50%, rgba(214, 255, 47, 0.12), transparent 65%);
	opacity: 0;
	transition: opacity 0.45s ease;
	pointer-events: none;
}

.stats__item:hover .stats__item-glow,
.stats__item.stats__item--active .stats__item-glow {
	opacity: 1;
}

.stats__item-line {
	position: absolute;
	bottom: 0;
	left: 50%;
	width: 0;
	height: 2px;
	transform: translateX(-50%);
	background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
	box-shadow: 0 0 14px rgba(214, 255, 47, 0.45);
	transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.stats__item:hover .stats__item-line,
.stats__item.stats__item--active .stats__item-line {
	width: 72%;
}

/* Dividers */
.stats__item + .stats__item::before {
	content: '';
	position: absolute;
	left: 0;
	top: 50%;
	transform: translateY(-50%);
	height: 58%;
	width: 1px;
	background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.14), transparent);
}

/* Icon */
.stats__icon {
	position: relative;
	display: grid;
	place-items: center;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	border: 1px solid rgba(214, 255, 47, 0.3);
	background: rgba(214, 255, 47, 0.04);
	color: var(--color-accent);
	box-shadow: 0 0 22px rgba(214, 255, 47, 0.12), inset 0 0 16px rgba(214, 255, 47, 0.04);
	flex-shrink: 0;
	transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.45s ease, border-color 0.45s ease;
}

.stats__icon-ring {
	position: absolute;
	inset: -5px;
	border-radius: 50%;
	border: 1px dashed rgba(214, 255, 47, 0.28);
	animation: stats-ring-spin 12s linear infinite;
	pointer-events: none;
}

.stats__icon-ring--2 {
	inset: -10px;
	border-style: solid;
	border-color: rgba(214, 255, 47, 0.1);
	animation-direction: reverse;
	animation-duration: 18s;
}

@keyframes stats-ring-spin {
	to { transform: rotate(360deg); }
}

.stats__item:hover .stats__icon,
.stats__item.stats__item--active .stats__icon {
	transform: translateY(-4px) scale(1.04);
	border-color: rgba(214, 255, 47, 0.6);
	box-shadow: 0 0 32px rgba(214, 255, 47, 0.28), inset 0 0 18px rgba(214, 255, 47, 0.1);
}

.stats__icon-svg {
	position: relative;
	z-index: 1;
	width: 1.4rem;
	height: 1.4rem;
	transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.stats__item:hover .stats__icon-svg {
	transform: scale(1.08);
}

/* Number + label */
.stats__body {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	min-width: 0;
}

.stats__number {
	font-size: clamp(1.55rem, 2.8vw, 2rem);
	font-weight: 800;
	line-height: 1;
	letter-spacing: -0.02em;
	color: var(--color-white);
	font-variant-numeric: tabular-nums;
	text-shadow: 0 0 24px rgba(214, 255, 47, 0.15);
	transition: color 0.35s ease, text-shadow 0.35s ease;
}

.stats__item:hover .stats__number,
.stats__item.stats__item--active .stats__number {
	color: var(--color-accent);
	text-shadow: 0 0 28px rgba(214, 255, 47, 0.35);
}

.stats__label {
	font-size: 0.68rem;
	font-weight: 600;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--color-text-muted);
	white-space: nowrap;
	transition: color 0.35s ease, letter-spacing 0.35s ease;
}

.stats__item:hover .stats__label {
	color: var(--color-text-secondary);
	letter-spacing: 0.22em;
}

/* Counter flash when animating */
.stats__number.stats__number--counting {
	animation: stats-number-flash 0.6s ease;
}

@keyframes stats-number-flash {
	0%, 100% { transform: scale(1); }
	50% { transform: scale(1.04); }
}

/* ================================================================
   Responsive
   ================================================================ */
.stats__grid[data-stats-count="1"] {
	max-width: 20rem;
	margin-inline: auto;
}

.stats__grid[data-stats-count="3"] {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 900px) {
	.stats__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.stats__grid[data-stats-count="1"] {
		grid-template-columns: 1fr;
	}

	.stats__grid[data-stats-count="3"] .stats__item:last-child {
		grid-column: 1 / -1;
		justify-self: center;
		width: min(100%, 16rem);
	}

	.stats__item + .stats__item::before {
		display: none;
	}

	.stats__item:nth-child(even)::before {
		content: '';
		display: block;
		position: absolute;
		left: 0;
		top: 50%;
		transform: translateY(-50%);
		height: 58%;
		width: 1px;
		background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.14), transparent);
	}

	.stats__item:nth-child(n+3)::after {
		content: '';
		position: absolute;
		top: 0;
		left: 10%;
		right: 10%;
		height: 1px;
		background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
	}

	.stats__item {
		padding: 1.45rem 0.75rem;
	}

	.stats__edge {
		display: none;
	}
}

@media (max-width: 480px) {
	.stats__item {
		flex-direction: column;
		text-align: center;
		gap: 0.65rem;
		padding: 1.3rem 0.5rem;
	}

	.stats__body {
		align-items: center;
	}

	.stats__icon {
		width: 48px;
		height: 48px;
	}

	.stats__icon-svg {
		width: 1.2rem;
		height: 1.2rem;
	}

	.stats__number {
		font-size: 1.45rem;
	}

	.stats__label {
		font-size: 0.62rem;
		letter-spacing: 0.16em;
	}
}

@media (prefers-reduced-motion: reduce) {
	.stats__ambient-glow,
	.stats__scan,
	.stats__edge,
	.stats__icon-ring {
		animation: none;
	}

	.stats__icon,
	.stats__item-line,
	.stats__label,
	.stats__number {
		transition: none;
	}
}
