:root {
	--bg-color: #000000;
	--text-color: #d3d3d3;
	--primary-color: #ffffff;
	--secondary-color: #ff00ff;
	--accent-color: #00ffff;
	--glitch-color-1: var(--secondary-color);
	--glitch-color-2: var(--accent-color);
	--font-main: Arial, sans-serif;
	--gap: 20px;
	--radius: 4px;
	--border-color: #333;
	--surface: #111;
	--surface-2: #222;
}

body {
	font-family: var(--font-main);
	background-color: var(--bg-color);
	color: var(--text-color);
	margin: 0;
	padding: 0;
	overflow-x: hidden;
	line-height: 1.5;
}

.shell {
	max-width: 800px;
	margin: 0 auto;
	padding: 20px;
	position: relative;
	z-index: 10;
}

/* Password Protection Overlay */
#password-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	background-color: var(--bg-color);
	z-index: 10000;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	color: var(--primary-color);
	font-family: var(--font-main);
}

#password-overlay h2 {
	font-size: 2rem;
	margin-bottom: 2rem;
	text-transform: uppercase;
}

#password-overlay input {
	background: transparent;
	border: 2px solid var(--primary-color);
	color: var(--primary-color);
	padding: 15px;
	font-size: 2rem;
	text-align: center;
	margin-top: 20px;
	width: 200px;
	letter-spacing: 10px;
	border-radius: var(--radius);
	outline: none;
	box-shadow: 0 0 15px var(--primary-color);
}

#password-overlay .error-msg {
	color: #ff0000;
	margin-top: 20px;
	height: 30px;
	font-size: 1.2rem;
	text-shadow: 0 0 5px #ff0000;
}

body.locked {
	overflow: hidden;
}

body.locked #app,
body.locked header,
body.locked footer {
	/* filter: blur(10px); */
	/* opacity: 0.1; */
	/* Alternatively, just hide them implicitly by the overlay being on top. 
       But blurring might look cool. */
}

/* Header */
.site-header {
	display: flex;
	justify-content: center;
	padding-top: 20px;
}

.logo-container {
	position: relative;
	display: inline-block;
	cursor: pointer;
	width: 300px;
	height: 300px;
}

.logo {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	display: block;
	position: relative;
	z-index: 2;
	opacity: 0; /* Hidden initially, shown by animation */
}

/* Click Animation */
.logo-container.glitch-click .logo {
	animation: glitch-click-main 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.logo-container.glitch-click .logo-glitch {
	opacity: 1;
}

.logo-container.glitch-click .logo-glitch-1 {
	animation: glitch-click-1 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.logo-container.glitch-click .logo-glitch-2 {
	animation: glitch-click-2 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

@keyframes glitch-click-main {
	0% {
		transform: translate(0);
	}
	20% {
		transform: translate(-2px, 2px);
	}
	40% {
		transform: translate(-2px, -2px);
	}
	60% {
		transform: translate(2px, 2px);
	}
	80% {
		transform: translate(2px, -2px);
	}
	100% {
		transform: translate(0);
	}
}

@keyframes glitch-click-1 {
	0% {
		clip-path: inset(20% 0 80% 0);
		transform: translate(-4px, 0);
	}
	20% {
		clip-path: inset(60% 0 10% 0);
		transform: translate(4px, 0);
	}
	40% {
		clip-path: inset(40% 0 50% 0);
		transform: translate(-4px, 0);
	}
	60% {
		clip-path: inset(80% 0 5% 0);
		transform: translate(4px, 0);
	}
	80% {
		clip-path: inset(10% 0 70% 0);
		transform: translate(-4px, 0);
	}
	100% {
		clip-path: inset(0 0 0 0);
		transform: translate(0, 0);
	}
}

@keyframes glitch-click-2 {
	0% {
		clip-path: inset(10% 0 60% 0);
		transform: translate(4px, 0);
	}
	20% {
		clip-path: inset(30% 0 20% 0);
		transform: translate(-4px, 0);
	}
	40% {
		clip-path: inset(10% 0 80% 0);
		transform: translate(4px, 0);
	}
	60% {
		clip-path: inset(70% 0 10% 0);
		transform: translate(-4px, 0);
	}
	80% {
		clip-path: inset(50% 0 30% 0);
		transform: translate(4px, 0);
	}
	100% {
		clip-path: inset(0 0 0 0);
		transform: translate(0, 0);
	}
}

/* Album Title */
.album-title {
	text-align: center;
	font-size: 2.5rem;
	font-weight: bold;
	margin: 40px 0;
	text-transform: uppercase;
	letter-spacing: 2px;
	color: #fff;
	user-select: none;
	pointer-events: none;
}

/* Track List */
.track-list {
	list-style: none;
	padding: 0;
	margin: 0 0 60px 0;
}

.track-item {
	display: block;
	padding: 0;
	border-bottom: 1px solid #333;
	transition: border-bottom-color 0.3s ease;
}

.track-item:hover {
	border-bottom-color: #fff;
}

.track-row {
	display: flex;
	justify-content: space-between;
	align-items: stretch;
	position: relative;
	overflow: hidden;
	padding: 15px 0;
	cursor: pointer;
}

.track-info,
.track-actions {
	position: relative;
	z-index: 2;
}

.track-actions {
	display: flex;
	align-items: center;
}

.pixel-rain {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	z-index: 1;
	display: none;
}

.track-row:hover .pixel-rain {
	display: block;
}

.rain-drop {
	position: absolute;
	top: -100%;
	width: 1px;
	background: linear-gradient(
		to bottom,
		transparent,
		rgba(255, 255, 255, 0.8)
	);
	animation: rain-fall linear infinite;
}

@keyframes rain-fall {
	0% {
		top: -50px;
	}
	100% {
		top: 100%;
	}
}

.track-embed {
	margin-top: 15px;
	border: 1px solid #333;
}

.track-info {
	flex-grow: 1;
	display: flex;
	align-items: center;
	text-decoration: none;
	color: inherit;
}

.track-number {
	margin-right: 15px;
	color: #666;
	font-family: monospace;
	min-width: 25px;
	position: relative;
}

.track-title {
	font-size: 1.1rem;
	font-weight: bold;
	color: #e0e0e0;
	transition: color 0.2s;
	position: relative;
	display: inline-block;
}

/* Hover glitch effect for song titles and numbers */
.track-row:hover .track-title,
.track-row:hover .track-number {
	text-shadow: 0 0 14px rgba(0, 255, 255, 0.12);
	color: #fff;
}

.track-row:hover .track-number::before,
.track-row:hover .track-number::after {
	content: attr(data-text);
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
}

.track-row:hover .track-number::before {
	opacity: 0.4;
	text-shadow: -2px 0 var(--primary-color);
	transform: translate(1px, -1px);
	clip-path: inset(0 0 80% 0);
	animation: song-hover-glitch-1 680ms infinite steps(2, end);
}

.track-row:hover .track-number::after {
	opacity: 0.4;
	text-shadow: 2px 0 var(--accent-color);
	transform: translate(-1px, 1px);
	clip-path: inset(55% 0 10% 0);
	animation: song-hover-glitch-2 520ms infinite steps(2, end);
}

.track-actions {
	display: flex;
	gap: 10px;
}

.btn {
	background: transparent;
	border: 1px solid #555;
	color: #aaa;
	padding: 5px 10px;
	font-size: 0.75rem;
	cursor: pointer;
	text-decoration: none;
	font-family: var(--font-main);
	transition: all 0.2s;
	text-transform: uppercase;
	display: inline-block;
}

.btn:hover {
	border-color: #fff;
	color: #fff;
	background: #222;
}

.btn-download {
	border-color: #444;
	color: #888;
}

.btn-download:hover {
	border-color: var(--accent-color);
	color: var(--accent-color);
}

.btn-video {
	border-color: #444;
	color: #888;
}

.btn-video:hover {
	border-color: #ff0000;
	color: #ff0000;
}

/* Gallery */
.gallery-container {
	width: 100%;
	overflow: hidden;
	padding: 20px 0; /* Reduced padding */
	position: relative;
	white-space: nowrap;
	display: flex;
	align-items: center; /* Center items vertically */
	-webkit-mask-image: linear-gradient(
		to right,
		transparent 0%,
		black 10%,
		black 90%,
		transparent 100%
	);
	mask-image: linear-gradient(
		to right,
		transparent 0%,
		black 10%,
		black 90%,
		transparent 100%
	);
}

.gallery {
	display: flex;
	align-items: center;
	gap: 0; /* Gap handled by scaling down */
	overflow-x: hidden; /* Hide scrollbar but allow scrolling via JS */
	padding: 0; /* Removed large padding */
	height: 400px; /* Ensure enough height for scaled items */
	width: 100%;
}

.gallery-item {
	--base-size: 320px;
	--scale: 1;

	width: var(--base-size);
	height: var(--base-size);
	flex-shrink: 0;

	/* Scale the item */
	transform: scale(var(--scale));

	/* Fixed margin for stability */
	margin: 0;

	cursor: pointer;
	border: 1px solid transparent;
	transform-origin: center center;
	will-change: transform;
	z-index: calc(var(--scale) * 100);
}

.gallery-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.gallery-item:hover {
	border-color: #fff;
	box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
	z-index: 100;
}

@media (max-width: 768px) {
	.gallery {
		height: 260px;
	}

	.gallery-item {
		--base-size: 220px;
	}
}

/* Background Layer */
.background-layer {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: -1;
	background-size: cover;
	background-position: center;
	filter: blur(8px) grayscale(80%) brightness(0.4);
	transition: background-image 1s ease-in-out;
}

/* Glitch Effect */
.glitch {
	position: relative;
	color: #fff;
}

.glitch::before,
.glitch::after {
	content: attr(data-text);
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: var(--bg-color);
}

.glitch::before {
	left: 2px;
	text-shadow: -1px 0 var(--glitch-color-1);
	clip: rect(24px, 550px, 90px, 0);
	animation: glitch-anim-1 2.5s infinite linear alternate-reverse;
}

.glitch::after {
	left: -2px;
	text-shadow: -1px 0 var(--glitch-color-2);
	clip: rect(85px, 550px, 140px, 0);
	animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
	0% {
		clip: rect(20px, 9999px, 15px, 0);
	}
	20% {
		clip: rect(60px, 9999px, 10px, 0);
	}
	40% {
		clip: rect(10px, 9999px, 80px, 0);
	}
	60% {
		clip: rect(90px, 9999px, 20px, 0);
	}
	80% {
		clip: rect(30px, 9999px, 100px, 0);
	}
	100% {
		clip: rect(70px, 9999px, 50px, 0);
	}
}

@keyframes glitch-anim-2 {
	0% {
		clip: rect(90px, 9999px, 10px, 0);
	}
	20% {
		clip: rect(60px, 9999px, 10px, 0);
	}
	40% {
		clip: rect(10px, 9999px, 80px, 0);
	}
	60% {
		clip: rect(90px, 9999px, 20px, 0);
	}
	80% {
		clip: rect(30px, 9999px, 100px, 0);
	}
	100% {
		clip: rect(70px, 9999px, 50px, 0);
	}
}

@keyframes song-hover-glitch-1 {
	0% {
		clip-path: inset(0 0 78% 0);
		transform: translate(1px, -1px);
	}
	20% {
		clip-path: inset(14% 0 62% 0);
		transform: translate(-1px, 0);
	}
	40% {
		clip-path: inset(42% 0 38% 0);
		transform: translate(2px, -1px);
	}
	60% {
		clip-path: inset(64% 0 18% 0);
		transform: translate(-2px, 1px);
	}
	80% {
		clip-path: inset(22% 0 66% 0);
		transform: translate(1px, 0);
	}
	100% {
		clip-path: inset(4% 0 74% 0);
		transform: translate(0, 0);
	}
}

@keyframes song-hover-glitch-2 {
	0% {
		clip-path: inset(58% 0 12% 0);
		transform: translate(-1px, 1px);
	}
	25% {
		clip-path: inset(8% 0 72% 0);
		transform: translate(2px, 0);
	}
	50% {
		clip-path: inset(30% 0 45% 0);
		transform: translate(-2px, -1px);
	}
	75% {
		clip-path: inset(70% 0 8% 0);
		transform: translate(1px, 1px);
	}
	100% {
		clip-path: inset(44% 0 28% 0);
		transform: translate(0, 0);
	}
}

/* Congestion Toast */
.congestion-toast {
	position: fixed;
	bottom: 20px;
	right: 20px;
	background: #111;
	border: 1px solid var(--secondary-color);
	padding: 16px 24px;
	border-radius: var(--radius);
	box-shadow: 0 0 20px rgba(255, 0, 255, 0.2);
	z-index: 9999;
	display: flex;
	align-items: flex-start;
	gap: 16px;
	animation: slide-in 0.3s ease-out;
	max-width: 350px;
}

.congestion-toast-content h3 {
	color: var(--secondary-color);
	margin: 0 0 4px 0;
	font-size: 1rem;
	text-transform: uppercase;
	letter-spacing: 1px;
	font-family: var(--font-main);
}

.congestion-toast-content p {
	color: var(--text-color);
	margin: 0;
	font-size: 0.9rem;
}

.congestion-toast-close {
	background: transparent;
	border: none;
	color: var(--muted-color);
	font-size: 1.5rem;
	cursor: pointer;
	padding: 0;
	line-height: 0.8;
	transition: color 0.2s;
	margin-top: -4px;
}

.congestion-toast-close:hover {
	color: var(--text-color);
}

@keyframes slide-in {
	from {
		transform: translateX(100%);
		opacity: 0;
	}
	to {
		transform: translateX(0);
		opacity: 1;
	}
}

/* Page Description */
.page-description {
	text-align: center;
	margin: 10px auto;
	max-width: 600px;
	color: #aaa;
	font-size: 1.1rem;
	line-height: 1.6;
}

/* Footer */
.site-footer {
	text-align: center;
	padding: 40px 20px;
	color: #666;
	font-size: 0.9rem;
	position: relative;
	z-index: 10;
	border-top: 1px solid #222;
	margin-top: 40px;
	opacity: 0; /* Hidden initially for animation */
}

.site-footer p {
	margin: 5px 0;
}

.credits {
	color: #444;
	font-size: 0.8rem;
	margin-top: 10px;
}

/* Page Load Animation */
@keyframes dropInFade {
	from {
		opacity: 0;
		transform: translateY(-20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.animate-on-load {
	opacity: 0; /* Start hidden */
	animation: dropInFade 0.6s ease-out forwards;
}
