:root {
	--bg: #050308;
	--bg-soft: #0b0517;
	--card: #100720;
	--card-hover: #170a2e;
	--border: #230f40;
	--border-hover: #6b21a8;
	--text: #f3ebfc;
	--muted: #a78bfa;
	--accent: #9333ea;
	--accent-dim: rgba(147, 51, 234, 0.14);
	--accent-bright: #c084fc;
	--accent-glow: rgba(147, 51, 234, 0.35);
	--accent-2: #38bdf8;
	--accent-3: #f43f5e;
	--font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
	--font-sans: 'Outfit', system-ui, sans-serif;
	--max-w: 880px;
	--ease: cubic-bezier(0.16, 0.84, 0.44, 1);
}

* {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
	background-color: #050308;
}

body {
	margin: 0;
	background: transparent;
	color: var(--text);
	font-family: var(--font-sans);
	font-size: 16px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
	min-height: 100vh;
}

img {
	max-width: 100%;
}

[hidden] {
	display: none !important;
}

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

::selection {
	background: var(--accent-dim);
	color: var(--accent-bright);
}

a:focus-visible,
button:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 3px;
	border-radius: 6px;
}

/* Fixed Background Overlay Gradient */
.bg-gradient-overlay {
	position: fixed;
	top: -60vh;
	left: -50vw;
	width: 200vw;
	height: 220vh;
	z-index: 0;
	pointer-events: none;
	background-image: 
		radial-gradient(ellipse 120% 85% at 50% 25%, rgba(147, 51, 234, 0.22) 0%, rgba(107, 33, 168, 0.09) 45%, transparent 70%),
		radial-gradient(circle at 90% 90%, rgba(147, 51, 234, 0.07) 0%, transparent 50%);
}

/* Background Canvas */
#bg-canvas {
	position: fixed;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	width: 100%;
	height: 100%;
	opacity: 0.85;
}

/* CRT Scanlines Overlay */
.scanlines {
	position: fixed;
	inset: 0;
	z-index: 2;
	pointer-events: none;
	background: repeating-linear-gradient(
		0deg,
		rgba(255, 255, 255, 0.02) 0px,
		rgba(255, 255, 255, 0.02) 1px,
		transparent 1px,
		transparent 3px
	);
	mix-blend-mode: overlay;
	opacity: 0.5;
}

main {
	position: relative;
	z-index: 3;
}

/* Container */
.wrap {
	max-width: var(--max-w);
	margin: 0 auto;
	padding: 0 24px;
}

/* ---------- Hero Section ---------- */
.hero {
	min-height: 100svh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 80px 24px 32px;
}

.avatar-container {
	position: relative;
	width: 120px;
	height: 120px;
	margin: 0 auto 24px;
	display: flex;
	justify-content: center;
	align-items: center;
	opacity: 0;
	animation: fade-up 0.8s var(--ease) forwards;
}

.avatar-ring {
	position: relative;
	width: 120px;
	height: 120px;
	border-radius: 50%;
	display: flex;
	justify-content: center;
	align-items: center;
}

.avatar-img {
	width: 112px;
	height: 112px;
	border-radius: 50%;
	object-fit: cover;
	display: block;
	background: var(--bg-soft);
	border: 2px solid var(--accent-bright);
	box-shadow: 0 0 25px var(--accent-glow);
	transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
	z-index: 2;
}

.avatar-ring:hover .avatar-img {
	transform: scale(1.04);
	box-shadow: 0 0 35px rgba(168, 85, 247, 0.75);
}

.avatar-decoration-img {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 138px;
	height: 138px;
	max-width: none !important;
	aspect-ratio: 1 / 1;
	object-fit: contain;
	pointer-events: none;
	z-index: 4;
}

.eyebrow {
	font-family: var(--font-mono);
	font-size: 14px;
	color: var(--accent-bright);
	letter-spacing: 0.05em;
	margin: 0 0 16px;
	opacity: 0;
	animation: fade-up 0.7s 0.1s var(--ease) forwards;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
}

.hero h1 {
	font-family: var(--font-mono);
	font-weight: 700;
	font-size: clamp(3rem, 10vw, 6rem);
	line-height: 1;
	margin: 0 0 20px;
	letter-spacing: -0.02em;
	color: var(--text);
	text-shadow: 0 0 30px var(--accent-glow), 0 0 3px rgba(192, 132, 252, 0.5);
	opacity: 0;
	animation: fade-up 0.8s 0.2s var(--ease) forwards;
}

.hero h1 .cursor {
	display: inline-block;
	color: var(--accent-bright);
	animation: blink 1.1s steps(1) infinite;
}

.hero p {
	font-size: clamp(1rem, 2.2vw, 1.2rem);
	color: var(--muted);
	max-width: 52ch;
	margin: 0 0 36px;
	opacity: 0;
	animation: fade-up 0.8s 0.3s var(--ease) forwards;
}

.hero p .accent {
	color: var(--accent-bright);
	font-weight: 600;
}

/* Glitch Effect */
.glitch {
	position: relative;
	display: inline-block;
}

.glitch::before,
.glitch::after {
	content: attr(data-text);
	position: absolute;
	left: 0;
	top: 0;
	width: 100%;
	opacity: 0;
	pointer-events: none;
}

.glitch:hover::before {
	opacity: 0.8;
	color: var(--accent-2);
	clip-path: inset(0 0 55% 0);
	animation: glitch-1 0.4s steps(2, end) infinite;
}

.glitch:hover::after {
	opacity: 0.8;
	color: var(--accent-3);
	clip-path: inset(55% 0 0 0);
	animation: glitch-2 0.4s steps(2, end) infinite;
}

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

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

/* Call to Action Buttons */
.cta-row {
	display: flex;
	gap: 14px;
	flex-wrap: wrap;
	justify-content: center;
	opacity: 0;
	animation: fade-up 0.8s 0.4s var(--ease) forwards;
}

.btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-family: var(--font-mono);
	font-size: 15px;
	font-weight: 500;
	padding: 13px 22px;
	border-radius: 12px;
	border: 1px solid var(--border);
	cursor: pointer;
	transition: transform 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease);
	min-height: 46px;
}

.btn svg {
	width: 18px;
	height: 18px;
	flex: none;
}

.btn-primary {
	background: linear-gradient(135deg, var(--accent), #7c3aed);
	color: #ffffff;
	border-color: var(--accent-bright);
	box-shadow: 0 4px 20px -4px var(--accent-glow);
}

.btn-primary:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 30px -4px rgba(168, 85, 247, 0.6);
	background: linear-gradient(135deg, #b566f8, #8b5cf6);
}

.btn-secondary {
	background: rgba(19, 9, 39, 0.6);
	color: var(--text);
	backdrop-filter: blur(8px);
}

.btn-secondary:hover {
	border-color: var(--border-hover);
	transform: translateY(-2px);
	background: var(--bg-soft);
	box-shadow: 0 6px 20px -6px rgba(126, 34, 206, 0.3);
}

.scroll-cue {
	margin-top: 56px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	color: var(--muted);
	font-family: var(--font-mono);
	font-size: 12px;
	letter-spacing: 0.08em;
	opacity: 0;
	animation: fade-up 0.8s 0.5s var(--ease) forwards, float 2.4s 1.3s ease-in-out infinite;
}

.scroll-cue svg {
	width: 16px;
	height: 16px;
}

@keyframes fade-up {
	from { opacity: 0; transform: translateY(16px); }
	to { opacity: 1; transform: translateY(0); }
}

@keyframes float {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(6px); }
}

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

.type-cursor-inline {
	display: inline-block;
	width: 7px;
	height: 15px;
	background: var(--accent-bright);
	margin-left: 3px;
	vertical-align: middle;
	animation: blink 1s steps(1) infinite;
	transition: opacity 0.4s ease;
}

/* ---------- Scroll Reveal ---------- */
.reveal {
	opacity: 1;
	transform: none;
	transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

html.js-ready .reveal:not(.is-visible) {
	opacity: 0;
	transform: translateY(24px);
}

html.js-ready .reveal.is-visible {
	opacity: 1;
	transform: translateY(0);
}

section {
	padding: 32px 0;
}

.section-label {
	font-family: var(--font-mono);
	font-size: 13.5px;
	color: var(--accent-bright);
	margin: 0 0 18px;
	letter-spacing: 0.03em;
}

/* ---------- Terminal Component ---------- */
.terminal {
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.8), 0 0 20px -10px var(--accent-dim);
}

.terminal-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 18px;
	background: var(--bg-soft);
	border-bottom: 1px solid var(--border);
}

.window-buttons {
	display: flex;
	gap: 8px;
}

.btn-dot {
	width: 11px;
	height: 11px;
	border-radius: 50%;
}

.dot-red { background: #ef4444; }
.dot-yellow { background: #eab308; }
.dot-green { background: #22c55e; }

.terminal-title {
	font-family: var(--font-mono);
	font-size: 12px;
	color: var(--muted);
}

.terminal-body {
	padding: 24px 22px 28px;
	font-family: var(--font-mono);
	font-size: 14.5px;
	color: var(--text);
	white-space: pre-wrap;
	min-height: 150px;
}

.terminal-body .prompt {
	color: var(--accent-bright);
	font-weight: 500;
}

.terminal-body .out {
	color: #d8b4fe;
}

.type-cursor {
	display: inline-block;
	width: 8px;
	height: 16px;
	background: var(--accent-bright);
	vertical-align: middle;
	margin-left: 3px;
	animation: blink 1s steps(1) infinite;
}

/* ---------- Tech Stack Chips ---------- */
.skills-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-family: var(--font-mono);
	font-size: 13.5px;
	padding: 10px 18px;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: var(--card);
	color: var(--text);
	transition: border-color 0.3s var(--ease), transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.chip .dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--accent);
}

.chip:hover {
	border-color: var(--border-hover);
	transform: translateY(-2px);
	box-shadow: 0 8px 24px -10px var(--accent-glow);
}

/* ---------- Discord Lanyard Status Card ---------- */
.discord-card {
	display: flex;
	align-items: center;
	gap: 20px;
	padding: 22px 24px;
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: 14px;
	box-shadow: 0 15px 40px -20px rgba(0, 0, 0, 0.7);
}

.card-avatar-wrapper {
	position: relative;
	flex: none;
	width: 68px;
	height: 68px;
}

.card-avatar-wrapper img {
	width: 100%;
	height: 100%;
	border-radius: 50%;
	object-fit: cover;
}

.status-dot {
	position: absolute;
	bottom: 2px;
	right: 2px;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	border: 3px solid var(--card);
}

.status-dot.online { background: #22c55e; box-shadow: 0 0 10px #22c55e; }
.status-dot.dnd { background: #ef4444; box-shadow: 0 0 10px #ef4444; }
.status-dot.idle { background: #eab308; box-shadow: 0 0 10px #eab308; }
.status-dot.offline { background: #6b7280; }

.card-details {
	flex: 1;
	min-width: 0;
}

.card-user-row {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 6px;
}

.card-username {
	font-weight: 700;
	font-size: 18px;
	color: var(--text);
	cursor: pointer;
	transition: color 0.2s ease, opacity 0.12s ease;
}

.card-username:hover {
	color: var(--accent-bright);
}

.card-badges {
	display: flex;
	align-items: center;
	gap: 6px;
}

.badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 2px 8px;
	border-radius: 12px;
	font-size: 11px;
	font-family: var(--font-mono);
	font-weight: 600;
}

.pink-badge {
	background: rgba(236, 72, 153, 0.2);
	color: #f472b6;
	border: 1px solid rgba(236, 72, 153, 0.3);
}

.clan-badge-icon {
	width: 14px;
	height: 14px;
}

.legacy-badge-wrapper {
	position: relative;
	display: inline-block;
}

.legacy-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: rgba(168, 85, 247, 0.2);
	color: var(--accent-bright);
	font-size: 12px;
	font-weight: 700;
	cursor: help;
}

.legacy-tooltip-popup {
	display: none;
	position: absolute;
	bottom: 125%;
	left: 50%;
	transform: translateX(-50%);
	background: #180e30;
	border: 1px solid var(--border);
	padding: 8px 12px;
	border-radius: 8px;
	text-align: center;
	box-shadow: 0 10px 25px rgba(0, 0, 0, 0.7);
	white-space: nowrap;
	z-index: 10;
}

.legacy-badge-wrapper:hover .legacy-tooltip-popup {
	display: block;
}

.legacy-popup-title {
	font-size: 10px;
	color: var(--muted);
	font-family: var(--font-mono);
}

.legacy-popup-tag {
	font-size: 12px;
	font-weight: 600;
	color: var(--text);
}

.card-status-row {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	color: var(--muted);
}

.spotify-activity {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 10px;
	padding: 8px 12px;
	border-radius: 8px;
	background: rgba(34, 197, 94, 0.1);
	border: 1px solid rgba(34, 197, 94, 0.2);
}

.spotify-bars {
	display: flex;
	align-items: flex-end;
	gap: 2px;
	height: 14px;
}

.spotify-bars span {
	width: 3px;
	background: #22c55e;
	animation: bounce 1.2s ease-in-out infinite alternate;
}

.spotify-bars span:nth-child(1) { height: 60%; animation-delay: 0s; }
.spotify-bars span:nth-child(2) { height: 100%; animation-delay: 0.2s; }
.spotify-bars span:nth-child(3) { height: 40%; animation-delay: 0.4s; }

@keyframes bounce {
	0% { height: 20%; }
	100% { height: 100%; }
}

.spotify-info {
	display: flex;
	flex-direction: column;
	font-size: 12.5px;
}

.spotify-track {
	font-weight: 600;
	color: var(--text);
}

.spotify-artist {
	color: #86efac;
}

/* ---------- Projects Card ---------- */
.project-card {
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: 14px;
	padding: 28px 26px;
	box-shadow: 0 20px 40px -24px rgba(0, 0, 0, 0.6);
}

.project-header h3 {
	margin: 0 0 12px;
	font-size: 20px;
	font-weight: 700;
	color: var(--text);
}

.project-card .lead {
	margin: 0 0 20px;
	color: var(--muted);
	font-size: 15px;
}

.project-features {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 14px;
}

.project-features li {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	font-size: 14.5px;
	color: var(--text);
}

.project-features li svg {
	flex: none;
	width: 18px;
	height: 18px;
	margin-top: 3px;
	color: var(--accent-bright);
}

.project-features a {
	color: var(--accent-bright);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.project-features a:hover {
	color: var(--text);
}

/* ---------- Links Grid ---------- */
.links-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

@media (max-width: 640px) {
	.links-grid {
		grid-template-columns: 1fr;
	}
}

.link-card {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 20px 22px;
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: 14px;
	text-decoration: none;
	transition: border-color 0.3s var(--ease), transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s var(--ease);
	min-height: 44px;
}

.link-card:hover {
	border-color: var(--border-hover);
	transform: translateY(-3px);
	background: var(--card-hover);
	box-shadow: 0 20px 40px -24px var(--accent-glow);
}

.link-card .icon {
	flex: none;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 10px;
	background: var(--accent-dim);
	color: var(--accent-bright);
}

.link-card .icon.icon-alt {
	background: rgba(56, 189, 248, 0.15);
	color: var(--accent-2);
}

.link-card .icon svg {
	width: 22px;
	height: 22px;
}

.link-info h3 {
	margin: 0 0 3px;
	font-size: 16px;
	font-weight: 600;
	color: var(--text);
}

.link-info p {
	margin: 0;
	font-size: 13px;
	color: var(--muted);
}

.link-card .go {
	margin-left: auto;
	flex: none;
	color: var(--muted);
	transition: transform 0.3s var(--ease), color 0.3s var(--ease);
}

.link-card:hover .go {
	color: var(--accent-bright);
	transform: translateX(4px);
}

/* ---------- Bottom Telegram Action ---------- */
.telegram-card-wrap {
	display: flex;
	justify-content: center;
	margin-top: 16px;
	width: 100%;
}

.telegram-card {
	width: calc(50% - 8px);
}

@media (max-width: 640px) {
	.telegram-card {
		width: 100%;
	}
}

/* ---------- View Counter & Footer ---------- */
.view-counter {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--muted);
	font-family: var(--font-mono);
	font-size: 13px;
	font-weight: 500;
	transition: color 0.2s ease;
}

.view-counter:hover {
	color: var(--accent-bright);
}

.view-counter svg {
	color: var(--accent-bright);
}

footer {
	padding: 48px 0 64px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	text-align: center;
	font-family: var(--font-mono);
	font-size: 12.5px;
	color: var(--muted);
}

footer p {
	margin: 0;
}

/* ---------- Accessibility ---------- */
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
	}
	.reveal { opacity: 1; transform: none; }
}
