/* Shared styles for every page: colours, type, nav, buttons, contact, footer. */
:root {
	--bg: #f8fafc;
	--surface: #ffffff;
	--text: #0f172a;
	--muted: #475569;
	--border: #e2e8f0;
	--accent: #2563eb;
	--accent-hover: #1d4ed8;
	--accent-soft: #eff6ff;
	--dark: #0f172a;
	--radius: 12px;
	--shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.1);
	--shadow-lg: 0 12px 24px -6px rgba(15, 23, 42, 0.15);
	--nav-h: 4rem;
	--max-w: 1120px;
}

*,
*::before,
*::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}
html {
	scroll-padding-top: var(--nav-h);
	scroll-behavior: smooth;
}
body {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	font-size: 1rem;
	line-height: 1.6;
	color: var(--text);
	background: var(--bg);
	-webkit-font-smoothing: antialiased;
}
[hidden] {
	display: none !important; /* beat display rules on buttons and sections */
}
img {
	max-width: 100%;
	display: block;
}
a {
	color: var(--accent);
	text-decoration: none;
}
h1,
h2,
h3 {
	line-height: 1.2;
	letter-spacing: -0.02em;
}
main {
	flex: 1 0 auto;
	display: flex;
	flex-direction: column;
	padding-top: var(--nav-h);
}
#contact {
	margin-top: auto; /* keep the dark contact band flush with the footer */
}
.container {
	width: 100%;
	max-width: var(--max-w);
	margin: 0 auto;
	padding: 0 1.5rem;
}
.section-title {
	font-size: clamp(1.75rem, 3vw, 2.25rem);
	font-weight: 700;
	margin-bottom: 0.5rem;
}
.section-intro {
	color: var(--muted);
	margin-bottom: 2.5rem;
}

/* ---------- Nav ---------- */
#navbar {
	position: fixed;
	inset: 0 0 auto 0;
	z-index: 10;
	height: var(--nav-h);
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 max(1.5rem, calc((100% - var(--max-w)) / 2 + 1.5rem));
	background: rgba(255, 255, 255, 0.85);
	backdrop-filter: saturate(180%) blur(12px);
	-webkit-backdrop-filter: saturate(180%) blur(12px);
	border-bottom: 1px solid var(--border);
}
#logo {
	display: flex;
	align-items: center;
	gap: 0.625rem;
	color: var(--text);
	font-weight: 700;
	font-size: 1.125rem;
	letter-spacing: -0.01em;
}
#logo img {
	width: 2rem;
	height: 2rem;
}
.nav_buttons {
	display: flex;
	align-items: center;
	gap: 2rem;
}
.nav_buttons a {
	color: var(--muted);
	font-weight: 500;
	font-size: 0.95rem;
	transition: color 150ms ease;
}
.nav_buttons a:hover,
.nav_buttons a[aria-current="page"] {
	color: var(--text);
}
.menu-toggle {
	display: none;
	width: 2.75rem;
	height: 2.75rem;
	margin-right: -0.5rem;
	border: 0;
	border-radius: 8px;
	background: transparent;
	cursor: pointer;
	align-items: center;
	justify-content: center;
}
.menu-toggle:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}
.menu-button,
.menu-button::before,
.menu-button::after {
	display: block;
	width: 22px;
	height: 2px;
	border-radius: 2px;
	background: var(--text);
	transition: transform 250ms ease, background 250ms ease;
}
.menu-button {
	position: relative;
}
.menu-button::before,
.menu-button::after {
	content: "";
	position: absolute;
	left: 0;
}
.menu-button::before {
	top: -7px;
}
.menu-button::after {
	top: 7px;
}
#navbar.open .menu-button {
	background: transparent;
}
#navbar.open .menu-button::before {
	transform: translateY(7px) rotate(45deg);
}
#navbar.open .menu-button::after {
	transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Buttons ---------- */
.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.7rem 1.4rem;
	border-radius: 8px;
	font-weight: 600;
	font-size: 0.95rem;
	border: 1px solid transparent;
	transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}
.button.primary {
	background: var(--accent);
	color: #fff;
}
.button.primary:hover {
	background: var(--accent-hover);
}
.button.secondary {
	background: var(--surface);
	color: var(--text);
	border-color: var(--border);
}
.button.secondary:hover {
	border-color: var(--muted);
}

/* ---------- Tech chips (about + project pages) ---------- */
.stack_container,
#stack_container {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}
.tech_icon_container {
	display: inline-flex;
	flex-direction: row-reverse; /* icon before label without changing markup */
	align-items: center;
	gap: 0.5rem;
	padding: 0.35rem 0.8rem 0.35rem 0.6rem;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 999px;
	font-size: 0.875rem;
	font-weight: 500;
}
.tech_icon_container img {
	/* the icon files draw each logo inside a padded white tile with a shadow;
	   enlarge the image and clip to the middle so only the logo shows */
	width: 2.5rem;
	height: 2.5rem;
	margin: -0.55rem;
	clip-path: inset(22%);
}

/* ---------- Contact ---------- */
#contact {
	width: 100%;
	background: var(--dark);
	color: #fff;
	padding: 4.5rem 1.5rem;
	text-align: center;
}
#contact h2 {
	font-size: clamp(1.5rem, 3vw, 2rem);
	font-weight: 700;
	margin-bottom: 0.5rem;
}
#contact .contact-intro {
	color: #94a3b8;
	margin-bottom: 2rem;
}
#contact .contact-links {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 0.75rem;
}
#contact .button {
	color: #fff;
	border-color: #334155;
}
#contact .button:hover {
	background: #1e293b;
	border-color: #64748b;
}
.contact_logo {
	width: 1.1rem;
	height: 1.1rem;
	fill: currentColor;
}

/* ---------- Footer ---------- */
footer {
	background: var(--dark);
	color: #64748b;
	text-align: center;
	font-size: 0.85rem;
	padding: 1.5rem;
	border-top: 1px solid #1e293b;
}

/* ---------- Mobile nav ---------- */
@media (max-width: 650px) {
	.menu-toggle {
		display: flex;
	}
	.nav_buttons {
		display: none;
		position: absolute;
		top: var(--nav-h);
		left: 0;
		right: 0;
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		background: var(--surface);
		border-bottom: 1px solid var(--border);
		box-shadow: var(--shadow-lg);
	}
	#navbar.open .nav_buttons {
		display: flex;
	}
	.nav_buttons a {
		padding: 1rem 1.5rem;
		border-top: 1px solid var(--border);
	}
}
