/* ==========================================================================
   kpytka.eu — site stylesheet
   Light, editorial design: warm paper, serif display type, hairline rules.
   Dark variant follows the visitor's system preference.
   ========================================================================== */

/* ---------- Local font: Jost (UI labels, navigation, buttons) ---------- */

@font-face {
	font-family: "Jost";
	src: url("../webfonts/Jost-400-Book.otf") format("opentype");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Jost";
	src: url("../webfonts/Jost-500-Medium.otf") format("opentype");
	font-weight: 500;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Jost";
	src: url("../webfonts/Jost-600-Semi.otf") format("opentype");
	font-weight: 600;
	font-style: normal;
	font-display: swap;
}

/* ---------- Design tokens ---------- */

:root {
	color-scheme: light;

	--paper: #f6f3ec;
	--paper-2: #fdfcf9;
	--paper-3: #ece8df;

	--ink: #17181d;
	--ink-2: #4b4c56;
	--ink-3: #6b6c76;

	--rule: rgba(23, 24, 29, 0.14);
	--rule-2: rgba(23, 24, 29, 0.08);

	/* Accent: the sunset glow of the Meadows photo (hue about 30). */
	--accent: #a4501a;
	--accent-strong: #7c3a10;
	--accent-soft: rgba(164, 80, 26, 0.09);
	--on-accent: #ffffff;

	--shadow-sm: 0 1px 2px rgba(23, 24, 29, 0.05), 0 2px 10px -2px rgba(23, 24, 29, 0.08);
	--shadow-lg: 0 2px 4px rgba(23, 24, 29, 0.06), 0 28px 56px -28px rgba(23, 24, 29, 0.4);

	--header-h: 4rem;
	--gutter: clamp(1.25rem, 4vw, 3rem);
	--radius: 6px;
	--radius-lg: 10px;

	--serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
	--sans: "Jost", "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
	--mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

	--ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		color-scheme: dark;
		--paper: #121318;
		--paper-2: #1a1b21;
		--paper-3: #23242b;
		--ink: #ebe7de;
		--ink-2: #b9b5ac;
		--ink-3: #8f8c84;
		--rule: rgba(235, 231, 222, 0.16);
		--rule-2: rgba(235, 231, 222, 0.09);
		--accent: #e6a562;
		--accent-strong: #f3bf86;
		--accent-soft: rgba(230, 165, 98, 0.12);
		--on-accent: #17181d;
		--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 2px 10px -2px rgba(0, 0, 0, 0.4);
		--shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.4), 0 28px 56px -28px rgba(0, 0, 0, 0.75);
	}
}

:root[data-theme="dark"] {
	color-scheme: dark;
	--paper: #121318;
	--paper-2: #1a1b21;
	--paper-3: #23242b;
	--ink: #ebe7de;
	--ink-2: #b9b5ac;
	--ink-3: #8f8c84;
	--rule: rgba(235, 231, 222, 0.16);
	--rule-2: rgba(235, 231, 222, 0.09);
	--accent: #e6a562;
	--accent-strong: #f3bf86;
	--accent-soft: rgba(230, 165, 98, 0.12);
	--on-accent: #17181d;
	--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 2px 10px -2px rgba(0, 0, 0, 0.4);
	--shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.4), 0 28px 56px -28px rgba(0, 0, 0, 0.75);
}

/* ---------- Base ---------- */

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

html {
	-webkit-text-size-adjust: 100%;
	scroll-padding-top: calc(var(--header-h) + 1.5rem);
}

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

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--serif);
	font-size: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
	line-height: 1.6;
	font-optical-sizing: auto;
	text-rendering: optimizeLegibility;
	overflow-x: clip;
}

img,
svg {
	max-width: 100%;
	height: auto;
}

h1,
h2,
h3,
h4 {
	font-family: var(--serif);
	font-weight: 500;
	line-height: 1.15;
	letter-spacing: -0.01em;
	margin: 0;
	text-wrap: balance;
}

p {
	margin: 0 0 1.25rem;
}

p:last-child {
	margin-bottom: 0;
}

strong,
b {
	font-weight: 600;
	color: var(--ink);
}

em,
i {
	font-style: italic;
}

a {
	color: inherit;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
	text-decoration-color: var(--rule);
	transition: color 0.2s var(--ease), text-decoration-color 0.2s var(--ease);
}

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

code {
	font-family: var(--mono);
	font-size: 0.86em;
	background: var(--paper-3);
	border: 1px solid var(--rule-2);
	border-radius: 4px;
	padding: 0.08em 0.4em;
}

::selection {
	background: var(--accent);
	color: var(--on-accent);
}

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

.container {
	width: min(100% - 2 * var(--gutter), 1120px);
	margin-inline: auto;
}

.visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.skip-link {
	position: absolute;
	top: 0.75rem;
	left: 0.75rem;
	z-index: 100;
	padding: 0.6rem 1rem;
	background: var(--ink);
	color: var(--paper);
	font-family: var(--sans);
	font-size: 0.9rem;
	border-radius: var(--radius);
	text-decoration: none;
	transform: translateY(-200%);
	transition: transform 0.2s var(--ease);
}

.skip-link:focus {
	transform: none;
}

/* Icons (inline SVG sprite) */

.icon {
	width: 1em;
	height: 1em;
	display: inline-block;
	vertical-align: -0.15em;
	flex: none;
}

/* ---------- Header ---------- */

.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	height: var(--header-h);
	background: color-mix(in srgb, var(--paper) 84%, transparent);
	-webkit-backdrop-filter: blur(14px) saturate(1.4);
	backdrop-filter: blur(14px) saturate(1.4);
	border-bottom: 1px solid transparent;
	transition: border-color 0.3s var(--ease);
}

@supports not (background: color-mix(in srgb, red 50%, blue)) {
	.site-header {
		background: var(--paper);
	}
}

.site-header.is-scrolled {
	border-bottom-color: var(--rule-2);
}

.site-header__inner {
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem;
}

.brand {
	display: flex;
	align-items: center;
	gap: 0.9rem;
	min-width: 0;
	color: var(--ink);
	text-decoration: none;
	white-space: nowrap;
}

.brand__logo {
	display: block;
	height: 1.9rem;
	width: auto;
	filter: brightness(0);
	opacity: 0.85;
	transition: opacity 0.2s var(--ease);
}

.brand:hover .brand__logo {
	opacity: 1;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .brand__logo {
		filter: none;
		opacity: 0.9;
	}
}

:root[data-theme="dark"] .brand__logo {
	filter: none;
	opacity: 0.9;
}

.brand__name {
	padding-left: 0.9rem;
	border-left: 1px solid var(--rule);
	font-family: var(--serif);
	font-size: 1.2rem;
	font-weight: 500;
	line-height: 1.1;
	letter-spacing: -0.01em;
	transition: color 0.2s var(--ease);
}

.brand:hover .brand__name {
	color: var(--accent);
}

.brand__short {
	display: none;
}

.site-nav {
	min-width: 0;
	position: relative;
}

.site-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	gap: clamp(1rem, 2.5vw, 2rem);
}

.site-nav a {
	display: inline-block;
	padding: 0.4rem 0;
	font-family: var(--sans);
	font-size: 0.9rem;
	font-weight: 500;
	letter-spacing: 0.01em;
	color: var(--ink-2);
	text-decoration: none;
	white-space: nowrap;
	position: relative;
}

.site-nav a::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 1.5px;
	background: var(--accent);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 0.3s var(--ease);
}

.site-nav a:hover,
.site-nav a[aria-current="true"] {
	color: var(--ink);
}

.site-nav a:hover::after,
.site-nav a[aria-current="true"]::after {
	transform: scaleX(1);
}

@media (max-width: 720px) {
	:root {
		--header-h: 3.5rem;
	}

	.brand__full {
		display: none;
	}

	.brand__short {
		display: inline;
	}

	.site-nav {
		flex: 1;
		overflow-x: auto;
		scrollbar-width: none;
		-webkit-overflow-scrolling: touch;
	}

	.site-nav::-webkit-scrollbar {
		display: none;
	}

	.site-nav ul {
		width: max-content;
		margin-inline: auto;
		gap: 0.9rem;
	}

	.site-nav a {
		font-size: 0.82rem;
	}

	.brand__logo {
		height: 1.75rem;
	}

	.site-nav.is-overflowing {
		-webkit-mask-image: linear-gradient(to right, #000 calc(100% - 2.5rem), transparent);
		mask-image: linear-gradient(to right, #000 calc(100% - 2.5rem), transparent);
	}

	.site-nav.is-overflowing ul {
		padding-right: 2.5rem;
	}
}

@media (max-width: 520px) {
	.brand__name {
		display: none;
	}

	.site-header__inner {
		gap: 1rem;
	}

	.site-nav ul {
		gap: 0.62rem;
	}

	.site-nav a {
		font-size: 0.78rem;
	}
}

@media (max-width: 380px) {
	.site-header__inner {
		gap: 0.75rem;
	}

	.site-nav ul {
		gap: 0.5rem;
	}

	.site-nav a {
		font-size: 0.74rem;
	}

	.brand__logo {
		height: 1.5rem;
	}
}

/* ---------- Hero / About ---------- */

.hero {
	position: relative;
	padding-block: clamp(2.5rem, 6vw, 5rem) clamp(3rem, 7vw, 6rem);
}

/* Masthead photo band. Shown only when <body> has the "has-backdrop" class;
   data-backdrop="calton" (Calton Hill at dusk) or data-backdrop="meadows"
   (The Meadows at sunset) on <body> picks the photo. */

.hero__backdrop {
	display: none;
}

.has-backdrop .hero {
	/* Band height = top bar + a photo strip that scales with the window width
	   but never takes more than about half of the window height. */
	--band-h: calc(var(--header-h) + clamp(240px, min(36vw, 52vh), 760px));
	padding-top: calc(var(--band-h) * 0.96 - var(--header-h));
}

.has-backdrop:not([data-backdrop="meadows"]) .hero__backdrop--calton,
.has-backdrop[data-backdrop="meadows"] .hero__backdrop--meadows {
	display: block;
}

.has-backdrop .hero__backdrop {
	position: absolute;
	top: calc(-1 * var(--header-h));
	left: 0;
	right: 0;
	height: var(--band-h);
	overflow: hidden;
	z-index: 0;
	pointer-events: none;
	filter: saturate(0.92) brightness(0.97);
	-webkit-mask-image: linear-gradient(to bottom, #000 0, #000 74%, rgba(0, 0, 0, 0.5) 87%, transparent 100%);
	mask-image: linear-gradient(to bottom, #000 0, #000 74%, rgba(0, 0, 0, 0.5) 87%, transparent 100%);
}

/* The photo spans the full width and is shifted so that its landmark sits at a
   fixed place in the band: the Calton Hill cupola just below the top bar, the
   Meadows spire tip at about 45% of the band height. */
.has-backdrop .hero__backdrop img {
	position: absolute;
	left: 0;
	width: 100%;
	height: auto;
}

.hero__backdrop--calton img {
	top: calc(var(--header-h) + 10px - 1.33vw);
}

.hero__backdrop--meadows img {
	top: calc(var(--band-h) * 0.45 - 22.3vw);
}

@media (max-width: 739px) {
	.has-backdrop .hero {
		--band-h: 220px;
		padding-top: calc(var(--band-h) * 0.96);
	}

	.has-backdrop .hero__backdrop {
		top: 0;
	}

	.has-backdrop .hero__backdrop img {
		position: static;
		width: 100%;
		height: 100%;
		object-fit: cover;
	}

	.hero__backdrop--calton img {
		object-position: 46% 0;
	}

	.hero__backdrop--meadows img {
		object-position: 60% 0;
	}
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .has-backdrop .hero__backdrop {
		filter: saturate(0.9) brightness(0.8);
	}
}

:root[data-theme="dark"] .has-backdrop .hero__backdrop {
	filter: saturate(0.9) brightness(0.8);
}

.hero__grid {
	position: relative;
	z-index: 1;
}

.hero__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	grid-template-areas:
		"intro"
		"portrait"
		"body";
	gap: 2rem;
}

.hero__intro {
	grid-area: intro;
}

.hero__body {
	grid-area: body;
}

.hero__portrait {
	grid-area: portrait;
}

@media (min-width: 740px) {
	.hero__grid {
		grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
		grid-template-areas:
			"intro portrait"
			"body  portrait";
		gap: 1.5rem clamp(3rem, 6vw, 6rem);
		align-items: start;
	}

	.hero__portrait {
		align-self: start;
		justify-self: end;
		margin-top: 0.35rem;
	}
}

.hero__greeting {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	margin: 0 0 0.35rem;
	font-style: italic;
	font-size: clamp(1.25rem, 1rem + 1vw, 1.65rem);
	color: var(--accent);
}

.hero__greeting a {
	display: inline-flex;
	color: inherit;
	text-decoration: none;
	opacity: 0.75;
	transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}

.hero__greeting a:hover {
	opacity: 1;
	transform: translateY(-1px);
}

.hero__greeting .icon {
	width: 0.85em;
	height: 0.85em;
}

.hero__name {
	font-size: clamp(2.25rem, 1rem + 5.5vw, 5rem);
	font-weight: 400;
	line-height: 1.05;
	letter-spacing: -0.02em;
	white-space: nowrap;
	min-height: 1.05em;
	margin: 0 0 0.9rem;
}

.hero__caret {
	display: none;
	width: 0.045em;
	height: 0.8em;
	margin-left: 0.06em;
	vertical-align: -0.06em;
	background: var(--accent);
	animation: caret-blink 1s steps(2, start) infinite;
}

.js .hero__caret {
	display: inline-block;
}

.hero__caret.is-done {
	animation: caret-out 0.9s var(--ease) 0.6s forwards;
}

@keyframes caret-blink {
	to {
		visibility: hidden;
	}
}

@keyframes caret-out {
	to {
		opacity: 0;
	}
}

.hero__role {
	font-family: var(--sans);
	font-size: 0.85rem;
	font-weight: 500;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--ink-2);
	margin: 0;
}

.hero__affiliation {
	margin: 0.6rem 0 0;
	font-size: clamp(1.1rem, 1rem + 0.4vw, 1.3rem);
	font-weight: 500;
	line-height: 1.35;
	letter-spacing: -0.005em;
	color: var(--ink);
}

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

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

.hero__affiliation-sep {
	margin: 0 0.5em;
	color: var(--ink-3);
}

.hero__school {
	white-space: nowrap;
}

/* Too narrow for one line: stack the two names instead of orphaning a word. */
@media (max-width: 420px) {
	.hero__affiliation a,
	.hero__school {
		display: block;
		width: fit-content;
	}

	.hero__affiliation-sep {
		display: none;
	}
}

.hero__note {
	margin: 1.75rem 0 0;
	max-width: 40em;
	font-style: italic;
	font-size: 0.92rem;
	line-height: 1.5;
	color: var(--ink-3);
	text-wrap: pretty;
}

.hero__note a {
	display: inline-flex;
	vertical-align: -0.12em;
	color: var(--accent);
	text-decoration: none;
	transition: transform 0.2s var(--ease), color 0.2s var(--ease);
}

.hero__note a:hover {
	color: var(--accent-strong);
	transform: translateY(-1px);
}

.hero__say {
	font-family: var(--sans);
	font-style: normal;
	font-weight: 500;
	font-size: 0.86em;
	letter-spacing: 0.05em;
	color: var(--ink-2);
}

.lede,
.hero__focus,
.paper__authors,
.paper__abstract,
.block__text,
.quote,
.misc__text p {
	font-variant-numeric: oldstyle-nums proportional-nums;
}

.lede {
	font-size: clamp(1.15rem, 1.05rem + 0.45vw, 1.4rem);
	line-height: 1.5;
	max-width: 34em;
	margin: 0 0 1.25rem;
}

.hero__focus {
	color: var(--ink-2);
	max-width: 40em;
	margin: 0 0 2rem;
}

.hero__focus strong {
	font-weight: 500;
}

.hero__portrait {
	position: relative;
	isolation: isolate;
	margin: 0;
	width: min(100%, 300px);
	padding: 0 14px 14px 0;
}

@media (min-width: 740px) {
	.hero__portrait {
		width: min(100%, 360px);
	}
}

.hero__portrait::before {
	content: "";
	position: absolute;
	inset: 14px 0 0 14px;
	border: 1px solid var(--rule);
	border-radius: var(--radius-lg);
	z-index: -1;
}

.hero__portrait img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 3 / 4;
	object-fit: cover;
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-lg);
}

/* ---------- Buttons & chips ---------- */

.actions {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem 0.7rem;
}

.btn {
	display: inline-flex;
	align-items: center;
	gap: 0.55rem;
	padding: 0.72rem 1.1rem;
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	background: transparent;
	color: var(--ink);
	font-family: var(--sans);
	font-size: 0.9rem;
	font-weight: 500;
	letter-spacing: 0.01em;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
}

.btn:hover {
	color: var(--ink);
	border-color: var(--ink);
	background: var(--paper-2);
	transform: translateY(-1px);
}

.btn--primary {
	background: var(--ink);
	border-color: var(--ink);
	color: var(--paper);
}

.btn--primary:hover {
	background: var(--accent);
	border-color: var(--accent);
	color: var(--on-accent);
}

.btn .icon {
	width: 1.05em;
	height: 1.05em;
	vertical-align: 0;
}

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

.chip {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	padding: 0.48rem 0.8rem;
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	background: transparent;
	color: var(--ink-2);
	font-family: var(--sans);
	font-size: 0.84rem;
	font-weight: 500;
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
	transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.chip .icon {
	width: 1em;
	height: 1em;
	vertical-align: 0;
	color: var(--ink-3);
	transition: color 0.2s var(--ease);
}

.chip:hover {
	color: var(--accent);
	border-color: var(--accent);
	background: var(--accent-soft);
	transform: translateY(-1px);
}

.chip:hover .icon {
	color: inherit;
}

/* ---------- Sections ---------- */

.section {
	border-top: 1px solid var(--rule-2);
	padding-block: clamp(3.5rem, 8vw, 6.5rem);
}

.section__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 2rem;
}

@media (min-width: 900px) {
	.section__grid {
		grid-template-columns: minmax(0, 1fr) minmax(0, 2.6fr);
		gap: 3rem clamp(3rem, 6vw, 6rem);
	}

	.section__head {
		position: sticky;
		top: calc(var(--header-h) + 2rem);
		align-self: start;
	}
}

main {
	counter-reset: section;
}

.section {
	counter-increment: section;
}

.section__head::before {
	content: counter(section, decimal-leading-zero);
	display: block;
	width: 2.5rem;
	padding-top: 0.6rem;
	border-top: 2px solid var(--accent);
	margin-bottom: 1rem;
	font-family: var(--sans);
	font-size: 0.74rem;
	font-weight: 500;
	letter-spacing: 0.14em;
	line-height: 1;
	color: var(--accent);
}

.section__title {
	font-size: clamp(1.85rem, 1.4rem + 1.6vw, 2.5rem);
	font-weight: 400;
	line-height: 1.1;
	letter-spacing: -0.015em;
	margin: 0;
}

.section__title-end {
	white-space: nowrap;
}

.section__title .icon {
	width: 0.62em;
	height: 0.62em;
	margin-left: 0.12em;
	vertical-align: -0.03em;
	color: var(--accent);
}

.section__body {
	min-width: 0;
}

/* ---------- Research ---------- */

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

.paper {
	padding-block: 2.25rem;
	border-top: 1px solid var(--rule-2);
}

.paper:first-child {
	padding-top: 0;
	border-top: 0;
}

.paper:last-child {
	padding-bottom: 0;
}

.paper__title {
	font-size: clamp(1.3rem, 1.15rem + 0.5vw, 1.6rem);
	font-weight: 500;
	line-height: 1.25;
	letter-spacing: -0.01em;
	margin: 0 0 0.5rem;
}

.paper__authors {
	font-style: italic;
	color: var(--ink-3);
	margin: 0 0 0.6rem;
}

.paper__status {
	display: flex;
	align-items: baseline;
	gap: 0.6rem;
	margin: 0 0 1.1rem;
	font-style: italic;
	color: var(--accent);
}

.paper__status::before {
	content: "";
	width: 0.42rem;
	height: 0.42rem;
	border-radius: 50%;
	background: var(--accent);
	flex: none;
	align-self: center;
}

.paper .chips {
	margin-bottom: 1.4rem;
}

.paper__abstract {
	color: var(--ink-2);
	font-size: 0.98em;
	line-height: 1.65;
	max-width: 68ch;
	margin: 0;
	text-wrap: pretty;
}

.paper__extra {
	margin-top: 1.75rem;
	padding-top: 1.4rem;
	border-top: 1px solid var(--rule-2);
}

.label {
	font-family: var(--sans);
	font-size: 0.74rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--ink-3);
	margin: 0 0 0.85rem;
}

.paper__extra ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.75rem;
}

.paper__extra li {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 0.8rem;
	color: var(--ink-2);
	font-size: 0.95em;
	max-width: 68ch;
}

/* ---------- Teaching ---------- */

.blocks > * + * {
	margin-top: 3rem;
	padding-top: 3rem;
	border-top: 1px solid var(--rule-2);
}

.block__title {
	font-size: clamp(1.3rem, 1.15rem + 0.5vw, 1.6rem);
	font-weight: 500;
	line-height: 1.25;
	margin: 0 0 0.75rem;
}

.block__text {
	color: var(--ink-2);
	max-width: 68ch;
	margin: 0 0 1.6rem;
	text-wrap: pretty;
}

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

.course {
	padding: 1.25rem 0;
	border-top: 1px solid var(--rule-2);
}

.course:last-child {
	padding-bottom: 0;
}

.course__title {
	font-size: 1.12rem;
	font-weight: 500;
	line-height: 1.35;
	margin: 0 0 0.3rem;
}

.course__title strong {
	font-weight: 500;
}

.course__subtitle {
	margin: 0 0 0.5rem;
	font-style: italic;
	color: var(--ink-3);
}

.course__level {
	font-family: var(--sans);
	font-size: 0.76rem;
	font-weight: 500;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--ink-3);
	margin: 0;
}

.course .chips {
	margin-top: 0.9rem;
}

.quotes {
	columns: 2;
	column-gap: 1.25rem;
}

@media (max-width: 640px) {
	.quotes {
		columns: 1;
	}
}

.quote {
	break-inside: avoid;
	margin: 0 0 1.25rem;
	padding: 1.3rem 1.45rem;
	background: var(--paper-2);
	border: 1px solid var(--rule-2);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-sm);
	font-style: italic;
	font-size: 0.98em;
	line-height: 1.55;
	color: var(--ink-2);
	text-wrap: pretty;
}

/* ---------- Contact ---------- */

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

@media (min-width: 720px) {
	.contact {
		grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
		gap: 3rem;
		align-items: start;
	}
}

.contact__item {
	display: flex;
	gap: 0.9rem;
	margin: 0 0 1.5rem;
	line-height: 1.55;
}

.contact__item:last-child {
	margin-bottom: 0;
}

.contact__item .icon {
	width: 1.15rem;
	height: 1.15rem;
	margin-top: 0.28rem;
	color: var(--accent);
}

.contact__item .chip {
	margin-top: 0.1rem;
}

.map {
	aspect-ratio: 4 / 3;
	background: var(--paper-3);
	border: 1px solid var(--rule-2);
	border-radius: var(--radius-lg);
	overflow: hidden;
	box-shadow: var(--shadow-sm);
}

.map iframe {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}

.map-link {
	margin: 0.9rem 0 0;
	font-family: var(--sans);
	font-size: 0.86rem;
}

.map-link a {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	color: var(--ink-2);
	text-decoration: none;
}

.map-link a:hover {
	color: var(--accent);
}

/* ---------- Miscellanea ---------- */

.misc {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 2.25rem;
}

@media (min-width: 720px) {
	.misc {
		grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
		gap: 3rem;
		align-items: start;
	}
}

.misc__text p {
	color: var(--ink-2);
	max-width: 60ch;
	margin: 0 0 1.6rem;
}

.misc__text p a {
	color: inherit;
}

.misc__text p .icon {
	color: var(--accent);
}

.ipa {
	font-family: "Gentium Plus", "Charis SIL", "Doulos SIL", var(--serif);
}

.social-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.6rem 1rem;
	margin: 0 0 1rem;
}

.social-row__label {
	color: var(--ink-2);
}

.photo {
	margin: 0;
	width: min(100%, 300px);
}

.photo img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-lg);
}

.photo figcaption {
	margin-top: 0.8rem;
	font-style: italic;
	font-size: 0.92rem;
	color: var(--ink-3);
}

.photo figcaption a {
	color: var(--accent);
	font-weight: 500;
	text-decoration-color: currentColor;
	text-decoration-thickness: 1.5px;
}

.photo figcaption a:hover {
	color: var(--accent-strong);
}

/* ---------- Footer ---------- */

.site-footer {
	border-top: 1px solid var(--rule-2);
	padding: 2rem 0 2.5rem;
	font-family: var(--sans);
	font-size: 0.82rem;
	color: var(--ink-3);
}

.site-footer p {
	margin: 0;
}

.site-footer a {
	color: inherit;
}

/* ---------- BibTeX dialog ---------- */

.dialog {
	width: min(92vw, 640px);
	max-height: min(90vh, 100% - 2rem);
	margin: auto;
	padding: 0;
	border: 1px solid var(--rule);
	border-radius: 12px;
	background: var(--paper-2);
	color: var(--ink);
	box-shadow: var(--shadow-lg);
}

.dialog::backdrop {
	background: rgba(23, 24, 29, 0.45);
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
}

.dialog[open] {
	animation: dialog-in 0.25s var(--ease);
}

@keyframes dialog-in {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
}

.dialog__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 1rem 1.25rem 0.9rem;
	border-bottom: 1px solid var(--rule-2);
}

.dialog__title {
	font-family: var(--sans);
	font-size: 0.76rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--ink-3);
	margin: 0;
}

.icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.1rem;
	height: 2.1rem;
	padding: 0;
	border: 1px solid transparent;
	border-radius: var(--radius);
	background: transparent;
	color: var(--ink-2);
	cursor: pointer;
	transition: background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.icon-btn:hover {
	color: var(--ink);
	border-color: var(--rule);
	background: var(--paper-3);
}

.icon-btn .icon {
	width: 1.1rem;
	height: 1.1rem;
	vertical-align: 0;
}

.dialog__body {
	padding: 1.25rem;
}

.dialog__note {
	font-size: 0.92rem;
	line-height: 1.55;
	color: var(--ink-2);
	padding: 0.9rem 1.1rem;
	margin: 0 0 1rem;
	border-left: 2px solid var(--accent);
	border-radius: 0 var(--radius) var(--radius) 0;
	background: var(--accent-soft);
}

.dialog__note p {
	margin: 0;
}

.dialog__code {
	margin: 0;
	padding: 1rem 1.1rem;
	background: var(--paper-3);
	border: 1px solid var(--rule-2);
	border-radius: var(--radius);
	font-family: var(--mono);
	font-size: 0.82rem;
	line-height: 1.55;
	overflow: auto;
	white-space: pre;
	-webkit-overflow-scrolling: touch;
}

.dialog__actions {
	display: flex;
	justify-content: flex-end;
	gap: 0.6rem;
	padding: 0 1.25rem 1.25rem;
}

/* ---------- Motion ---------- */

.js .reveal {
	opacity: 0;
	transform: translateY(14px);
	transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.js .reveal.is-visible {
	opacity: 1;
	transform: none;
}

.js .hero__intro > *,
.js .hero__body > *,
.js .hero__portrait {
	animation: rise 0.9s var(--ease) both;
}

.js .hero__intro > :nth-child(1) { animation-delay: 0.05s; }
.js .hero__intro > :nth-child(2) { animation-delay: 0.15s; }
.js .hero__intro > :nth-child(3) { animation-delay: 0.25s; }
.js .hero__intro > :nth-child(4) { animation-delay: 0.35s; }
.js .hero__body > :nth-child(1) { animation-delay: 0.45s; }
.js .hero__body > :nth-child(2) { animation-delay: 0.55s; }
.js .hero__body > :nth-child(3) { animation-delay: 0.65s; }
.js .hero__body > :nth-child(4) { animation-delay: 0.75s; }
.js .hero__portrait { animation-delay: 0.3s; }

.js .has-backdrop .hero__backdrop {
	animation: fade-in 1.2s var(--ease) both;
}

@keyframes fade-in {
	from {
		opacity: 0;
	}
}

@keyframes rise {
	from {
		opacity: 0;
		transform: translateY(12px);
	}
}

@media (prefers-reduced-motion: reduce) {
	.js .reveal {
		opacity: 1;
		transform: none;
		transition: none;
	}

	.js .hero__intro > *,
	.js .hero__body > *,
	.js .hero__portrait,
	.js .has-backdrop .hero__backdrop,
	.dialog[open] {
		animation: none;
	}

	.hero__caret {
		animation: none;
	}

	.site-nav a::after,
	.btn,
	.chip,
	.skip-link {
		transition: none;
	}
}

/* ---------- Print ---------- */

@media print {
	.site-header,
	.skip-link,
	.map,
	.map-link,
	.dialog {
		display: none !important;
	}

	body {
		background: #fff;
		color: #000;
		font-size: 11pt;
	}

	.js .reveal,
	.js .hero__intro > *,
	.js .hero__body > *,
	.js .hero__portrait {
		opacity: 1;
		transform: none;
		animation: none;
	}

	.section__head {
		position: static;
	}

	.section,
	.paper,
	.course,
	.blocks > * + * {
		border-color: #ccc;
	}

	a {
		color: inherit;
		text-decoration: none;
	}

	.chip,
	.btn {
		border-color: #999;
		color: #000;
	}

	.btn--primary {
		background: none;
	}
}
