/* Layout */
*,
*::before,
*::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html {
	height: 100%;
}

:root {
	--font-mono: "JetBrains Mono", "Fira Code", monospace;
	--bg-dark: #020617;
	--text-main: #e2e8f0;
	--text-muted: #94a3b8;
	--accent: #22c55e; /* Terminal Green */
	--accent-hover: #4ade80;
	--border: #1e293b;
	--card-bg: #0f172a;
}

body {
	min-height: 100vh;
	font-family: var(--font-mono);
	background: radial-gradient(
		circle at 10% 0%,
		#111827 0,
		#020617 55%,
		#02030a 100%
	);
	background-attachment: fixed; /* Fix background scrolling issue */
	color: var(--text-main);
	-webkit-font-smoothing: antialiased;
}

a {
	color: inherit;
	text-decoration: none;
}

.page {
	min-height: 100vh;
	padding: 3.5rem min(7vw, 4.5rem) 2.5rem;
	display: grid;
	grid-template-columns: minmax(0, 1.6fr) minmax(0, 0.7fr);
	gap: 3.5rem;
	position: relative;
	/* overflow: hidden; Removed to allow sticking if needed, check if necessary */
}

/* =========================================
   MOON PRESERVATION (DO NOT TOUCH)
   ========================================= */
.page::before {
	content: "";
	position: absolute;
	top: clamp(-3rem, -10vh, -1rem);
	right: clamp(-4rem, -6vw, -1rem);
	width: clamp(150px, 18vw, 230px);
	height: clamp(150px, 18vw, 230px);
	border-radius: 50%;
	background: radial-gradient(
		circle at 30% 30%,
		#f9fafb 0,
		#e5e7eb 38%,
		#9ca3af 65%,
		#020617 100%
	);
	box-shadow: 0 0 40px rgba(248, 250, 252, 0.3),
		0 0 120px rgba(148, 163, 184, 0.35);
	opacity: 0.9;
	animation: float-moon 16s ease-in-out infinite;
	z-index: -1;
}

.page::after {
	content: "";
	position: absolute;
	top: clamp(1.5rem, 8vh, 3.5rem);
	right: clamp(2.5rem, 6vw, 5rem);
	width: clamp(80px, 10vw, 130px);
	height: clamp(80px, 10vw, 130px);
	border-radius: 50%;
	background: radial-gradient(
			circle at 40% 35%,
			rgba(15, 23, 42, 0.4) 0,
			transparent 55%
		),
		radial-gradient(
			circle at 70% 70%,
			rgba(15, 23, 42, 0.35) 0,
			transparent 58%
		);
	opacity: 0.55;
	filter: blur(1px);
	animation: float-moon 18s ease-in-out infinite reverse;
	z-index: -1;
}

@keyframes float-moon {
	0% {
		transform: translate3d(0, 0, 0) scale(1);
	}
	50% {
		transform: translate3d(-6px, 10px, 0) scale(1.02);
	}
	100% {
		transform: translate3d(0, 0, 0) scale(1);
	}
}

/* CRT Scanline Effect */
.scanlines {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	background: linear-gradient(
		rgba(18, 16, 16, 0) 50%,
		rgba(0, 0, 0, 0.25) 50%
	),
	linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
	background-size: 100% 2px, 3px 100%;
	z-index: 9999;
	pointer-events: none;
	opacity: 0.4;
	animation: flicker 0.15s infinite;
}

@keyframes flicker {
	0% { opacity: 0.4; }
	50% { opacity: 0.42; }
	100% { opacity: 0.4; }
}

/* Glassmorphism improvements for header */
.hero-header {
	position: relative;
	z-index: 1;
}

@media (min-width: 960px) {
	.page::before {
		top: -6rem;
		right: -5rem;
		width: 210px;
		height: 210px;
		opacity: 0.85;
	}
	.page::after {
		top: 0.5rem;
		right: 1.5rem;
		width: 130px;
		height: 130px;
	}
}
/* ========================================= */

/* Hero */
.hero-header {
	margin-bottom: 2.5rem;
}

.hero-name {
	font-weight: 700;
	font-size: clamp(2.3rem, 4vw, 2.8rem);
	line-height: 1.1;
	letter-spacing: -0.02em;
	color: var(--text-main);
}

.hero-role {
	margin-top: 0.8rem;
	font-size: 0.95rem;
	color: #64748b; /* Comment color */
	font-style: italic;
	min-height: 1.5em; /* Prevent layout shift */
	display: flex;
	align-items: center;
}

.typing-cursor {
	display: inline-block;
	color: var(--accent);
	margin-left: 4px;
	font-weight: bold;
	font-style: normal;
	animation: blink 1s step-end infinite;
}

.prompt {
	color: var(--accent);
	margin-right: 0.5rem;
	font-weight: bold;
	text-shadow: 0 0 10px rgba(34, 197, 94, 0.4); /* Glow effect */
}

/* Removed old .comment class as it's replaced by dynamic typing */
/* .comment { ... } */

.hero-text {
	max-width: 38rem;
	font-size: 0.95rem;
	line-height: 1.8;
	color: var(--text-main);
	display: grid;
	gap: 1.2rem;
	transition: opacity 0.25s ease;
}

.hero-text.is-switching {
	opacity: 0;
}

.highlight {
	color: var(--accent);
	background: rgba(34, 197, 94, 0.1);
	padding: 0 4px;
}

/* Links */
.hero-links {
	margin-top: 2.5rem;
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
}

.hero-link {
	background: rgba(255, 255, 255, 0.05);
	backdrop-filter: blur(5px);
	border: 1px solid rgba(255, 255, 255, 0.1);
	padding: 0.7rem 1.4rem;
	font-size: 0.85rem;
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	color: var(--text-muted);
	cursor: pointer;
	border-radius: 4px;
	position: relative;
	overflow: hidden;
}

.hero-link:hover {
	border-color: var(--accent);
	color: var(--accent);
	transform: translateY(-2px);
	background: rgba(34, 197, 94, 0.05);
	box-shadow: 0 0 20px rgba(34, 197, 94, 0.2);
}

.hero-link.highlight-btn {
	border-color: var(--accent);
	color: var(--accent);
	background: rgba(34, 197, 94, 0.08);
}

.hero-link.highlight-btn:hover {
	background: var(--accent);
	color: #000;
	box-shadow: 0 0 25px rgba(34, 197, 94, 0.5);
}

.hero-link-label {
	font-weight: 600;
	letter-spacing: 0.5px;
}

/* Side Nav */
.side {
	display: flex;
	flex-direction: column;
	/* Use full available height so we can position footer at bottom */
	height: 100%;
	/* Grid stretches it, but flex column needs controls */
	justify-content: space-between; 
	align-items: flex-end;
	gap: 2.5rem;
	z-index: 10;
}

.side-nav {
	/* Auto margins to center the nav vertically in the available space */
	margin-top: auto;
	margin-bottom: auto;
}

.side-nav ul {
	list-style: none;
	text-align: right;
}

.side-nav li + li {
	margin-top: 0.5rem;
}

.side-nav a {
	font-size: 1rem;
	color: var(--text-main);
	padding: 0.2rem 0;
	position: relative;
	transition: color 0.2s;
	/* mix-blend-mode removed for stability */
	font-weight: 600;
}

.side-nav a:hover,
.side-nav a.active {
	color: var(--accent);
	text-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}

.side-nav a.active::before {
	content: "> ";
	color: var(--accent);
}

/* Footer & Band */
.band {
	display: none; /* Content is loaded via JS */
}

.side-footer {
	text-align: right;
	font-size: 0.75rem;
	color: var(--text-muted);
	opacity: 0.6;
	padding-bottom: 0.5rem;
}

.blink {
	animation: blink 1s step-end infinite;
}

@keyframes blink {
	0%,
	100% {
		opacity: 1;
	}
	50% {
		opacity: 0;
	}
}

/* Band Titles & Lists (Injected Content) */
.band-title {
	font-size: 1rem;
	font-weight: 700;
	color: var(--accent);
	margin-bottom: 1rem;
	border-bottom: 1px dashed var(--border);
	padding-bottom: 0.5rem;
}

.band-list {
	list-style: none;
}

.band-list li {
	margin-bottom: 0.5rem;
	color: var(--text-main);
	display: flex;
	gap: 0.5rem;
}

.file-icon {
	color: var(--text-muted);
}

.link-list {
	list-style: none;
}

.link-list li {
	margin-bottom: 0.5rem;
}

.link-list a:hover {
	color: var(--accent);
	text-decoration: underline;
}

/* Disclaimer: Donate Modal Styles (Refined) */
.modal {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.8);
	z-index: 1000;
	opacity: 0;
	transition: opacity 0.3s ease;
	backdrop-filter: blur(5px);
	overflow-y: auto;
	padding: 1rem;
}

.modal.show {
	opacity: 1;
}

.modal-content {
	background-color: var(--card-bg);
	margin: 5% auto;
	padding: 2rem;
	width: 95%;
	max-width: 800px;
	border: 1px solid var(--border);
	position: relative;
	color: var(--text-main);
	box-shadow: 0 0 30px rgba(0, 0, 0, 0.7);
	transform: translateY(-20px);
	transition: transform 0.3s ease;
}

.modal.show .modal-content {
	transform: translateY(0);
}

.modal-header-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 2rem;
	border-bottom: 1px solid var(--border);
	padding-bottom: 1rem;
}

.modal-header-row h2 {
	font-size: 1.2rem;
	color: var(--text-main);
}

.close {
	font-size: 1.5rem;
	cursor: pointer;
	color: var(--text-muted);
}

.close:hover {
	color: var(--accent);
}

.donate-header p {
	color: var(--text-muted);
	margin-bottom: 2rem;
}

.donate-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 1.5rem;
}

.donate-card {
	background: rgba(255, 255, 255, 0.02);
	border: 1px solid var(--border);
	padding: 1.5rem;
	border-radius: 4px;
}

.donate-card.okx .card-head {
	color: #06b6d4;
}

.donate-card:hover {
	border-color: var(--accent);
}

.card-head {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-bottom: 1rem;
	color: var(--accent);
}

.code-pill {
	background: #000;
	border: 1px solid var(--border);
	padding: 0.5rem;
	margin-top: 0.5rem;
	font-size: 0.8rem;
	display: flex;
	justify-content: space-between;
	align-items: center;
	color: #a3a3a3;
	max-width: 100%;
}

.code-pill span {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	min-width: 0;
	margin-right: 0.5rem;
	flex: 1;
}

.copy-btn {
	background: none;
	border: none;
	color: var(--text-muted);
	cursor: pointer;
	padding: 0.2rem;
}

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

.network-select {
	width: 100%;
	background: #000;
	color: #fff;
	border: 1px solid var(--border);
	padding: 0.3rem;
	font-family: var(--font-mono);
}

.copy-toast {
	position: fixed;
	bottom: 2rem;
	left: 50%;
	transform: translateX(-50%);
	background: var(--accent);
	color: #000;
	padding: 0.5rem 1rem;
	border-radius: 4px;
	font-weight: bold;
	opacity: 0;
	transition: opacity 0.3s;
	pointer-events: none;
}

.copy-toast.show {
	opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 960px) {
	.page {
		grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.9fr);
	}
}

@media (max-width: 720px) {
	.page {
		grid-template-columns: 1fr;
		padding-top: 2rem;
	}
	.side {
		align-items: flex-start;
		margin-top: 0;
	}
	.side-nav ul {
		text-align: left;
	}
	.side-footer {
		text-align: left;
	}
}

@media (max-width: 540px) {
	.page {
		padding: 1.75rem 1.25rem 2.5rem;
		gap: 2rem;
	}
	.hero-links {
		flex-direction: column;
		align-items: stretch;
	}
	.hero-link {
		width: 100%;
		justify-content: space-between;
	}
	/* Optimized Modal Mobile */
	.modal-content {
		margin: 5% auto; /* Reduced from 12% */
		padding: 1rem; /* Reduced from 1.25rem */
		width: 92%;
	}
	.modal-header-row {
		flex-direction: row; /* Keep row for close button */
		justify-content: space-between;
		align-items: center;
		margin-bottom: 1rem;
		padding-bottom: 0.8rem;
	}
	.modal-header-row h2 {
		font-size: 1rem;
	}
	.donate-header p {
		font-size: 0.85rem;
		margin-bottom: 1.2rem;
	}
	.donate-grid {
		grid-template-columns: 1fr;
		gap: 1rem; /* Reduced gap */
	}
	.donate-card {
		padding: 1rem; /* Compact padding */
		min-width: 0; /* Critical for grid overflow fix */
	}
	.code-pill {
		font-size: 0.75rem; /* Smaller font for code */
		width: 100%; /* Force width containment */
	}
	.code-pill span {
		display: block; /* Ensure ellipsis works */
	}
}
