/* ============================================================
   PORTFOLIO REDESIGN — "Terminal Architect"
   Dark surfaces, cyan precision, monospaced clarity.
   ============================================================ */

/* --- Design Tokens --- */
:root {
	/* Palette — deep navy base for aurora depth */
	--bg-primary: #0a0e1a;
	--bg-secondary: #0e1424;
	--bg-card: rgba(22, 30, 51, 0.55);
	--bg-card-solid: #161e33;
	--bg-elevated: #1d2742;

	--text-primary: #eef2fb;
	--text-secondary: #a6b2cc;
	--text-muted: #8696b5; /* WCAG AA (≈6.5:1) on --bg-primary; was #6f7e9e (≈4.7:1, already AA — raised for headroom over translucent surfaces) */

	/* Dual accent — cyan primary, violet secondary (aurora) */
	--accent: #22d3ee;
	--accent-dim: #0ea5c9;
	--accent-2: #a78bfa;
	--accent-2-dim: #8b5cf6;
	--accent-glow: rgba(34, 211, 238, 0.12);
	--accent-glow-strong: rgba(34, 211, 238, 0.25);

	/* Gradient — cyan → violet, the signature aurora sweep */
	--gradient-aurora: linear-gradient(120deg, #22d3ee 0%, #6366f1 50%, #a78bfa 100%);
	--gradient-aurora-soft: linear-gradient(120deg, rgba(34, 211, 238, 0.9) 0%, rgba(167, 139, 250, 0.9) 100%);

	/* Glass — frosted card surfaces (static fill, no per-frame backdrop sampling) */
	--glass-bg: rgba(20, 27, 46, 0.72);
	--glass-blur: 6px;

	--border: rgba(148, 180, 230, 0.12);
	--border-hover: rgba(170, 150, 250, 0.28);

	/* Typography */
	--font-display: 'Outfit', sans-serif;
	--font-mono: 'JetBrains Mono', monospace;

	/* Type scale — 1.25 ratio (Major Third) */
	--text-xs: 0.694rem;   /* ~11px */
	--text-sm: 0.8rem;     /* ~12.8px */
	--text-base: 0.938rem; /* ~15px */
	--text-lg: 1.125rem;   /* ~18px */
	--text-xl: 1.375rem;   /* ~22px */
	--text-2xl: clamp(1.5rem, 3vw, 2rem);     /* 24–32px */
	--text-3xl: clamp(2rem, 4vw, 2.75rem);    /* 32–44px */
	--text-hero: clamp(3rem, 7vw, 6rem);       /* 48–96px */

	/* Spacing — 8px base grid */
	--space-xs: 4px;
	--space-sm: 8px;
	--space-md: 16px;
	--space-lg: 24px;
	--space-xl: 32px;
	--space-2xl: 48px;
	--space-3xl: 64px;
	--space-4xl: 96px;

	--nav-width: 260px;
	--section-pad: clamp(80px, 10vh, 120px);
	--content-max: 1100px;

	/* Radius */
	--radius-sm: 4px;
	--radius-md: 8px;
	--radius-lg: 12px;

	/* Animation */
	--ease-out: cubic-bezier(0.16, 1, 0.3, 1);
	--ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
	--duration: 0.6s;
	--stagger: 0.08s;
}

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

html {
	scroll-behavior: smooth;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	scrollbar-width: thin;
	scrollbar-color: var(--accent-dim) var(--bg-primary);
}

body {
	font-family: var(--font-display);
	font-weight: 400;
	color: var(--text-primary);
	background: var(--bg-primary);
	line-height: 1.65;
	overflow-x: hidden;
}

/* --- Aurora mesh — fixed atmospheric backdrop behind all content --- */
.aurora-bg {
	position: fixed;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	overflow: hidden;
	contain: strict;
}

.aurora-bg::before,
.aurora-bg::after {
	content: '';
	position: absolute;
	border-radius: 50%;
	/* soft via a feathered radial gradient instead of an expensive filter blur */
	opacity: 0.55;
	will-change: transform;
	transform: translateZ(0);
}

.aurora-bg::before {
	width: 55vw;
	height: 55vw;
	top: -15%;
	left: -10%;
	background: radial-gradient(circle, rgba(34, 211, 238, 0.28) 0%, rgba(34, 211, 238, 0.1) 35%, transparent 70%);
	animation: aurora-drift-1 26s var(--ease-in-out) infinite alternate;
}

.aurora-bg::after {
	width: 50vw;
	height: 50vw;
	bottom: -20%;
	right: -10%;
	background: radial-gradient(circle, rgba(139, 92, 246, 0.26) 0%, rgba(139, 92, 246, 0.1) 35%, transparent 70%);
	animation: aurora-drift-2 32s var(--ease-in-out) infinite alternate;
}

@keyframes aurora-drift-1 {
	from { transform: translate(0, 0) scale(1); }
	to   { transform: translate(12vw, 8vh) scale(1.18); }
}

@keyframes aurora-drift-2 {
	from { transform: translate(0, 0) scale(1.1); }
	to   { transform: translate(-10vw, -6vh) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
	.aurora-bg::before,
	.aurora-bg::after { animation: none; }
}

img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }

::selection {
	background: var(--accent);
	color: var(--bg-primary);
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--accent-dim); border-radius: 3px; }

/* --- Skip Link (accessibility) --- */
.skip-link {
	position: fixed;
	top: -100%;
	left: 16px;
	z-index: 10000;
	padding: 12px 24px;
	font-family: var(--font-mono);
	font-size: 13px;
	color: var(--bg-primary);
	background: var(--accent);
	border-radius: 0 0 6px 6px;
	transition: top 0.3s var(--ease-out);
}

.skip-link:focus {
	top: 0;
	outline: 2px solid var(--text-primary);
	outline-offset: 2px;
}

/* --- Loader --- */
#loader {
	position: fixed;
	inset: 0;
	z-index: 9999;
	background: var(--bg-primary);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 20px;
	transition: opacity 0.5s var(--ease-out), visibility 0.5s;
}

#loader.hidden {
	opacity: 0;
	visibility: hidden;
}

.loader__bar {
	width: 120px;
	height: 2px;
	background: var(--bg-elevated);
	border-radius: 1px;
	overflow: hidden;
	position: relative;
}

.loader__bar::after {
	content: '';
	position: absolute;
	left: 0;
	top: 0;
	height: 100%;
	width: 0%;
	background: var(--accent);
	animation: loaderFill 1.2s var(--ease-in-out) forwards;
}

@keyframes loaderFill {
	to { width: 100%; }
}

.loader__text {
	font-family: var(--font-mono);
	font-size: 11px;
	letter-spacing: 4px;
	color: var(--text-muted);
}

/* --- Cursor Glow --- */
#cursor-glow {
	position: fixed;
	width: 400px;
	height: 400px;
	border-radius: 50%;
	background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
	pointer-events: none;
	z-index: 1;
	transform: translate(-50%, -50%);
	will-change: transform;
	opacity: 0;
	transition: opacity 0.4s;
}

/* --- Mobile nav backdrop --- */
.nav-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.6);
	z-index: 99;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.4s var(--ease-out), visibility 0.4s;
	-webkit-tap-highlight-color: transparent;
}

.nav-backdrop.visible {
	opacity: 1;
	visibility: visible;
}

/* --- Navigation --- */
#nav {
	position: fixed;
	left: 0;
	top: 0;
	width: var(--nav-width);
	height: 100vh;
	height: 100dvh;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	padding: 40px 32px;
	padding-left: max(32px, env(safe-area-inset-left));
	border-right: 1px solid var(--border);
	background: rgba(10, 14, 26, 0.82);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	z-index: 100;
	transition: transform 0.5s var(--ease-out);
}

.nav__logo {
	font-family: var(--font-mono);
	font-size: 18px;
	font-weight: 700;
	letter-spacing: 2px;
	margin-bottom: 60px;
}

.nav__logo-bracket { color: var(--accent); }
.nav__logo-name { color: var(--text-primary); }

.nav__links {
	display: flex;
	flex-direction: column;
	gap: 4px;
	flex: 1;
}

.nav__link {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 14px;
	font-family: var(--font-display);
	font-size: 13px;
	font-weight: 500;
	color: var(--text-muted);
	border-radius: var(--radius-md);
	transition: all 0.3s var(--ease-out);
	position: relative;
}

.nav__link::before {
	content: '';
	position: absolute;
	left: 0;
	top: 50%;
	transform: translateY(-50%);
	width: 0;
	height: 60%;
	background: var(--accent);
	border-radius: 0 2px 2px 0;
	transition: width 0.3s var(--ease-out);
}

.nav__link:hover,
.nav__link.active {
	color: var(--text-primary);
	background: var(--accent-glow);
	letter-spacing: 0.5px;
}

.nav__link.active::before { width: 3px; }

.nav__link-index {
	font-family: var(--font-mono);
	font-size: 10px;
	color: var(--accent);
	min-width: 18px;
}

.nav__footer {
	display: flex;
	gap: 16px;
}

.nav__footer a {
	color: var(--text-muted);
	font-size: 16px;
	transition: color 0.3s, transform 0.3s var(--ease-out);
}

.nav__footer a:hover {
	color: var(--accent);
	transform: translateY(-2px);
}

/* Mobile nav toggle */
.nav-toggle {
	display: none;
	position: fixed;
	top: 20px;
	right: 20px;
	z-index: 200;
	width: 40px;
	height: 40px;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 6px;
	background: rgba(10, 14, 26, 0.9);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border: 1px solid var(--border);
	border-radius: 8px;
}

.nav-toggle span {
	display: block;
	width: 18px;
	height: 1.5px;
	background: var(--text-primary);
	transition: all 0.3s var(--ease-out);
	transform-origin: center;
}

.nav-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(2.5px, 2.5px); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(3px, -3px); }

/* --- Main Content --- */
#main {
	margin-left: var(--nav-width);
	position: relative;
	z-index: 1;
}

.section {
	padding: var(--section-pad) clamp(32px, 5vw, 80px);
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
}

.section--alt {
	background: linear-gradient(180deg, rgba(14, 20, 36, 0.82) 0%, rgba(10, 14, 26, 0.82) 100%);
	border-top: 1px solid var(--border);
	border-bottom: 1px solid var(--border);
}

/* --- Section Headers --- */
.section__header {
	display: flex;
	align-items: center;
	gap: var(--space-md);
	margin-bottom: var(--space-2xl);
}

.section__index {
	font-family: var(--font-mono);
	font-size: var(--text-sm);
	color: var(--accent);
	font-weight: 500;
}

.section__title {
	font-family: var(--font-display);
	font-size: var(--text-2xl);
	font-weight: 600;
	white-space: nowrap;
}

.section__line {
	flex: 1;
	height: 1px;
	background: var(--border);
}

/* --- Hero --- */
.hero {
	min-height: 100vh;
	min-height: 100dvh;
	justify-content: center;
	position: relative;
	overflow: hidden;
}

/* Ambient gradient wash behind hero content */
.hero::before {
	content: '';
	position: absolute;
	inset: 0;
	background:
		radial-gradient(ellipse 80% 60% at 18% 82%, rgba(34, 211, 238, 0.09) 0%, transparent 60%),
		radial-gradient(ellipse 55% 55% at 82% 18%, rgba(167, 139, 250, 0.08) 0%, transparent 55%);
	pointer-events: none;
	z-index: 0;
}

/* Noise texture overlay for depth */
.hero::after {
	content: '';
	position: absolute;
	inset: 0;
	background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
	background-repeat: repeat;
	background-size: 256px 256px;
	pointer-events: none;
	z-index: 0;
	opacity: 0.5;
}

.hero__grid-bg {
	position: absolute;
	inset: 0;
	background-image:
		linear-gradient(var(--border) 1px, transparent 1px),
		linear-gradient(90deg, var(--border) 1px, transparent 1px);
	background-size: 60px 60px;
	mask-image: radial-gradient(ellipse 60% 50% at 50% 50%, black 20%, transparent 100%);
	-webkit-mask-image: radial-gradient(ellipse 60% 50% at 50% 50%, black 20%, transparent 100%);
	opacity: 0.5;
}

#wireframe-bg {
	position: fixed;
	right: 5%;
	top: 50%;
	transform: translateY(-50%);
	width: 420px;
	height: 420px;
	opacity: 0.22;
	pointer-events: none;
	z-index: 0;
	transition: opacity 0.8s var(--ease-out);
}

.hero__content {
	max-width: var(--content-max);
	position: relative;
	z-index: 2;
}

.hero__greeting {
	font-family: var(--font-mono);
	font-size: var(--text-sm);
	color: var(--accent);
	letter-spacing: 3px;
	text-transform: uppercase;
	margin-bottom: var(--space-md);
}

.hero__name {
	font-family: var(--font-display);
	font-size: var(--text-hero);
	font-weight: 700;
	line-height: 1.05;
	letter-spacing: -2px;
	margin-bottom: var(--space-lg);
	background: linear-gradient(120deg, var(--text-primary) 0%, var(--text-primary) 45%, #8ee9f7 70%, var(--accent-2) 100%);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
}

.hero__cursor {
	-webkit-text-fill-color: var(--accent);
	animation: cursorBlink 1s step-end infinite;
}

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

.hero__title {
	font-family: var(--font-display);
	font-size: var(--text-xl);
	font-weight: 500;
	color: var(--text-secondary);
	margin-bottom: var(--space-sm);
}

.hero__subtitle {
	font-family: var(--font-mono);
	font-size: var(--text-sm);
	color: var(--text-secondary);
	letter-spacing: 0.5px;
	margin-bottom: var(--space-2xl);
}

.hero__cta {
	display: flex;
	gap: 16px;
	flex-wrap: wrap;
}

/* Buttons */
.btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 28px;
	font-family: var(--font-mono);
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.5px;
	border-radius: var(--radius-md);
	transition: all 0.3s var(--ease-out);
	position: relative;
	overflow: hidden;
}

.btn--primary {
	background: var(--gradient-aurora);
	background-size: 160% 160%;
	color: var(--bg-primary);
	font-weight: 600;
	transition: all 0.3s var(--ease-out), background-position 0.5s var(--ease-out);
}

/* Shimmer sweep on hover */
.btn--primary::after {
	content: '';
	position: absolute;
	top: 0;
	left: -100%;
	width: 100%;
	height: 100%;
	background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
	transition: left 0.5s var(--ease-out);
}

.btn--primary:hover::after {
	left: 100%;
}

.btn--primary:hover {
	background-position: 100% 100%;
	transform: translateY(-2px);
	box-shadow: 0 10px 34px rgba(99, 102, 241, 0.35);
}

.btn--outline {
	border: 1px solid var(--border-hover);
	color: var(--text-secondary);
}

.btn--outline:hover {
	border-color: var(--accent);
	color: var(--accent);
	transform: translateY(-2px);
}

/* Hero scroll indicator */
.hero__scroll-indicator {
	position: absolute;
	bottom: 40px;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
}

.hero__scroll-indicator span {
	font-family: var(--font-mono);
	font-size: 10px;
	letter-spacing: 3px;
	text-transform: uppercase;
	color: var(--text-muted);
}

.hero__scroll-line {
	width: 1px;
	height: 40px;
	background: var(--border);
	position: relative;
	overflow: hidden;
}

.hero__scroll-line::after {
	content: '';
	position: absolute;
	top: -100%;
	left: 0;
	width: 100%;
	height: 50%;
	background: var(--accent);
	animation: scrollLine 2s var(--ease-in-out) infinite;
}

@keyframes scrollLine {
	0% { top: -50%; }
	100% { top: 150%; }
}

/* --- Reveal Animations --- */
.reveal {
	opacity: 0;
	transform: translateY(20px);
	transition: opacity var(--duration) var(--ease-out), transform var(--duration) var(--ease-out);
}

.reveal.visible {
	opacity: 1;
	transform: translateY(0);
}

.reveal-slide {
	opacity: 0;
	transform: translateY(30px);
	transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.reveal-slide.visible {
	opacity: 1;
	transform: translateY(0);
}

/* --- About --- */
.about__grid {
	display: grid;
	grid-template-columns: 280px 1fr;
	gap: var(--space-3xl);
	align-items: start;
	max-width: var(--content-max);
}

.about__image-wrapper {
	position: relative;
	width: 100%;
	aspect-ratio: 1;
}

.about__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center 15%;
	border-radius: var(--radius-lg);
	background: var(--bg-card);
	position: relative;
	z-index: 2;
	filter: grayscale(0.25) contrast(1.05) brightness(0.95);
	transition: filter 0.5s var(--ease-out);
}

.about__image-wrapper:hover .about__image {
	filter: grayscale(0) contrast(1) brightness(1);
}

.about__image-border {
	position: absolute;
	inset: 10px -10px -10px 10px;
	border: 1px solid var(--accent);
	border-radius: var(--radius-lg);
	z-index: 1;
	transition: inset 0.4s var(--ease-out);
}

.about__image-wrapper:hover .about__image-border {
	inset: 6px -6px -6px 6px;
}

.about__bio {
	color: var(--text-secondary);
	font-size: var(--text-base);
	margin-bottom: var(--space-md);
	max-width: 600px;
}

.about__stats {
	display: flex;
	gap: var(--space-2xl);
	margin: var(--space-xl) 0;
	padding: var(--space-lg) 0;
	border-top: 1px solid var(--border);
	border-bottom: 1px solid var(--border);
}

.about__stat {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.about__stat-number {
	font-family: var(--font-mono);
	font-size: var(--text-2xl);
	font-weight: 700;
	color: var(--accent);
}

.about__stat-label {
	font-size: var(--text-xs);
	color: var(--text-muted);
	text-transform: uppercase;
	letter-spacing: 1px;
}

.about__stat--muted .about__stat-number {
	color: var(--text-muted);
	font-size: var(--text-lg);
}

.about__stat--muted .about__stat-label {
	font-size: 10px;
}

.about__tech {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-sm);
	margin-top: var(--space-lg);
}

/* Tags */
.tag {
	display: inline-block;
	padding: 6px 14px;
	font-family: var(--font-mono);
	font-size: 12px;
	color: var(--accent);
	background: var(--accent-glow);
	border: 1px solid rgba(34, 211, 238, 0.15);
	border-radius: var(--radius-sm);
	transition: all 0.3s var(--ease-out);
}

.tag:hover {
	background: var(--accent-glow-strong);
	border-color: var(--accent-dim);
	transform: translateY(-2px) scale(1.04);
	transition-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tag--sm {
	padding: 3px 10px;
	font-size: 11px;
}

/* Proficiency tiers — icon badge prefix */
.tag--core,
.tag--proficient,
.tag--familiar {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--accent);
	background: var(--accent-glow);
	border-color: rgba(34, 211, 238, 0.15);
}

.tag--core::before,
.tag--proficient::before,
.tag--familiar::before {
	content: '';
	display: inline-block;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	flex-shrink: 0;
}

/* Core: filled circle */
.tag--core {
	background: var(--accent-glow-strong);
	border-color: var(--accent-dim);
	font-weight: 500;
}

.tag--core::before {
	background: var(--accent);
}

/* Proficient: half-filled circle */
.tag--proficient::before {
	background: linear-gradient(90deg, var(--accent) 50%, transparent 50%);
	border: 1px solid var(--accent);
	box-sizing: border-box;
}

/* Familiar: outline circle */
.tag--familiar::before {
	border: 1px solid var(--accent);
	background: transparent;
	box-sizing: border-box;
}

/* Tag legend */
.about__tech-legend {
	display: flex;
	gap: var(--space-lg);
	margin-top: var(--space-md);
}

.legend__item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-family: var(--font-mono);
	font-size: 11px;
	color: var(--text-muted);
	letter-spacing: 0.5px;
}

.legend__dot {
	display: inline-block;
	width: 6px;
	height: 6px;
	border-radius: 50%;
}

.legend__dot--core {
	background: var(--accent);
}

.legend__dot--proficient {
	background: linear-gradient(90deg, var(--accent) 50%, transparent 50%);
	border: 1px solid var(--accent);
	box-sizing: border-box;
}

.legend__dot--familiar {
	border: 1px solid var(--accent);
	background: transparent;
	box-sizing: border-box;
}

/* --- Beyond Code --- */
.beyond {
	background: transparent;
}

.beyond__grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: var(--space-lg);
	max-width: var(--content-max);
}

.beyond__card {
	padding: var(--space-xl);
	background: var(--glass-bg);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	transition: border-color 0.4s var(--ease-out), transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
}

.beyond__card:hover {
	border-color: var(--border-hover);
	transform: translateY(-4px);
	box-shadow: 0 12px 40px rgba(139, 92, 246, 0.12);
}

.beyond__icon {
	font-size: var(--text-xl);
	color: var(--accent);
	margin-bottom: var(--space-md);
	display: block;
}

.beyond__label {
	font-family: var(--font-display);
	font-size: var(--text-base);
	font-weight: 600;
	margin-bottom: var(--space-sm);
}

.beyond__desc {
	font-size: var(--text-sm);
	color: var(--text-secondary);
	line-height: 1.6;
}

@media (max-width: 1100px) {
	.beyond__grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

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

	.beyond__card {
		padding: 20px;
	}
}

/* --- Experience Timeline --- */
.experience__timeline {
	max-width: var(--content-max);
	position: relative;
	padding-left: var(--space-2xl);
}

.experience__timeline::before {
	content: '';
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 1px;
	background: linear-gradient(180deg, var(--accent-dim) 0%, var(--border) 40%, var(--border) 100%);
}

.exp-card {
	display: grid;
	grid-template-columns: 160px 1fr;
	gap: var(--space-xl);
	margin-bottom: var(--space-2xl);
	position: relative;
}

.exp-card__dot {
	position: absolute;
	left: -54px;
	top: 6px;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--bg-primary);
	border: 2px solid var(--accent);
	z-index: 2;
	transition: all 0.3s var(--ease-out);
}

.exp-card:hover .exp-card__dot {
	background: var(--accent);
	animation: dotPulse 1.5s ease-in-out infinite;
}

@keyframes dotPulse {
	0%, 100% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.4); }
	50% { box-shadow: 0 0 0 8px rgba(34, 211, 238, 0); }
}

/* First dot always glows to signal current role */
.exp-card:first-child .exp-card__dot {
	background: var(--accent);
	box-shadow: 0 0 8px var(--accent-glow-strong);
}

.exp-card__period {
	font-family: var(--font-mono);
	font-size: 12px;
	color: var(--text-muted);
	letter-spacing: 0.5px;
	white-space: nowrap;
}

.exp-card__body {
	padding: var(--space-lg);
	background: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: var(--radius-md);
	transition: border-color 0.4s var(--ease-out), background 0.4s var(--ease-out), transform 0.4s var(--ease-out);
}

.exp-card:hover .exp-card__body {
	border-color: var(--accent-dim);
	background: var(--bg-elevated);
	transform: translateX(4px);
}

.exp-card__title {
	font-family: var(--font-display);
	font-size: var(--text-lg);
	font-weight: 600;
	margin-bottom: var(--space-xs);
}

.exp-card__company {
	font-family: var(--font-mono);
	font-size: var(--text-sm);
	color: var(--accent);
	font-weight: 400;
	margin-bottom: var(--space-sm);
}

.exp-card__desc {
	font-size: var(--text-sm);
	color: var(--text-secondary);
	line-height: 1.7;
	margin-bottom: var(--space-md);
}

.exp-card__list {
	list-style: none;
	padding: 0;
	margin: 0 0 var(--space-md) 0;
}

.exp-card__list li {
	position: relative;
	padding-left: 16px;
	font-size: var(--text-sm);
	color: var(--text-secondary);
	line-height: 1.7;
	margin-bottom: 6px;
}

.exp-card__list li::before {
	content: '▹';
	position: absolute;
	left: 0;
	color: var(--accent);
	font-size: 12px;
}

.exp-card__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 12px;
}

.exp-card__links {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.exp-card__link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-family: var(--font-mono);
	font-size: 12px;
	color: var(--accent);
	transition: all 0.3s;
}

.exp-card__link:hover {
	color: var(--text-primary);
}

.exp-card__link i {
	font-size: 10px;
	transition: transform 0.3s var(--ease-out);
}

.exp-card__link:hover i {
	transform: translate(2px, -2px);
}

/* --- Education --- */
.education__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	gap: var(--space-lg);
	max-width: var(--content-max);
	margin-bottom: var(--space-3xl);
}

.edu-card {
	padding: var(--space-xl);
	background: var(--glass-bg);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	transition: border-color 0.4s var(--ease-out), transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
	position: relative;
	overflow: hidden;
}

.edu-card::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 2px;
	background: var(--gradient-aurora);
	opacity: 0;
	transition: opacity 0.4s;
}

.edu-card:hover {
	border-color: var(--border-hover);
	transform: translateY(-4px);
	box-shadow: 0 12px 40px rgba(139, 92, 246, 0.12);
}

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

.edu-card__icon {
	font-size: var(--text-xl);
	color: var(--accent);
	margin-bottom: var(--space-md);
}

.edu-card__title {
	font-size: var(--text-lg);
	font-weight: 600;
	margin-bottom: var(--space-xs);
}

.edu-card__subtitle {
	font-size: var(--text-sm);
	color: var(--text-secondary);
	margin-bottom: var(--space-sm);
}

.edu-card__period {
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	color: var(--text-muted);
	margin-bottom: var(--space-sm);
}

.edu-card__detail {
	font-size: var(--text-sm);
	color: var(--text-secondary);
	line-height: 1.6;
}

/* Coursework */
.education__coursework {
	max-width: var(--content-max);
	border-top: 1px solid var(--border);
	padding-top: var(--space-2xl);
}

.education__coursework-title {
	font-size: var(--text-xl);
	font-weight: 600;
	margin-bottom: var(--space-sm);
}

.education__coursework-desc {
	font-size: var(--text-sm);
	color: var(--text-secondary);
	margin-bottom: var(--space-xl);
	max-width: 600px;
}

.education__gallery {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	gap: var(--space-lg);
}

.edu-gallery__item {
	border-radius: var(--radius-lg);
	overflow: hidden;
	border: 1px solid var(--border);
	background: var(--bg-card);
	transition: border-color 0.4s var(--ease-out), transform 0.4s var(--ease-out);
}

.edu-gallery__item:hover {
	border-color: var(--border-hover);
	transform: translateY(-4px);
}

.edu-gallery__item img {
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	transition: transform 0.6s var(--ease-out);
}

.edu-gallery__item:hover img {
	transform: scale(1.03);
}

.edu-gallery__item figcaption {
	padding: 14px 18px;
	font-size: 13px;
	color: var(--text-secondary);
}

/* --- Projects --- */
.projects__grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: var(--space-lg);
	max-width: var(--content-max);
}

/* Featured projects span full width */
.project-card--featured {
	grid-column: span 2;
	display: grid;
	grid-template-columns: 1.2fr 1fr;
	border-color: var(--accent-dim);
	box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.08), 0 0 40px rgba(34, 211, 238, 0.06);
}

.project-card--featured::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 2px;
	background: var(--gradient-aurora);
	z-index: 3;
}

.project-card--featured:hover {
	box-shadow: 0 0 0 1px rgba(167, 139, 250, 0.18), 0 0 60px rgba(99, 102, 241, 0.14);
}

.project-card {
	background: var(--glass-bg);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	overflow: hidden;
	transition: border-color 0.4s var(--ease-out), transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
	position: relative;
	will-change: transform;
}

.project-card::after {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: var(--radius-lg);
	background: linear-gradient(135deg, var(--accent-glow) 0%, transparent 45%, rgba(167, 139, 250, 0.1) 100%);
	opacity: 0;
	transition: opacity 0.4s;
	pointer-events: none;
}

.project-card:hover {
	border-color: var(--border-hover);
	transform: translateY(-4px);
	box-shadow: 0 16px 48px rgba(99, 102, 241, 0.16);
}

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

.project-card__media {
	position: relative;
	overflow: hidden;
	background: var(--bg-secondary);
}

.project-card--featured .project-card__media {
	min-height: 280px;
}

.project-card:not(.project-card--featured) .project-card__media {
	height: 200px;
}

.project-card__media video {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.project-card__overlay {
	position: absolute;
	inset: 0;
	/* Fade media into the card surface (--bg-card base rgb 22,30,51) at high alpha,
	   instead of fading to the translucent token itself which gave a muddy half-fade. */
	background: linear-gradient(180deg, transparent 45%, rgba(22, 30, 51, 0.9) 100%);
	pointer-events: none;
}

.project-card__media--icon {
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-elevated) 100%);
}

.project-card__media--icon i {
	font-size: 48px;
	color: var(--accent);
	opacity: 0.6;
	transition: all 0.4s var(--ease-out);
}

.project-card:hover .project-card__media--icon i {
	opacity: 1;
	transform: scale(1.1);
}

/* Faux terminal panel — for projects with no screenshot (e.g. contexture) */
.project-card__media--terminal {
	background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
	display: flex;
	align-items: stretch;
	padding: var(--space-md);
}

.terminal {
	flex: 1;
	display: flex;
	flex-direction: column;
	background: #0b0e12;
	border: 1px solid var(--border);
	border-radius: var(--radius-md);
	overflow: hidden;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
	transition: border-color 0.4s var(--ease-out), transform 0.4s var(--ease-out);
}

.project-card:hover .terminal {
	border-color: var(--border-hover);
	transform: translateY(-2px);
}

.terminal__bar {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 8px 12px;
	background: var(--bg-secondary);
	border-bottom: 1px solid var(--border);
}

.terminal__dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--text-muted);
	opacity: 0.5;
}

.terminal__dot:nth-child(1) { background: #ff5f57; opacity: 0.8; }
.terminal__dot:nth-child(2) { background: #febc2e; opacity: 0.8; }
.terminal__dot:nth-child(3) { background: #28c840; opacity: 0.8; }

.terminal__name {
	margin-left: 8px;
	font-family: var(--font-mono);
	font-size: 11px;
	color: var(--text-muted);
	letter-spacing: 0.5px;
}

.terminal__body {
	flex: 1;
	margin: 0;
	padding: 14px 16px;
	font-family: var(--font-mono);
	font-size: 11.5px;
	line-height: 1.7;
	color: var(--text-secondary);
	white-space: pre-wrap;
	word-break: break-word;
	overflow: hidden;
}

.terminal__prompt { color: var(--accent); font-weight: 700; }
.terminal__hl { color: var(--accent); }
.terminal__warn { color: #febc2e; font-weight: 600; }

.terminal__cursor {
	display: inline-block;
	color: var(--accent);
	font-weight: 700;
	animation: terminal-blink 1.1s steps(1) infinite;
}

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

@media (prefers-reduced-motion: reduce) {
	.terminal__cursor { animation: none; }
}

.project-card__content {
	padding: var(--space-lg);
	display: flex;
	flex-direction: column;
	justify-content: center;
	position: relative;
	z-index: 2;
}

.project-card__label {
	font-family: var(--font-mono);
	font-size: 11px;
	color: var(--accent);
	text-transform: uppercase;
	letter-spacing: 2px;
	margin-bottom: 10px;
}

.project-card__title {
	font-size: var(--text-xl);
	font-weight: 600;
	margin-bottom: var(--space-sm);
}

.project-card__desc {
	font-size: var(--text-sm);
	color: var(--text-secondary);
	line-height: 1.7;
	margin-bottom: var(--space-md);
}

.project-card__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: var(--space-md);
}

.project-card__link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-family: var(--font-mono);
	font-size: 13px;
	color: var(--accent);
	transition: all 0.3s;
}

.project-card__link:hover { color: var(--text-primary); }

/* --- Contact --- */
.contact {
	align-items: center;
	text-align: center;
	min-height: auto;
	padding-top: var(--section-pad);
	padding-bottom: var(--section-pad);
	position: relative;
}

/* Subtle grid pattern behind contact */
.contact::before {
	content: '';
	position: absolute;
	inset: 0;
	background-image:
		linear-gradient(var(--border) 1px, transparent 1px),
		linear-gradient(90deg, var(--border) 1px, transparent 1px);
	background-size: 80px 80px;
	mask-image: radial-gradient(ellipse 50% 60% at 50% 50%, black 0%, transparent 80%);
	-webkit-mask-image: radial-gradient(ellipse 50% 60% at 50% 50%, black 0%, transparent 80%);
	opacity: 0.3;
	pointer-events: none;
}

.contact__status {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-family: var(--font-mono);
	font-size: 12px;
	color: var(--text-muted);
	letter-spacing: 1px;
	margin-bottom: 24px;
}

.contact__status-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #22c55e;
	animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
	0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
	50% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
}

.contact .section__header {
	justify-content: center;
}

.contact__content {
	max-width: 520px;
}

.contact__heading {
	font-family: var(--font-display);
	font-size: var(--text-3xl);
	font-weight: 600;
	margin-bottom: var(--space-md);
}

.contact__desc {
	font-size: var(--text-base);
	color: var(--text-secondary);
	margin-bottom: var(--space-xl);
	line-height: 1.7;
}

.contact__links {
	display: flex;
	gap: var(--space-md);
	justify-content: center;
	flex-wrap: wrap;
}

/* --- Footer --- */
.footer {
	padding: var(--space-3xl) clamp(32px, 5vw, 80px) var(--space-xl);
	border-top: 1px solid var(--border);
}

.footer__content {
	display: flex;
	justify-content: space-between;
	align-items: center;
	max-width: var(--content-max);
	margin-bottom: var(--space-xl);
}

.footer__logo {
	font-family: var(--font-mono);
	font-size: var(--text-base);
	font-weight: 700;
	letter-spacing: 2px;
	margin-bottom: var(--space-sm);
}

.footer__tagline {
	font-size: var(--text-sm);
	color: var(--text-muted);
}

.footer__socials {
	display: flex;
	gap: 20px;
}

.footer__socials a {
	color: var(--text-muted);
	font-size: 18px;
	transition: color 0.3s, transform 0.3s var(--ease-out);
}

.footer__socials a:hover {
	color: var(--accent);
	transform: translateY(-2px);
}

.footer__bottom {
	padding-top: var(--space-lg);
	border-top: 1px solid var(--border);
}

.footer__bottom p {
	font-size: var(--text-xs);
	color: var(--text-muted);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Large desktop — constrain content width */
@media (min-width: 1600px) {
	.section {
		padding-left: calc((100vw - var(--nav-width) - var(--content-max)) / 2);
		padding-right: calc((100vw - var(--nav-width) - var(--content-max)) / 2);
	}
}

/* Tablet — stack layouts, shrink featured cards */
@media (max-width: 1100px) {
	#wireframe-bg {
		opacity: 0.10;
	}

	.about__grid {
		grid-template-columns: 1fr;
		gap: 40px;
	}

	.about__image-col {
		max-width: 220px;
	}

	.about__stats {
		gap: 28px;
	}

	.projects__grid {
		grid-template-columns: 1fr;
	}

	.project-card--featured {
		grid-column: span 1;
		grid-template-columns: 1fr;
	}

	.project-card--featured .project-card__media {
		min-height: 240px;
	}

	.education__grid {
		grid-template-columns: 1fr;
	}

	.exp-card {
		grid-template-columns: 120px 1fr;
		gap: 20px;
	}
}

/* Sidebar collapses to overlay drawer */
@media (max-width: 860px) {
	#wireframe-bg {
		opacity: 0.07;
	}

	#nav {
		transform: translateX(-100%);
		width: 280px;
	}

	#nav.open {
		transform: translateX(0);
	}

	.nav-toggle {
		display: flex;
	}

	#main {
		margin-left: 0;
	}

	/* Sections no longer need min-height on narrow viewports */
	.section {
		min-height: auto;
	}

	.hero {
		min-height: 100svh;
	}

	/* Timeline adjustments */
	.exp-card {
		grid-template-columns: 1fr;
		gap: 8px;
	}

	.experience__timeline {
		padding-left: 24px;
	}

	.exp-card__dot {
		left: -30px;
		width: 10px;
		height: 10px;
	}

	/* Footer stacks */
	.footer__content {
		flex-direction: column;
		align-items: flex-start;
		gap: 24px;
	}
}

/* Mobile */
@media (max-width: 580px) {
	:root {
		--section-pad: 48px;
	}

	.section {
		padding-left: 18px;
		padding-right: 18px;
	}

	/* Hero */
	.hero {
		padding-top: 100px;
		padding-bottom: 60px;
	}

	.hero__name {
		font-size: clamp(36px, 12vw, 52px);
		letter-spacing: -1px;
	}

	.hero__title {
		font-size: 18px;
	}

	.hero__subtitle {
		font-size: 11px;
	}

	.hero__cta {
		flex-direction: column;
	}

	.hero__cta .btn {
		justify-content: center;
		width: 100%;
	}

	.hero__scroll-indicator {
		display: none;
	}

	/* Section headers */
	.section__header {
		gap: 12px;
		margin-bottom: 32px;
	}

	.section__title {
		font-size: 20px;
	}

	.section__line {
		display: none;
	}

	/* About */
	.about__image-col {
		max-width: 160px;
	}

	.about__bio {
		font-size: 14px;
	}

	.about__stats {
		gap: 20px;
		flex-wrap: wrap;
	}

	.about__stat-number {
		font-size: 22px;
	}

	.about__tech {
		gap: 6px;
	}

	/* Experience */
	.experience__timeline {
		padding-left: 18px;
	}

	.exp-card__body {
		padding: 18px;
	}

	.exp-card__title {
		font-size: 16px;
	}

	.exp-card__desc {
		font-size: 13px;
	}

	/* Education */
	.edu-card {
		padding: 22px;
	}

	.education__gallery {
		grid-template-columns: 1fr;
	}

	.education__coursework-title {
		font-size: 18px;
	}

	/* Projects */
	.project-card:not(.project-card--featured) .project-card__media {
		height: 180px;
	}

	.project-card--featured .project-card__media {
		min-height: 200px;
	}

	.project-card__content {
		padding: 20px;
	}

	.project-card__title {
		font-size: 18px;
	}

	.project-card__desc {
		font-size: 13px;
	}

	/* Tags */
	.tag {
		padding: 4px 10px;
		font-size: 11px;
	}

	.tag--sm {
		padding: 2px 8px;
		font-size: 10px;
	}

	/* Contact */
	.contact__links {
		flex-direction: column;
	}

	.contact__links .btn {
		justify-content: center;
		width: 100%;
	}

	.contact__heading {
		font-size: 22px;
	}
}

/* Small mobile */
@media (max-width: 380px) {
	.hero__name {
		font-size: 32px;
	}

	.about__stats {
		flex-direction: column;
		gap: 16px;
	}

	.about__stat {
		flex-direction: row;
		align-items: baseline;
		gap: 8px;
	}

	.exp-card__period {
		font-size: 11px;
	}

	.nav-toggle {
		top: 14px;
		right: 14px;
	}
}

/* Touch devices — disable hover transforms to avoid sticky states */
@media (hover: none) {
	.project-card:hover,
	.edu-card:hover,
	.edu-gallery__item:hover,
	.exp-card:hover .exp-card__body {
		transform: none;
	}

	#cursor-glow {
		display: none;
	}
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}

	.reveal, .reveal-slide {
		opacity: 1;
		transform: none;
	}
}

/* Landscape mobile — constrain hero height */
@media (max-height: 500px) and (orientation: landscape) {
	.hero {
		min-height: auto;
		padding-top: 60px;
		padding-bottom: 40px;
	}

	.hero__name {
		font-size: 36px;
	}
}
