@font-face {
	font-display: swap;
	font-family: 'Gambarino';
	src: local("Gambarino"),
	url('../fonts/gambarino.woff2') format('woff2'),
	url('../fonts/gambarino.woff') format('woff');
	font-weight: normal;
	font-style: normal;
}

@font-face {
	font-display: swap;
	font-family: 'Montreuil';
	src: local("MontreuilDemo"),
	url('../fonts/test/MontreuilDemo-Regular.otf') format('opentype');
	font-weight: 400;
	font-style: normal;
}

@font-face {
	font-display: swap;
	font-family: 'Montreuil';
	src: local("MontreuilDemo"),
	url('../fonts/test/MontreuilDemo-Italic.otf') format('opentype');
	font-weight: 400;
	font-style: italic;
}

@font-face {
	font-display: swap;
	font-family: 'Montreuil';
	src: local("MontreuilDemo"),
	url('../fonts/test/MontreuilDemo-Medium.otf') format('opentype');
	font-weight: 500;
	font-style: normal;
}

@font-face {
	font-display: swap;
	font-family: 'Montreuil';
	src: local("MontreuilDemo"),
	url('../fonts/test/MontreuilDemo-MediumItalic.otf') format('opentype');
	font-weight: 500;
	font-style: italic;
}

@font-face {
	font-display: swap;
	font-family: 'Montreuil';
	src: local("MontreuilDemo"),
	url('../fonts/test/MontreuilDemo-Semibold.otf') format('opentype');
	font-weight: 600;
	font-style: normal;
}

@font-face {
	font-display: swap;
	font-family: 'Montreuil';
	src: local("MontreuilDemo"),
	url('../fonts/test/MontreuilDemo-SemiboldItalic.otf') format('opentype');
	font-weight: 600;
	font-style: italic;
}

@font-face {
	font-display: swap;
	font-family: 'Montreuil';
	src: local("MontreuilDemo"),
	url('../fonts/test/MontreuilDemo-Bold.otf') format('opentype');
	font-weight: 700;
	font-style: normal;
}

@font-face {
	font-display: swap;
	font-family: 'Montreuil';
	src: local("MontreuilDemo"),
	url('../fonts/test/MontreuilDemo-BoldItalic.otf') format('opentype');
	font-weight: 700;
	font-style: italic;
}

@font-face {
	font-display: swap;
	font-family: 'Montreuil';
	src: local("MontreuilDemo"),
	url('../fonts/test/MontreuilDemo-Black.otf') format('opentype');
	font-weight: 900;
	font-style: normal;
}

@font-face {
	font-display: swap;
	font-family: 'Montreuil';
	src: local("MontreuilDemo"),
	url('../fonts/test/MontreuilDemo-BlackItalic.otf') format('opentype');
	font-weight: 900;
	font-style: italic;
}

@font-face {
	font-display: swap;
	font-family: 'Montreuil';
	src: local("MontreuilDemo"),
	url('../fonts/test/MontreuilDemo-Light.otf') format('opentype');
	font-weight: 300;
	font-style: normal;
}

@font-face {
	font-display: swap;
	font-family: 'Montreuil';
	src: local("MontreuilDemo"),
	url('../fonts/test/MontreuilDemo-LightItalic.otf') format('opentype');
	font-weight: 300;
	font-style: italic;
}

@font-face {
	font-display: swap;
	font-family: 'Montreuil';
	src: local("MontreuilDemo"),
	url('../fonts/test/MontreuilDemo-Thin.otf') format('opentype');
	font-weight: 200;
	font-style: normal;
}

@font-face {
	font-display: swap;
	font-family: 'Montreuil';
	src: local("MontreuilDemo"),
	url('../fonts/test/MontreuilDemo-ThinItalic.otf') format('opentype');
	font-weight: 200;
	font-style: italic;
}

html {
	overflow-x: hidden;
	scroll-behavior: smooth;
	background: var(--secondary);
	color: var(--primary);

	background-image:
		radial-gradient(
			circle at left top,
			oklch(from var(--tertiary) l c h / calc(alpha - .7)),
			transparent 50vw
		),
		radial-gradient(
			circle at right bottom,
			oklch(from var(--tertiary) l c h / calc(alpha - .5)),
			transparent 50vw
		),
		radial-gradient(
			circle at right top,
			rgba(255, 100, 100, 0.2),
			transparent 50vw
		),
		radial-gradient(
			circle at left center,
			rgba(255, 100, 100, 0.2),
			transparent 160vh
		);
	position: relative;

	&::after {
		content: "";
		width: 100%;
		position: absolute;
		top: 0;
		bottom: 0;
		left: 0;
		z-index: 2;
		mix-blend-mode: soft-light;
		background-image: url("/assets/img/noise.svg");
		background-size: 1000px;
		background-repeat: repeat;
		pointer-events: none;
	}

	--primary: light-dark(#a00000, #95d6f0);
	--secondary: light-dark(#acdcef, #600000);
	--tertiary: light-dark(#fcf9f5, #300000);

	--border-color: oklch(from currentColor l c h / calc(alpha - .7));
}

body {
	overflow-wrap: break-word;
	font-family: Montreuil, Inter, Roboto, 'Helvetica Neue', 'Arial Nova', 'Nimbus Sans', Arial, sans-serif;
	font-size: clamp(1em, 16px + 0.44vw, 1.25em);
	line-height: 1.6;
	margin: 0;
	padding: 0;

	@supports (font-variant-ligatures: discretionary-ligatures) {
		font-variant-ligatures: discretionary-ligatures;
	}
}

*:focus-visible {
	outline: .2em solid currentColor;
	outline-offset: .2em;
}

h1,
h2,
h3 {
	font-family: Gambarino, 'Iowan Old Style', 'Palatino Linotype', 'URW Palladio L', P052, serif;
	line-height: 1.1;
	text-wrap: balance;
	font-weight: unset;
}

h1 {
	font-size: 3.5em;
	margin-block: 2em 1.5em;
}

h2 {
	font-size: 2em;
	margin-block: 2.5em 1.5em;
}

a {
	color: var(--primary);
	transition: text-decoration 200ms cubic-bezier(.25,.8,.25,1),
		text-underline-offset 200ms cubic-bezier(.25,.8,.25,1);
	text-underline-offset: .2em;

	&:visited {
		color: light-dark(oklch(from var(--primary) calc(l + .1) c h),
			oklch(from var(--primary) calc(l - .1) c h));
		text-decoration-thickness: 0;
	}

	&:visited:hover {
		color: var(--primary);
	}

	&:hover {
		text-underline-offset: .3em;
	}
}

.action {
	font-size: 1.05em;
	font-weight: 600;
}

nav {
	display: flex;
	justify-content: space-between;
	padding: 24px 32px;
	border-bottom: 1px solid var(--border-color);
	font-size: .85em;
	line-height: 1;
	text-box-trim: trim-both;

	& ul {
		display: flex;
		list-style: none;
		gap: 2vw;
		margin: 0;
		padding: 0;
	}

	a {
		text-decoration-color: transparent;
		text-decoration-skip-ink: auto;
		text-underline-offset: .2em;
		padding: .1em;

		&:visited {
			color: var(--primary);
		}

		&:hover {
			text-decoration-color: currentColor;
			text-decoration-thickness: .1em;
		}
	}

	> a {
		text-decoration: none;
		font-weight: 700;
	}
}

main {
	max-width: 60ch;
	margin: 5vw auto;
	padding: 0 4vw;

	&:has(.intro) {
		max-width: 90ch;
	}
}

.home {
	padding-top: 1vw;
}

.intro {
	font-size: clamp(1.2em, 16px + 2.04vw, 1.8em);
	line-height: 1.3;
	margin-block-end: 10vw;
	max-width: 45rem;
	font-weight: 300;
}

.last-publication {
	padding: calc(1.5vw + 1em);
	border: 1px solid var(--border-color);
	border-radius: 1vw;

	p {
		margin-block: .15rem;
	}

	.pre-header {
		font-size: 1em;
		font-variant-caps: all-small-caps;
		font-family: inherit;
		font-weight: bold;
		margin-block: 0;
	}

	div {
		display: grid;
		grid-template-columns: 2.5em 1fr;
		column-gap: 1em;
		margin-block: 1em;

		* {
			grid-column: 2;
		}
	}

	.year {
		font-size: .9em;
		margin-block: .5rem;
		grid-column: 1;
	}

	h3 {
		font-size: 1.75em;
		margin-block: .5rem;
	}

	.doi {
		font-size: .85em;
		font-variant-numeric: tabular-nums;
	}
}

.publications {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: 2.5em 1fr;
	column-gap: 1.5em;
	max-width: 45rem;
	line-height: 1.3;

	column-rule: 1px solid var(--border-color);

	li {
		display: grid;
		grid-template-columns: subgrid;
		grid-column: 1 / span 2;
		column-rule: 1px solid var(--border-color);

		p {
			margin: .15rem 0;
		}

		a {
			font-weight: 500;
		}

		> :first-child {
			grid-column: 1;
			opacity: .75;
		}

		:not(:first-child) {
			grid-column: 2;
		}

		& > :last-child {
			opacity: .75;
			font-size: .85em;
			margin-bottom: 2.5em;
		}
	}
}

footer {
	margin-block-start: 10vw;
	padding: 24px 32px;
	border-top: 1px solid var(--border-color);
	display: flex;
	gap: 32px;
	font-size: .85em;

	ul {
		list-style: none;
		margin: 1em 0;
		padding: 0;
		display: flex;
		flex-direction: column;
		gap: 1em;
	}

	fieldset {
		border: 0;
		border-left: 1px solid var(--border-color);
		padding-left: 32px;
		display: flex;
		flex-direction: column;

		legend {
			font-weight: bold;
		}

		label {
			margin-block: .5em;
		}
	}
}