/* ===========================================================================
   remydegenne.github.io
   Ink & warm accent. Light and dark, one column, no framework.
   =========================================================================== */

:root {
	--ink:          #1a1a1a;
	--bg:           #faf8f6;
	--surface:      #ffffff;
	--accent:       #b04a33;
	--accent-hover: #8f3a27;
	--accent-wash:  rgba(176, 74, 51, 0.09);
	--muted:        #6b6560;
	--rule:         #e8e2dc;
	--shadow:       0 1px 2px rgba(26, 20, 15, 0.04), 0 8px 24px rgba(26, 20, 15, 0.05);

	--mathlib: #004d99;
	--lml:     #d65d5d;

	--serif: "Source Serif 4", "Iowan Old Style", Georgia, serif;
	--sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

	--wrap:    46rem;   /* reading measure */
	--gutter:  1.5rem;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--ink:          #ece7e1;
		--bg:           #17140f;
		--surface:      #201c17;
		--accent:       #e8907a;
		--accent-hover: #f3a994;
		--accent-wash:  rgba(232, 144, 122, 0.13);
		--muted:        #a8a099;
		--rule:         #332d26;
		--shadow:       0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
		--mathlib:      #74a9e8;
		--lml:          #e8857f;
	}
}

:root[data-theme="dark"] {
	--ink:          #ece7e1;
	--bg:           #17140f;
	--surface:      #201c17;
	--accent:       #e8907a;
	--accent-hover: #f3a994;
	--accent-wash:  rgba(232, 144, 122, 0.13);
	--muted:        #a8a099;
	--rule:         #332d26;
	--shadow:       0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
	--mathlib:      #74a9e8;
	--lml:          #e8857f;
}

/* --- base ---------------------------------------------------------------- */

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

html {
	font-size: 17px;
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
	scroll-padding-top: 4.5rem;   /* clears the sticky nav when jumping to #id */
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	* { transition: none !important; animation: none !important; }
}

body {
	margin: 0;
	/* Keeps the footer at the bottom on short pages such as older_news.html. */
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--sans);
	font-size: 1rem;
	line-height: 1.65;
	font-synthesis-weight: none;
	-webkit-font-smoothing: antialiased;
}

.wrap {
	width: 100%;
	max-width: var(--wrap);
	margin: 0 auto;
	padding: 0 var(--gutter);
}

/* Links in running text keep the text colour and carry an accent underline.
   With this much linking, colouring every one of them turns the prose red. */
a {
	color: inherit;
	text-decoration: underline;
	text-decoration-color: color-mix(in srgb, var(--accent) 42%, transparent);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
	transition: color 0.15s, text-decoration-color 0.15s, background-color 0.15s, border-color 0.15s;
}

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

@supports not (color: color-mix(in srgb, red 50%, transparent)) {
	a { text-decoration-color: var(--rule); }
}

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

strong, b { font-weight: 600; }

img { max-width: 100%; height: auto; vertical-align: middle; }

hr {
	border: 0;
	border-top: 1px solid var(--rule);
	margin: 3rem 0;
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	background: var(--accent);
	color: #fff;
	padding: 0.6rem 1rem;
	z-index: 100;
}

.skip-link:focus {
	left: 0;
}

.masthead-name,
.masthead-back,
.masthead-meta a,
.topnav a,
.brand-btn,
.site-footer a,
.skip-link {
	text-decoration: none;
}

/* --- masthead ------------------------------------------------------------ */

.masthead {
	padding: 3.5rem 0 2rem;
}

.masthead-name {
	display: inline-block;
	font-family: var(--serif);
	font-size: 2.6rem;
	font-weight: 600;
	line-height: 1.1;
	letter-spacing: -0.015em;
	color: var(--ink);
	border-bottom: 0;
	margin: 0;
}

.masthead-name:hover { color: var(--accent); }

.masthead-role a {
	color: inherit;
	text-decoration-color: var(--rule);
}

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

.masthead-role {
	margin: 0.6rem 0 0;
	font-size: 1.05rem;
	color: var(--muted);
	max-width: 34rem;
}

.masthead-meta {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.45rem 1.25rem;
	margin: 1.1rem 0 0;
	padding: 0;
	font-size: 0.9rem;
}

.masthead-meta a {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	color: var(--muted);
}

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

.masthead-meta svg {
	width: 1.05em;
	height: 1.05em;
	fill: currentColor;
	flex: none;
}

h1.masthead-name {
	display: block;
	margin: 0;
}

/* Subpages: a small line back to the homepage above the page title. */
.masthead-back {
	display: inline-block;
	margin: 0 0 0.9rem;
	font-size: 0.9rem;
	color: var(--muted);
}

.masthead-back:hover { color: var(--accent); }

.masthead-back::before {
	content: "\2190";
	margin-right: 0.4em;
}

/* --- navigation ---------------------------------------------------------- */

.topnav {
	position: sticky;
	top: 0;
	z-index: 20;
	background: color-mix(in srgb, var(--bg) 88%, transparent);
	-webkit-backdrop-filter: saturate(180%) blur(12px);
	backdrop-filter: saturate(180%) blur(12px);
	border-bottom: 1px solid var(--rule);
}

@supports not (backdrop-filter: blur(1px)) {
	.topnav { background: var(--bg); }
}

.topnav ul {
	list-style: none;
	display: flex;
	gap: 0.25rem;
	margin: 0;
	padding: 0;
	overflow-x: auto;
	scrollbar-width: none;
}

.topnav ul::-webkit-scrollbar { display: none; }

.topnav a {
	display: block;
	padding: 0.85rem 0.75rem;
	font-size: 0.88rem;
	font-weight: 500;
	letter-spacing: 0.01em;
	color: var(--muted);
	white-space: nowrap;
	border-bottom: 2px solid transparent;
}

.topnav a:hover {
	color: var(--ink);
	border-bottom-color: var(--rule);
}

.topnav a.active {
	color: var(--accent);
	border-bottom-color: var(--accent);
}

/* --- sections ------------------------------------------------------------ */

main {
	flex: 1 0 auto;
	padding: 1rem 0 2rem;
}

section[id] {
	padding: 2.75rem 0 0;
	scroll-margin-top: 4.5rem;
}

section > .container { max-width: none; }

h1, h2, h3, h4, h5, h6 {
	font-family: var(--serif);
	font-weight: 600;
	line-height: 1.25;
	letter-spacing: -0.01em;
	color: var(--ink);
}

h3 {
	font-size: 1.6rem;
	margin: 0 0 1.25rem;
	padding-bottom: 0.5rem;
	border-bottom: 1px solid var(--rule);
}

/* The accent mark that makes a section heading read as a section heading. */
h3::before {
	content: "";
	display: inline-block;
	width: 0.55rem;
	height: 0.55rem;
	margin-right: 0.6rem;
	border-radius: 1px;
	background: var(--accent);
	vertical-align: 0.08em;
}

h4 {
	font-size: 1.15rem;
	margin: 2rem 0 0.6rem;
}

header.major h3 { margin-bottom: 1.25rem; }

p { margin: 0 0 1.1rem; }

section .container > ul,
section .container > ol {
	margin: 0 0 1.1rem;
	padding-left: 1.2rem;
}

li { margin-bottom: 0.5rem; }

li > ul { margin-top: 0.5rem; }

/* Label above a list, e.g. "PhD students" in the collaborators section. */
.group-label { margin: 0 0 0.4rem; }

/* --- publication list ---------------------------------------------------- */

#two .container > ul {
	list-style: none;
	padding-left: 0;
	margin-top: 1.5rem;
}

#two .container > ul > li {
	position: relative;
	margin: 0 0 1.35rem;
	padding: 0 0 0 1.1rem;
	line-height: 1.5;
}

#two .container > ul > li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.62em;
	width: 0.32rem;
	height: 0.32rem;
	border-radius: 50%;
	background: var(--rule);
}

#two .container > ul > li:hover::before { background: var(--accent); }

#two li > b > a {
	color: var(--ink);
	font-weight: 600;
}

#two li > b > a:hover { color: var(--accent); }

/* Coauthors and extra links sit directly in the <li>, after the <br>. */
#two li > a { color: var(--muted); }
#two li > a:hover { color: var(--accent); }

/* --- news ---------------------------------------------------------------- */

.news-date {
	display: inline-block;
	margin-right: 0.15rem;
	font-family: var(--sans);
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--accent);
}

#news p, #one + #news p { margin-bottom: 1.4rem; }

/* "[Done by ...]" annotations on the Lean projects page. */
.done {
	color: var(--muted);
	font-style: italic;
}

/* --- brand buttons ------------------------------------------------------- */

.brand-buttons {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.9rem;
	margin: 1.75rem 0 2rem;
}

.brand-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 0.95rem;
	padding: 0.7rem 1.6rem;
	white-space: nowrap;
	background: var(--surface);
}

.brand-btn.mathlib {
	font-family: var(--serif);
	font-weight: 600;
	border-radius: 0.25rem;
	border: 2px solid var(--mathlib);
	color: var(--mathlib);
}

.brand-btn.mathlib:hover {
	background: var(--mathlib);
	color: var(--bg);
	border-color: var(--mathlib);
}

.brand-btn.lml {
	font-family: var(--sans);
	font-weight: 500;
	border-radius: 0.5rem;
	border: 2px solid var(--lml);
	color: var(--lml);
}

.brand-btn.lml:hover {
	background: var(--lml);
	color: var(--bg);
	border-color: var(--lml);
}

/* --- portrait ------------------------------------------------------------ */

.intro {
	display: flex;
	gap: 1.75rem;
	align-items: flex-start;
}

.intro-text { flex: 1 1 auto; min-width: 0; }

.portrait {
	flex: none;
	width: 8.5rem;
	margin-top: 0.3rem;
}

.portrait img {
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	border-radius: 0.5rem;
	box-shadow: var(--shadow);
}

@media (max-width: 34rem) {
	.intro { flex-direction: column-reverse; gap: 1.25rem; }
	.portrait { width: 7rem; align-self: flex-start; }
}

/* --- code ---------------------------------------------------------------- */

pre, code {
	font-family: ui-monospace, "SF Mono", "Source Code Pro", Menlo, monospace;
	font-size: 0.86em;
}

code {
	background: var(--accent-wash);
	padding: 0.1em 0.35em;
	border-radius: 3px;
}

pre {
	background: var(--surface);
	border: 1px solid var(--rule);
	border-radius: 0.4rem;
	padding: 1rem 1.1rem;
	overflow-x: auto;
	line-height: 1.5;
}

pre code {
	background: none;
	padding: 0;
}

/* --- footer -------------------------------------------------------------- */

.site-footer {
	margin-top: 4rem;
	padding: 2rem 0 3rem;
	border-top: 1px solid var(--rule);
	color: var(--muted);
	font-size: 0.85rem;
}

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

.site-footer ul {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem 1.25rem;
	margin: 0;
	padding: 0;
}

/* --- small screens ------------------------------------------------------- */

@media (max-width: 40rem) {
	html { font-size: 16px; }
	.topnav .wrap {
		-webkit-mask-image: linear-gradient(to right, #000 82%, transparent);
		mask-image: linear-gradient(to right, #000 82%, transparent);
	}
	.masthead { padding: 2.25rem 0 1.5rem; }
	.masthead-name { font-size: 2.05rem; }
	section[id] { padding-top: 2.25rem; }
	h3 { font-size: 1.4rem; }
}

/* --- print --------------------------------------------------------------- */

@media print {
	.topnav, .skip-link, .site-footer { display: none; }
	body { background: #fff; color: #000; }
	a { color: #000; text-decoration: underline; }
	.masthead { padding-top: 0; }
}
