@font-face {
	font-family: "Lobster Two";
	src: url(LobsterTwo-Bold.ttf) format("truetype");
	font-weight: 700;
	font-display: swap;
}

:root {
	--bg: #0b0b0c;
	--fg: #ece9e3;
	--mute: #8f8c86;
	--ease: cubic-bezier(.2, .7, .2, 1);
	--script: 700 1em/1.2 "Lobster Two", cursive; /* the handwriting of the logo and the titles */
	--caption: 56px; /* room for the title below the work in the viewer */
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { scroll-behavior: smooth; }
body {
	min-height: 100dvh;
	background: var(--bg);
	color: var(--fg);
	font: 300 15px/1.5 "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
	-webkit-font-smoothing: antialiased;
}
body.viewing { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { display: block; }
:focus-visible { outline: 1px solid var(--fg); outline-offset: 3px; }

/* ---- header and footer ------------------------------------------------ */
.top {
	display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .4rem 2rem;
	padding: clamp(14px, 2.2vw, 30px) clamp(16px, 3vw, 44px);
}
.logo { margin: 0; font: inherit; display: flex; flex-wrap: wrap; align-items: baseline; gap: .2em .9em; }
.brand { font: var(--script); font-size: clamp(30px, 4vw, 46px); }
.brand b { font-weight: inherit; }
.name { font-size: 13px; letter-spacing: .04em; color: var(--mute); }
.facts { margin: 0; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--mute); }

.foot {
	display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.5rem 3rem;
	padding: clamp(28px, 5vw, 64px) clamp(16px, 3vw, 44px) 32px;
	font-size: 12px; line-height: 1.7; color: var(--mute);
}
.foot p { margin: 0; }
/* in the color of the background: only there for whoever knows where it is */
.edit-link { margin-left: .6em; color: var(--bg); }
.edit-link:hover, .edit-link:focus-visible { color: var(--mute); }

.menu {
	display: flex; flex-wrap: wrap; gap: .4em 1.6em;
	font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--mute);
}
.menu a:hover, .menu a:focus-visible { color: var(--fg); }
.languages { display: flex; gap: .9em; margin-left: .8em; }
.languages [aria-current] { color: var(--fg); }

/* ---- text pages --------------------------------------------------------------- */
.page {
	max-width: 46rem; margin: 0 auto; padding: clamp(20px, 5vw, 64px) clamp(16px, 3vw, 44px) 40px;
	font-size: 16px; font-weight: 400; line-height: 1.65;
}
.page h1 { margin: 0 0 .6em; font: var(--script); font-size: clamp(34px, 5vw, 54px); }
.page h2 { margin: 2.4em 0 .6em; font: inherit; font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--mute); }
.page a { border-bottom: 1px solid var(--mute); }
.page a:hover { border-color: var(--fg); }
.page address { font-style: normal; }
/* a text that is still missing; do/build and do/upload tell about these */
.todo { padding: .6em .9em; border-left: 3px solid #ffd95a; background: rgba(255, 217, 90, .1); color: #ffe89a; }

/* ---- hero: one work fills the window before the overview begins ------------- */
.hero {
	position: relative; height: 100svh; min-height: 420px; overflow: hidden;
	display: grid; align-items: end; background: var(--c);
}
.hero-picture {
	position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--at, center);
	animation: drift 40s ease-out both;
}
@keyframes drift { from { transform: scale(1.16) translate(-1.5%, 1.2%); } to { transform: scale(1.02); } }
.hero::after {
	content: ""; position: absolute; inset: 0; pointer-events: none;
	background:
		linear-gradient(to top, var(--bg) 0%, rgba(11, 11, 12, .55) 22%, transparent 55%),
		linear-gradient(to right, rgba(11, 11, 12, .45), transparent 50%);
}
.hero-menu {
	position: absolute; z-index: 1; top: clamp(14px, 2.2vw, 30px); right: clamp(16px, 3vw, 44px);
	left: clamp(16px, 3vw, 44px); justify-content: flex-end;
	color: rgba(255, 255, 255, .7); text-shadow: 0 1px 12px rgba(0, 0, 0, .8);
}
.hero-menu a:hover, .hero-menu a:focus-visible, .hero-menu [aria-current] { color: #fff; }
.hero-text { position: relative; z-index: 1; padding: 0 clamp(16px, 3vw, 44px) clamp(64px, 11vh, 120px); }
.hero .logo { display: block; }
.hero .brand { font-size: clamp(56px, 10vw, 150px); line-height: .9; text-shadow: 0 2px 40px rgba(0, 0, 0, .55); }
.hero-name { margin: clamp(10px, 1.6vw, 22px) 0 0; font-size: clamp(14px, 1.5vw, 21px); letter-spacing: .32em; text-transform: uppercase; text-shadow: 0 1px 16px rgba(0, 0, 0, .7); }
.hero .facts { margin-top: 8px; color: rgba(255, 255, 255, .7); text-shadow: 0 1px 12px rgba(0, 0, 0, .8); }
.hero-work, .hero-down {
	position: absolute; z-index: 1; bottom: 22px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
	color: rgba(255, 255, 255, .72); text-shadow: 0 1px 12px rgba(0, 0, 0, .8);
}
.hero-work { right: clamp(16px, 3vw, 44px); }
.hero-down { left: clamp(16px, 3vw, 44px); }
.hero-work:hover, .hero-down:hover { color: #fff; }
@media (prefers-reduced-motion: reduce) { .hero-picture { animation: none; } }

/* ---- overview: rows of equal height, centred, with room around each work ----
   Two ways to hang them, chosen in the edit mode (settings.json, the class on <html>):
   gallery-wall, like on the wall of an exhibition, with a label below each work;
   gallery-mat, each work in a passe-partout of the color --mat (settings.json), its label shown on hover. */
.chapter { margin-top: 6px; }
.chapter h2 {
	display: flex; flex-wrap: wrap; align-items: baseline; gap: .2em 1em;
	margin: 0; padding: clamp(36px, 6vw, 84px) clamp(16px, 3vw, 44px) clamp(14px, 1.6vw, 24px); font: inherit;
}
.chapter-title { font: var(--script); font-size: clamp(28px, 4vw, 48px); }
.chapter-facts { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--mute); }
.rows {
	display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end;
	gap: clamp(36px, 5vw, 80px) clamp(28px, 4vw, 64px); padding: 8px clamp(16px, 3vw, 44px) 0;
	--row: clamp(140px, 19vw, 270px);
}
.item { position: relative; flex: 0 0 auto; max-width: 100%; }
.item img {
	width: calc(var(--r) * var(--row)); max-width: 100%; height: auto; aspect-ratio: var(--r);
	background: var(--c); transition: transform .7s var(--ease), filter .45s;
}
.cap { font-size: 12px; letter-spacing: .04em; color: var(--mute); }
.cap b { font: var(--script); font-size: 15px; letter-spacing: 0; margin-right: .5em; color: var(--fg); }

.gallery-wall .item img { box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.gallery-wall .cap { display: block; width: calc(var(--r) * var(--row)); max-width: 100%; padding-top: 10px; }

.gallery-mat .rows { gap: clamp(18px, 2.4vw, 36px); }
.gallery-mat .item {
	overflow: hidden; padding: clamp(14px, 2.2vw, 34px);
	background: var(--mat, #18181a); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04);
}
.gallery-mat .item img { box-shadow: 0 6px 24px rgba(0, 0, 0, .55); }
.gallery-mat .cap {
	position: absolute; inset: auto 0 0 0; padding: 40px 14px 12px; font-size: 13px; color: var(--fg);
	background: linear-gradient(transparent, rgba(0, 0, 0, .72));
	opacity: 0; transform: translateY(8px); transition: opacity .35s, transform .35s;
}
.gallery-mat .cap b { font-size: 17px; }
.gallery-mat .item:focus-visible .cap { opacity: 1; transform: none; }

.item:focus-visible { outline-offset: 4px; }
@media (hover: hover) {
	.gallery-mat .item:hover img { transform: scale(1.03); }
	.rows:hover .item:not(:hover) img { filter: brightness(.5) saturate(.75); }
	.gallery-mat .item:hover .cap { opacity: 1; transform: none; }
}

/* ---- viewer: the work lights the room ----------------------------------- */
.viewer {
	position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; overflow: hidden;
	background: #050506; container-type: size; touch-action: none; outline: none;
}
.viewer[hidden] { display: none; }
.backdrop {
	position: absolute; inset: -12%; z-index: -1;
	background: center / cover no-repeat;
	filter: blur(70px) saturate(1.6) brightness(.48);
	transition: background-image .9s;
}
.fig { margin: 0; display: grid; justify-items: center; }
.stage {
	width: min(96cqw, calc((96cqh - var(--caption)) * var(--r))); height: auto; aspect-ratio: var(--r); object-fit: cover;
	box-shadow: 0 30px 90px rgba(0, 0, 0, .65);
	user-select: none; -webkit-user-drag: none; cursor: zoom-in;
}
/* zooming: the script moves and scales the picture, the page only says how smoothly */
.stage.gliding { transition: transform .35s var(--ease); }
.viewer.zoomed .stage { cursor: grab; position: relative; z-index: 1; }
.viewer.zoomed .stage:active { cursor: grabbing; }
.viewer.zoomed .close { z-index: 2; }
.viewer.zoomed .nav, .viewer.zoomed .count, .viewer.zoomed .parts, .viewer.zoomed figcaption {
	opacity: 0; pointer-events: none;
}
.fig.in { animation: in .55s var(--ease); }
@keyframes in { from { opacity: 0; transform: scale(.985); } }

.fig.detailed { --caption: 80px; }
.fig figcaption {
	height: var(--caption); max-width: 92cqw;
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
	text-shadow: 0 1px 12px rgba(0, 0, 0, .8); white-space: nowrap;
}
.fig .label {
	max-width: 100%; overflow: hidden; text-overflow: ellipsis;
	font: var(--script); font-size: clamp(19px, 2.4cqw, 24px);
}
.fig .year { margin-left: .3em; color: rgba(255, 255, 255, .6); }
.fig .part {
	margin-left: .6em; font: 300 12px/1 "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
	letter-spacing: .16em; text-transform: uppercase; color: rgba(255, 255, 255, .6);
}
.fig .part:empty { display: none; }
.fig figcaption { transition: opacity .3s; }

.parts { position: absolute; left: 22px; bottom: 16px; display: flex; gap: 8px; transition: opacity .3s; }
.parts[hidden] { display: none; }
.parts button { height: 44px; opacity: .55; transition: opacity .3s; }
.parts button img { height: 100%; width: auto; }
.parts button:hover, .parts button:focus-visible { opacity: 1; }
.parts button[aria-pressed=true] { opacity: 1; outline: 1px solid var(--fg); outline-offset: 2px; }
.fig .details {
	max-width: 100%; overflow: hidden; text-overflow: ellipsis;
	font-size: 13px; letter-spacing: .06em; color: rgba(255, 255, 255, .7);
}
.fig .details:empty { display: none; }
.count {
	position: absolute; right: 26px; bottom: 20px;
	font-size: 12px; letter-spacing: .12em; color: rgba(255, 255, 255, .6); text-shadow: 0 1px 12px rgba(0, 0, 0, .8);
}
.close {
	position: absolute; top: 6px; right: 12px; width: 48px; height: 48px;
	font-size: 34px; line-height: 1; text-shadow: 0 0 20px rgba(0, 0, 0, .9);
}
.nav {
	position: absolute; top: 60px; bottom: 60px; width: 14%; min-width: 56px;
	display: grid; place-items: center;
	font-size: 44px; font-weight: 200; line-height: 1; text-shadow: 0 0 20px rgba(0, 0, 0, .9);
	opacity: .55;
}
.nav.prev { left: 0; }
.nav.next { right: 0; }
.nav:hover, .nav:focus-visible { opacity: 1; }
.nav:disabled { visibility: hidden; }

/* the controls step back while the visitor just looks */
.nav, .close, .count { transition: opacity .6s; }
.viewer.idle, .viewer.idle .stage { cursor: none; }
.viewer.idle .nav, .viewer.idle .close, .viewer.idle .count, .viewer.idle .parts { opacity: 0; }

/* the picture grows out of its place in the overview */
::view-transition-group(work) { animation-duration: .55s; animation-timing-function: cubic-bezier(.2, .8, .2, 1); }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .4s; }

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) {
		transition: none !important; animation: none !important;
	}
}
