/* ---------- Reset & base ---------- */
* {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--color-text);
	background: var(--color-bg);
	line-height: 1.6;
}

h1,
h2,
h3 {
	font-weight: 600;
	color: var(--color-primary);
	margin: 0 0 0.5em;
}

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

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

:root {
	/* Base palette */
	--color-bg: #fff;
	--color-text: #26313c;
	--color-primary: #16232f;
	--color-primary-hover: #24384a;
	--color-accent: #2d6a8f;
	--color-accent-light: #3f88b3;
	--color-surface: #f5f6f8;
	--color-border: #e1e4e8;

	/* Text/borders for content sitting on a dark (--color-primary) background */
	--color-text-inverse: #ffffff;
	--color-text-muted-inverse: #cfd6dc;
	--color-hero-subtext: #d7dee4;
	--color-border-inverse: rgba(255, 255, 255, 0.2);

	/* Drop shadows */
	--shadow-color-soft: rgba(0, 0, 0, 0.08);
	--shadow-color: rgba(0, 0, 0, 0.1);
	--shadow-color-strong: rgba(0, 0, 0, 0.15);

	/* Tinted overlays drawn over images (share --color-primary's rgb) */
	--overlay-hero-top: rgba(22, 35, 47, 0.15);
	--overlay-hero-bottom: rgba(22, 35, 47, 0.55);
	--overlay-card-label: rgba(22, 35, 47, 0.85);

	--max-width: 1200px;
}

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

section {
	padding: 48px 0;
	scroll-margin-top: 64px;
}

.section-title {
	font-size: 1.6rem;
	border-bottom: 2px solid var(--color-border);
	padding-bottom: 16px;
	margin-bottom: 32px;
}

[hidden] {
	display: none !important;
}

/* ---------- Nav ---------- */
.site-nav {
	position: sticky;
	top: 0;
	z-index: 100;
	background: var(--color-bg);
	box-shadow: 0 1px 4px var(--shadow-color-soft);
}

.nav-inner {
	max-width: var(--max-width);
	margin: 0 auto;
	padding: 0 24px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 64px;
}

.nav-logo {
	display: flex;
	align-items: center;
}

.nav-logo img {
	height: 52px;
	width: auto;
}

.nav-links {
	display: flex;
	gap: 8px;
}

.nav-links a {
	padding: 10px 16px;
	border-radius: 4px;
	font-weight: 500;
	transition: background 0.15s, color 0.15s;
}

.nav-links a:hover {
	background: var(--color-surface);
	color: var(--color-accent);
}

.nav-toggle {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 32px;
	height: 32px;
	background: none;
	border: none;
	cursor: pointer;
	padding: 0;
}

.nav-toggle span {
	display: block;
	height: 2px;
	background: var(--color-primary);
	border-radius: 2px;
}

/* ---------- Hero ---------- */
.hero {
	position: relative;
	max-height: 560px;
	overflow: hidden;
}

.hero img {
	width: 100%;
	height: 560px;
	object-fit: cover;
}

.hero::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, var(--overlay-hero-top) 0%, var(--overlay-hero-bottom) 100%);
}

.hero-text {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	z-index: 1;
}

.hero-text h1 {
	color: var(--color-text-inverse);
	font-size: 2.6rem;
	letter-spacing: 0.5px;
	margin: 0;
}

.hero-text span.light {
	font-weight: 300;
	color: var(--color-hero-subtext);
}

/* ---------- Grids (projects & team) ---------- */
.card-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 24px;
}

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

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

/* Collapsed height = 2 full card rows + half of a 3rd (card height 220px + 24px gap, twice, plus half a row: 220+24+220+24+110). Update this if .project-card img height or .card-grid gap change. */
.project-grid-wrap {
	position: relative;
	max-height: 598px;
	overflow: hidden;
	transition: max-height 0.3s ease;
}

.project-grid-fade {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 120px;
	background: linear-gradient(to bottom, transparent, var(--color-bg));
	pointer-events: none;
	transition: opacity 0.2s ease;
}

.project-grid-wrap.expanded .project-grid-fade {
	opacity: 0;
}

.see-more-wrap {
	text-align: center;
	margin-top: 24px;
}

.see-more-wrap.hidden {
	display: none;
}

.project-card {
	position: relative;
	border-radius: 6px;
	overflow: hidden;
	box-shadow: 0 1px 6px var(--shadow-color);
	cursor: pointer;
	transition: transform 0.15s, box-shadow 0.15s;
}

.project-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 6px 16px var(--shadow-color-strong);
}

.project-card img {
	width: 100%;
	height: 220px;
	object-fit: cover;
}

.project-card .card-label {
	position: absolute;
	top: 0;
	left: 0;
	background: var(--overlay-card-label);
	color: var(--color-text-inverse);
	padding: 8px 14px;
	font-weight: 500;
	font-size: 0.95rem;
}

.team-card {
	text-align: left;
}

.team-card img {
	width: 250px;
	height: 400px;
	margin: 0 auto;
	object-fit: cover;
	object-position: top;
	border-radius: 6px;
}

.team-card h3 {
	margin-top: 16px;
	margin-bottom: 2px;
}

.team-card .title {
	color: var(--color-accent);
	font-size: 0.9rem;
	font-weight: 500;
	margin-bottom: 8px;
}

/* ---------- About ---------- */
.about-subsection+.about-subsection {
	margin-top: 32px;
}

.about-heading {
	font-size: 1.1rem;
	color: var(--color-accent);
	margin-bottom: 8px;
}

#about p,
#project-description {
	text-indent: 2em;
	text-align: justify;
}

.contact-email {
	color: var(--color-accent);
	font-weight: 600;
	text-decoration: underline;
}

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

/* ---------- Contact ---------- */
form {
	max-width: 560px;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.field {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid var(--color-border);
	border-radius: 4px;
	font-size: 1rem;
	font-family: inherit;
}

.field:focus {
	outline: none;
	border-color: var(--color-accent);
}

textarea.field {
	resize: vertical;
	min-height: 100px;
}

.btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	width: fit-content;
	background: var(--color-primary);
	color: var(--color-text-inverse);
	border: none;
	padding: 12px 22px;
	border-radius: 4px;
	font-size: 1rem;
	font-weight: 500;
	cursor: pointer;
	transition: background 0.15s;
}

.btn:hover {
	background: var(--color-primary-hover);
}

.btn svg {
	width: 16px;
	height: 16px;
	fill: currentColor;
}

/* ---------- Hiring banner ---------- */
.hiring-banner {
	background: var(--color-primary);
	color: var(--color-text-muted-inverse);
	text-align: center;
}

.hiring-banner .section-title {
	color: var(--color-text-inverse);
	border-bottom-color: var(--color-border-inverse);
}

.hiring-banner p {
	max-width: 640px;
	margin: 0 auto;
}

.hiring-banner .contact-email {
	color: var(--color-accent-light);
}

.hiring-banner .contact-email:hover {
	color: var(--color-text-inverse);
}

/* ---------- Map ---------- */
#map-wrap {
	margin: 48px 0;
	line-height: 0;
}

#map-wrap iframe {
	width: 100%;
	height: 450px;
	border: 0;
	display: block;
}

/* ---------- Project detail view ---------- */
#project-view {
	max-width: 900px;
	margin: 0 auto;
	padding: 48px 24px;
}

.back-link {
	display: inline-block;
	margin-bottom: 24px;
	color: var(--color-accent);
	font-weight: 500;
}

.back-link:hover {
	text-decoration: underline;
}

#project-images img {
	display: block;
	width: 100%;
	height: 480px;
	object-fit: contain;
	background: var(--color-surface);
	border-radius: 6px;
	margin-top: 24px;
}

/* ---------- Footer ---------- */
footer {
	background: var(--color-primary);
	color: var(--color-text-muted-inverse);
	text-align: center;
	padding: 24px;
}

/* ---------- Mobile nav ---------- */
@media (max-width: 700px) {
	.nav-toggle {
		display: flex;
	}

	.nav-links {
		position: absolute;
		top: 64px;
		left: 0;
		right: 0;
		background: var(--color-bg);
		flex-direction: column;
		gap: 0;
		box-shadow: 0 4px 8px var(--shadow-color);
		max-height: 0;
		overflow: hidden;
		transition: max-height 0.2s ease;
	}

	.nav-links.open {
		max-height: 240px;
	}

	.nav-links a {
		padding: 14px 24px;
		border-radius: 0;
		border-bottom: 1px solid var(--color-border);
	}

	.hero-text h1 {
		font-size: 1.9rem;
	}
}
