/* Palette: security paper and intaglio ink. The rosette is printed in iris
   (a colour ramp), like the guilloche on banknotes and cheques. */

:root {
	--paper: #e4ebe6;
	--ink: #14243a;
	--ink-soft: #4b5b6c;
	--iris-a: #1d7d6e;
	--iris-b: #5b44b0;
	--line-opacity: 0.75;
}

@media (prefers-color-scheme: dark) {
	:root {
		--paper: #0f1a28;
		--ink: #e4ebe6;
		--ink-soft: #9aa9b5;
		--iris-a: #6fd6c3;
		--iris-b: #b2a6ff;
		--line-opacity: 0.75;
	}
}

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

html {
	background: var(--paper);
	color: var(--ink);
	font-family: "Archivo", system-ui, sans-serif;
	font-size: 100%;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

/* Text on the left, rosette in its own column on the right. The rosette is
   wider than its column and its frame crops it at the edge of the screen. */
body {
	display: grid;
	grid-template-columns: minmax(0, 46rem) minmax(40%, 1fr);
	min-height: 100svh;
	margin: 0;
}

/* Rosette ---------------------------------------------------------------- */

.rosette-frame {
	grid-area: 1 / 2;
	display: flex;
	align-items: center;
	min-width: 0;
	overflow: hidden;
	pointer-events: none;
}

.rosette {
	flex: none;
	width: min(150%, 100vh);
	height: auto;
}

.rosette .iris-a {
	stop-color: var(--iris-a);
}

.rosette .iris-b {
	stop-color: var(--iris-b);
}

.rosette path {
	fill: none;
	stroke: url(#iris);
	stroke-width: 0.75;
	stroke-opacity: var(--line-opacity);
	vector-effect: non-scaling-stroke;
}

@media (prefers-reduced-motion: no-preference) {
	.rosette path {
		stroke-dasharray: 100;
		stroke-dashoffset: 100;
		animation: draw 2.6s cubic-bezier(0.55, 0, 0.2, 1) forwards;
		animation-delay: calc(var(--i) * 45ms);
	}
}

@keyframes draw {
	to {
		stroke-dashoffset: 0;
	}
}

/* Page ------------------------------------------------------------------- */

.page {
	grid-area: 1 / 1;
	padding: clamp(2.5rem, 7vh, 6rem) clamp(1rem, 6vw, 6rem) clamp(2.5rem, 7vh, 5rem);
}

h1 {
	margin: 0 0 2rem;
	font-size: clamp(3.25rem, 1.5rem + 5.6vw, 6.75rem);
	font-weight: 800;
	font-variation-settings: "wdth" 125;
	line-height: 0.9;
	letter-spacing: -0.015em;
}

.intro p {
	max-width: 32em;
	margin: 0 0 1em;
	font-size: clamp(1.15rem, 0.95rem + 0.5vw, 1.375rem);
	line-height: 1.45;
}

a {
	color: inherit;
	text-decoration-line: underline;
	text-decoration-color: var(--iris-a);
	text-decoration-thickness: 2px;
	text-underline-offset: 0.2em;
	transition: text-decoration-color 150ms ease;
}

a:hover {
	text-decoration-color: currentColor;
}

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

/* Career path ------------------------------------------------------------ */

.path {
	margin-top: clamp(2rem, 5vh, 3.5rem);
}

h2 {
	margin: 0 0 1.25rem;
	font-size: 1rem;
	font-weight: 700;
	font-variation-settings: "wdth" 112;
}

.path ol {
	margin: 0;
	padding: 0;
	list-style: none;
}

.path li {
	display: grid;
	grid-template-columns: 6.5rem 1fr;
	column-gap: 1rem;
	padding: 0.5rem 0;
	line-height: 1.4;
}

.years {
	grid-row: span 2;
	color: var(--ink-soft);
	font-variant-numeric: tabular-nums;
}

.org {
	font-weight: 650;
}

.role {
	color: var(--ink-soft);
}

/* Links ------------------------------------------------------------------ */

.elsewhere {
	margin-top: clamp(1.75rem, 4vh, 3rem);
}

.elsewhere ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.75rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.elsewhere a {
	font-weight: 650;
}

/* Narrow screens: the rosette sits above the name instead of beside it. -- */

@media (max-width: 899px) {
	body {
		--crown: min(74vw, 52vh);
		display: block;
		position: relative;
	}

	.rosette-frame {
		display: block;
		position: absolute;
		inset: 0 0 auto;
		height: calc(var(--crown) * 1.04);
	}

	.rosette {
		position: absolute;
		bottom: 0;
		right: calc(var(--crown) * -0.57);
		width: calc(var(--crown) * 1.7);
	}

	.page {
		position: relative;
		padding-top: var(--crown);
	}
}

@media (max-width: 560px) {
	.path li {
		grid-template-columns: 1fr;
	}

	.years {
		grid-row: auto;
	}
}
