/* IP Farm - ipfarm.co.uk
   Black and white only. Serif display + mono for everything else. */

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

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

@font-face {
	font-family: 'Geist Mono';
	src: url('/fonts/geist-mono-400.woff2') format('woff2');
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'Geist Mono';
	src: url('/fonts/geist-mono-500.woff2') format('woff2');
	font-weight: 500;
	font-style: normal;
	font-display: swap;
}

:root {
	/* colour */
	--ink: #0a0a0a;
	--paper: #f3f2ef;
	--mute: #8f8f8a;
	--line: rgb(243 242 239 / 0.16);

	/* type */
	--font-display: 'Instrument Serif', 'Times New Roman', serif;
	--font-ui: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
	--text-label: 0.8125rem;
	--text-body: 0.9375rem;
	--text-name: clamp(2.125rem, 3.4vw, 3.25rem);
	--text-hero: clamp(3.25rem, 7.3vw, 8.5rem);
	/* Sized so the footer wordmark runs gutter to gutter (it measures 2.4em wide) */
	--text-mark: calc((100vw - 2 * var(--gutter)) / 2.42);

	/* space */
	--gutter: clamp(1.25rem, 3.2vw, 3rem);
	--gap: clamp(0.75rem, 1.4vw, 1.25rem);
	--bar-h: 4.5rem;

	/* motion */
	--ease-enter: cubic-bezier(0.16, 1, 0.3, 1);
	--ease-move: cubic-bezier(0.65, 0, 0.35, 1);
	--dur-instant: 120ms;
	--dur-base: 300ms;
	--dur-slow: 600ms;
	--dur-hero: 1100ms;
}

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

html {
	background: var(--ink);
	color: var(--paper);
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

body {
	margin: 0;
	font-family: var(--font-ui);
	font-size: var(--text-body);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
p,
ul,
figure {
	margin: 0;
	padding: 0;
}

ul {
	list-style: none;
}

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

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

:focus-visible {
	outline: 1px solid var(--paper);
	outline-offset: 4px;
}

::selection {
	background: var(--paper);
	color: var(--ink);
}

.skip {
	position: absolute;
	left: var(--gutter);
	top: -4rem;
	z-index: 10;
	padding: 0.5rem 0.75rem;
	background: var(--paper);
	color: var(--ink);
	font-size: var(--text-label);
}

.skip:focus {
	top: 0.75rem;
}

/* Small uppercase mono, used for all chrome */
.bar,
.hero__note,
.plates__caption,
.person__role,
.foot__row {
	font-size: var(--text-label);
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.link {
	position: relative;
	display: inline-block;
	padding-bottom: 0.2em;
}

.link::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 1px;
	background: currentColor;
	transform-origin: left;
	transition: transform var(--dur-base) var(--ease-move);
}

.link:hover::after {
	transform: scaleX(0);
	transform-origin: right;
}

/* ---------- Top bar ---------- */

.bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: var(--bar-h);
	padding: 0 var(--gutter);
}

.bar__mark {
	font-weight: 500;
}

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

.hero {
	display: grid;
	grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
	gap: var(--gap);
	min-height: calc(100svh - var(--bar-h));
	padding: 0 var(--gutter) var(--gutter);
}

.hero__copy {
	align-self: end;
}

.hero__title {
	font-family: var(--font-display);
	font-size: var(--text-hero);
	font-weight: 400;
	line-height: 0.92;
	letter-spacing: -0.025em;
}

/* Each line is masked so it can rise into place. The extra padding
   stops descenders being clipped by the mask. */
.hero__title .line {
	display: block;
	overflow: hidden;
	padding-bottom: 0.16em;
	margin-bottom: -0.16em;
}

.hero__title .line > span {
	display: block;
}

.hero__note {
	margin-top: clamp(1.5rem, 3vw, 2.75rem);
	color: var(--mute);
}

.hero__media {
	min-height: 22rem;
}

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

/* ---------- Image plates ---------- */

.plate {
	position: relative;
	overflow: hidden;
	background: #141414;
}

/* Fine grain over every photograph. Keeps the archive shots feeling
   like one set and hides their varying sharpness. */
.plate::after {
	content: '';
	position: absolute;
	inset: 0;
	pointer-events: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
	mix-blend-mode: overlay;
	opacity: 0.28;
}

.plates {
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	gap: var(--gap);
	padding: var(--gap) var(--gutter) 0;
}

.plate--crowd {
	grid-column: 1 / span 8;
}

.plates__caption {
	grid-column: 9 / span 4;
	align-self: end;
	color: var(--mute);
}

.plate--hall {
	grid-column: 3 / span 6;
}

.plate--installation {
	grid-column: 9 / span 4;
	align-self: end;
}

/* ---------- Behind it ---------- */

.behind {
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	gap: var(--gap);
	padding: clamp(5rem, 13vw, 12rem) var(--gutter) clamp(4rem, 9vw, 8rem);
}

.behind__title {
	grid-column: 1 / span 3;
	font-family: var(--font-display);
	font-size: var(--text-name);
	font-style: italic;
	font-weight: 400;
	line-height: 1;
	letter-spacing: -0.015em;
}

.people {
	grid-column: 4 / span 9;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--gap) clamp(1.5rem, 4vw, 4rem);
}

/* Second portrait sits lower so the pair does not read as a stamped grid */
.person:nth-child(2) {
	margin-top: clamp(3rem, 8vw, 7rem);
}

.person__portrait {
	overflow: hidden;
	aspect-ratio: 1;
	background: #141414;
}

.person__portrait img {
	height: 100%;
	object-fit: cover;
	transition: transform var(--dur-slow) var(--ease-enter);
}

.person:hover .person__portrait img {
	transform: scale(1.03);
}

.person__name {
	margin-top: 1.25rem;
	font-family: var(--font-display);
	font-size: var(--text-name);
	font-weight: 400;
	line-height: 1;
	letter-spacing: -0.015em;
}

.person__role {
	margin-top: 0.75rem;
}

.person__bio {
	max-width: 34ch;
	margin: 0.75rem 0 1.25rem;
	color: var(--mute);
}

.person .link {
	font-size: var(--text-label);
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

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

.foot {
	overflow: hidden;
	border-top: 1px solid var(--line);
}

.foot__row {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 0.5rem 2rem;
	padding: 1.5rem var(--gutter);
	color: var(--mute);
}

.foot__row .link {
	color: var(--paper);
}

.foot__mark {
	padding: 0 var(--gutter);
	font-family: var(--font-display);
	font-size: var(--text-mark);
	line-height: 0.82;
	letter-spacing: -0.04em;
	white-space: nowrap;
	user-select: none;
}

/* ---------- Small screens ---------- */

@media (max-width: 820px) {
	.hero {
		grid-template-columns: minmax(0, 1fr);
		gap: clamp(2rem, 8vw, 3rem);
		min-height: 0;
		padding-top: clamp(2.5rem, 12vw, 5rem);
	}

	.hero__media {
		aspect-ratio: 4 / 5;
		min-height: 0;
	}

	.plates {
		grid-template-columns: repeat(6, minmax(0, 1fr));
	}

	.plate--crowd {
		grid-column: 1 / -1;
	}

	.plates__caption {
		grid-column: 1 / -1;
		order: 4;
		margin-top: 0.5rem;
	}

	.plate--hall {
		grid-column: 1 / span 5;
	}

	.plate--installation {
		grid-column: 3 / -1;
	}

	.behind__title,
	.people {
		grid-column: 1 / -1;
	}

	.behind__title {
		margin-bottom: 1.5rem;
	}
}

@media (max-width: 560px) {
	.people {
		grid-template-columns: minmax(0, 1fr);
		row-gap: 3.5rem;
	}

	.person:nth-child(2) {
		margin-top: 0;
	}

	.person__portrait {
		width: 78%;
	}

	.person:nth-child(2) .person__portrait {
		margin-left: auto;
	}
}

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

@keyframes line-up {
	from {
		transform: translateY(112%);
	}
}

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

@keyframes settle {
	from {
		transform: scale(1.08);
	}
}

@keyframes rise {
	from {
		opacity: 0;
		transform: translateY(2.5rem);
	}
}

@media (prefers-reduced-motion: no-preference) {
	/* Load: headline first, note second, photograph last and slowest */
	.hero__title .line > span {
		animation: line-up var(--dur-hero) var(--ease-enter) both;
	}

	.hero__title .line:nth-child(2) > span {
		animation-delay: 80ms;
	}

	.hero__note {
		animation: fade-in var(--dur-slow) var(--ease-enter) 380ms both;
	}

	.hero__media {
		animation: fade-in var(--dur-hero) var(--ease-enter) 180ms both;
	}

	.hero__media img {
		animation: settle 1800ms var(--ease-enter) 180ms both;
	}

	/* Scroll: tied to scroll position, so it reverses on the way back up.
	   Browsers without scroll timelines simply show everything. */
	@supports (animation-timeline: view()) {
		.plates .plate,
		.plates__caption,
		.behind__title,
		.person {
			animation: rise linear both;
			animation-timeline: view();
			animation-range: entry 0% entry 70%;
		}
	}
}

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

	.link::after,
	.person__portrait img {
		transition: none;
	}
}
