:root {
	--count: 4;
	--duration: 8s; 
	--step: calc(var(--duration) / var(--count));
	--w: 400px;
	--h: 250px;
	--d: 4px;
	--hd: calc(var(--d) / 2);
	--layer-spacing: 400px;
	
	/* Mesh Color Scheme */
	--Mesh-primary: #00D4FF;
	--Mesh-secondary: #7B61FF;
	--Mesh-purple: #8B5CF6;
	--Mesh-gradient: linear-gradient(135deg, #8B5CF6 0%, #7B61FF 50%, #00D4FF 100%);
	--Mesh-card-gradient: linear-gradient(135deg, rgba(139, 92, 246, 0.9) 0%, rgba(123, 97, 255, 0.9) 50%, rgba(0, 212, 255, 0.9) 100%);
	
	/* Card Colors */
	--card-blue: var(--Mesh-card-gradient);
	--card-gold: linear-gradient(135deg, #ffd700 0%, #ffed4e 50%, #ff8c00 100%);
	--pvc-clear: rgba(255, 255, 255, 0.1);
	--magnetic-brown: #8B4513;
	--antenna-copper: #B87333;
}

@property --space {
	syntax: "<length>";
	inherits: false;
	initial-value: 0px; 
}

@property --rtY {
	syntax: "<angle>";
	inherits: false;
	initial-value: 0deg;
}

@property --rtX {
	syntax: "<angle>";
	inherits: false;
	initial-value: 0deg;
}



@property --space {
	syntax: "<length>";
	inherits: false;
	initial-value: 0px;
}

@property --rtY {
	syntax: "<angle>";
	inherits: false;
	initial-value: 0deg;
}

@property --rtX {
	syntax: "<angle>";
	inherits: false;
	initial-value: 0deg;
}

@property --xOffset {
	syntax: "<length>";
	inherits: false;
	initial-value: 0px;
}

@property --yOffset {
	syntax: "<length>";
	inherits: false;
	initial-value: 0px;
}


.scene {
	width: 100%;
	height: 100%;
	display: grid;
	place-items: start center;
	padding-top: 100px;
	transform-style: preserve-3d;
	transform: rotateY(var(--rtY)) rotateX(var(--rtX));
}

.card-layer {
	position: absolute;
	width: var(--w) !important;
	height: var(--h) !important;
	background: 
		linear-gradient(rgba(15, 15, 25, 0.3), rgba(25, 20, 35, 0.3)),
		url('assets/background-card.png');
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	transform: translateZ(calc( (var(--i) - ( var(--tc) + 1) / 2) * var(--space) ))
	          translateX(calc( (var(--i) - 1) * var(--xOffset) ))
	          translateY(calc( (var(--i) - 1) * var(--yOffset) ));
	transform-style: preserve-3d;
	will-change: transform;
	border-radius: 16px;
	overflow: hidden;
	transition: all 0.8s cubic-bezier(0.4, 0.0, 0.2, 1);
	/* box-shadow: 
		0 25px 50px rgba(0, 0, 0, 0.35),
		0 15px 25px rgba(0, 0, 0, 0.25),
		inset 0 1px 0 rgba(255, 255, 255, 0.15); */
}

/* Add mirror-like shine effect to all layers */
.card-layer::after {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: linear-gradient(45deg, 
		transparent 0%, 
		rgba(255,255,255,0.15) 25%, 
		rgba(255,255,255,0.3) 50%, 
		rgba(255,255,255,0.15) 75%, 
		transparent 100%);
	border-radius: inherit;
	pointer-events: none;
	animation: mirror-shine 4s ease-in-out infinite;
}

@keyframes mirror-shine {
	0%, 100% {
		transform: translateX(-100%) skewX(-15deg);
		opacity: 0;
	}
	50% {
		transform: translateX(200%) skewX(-15deg);
		opacity: 1;
	}
}

/* Layer Z-Index Stacking - Simplified 4-layer structure */
.card-layer[style*="--i: 1"] {
	z-index: 10;
}

.card-layer[style*="--i: 2"] {
	z-index: 20;
}

.card-layer[style*="--i: 3"] {
	z-index: 30;
}

.card-layer[style*="--i: 4"] {
	z-index: 40;
}

/* When layers explode, maintain proper stacking */
.card-layer.exploded {
	z-index: calc(var(--i) * 10 + 100) !important;
}

/* Layer Highlighting System */
.layer-highlight {
	position: absolute;
	left: -300px;
	top: 120px;
	transform: translateY(0);
	opacity: 0;
	transition: all 0.8s ease-out;
	pointer-events: none;
}

.layer-highlight.active {
	opacity: 1;
	left: -250px;
}

.highlight-arrow {
	width: 150px;
	height: 2px;
	background: linear-gradient(90deg, #ff6b35 0%, #f7931e 100%);
	position: relative;
	margin-bottom: 10px;
}

.highlight-arrow::after {
	content: '';
	position: absolute;
	right: -10px;
	top: -5px;
	width: 0;
	height: 0;
	border-left: 12px solid #f7931e;
	border-top: 6px solid transparent;
	border-bottom: 6px solid transparent;
}

.highlight-text {
	background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
	color: white;
	padding: 8px 16px;
	border-radius: 20px;
	font-size: 14px;
	font-weight: 600;
	text-align: center;
	box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
	white-space: nowrap;
}

.layer-content {
	width: 100%;
	height: 100%;
	position: relative;
	border-radius: inherit;
	box-shadow: 
		0 15px 35px rgba(0, 0, 0, 0.2),
		0 5px 15px rgba(0, 0, 0, 0.1);
	backdrop-filter: blur(10px);
	border: 1px solid rgba(255, 255, 255, 0.2);
	background-clip: padding-box;
	transform-style: preserve-3d;
}

/* Signature Panel */
.signature-panel {
	background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
	border: 1px solid rgba(0, 0, 0, 0.1);
	box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.signature-strip {
	position: absolute;
	bottom: 20px;
	left: 20px;
	right: 60px;
	height: 30px;
	background: linear-gradient(90deg, #666 0%, #999 100%);
	border-radius: 4px;
}

/* Magnetic Strip Layer */
.magnetic-overlay {
	background: rgba(255, 255, 255, 0.8);
	backdrop-filter: blur(5px);
	border: 1px solid rgba(0, 0, 0, 0.1);
}

.magnetic-strip {
	position: absolute;
	top: 20px;
	left: 0;
	right: 0;
	height: 40px;
	background: linear-gradient(90deg, var(--magnetic-brown) 0%, #654321 100%);
}

/* Layer 1: Complete Assembled Card - Final card appearance */
.complete-card-layer {
	width: var(--w) !important;
	height: var(--h) !important;
	background: 
		linear-gradient(rgba(15, 15, 25, 0.4), rgba(25, 20, 35, 0.4)),
		url('assets/background-card.png');
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	color: white;
	border: 2px solid rgba(255, 255, 255, 0.2);
	box-shadow: 
		0 15px 40px rgba(0, 0, 0, 0.7),
		0 8px 25px rgba(0, 0, 0, 0.5),
		inset 0 2px 0 rgba(255, 255, 255, 0.1),
		inset 0 -2px 0 rgba(0, 0, 0, 0.3);
	backdrop-filter: blur(3px);
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	padding: 25px;
}

/* Layer 2: Chip & Number Layer - Shows EMV chip and card number */
.chip-number-layer {
	width: var(--w) !important;
	height: var(--h) !important;
	background: 
		linear-gradient(rgba(25, 20, 5, 0.15), rgba(35, 30, 10, 0.15)),
		url('assets/background-card.png');
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	color: white;
	border: 2px solid rgba(255, 215, 0, 0.2);
	box-shadow: 
		0 14px 40px rgba(50, 25, 0, 0.25),
		0 7px 25px rgba(0, 0, 0, 0.15),
		inset 0 2px 0 rgba(255, 215, 0, 0.1),
		inset 0 -2px 0 rgba(0, 0, 0, 0.1);
	backdrop-filter: blur(12px);
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	padding: 25px;
	opacity: 1;
}

/* Layer 3: Date & Name Layer - Shows expiry date and cardholder name */
.date-name-layer {
	width: var(--w) !important;
	height: var(--h) !important;
	background: 
		linear-gradient(rgba(10, 25, 15, 0.2), rgba(15, 35, 20, 0.2)),
		url('assets/background-card.png');
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	color: white;
	border: 2px solid rgba(100, 255, 150, 0.2);
	box-shadow: 
		0 15px 40px rgba(0, 50, 25, 0.3),
		0 8px 25px rgba(0, 0, 0, 0.2),
		inset 0 2px 0 rgba(100, 255, 150, 0.08),
		inset 0 -2px 0 rgba(0, 0, 0, 0.15);
	backdrop-filter: blur(8px);
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	padding: 25px;
	opacity: 1;
}

/* Layer 4: Base Layer - Shows Mesh branding and basic structure */
.base-layer {
	width: var(--w) !important;
	height: var(--h) !important;
	background: 
		linear-gradient(rgba(15, 15, 25, 0.1), rgba(25, 20, 35, 0.1)),
		url('assets/background-card.png');
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	color: white;
	border: 0px solid rgba(255, 255, 255, 0.1);
	box-shadow: 
		0 15px 40px rgba(0, 0, 0, 0.2),
		0 8px 25px rgba(0, 0, 0, 0.1),
		inset 0 2px 0 rgba(255, 255, 255, 0.05),
		inset 0 -2px 0 rgba(0, 0, 0, 0.1);
	backdrop-filter: blur(15px);
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	padding: 25px;
	opacity: 1;
}

/* Universal card element styles for all layers */
.card-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	margin-bottom: 15px;
}

.card-main {
	margin: 20px 0;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
}

.card-footer {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	margin-top: auto;
}

/* Mesh branding */
.brand-logo {
	font-size: 28px;
	font-weight: 900;
	color: white;
	text-shadow: 
		0 4px 8px rgba(0, 0, 0, 0.9),
		0 2px 4px rgba(0, 0, 0, 0.7),
		0 0 15px rgba(255, 255, 255, 0.3);
	letter-spacing: 2px;
}

.bank-name {
	font-size: 14px;
	color: rgba(255, 255, 255, 0.9);
	font-weight: 600;
	text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
	letter-spacing: 1px;
}

/* Card number display */
.card-number {
	font-size: 22px;
	font-weight: 700;
	letter-spacing: 4px;
	color: white;
	text-shadow: 
		0 4px 8px rgba(0, 0, 0, 0.9),
		0 2px 4px rgba(0, 0, 0, 0.7),
		0 0 15px rgba(255, 255, 255, 0.3);
	font-family: 'Courier New', monospace;
	margin: 0px;
}

/* Validity date styling */
.validity {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
}

.validity .label {
	font-size: 8px;
	color: rgba(255, 255, 255, 0.8);
	line-height: 1.2;
	margin-bottom: 6px;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
	font-weight: 600;
	letter-spacing: 1px;
}

.validity .date {
	font-size: 14px;
	font-weight: 700;
	color: white;
	text-shadow: 
		0 3px 6px rgba(0, 0, 0, 0.9),
		0 1px 3px rgba(0, 0, 0, 0.7),
		0 0 10px rgba(255, 255, 255, 0.3);
}

/* Cardholder name */
.cardholder-name {
	font-size: 16px;
	font-weight: 700;
	color: white;
	text-shadow: 
		0 3px 6px rgba(0, 0, 0, 0.9),
		0 1px 3px rgba(0, 0, 0, 0.7),
		0 0 12px rgba(255, 255, 255, 0.4);
	letter-spacing: 1.5px;
}

/* VISA payment network logo */
.payment-network {
	background: white;
	color: #1e40af;
	padding: 6px 12px;
	border-radius: 4px;
	font-weight: 800;
	font-size: 14px;
	letter-spacing: 1px;
}

/* EMV Chip Styling - Enhanced */
.emv-chip {
	position: relative;
	width: 52px;
	height: 40px;
	background: linear-gradient(135deg, #ffd700 0%, #ffed4e 50%, #ff8c00 100%);
	border-radius: 8px;
	margin-bottom: 10px;
	margin-top: 10px;
	box-shadow: 
		0 4px 12px rgba(0, 0, 0, 0.4),
		0 2px 8px rgba(255, 215, 0, 0.6),
		inset 0 2px 0 rgba(255, 255, 255, 0.4),
		inset 0 -2px 0 rgba(0, 0, 0, 0.3);
	filter: url(#metallic-shine);
	border: 1px solid #e6c200;
}

.chip-contacts {
	width: 53px;
	height: auto;
	border-radius: 6px;
	display: block;
}


/* Transparent Overlay */
.transparent-overlay {
	background: rgba(255, 255, 255, 0.2);
	backdrop-filter: blur(2px);
	border: 1px solid rgba(200, 200, 200, 0.2);
}

.overlay-shine {
	position: absolute;
	inset: 0;
	background: linear-gradient(45deg, 
		transparent 0%, 
		rgba(255,255,255,0.1) 30%, 
		rgba(255,255,255,0.2) 50%, 
		rgba(255,255,255,0.1) 70%, 
		transparent 100%);
	animation: shine 3s ease-in-out infinite;
}

/* Remove old chip layer styles - now handled by individual layer classes */



/* Layer Labels */
.layer-label {
	position: absolute;
	right: -250px;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(255, 255, 255, 0.95);
	padding: 15px 20px;
	border-radius: 10px;
	box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
	opacity: 0;
	animation: show-labels 1s 6.5s ease-out forwards;
	min-width: 220px;
}

.layer-label h3 {
	margin: 0 0 6px 0;
	font-size: 16px;
	color: #2c3e50;
	font-weight: 600;
}

.layer-label p {
	margin: 0;
	font-size: 13px;
	color: #7f8c8d;
	font-weight: 400;
}

/* Animations */
@keyframes angle {
	0% {
		--rtY: 50deg;
		--rtX: 5deg;
	}
	100% {
		--rtY: -50deg;
		--rtX: -5deg;
	}
}  

@keyframes explode-complete {
	0% {
		--space: 0px;
		--xOffset: 0px;
		--yOffset: 0px;
	}
	100% {
		--space: 400px;
		--xOffset: 60px;
		--yOffset: 45px;
	}
}

@keyframes space {
	0% {
		--space: 0px;
	}
	100% {
		--space: 400px;
	}
}

@keyframes explode-layers {
	0% {
		--space: 0px;
	}
	100% {
		--space: var(--layer-spacing);
	}
}

@keyframes show-labels {
	0% {
		opacity: 0;
		transform: translateY(-50%) translateX(-20px);
	}
	100% {
		opacity: 1;
		transform: translateY(-50%) translateX(0);
	}
}

@keyframes shine {
	0%, 100% {
		transform: translateX(-100%) skewX(-15deg);
	}
	50% {
		transform: translateX(200%) skewX(-15deg);
	}
}

/* Responsive Design */
@media (max-width: 1200px) {
	:root {
		--w: 350px;
		--h: 220px;
		--layer-spacing: 500px;
	}
	

	
	.layer-label {
		right: -220px;
		padding: 13px 18px;
		min-width: 200px;
	}
	
	.callout-label {
		right: 150px;
		min-width: 150px;
		padding: 13px 18px;
	}
}

@media (max-width: 768px) {
	:root {
		--w: 300px;
		--h: 190px;
		--layer-spacing: 400px;
	}
	

	
	.layer-label {
		right: -160px;
		font-size: 12px;
		padding: 10px 14px;
		min-width: 150px;
	}
	
	.layer-label h3 {
		font-size: 13px;
	}
	
	.layer-label p {
		font-size: 11px;
	}
	
	.callout {
		right: 3%;
	}
	
	.callout-line {
		width: 80px;
	}
	
	.callout-arrow {
		right: 77px;
		border-left: 8px solid white;
		border-top: 6px solid transparent;
		border-bottom: 6px solid transparent;
	}
	
	.callout-label {
		right: 100px;
		min-width: 130px;
		padding: 10px 14px;
	}
	
	.callout-label h4 {
		font-size: 13px;
	}
	
	.callout-label p {
		font-size: 11px;
	}
	
	.card-number {
		font-size: 22px;
		letter-spacing: 3px;
	}
	
	.card-brand {
		font-size: 18px;
	}
	
	.card-details {
		font-size: 13px;
	}
	
	.emv-chip {
		width: 28px;
		height: 22px;
		top: 35px;
		left: 35px;
	}
	
	.scene {
		padding-top: 60px;
	}
}

@media (max-width: 480px) {
	:root {
		--w: 280px;
		--h: 175px;
		--layer-spacing: 350px;
	}
	
	body {
		perspective: 1800px;
		perspective-origin: 50% 15%;
	}
	
	.scene {
		padding-top: 40px;
	}
	
	.layer-label {
		right: -130px;
		padding: 8px 12px;
		min-width: 120px;
	}
	
	.layer-label h3 {
		font-size: 12px;
	}
	
	.layer-label p {
		font-size: 10px;
	}
	
	.callout {
		right: 2%;
	}
	
	.callout-line {
		width: 60px;
	}
	
	.callout-arrow {
		right: 57px;
		border-left: 6px solid white;
		border-top: 5px solid transparent;
		border-bottom: 5px solid transparent;
	}
	
	.callout-label {
		right: 75px;
		min-width: 110px;
		padding: 8px 12px;
	}
	
	.callout-label h4 {
		font-size: 12px;
	}
	
	.callout-label p {
		font-size: 10px;
	}
	
	.front-printed {
		padding: 18px;
	}
	
	.card-number {
		font-size: 18px;
		letter-spacing: 2px;
		margin: 15px 0;
	}
	
	.card-brand {
		font-size: 16px;
	}
	
	.card-details {
		font-size: 12px;
	}
	
	.emv-chip {
		width: 24px;
		height: 18px;
		top: 25px;
		left: 25px;
	}
	
	.antenna-coil {
		width: 100px;
		height: 100px;
		border: 3px solid #ffffff;
		box-shadow: 
			inset 0 0 0 8px transparent,
			inset 0 0 0 11px #ffffff,
			inset 0 0 0 20px transparent,
			inset 0 0 0 23px #ffffff,
			0 0 15px rgba(255, 255, 255, 0.6);
	}
	
	.antenna-lines {
		width: 60px;
		height: 45px;
		top: 15px;
		right: 15px;
	}
}

/* Callout System */
.callout-system {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 100vw;
	height: 100vh;
	pointer-events: none;
	z-index: 2000;
}

.callout {
	position: absolute;
	right: 10%;
	opacity: 0;
	transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
	pointer-events: none;
}

.callout.active {
	opacity: 1;
}

.callout[data-layer="1"] {
	top: 15%;
}

.callout[data-layer="2"] {
	top: 35%;
}

.callout[data-layer="3"] {
	top: 55%;
}

.callout[data-layer="4"] {
	top: 75%;
}

.callout-line {
	position: absolute;
	right: 0;
	top: 50%;
	width: 150px;
	height: 3px;
	background: linear-gradient(90deg, white 0%, rgba(255,255,255,0.9) 80%, transparent 100%);
	transform: translateY(-50%);
	border-radius: 2px;
	box-shadow: 
		0 0 15px rgba(255, 255, 255, 0.4),
		0 0 30px rgba(255, 255, 255, 0.2);
}

.callout-arrow {
	position: absolute;
	right: 147px;
	top: 50%;
	width: 0;
	height: 0;
	border-left: 10px solid white;
	border-top: 8px solid transparent;
	border-bottom: 8px solid transparent;
	transform: translateY(-50%);
	filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.4));
}

.callout-label {
	position: absolute;
	right: 170px;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(255, 255, 255, 0.95);
	padding: 15px 20px;
	border-radius: 10px;
	min-width: 160px;
	border: 2px solid white;
	box-shadow: 
		0 6px 25px rgba(0, 0, 0, 0.18),
		0 0 0 1px rgba(255, 255, 255, 0.1);
	backdrop-filter: blur(12px);
}

.callout-label h4 {
	font-family: 'Arial', sans-serif;
	font-size: 16px;
	font-weight: 600;
	color: #333;
	margin: 0 0 6px 0;
	text-align: left;
}

.callout-label p {
	font-family: 'Arial', sans-serif;
	font-size: 13px;
	color: #666;
	margin: 0;
	text-align: left;
}

/* Responsive adjustments for callouts */
@media (max-width: 1200px) {
	.callout-line {
		width: 130px;
	}
	
	.callout-arrow {
		right: 127px;
	}
	
	.callout-label {
		right: 150px;
	}
}