/* ========================================
   Chema Alfonso — Personal Site
   ======================================== */

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

:root {
	--bg: #0a0a0a;
	--bg-elevated: #111111;
	--bg-card: #161616;
	--text: #e8e8e8;
	--text-muted: #888888;
	--accent: #5eead4;
	--accent-dim: rgba(94, 234, 212, 0.1);
	--border: #222222;
	--font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
	--max-width: 1100px;
	--nav-height: 72px;
}

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

body {
	font-family: var(--font);
	background-color: var(--bg);
	color: var(--text);
	line-height: 1.7;
	font-size: 16px;
	font-weight: 300;
	overflow-x: hidden;
}

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

img {
	max-width: 100%;
	display: block;
}

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

/* --- Navigation --- */
.nav {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	height: var(--nav-height);
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 32px;
	z-index: 100;
	background: rgba(10, 10, 10, 0.8);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border-bottom: 1px solid transparent;
	transition: border-color 0.3s;
}

.nav--scrolled {
	border-bottom-color: var(--border);
}

.nav__logo {
	font-weight: 700;
	font-size: 20px;
	letter-spacing: -0.5px;
	color: var(--text);
	transition: color 0.3s;
}

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

.nav__links {
	display: flex;
	list-style: none;
	gap: 36px;
}

.nav__links a {
	font-size: 14px;
	font-weight: 400;
	color: var(--text-muted);
	transition: color 0.3s;
	letter-spacing: 0.3px;
}

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

.nav__lang {
	background: none;
	border: 1px solid var(--border);
	color: var(--text-muted);
	padding: 6px 14px;
	border-radius: 6px;
	font-family: var(--font);
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.3s;
	letter-spacing: 0.5px;
}

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

.nav__menu {
	display: none;
	background: none;
	border: none;
	cursor: pointer;
	padding: 8px;
	flex-direction: column;
	gap: 6px;
}

.nav__menu span {
	display: block;
	width: 24px;
	height: 1.5px;
	background: var(--text);
	transition: all 0.3s;
}

.nav__menu.active span:first-child {
	transform: rotate(45deg) translate(2.5px, 2.5px);
}

.nav__menu.active span:last-child {
	transform: rotate(-45deg) translate(2.5px, -2.5px);
}

/* --- Mobile Menu --- */
.mobile-menu {
	position: fixed;
	top: var(--nav-height);
	left: 0;
	right: 0;
	bottom: 0;
	background: var(--bg);
	z-index: 99;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s;
}

.mobile-menu.active {
	opacity: 1;
	pointer-events: all;
}

.mobile-menu__links {
	list-style: none;
	text-align: center;
	display: flex;
	flex-direction: column;
	gap: 32px;
}

.mobile-menu__links a {
	font-size: 28px;
	font-weight: 300;
	color: var(--text-muted);
	transition: color 0.3s;
}

.mobile-menu__links a:hover {
	color: var(--text);
}

/* --- Hero --- */
.hero {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 0 24px;
	position: relative;
}

.hero__greeting {
	font-size: 16px;
	font-weight: 400;
	color: var(--accent);
	letter-spacing: 2px;
	text-transform: uppercase;
	margin-bottom: 16px;
}

.hero__name {
	font-size: clamp(48px, 10vw, 96px);
	font-weight: 700;
	letter-spacing: -2px;
	line-height: 1.05;
	margin-bottom: 20px;
	background: linear-gradient(135deg, var(--text) 0%, var(--text-muted) 100%);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
}

.hero__tagline {
	font-size: clamp(16px, 2.5vw, 22px);
	font-weight: 300;
	color: var(--text-muted);
	letter-spacing: 1px;
}

.hero__scroll {
	position: absolute;
	bottom: 40px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
}

.hero__scroll-line {
	width: 1px;
	height: 48px;
	background: linear-gradient(to bottom, var(--accent), transparent);
	animation: scroll-pulse 2s ease-in-out infinite;
}

@keyframes scroll-pulse {
	0%, 100% { opacity: 0.3; transform: scaleY(0.6); }
	50% { opacity: 1; transform: scaleY(1); }
}

/* --- Section --- */
.section {
	padding: 120px 0;
}

.section__title {
	font-size: 14px;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 3px;
	color: var(--accent);
	margin-bottom: 64px;
}

/* --- About --- */
.about__content {
	display: grid;
	grid-template-columns: 280px 1fr;
	gap: 64px;
	align-items: start;
}

.about__img {
	width: 280px;
	height: 340px;
	object-fit: cover;
	object-position: 40% center;
	border-radius: 12px;
	border: 1px solid var(--border);
	filter: grayscale(100%);
	transition: filter 0.5s ease;
}

.about__img:hover {
	filter: grayscale(0%);
}

.about__text p {
	color: var(--text-muted);
	margin-bottom: 20px;
	font-size: 17px;
	line-height: 1.8;
}

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

.about__text strong {
	color: var(--text);
	font-weight: 500;
}

.about__text a {
	color: var(--text);
	text-decoration: underline;
	text-decoration-color: var(--accent);
	text-underline-offset: 3px;
	transition: color 0.3s, text-decoration-color 0.3s;
}

.about__text a:hover,
.about__text a:hover strong {
	color: var(--accent);
}

/* --- Stack --- */
.stack__category {
	font-size: 13px;
	font-weight: 500;
	color: var(--text-muted);
	text-transform: uppercase;
	letter-spacing: 1.5px;
	margin-bottom: 16px;
	margin-top: 40px;
}

.stack__category:first-of-type {
	margin-top: 0;
}

.stack__grid {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 8px;
}

.stack__pill {
	padding: 10px 22px;
	border: 1px solid var(--border);
	border-radius: 100px;
	font-size: 14px;
	font-weight: 400;
	color: var(--text-muted);
	transition: all 0.3s;
	cursor: default;
}

.stack__pill:hover {
	border-color: var(--accent);
	color: var(--accent);
	background: var(--accent-dim);
}

/* --- Projects --- */
.projects__grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 24px;
}

.project-card {
	display: block;
	background: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: 16px;
	padding: 40px;
	transition: all 0.4s;
	position: relative;
	overflow: hidden;
}

.project-card::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 1px;
	background: linear-gradient(90deg, transparent, var(--accent), transparent);
	opacity: 0;
	transition: opacity 0.4s;
}

.project-card:hover {
	border-color: var(--border);
	transform: translateY(-4px);
	background: var(--bg-elevated);
}

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

.project-card__number {
	font-size: 13px;
	font-weight: 500;
	color: var(--accent);
	margin-bottom: 20px;
	font-variant-numeric: tabular-nums;
}

.project-card__name {
	font-size: 22px;
	font-weight: 600;
	margin-bottom: 12px;
	letter-spacing: -0.3px;
}

.project-card__desc {
	font-size: 15px;
	color: var(--text-muted);
	line-height: 1.7;
	margin-bottom: 24px;
}

.project-card__link {
	font-size: 14px;
	font-weight: 500;
	color: var(--accent);
	transition: letter-spacing 0.3s;
}

.project-card:hover .project-card__link {
	letter-spacing: 1px;
}

.project-card--github {
	border-style: dashed;
	background: transparent;
}

.project-card--github:hover {
	background: var(--bg-card);
}

/* --- Contact --- */
.contact {
	text-align: center;
}

.contact__subtitle {
	font-size: 18px;
	color: var(--text-muted);
	margin-bottom: 48px;
}

.contact__links {
	display: flex;
	justify-content: center;
	gap: 24px;
	flex-wrap: wrap;
}

.contact__link {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 28px;
	border: 1px solid var(--border);
	border-radius: 12px;
	font-size: 15px;
	color: var(--text-muted);
	transition: all 0.3s;
}

.contact__link:hover {
	border-color: var(--accent);
	color: var(--accent);
	background: var(--accent-dim);
}

.contact__icon {
	width: 20px;
	height: 20px;
	flex-shrink: 0;
}

/* --- Footer --- */
.footer {
	padding: 32px 0;
	border-top: 1px solid var(--border);
}

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

.footer__copy {
	font-size: 13px;
	color: var(--text-muted);
}

.footer__services {
	font-size: 13px;
	color: var(--text-muted);
}

.footer__services a {
	color: var(--accent);
	transition: opacity 0.3s;
}

.footer__services a:hover {
	opacity: 0.7;
}

/* --- Animations --- */
.fade-in {
	opacity: 0;
	transform: translateY(24px);
	transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* Hero animations play immediately */
.hero .fade-in {
	animation: hero-enter 0.8s ease forwards;
}

.hero .fade-in:nth-child(1) { animation-delay: 0.1s; }
.hero .fade-in:nth-child(2) { animation-delay: 0.25s; }
.hero .fade-in:nth-child(3) { animation-delay: 0.4s; }

@keyframes hero-enter {
	from {
		opacity: 0;
		transform: translateY(24px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* --- Responsive --- */
@media (max-width: 768px) {
	.nav__links {
		display: none;
	}

	.nav__menu {
		display: flex;
	}

	.section {
		padding: 80px 0;
	}

	.section__title {
		margin-bottom: 40px;
	}

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

	.about__img {
		width: 200px;
		height: 240px;
		margin: 0 auto;
	}

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

	.project-card {
		padding: 28px;
	}

	.contact__links {
		flex-direction: column;
		align-items: center;
	}

	.contact__link {
		width: 100%;
		max-width: 320px;
		justify-content: center;
	}

	.footer__inner {
		flex-direction: column;
		gap: 12px;
		text-align: center;
	}
}

@media (max-width: 480px) {
	.hero__name {
		letter-spacing: -1px;
	}

	.nav {
		padding: 0 20px;
	}
}
