/* Modern Nature Portfolio — unified design system */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700&family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,700&display=swap');

:root {
	--color-bg: #152019;
	--color-bg-alt: #1a2a24;
	--color-bg-card: rgba(30, 48, 40, 0.65);
	--color-accent: #5c8a6f;
	--color-accent-light: #8fb39a;
	--color-text: #e8ede9;
	--color-text-muted: rgba(232, 237, 233, 0.72);
	--color-border: rgba(143, 179, 154, 0.22);
	--color-overlay: rgba(21, 32, 25, 0.72);

	--font-sans: 'DM Sans', system-ui, sans-serif;
	--font-display: 'Fraunces', Georgia, serif;

	--radius-sm: 8px;
	--radius-md: 12px;
	--radius-lg: 16px;

	--space-xs: 0.5rem;
	--space-sm: 1rem;
	--space-md: 1.5rem;
	--space-lg: 2.5rem;
	--space-xl: 4rem;

	--nav-height: 4rem;
	--max-width: 1100px;

	--bg-hero: url('../../images/bg/hero-mountains.jpg');
	--bg-page: url('../../images/bg/hero-alpine.jpg');
}

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

html {
	scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}

body {
	font-family: var(--font-sans);
	font-size: 1.05rem;
	font-weight: 400;
	line-height: 1.65;
	color: var(--color-text);
	background: var(--color-bg);
	min-height: 100vh;
	-webkit-font-smoothing: antialiased;
}

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

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

a:hover {
	color: #b8d4c4;
}

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

h1, h2, h3 {
	font-family: var(--font-display);
	font-weight: 600;
	line-height: 1.2;
	color: var(--color-text);
}

h1 { font-size: clamp(2.25rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: var(--space-md); }
h3 { font-size: 1.15rem; margin-bottom: var(--space-xs); }

p + p {
	margin-top: var(--space-sm);
}

/* ——— Layout ——— */

.container {
	width: 100%;
	max-width: var(--max-width);
	margin: 0 auto;
	padding: 0 var(--space-md);
}

.section {
	padding: var(--space-xl) 0;
}

.section-alt {
	background: linear-gradient(180deg, var(--color-bg-alt) 0%, var(--color-bg) 100%);
}

.section-title {
	text-align: center;
	margin-bottom: var(--space-lg);
}

.section-title p {
	color: var(--color-text-muted);
	font-size: 1.1rem;
	margin-top: var(--space-xs);
}

/* ——— Navigation ——— */

.site-nav {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 1000;
	height: var(--nav-height);
	display: flex;
	align-items: center;
	background: rgba(21, 32, 25, 0.55);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border-bottom: 1px solid transparent;
	transition: border-color 0.3s ease, background 0.3s ease;
}

.site-nav.scrolled {
	background: rgba(21, 32, 25, 0.92);
	border-bottom-color: var(--color-border);
}

.site-nav .container {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-sm);
}

.nav-brand {
	font-family: var(--font-display);
	font-weight: 600;
	font-size: 1.1rem;
	color: var(--color-text);
	letter-spacing: 0.02em;
}

.nav-brand:hover {
	color: var(--color-accent-light);
}

.nav-links {
	display: flex;
	align-items: center;
	gap: var(--space-md);
	list-style: none;
}

.nav-links a {
	color: var(--color-text-muted);
	font-size: 0.95rem;
	font-weight: 500;
}

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

.nav-social {
	display: flex;
	gap: var(--space-sm);
	align-items: center;
}

.nav-social a {
	display: flex;
	color: var(--color-text-muted);
}

.nav-social a:hover {
	color: var(--color-accent-light);
}

.nav-toggle {
	display: none;
	background: none;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
	color: var(--color-text);
	cursor: pointer;
	padding: 0.4rem 0.6rem;
	font-size: 1.25rem;
	line-height: 1;
}

.nav-toggle:focus-visible {
	outline: 2px solid var(--color-accent-light);
	outline-offset: 2px;
}

/* ——— Hero ——— */

.hero {
	position: relative;
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: calc(var(--nav-height) + var(--space-xl)) var(--space-md) var(--space-xl);
	overflow: hidden;
}

.hero-bg {
	position: absolute;
	inset: 0;
	background-image: var(--bg-hero);
	background-size: cover;
	background-position: center;
	z-index: 0;
}

.hero-bg::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(
		180deg,
		rgba(21, 32, 25, 0.55) 0%,
		rgba(21, 32, 25, 0.75) 50%,
		var(--color-bg) 100%
	);
}

.hero-content {
	position: relative;
	z-index: 1;
	max-width: 42rem;
}

.hero-eyebrow {
	font-size: 0.9rem;
	font-weight: 500;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--color-accent-light);
	margin-bottom: var(--space-sm);
}

.hero-tagline {
	font-size: clamp(1.05rem, 2.5vw, 1.25rem);
	color: var(--color-text-muted);
	margin: var(--space-md) 0 var(--space-lg);
}

.hero-actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-sm);
	justify-content: center;
}

/* Page hero (projects subpages) */

.page-hero {
	position: relative;
	padding: calc(var(--nav-height) + var(--space-xl)) 0 var(--space-lg);
	text-align: center;
	overflow: hidden;
}

.page-hero-bg {
	position: absolute;
	inset: 0;
	background-image: var(--bg-page);
	background-size: cover;
	background-position: center;
	z-index: 0;
}

.page-hero-bg::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(21, 32, 25, 0.7) 0%, var(--color-bg) 100%);
}

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

.page-hero h1 {
	margin-bottom: var(--space-sm);
}

.page-hero p {
	color: var(--color-text-muted);
	max-width: 36rem;
	margin: 0 auto;
}

.breadcrumb {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.35rem;
	font-size: 0.9rem;
	color: var(--color-text-muted);
	margin-bottom: var(--space-md);
}

.breadcrumb a {
	color: var(--color-accent-light);
}

.breadcrumb span {
	opacity: 0.5;
}

/* ——— Mountain divider ——— */

.mountain-divider {
	display: block;
	width: 100%;
	height: 48px;
	color: var(--color-bg);
	margin-top: -1px;
}

.section-alt + .mountain-divider,
.hero + .mountain-divider {
	color: var(--color-bg-alt);
}

/* ——— Buttons ——— */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.75rem 1.5rem;
	font-family: var(--font-sans);
	font-size: 0.95rem;
	font-weight: 600;
	border-radius: var(--radius-md);
	border: 1px solid transparent;
	cursor: pointer;
	transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
	text-decoration: none;
}

.btn-primary {
	background: var(--color-accent);
	color: #fff;
	border-color: var(--color-accent);
}

.btn-primary:hover {
	background: #6d9d7f;
	color: #fff;
	transform: translateY(-1px);
}

.btn-outline {
	background: rgba(255, 255, 255, 0.08);
	color: var(--color-text);
	border-color: var(--color-border);
}

.btn-outline:hover {
	background: rgba(255, 255, 255, 0.14);
	color: var(--color-text);
}

.btn-small {
	padding: 0.5rem 1rem;
	font-size: 0.85rem;
}

/* ——— Cards ——— */

.card {
	background: var(--color-bg-card);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-lg);
	padding: var(--space-lg);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
}

.card p {
	color: var(--color-text-muted);
	text-align: justify;
}

/* ——— Skills / tags ——— */

.skills-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	justify-content: center;
}

.skill-tag {
	display: inline-block;
	padding: 0.4rem 0.9rem;
	font-size: 0.88rem;
	font-weight: 500;
	background: rgba(92, 138, 111, 0.2);
	border: 1px solid rgba(143, 179, 154, 0.35);
	border-radius: 2rem;
	color: var(--color-text);
}

.tech-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: var(--space-sm) 0;
}

.tech-tags .tag {
	padding: 0.3rem 0.65rem;
	border-radius: 2rem;
	font-size: 0.78rem;
	font-weight: 500;
	border: 1px solid var(--color-border);
	background: rgba(255, 255, 255, 0.06);
	color: var(--color-text-muted);
	transition: transform 0.2s ease, color 0.2s ease;
}

.tech-tags .tag:hover {
	color: var(--color-text);
	transform: translateY(-1px);
}

.tag.core { background: rgba(66, 139, 202, 0.12); border-color: rgba(66, 139, 202, 0.3); }
.tag.dev-tools { background: rgba(241, 196, 15, 0.1); border-color: rgba(241, 196, 15, 0.25); }
.tag.frameworks { background: rgba(92, 184, 92, 0.1); border-color: rgba(92, 184, 92, 0.25); }
.tag.infra-devops { background: rgba(153, 84, 187, 0.1); border-color: rgba(153, 84, 187, 0.25); }
.tag.devops-monitoring { background: rgba(18, 147, 161, 0.1); border-color: rgba(18, 147, 161, 0.25); }
.tag.database { background: rgba(212, 112, 18, 0.1); border-color: rgba(212, 112, 18, 0.25); }
.tag.security { background: rgba(217, 34, 28, 0.1); border-color: rgba(217, 34, 28, 0.25); }

/* ——— Forms ——— */

.contact-form .fields {
	display: grid;
	gap: var(--space-md);
}

.contact-form .field-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--space-md);
}

.contact-form label {
	display: block;
	font-size: 0.9rem;
	font-weight: 500;
	margin-bottom: 0.4rem;
	color: var(--color-text-muted);
}

.contact-form input,
.contact-form textarea {
	width: 100%;
	padding: 0.75rem 1rem;
	font-family: var(--font-sans);
	font-size: 1rem;
	color: var(--color-text);
	background: rgba(0, 0, 0, 0.25);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
	transition: border-color 0.2s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
	outline: none;
	border-color: var(--color-accent);
}

.contact-form textarea {
	resize: vertical;
	min-height: 120px;
}

.form-actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-sm);
	margin-top: var(--space-md);
}

.form-actions button {
	font-family: var(--font-sans);
}

.contact-social {
	display: flex;
	gap: var(--space-md);
	margin-top: var(--space-lg);
	justify-content: center;
}

/* ——— Resume ——— */

.resume-viewer {
	width: 100%;
	height: 75vh;
	min-height: 400px;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-md);
	overflow: hidden;
	background: rgba(0, 0, 0, 0.3);
}

.resume-viewer iframe {
	width: 100%;
	height: 100%;
	border: none;
}

.resume-fallback {
	padding: var(--space-lg);
	text-align: center;
}

.resume-actions {
	text-align: center;
	margin-top: var(--space-md);
}

/* ——— Projects grid ——— */

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

.project-card {
	background: var(--color-bg-card);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-lg);
	overflow: hidden;
	cursor: pointer;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
	display: flex;
	flex-direction: column;
}

.project-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.project-card-featured {
	border-color: rgba(143, 179, 154, 0.45);
	box-shadow: 0 0 0 1px rgba(92, 138, 111, 0.25);
}

.project-card-badge {
	position: absolute;
	top: 0.75rem;
	left: 0.75rem;
	z-index: 2;
	padding: 0.25rem 0.65rem;
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	background: var(--color-accent);
	color: #fff;
	border-radius: 2rem;
}

.project-card-image {
	position: relative;
	width: 100%;
	padding-top: 56.25%;
	overflow: hidden;
	background: rgba(0, 0, 0, 0.3);
}

.project-card-image img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.35s ease;
}

.project-card:hover .project-card-image img {
	transform: scale(1.04);
}

.project-card-body {
	padding: var(--space-md);
	flex: 1;
	display: flex;
	flex-direction: column;
}

.project-card-body h3 {
	margin-bottom: var(--space-xs);
}

.project-card-body p {
	font-size: 0.95rem;
	color: var(--color-text-muted);
	flex: 1;
}

.project-card-actions {
	display: flex;
	gap: var(--space-sm);
	margin-top: var(--space-md);
}

.project-card-actions .btn {
	pointer-events: auto;
}

/* ——— Gallery ——— */

.gallery {
	position: relative;
	width: 100%;
	height: 70vh;
	min-height: 320px;
	margin: var(--space-lg) 0;
	overflow: hidden;
	border-radius: var(--radius-md);
	border: 1px solid var(--color-border);
	background: rgba(0, 0, 0, 0.35);
}

.gallery-container {
	display: flex;
	transition: transform 0.5s ease;
	height: 100%;
}

@media (prefers-reduced-motion: reduce) {
	.gallery-container {
		transition: none;
	}
}

.gallery-item {
	min-width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: var(--space-sm);
}

.gallery-item img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
}

.gallery-nav {
	position: absolute;
	bottom: 1.25rem;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	gap: 0.5rem;
	z-index: 2;
}

.gallery-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: rgba(143, 179, 154, 0.35);
	cursor: pointer;
	transition: background 0.3s ease;
	border: none;
	padding: 0;
}

.gallery-dot.active {
	background: var(--color-accent-light);
}

.gallery-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 2.5rem;
	height: 2.5rem;
	background: rgba(21, 32, 25, 0.75);
	border: 1px solid var(--color-border);
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--color-text);
	font-size: 1.25rem;
	z-index: 2;
	transition: background 0.2s ease;
	user-select: none;
}

.gallery-arrow:hover {
	background: rgba(21, 32, 25, 0.95);
}

.gallery-prev { left: 0.75rem; }
.gallery-next { right: 0.75rem; }

/* ——— Feature sections ——— */

.feature-section {
	margin: var(--space-xl) 0;
	padding: var(--space-lg);
	background: var(--color-bg-card);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-lg);
}

.feature-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: var(--space-md);
	margin-top: var(--space-md);
}

.feature-item {
	padding: var(--space-md);
	background: rgba(0, 0, 0, 0.2);
	border-radius: var(--radius-md);
	border: 1px solid var(--color-border);
	transition: transform 0.2s ease;
}

.feature-item:hover {
	transform: translateY(-3px);
}

.feature-item p {
	font-size: 0.95rem;
	color: var(--color-text-muted);
	margin-top: 0.35rem;
}

.page-content {
	padding: var(--space-lg) 0 var(--space-xl);
}

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

/* ——— Footer ——— */

.site-footer {
	padding: var(--space-lg) 0;
	text-align: center;
	border-top: 1px solid var(--color-border);
	color: var(--color-text-muted);
	font-size: 0.9rem;
}

.site-footer a {
	color: var(--color-text-muted);
}

.site-footer a:hover {
	color: var(--color-accent-light);
}

.site-footer .photo-credit {
	margin-top: 0.5rem;
	font-size: 0.8rem;
	opacity: 0.7;
}

/* ——— 404 ——— */

.error-page {
	min-height: calc(100vh - var(--nav-height));
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: calc(var(--nav-height) + var(--space-xl)) var(--space-md);
}

.error-page h1 {
	margin-bottom: var(--space-sm);
}

.error-page p {
	color: var(--color-text-muted);
	margin-bottom: var(--space-lg);
}

/* ——— Scroll reveal ——— */

.reveal {
	opacity: 0;
	transform: translateY(20px);
	transition: opacity 0.6s ease, transform 0.6s ease;
}

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

@media (prefers-reduced-motion: reduce) {
	.reveal {
		opacity: 1;
		transform: none;
		transition: none;
	}
}

/* ——— Mobile nav ——— */

@media (max-width: 768px) {
	.nav-toggle {
		display: block;
	}

	.nav-menu {
		position: fixed;
		top: var(--nav-height);
		left: 0;
		right: 0;
		background: rgba(21, 32, 25, 0.98);
		border-bottom: 1px solid var(--color-border);
		padding: var(--space-md);
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		display: none;
	}

	.nav-menu.open {
		display: flex;
	}

	.nav-links {
		flex-direction: column;
		align-items: flex-start;
		gap: 0;
		width: 100%;
	}

	.nav-links li {
		width: 100%;
		border-bottom: 1px solid var(--color-border);
	}

	.nav-links a {
		display: block;
		padding: var(--space-sm) 0;
	}

	.nav-social {
		padding-top: var(--space-sm);
	}

	.contact-form .field-row {
		grid-template-columns: 1fr;
	}

	.hero-actions {
		flex-direction: column;
		align-items: stretch;
	}

	.gallery {
		height: 50vh;
	}
}
