:root {
	--bg: #F6F4F0;
	--text: #111318;
	--muted: #5C6370;
	--line: #D7E3DE;
	--accent: #0E6B5C;
	--accent-soft: rgba(14, 107, 92, 0.18);
	--accent-border: rgba(14, 107, 92, 0.42);
}

* {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: Inter, "Segoe UI", sans-serif;
	font-size: 16px;
	font-weight: 400;
	line-height: 1.6;
}

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

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

.page {
	width: min(1120px, calc(100% - 48px));
	margin: 32px auto 24px;
}

/* —— Mast: mobile-first, name overlay on photo —— */

.mast {
	display: grid;
	grid-template-columns: 1fr;
	grid-template-rows: auto auto;
	margin: 0;
	background: var(--bg);
}

/* Unwrap on mobile so photo / overlay / links keep current grid placement */
.mast-side {
	display: contents;
}

.mast-photo {
	grid-column: 1;
	grid-row: 1;
	overflow: hidden;
	width: 100%;
	aspect-ratio: 3 / 4;
	max-height: 72vh;
	background: #1a1c1e;
}

.header-photo {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center 22%;
}

.mast-copy {
	grid-column: 1;
	grid-row: 1;
	z-index: 1;
	align-self: end;
	padding: 72px 24px 28px;
	background: linear-gradient(
		to top,
		rgba(17, 19, 24, 0.88) 0%,
		rgba(17, 19, 24, 0.55) 45%,
		rgba(17, 19, 24, 0) 100%
	);
	color: #fff;
}

.place {
	margin: 0 0 12px;
	color: rgba(246, 244, 240, 0.72);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.08em;
	line-height: 1.4;
	text-transform: uppercase;
}

h1 {
	margin: 0;
	font-family: "Plus Jakarta Sans", Inter, sans-serif;
	font-size: clamp(1.85rem, 8.5vw, 3.25rem);
	font-weight: 700;
	letter-spacing: -0.03em;
	line-height: 1.05;
	color: #fff;
}

.role {
	max-width: 22rem;
	margin: 16px 0 0;
	color: rgba(246, 244, 240, 0.82);
	font-family: Inter, "Segoe UI", sans-serif;
	font-size: 16px;
	line-height: 1.45;
}

h1::after {
	content: "";
	display: block;
	width: 40px;
	height: 3px;
	margin-top: 14px;
	background: var(--accent);
	border-radius: 2px;
}

.project {
	position: relative;
	padding: 80px 0;
	border-bottom: 1px solid var(--line);
}

.project.has-shot {
	padding-left: 20px;
	margin-left: 0;
}

.project.has-shot::before {
	content: "";
	position: absolute;
	left: 0;
	top: 40px;
	bottom: 40px;
	width: 3px;
	background: var(--accent);
	border-radius: 2px;
}

.project:last-child {
	border-bottom: 0;
}

.project.has-shot {
	display: grid;
	grid-template-columns: 0.9fr 1.1fr;
	gap: 48px;
	align-items: center;
}

.project.has-shot.flip .shot {
	order: -1;
}

.project.has-shot.flip {
	grid-template-columns: 1.1fr 0.9fr;
}

.shot {
	overflow: hidden;
	border-radius: 16px;
	aspect-ratio: 16 / 10;
	border: 1px solid var(--accent-border);
	box-shadow: 0 0 0 4px var(--accent-soft);
}

.shot img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 150ms ease;
}

.project:hover .shot img {
	transform: scale(1.02);
}

.project:not(.has-shot) .project-copy {
	max-width: 40rem;
}

.stack {
	margin: 0 0 12px;
	color: var(--muted);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.06em;
	line-height: 1.4;
	text-transform: uppercase;
}

h3 {
	margin: 0 0 12px;
	font-family: "Plus Jakarta Sans", Inter, sans-serif;
	font-size: clamp(1.75rem, 2.5vw, 2.25rem);
	font-weight: 600;
	line-height: 1.15;
}

.project-copy > p {
	margin: 0;
}

.view {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin: 20px 0 0;
}

.project-copy .view {
	margin: 8px 0 16px;
}

.mast-links {
	grid-column: 1;
	grid-row: 1;
	z-index: 2;
	align-self: start;
	justify-self: end;
	margin: 0;
	padding: 16px;
}

.icon-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	color: var(--accent);
	background: #fff;
	border: 1px solid var(--accent-border);
	border-radius: 12px;
	box-shadow: 0 0 0 3px var(--accent-soft);
	transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.icon-link svg {
	width: 20px;
	height: 20px;
	display: block;
}

.icon-link:hover {
	color: #fff;
	background: var(--accent);
	border-color: var(--accent);
}

.note {
	color: var(--muted);
	font-size: 16px;
	line-height: 1.6;
}

/* —— Desktop: split mast, photo left, text+icons right —— */

@media (min-width: 801px) {
	.mast {
		grid-template-columns: 55% 1fr;
		grid-template-rows: 1fr;
		height: 100vh;
		max-height: 100vh;
		width: 100%;
		align-items: stretch;
		overflow: hidden;
	}

	.mast-photo {
		grid-column: 1;
		grid-row: 1;
		aspect-ratio: auto;
		max-height: none;
		height: 100%;
		min-height: 0;
	}

	.header-photo {
		object-position: center 18%;
	}

	.mast-side {
		display: flex;
		flex-direction: column;
		justify-content: center;
		grid-column: 2;
		grid-row: 1;
		padding: 48px clamp(32px, 5vw, 72px);
		background: var(--bg);
		min-height: 0;
	}

	.mast-copy {
		grid-column: auto;
		grid-row: auto;
		align-self: auto;
		padding: 0;
		background: transparent;
		color: var(--text);
		min-height: 0;
	}

	.place {
		color: var(--muted);
	}

	h1 {
		font-size: clamp(2.5rem, 3.6vw, 4rem);
		white-space: nowrap;
		color: var(--text);
	}

	h1::after {
		margin-top: 16px;
	}

	.role {
		color: var(--muted);
		font-size: 17px;
	}

	.mast-links {
		grid-column: auto;
		grid-row: auto;
		z-index: auto;
		align-self: auto;
		justify-self: auto;
		margin: 24px 0 0;
		padding: 0;
		background: transparent;
	}

	.page {
		margin-top: 48px;
	}
}

@media (max-width: 800px) {
	.page {
		width: min(1120px, calc(100% - 32px));
		margin-top: 16px;
	}

	.mast-copy {
		padding: 64px 16px 24px;
	}

	.mast-links {
		padding: 12px;
	}

	.mast-links .icon-link {
		box-shadow:
			0 2px 10px rgba(0, 0, 0, 0.35),
			0 0 0 3px var(--accent-soft);
	}

	.project.has-shot,
	.project.has-shot.flip {
		grid-template-columns: 1fr;
		gap: 24px;
		padding: 48px 0 48px 20px;
		margin-left: 0;
	}

	.project.has-shot::before {
		top: 24px;
		bottom: 24px;
	}

	.project.has-shot.flip .shot {
		order: 0;
	}

	.project {
		padding: 48px 0;
	}
}

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

	.shot img {
		transition: none;
	}

	.project:hover .shot img {
		transform: none;
	}
}
