/* Site styles. Colours and type follow Bootstrap 5's defaults. */

:root {
	--bg: #fff;
	--fg: #212529;
	--muted: rgba(33, 37, 41, .75);
	--link: #0d6efd;
	--link-hover: #0a58ca;
	--border: #dee2e6;
	--tint: #f8f9fa;
	--wrap: 52rem;
	--pad: 1.5rem;
	--name: 2.5rem;
	color-scheme: light;
}

[data-theme="dark"] {
	--bg: #212529;
	--fg: #dee2e6;
	--muted: rgba(222, 226, 230, .75);
	--link: #6ea8fe;
	--link-hover: #8bb9fe;
	--border: #495057;
	--tint: #2b3035;
	color-scheme: dark;
}

/* Without JavaScript the theme attribute is never set, so follow the system. */
@media (prefers-color-scheme: dark) {
	:root:not([data-theme]) {
		--bg: #212529;
		--fg: #dee2e6;
		--muted: rgba(222, 226, 230, .75);
		--link: #6ea8fe;
		--link-hover: #8bb9fe;
		--border: #495057;
		--tint: #2b3035;
		color-scheme: dark;
	}
}

/* Base */

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

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--fg);
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif;
	font-size: 1rem;
	line-height: 1.5;
}

h1, h2, h3 {
	margin: 0;
	line-height: 1.2;
}

p {
	margin: 0 0 1rem;
	text-wrap: pretty;
}

dl, dd {
	margin: 0;
}

address {
	font-style: normal;
}

a {
	color: var(--link);
	text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
	text-underline-offset: .18em;
}

a:hover {
	color: var(--link-hover);
	text-decoration-color: currentColor;
}

:focus-visible {
	outline: 2px solid var(--link);
	outline-offset: 2px;
}

.small {
	font-size: .875em;
}

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

.mono {
	font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
	font-size: .95em;
}

/* Layout */

.page {
	max-width: var(--wrap);
	margin: 0 auto;
	padding: 3rem var(--pad) 2.5rem;
}

/* Header: name and links on the left; the theme toggle sits opposite, level with the name. */
.masthead {
	position: relative;
	padding-bottom: 2.25rem;
}

.masthead h1 {
	font-size: var(--name);
	font-weight: 300;
	line-height: 1.15;
}

.masthead p {
	margin: .45rem 0 0;
}

.theme-toggle {
	position: absolute;
	top: calc((var(--name) * 1.15 - 2rem) / 2);
	right: -.5rem;
	display: inline-flex;
	padding: .5rem;
	border: 0;
	border-radius: 50%;
	background: none;
	color: var(--muted);
	cursor: pointer;
}

.theme-toggle:hover {
	color: var(--fg);
	background: var(--tint);
}

/* Sections: a small label in the left column, content on the right. */
.section {
	display: grid;
	grid-template-columns: 9rem minmax(0, 1fr);
	column-gap: 3rem;
	padding: 2.25rem 0 1.5rem;
	border-top: 1px solid var(--border);
	scroll-margin-top: 1rem;
}

.label {
	align-self: start;
	position: sticky;
	top: 1.5rem;
	padding-top: .25rem;
	font-size: .75rem;
	font-weight: 600;
	letter-spacing: .09em;
	text-transform: uppercase;
	color: var(--muted);
}

.content > p {
	line-height: 1.6;
}

.content h3 {
	margin: 1.75rem 0 .7rem;
	font-size: 1rem;
	font-weight: 600;
}

.tag {
	margin-right: .6rem;
	font-size: .75rem;
	font-weight: 600;
	letter-spacing: .09em;
	text-transform: uppercase;
	color: var(--muted);
}

.title {
	font-weight: 500;
}

/* Research */

.entry {
	margin-bottom: 1.1rem;
}

.note {
	margin-bottom: 1.4rem;
}

.abstract-toggle {
	padding: 0;
	border: 0;
	background: none;
	font: inherit;
	color: var(--link);
	text-decoration: underline;
	text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
	text-underline-offset: .18em;
	cursor: pointer;
}

.abstract-toggle:hover {
	color: var(--link-hover);
	text-decoration-color: currentColor;
}

.abstract {
	margin: .5rem 0 1.25rem;
	padding-left: 1rem;
	border-left: 1px solid var(--border);
}

/* Talks */

.talk {
	display: grid;
	grid-template-columns: 5.5rem minmax(0, 1fr);
	column-gap: 1rem;
	padding: .4rem 0;
}

.talk time {
	padding-top: .15rem;
	font-variant-numeric: tabular-nums;
}

/* Service */

.group {
	margin-bottom: .15rem;
}

.list {
	margin-bottom: .9rem;
	line-height: 1.65;
}

/* Keep each name on one line so the eye can find where one ends and the next begins. */
@media (min-width: 576px) {
	.nowrap {
		white-space: nowrap;
	}
}

/* Contact */

.contact {
	display: grid;
	grid-template-columns: 6rem minmax(0, 1fr);
	gap: .5rem 1rem;
}

.contact dt {
	padding-top: .15rem;
	font-size: .875em;
	color: var(--muted);
}

@media (max-width: 575.98px) {
	.contact {
		grid-template-columns: minmax(0, 1fr);
		gap: 0;
	}

	.contact dd {
		margin-bottom: .75rem;
	}
}

/* Footer */

.footer {
	margin-top: 1rem;
	padding-top: 1.25rem;
	border-top: 1px solid var(--border);
}

.footer a {
	color: var(--muted);
}

.footer a:hover {
	color: var(--fg);
}

/* Phones: one column, labels above their content. */
@media (max-width: 639.98px) {
	:root {
		--pad: 1.25rem;
		--name: 1.85rem;
	}

	.page {
		padding-top: 2.25rem;
	}

	.section {
		grid-template-columns: minmax(0, 1fr);
	}

	.label {
		position: static;
		margin-bottom: .9rem;
	}
}
