/******************************************************************************\
|                                                                              |
|                                   site.css                                   |
|                                                                              |
|        Modern, responsive styles for abemegahed.com. No build step:          |
|        edit this file directly. Colors live in the :root tokens below.       |
|                                                                              |
\******************************************************************************/

@font-face {
	font-family: "Open Sans Condensed";
	src: url("../fonts/open-sans-condensed/bold/OpenSans-CondBold.woff") format("woff"),
		url("../fonts/open-sans-condensed/bold/OpenSans-CondBold.ttf") format("truetype");
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}

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

:root {
	--blue: #3d5cc4;
	--blue-strong: #2c47a3;
	--orange: darkorange;
	--orange-text: darkorange;
	--bg: #ffffff;
	--bg-alt: #f5f7fc;
	--surface: #ffffff;
	--text: #1d2433;
	--text-muted: #556078;
	--border: #e2e7f2;
	--heading: var(--blue);
	--link: var(--blue);
	--link-hover: var(--orange-text);
	--label: var(--orange-text);

	--font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--font-display: "Open Sans Condensed", "Arial Narrow", "Roboto Condensed", sans-serif-condensed, sans-serif;

	--max: 68rem;
	--gutter: clamp(1.5rem, 6vw, 4.5rem);
	--radius: 14px;
	--header-h: 64px;

	--on-accent: #fff;
	--polaroid: white;
	--slide-caption: linear-gradient(to top, rgb(255 255 255 / .9), rgb(255 255 255 / .8) calc(100% - 3.5rem), transparent);
	--slide-title: #ff8a3d;
	--slide-subtitle: var(--heading);

	/* cards: one look for every card on the site (see "cards" below) */
	--card-bg: var(--bg-alt);        /* light: a subtle tint so cards stand out from the white page */
	--card-border: 2px solid var(--border);
	--card-radius: var(--radius);
	--card-padding: 1rem 1.25rem;
	--card-hover-border: color-mix(in srgb, var(--orange) 50%, transparent);
	/* text on blue/orange fills */
	color-scheme: light;
}

/* dark theme: chosen with the header toggle, or following the device setting */
:root[data-theme="dark"] {
	--blue: #7f9bff;
	--blue-strong: #a9bcff;
	--orange: #ff8a3d;
	--orange-text: #ff9a55;
	--bg: #0e1320;
	--bg-alt: #131a2b;
	--surface: #172036;
	--card-bg: var(--surface);
	--text: #e6e9f2;
	--text-muted: #a3acc2;
	--border: #263252;
	--on-accent: #0e1320;
	--polaroid: var(--card-bg);
	--slide-caption: linear-gradient(to top, rgb(10 16 36 / .9), rgb(10 16 36 / .8) calc(100% - 3.5rem), transparent);

	color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--blue: #7f9bff;
		--blue-strong: #a9bcff;
		--orange: #ff8a3d;
		--orange-text: #ff9a55;
		--bg: #0e1320;
		--bg-alt: #131a2b;
		--surface: #172036;
		--card-bg: var(--surface);
		--text: #e6e9f2;
		--text-muted: #a3acc2;
		--border: #263252;
		--on-accent: #0e1320;
		--polaroid: var(--card-bg);
		--slide-caption: linear-gradient(to top, rgb(10 16 36 / .92), rgb(10 16 36 / .85) calc(100% - 3.5rem), transparent);

		color-scheme: dark;
	}
}

/* ------------------------------------------------------------------- reset */

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

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

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		transition: none !important;
		animation: none !important;
	}
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font-body);
	font-size: clamp(1rem, .95rem + .2vw, 1.0625rem);
	line-height: 1.65;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;

	/* keep the footer at the bottom of the window on short pages */
	min-height: 100vh;
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
}

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

img {
	border: 0;
}

a {
	color: var(--link);
	text-underline-offset: .18em;
	text-decoration-thickness: 1px;
}

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

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

.skip-link {
	position: absolute;
	left: 1rem;
	top: -3rem;
	z-index: 100;
	background: var(--blue);
	color: #fff;
	padding: .5rem 1rem;
	border-radius: 8px;
}

.skip-link:focus {
	top: 1rem;
}

/* -------------------------------------------------------------- typography */

h1,
h2,
h3,
h4,
summary {
	font-family: var(--font-display);
	font-weight: 700;
	color: var(--heading);
	line-height: 1.1;
	letter-spacing: .01em;
	text-wrap: balance;
}

h1 {
	font-size: 3rem;
	margin: 0 0 .5rem;
}

h2 {
	font-size: 2.5rem;
	margin: 2rem 0 1rem;
}

h3 {
	font-size: 2rem;
	margin: 2.25rem 0 .75rem;
	clear: both;
}

/* section divider: short orange bar under h2 (evolved from the old full-width rule) */
h2::after,
summary.section-title::after {
	content: "";
	display: block;
	width: 3rem;
	height: 4px;
	margin-top: .5rem;
	background: var(--orange);
	border-radius: 2px;
}

/* orange dot as the h3 marker (centered on the first line) */
.content h3 {
	position: relative;
	padding-left: 1.05em;
}

.content h3::before {
	content: "";
	position: absolute;
	left: .1em;
	top: .3em;
	width: .5em;
	height: .5em;
	border-radius: 50%;
	background: var(--orange);
}

ul,
ol {
	padding-left: 1.4rem;
	margin: 0 0 1.25rem;
}

li {
	margin-bottom: .35rem;
}

li::marker {
	color: var(--orange);
}

.label {
	font-family: var(--font-display);
	letter-spacing: 0.1rem;
	color: var(--label);
	margin: 0 .35em 0 0;
}

p.label {
	margin: 1rem 0 .35rem;
}

p.label+ul {
	margin-top: 0;
}

li .label {
	margin-right: .3em;
}

.lead {
	font-size: clamp(1.1rem, 1rem + .4vw, 1.3rem);
	color: var(--text-muted);
	line-height: 1.6;
}

.caption {
	font-size: .85rem;
	font-style: italic;
	color: var(--text-muted);
	line-height: 1.3;
	margin-top: .4rem;
}

/* ----------------------------------------------------------------- layout */

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

/* -------------------------------------------------------------- site header */

.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: color-mix(in srgb, var(--bg) 85%, transparent);
	-webkit-backdrop-filter: saturate(1.6) blur(12px);
	backdrop-filter: saturate(1.6) blur(12px);
	border-bottom: 1px solid var(--border);
}

.site-header .container {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	height: var(--header-h);
}

.brand {
	display: flex;
	align-items: center;
	gap: .6rem;
	text-decoration: none;
}

.brand img {
	display: block;
}

.brand .brand-icon {
	width: 40px;
	height: 40px;
}

.brand .brand-name {
	white-space: nowrap;
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 1.45rem;
	line-height: 1;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--blue);
}

.brand .brand-name b {
	color: var(--orange);
	font-weight: 700;
}

.site-nav {
	display: flex;
	align-items: center;
	gap: .25rem;
}

.site-nav a,
.menu-button {
	font: 600 .95rem/1 var(--font-body);
	color: var(--text);
	text-decoration: none;
	padding: .6rem .8rem;
	border-radius: 999px;
	background: none;
	border: 0;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: .4rem;
}

.site-nav a:hover,
.menu-button:hover {
	background: var(--bg-alt);
	color: var(--blue);
}

.menu-button {
	background: var(--blue);
	color: var(--on-accent);
}

.menu-button:hover {
	background: var(--blue-strong);
	color: var(--on-accent);
}

/* header text links (Contact, CV): blue, orange on hover */
.site-nav a {
	color: var(--blue);
}

.site-nav a:hover {
	color: var(--orange-text);
}

.menu-button svg {
	flex: none;
	width: 1rem;
	height: 1rem;
}

/* very small phones: icon-only Topics button so the header fits on one line
   (the word "Topics" stays in the button for screen readers) */
@media (max-width: 359px) {
	.menu-button {
		font-size: 0;
		gap: 0;
		padding: .6rem;
	}
}

.theme-toggle {
	display: grid;
	place-items: center;
	width: 2.4rem;
	height: 2.4rem;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: none;
	color: var(--blue);
	cursor: pointer;
}

.theme-toggle:hover {
	background: var(--bg-alt);
	color: var(--orange-text);
}

.theme-toggle[hidden] {
	display: none;
}

/* the icon shows the current setting: auto, light or dark */
.theme-toggle svg {
	display: none;
	width: 1.2rem;
	height: 1.2rem;
}

.theme-toggle[data-mode="auto"] .auto,
.theme-toggle[data-mode="light"] .sun,
.theme-toggle[data-mode="dark"] .moon {
	display: block;
}

@media (max-width: 560px) {
	.site-nav .nav-text {
		display: none;
	}

	.brand .brand-name {
		font-size: 1.2rem;
	}
}

/* topics menu: a popover panel listing every section */
.topics-menu {
	position: fixed;
	inset: auto;
	top: calc(var(--header-h) + .5rem);
	right: max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter)));
	margin: 0;
	padding: .75rem;
	width: min(36rem, calc(100vw - 2rem));
	max-height: calc(100dvh - var(--header-h) - 1.5rem);
	overflow: auto;
	background: var(--surface);
	color: var(--text);
	border: 2px solid var(--border);
	border-radius: var(--radius);
}

/* browsers without the Popover API (Safari before iOS 17): hidden until site.js opens it */
@supports not selector(:popover-open) {
	.topics-menu:not(.is-open) {
		display: none;
	}
}

.topics-menu::backdrop {
	background: rgb(10 15 30 / .25);
}

.topics-menu:popover-open {
	animation: menu-in .18s ease-out;
}

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

@media (max-width: 560px) {
	.topics-menu {
		right: 1rem;
		left: 1rem;
		width: auto;
	}
}

.topics-menu ul {
	list-style: none;
	padding: 0;
	margin: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(14rem, 100%), 1fr));
	gap: .25rem;
}

.topics-menu li {
	margin: 0;
}

.topics-menu a {
	display: flex;
	align-items: center;
	gap: .75rem;
	padding: .5rem .6rem;
	border-radius: 10px;
	text-decoration: none;
	color: var(--text);
	font-weight: 600;
	font-size: .95rem;
	line-height: 1.2;
}

.topics-menu a:hover {
	background: var(--bg-alt);
	color: var(--blue);
}

.topics-menu a[aria-current="page"] {
	background: var(--bg-alt);
	color: var(--orange-text);
}

.topics-menu a:hover .topic-icon,
.topics-menu a[aria-current="page"] .topic-icon {
	background: var(--orange);
}

/* round topic icon (white glyph on brand-blue disc) */
.topic-icon {
	flex: none;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: #3d5cc4;
}

.topic-icon img {
	width: 100%;
	height: 100%;
	display: block;
}

.topic-icon.lg {
	width: 72px;
	height: 72px;
	box-shadow: 0 0 0 4px var(--bg), 0 0 0 6px var(--orange);
}

/* ----------------------------------------------------------------- page hero */

.home-hero {
	background:
		radial-gradient(100rem 50rem at 100% 0%, color-mix(in srgb, var(--orange) 25%, transparent), transparent 50%),
		radial-gradient(100rem 50rem at 0% 100%, color-mix(in srgb, var(--blue) 15%, transparent), transparent 50%),
		var(--bg-alt);
	border-bottom: 1px solid var(--border);
}

.page-hero {
	background:
		radial-gradient(100rem 25rem at 100% 0%, color-mix(in srgb, var(--orange) 10%, transparent), transparent 50%),
		radial-gradient(100rem 25rem at 0% 100%, color-mix(in srgb, var(--blue) 10%, transparent), transparent 15%),
		var(--bg-alt);
	border-bottom: 1px solid var(--border);
}

.page-hero {
	padding-block: clamp(2rem, 5vw, 3.5rem) clamp(1.75rem, 4vw, 2.75rem);
}

.page-hero .container {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 1.25rem 1.75rem;
	align-items: start;
}

.page-hero .topic-icon.lg {
	margin-top: .35rem;
}

.page-hero .lead {
	margin: .75rem 0 0;
}

@media (max-width: 640px) {
	.page-hero .container {
		grid-template-columns: 1fr;
	}

	/* on phones the icon sits on its own row above the title; center it */
	.page-hero .topic-icon.lg {
		justify-self: center;
	}
}

@media (max-width: 480px) {
	.page-hero h1 {
		font-size: 2.2rem;
	}
}

/* small link above a page title, back to its group page (e.g. "Software") */
.breadcrumb {
	margin: 0 0 .35rem;
	font-size: .8rem;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.breadcrumb a {
	color: var(--orange-text);
	text-decoration: none;
}

.breadcrumb a::before {
	content: "\2190\00a0";   /* left arrow */
}

.breadcrumb a:hover {
	text-decoration: underline;
}

/* ------------------------------------------------------------------ content */

main {
	flex: 1 0 auto;    /* grows to fill spare height, pushing the footer down */
}

.content {
	padding-block: clamp(1.5rem, 4vw, 3rem) 4rem;
}

.content>*:first-child {
	margin-top: 0;
}

/* small screens: keep long words and URLs from running off the edge */
.content,
.page-hero h1 {
	overflow-wrap: break-word;
}

.content a {
	overflow-wrap: anywhere;
}

/* legacy row / column grid, now fluid */
.row {
	display: flex;
	flex-wrap: wrap;
	gap: 1.25rem 2rem;
	margin: 0 0 1.5rem;
	align-items: flex-start;
}

.row>.column {
	flex: 1 1 0;
	min-width: 0;
}

.row>.half-width {
	flex: 1 1 calc(50% - 2rem);
}

.row>.third-width {
	flex: 1 1 calc(33.333% - 2rem);
}

.row>.two-thirds-width {
	flex: 2 1 calc(66.666% - 2rem);
}

.row>.fourth-width {
	flex: 1 1 calc(25% - 2rem);
}

.row>.three-fourths-width {
	flex: 3 1 calc(75% - 2rem);
}

.row>.two-fifths-width {
	flex: 2 1 calc(40% - 2rem);
}

.row>.three-fifths-width {
	flex: 3 1 calc(60% - 2rem);
}

.row>.centered {
	text-align: center;
}

.row>.fourth-width.centered {
	flex: 0 0 7rem;
}

.row:has(> .centered)>.fourth-width:not(.centered) {
	flex: 1 1 calc(50% - 13rem);
}

@media (max-width: 900px) {

	/* thumbnail + text pairs (technical writing) go two-per-row */
	.row:has(> .centered)>.fourth-width:not(.centered) {
		flex: 1 1 calc(100% - 9rem);
	}
}

@media (max-width: 680px) {
	.row {
		flex-direction: column;
		gap: 1rem;
	}

	.row>.column,
	.row>[class*="-width"] {
		flex: none;
		width: 100%;
	}

	.row>.fourth-width.centered {
		width: auto;
		text-align: left;
	}
}

/* ------------------------------------------------------------------- cards */

/* One card for the whole site: <… class="card">. It lays itself out from what
   it contains:
     .card-icon   round topic icon, shown beside the text
     .card-image  a picture across the top, edge to edge
     .card-body   wraps the text: .card-meta, .card-title, .card-text, .card-links
   Put a set of cards in a .card-grid (or .card-list for a single column). */
.card {
	display: block;
	background: var(--card-bg);
	border: var(--card-border);
	border-radius: var(--card-radius);
	padding: var(--card-padding);
	color: var(--text);
	text-decoration: none;
}

/* cards that are a link, or lead with a picture link, highlight on hover */
a.card:hover,
a.card:focus-visible,
.card:has(> .card-image):hover,
.card:has(> .card-image):focus-within {
	border-color: var(--card-hover-border);
	color: var(--text);
}

.card-grid,
.card-list {
	list-style: none;
	padding: 0;
	margin: 0;
	display: grid;
	gap: 1rem;
}

.card-grid {
	grid-template-columns: repeat(auto-fill, minmax(min(17rem, 100%), 1fr));
}

.card-grid>li,
.card-list>li {
	margin: 0;
}

.card-grid>li>.card {
	height: 100%;
}

/* with an icon: the icon sits beside the text */
.card:has(> .card-icon) {
	display: flex;
	align-items: center;
	gap: 1rem;
	min-height: 140px;
}

.card-icon {
	width: 52px;
	height: 52px;
}

a.card:hover .card-icon {
	background: var(--orange);
}

/* with an image: the picture runs edge to edge across the top */
.card:has(> .card-image) {
	display: flex;
	flex-direction: column;
	padding: 0;
	overflow: hidden;
}

.card-image {
	display: block;
	background: var(--bg-alt);
	border-bottom: 1px solid var(--border);
}

.card-image img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 10;      /* every card image the same shape, whatever the source */
	object-fit: cover;
	object-position: top center;
}

.card:has(> .card-image)>.card-body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: var(--card-padding);
	padding-bottom: 1.25rem;
}

/* the text */
.card-meta {
	display: block;
	margin-bottom: .25rem;
	font-size: .85rem;
	font-weight: 600;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--text-muted);
}

.content .card-title {
	display: block;
	margin: 0 0 .35rem;
	padding: 0;                /* no orange-dot subheading marker in cards */
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 1.4rem;
	line-height: 1.15;
	color: var(--heading);
}

.content .card-title::before {
	content: none;
}

.card-title a {
	color: inherit;
	text-decoration: none;
}

a.card:hover .card-title,
.card-title a:hover {
	color: var(--orange-text);
}

.card-text {
	display: block;
	margin: 0;
	font-size: .92rem;
	line-height: 1.4;
	color: var(--text-muted);
}

.card-links {
	margin: auto 0 0;
	padding-top: .75rem;
	font-weight: 600;
}

.card-links a {
	text-decoration: none;
}

/* skill lists: a grid of cards */
.skill-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(13rem, 100%), 1fr));
	gap: 1rem;
	margin: 0 0 1.5rem;
}

.skill-grid>.card {
	padding-bottom: .25rem;    /* the list's own bottom margin supplies the rest */
	width: auto !important;
}

.skill-grid>.card>.label:first-child {
	margin-top: 0;
}

/* portfolio entries: a row of columns (image + details) inside a card */
.row.card {
	display: flex;             /* keep the row layout (.card alone is display: block) */
}

.row.card>.column:first-child:has(img):not(.fourth-width) {
	flex-grow: 0;
	flex-basis: 15rem;
}

@media (max-width: 680px) {
	.row.card>.column:first-child:has(img) {
		flex-basis: auto;
	}
}

/* photos and thumbnails */
.photo {
	display: inline-block;
	border-radius: 8px;
	border: 5px solid var(--border);
	margin: 0;
}

a:hover .photo,
a:focus-visible .photo {
	border-color: var(--orange);
}

a.lightbox {
	cursor: zoom-in;
	display: inline-block;
}

.content img[align="left"],
.content .left.figure {
	float: left;
	margin: .35rem 1.75rem 1rem 0;
}

.content img[align="right"] {
	float: right;
	margin: .35rem 0 1rem 1.75rem;
}

.content p:has(> img[align]) {
	display: flow-root;
}

@media (max-width: 560px) {

	.content img[align="left"],
	.content img[align="right"],
	.content .left.figure {
		float: none;
		display: block;
		margin: 0 0 1rem;
	}
}

/* "Examples:" thumbnail sidebars (simulation page) */
.examples.sidebar {
	float: right;
	width: min(26rem, 46%);
	margin: 0 0 1.5rem 2rem;
	background: var(--bg-alt);
	border: 2px solid var(--border);
	border-radius: var(--radius);
	padding: 1rem;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
	gap: .75rem;
}

.examples.sidebar h1 {
	grid-column: 1 / -1;
	font-size: 1.2rem;
	margin: 0;
}

.examples .example {
	text-align: center;
}

.examples .example img {
	width: 100%;
	height: auto;
	aspect-ratio: 1;
	object-fit: cover;
	border-radius: 8px;
	display: block;
}

.examples .caption {
	height: auto;
	font-style: normal;
	color: var(--text-muted);
}

@media (max-width: 760px) {
	.examples.sidebar {
		float: none;
		width: auto;
		margin: 0 0 1.5rem;
	}
}

/* collapsible portfolio */
details.portfolio {
	margin-top: 3rem;
	display: flow-root;
}

details.portfolio>summary {
	font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.25rem);
	list-style: none;
	cursor: pointer;
	margin-bottom: 1.5rem;
	display: block;
}

details.portfolio>summary::-webkit-details-marker {
	display: none;
}

details.portfolio>summary .chev {
	display: inline-block;
	width: .55em;
	height: .55em;
	margin-left: .4em;
	vertical-align: .12em;
	border-right: 3px solid var(--orange);
	border-bottom: 3px solid var(--orange);
	transform: rotate(-45deg);
	transition: transform .2s;
}

details.portfolio[open]>summary .chev {
	transform: rotate(45deg);
}

/* ordered list of records (grants, patents, companies) */
ol.records {
	list-style: none;
	padding: 0;
	counter-reset: rec;
	display: grid;
	gap: 1rem;
	max-width: none;
}

ol.records>.card {
	counter-increment: rec;
	position: relative;
	padding-left: 3.5rem;      /* room for the number badge */
	margin: 0;
}

ol.records>li::before {
	content: counter(rec);
	position: absolute;
	left: 1rem;
	top: 1rem;
	width: 1.75rem;
	height: 1.75rem;
	border-radius: 50%;
	display: grid;
	place-items: center;
	background: var(--blue);
	color: var(--on-accent);
	font: 700 .85rem/1 var(--font-body);
}

ol.records>li>p {
	margin-top: .5rem;
}

@media (min-width: 900px) {
	ol.records.cols {
		grid-template-columns: 1fr 1fr;
	}
}

/* ----------------------------------------------------------------- carousel */

.carousel {
	position: relative;
	margin: 0 0 2em;
	border-radius: var(--radius);
	overflow: hidden;
	background: #0e1320;
}

.carousel-track {
	display: flex;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	overscroll-behavior-x: contain;
}

.carousel-track::-webkit-scrollbar {
	display: none;
}

.slide {
	flex: 0 0 100%;
	scroll-snap-align: start;
	position: relative;
	aspect-ratio: 16 / 7;
	min-height: 14rem;
	display: block;
	color: #fff;
	text-decoration: none;
}

.slide img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.slide-caption {
	position: absolute;
	inset: auto 0 0 0;
	padding: 3.5rem clamp(1rem, 4vw, 2rem) clamp(1rem, 3vw, 1.5rem);
	/* dark behind the text (even on white images), fading out above it */
	background: var(--slide-caption);
}

.slide-title {
	font-family: var(--font-display);
	font-weight: 700;
	font-size: clamp(1.15rem, .9rem + 1.5vw, 2.1rem);
	line-height: 1.1;
	color: var(--slide-title);
}

.slide-subtitle {
	font-size: clamp(.9rem, .85rem + .25vw, 1.05rem);
	opacity: .92;
	max-width: 44rem;
	margin-top: .25rem;
	color: var(--slide-subtitle);
}

.slide:hover .slide-title {
	text-decoration: underline;
	text-underline-offset: .15em;
}

@media (max-width: 560px) {
	.slide {
		aspect-ratio: 4 / 3;
	}
}

.carousel-btn {
	position: absolute;
	top: 50%;
	translate: 0 -50%;
	width: 2.75rem;
	height: 2.75rem;
	border-radius: 50%;
	border: 0;
	cursor: pointer;
	background: rgb(255 255 255 / .9);
	color: #1d2433;
	display: grid;
	place-items: center;
	opacity: 0;
}

.carousel-btn svg {
	width: 1.2rem;
	height: 1.2rem;
}

.carousel-btn.prev {
	left: .75rem;
}

.carousel-btn.next {
	right: .75rem;
}

.carousel:hover .carousel-btn,
.carousel:focus-within .carousel-btn {
	opacity: 1;
}

.carousel-btn:hover {
	background: var(--orange);
	color: #fff;
}

@media (hover: none) {
	.carousel-btn {
		display: none;
	}
}

.carousel-dots {
	position: absolute;
	right: 1rem;
	top: 1rem;
	display: flex;
	gap: .4rem;
}

.carousel-dots button {
	width: .6rem;
	height: .6rem;
	padding: 0;
	border-radius: 999px;
	border: 0;
	cursor: pointer;
	background: rgb(255 255 255 / .55);
	transition: width .25s, background-color .25s;
}

.carousel-dots button[aria-current="true"] {
	width: 1.6rem;
	background: #ff8a3d;
}

/* ----------------------------------------------------------------- lightbox */

.lightbox-dialog {
	border: 0;
	padding: 0;
	background: transparent;
	max-width: 94vw;
	max-height: 92dvh;
	overflow: visible;
}

.lightbox-dialog::backdrop {
	background: rgb(8 12 24 / .85);
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
}

.lightbox-dialog[open] {
	animation: lb-in .2s ease-out;
}

@keyframes lb-in {
	from {
		opacity: 0;
		transform: scale(.97);
	}
}

.lightbox-dialog img {
	display: block;
	max-width: 94vw;
	max-height: 82dvh;
	width: auto;
	height: auto;
	border-radius: 10px;
}

.lightbox-dialog figcaption {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 1rem;
	margin-top: .75rem;
	color: #fff;
	font-weight: 600;
	text-align: center;
}

.lightbox-close {
	position: absolute;
	top: -1rem;
	right: -1rem;
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 50%;
	border: 0;
	background: #fff;
	color: #1d2433;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
}

.lightbox-close:hover {
	background: var(--orange);
	color: #fff;
}

.lightbox-dialog figure {
	margin: 0;
	position: relative;
}

.lightbox-count {
	font-weight: 400;
	opacity: .75;
	font-variant-numeric: tabular-nums;
}

/* previous / next buttons, shown only when stepping through a gallery */
.lightbox-nav {
	display: none;
	position: absolute;
	top: 50%;
	translate: 0 -50%;
	width: 2.75rem;
	height: 2.75rem;
	border-radius: 50%;
	border: 0;
	background: rgb(255 255 255 / .9);
	color: #1d2433;
	cursor: pointer;
	place-items: center;
}

.lightbox-nav svg {
	width: 1.2rem;
	height: 1.2rem;
}

.lightbox-nav.prev {
	left: .75rem;
}

.lightbox-nav.next {
	right: .75rem;
}

.lightbox-nav:hover {
	background: var(--orange);
	color: #fff;
}

.lightbox-dialog.is-gallery .lightbox-nav {
	display: grid;
}

/* ------------------------------------------------------------ photo albums */

.album-meta {
	margin: 0 0 1.5rem;
	color: var(--text-muted);
	font-weight: 600;
}

.gallery {
	list-style: none;
	padding: 0;
	margin: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(15rem, 100%), 1fr));
	gap: .75rem;
}

.gallery li {
	margin: 0;
}

.gallery figure {
	margin: 0;
}

.gallery a {
	display: block;
	border-radius: 10px;
	overflow: hidden;
	background: var(--bg-alt);
	border: 2px solid var(--border);
}

.gallery a:hover {
	border-color: var(--orange);
}

.gallery img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 3 / 2;
	object-fit: cover;
}

.gallery figcaption {
	padding: .5rem .75rem .6rem;
	font-size: .9rem;
	color: var(--text-muted);
	line-height: 1.35;
}

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

.site-footer {
	border-top: 1px solid var(--border);
	background: var(--bg-alt);
	font-size: .9rem;
	color: var(--blue);
}

.site-footer .container {
	display: flex;
	flex-wrap: wrap;
	gap: .75rem 1.5rem;
	justify-content: space-between;
	align-items: center;
	min-height: var(--header-h);    /* same height as the header; grows if the links wrap */
	padding-block: .75rem;
}

.site-footer nav {
	display: flex;
	flex-wrap: wrap;
	gap: .25rem 1.25rem;
}

.site-footer a {
	color: var(--blue);
	text-decoration: none;
	font-weight: 600;
}

.site-footer a:hover {
	color: var(--orange-text);
}

/* footer and header link icons (Font Awesome Free, CC BY 4.0), drawn as masks
   so they take the link's color, including hover and dark mode */
.site-footer nav a {
	display: inline-flex;
	align-items: center;
	gap: .4em;
}

.site-footer nav a::before,
.site-nav a.nav-text::before {
	content: "";
	flex: none;
	width: 1em;
	height: 1em;
	background-color: currentColor;
	-webkit-mask: no-repeat center / contain;
	mask: no-repeat center / contain;
}

.site-footer nav a[data-contact]::before,
.site-nav a.nav-text[data-contact]::before {
	-webkit-mask-image: url(../images/icons/footer/envelope.svg);
	mask-image: url(../images/icons/footer/envelope.svg);
}

.site-footer nav a[href$="about/"]::before {
	-webkit-mask-image: url(../images/icons/footer/user.svg);
	mask-image: url(../images/icons/footer/user.svg);
}

.site-footer nav a[href$="resume.pdf"]::before,
.site-nav a.nav-text[href$="resume.pdf"]::before {
	-webkit-mask-image: url(../images/icons/footer/file-lines.svg);
	mask-image: url(../images/icons/footer/file-lines.svg);
}

.site-footer nav a[href*="github.com"]::before {
	-webkit-mask-image: url(../images/icons/footer/github.svg);
	mask-image: url(../images/icons/footer/github.svg);
}

/* ------------------------------------------------------------------- home */

.home-hero .container {
	display: grid;
	grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
	align-items: center;
	gap: 2rem 3rem;
	padding-block: clamp(2.5rem, 7vw, 5.5rem);
}

.home-hero h1 {
	font-size: clamp(3.5rem, 2rem + 6vw, 6rem);
	margin-bottom: 1rem;
}

.home-hero h1 .dot {
	color: var(--orange);
}

.home-hero .lead {
	max-width: 38rem;
	color: var(--text);
}

.home-hero .lead+p {
	color: var(--text-muted);
	max-width: 38rem;
}

.home-hero .art {
	display: grid;
	justify-items: center;
	gap: 1rem;
	width: fit-content;
	margin: auto;
	background: var(--polaroid);
	padding: 20px;
	padding-bottom: 60px;
	border-radius: 5px;
	border-color: var(--border);
	border-style: solid;
	filter: drop-shadow(10px 30px 50px rgba(0, 0, 0, 25%));
	transform: rotate(-3deg);
}

.home-hero .art .portrait {
	aspect-ratio: 1;
	height: auto;
	object-fit: cover;
	border-radius: 5px;
}

.home-hero .art .head.portrait {
	width: clamp(25rem, 50vw, 25rem);
}

@media (max-width: 720px) {
	.home-hero .art .head.portrait {
		width: min(15rem, 70vw);
	}
}

.cta {
	display: flex;
	flex-wrap: wrap;
	gap: .75rem;
	margin-top: 1.75rem;
}

.button {
	display: inline-flex;
	align-items: center;
	gap: .5rem;
	padding: .75rem 1.25rem;
	border-radius: 999px;
	font-weight: 600;
	text-decoration: none;
	border: 2px solid var(--blue);
	color: var(--blue);
	background: transparent;
	cursor: pointer;
	font-size: 1rem;
}

.button:hover {
	border-color: var(--orange);
	color: var(--orange-text);
}

.button.primary {
	background: var(--blue);
	color: var(--on-accent);
}

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

@media (max-width: 720px) {
	.home-hero .container {
		grid-template-columns: 1fr;
	}

	/* on phones, show the banner photo centered above the greeting */
	.home-hero .art {
		order: -1;
	}
}

.section-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1.25rem;
}

.section-head h2 {
	margin: 0;
}
/* ---------------------------------------------------------------- writing */

.byline {
	margin: .5rem 0 0;
	font-style: italic;
	color: var(--text-muted);
	font-size: 1.1rem;
}

.back-link {
	margin: 0 0 1.5rem;
	font-weight: 600;
}

.back-link a {
	text-decoration: none;
}

/* "originally published in…" note under a republished article */
.source-note {
	max-width: 70ch;
	margin-top: 2.5rem;
	padding-top: 1rem;
	border-top: 1px solid var(--border);
	font-size: .92rem;
	color: var(--text-muted);
}

/* essay: drop cap on the opening paragraph */
.essay > p:first-child::first-letter {
	float: left;
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 4.2em;
	line-height: .85;
	margin: .08em .1em 0 0;
	color: var(--heading);
}

/* dialogue: speaker in a narrow column, line beside it */
.dialogue {
	margin: 0 0 1.5rem;
	padding: 1rem 1.25rem;
	background: var(--bg-alt);
	border-left: 4px solid var(--orange);
	border-radius: 0 var(--radius) var(--radius) 0;
}

.dialogue p {
	display: grid;
	grid-template-columns: 8.5rem 1fr;
	gap: 1rem;
	margin: 0 0 .5rem;
}

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

.dialogue .speaker {
	font-weight: 600;
	color: var(--text-muted);
}

@media (max-width: 560px) {
	.dialogue p {
		grid-template-columns: 1fr;
		gap: 0;
	}
}

.essay-figure {
	margin: 2.5rem auto 0;
	max-width: 26rem;
	text-align: center;
}

.essay-figure img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 8px;
	border: 2px solid var(--border);
}

.essay-figure figcaption {
	margin-top: .6rem;
	font-size: .95rem;
	color: var(--text-muted);
}

/* ---------------------------------------------------------- featured work */

.featured {
	padding-bottom: 0;
}
