/* ============================================
   Obsidian Studio — Design System
   ============================================ */

/* --- Design Tokens --- */
:root {
	--bg: #09090b;
	--surface: #141416;
	--surface-hover: #1c1c1f;
	--text: #fafaf9;
	--text-muted: #71717a;
	--border: #27272a;
	--accent: #a78bfa;
	--accent-hover: #c4b5fd;

	--font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
	--font-serif: Georgia, 'Noto Serif', 'Times New Roman', serif;
	--font-mono: 'SF Mono', 'Cascadia Code', Consolas, 'Liberation Mono', monospace;

	--ease: cubic-bezier(0.16, 1, 0.3, 1);
	--duration: 0.6s;
}

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

html {
	scroll-behavior: smooth;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

body {
	background: var(--bg);
	color: var(--text);
	font-family: var(--font-sans);
	line-height: 1.6;
	min-height: 100vh;
	overflow-x: hidden;
}

::selection {
	background: rgba(167, 139, 250, 0.3);
	color: var(--text);
}

a {
	color: var(--accent);
	text-decoration: none;
	transition: color 0.3s var(--ease);
}

a:hover {
	color: var(--accent-hover);
}

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

/* --- Container --- */
.container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 2rem;
}

/* ============================================
   Navigation
   ============================================ */
header {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	z-index: 1000;
	background: transparent;
	transition: background 0.4s var(--ease), border-color 0.4s var(--ease);
	border-bottom: 1px solid transparent;
}

header.scrolled {
	background: rgba(9, 9, 11, 0.85);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border-bottom-color: var(--border);
}

nav {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 1.25rem 0;
}

.logo {
	font-family: var(--font-serif);
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--text);
	text-decoration: none;
	letter-spacing: -0.02em;
	transition: opacity 0.3s var(--ease);
}

.logo:hover {
	opacity: 0.7;
	color: var(--text);
}

.nav-links {
	display: flex;
	gap: 2.5rem;
}

.nav-links a {
	color: var(--text-muted);
	text-decoration: none;
	font-size: 0.875rem;
	font-weight: 500;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	transition: color 0.3s var(--ease);
	position: relative;
}

.nav-links a::after {
	content: '';
	position: absolute;
	bottom: -4px;
	left: 0;
	width: 0;
	height: 1px;
	background: var(--accent);
	transition: width 0.4s var(--ease);
}

.nav-links a:hover {
	color: var(--text);
}

.nav-links a:hover::after {
	width: 100%;
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
	position: relative;
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 8rem 0 4rem;
	overflow: hidden;
}

.hero-glow {
	position: absolute;
	top: 20%;
	left: 50%;
	transform: translateX(-50%);
	width: 800px;
	height: 600px;
	background: radial-gradient(
		ellipse at center,
		rgba(139, 92, 246, 0.12) 0%,
		rgba(99, 102, 241, 0.06) 40%,
		transparent 70%
	);
	filter: blur(60px);
	pointer-events: none;
	z-index: 0;
}

.hero-content {
	position: relative;
	z-index: 1;
}

.hero-label {
	font-family: var(--font-mono);
	font-size: 0.8rem;
	letter-spacing: 0.15em;
	text-transform: uppercase;
	color: var(--accent);
	margin-bottom: 2rem;
	opacity: 0;
	transform: translateY(20px);
	animation: fadeInUp 0.8s var(--ease) 0.2s forwards;
}

.hero-name {
	font-family: var(--font-serif);
	font-weight: 400;
	line-height: 1.1;
	letter-spacing: -0.03em;
	margin-bottom: 1.5rem;
	opacity: 0;
	transform: translateY(30px);
	animation: fadeInUp 1s var(--ease) 0.4s forwards;
}

.hero-first,
.hero-last {
	display: block;
	font-size: clamp(3.5rem, 8vw, 6.5rem);
}

.hero-last {
	color: var(--text-muted);
}

.hero-tagline {
	font-size: 1.125rem;
	color: var(--text-muted);
	max-width: 480px;
	margin: 0 auto 2.5rem;
	line-height: 1.7;
	opacity: 0;
	transform: translateY(20px);
	animation: fadeInUp 0.8s var(--ease) 0.7s forwards;
}

.hero-actions {
	display: flex;
	gap: 1rem;
	justify-content: center;
	align-items: center;
	opacity: 0;
	transform: translateY(20px);
	animation: fadeInUp 0.8s var(--ease) 0.9s forwards;
}

.cta-button {
	display: inline-block;
	padding: 0.75rem 2rem;
	background: var(--accent);
	color: var(--bg);
	font-size: 0.875rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	border-radius: 6px;
	text-decoration: none;
	transition: all 0.3s var(--ease);
}

.cta-button:hover {
	background: var(--accent-hover);
	color: var(--bg);
	transform: translateY(-2px);
	box-shadow: 0 8px 30px rgba(167, 139, 250, 0.2);
}

.cta-secondary {
	display: inline-block;
	padding: 0.75rem 2rem;
	color: var(--text-muted);
	font-size: 0.875rem;
	font-weight: 500;
	letter-spacing: 0.02em;
	border: 1px solid var(--border);
	border-radius: 6px;
	text-decoration: none;
	transition: all 0.3s var(--ease);
}

.cta-secondary:hover {
	color: var(--text);
	border-color: var(--text-muted);
	transform: translateY(-2px);
}

/* ============================================
   Section Common
   ============================================ */
.section {
	padding: 7rem 0;
}

.section-label {
	font-family: var(--font-mono);
	font-size: 0.75rem;
	letter-spacing: 0.15em;
	text-transform: uppercase;
	color: var(--accent);
	margin-bottom: 1rem;
}

.section-title {
	font-family: var(--font-serif);
	font-size: clamp(2rem, 4vw, 3rem);
	font-weight: 400;
	letter-spacing: -0.02em;
	margin-bottom: 1rem;
}

.section-desc {
	color: var(--text-muted);
	font-size: 1.05rem;
	max-width: 560px;
	line-height: 1.7;
}

.divider {
	width: 100%;
	height: 1px;
	background: var(--border);
	border: none;
}

/* ============================================
   About Section
   ============================================ */
.about-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 4rem;
	align-items: start;
}

.about-text p {
	color: var(--text-muted);
	font-size: 1.05rem;
	line-height: 1.8;
	margin-bottom: 1.25rem;
}

.about-text p:last-child {
	margin-bottom: 0;
}

.skills-group {
	margin-bottom: 2rem;
}

.skills-group:last-child {
	margin-bottom: 0;
}

.skills-group-title {
	font-family: var(--font-mono);
	font-size: 0.7rem;
	letter-spacing: 0.15em;
	text-transform: uppercase;
	color: var(--text-muted);
	margin-bottom: 0.75rem;
}

.skills-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.skill-tag {
	display: inline-block;
	padding: 0.35rem 0.85rem;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 4px;
	font-size: 0.8rem;
	color: var(--text);
	font-weight: 500;
	transition: all 0.3s var(--ease);
}

.skill-tag:hover {
	border-color: var(--accent);
	background: rgba(167, 139, 250, 0.06);
}

/* ============================================
   Projects Section — Bento Grid
   ============================================ */
.bento-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 1.5rem;
}

.project-card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 12px;
	padding: 2rem;
	transition: all 0.4s var(--ease);
	position: relative;
	overflow: hidden;
}

.project-card::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	width: 3px;
	height: 0;
	background: var(--accent);
	border-radius: 0 2px 2px 0;
	transition: height 0.4s var(--ease);
}

.project-card:hover {
	border-color: rgba(167, 139, 250, 0.3);
	transform: translateY(-4px);
	background: var(--surface-hover);
}

.project-card:hover::before {
	height: 100%;
}

.project-card.featured {
	grid-column: span 2;
}

.project-number {
	font-family: var(--font-mono);
	font-size: 0.7rem;
	color: var(--text-muted);
	letter-spacing: 0.1em;
	margin-bottom: 1.25rem;
}

.project-card h3 {
	font-family: var(--font-serif);
	font-size: 1.5rem;
	font-weight: 400;
	letter-spacing: -0.01em;
	margin-bottom: 0.75rem;
}

.project-card.featured h3 {
	font-size: 1.75rem;
}

.project-card p {
	color: var(--text-muted);
	font-size: 0.95rem;
	line-height: 1.7;
	margin-bottom: 1.25rem;
}

.project-stack {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}

.project-stack span {
	font-family: var(--font-mono);
	font-size: 0.7rem;
	color: var(--text-muted);
	padding: 0.2rem 0.6rem;
	border: 1px solid var(--border);
	border-radius: 3px;
	letter-spacing: 0.03em;
}

/* ============================================
   Contact Section
   ============================================ */
.contact-layout {
	display: grid;
	grid-template-columns: 1fr 1.2fr;
	gap: 4rem;
	align-items: start;
}

.contact-info p {
	color: var(--text-muted);
	font-size: 1.05rem;
	line-height: 1.8;
	margin-bottom: 1.5rem;
}

.contact-links {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.contact-link {
	font-size: 0.9rem;
	color: var(--text-muted);
	transition: color 0.3s var(--ease);
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

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

.contact-link .link-arrow {
	display: inline-block;
	transition: transform 0.3s var(--ease);
	font-size: 0.75rem;
}

.contact-link:hover .link-arrow {
	transform: translateX(4px);
}

.contact-form {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

.form-group {
	position: relative;
}

.form-group input,
.form-group textarea {
	width: 100%;
	padding: 1rem 0;
	background: transparent;
	border: none;
	border-bottom: 1px solid var(--border);
	color: var(--text);
	font-family: var(--font-sans);
	font-size: 0.95rem;
	transition: border-color 0.3s var(--ease);
	outline: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
	color: var(--text-muted);
	opacity: 0.5;
}

.form-group input:focus,
.form-group textarea:focus {
	border-bottom-color: var(--accent);
}

.form-group textarea {
	height: 120px;
	resize: vertical;
	line-height: 1.7;
}

.submit-btn {
	align-self: flex-start;
	padding: 0.75rem 2.5rem;
	background: transparent;
	color: var(--accent);
	border: 1px solid var(--accent);
	border-radius: 6px;
	font-family: var(--font-sans);
	font-size: 0.875rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	cursor: pointer;
	transition: all 0.3s var(--ease);
}

.submit-btn:hover {
	background: var(--accent);
	color: var(--bg);
	transform: translateY(-2px);
	box-shadow: 0 8px 30px rgba(167, 139, 250, 0.2);
}

/* ============================================
   Footer
   ============================================ */
footer {
	padding: 3rem 0;
	border-top: 1px solid var(--border);
}

.footer-inner {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.footer-copy {
	font-size: 0.8rem;
	color: var(--text-muted);
}

.footer-links {
	display: flex;
	gap: 1.5rem;
}

.footer-links a {
	font-size: 0.8rem;
	color: var(--text-muted);
	text-decoration: none;
	transition: color 0.3s var(--ease);
}

.footer-links a:hover {
	color: var(--text);
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeInUp {
	from {
		opacity: 0;
		transform: translateY(24px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Scroll reveal */
.reveal {
	opacity: 0;
	transform: translateY(30px);
	transition: opacity var(--duration) var(--ease), transform var(--duration) var(--ease);
}

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

/* Stagger children */
.reveal-stagger > * {
	opacity: 0;
	transform: translateY(20px);
	transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}

.reveal-stagger.visible > *:nth-child(1) { transition-delay: 0s; opacity: 1; transform: translateY(0); }
.reveal-stagger.visible > *:nth-child(2) { transition-delay: 0.1s; opacity: 1; transform: translateY(0); }
.reveal-stagger.visible > *:nth-child(3) { transition-delay: 0.2s; opacity: 1; transform: translateY(0); }
.reveal-stagger.visible > *:nth-child(4) { transition-delay: 0.3s; opacity: 1; transform: translateY(0); }
.reveal-stagger.visible > *:nth-child(5) { transition-delay: 0.4s; opacity: 1; transform: translateY(0); }
.reveal-stagger.visible > *:nth-child(6) { transition-delay: 0.5s; opacity: 1; transform: translateY(0); }

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

	html {
		scroll-behavior: auto;
	}

	.hero-label,
	.hero-name,
	.hero-tagline,
	.hero-actions {
		opacity: 1;
		transform: none;
	}

	.reveal,
	.reveal-stagger > * {
		opacity: 1;
		transform: none;
	}
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
	.container {
		padding: 0 1.25rem;
	}

	.nav-links {
		display: none;
	}

	.hero {
		padding: 6rem 0 3rem;
	}

	.hero-glow {
		width: 400px;
		height: 300px;
		top: 15%;
	}

	.hero-first,
	.hero-last {
		font-size: clamp(2.5rem, 12vw, 4rem);
	}

	.hero-actions {
		flex-direction: column;
	}

	.section {
		padding: 4rem 0;
	}

	.about-grid {
		grid-template-columns: 1fr;
		gap: 2.5rem;
	}

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

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

	.contact-layout {
		grid-template-columns: 1fr;
		gap: 2.5rem;
	}

	.footer-inner {
		flex-direction: column;
		gap: 1rem;
		text-align: center;
	}
}

/* ============================================
   404 Page Styles (used by 404.html)
   ============================================ */
.page-404 {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 100vh;
	text-align: center;
	padding: 2rem;
}

.page-404 .error-code {
	font-family: var(--font-serif);
	font-size: clamp(6rem, 15vw, 12rem);
	font-weight: 400;
	line-height: 1;
	letter-spacing: -0.04em;
	color: var(--text);
	margin-bottom: 1rem;
}

.page-404 .error-text {
	font-size: 1rem;
	color: var(--text-muted);
	margin-bottom: 2.5rem;
}

.page-404 .back-link {
	display: inline-block;
	padding: 0.75rem 2rem;
	border: 1px solid var(--border);
	border-radius: 6px;
	color: var(--text);
	font-size: 0.875rem;
	font-weight: 500;
	text-decoration: none;
	transition: all 0.3s var(--ease);
}

.page-404 .back-link:hover {
	border-color: var(--accent);
	color: var(--accent);
}
