/* ============================================================
   Cases Section — dark theme, 3-projects batch with load-more
   ============================================================ */

/* ———————————————————————
   Section Background — dark
   ——————————————————————— */

section.cases-section.section {
	position: relative;
	background-color: #0d0d20 !important;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	padding: 50px 0;
}

/* Subtle background pattern */
section.cases-section.section::before {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 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),
		radial-gradient(rgba(255, 94, 20, 0.05) 1px, transparent 1px);
	background-size: 50px 50px, 50px 50px, 25px 25px;
	-webkit-mask-image: radial-gradient(ellipse at 50% 50%, black 45%, transparent 72%);
	mask-image: radial-gradient(ellipse at 50% 50%, black 45%, transparent 72%);
	pointer-events: none;
}

/* Ambient orange glow */
section.cases-section.section::after {
	content: '';
	position: absolute;
	bottom: -150px;
	right: -100px;
	width: 450px;
	height: 450px;
	background: radial-gradient(circle, rgba(255, 94, 20, 0.04) 0%, transparent 65%);
	border-radius: 50%;
	pointer-events: none;
	z-index: 0;
}

section.cases-section .container {
	position: relative;
	z-index: 1;
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 28px;
}

/* ———————————————————————
   Section Title
   ——————————————————————— */

.cases-section .section-title {
	color: #ffffff;
	margin-bottom: 0;
}

/* ———————————————————————
   Filter
   ——————————————————————— */

.cases-filter {
	display: flex;
	justify-content: center;
	gap: 10px;
	flex-wrap: wrap;
}

.filter-btn {
	padding: 7px 22px;
	font-family: var(--font-primary);
	font-size: 13px;
	font-weight: 500;
	color: rgba(255, 255, 255, 0.55);
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 20px;
	cursor: pointer;
	transition: all var(--transition-speed) var(--transition-ease);
	line-height: 1.4;
}

.filter-btn:hover {
	border-color: rgba(255, 94, 20, 0.35);
	color: #ffffff;
}

.filter-btn.active {
	background: var(--color-primary);
	color: #ffffff;
	border-color: var(--color-primary);
}

/* ———————————————————————
   Cases Batch Container (4 cards row on desktop)
   ——————————————————————— */

.cases-batch {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 20px;
	position: relative;
	perspective: 1200px;
}

/* ———————————————————————
   Case Card — compact, background-image hero
   ——————————————————————— */

.case-card {
	position: relative;
	background: rgba(255, 255, 255, 0.03);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border: 1px solid rgba(255, 255, 255, 0.06);
	border-radius: var(--radius-md);
	overflow: hidden;
	transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
	            border-color 0.4s ease,
	            box-shadow 0.4s ease;
	display: flex;
	flex-direction: column;
	opacity: 1;
	transform: translateY(0) scale(1);
}

.case-card:hover {
	transform: translateY(-6px);
	border-color: rgba(255, 94, 20, 0.25);
	box-shadow:
		0 12px 40px rgba(0, 0, 0, 0.3),
		0 0 60px rgba(255, 94, 20, 0.04);
}

/* Hidden state — used for batching */
.case-card.hidden {
	display: none !important;
}

/* Animation classes for batch swap */
.case-card.batch-exit {
	animation: batch-card-exit 0.45s ease-in forwards;
}

.case-card.batch-enter {
	animation: batch-card-enter 0.45s ease-out forwards;
}

@keyframes batch-card-exit {
	0% {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
	100% {
		opacity: 0;
		transform: translateY(20px) scale(0.95);
	}
}

@keyframes batch-card-enter {
	0% {
		opacity: 0;
		transform: translateY(-20px) scale(0.95);
	}
	100% {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

/* Card is a full link */
.case-card-link {
	display: flex;
	flex-direction: column;
	flex: 1;
	color: inherit;
	text-decoration: none;
}

.case-card-link:hover {
	color: inherit;
}

/* ———————————————————————
   Hero Area — background image with result overlay
   ——————————————————————— */

.case-hero {
	position: relative;
	height: 180px;
	background-size: cover;
	background-position: center;
	background-color: #1a1a3a;
	overflow: hidden;
	flex-shrink: 0;
}

.case-hero-result {
	position: relative;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 24px;
	height: 100%;
	padding: 16px 20px;
}

.case-hero-result-item {
	text-align: center;
	flex: 1;
}

.case-hero-value {
	display: block;
	font-family: var(--font-heading);
	font-size: 38px;
	font-weight: 800;
	color: var(--color-primary);
	line-height: 1.1;
	text-shadow:
		0 2px 8px rgba(0, 0, 0, 0.9),
		0 0 30px rgba(0, 0, 0, 0.6),
		0 0 20px rgba(255, 94, 20, 0.15);
}

.case-hero-label {
	display: block;
	font-size: 11px;
	color: rgba(255, 255, 255, 0.85);
	margin-top: 2px;
	line-height: 1.3;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	text-shadow: 0 1px 6px rgba(0, 0, 0, 0.85);
}

/* ———————————————————————
   Card Body
   ——————————————————————— */

.case-body {
	padding: 14px 16px 16px;
	flex: 1;
	display: flex;
	flex-direction: column;
}

.case-title {
	font-family: var(--font-heading);
	font-size: 16px;
	font-weight: 600;
	line-height: 1.3;
	color: #ffffff;
	margin-bottom: 6px;
	transition: color var(--transition-speed) var(--transition-ease);
}

.case-card:hover .case-title {
	color: var(--color-primary);
}

.case-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
	margin-bottom: 6px;
}

.case-tag {
	padding: 2px 8px;
	background: rgba(255, 94, 20, 0.12);
	color: var(--color-primary);
	font-size: 11px;
	font-weight: 600;
	border-radius: 4px;
	line-height: 1.4;
}

.case-description {
	font-size: 13px;
	line-height: 1.5;
	color: rgba(255, 255, 255, 0.5);
	margin-bottom: auto;
	padding-top: 4px;
	flex: 1;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.case-more-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	font-weight: 600;
	color: var(--color-primary);
	margin-top: 10px;
	transition: gap 0.3s var(--transition-ease);
}

.case-arrow {
	display: inline-block;
	transition: transform 0.3s var(--transition-ease);
}

.case-card:hover .case-arrow {
	transform: translateX(4px);
}

/* ———————————————————————
   Navigation (load-more button + counter)
   ——————————————————————— */

.cases-nav {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 20px;
	margin-top: 28px;
}

.cases-load-btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 12px 32px;
	font-family: var(--font-primary);
	font-size: 15px;
	font-weight: 600;
	color: #ffffff;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 10px;
	cursor: pointer;
	transition: all var(--transition-speed) var(--transition-ease);
	line-height: 1.4;
}

.cases-load-btn:hover {
	background: rgba(255, 94, 20, 0.12);
	border-color: rgba(255, 94, 20, 0.3);
	color: var(--color-primary);
}

.cases-load-btn:hover .cases-load-icon {
	transform: translateX(4px);
}

.cases-load-icon {
	display: inline-block;
	font-size: 18px;
	transition: transform 0.3s var(--transition-ease);
}

.cases-load-btn:disabled {
	opacity: 0.3;
	cursor: default;
	pointer-events: none;
}

.cases-counter {
	font-size: 13px;
	font-weight: 500;
	color: rgba(255, 255, 255, 0.3);
	font-variant-numeric: tabular-nums;
}

/* ———————————————————————
   Empty State
   ——————————————————————— */

.cases-empty {
	text-align: center;
	font-size: 16px;
	color: rgba(255, 255, 255, 0.4);
	padding: 60px 20px;
}

/* ———————————————————————
   Responsive
   ——————————————————————— */

@media (max-width: 1100px) {
	.cases-batch {
		grid-template-columns: repeat(3, 1fr);
		gap: 16px;
	}

	.case-hero-value {
		font-size: 32px;
	}

	.case-hero {
		height: 160px;
	}
}

@media (max-width: 900px) {
	.cases-batch {
		grid-template-columns: repeat(2, 1fr);
		gap: 14px;
	}

	.case-hero-value {
		font-size: 28px;
	}

	.case-hero {
		height: 140px;
	}

	.case-hero-result {
		gap: 14px;
		padding: 12px 14px;
	}

	.case-body {
		padding: 12px 14px 14px;
	}

	.case-title {
		font-size: 15px;
	}
}

@media (max-width: 767px) {
	section.cases-section.section {
		padding: 24px 0;
	}

	.cases-batch {
		grid-template-columns: 1fr;
		align-items: center;
		gap: 16px;
	}

	.case-card {
		max-width: 400px;
		width: 100%;
		justify-self: center;
	}

	.case-hero {
		height: 180px;
	}

	.case-hero-value {
		font-size: 34px;
	}

	.case-card:hover {
		transform: none;
		box-shadow: none;
	}

	.cases-load-btn {
		width: 100%;
		justify-content: center;
		padding: 14px 24px;
	}
}
