@font-face {
	font-family: ABCMonumentGrotesk;
	src: url(/ABCMonumentGrotesk-450.woff2) format("woff2"); /* a weight halfway between Regular and Medium */
	font-display: swap;
}

:root {
	--text: #000;
	--background: #ebebeb;
	--muted: color-mix(in srgb, var(--text) 55%, transparent);
	--gutter: 12px;
	--row: calc(2.14rem + 1px); /* a row of the list: its rule, its padding and one line */
	--title: calc(var(--row) + 16px); /* a project's title bar: a row, and room for its background to fade out */

	font: 21px/1.15 ABCMonumentGrotesk, sans-serif;
	letter-spacing: -.015em;
	color: var(--text);
	background: var(--background);
	-webkit-text-size-adjust: 100%;

	/* macOS thickens text unless told otherwise; this matches design tools. */
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

@media (min-width: 768px) {
	:root {
		--gutter: 20px;
		font-size: 28px;
	}
}

@media (prefers-color-scheme: dark) {
	:root {
		--text: #cacaca;
		--background: #191818;
	}
}

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

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

h1, h2 { font: inherit; }

p a { text-decoration: underline; }

/* On hover a link, or "Read more", goes a bit lighter. The tagline instead
   gives way to the name. Both sit in one cell, so the link keeps its size;
   the tagline slides up out of it as the name slides up into it, and the link
   clips whichever is outside. Its padding leaves room for the descenders. */

.bar a:first-child {
	display: grid;
	margin-block: -.15em;
	padding-block: .15em;
	overflow: clip;

	span {
		grid-area: 1 / 1;
		transition: translate .25s;
	}

	span:last-child { translate: 0 130%; }
}

@media (hover: hover) {
	:is(a, summary):hover { opacity: .6; }

	.bar a:first-child:hover {
		opacity: 1;

		span:first-child { translate: 0 -130%; }
		span:last-child { translate: none; }
	}
}

/* On the home page the two take turns by themselves: it opens on the name, and
   every three seconds one gives way to the other, up and back down. */
@media (prefers-reduced-motion: no-preference) {
	.bar a[aria-current] span { animation: tagline 10s infinite; }
	.bar a[aria-current] span:last-child { animation-name: name; }
}

@keyframes tagline {
	0%, 46%, 100% { translate: 0 130%; }
	50%, 96% { translate: none; }
}

@keyframes name {
	0%, 46%, 100% { translate: none; }
	50%, 96% { translate: 0 -130%; }
}

/* An email link copies its address. site.js adds .copied, and "Copied to
   clipboard" passes through the link like a marquee, ending on its own text. */

.copied {
	position: relative;
	display: inline-block;
	overflow-x: clip;
	visibility: hidden;

	&::after {
		content: attr(data-label) "\2003 Copied to clipboard\2003 " attr(data-label);
		position: absolute;
		top: 0;
		left: 0;
		white-space: nowrap;
		visibility: visible;
		animation: marquee 2s linear;
	}
}

@keyframes arrive {
	from {
		translate: var(--from);
		opacity: 0;
	}
}

@keyframes marquee {
	to {
		left: 100%;
		translate: -100%;
	}
}

/* The header holds the top bar and, on a project page, the title under it.
   site.js slides it up while scrolling down, until only the title shows. */

header {
	position: sticky;
	top: 0;
	z-index: 2;
	transition: translate .3s;

	.scrolling-down & { translate: 0 calc(var(--title) - 100% - 1px); }
}

/* Email is in the top bar on a wide screen and in the footer on a phone. */
.bar {
	display: flex;
	justify-content: space-between;
	padding: .53rem var(--gutter) .64rem;
	background: var(--background);

	@media (max-width: 767px) {
		[href^="mailto:"] { display: none; }
	}
}

.title {
	display: flex;
	align-items: center;
	gap: .55rem;
	height: var(--title);
	margin: 0 var(--gutter);
	padding-bottom: 16px;
	border-top: 1px solid;
	background: linear-gradient(var(--background) calc(100% - .65rem), transparent); /* the content fades out under it */

	h1 { flex: 1; }

	/* After Previous or Next, site.js has the title arrive from that side. */
	.from-left { --from: -1rem; }
	.from-right { --from: 1rem; }
	.from-left, .from-right { animation: arrive .25s ease-out; }

	/* The icons are larger on a phone; their lines keep the weight of the type. */
	svg {
		display: block;
		height: 1rem;
		fill: none;
		stroke: currentColor;
		stroke-width: .066rem;

		@media (min-width: 768px) { height: .72rem; }
	}

	path { vector-effect: non-scaling-stroke; }
}

/* Home: the list starts two thirds of the way down the window on a phone and
   halfway down on a wider screen. The top bar above the introduction is
   2.27rem tall. */

.intro {
	min-height: calc(100svh * 2 / 3 - 2.27rem);
	padding: .46rem var(--gutter) 1.5rem; /* with the bar's own padding, one empty line */

	@media (min-width: 768px) { min-height: calc(50svh - 2.27rem); }

	color: var(--muted);

	> * { max-width: 22rem; }
	details :is(h2, p) { margin-top: 1.4em; }
	h2 + p { margin-top: 0; }
	h2, details[open] summary { color: var(--text); }

	/* "Read more" sits under the text it opens. */
	details {
		display: flex;
		flex-direction: column-reverse;
	}

	/* Closed, the text's first three lines still show, fading out. A browser
	   hides the content of closed details; one without ::details-content
	   keeps doing so. */
	details:not([open])::details-content {
		content-visibility: visible;
		height: calc(1.4em + 3lh);
		overflow: hidden;
		mask-image: linear-gradient(#000 1.4em, transparent);
	}

	summary {
		display: block;
		width: fit-content;
		margin-top: .28rem;
		text-decoration: underline;
		cursor: pointer;
	}

	summary::-webkit-details-marker { display: none; }
	details:not([open]) summary :last-child, details[open] summary :first-child { display: none; }
}

.projects {
	margin: 0 var(--gutter);
	border-bottom: 1px solid;
	list-style: none;

	li { border-top: 1px solid; }

	/* The name at the left, the year, if it has one, at the right. A row is a
	   link, unless the project has no page yet. */
	:is(a, div) {
		display: flex;
		justify-content: space-between;
		padding: .33rem 0 .36rem;
		line-height: 1.45;
	}

	span { color: var(--muted); }
}

/* A project's cover shows beside the mouse over its row; site.js sets --x
   and --y and marks the row. */

.cover {
	position: fixed;
	z-index: 3;
	left: min(var(--x, 0px) + 1rem, 100vw - 460px - 1rem);
	top: var(--y, 0px);
	translate: 0 -50%;
	width: auto;
	height: auto;
	max-width: 460px;
	max-height: 460px;
	box-shadow: 12px 12px 0 rgb(0 0 0 / .25);
	visibility: hidden;
	pointer-events: none;

	&.cut-out { box-shadow: none; }

	.shown > & { visibility: visible; }

	/* On a phone it shows at the right of the row passing the middle of the window. */
	@media (max-width: 767px) {
		left: auto;
		right: var(--gutter);
		top: 50%;
		max-width: 50vw;
		max-height: 50vw;
		box-shadow: 4px 4px 0 rgb(0 0 0 / .25);
	}
}

/* A six-column grid; blocks span all of it, half or a third. */

.project {
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	gap: var(--gutter);
	margin: 0 var(--gutter) 2rem;

	> * { grid-column: span 6; }
	> .third { grid-column: span 2; }

	@media (min-width: 769px) {
		> .half { grid-column: span 3; }
	}

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

	.text {
		max-width: 20rem;
		margin: 2rem 0;
		color: var(--muted);

		p + p { margin-top: 1.4em; }
	}
}

/* Feed: items from an Are.na channel, added by feed.js. */

.feed {
	min-height: 100vh;
	margin: var(--gutter);

	article {
		display: flex;
		flex-direction: column;
		align-items: center;
		padding-bottom: 2em;
	}

	h2 {
		line-height: 1.2;
		text-align: center;
		word-break: break-word;
	}

	h2 a[href] { text-decoration: underline; }

	article > a {
		width: 75%;
		@media (min-width: 768px) { width: 50%; }
	}

	img { width: 100%; }
}

/* Impressum: the legal notice German law asks for, set like the introduction. */

.impressum {
	min-height: 50svh;
	padding: .46rem var(--gutter) 1.5rem;
	color: var(--muted);

	h1 { color: var(--text); }
	p + p { margin-top: 1.4em; }
}

.error {
	margin: 2rem var(--gutter);
	text-align: center;
}

/* Two lists, each half the width: this site's pages, and the others. */
footer {
	display: flex;
	gap: var(--gutter);
	margin: 3rem var(--gutter) var(--gutter);
	color: var(--muted);

	ul {
		flex: 1;
		list-style: none;
	}

	@media (min-width: 768px) {
		.email { display: none; }
	}
}
