/* bcschiffler.com */

/* Fonts: Instrument Serif and Instrument Sans (SIL Open Font License, see ../fonts/OFL.txt) */

@font-face {
	font-family: "Instrument Serif";
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url("../fonts/instrument-serif-latin-400-normal.woff2") format("woff2");
}

@font-face {
	font-family: "Instrument Sans";
	font-style: normal;
	font-weight: 400 700;
	font-display: swap;
	src: url("../fonts/instrument-sans-latin-wght-normal.woff2") format("woff2");
}

/* Tokens */

:root {
	color-scheme: light dark;

	--font-serif: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
	--font-sans: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

	--bg: #fafaf8;
	--surface: #ffffff;
	--text: #1c1b19;
	--text-2: #55524d;
	--text-3: #6b6760;
	--rule: #e6e3de;
	--rule-strong: #cfcac2;
	--accent: #2f55c4;
	--shadow: 0 1px 2px rgb(28 27 25 / 0.06), 0 12px 32px -18px rgb(28 27 25 / 0.28);

	/* Polymathic brand: paper, ink and oxblood */
	--pm-paper: #f2ece2;
	--pm-ink: #1a1612;
	--pm-ink-2: #5f584c;
	--pm-accent: #5a1a1f;
	--pm-on-accent: #f2ece2;
	--pm-rule: rgb(90 26 31 / 0.24);

	--radius: 10px;
	--gutter: 1rem;
	--measure: 36rem;
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg: #121211;
		--surface: #1b1b1a;
		--text: #edebe6;
		--text-2: #b8b3ab;
		--text-3: #9b968e;
		--rule: #292826;
		--rule-strong: #3d3b38;
		--accent: #93b1ff;
		--shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 12px 32px -18px rgb(0 0 0 / 0.8);

		--pm-paper: #1f1a15;
		--pm-ink: #ece3d1;
		--pm-ink-2: #aaa08c;
		--pm-accent: #cf7f79;
		--pm-on-accent: #1a1612;
		--pm-rule: rgb(236 227 209 / 0.14);
	}
}

@media (min-width: 40em) {
	:root {
		--gutter: 2rem;
	}
}

/* Base */

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

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-behavior: smooth;
	scroll-padding-block: 1rem;
}

/* Keep the page still while the lightbox is open */
html:has(.lightbox[open]) {
	overflow: hidden;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font-sans);
	font-size: 1.0625rem;
	line-height: 1.65;
	overflow-wrap: break-word;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

img,
svg {
	display: block;
	max-width: 100%;
}

img {
	height: auto;
}

h1,
h2,
h3 {
	margin: 0;
	font-family: var(--font-serif);
	font-weight: 400;
	line-height: 1.05;
	letter-spacing: -0.005em;
	text-wrap: balance;
}

p {
	margin: 0;
	text-wrap: pretty;
}

a {
	color: inherit;
	text-decoration-line: underline;
	text-decoration-thickness: 1px;
	text-decoration-color: var(--text-3);
	text-underline-offset: 0.22em;
	transition: color 0.15s ease, text-decoration-color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

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

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

::selection {
	background: color-mix(in srgb, var(--accent) 22%, transparent);
}

.icon {
	width: 1.1em;
	height: 1.1em;
	flex: none;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.icon-sprite {
	position: absolute;
	width: 0;
	height: 0;
	overflow: hidden;
}

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

.wrap {
	width: min(100% - 2 * var(--gutter), 68rem);
	margin-inline: auto;
}

.eyebrow {
	font-family: var(--font-sans);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	line-height: 1.4;
	text-transform: uppercase;
	color: var(--text-3);
}

.skip-link {
	position: absolute;
	top: 0.75rem;
	left: 0.75rem;
	z-index: 10;
	padding: 0.5rem 1rem;
	border-radius: 999px;
	background: var(--text);
	color: var(--bg);
	font-weight: 600;
	text-decoration: none;
	transform: translateY(-200%);
}

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

/* Hero */

.hero {
	padding-top: clamp(3rem, 5vw, 4rem);
}

.avatar {
	width: 80px;
	height: 80px;
	margin-bottom: 1.5rem;
	border-radius: 50%;
	object-fit: cover;
	box-shadow: 0 0 0 1px var(--rule), var(--shadow);
}

.hero h1 {
	font-size: clamp(3.25rem, 1.75rem + 6vw, 5.75rem);
	line-height: 0.95;
	letter-spacing: -0.015em;
}

.lead {
	max-width: 48em;
	margin-top: 1.5rem;
	font-size: clamp(1.1875rem, 1.05rem + 0.55vw, 1.4375rem);
	line-height: 1.5;
	color: var(--text-2);
	text-wrap: balance;
}

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

.pill-links a {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.5rem 1rem 0.5rem 0.85rem;
	border: 1px solid var(--rule-strong);
	border-radius: 999px;
	background: var(--surface);
	font-size: 0.9375rem;
	font-weight: 500;
	line-height: 1.4;
	text-decoration: none;
	color: var(--text);
}

.pill-links a:hover {
	border-color: currentColor;
	color: var(--accent);
}

@media (min-width: 46em) {
	/* Portrait beside the name, so the work starts on the first screen */
	.hero {
		display: grid;
		grid-template-columns: auto minmax(0, 1fr);
		align-items: center;
		column-gap: clamp(1.25rem, 2.5vw, 1.75rem);
	}

	.avatar {
		width: 88px;
		height: 88px;
		margin-bottom: 0;
	}

	.hero > .lead,
	.hero > .pill-links {
		grid-column: 1 / -1;
	}
}

/* Sections */

.section {
	padding-block: clamp(2.5rem, 5vw, 4rem);
}

.section-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.25rem 1.5rem;
	margin-bottom: clamp(1.5rem, 3vw, 2rem);
	padding-top: 1.1rem;
	border-top: 1px solid var(--text);
}

.section-head h2 {
	font-size: clamp(2.25rem, 1.6rem + 2.4vw, 3.25rem);
}

.section-head p {
	font-size: 0.9375rem;
	color: var(--text-3);
}

/* Polymathic: the highlighted first project */

.pm {
	--pm-pad: clamp(1.25rem, 3.5vw, 2.5rem);
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: clamp(1.75rem, 4vw, 2.5rem);
	margin-bottom: clamp(2.5rem, 5vw, 3.5rem);
	padding: var(--pm-pad);
	border-radius: var(--radius);
	background: var(--pm-paper);
	color: var(--pm-ink);
}

.pm-gallery {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: clamp(0.625rem, 1.5vw, 1rem);
}

.pm-shot {
	position: relative;
	display: block;
	overflow: hidden;
	aspect-ratio: 16 / 10;
	border-radius: 6px;
	background: var(--pm-paper);
	box-shadow: 0 0 0 1px var(--pm-rule);
}

.pm-shot-main {
	grid-column: 1 / -1;
}

.pm-shot img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: top center;
	transition: transform 0.4s ease;
}

.pm-shot:hover img {
	transform: scale(1.02);
}

.pm-shot:focus-visible {
	outline-color: var(--pm-accent);
	outline-offset: 4px;
	border-radius: 6px;
}

.pm-shot-label {
	position: absolute;
	left: 0.625rem;
	bottom: 0.625rem;
	padding: 0.2rem 0.6rem;
	border-radius: 999px;
	background: var(--pm-paper);
	background: color-mix(in srgb, var(--pm-paper) 92%, transparent);
	box-shadow: 0 0 0 1px var(--pm-rule);
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	line-height: 1.5;
	text-transform: uppercase;
	color: var(--pm-ink);
}

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

.pm-body .eyebrow {
	color: var(--pm-accent);
}

.pm-title {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	margin-top: 0.4rem;
	font-size: clamp(2rem, 1.6rem + 1.6vw, 2.75rem);
	line-height: 1;
}

.pm-mark {
	flex: none;
	width: 0.75em;
	height: auto;
	aspect-ratio: 534 / 626;
	fill: var(--pm-accent);
}

.pm-body p:not(.eyebrow) {
	max-width: var(--measure);
	color: var(--pm-ink-2);
}

.pm-cta {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	max-width: 100%;
	margin-top: 1.5rem;
	padding: calc(0.75rem - 1px) calc(1.25rem - 1px);
	/* transparent border keeps the button outlined in forced-colors mode */
	border: 1px solid transparent;
	border-radius: 999px;
	background: var(--pm-ink);
	color: var(--pm-paper);
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none;
	overflow-wrap: anywhere;
}

.pm-cta:hover {
	background: var(--pm-accent);
	color: var(--pm-on-accent);
}

.pm-cta .icon {
	transition: transform 0.2s ease;
}

.pm-cta:hover .icon {
	transform: translateX(3px);
}

.pm-cta:focus-visible {
	outline-color: var(--pm-accent);
}

@media (width < 46em) {
	/* On phones the small tiles get their labels underneath instead of on top */
	.pm-shot:not(.pm-shot-main) {
		overflow: visible;
		margin-bottom: 1.25rem;
	}

	.pm-shot:not(.pm-shot-main) picture {
		position: absolute;
		inset: 0;
		overflow: hidden;
		border-radius: inherit;
	}

	.pm-shot:not(.pm-shot-main) .pm-shot-label {
		top: calc(100% + 0.35rem);
		bottom: auto;
		left: 0.125rem;
		padding: 0;
		background: none;
		box-shadow: none;
		color: var(--pm-ink-2);
	}
}

@media (min-width: 46em) {
	/* Astrolabe large on the left, Chronicle and Timeline stacked beside it */
	.pm-gallery {
		grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
	}

	.pm-shot-main {
		grid-column: 1;
		grid-row: 1 / span 2;
	}

	.pm-shot:not(.pm-shot-main) {
		aspect-ratio: auto;
	}

	/* Text columns line up with the project rows below (18rem thumbnail column + row gap) */
	.pm-body {
		grid-template-columns: minmax(0, calc(18rem - var(--pm-pad))) minmax(0, 1fr);
		column-gap: clamp(1.75rem, 4vw, 3rem);
		align-items: start;
	}
}

/* Selected work */

.projects {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
}

.project {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 1.25rem;
	padding-block: 2.25rem;
	border-top: 1px solid var(--rule);
}

.pm + .project {
	padding-top: 0;
	border-top: 0;
}

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

@media (min-width: 46em) {
	.project {
		grid-template-columns: minmax(0, 18rem) minmax(0, 1fr);
		gap: clamp(1.75rem, 4vw, 3rem);
		align-items: start;
	}
}

.project-media {
	display: block;
	overflow: hidden;
	border-radius: var(--radius);
	background: var(--surface);
	box-shadow: 0 0 0 1px var(--rule), var(--shadow);
	aspect-ratio: 16 / 10;
}

.project-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s ease, filter 0.2s ease;
}

.project-media:hover img {
	transform: scale(1.03);
}

.project-media:focus-visible {
	outline-offset: 4px;
	border-radius: var(--radius);
}

@media (prefers-color-scheme: dark) {
	/* White charts would otherwise outshine everything else in dark mode */
	.project-media img {
		filter: brightness(0.85);
	}

	.project-media:hover img {
		filter: none;
	}
}

.project h3 {
	margin: 0.4rem 0 0.75rem;
	font-size: clamp(1.625rem, 1.35rem + 1.1vw, 2.125rem);
	line-height: 1.08;
}

.project-body > p:not(.eyebrow) {
	max-width: var(--measure);
	color: var(--text-2);
}

.project-body > p a {
	color: var(--text);
}

.project-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 1.5rem;
	margin: 1rem 0 0;
	padding: 0;
	list-style: none;
	font-size: 0.9375rem;
	font-weight: 500;
}

.project-links a {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	text-decoration-color: transparent;
}

.project-links a:hover {
	text-decoration-color: currentColor;
}

.project-links .icon {
	width: 0.95em;
	height: 0.95em;
	color: var(--text-3);
	transition: transform 0.2s ease, color 0.15s ease;
}

.project-links a:hover .icon {
	color: currentColor;
	transform: translate(2px, -2px);
}

/* About */

.about-intro {
	max-width: 30em;
	font-family: var(--font-serif);
	font-size: clamp(1.625rem, 1.3rem + 1.3vw, 2.25rem);
	line-height: 1.2;
	text-wrap: balance;
}

/* Footer */

.site-footer {
	padding-bottom: 2.5rem;
}

.footer-inner {
	display: grid;
	gap: 2rem;
	align-items: end;
	padding-top: clamp(2.5rem, 5vw, 3.5rem);
	border-top: 1px solid var(--rule);
}

@media (min-width: 46em) {
	.footer-inner {
		grid-template-columns: 1fr auto;
	}
}

.footer-email {
	display: inline-block;
	margin-top: 0.4rem;
	font-family: var(--font-serif);
	font-size: clamp(1.875rem, 1.2rem + 3vw, 3.25rem);
	line-height: 1.1;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.16em;
	overflow-wrap: anywhere;
}

.site-footer .pill-links {
	margin-top: 0;
}

.copyright {
	grid-column: 1 / -1;
	padding-top: 0.5rem;
	font-size: 0.875rem;
	color: var(--text-3);
}

/* Larger tap targets on touch screens */

@media (pointer: coarse) {
	.project-links {
		row-gap: 0.25rem;
	}

	.project-links a,
	.pill-links a {
		min-height: 44px;
	}
}

/* Lightbox */

.lightbox {
	width: 100%;
	max-width: none;
	height: 100%;
	max-height: none;
	margin: 0;
	padding: clamp(1rem, 4vw, 3rem);
	border: 0;
	background: transparent;
	color: #f4f3f0;
	cursor: zoom-out;
}

.lightbox[open] {
	display: grid;
	place-items: center;
}

.lightbox::backdrop {
	background: rgb(12 12 11 / 0.88);
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
}

.lightbox figure {
	display: grid;
	gap: 0.85rem;
	justify-items: center;
	margin: 0;
}

.lightbox img {
	max-width: min(100%, 1400px);
	max-height: calc(100vh - 9rem);
	max-height: calc(100dvh - 9rem);
	width: auto;
	height: auto;
	border-radius: 6px;
	background: #fff;
	box-shadow: 0 30px 80px -30px rgb(0 0 0 / 0.8);
}

.lightbox figcaption {
	max-width: 48rem;
	font-size: 0.9375rem;
	text-align: center;
	color: #cfccc6;
}

.lightbox-close {
	position: fixed;
	top: 1rem;
	right: 1rem;
	display: grid;
	place-items: center;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0;
	border: 1px solid rgb(255 255 255 / 0.25);
	border-radius: 999px;
	background: rgb(255 255 255 / 0.08);
	color: #fff;
	font-size: 1.25rem;
	cursor: pointer;
}

.lightbox-close:hover {
	background: rgb(255 255 255 / 0.18);
}

/* Motion & print */

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

	*,
	*::before,
	*::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
	}
}

@media print {
	.pill-links,
	.lightbox,
	.skip-link {
		display: none;
	}

	.project-media {
		box-shadow: none;
	}
}
