/* ==========================================================================
   Theme tokens
   ========================================================================== */
:root {
	--bg: #f7f7f5;
	--bg-elev: #ffffff;
	--surface: #ffffff;
	--surface-2: #f0f0ec;
	--border: #e4e4df;
	--text: #17171c;
	--text-muted: #5b5b66;
	--accent: #5b4cf0;
	--accent-2: #0ea5a4;
	--accent-soft: rgba(91, 76, 240, 0.1);
	--ring: rgba(91, 76, 240, 0.35);
	--shadow: 0 1px 2px rgba(20, 20, 30, 0.04), 0 8px 24px rgba(20, 20, 30, 0.06);
	--shadow-hover: 0 2px 4px rgba(20, 20, 30, 0.06), 0 16px 40px rgba(20, 20, 30, 0.1);
	--glow: radial-gradient(60% 50% at 70% 10%, rgba(91, 76, 240, 0.12), transparent 70%),
		radial-gradient(40% 40% at 10% 30%, rgba(14, 165, 164, 0.1), transparent 70%);
	--header-bg: rgba(247, 247, 245, 0.75);

	--radius: 16px;
	--radius-sm: 10px;
	--container: 1120px;
	--font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
	--ease: cubic-bezier(0.2, 0.7, 0.2, 1);

	color-scheme: light;
}

:root[data-theme="dark"] {
	--bg: #0c0d12;
	--bg-elev: #12141b;
	--surface: #14161e;
	--surface-2: #1b1e28;
	--border: #262a36;
	--text: #ececf1;
	--text-muted: #a0a3b1;
	--accent: #8f84ff;
	--accent-2: #2dd4bf;
	--accent-soft: rgba(143, 132, 255, 0.14);
	--ring: rgba(143, 132, 255, 0.45);
	--shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
	--shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.35), 0 16px 40px rgba(0, 0, 0, 0.4);
	--glow: radial-gradient(60% 50% at 70% 10%, rgba(143, 132, 255, 0.18), transparent 70%),
		radial-gradient(40% 40% at 10% 30%, rgba(45, 212, 191, 0.1), transparent 70%);
	--header-bg: rgba(12, 13, 18, 0.7);

	color-scheme: dark;
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html {
	scroll-behavior: smooth;
	scroll-padding-top: 80px;
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	font-family: var(--font);
	font-size: 16px;
	line-height: 1.65;
	color: var(--text);
	background: var(--bg);
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}

/* Smooth colour cross-fade when the theme changes (fallback for browsers
   without the View Transitions API). Only active while toggling. */
html.theme-fading,
html.theme-fading *,
html.theme-fading *::before,
html.theme-fading *::after {
	transition: background-color 0.4s var(--ease), color 0.4s var(--ease),
		border-color 0.4s var(--ease), fill 0.4s var(--ease), stroke 0.4s var(--ease),
		box-shadow 0.4s var(--ease) !important;
}

/* Circular reveal used by the View Transitions API */
::view-transition-old(root),
::view-transition-new(root) {
	animation: none;
	mix-blend-mode: normal;
}

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

a {
	color: var(--accent);
	text-decoration: none;
	text-underline-offset: 3px;
}
a:hover { text-decoration: underline; }

h1, h2, h3 {
	line-height: 1.15;
	letter-spacing: -0.02em;
	margin: 0;
}

p { margin: 0 0 1em; }

svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
	flex-shrink: 0;
}
svg.fill { fill: currentColor; stroke: none; }

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

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

.muted { color: var(--text-muted); }
.print-only { display: none; }
.mono { font-family: var(--mono); font-size: 0.85rem; letter-spacing: 0.02em; }

.skip-link {
	position: absolute;
	left: 16px;
	top: -100px;
	z-index: 100;
	padding: 8px 14px;
	background: var(--accent);
	color: #fff;
	border-radius: 8px;
}
.skip-link:focus { top: 12px; }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: var(--header-bg);
	backdrop-filter: saturate(180%) blur(14px);
	-webkit-backdrop-filter: saturate(180%) blur(14px);
	border-bottom: 1px solid transparent;
	transition: border-color 0.3s;
}
.site-header.scrolled { border-bottom-color: var(--border); }

.nav-inner {
	display: flex;
	align-items: center;
	gap: 24px;
	height: 64px;
}

.brand {
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--text);
	font-weight: 600;
}
.brand:hover { text-decoration: none; }

.brand-mark {
	width: 34px;
	height: 34px;
	border-radius: 10px;
	object-fit: cover;
	box-shadow: 0 0 0 1px var(--border);
}

.nav {
	display: flex;
	gap: 4px;
	margin-left: auto;
}
.nav a {
	padding: 6px 12px;
	border-radius: 8px;
	color: var(--text-muted);
	font-size: 0.92rem;
	font-weight: 500;
	transition: color 0.2s, background-color 0.2s;
}
.nav a:hover,
.nav a.active {
	color: var(--text);
	background: var(--surface-2);
	text-decoration: none;
}

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

.icon-btn {
	display: inline-grid;
	place-items: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 1px solid var(--border);
	border-radius: 10px;
	background: var(--surface);
	color: var(--text);
	cursor: pointer;
	transition: background-color 0.2s, border-color 0.2s, transform 0.2s var(--ease);
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:active { transform: scale(0.94); }

/* Theme toggle: sun and moon swap with a rotation */
.theme-toggle { position: relative; overflow: hidden; }
.theme-toggle svg {
	position: absolute;
	transition: transform 0.5s var(--ease), opacity 0.3s;
}
.icon-moon { transform: rotate(-90deg) scale(0.4); opacity: 0; }
[data-theme="dark"] .icon-sun { transform: rotate(90deg) scale(0.4); opacity: 0; }
[data-theme="dark"] .icon-moon { transform: none; opacity: 1; }

.menu-toggle { display: none; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 44px;
	padding: 0 18px;
	border: 1px solid var(--border);
	border-radius: 12px;
	background: var(--surface);
	color: var(--text);
	font: inherit;
	font-weight: 500;
	font-size: 0.95rem;
	cursor: pointer;
	box-shadow: var(--shadow);
	transition: transform 0.2s var(--ease), box-shadow 0.2s, background-color 0.2s;
}
.btn:hover {
	text-decoration: none;
	transform: translateY(-1px);
	box-shadow: var(--shadow-hover);
}
.btn svg { width: 18px; height: 18px; }

.btn-primary {
	border-color: transparent;
	color: #fff;
	background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, var(--accent-2)));
}
.btn-ghost { background: transparent; box-shadow: none; }

/* ==========================================================================
   About
   ========================================================================== */
.about {
	position: relative;
	padding: 72px 0 40px;
}
.about::before {
	content: "";
	position: absolute;
	inset: -64px 0 0;
	background: var(--glow);
	pointer-events: none;
	z-index: -1;
}

.about-grid {
	display: grid;
	grid-template-columns: 1.4fr 1fr;
	gap: 56px;
	align-items: center;
}

.eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 6px 14px;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: var(--surface);
	color: var(--text-muted);
	font-size: 0.85rem;
	font-weight: 500;
}
.status-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #22c55e;
	box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2);
}

.about h1 {
	margin: 20px 0;
	font-size: clamp(2.3rem, 5.5vw, 3.9rem);
	font-weight: 700;
	letter-spacing: -0.035em;
}

.gradient-text {
	background: linear-gradient(120deg, var(--accent), var(--accent-2));
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.lead {
	max-width: 56ch;
	font-size: 1.15rem;
	color: var(--text-muted);
}

.cta-row {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 28px;
}

.about-photo { margin: 0; justify-self: center; }
.photo-ring {
	position: relative;
	width: min(340px, 70vw);
	aspect-ratio: 1;
	padding: 3px;
	border-radius: 28px;
	background: linear-gradient(135deg, var(--accent), var(--accent-2));
	box-shadow: var(--shadow-hover);
}
/* Offset frame behind the photo */
.photo-ring::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	border: 2px solid var(--accent);
	border-radius: 28px;
	opacity: 0.35;
	transform: translate(16px, 16px);
	transition: transform 0.4s var(--ease);
}
.about-photo:hover .photo-ring::before { transform: translate(10px, 10px); }
.photo-ring img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 25px;
	background: var(--surface-2);
}

.stats {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1px;
	margin: 56px 0 0;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--border);
	overflow: hidden;
}
.stats div { padding: 20px 24px; background: var(--surface); }
.stats dt { color: var(--text-muted); font-size: 0.85rem; }
.stats dd {
	margin: 4px 0 0;
	font-size: 1.8rem;
	font-weight: 700;
	letter-spacing: -0.03em;
}

/* ==========================================================================
   Sections
   ========================================================================== */
.section { padding: 88px 0 0; }

.section-head { margin-bottom: 36px; }
.section-head h2,
.contact h2 { font-size: clamp(1.8rem, 3.5vw, 2.4rem); }
.kicker {
	margin: 0 0 8px;
	font-family: var(--mono);
	font-size: 0.8rem;
	color: var(--accent);
	letter-spacing: 0.04em;
	text-transform: uppercase;
}
.section-sub {
	max-width: 60ch;
	margin: 12px 0 0;
	color: var(--text-muted);
}

.card {
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
	box-shadow: var(--shadow);
	padding: 24px;
}

/* About */
.about-grid {
	display: grid;
	grid-template-columns: 1.1fr 1fr;
	gap: 40px;
}
.prose p { font-size: 1.05rem; color: var(--text-muted); }
.prose strong { color: var(--text); font-weight: 600; }

.services {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.services .card { padding: 20px; transition: transform 0.25s var(--ease), box-shadow 0.25s; }
.services .card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.services svg {
	width: 36px;
	height: 36px;
	padding: 8px;
	border-radius: 10px;
	color: var(--accent);
	background: var(--accent-soft);
}
.services h3 { margin: 14px 0 6px; font-size: 1rem; }
.services p { margin: 0; font-size: 0.9rem; color: var(--text-muted); }

/* Tags */
.tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 14px 0 0;
	padding: 0;
	list-style: none;
}
.tags li {
	padding: 3px 10px;
	border-radius: 999px;
	background: var(--surface-2);
	color: var(--text-muted);
	font-family: var(--mono);
	font-size: 0.75rem;
}

/* Career chart: proportional bars show how roles overlapped */
[data-kind="industry"] { --kind: var(--accent); }
[data-kind="teaching"] { --kind: var(--accent-2); }
[data-kind="freelance"] { --kind: #e19a1b; }
[data-kind="other"] { --kind: #8b8d98; }

.career-chart {
	display: none; /* shown once JS has drawn it */
	margin-bottom: 40px;
	padding: 20px 24px 14px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
	box-shadow: var(--shadow);
}
.career-chart.ready { display: block; }
.chart-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 18px;
	margin-bottom: 14px;
	font-size: 0.8rem;
	color: var(--text-muted);
}
.chart-legend span { display: inline-flex; align-items: center; gap: 8px; }
.chart-legend span::before {
	content: "";
	width: 10px;
	height: 10px;
	border-radius: 3px;
	background: var(--kind);
}
.chart-rows { display: grid; gap: 6px; }
.chart-row {
	display: grid;
	grid-template-columns: 130px 1fr;
	align-items: center;
	gap: 12px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--text-muted);
	font: inherit;
	font-size: 0.82rem;
	text-align: right;
	cursor: pointer;
}
.chart-row:hover { color: var(--text); }
.chart-track { position: relative; height: 22px; }
.chart-track::before {
	content: "";
	position: absolute;
	inset: 10px 0;
	border-top: 1px dashed var(--border);
}
.chart-bar {
	position: absolute;
	top: 0;
	bottom: 0;
	left: var(--from);
	width: var(--span);
	min-width: 6px;
	border-radius: 6px;
	background: var(--kind);
	opacity: 0.85;
	transform-origin: left;
	transition: opacity 0.2s, transform 0.2s var(--ease);
}
.chart-row:hover .chart-bar { opacity: 1; transform: scaleY(1.15); }
.chart-bar.ongoing {
	border-radius: 6px 0 0 6px;
	-webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
	mask-image: linear-gradient(90deg, #000 85%, transparent);
}
.chart-axis {
	position: relative;
	height: 20px;
	margin: 8px 0 0 142px;
	border-top: 1px solid var(--border);
	font-family: var(--mono);
	font-size: 0.7rem;
	color: var(--text-muted);
}
.chart-axis span {
	position: absolute;
	top: 4px;
	transform: translateX(-50%);
}

/* Timeline */
.timeline {
	position: relative;
	margin: 0;
	padding: 0;
	list-style: none;
}
.timeline::before {
	content: "";
	position: absolute;
	top: 22px;
	bottom: 22px;
	left: 21px;
	width: 2px;
	background: linear-gradient(var(--accent), var(--border) 30%);
}
.timeline-item {
	position: relative;
	display: grid;
	grid-template-columns: 44px 1fr;
	gap: 20px;
	margin-bottom: 16px;
	scroll-margin-top: 90px;
}
.org-badge {
	position: relative;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	margin-top: 14px;
	border: 1px solid var(--border);
	border-radius: 12px;
	background: var(--surface);
	color: var(--kind, var(--text-muted));
	font-family: var(--mono);
	font-size: 0.78rem;
	font-weight: 500;
	box-shadow: var(--shadow);
}
.timeline-item.is-current .org-badge {
	border-color: transparent;
	color: #fff;
	background: linear-gradient(135deg, var(--accent), var(--accent-2));
	box-shadow: 0 0 0 6px var(--accent-soft);
}
.timeline-body { border-left: 3px solid var(--kind, var(--border)); }
.timeline-item.is-current .timeline-body {
	border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
	border-left-color: var(--accent);
}
.timeline-item.flash .timeline-body { animation: flash 1.2s var(--ease); }
@keyframes flash {
	30% { box-shadow: 0 0 0 4px var(--ring), var(--shadow-hover); }
}

.job-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 4px 16px;
	margin-bottom: 10px;
}
.timeline-body h3 { font-size: 1.1rem; }
.timeline-body .at { font-weight: 500; color: var(--text-muted); }
.timeline-body p { margin: 0; color: var(--text-muted); }
.timeline-body .job-dates {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-family: var(--mono);
	font-size: 0.8rem;
	white-space: nowrap;
}
.duration:not(:empty) {
	margin-left: 4px;
	padding: 2px 8px;
	border-radius: 999px;
	background: var(--surface-2);
	font-size: 0.72rem;
}
.now-pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--accent);
	font-weight: 500;
}
.now-pill::before {
	content: "";
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #22c55e;
	animation: pulse 2s ease-out infinite;
}
@keyframes pulse {
	0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
	100% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
}

/* Skills */
.skills-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 16px;
}
.skill-group h3 { font-size: 1rem; margin-bottom: 12px; }
.skill-list { margin: 0; padding: 0; list-style: none; }
.skill-list li {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 9px 0;
	border-bottom: 1px dashed var(--border);
	font-weight: 500;
}
.skill-list li:last-child { border-bottom: 0; }

.level {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: var(--text-muted);
	font-family: var(--mono);
	font-size: 0.75rem;
	font-weight: 400;
	white-space: nowrap;
}
.level::after {
	content: "";
	width: 64px;
	height: 10px;
	/* 4 dots: filled up to data-level, rest dim */
	background:
		radial-gradient(circle 5px at 5px 50%, var(--dot1, var(--border)) 98%, transparent) 0 0 / 18px 10px no-repeat,
		radial-gradient(circle 5px at 5px 50%, var(--dot2, var(--border)) 98%, transparent) 18px 0 / 18px 10px no-repeat,
		radial-gradient(circle 5px at 5px 50%, var(--dot3, var(--border)) 98%, transparent) 36px 0 / 18px 10px no-repeat,
		radial-gradient(circle 5px at 5px 50%, var(--dot4, var(--border)) 98%, transparent) 54px 0 / 18px 10px no-repeat;
}
.level[data-level="1"] { --dot1: var(--accent); }
.level[data-level="2"] { --dot1: var(--accent); --dot2: var(--accent); }
.level[data-level="3"] { --dot1: var(--accent); --dot2: var(--accent); --dot3: var(--accent); }
.level[data-level="4"] { --dot1: var(--accent); --dot2: var(--accent); --dot3: var(--accent); --dot4: var(--accent); }

/* Education */
.edu-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}
.edu-grid h3 { font-size: 1.1rem; margin: 6px 0; }
.edu-grid p:last-child { margin: 0; color: var(--text-muted); }

/* Projects */
.projects-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 20px;
}
.project {
	display: flex;
	flex-direction: column;
	padding: 0;
	overflow: hidden;
	transition: transform 0.25s var(--ease), box-shadow 0.25s;
}
.project:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.project img {
	width: 100%;
	aspect-ratio: 16 / 10;
	object-fit: cover;
	background: var(--surface-2);
	border-bottom: 1px solid var(--border);
	transition: transform 0.5s var(--ease);
}
.project:hover img { transform: scale(1.03); }
.project-body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 20px;
	background: var(--surface);
	position: relative;
}
.project h3 { font-size: 1.05rem; margin-bottom: 6px; }
.project p { color: var(--text-muted); font-size: 0.92rem; }
/* A lone card on the last row spans the full width as a horizontal card */
@media (min-width: 961px) {
	.projects-grid > .project:last-child:nth-child(3n + 1) {
		grid-column: 1 / -1;
		flex-direction: row;
	}
	.projects-grid > .project:last-child:nth-child(3n + 1) img {
		width: 40%;
		aspect-ratio: auto;
		border-bottom: 0;
		border-right: 1px solid var(--border);
	}
}
.project-links {
	display: flex;
	gap: 16px;
	margin-top: auto;
	font-size: 0.9rem;
	font-weight: 500;
}

/* Gallery */
.gallery {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	grid-auto-rows: 220px;
	grid-auto-flow: dense;
	gap: 14px;
}
.gallery figure {
	position: relative;
	margin: 0;
	grid-row: span 2;
	border-radius: var(--radius);
	overflow: hidden;
	background: var(--surface-2);
}
.gallery figure.wide { grid-column: span 2; grid-row: span 1; }
.gallery button {
	display: block;
	width: 100%;
	height: 100%;
	padding: 0;
	border: 0;
	background: none;
	cursor: zoom-in;
}
.gallery img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.6s var(--ease);
}
.gallery figure:hover img { transform: scale(1.05); }
.gallery figcaption {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 28px 14px 12px;
	color: #fff;
	font-size: 0.85rem;
	font-weight: 500;
	background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
	pointer-events: none;
	opacity: 0;
	transform: translateY(6px);
	transition: opacity 0.3s, transform 0.3s var(--ease);
}
.gallery figure:hover figcaption,
.gallery figure:focus-within figcaption { opacity: 1; transform: none; }

/* Lightbox */
.lightbox {
	max-width: min(92vw, 1200px);
	max-height: 92vh;
	padding: 0;
	border: 0;
	border-radius: var(--radius);
	background: transparent;
	overflow: visible;
}
.lightbox::backdrop {
	background: rgba(5, 6, 10, 0.85);
	backdrop-filter: blur(6px);
}
.lightbox[open] { animation: zoom-in 0.3s var(--ease); }
.lightbox img {
	max-width: 100%;
	max-height: 84vh;
	margin: 0 auto;
	border-radius: var(--radius);
}
.lightbox-caption {
	margin: 12px 0 0;
	text-align: center;
	color: #e5e5ea;
	font-size: 0.9rem;
}
.lightbox-close {
	position: absolute;
	top: -52px;
	right: 0;
	color: #fff;
	background: rgba(255, 255, 255, 0.1);
	border-color: rgba(255, 255, 255, 0.2);
}
@keyframes zoom-in {
	from { opacity: 0; transform: scale(0.96); }
}

/* Contact */
.contact {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 40px;
	align-items: center;
	padding: 40px;
	background:
		var(--glow),
		var(--surface);
}
.contact-list {
	display: grid;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.contact-list li {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 16px;
	border: 1px solid var(--border);
	border-radius: 12px;
	background: var(--bg-elev);
	min-width: 0;
}
.contact-list svg { color: var(--accent); }
.contact-list a {
	color: var(--text);
	font-weight: 500;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Footer */
.site-footer {
	margin-top: 88px;
	padding: 28px 0;
	border-top: 1px solid var(--border);
	color: var(--text-muted);
	font-size: 0.88rem;
}
.footer-inner {
	display: flex;
	justify-content: space-between;
	gap: 16px;
}
.footer-inner p { margin: 0; }

/* Scroll reveal */
.reveal {
	opacity: 0;
	transform: translateY(16px);
	transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.visible { opacity: 1; transform: none; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 960px) {
	.about-grid,
	.about-grid,
	.contact { grid-template-columns: 1fr; }
	.about-photo { order: -1; justify-self: start; }
	.photo-ring { width: 160px; border-radius: 22px; }
	.photo-ring::before { border-radius: 22px; transform: translate(10px, 10px); }
	.photo-ring img { border-radius: 19px; }
	.projects-grid { grid-template-columns: repeat(2, 1fr); }
	.gallery { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 180px; }
}

@media (max-width: 760px) {
	.container { padding: 0 16px; }
	.brand-name { display: none; }
	.menu-toggle { display: inline-grid; }
	.nav-actions { margin-left: auto; }
	.nav {
		position: absolute;
		top: 64px;
		left: 0;
		right: 0;
		flex-direction: column;
		gap: 2px;
		margin: 0;
		padding: 8px 16px 16px;
		background: var(--bg);
		border-bottom: 1px solid var(--border);
		box-shadow: var(--shadow);
		transform-origin: top;
		transform: scaleY(0.96);
		opacity: 0;
		visibility: hidden;
		transition: opacity 0.2s, transform 0.2s var(--ease), visibility 0.2s;
	}
	.nav.open { opacity: 1; transform: none; visibility: visible; }
	.nav a { padding: 12px; font-size: 1rem; }

	.about { padding-top: 40px; }
	.stats { grid-template-columns: 1fr 1fr 1fr; }
	.stats div { padding: 14px; }
	.stats dd { font-size: 1.4rem; }
	.section { padding-top: 64px; }
	.services,
	.skills-grid,
	.edu-grid,
	.projects-grid { grid-template-columns: 1fr; }

	.timeline::before { left: 17px; }
	.timeline-item { grid-template-columns: 36px 1fr; gap: 12px; }
	.org-badge { width: 36px; height: 36px; font-size: 0.7rem; border-radius: 10px; }
	.career-chart { padding: 16px 14px 10px; }
	.chart-row { grid-template-columns: 84px 1fr; gap: 8px; font-size: 0.72rem; }
	.chart-axis { margin-left: 92px; }
	.chart-axis span:nth-child(even) { display: none; }
	.skill-list li { flex-wrap: wrap; row-gap: 2px; }

	.gallery { grid-auto-rows: 150px; gap: 10px; }
	.gallery figcaption { opacity: 1; transform: none; font-size: 0.75rem; }
	.contact { padding: 24px; }
	.footer-inner { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
	}
	.reveal { opacity: 1; transform: none; }
}

/* ==========================================================================
   Print: a clean one-column résumé
   ========================================================================== */
@media print {
	:root, :root[data-theme="dark"] {
		--bg: #fff; --surface: #fff; --surface-2: #f2f2f2; --border: #ddd;
		--text: #000; --text-muted: #333; --accent: #3b2fd0; --shadow: none;
		color-scheme: light;
	}
	body { font-size: 11pt; line-height: 1.45; }
	.site-header, .cta-row, .about-photo, .about::before, #photos, #projects img,
	.site-footer, .skip-link, .lightbox, .stats { display: none !important; }
	.reveal { opacity: 1 !important; transform: none !important; }
	.about { padding: 0; }
	.about h1 { font-size: 22pt; margin: 8px 0; }
	.gradient-text { color: #333; background: none; -webkit-text-fill-color: currentColor; }
	.section { padding-top: 18px; }
	.section-head { margin-bottom: 10px; }
	.section-sub { display: none; }
	.card { box-shadow: none; padding: 10px 12px; break-inside: avoid; }
	.services { display: none; }
	.about-grid, .contact { display: block; }
	.timeline::before, .org-badge, .career-chart, .duration { display: none !important; }
	.timeline-item { display: block; margin-bottom: 8px; }
	.timeline-body { border-left-width: 1px; }
	.now-pill::before { display: none; }
	.projects-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
	.projects-grid > .project:last-child { grid-column: auto !important; }
	.project-body { padding: 8px 10px; }
	.project p { font-size: 9pt; margin: 0; }
	.project-links, .eyebrow, .tags, #contact { display: none !important; }
	.skills-grid, .edu-grid { gap: 6px; }
	.skill-list li { padding: 2px 0; font-size: 10pt; }
	.edu-grid h3, .timeline-body h3, .project h3 { font-size: 11pt; margin: 0 0 2px; }
	.timeline-body p, .prose p { font-size: 10pt; }
	.section-head h2 { font-size: 14pt; }
	.section-head, h2, h3 { break-after: avoid; }
	.print-only { display: block; }
	.print-name { font-size: 22pt; font-weight: 700; margin: 0 0 4px; }
	.print-name span { display: block; font-size: 9.5pt; font-weight: 400; color: #333; }
	.about h1 { font-size: 13pt; margin: 4px 0; }
	.about h1 br, .about h1 .hi { display: none; }
	.level::after { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
	.prose p:last-child { display: none; }
	.lead { font-size: 10.5pt; max-width: none; }
	a { color: inherit; }
}
