:root {
	/* Theme Colors aligned with Tailwind Config */
	--color-forge-black: #000000;
	--color-forge-dark: #050505;
	--color-forge-card: rgba(10, 10, 10, 0.8);
	--color-forge-border: #333333;
	--color-forge-text: #F0F0F0;
	--color-forge-muted: #888888;
	--color-forge-accent: #FFFFFF;

	/* Cursor tracking */
	--cursor-x: 50%;
	--cursor-y: 50%;
}

/* Base Settings */
html {
	scroll-behavior: smooth;
}

* {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	box-sizing: border-box;
}

body {
	font-family: 'Inter', sans-serif;
	font-size: 16px;
	line-height: 1.6;
	/* Fallback background if Tailwind fails or for overscroll */
	background-color: var(--color-forge-black);
	color: var(--color-forge-text);
	overflow-x: hidden;
	text-rendering: optimizeLegibility;
}

::selection {
	background: rgba(255, 255, 255, 0.2);
	color: #FFFFFF;
}

/* Typography improvements for readability */
h1,
h2,
h3,
h4,
h5,
h6 {
	line-height: 1.2;
	letter-spacing: -0.02em;
}

p {
	line-height: 1.7;
}

/* Advanced Grid Background */
.grid-bg {
	background-size: 40px 40px;
	background-image:
		linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
		linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
	mask-image: radial-gradient(circle at 50% 50%, black 60%, transparent 100%);
	-webkit-mask-image: radial-gradient(circle at 50% 50%, black 60%, transparent 100%);
	/* Performance optimization */
	will-change: transform;
}

/* Spotlight Effect */
.spotlight-card {
	position: relative;
	overflow: hidden;
	background: rgba(5, 5, 5, 0.6);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border: 1px solid transparent;
	/* Prepare for border transition */
}

/* Only apply hover effects on devices that support hover */
@media (hover: hover) {
	.spotlight-card::before {
		content: '';
		position: absolute;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		background: radial-gradient(600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
				rgba(255, 255, 255, 0.04),
				transparent 50%);
		z-index: 1;
		opacity: 0;
		transition: opacity 0.2s ease;
		pointer-events: none;
		will-change: opacity;
	}

	.spotlight-card:hover::before {
		opacity: 1;
	}

	.spotlight-card::after {
		content: '';
		position: absolute;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		background: radial-gradient(400px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
				rgba(255, 255, 255, 0.08),
				transparent 50%);
		z-index: 3;
		opacity: 0;
		transition: opacity 0.2s ease;
		pointer-events: none;
		border-radius: inherit;
		mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
		-webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
		mask-composite: exclude;
		-webkit-mask-composite: xor;
		padding: 1px;
		will-change: opacity;
	}

	.spotlight-card:hover::after {
		opacity: 1;
	}
}

/* Minimalist Scrollbar */
/* Firefox */
* {
	scrollbar-width: thin;
	scrollbar-color: #1E293B #020408;
}

/* Webkit */
::-webkit-scrollbar {
	width: 6px;
}

::-webkit-scrollbar-track {
	background: #020408;
}

::-webkit-scrollbar-thumb {
	background: #1E293B;
	border-radius: 3px;
	transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
	background: #666666;
}

/* Fade-in animations - Optimized for speed */
.fade-in-up {
	opacity: 0;
	transform: translateY(10px);
	transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
	will-change: opacity, transform;
}

.fade-in-up.visible {
	opacity: 1;
	transform: translateY(0);
}

.screenshot-container {
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	border: 1px solid rgba(255, 255, 255, 0.1);
	box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05);
	cursor: pointer;
	position: relative;
}

.screenshot-container:hover {
	border-color: rgba(255, 255, 255, 0.3);
	box-shadow: 0 0 20px rgba(255, 255, 255, 0.05);
}

/* Modal styles */
.modal {
	display: none;
	position: fixed;
	z-index: 9999;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(2, 4, 8, 0.95);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	opacity: 0;
	transition: opacity 0.2s ease-out;
}

.modal.active {
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 1;
}

.modal-content {
	max-width: 90%;
	max-height: 90%;
	position: relative;
	border: 1px solid #1E293B;
	box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
	border-radius: 4px;
	overflow: hidden;
	transform: scale(0.95);
	transition: transform 0.2s ease-out;
}

.modal.active .modal-content {
	transform: scale(1);
}

.modal-content img,
.modal-content video {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

.modal-close {
	position: absolute;
	top: -40px;
	right: 0;
	color: white;
	font-size: 24px;
	cursor: pointer;
	opacity: 0.7;
	transition: opacity 0.2s;
	z-index: 10000;
	padding: 8px;
	/* Increase touch target */
}

.modal-close:hover {
	opacity: 1;
	color: #FFFFFF;
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {

	*,
	::before,
	::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}

	.fade-in-up {
		transition: none;
		opacity: 1;
		transform: none;
	}
}