:root {
	color-scheme: light dark;
	--bg: #fff;
	--text: #1f2328;
	--muted: #5f6b76;
	--faint: #6e7781;
	--border: #e3e6ea;
	--panel-rule: #dde1e6;
	--bg-soft: #f6f8fa;
	--accent: #2b5fab;
	--award-bg: #fff4e5;
	--award-text: #9a4a00;
	--max-width: 1100px;
	--font: Carlito, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
	--mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg: #0d1117;
		--text: #e6e8eb;
		--muted: #a3acb6;
		--faint: #8b949e;
		--border: #30363d;
		--panel-rule: #30363d;
		--bg-soft: #161b22;
		--accent: #7aa7ff;
		--award-bg: #3a2a12;
		--award-text: #f0b45a;
	}
	img, video {
		filter: brightness(0.9);
	}
}

/* Base */

* {
	box-sizing: border-box;
}
html {
	-webkit-text-size-adjust: 100%;
}
body {
	margin: 0;
	font-family: var(--font);
	font-size: 17px;
	line-height: 1.6;
	color: var(--text);
	background: var(--bg);
}
a {
	color: var(--accent);
	text-decoration: none;
}
a:hover {
	text-decoration: underline;
}
img {
	max-width: 100%;
	height: auto;
}
h1, h2, h3 {
	line-height: 1.25;
	font-weight: 650;
	letter-spacing: -0.01em;
}
h1 {
	font-size: 2rem;
	margin: 0 0 0.75rem;
}
h2 {
	font-size: 1.35rem;
	margin: 3rem 0 1rem;
	padding-bottom: 0.4rem;
	border-bottom: 1px solid var(--border);
}
h3 {
	font-size: 1.1rem;
}
p {
	margin: 0 0 1rem;
}
pre {
	font-family: var(--mono);
	font-size: 0.8rem;
	line-height: 1.5;
	background: var(--bg-soft);
	border: 1px solid var(--border);
	border-radius: 6px;
	padding: 1rem;
	white-space: pre-wrap;
	overflow-x: auto;
}

/* Layout */

.container {
	max-width: var(--max-width);
	margin: 0 auto;
	padding: 2.5rem 1.5rem 3rem;
}
.site-nav {
	max-width: var(--max-width);
	margin: 0 auto;
	padding: 1.25rem 1.5rem;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem 1.5rem;
	border-bottom: 1px solid var(--border);
}
.site-name {
	font-weight: 650;
	color: var(--text);
}
.site-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1.25rem;
}
.site-nav ul a {
	color: var(--muted);
	font-size: 1.05rem;
}
.site-nav ul a:hover {
	color: var(--accent);
	text-decoration: none;
}

/* Shared components */

.pill, .button {
	border: 1px solid var(--border);
	border-radius: 999px;
	color: var(--text);
	background: var(--bg);
	transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.pill:hover, .button:hover {
	border-color: var(--accent);
	color: var(--accent);
	text-decoration: none;
}
.pill {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	font-size: 0.8rem;
	line-height: 1.4;
	padding: 0.2rem 0.75rem;
}

/* Colored publication buttons: Project = green, Paper = red, Code = blue */

.pill-project {
	background: #e6f4ea;
	border-color: #b7dfc4;
	color: #1e6b3a;
}
.pill-project:hover {
	background: #d3ecdb;
	border-color: #1e6b3a;
	color: #14522b;
}
.pill-paper {
	background: #fdecea;
	border-color: #f5c2bd;
	color: #a4262c;
}
.pill-paper:hover {
	background: #fbdad6;
	border-color: #a4262c;
	color: #7f1d22;
}
.pill-code {
	background: #e7f0fd;
	border-color: #b9d4f5;
	color: #1a4d8f;
}
.pill-code:hover {
	background: #d6e6fb;
	border-color: #1a4d8f;
	color: #143d73;
}
.button {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	padding: 0.5rem 1rem;
	font-size: 0.9rem;
	font-weight: 600;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.button-primary {
	color: var(--bg);
	background: var(--text);
	border-color: var(--text);
}
.button-primary:hover {
	color: var(--bg);
	background: var(--accent);
}
.icon {
	flex-shrink: 0;
}
.award {
	display: inline-block;
	font-size: 0.8rem;
	font-weight: 600;
	padding: 0.1rem 0.6rem;
	border-radius: 4px;
	background: var(--award-bg);
	color: var(--award-text);
}
.callout {
	padding: 0.75rem 1rem;
	background: var(--bg-soft);
	border-radius: 6px;
}

/* Home page */

.intro {
	display: flex;
	gap: 2rem;
	align-items: flex-start;
}
.intro-photo {
	width: 150px;
	flex-shrink: 0;
	border: 1px solid var(--border);
	border-radius: 8px;
}
.intro-text h1 {
	margin: 0 0 0.4rem;
}
.profile-links {
	list-style: none;
	padding: 0;
	margin: 0 0 1rem;
	display: flex;
	flex-wrap: wrap;
	row-gap: 0.25rem;
	font-size: 0.95rem;
}
.profile-links li + li::before {
	content: "·";
	margin: 0 0.6rem;
	color: var(--faint);
}
.panel {
	margin-top: 3rem;
	padding: 0.5rem 1.5rem 0.75rem;
	background: var(--bg-soft);
	border-radius: 8px;
}
.intro + .panel {
	margin-top: 2rem;
}
.panel h2 {
	margin: 1rem 0 0.25rem;
	border-bottom-color: var(--panel-rule);
}
h3.year {
	font-size: 1.4rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	color: var(--faint);
	margin: 2.5rem 0 0.5rem;
	display: flex;
	align-items: center;
	gap: 1rem;
}
h3.year::after {
	content: "";
	flex: 1;
	border-top: 1px solid var(--border);
}
h2 + h3.year::after {
	content: none;
}

.pub {
	display: grid;
	grid-template-columns: 300px 1fr;
	gap: 1.5rem;
	align-items: center;
	padding: 1.25rem 1.5rem;
	background: #fffbe6;
	border: 1px solid #f0e7bd;
	border-radius: 8px;
}
.pub + .pub {
	margin-top: 1rem;
}
.pub-thumb img, .pub-thumb video {
	display: block;
	width: 100%;
	border: 1px solid var(--border);
	border-radius: 6px;
	transition: opacity 0.15s;
}
.pub-thumb:hover img, .pub-thumb:hover video {
	opacity: 0.85;
}
.pub-info {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.15rem;
}
.pub-title {
	font-weight: 600;
	color: var(--accent);
	line-height: 1.35;
}
.pub-title:hover {
	text-decoration: underline;
}
.pub-authors, .pub-venue {
	font-size: 0.92rem;
	color: var(--muted);
}
.pub-authors b {
	color: var(--text);
	font-weight: 600;
}
.pub-venue {
	font-style: italic;
	color: var(--text);
	font-weight: 700;
}
.pub-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin-top: 0.4rem;
}
.pub-missing {
	display: block;
	color: #c62828;
	font-weight: 600;
}

/* Project pages */

.project-header {
	text-align: center;
}
.project-title {
	font-size: 1.9rem;
	margin: 0.5rem 0 0.75rem;
}
.project-venue {
	font-size: 1.05rem;
	color: var(--muted);
	margin-bottom: 0.5rem;
}
.project-authors, .project-affiliations {
	list-style: none;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.25rem 1.5rem;
}
.project-authors {
	font-size: 1.05rem;
	margin: 1.25rem 0 0.5rem;
}
.project-affiliations {
	font-size: 0.92rem;
	color: var(--muted);
	margin: 0 0 0.5rem;
}
.project-authors sup, .project-affiliations sup {
	font-size: 0.7em;
	margin-left: 1px;
	color: var(--muted);
}
.project-affiliations sup {
	margin-right: 0.25em;
}
.author-note {
	font-size: 0.85rem;
	color: var(--faint);
}
.project-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.6rem;
	margin-top: 1.5rem;
}
.teaser {
	margin: 2rem 0 0;
	text-align: center;
}
.teaser img, .teaser video {
	vertical-align: middle;
	border-radius: 6px;
}
.project-section {
	max-width: 42rem;
	margin: 0 auto;
}
.project-section h2 {
	margin-top: 2.5rem;
}
.abstract p:last-child {
	margin-bottom: 0;
}
.bibtex-box {
	position: relative;
}
.copy-button {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	font-family: inherit;
	color: var(--muted);
	cursor: pointer;
}
.video {
	position: relative;
	aspect-ratio: 16 / 9;
	margin-bottom: 1.25rem;
	background: #000;
	border-radius: 6px;
	overflow: hidden;
}
.video iframe, .video video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* Teaching page */

.course-banner {
	margin: 1.5rem 0;
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 0.5%;
}
.course-banner video {
	border-radius: 4px;
}
.course-info {
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: 0.4rem 1.5rem;
	margin: 1.5rem 0 0;
}
.course-info dt {
	font-weight: 600;
}
.course-info dd {
	margin: 0;
}
.weight {
	font-weight: 400;
	color: var(--muted);
}
.lecture {
	display: grid;
	grid-template-columns: 5rem 1fr;
	gap: 1rem;
	padding: 0.9rem 0;
}
.lecture-date {
	font-weight: 600;
}
.lecture-topic {
	margin-bottom: 0.5rem;
}
.lecture-topic:last-child {
	margin-bottom: 0;
}
.lecture.no-slides .lecture-date,
.lecture.no-slides .lecture-topic {
	color: var(--faint);
}
.lecture-slides {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
}
.lecture-slides img {
	width: 200px;
}

/* Art page */

.art-grid {
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	gap: 1rem;
	margin-top: 2rem;
}
.art-item {
	margin: 0;
}
.art-item img {
	width: 100%;
	aspect-ratio: 1 / 2;
	object-fit: cover;
}

.lecture-slides img, .art-item img {
	display: block;
	border: 1px solid var(--border);
	border-radius: 6px;
	transition: opacity 0.15s;
}
.lecture-slides a:hover img, .art-item a:hover img {
	opacity: 0.85;
}

/* Team page */

.people {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1.25rem 2.5rem;
	max-width: 700px;
}
.person {
	display: flex;
	align-items: center;
	gap: 1rem;
}
.person img {
	display: block;
	width: 100px;
	border: 1px solid var(--border);
	border-radius: 8px;
	transition: opacity 0.15s;
}
.person a:hover img {
	opacity: 0.85;
}
.person-name {
	font-weight: 600;
}
.person-years {
	font-size: 0.92rem;
	color: var(--muted);
}
.invisible-box {
	display: inline-block;
	width: 100px;
	height: 100px;
}

/* Phones */

@media (max-width: 640px) {
	.container {
		padding: 1.5rem 1rem 2rem;
	}
	.site-nav {
		padding-left: 1rem;
		padding-right: 1rem;
	}
	.intro {
		flex-direction: column;
		gap: 1rem;
	}
	.intro-photo {
		width: 120px;
	}
	.pub {
		grid-template-columns: 1fr;
		gap: 0.75rem;
	}
	.pub-thumb img, .pub-thumb video {
		max-width: 320px;
	}
	.project-title {
		font-size: 1.5rem;
	}
	.lecture {
		grid-template-columns: 1fr;
		gap: 0.25rem;
	}
	.lecture-slides img {
		width: 150px;
	}
	.art-grid {
		grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
	}
	.people {
		grid-template-columns: 1fr;
	}
}

/* Dark mode for the publication cards and colored buttons.
   This block must stay at the very end of the file: these rules have the same
   specificity as the light-mode ones above, so source order is what makes them win. */

@media (prefers-color-scheme: dark) {
	.pub {
		background: #262210;
		border-color: #4a4322;
	}
	.pill-project {
		background: #12301f;
		border-color: #1e6b3a;
		color: #7fd8a0;
	}
	.pill-paper {
		background: #3a1a1a;
		border-color: #a4262c;
		color: #ff9a94;
	}
	.pill-code {
		background: #12243d;
		border-color: #1a4d8f;
		color: #7fb0f0;
	}
}
