:root {
	--bg: #f3f1ed;
	--text: #2b2926;
	--muted: #8a847b;
	--line: #dedad3;
	--available: #3f7a52;
	--sold: #a34a36;
	--column: 820px;
	--gutter: 16px;
	--font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

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

html {
	-webkit-text-size-adjust: 100%;
}

body {
	display: flex;
	flex-direction: column;
	min-height: 100svh;
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font);
	font-size: 16px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

a {
	color: inherit;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

img {
	display: block;
	max-width: 100%;
	height: auto;
}

body > * {
	width: 100%;
}

body > main {
	flex: 1;
}

/* Header */

.site-header {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 12px 32px;
	max-width: calc(var(--column) + 2 * var(--gutter));
	margin: 0 auto;
	padding: 48px var(--gutter) 0;
}

.site-logo {
	font-size: 18px;
	font-weight: 500;
	letter-spacing: 0.01em;
	text-decoration: none;
}

.site-logo {
	display: block;
}

.site-logo img {
	height: 48px;
	width: auto;
}

.site-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 20px;
	font-size: 14px;
}

.site-nav a {
	color: var(--muted);
	text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current] {
	color: var(--text);
}

/* Paintings */

.works {
	max-width: calc(var(--column) + 2 * var(--gutter));
	margin: 0 auto;
	padding: 96px var(--gutter) 0;
}

.work {
	/* keep portrait paintings within the screen height, text matches image width */
	width: min(100%, calc(82svh * var(--ratio)));
	margin: 0 auto 88px;
}

.work-link {
	display: block;
	cursor: zoom-in;
}

.work-link:focus-visible {
	outline: 2px solid var(--text);
	outline-offset: 6px;
}

.work img {
	width: 100%;
	user-select: none;
	-webkit-user-drag: none;
	transition: opacity 0.2s;
}

.work-link:hover img {
	opacity: 0.92;
}

.work-date {
	display: block;
	margin-top: 16px;
	font-size: 13px;
	color: var(--muted);
}

.status::before {
	content: "";
	display: inline-block;
	width: 6px;
	height: 6px;
	margin-right: 8px;
	border-radius: 50%;
	vertical-align: 2px;
	background: currentColor;
}

.status--available {
	color: var(--text);
}

.status--available::before {
	background: var(--available);
}

.status--sold {
	color: var(--sold);
}

.status--notforsale {
	color: var(--muted);
}

.work-text {
	margin-top: 4px;
	font-size: 15px;
	color: #4a463f;
}

.work-text p {
	margin: 0;
}

/* Lightbox: opened painting with picture left, info right */

body.is-locked {
	overflow: hidden;
}

.lb {
	position: fixed;
	inset: 0;
	z-index: 10;
	display: grid;
	grid-template-columns: 1fr 360px;
	background: var(--bg);
	opacity: 0;
	transition: opacity 0.2s;
}

.lb[hidden] {
	display: none;
}

.lb.is-visible {
	opacity: 1;
}

.lb button {
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	cursor: pointer;
}

.lb-stage {
	display: grid;
	grid-template-columns: 64px 1fr 64px;
	align-items: center;
	min-height: 0;
	padding: 40px 0;
	background: #ebe8e2;
}

.lb-img {
	justify-self: center;
	max-width: 100%;
	max-height: calc(100svh - 80px);
	width: auto;
	height: auto;
	object-fit: contain;
	user-select: none;
	-webkit-user-drag: none;
	box-shadow: 0 1px 2px rgba(43, 41, 38, 0.08), 0 12px 40px rgba(43, 41, 38, 0.12);
}

.lb-close,
.lb-arrow {
	display: grid;
	place-items: center;
	justify-self: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	opacity: 0.7;
	transition: opacity 0.15s;
}

.lb-close:hover,
.lb-arrow:hover {
	opacity: 1;
}

.lb-close:focus:not(:focus-visible) {
	outline: none;
}

.lb-close svg,
.lb-arrow svg {
	width: 22px;
	height: 22px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.5;
}

.lb-arrow[disabled] {
	visibility: hidden;
}

.lb-panel {
	display: flex;
	flex-direction: column;
	padding: 24px 32px 32px;
	border-left: 1px solid var(--line);
	overflow-y: auto;
}

.lb-panel-top {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin: 0 -12px 56px 0;
}

.lb-count {
	font-size: 13px;
	color: var(--muted);
	font-variant-numeric: tabular-nums;
}

.lb-date {
	margin: 0 0 20px;
	font-size: 22px;
	font-weight: 500;
	line-height: 1.3;
}

.lb-text {
	margin: 0 0 28px;
	font-size: 15px;
	color: #4a463f;
}

.lb-text:empty {
	display: none;
}

.lb-text p {
	margin: 0;
}

.lb-facts {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 8px 24px;
	margin: 0 0 24px;
	padding: 16px 0 0;
	border-top: 1px solid var(--line);
	font-size: 14px;
}

.lb-facts dt {
	color: var(--muted);
}

.lb-facts dd {
	margin: 0;
}

.lb-facts [hidden] {
	display: none;
}

.lb-cta {
	display: block;
	margin-top: auto;
	padding: 12px 16px;
	border: 1px solid var(--text);
	font-size: 14px;
	text-align: center;
	text-decoration: none;
	transition: background 0.15s, color 0.15s;
}

.lb-cta:hover {
	background: var(--text);
	color: var(--bg);
}

.lb-cta[hidden] {
	display: none;
}

/* Text pages */

.page {
	max-width: calc(640px + 2 * var(--gutter));
	margin: 0 auto;
	padding: 96px var(--gutter) 80px;
}

.page h1 {
	margin: 0 0 24px;
	font-size: 22px;
	font-weight: 500;
}

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

.prose {
	overflow-wrap: anywhere;
}

.prose h3 {
	margin: 36px 0 8px;
	font-size: 16px;
	font-weight: 500;
}

.prose li {
	margin-bottom: 6px;
}

.prose h2 {
	margin: 32px 0 8px;
	font-size: 18px;
	font-weight: 500;
}

.profiles {
	display: flex;
	gap: 20px;
	margin: 40px 0 0;
	padding: 24px 0 0;
	border-top: 1px solid var(--line);
	list-style: none;
	align-items: center;
}

.profiles a {
	display: block;
	opacity: 0.8;
	transition: opacity 0.15s;
}

.profiles a:hover {
	opacity: 1;
}

.profiles .icon {
	display: block;
	height: 24px;
	width: auto;
}

.profiles .icon--behance {
	height: 17px;
}

.portrait {
	width: 240px;
	margin-bottom: 40px;
}

/* Footer */

.site-footer {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 8px 24px;
	max-width: calc(var(--column) + 2 * var(--gutter));
	margin: 0 auto;
	padding: 24px var(--gutter) 48px;
	border-top: 1px solid var(--line);
	font-size: 13px;
	color: var(--muted);
}

.site-footer nav {
	display: flex;
	gap: 20px;
}

.site-footer a {
	text-decoration: none;
}

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

@media (max-width: 600px) {
	.site-header {
		padding-top: 28px;
	}

	.site-logo img {
		height: 38px;
	}

	.works,
	.page {
		padding-top: 56px;
	}

	.work {
		margin-bottom: 64px;
	}
}

@media (max-width: 760px) {
	/* lightbox becomes one scrolling page: picture on top, info below */
	.lb {
		display: block;
		overflow-y: auto;
	}

	.lb-stage {
		position: relative;
		display: block;
		padding: 56px var(--gutter) 24px;
	}

	.lb-img {
		margin: 0 auto;
		max-height: 62svh;
	}

	/* small arrows on the picture edges, so it's clear you can swipe */
	.lb-arrow {
		position: absolute;
		top: calc(50% + 16px);
		transform: translateY(-50%);
		width: 36px;
		height: 36px;
		background: rgba(243, 241, 237, 0.88);
		box-shadow: 0 1px 4px rgba(43, 41, 38, 0.15);
		opacity: 1;
	}

	.lb-arrow svg {
		width: 18px;
		height: 18px;
		stroke-width: 1.75;
	}

	.lb-prev {
		left: 6px;
	}

	.lb-next {
		right: 6px;
	}

	.lb-panel {
		padding: 24px var(--gutter) 40px;
		border-left: 0;
		overflow: visible;
	}

	.lb-panel-top {
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		z-index: 1;
		margin: 0;
		padding: 6px 4px 6px 16px;
		background: rgba(235, 232, 226, 0.92);
		-webkit-backdrop-filter: blur(8px);
		backdrop-filter: blur(8px);
	}

	.lb-cta {
		margin-top: 8px;
	}
}
