/* Matteo Lovadina — site styles. One typeface: Jost. */
:root {
	--paper: #efeee9;
	--ink: #141414;
	--grey: #5b5b57;
	--black: #0a0a0a;
	--ink-d: #f5f5f2;
	--grey-d: #a3a39e;
	--line: #b5b4ae;
	--still: #1d1d1b;
	--px: 64px;
	--pt: 44px;
	--pb: 40px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body.ml {
	background: var(--paper);
	color: var(--ink);
	font-family: "Jost", "Futura", system-ui, sans-serif;
	font-variant-numeric: lining-nums;
	-webkit-font-smoothing: antialiased;
	-webkit-tap-highlight-color: transparent;
}
.ml a { color: inherit; text-decoration: none; }
.ml button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; }
.ml h1, .ml h2, .ml p, .ml figure, .ml dl, .ml dd { margin: 0; }
.ml :focus { outline: none; }
.ml :focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }
.ml ::selection { background: var(--ink); color: var(--paper); }

.caps { font-size: 14px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.12em; }
.meta { font-size: 14px; font-weight: 400; color: var(--grey); font-variant-numeric: tabular-nums; }
.muted { color: var(--grey); }
.ttl { font-style: italic; font-size: 22px; }
.lnk { transition: opacity 160ms ease; }
@media (hover: hover) and (pointer: fine) { .lnk:hover { opacity: 0.6; } }

/* Frame: 44 / 64 / 40 margins, header, stage, footer */
.frame {
	min-height: 100vh;
	min-height: 100svh;
	display: grid;
	grid-template-rows: 48px minmax(0, 1fr) 72px;
	padding: var(--pt) var(--px) var(--pb);
}
.bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.logo { justify-self: start; display: block; padding: 6px 0; }
.logo svg { height: 30px; width: auto; display: block; }
.bar .end { justify-self: end; padding: 12px 0; }
.foot { border-top: 1px solid var(--ink); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.foot > button { justify-self: start; padding: 12px 0; }
.foot .end { justify-self: end; display: flex; gap: 32px; align-items: center; }
.foot .end button { padding: 12px 0; }
.marks { display: flex; gap: 6px; align-items: center; }
.marks span { width: 8px; height: 2px; background: var(--line); transition: width 180ms ease, background-color 180ms ease; }
.marks span.on { width: 24px; background: var(--ink); }

.stage { position: relative; min-height: 0; }

/* Desktop: one slide at a time */
@media (min-width: 900px) {
	.deck-page .frame { height: 100vh; height: 100svh; }
	.deck-page .slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 240ms ease-out, visibility 0s linear 240ms; }
	.deck-page .slide.on { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity 560ms cubic-bezier(0.23, 1, 0.32, 1) 120ms, visibility 0s; }
}
@media (prefers-reduced-motion: reduce) {
	.deck-page .slide, .deck-page .slide.on { transition: opacity 120ms ease, visibility 0s; }
}

/* Opening pages */
.opening { position: absolute; left: 0; right: 0; bottom: 40px; display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; }
.big { font-size: clamp(56px, 8.9vw, 128px); font-weight: 400; line-height: 1; text-transform: uppercase; letter-spacing: 0.1em; }
.opening .side { display: flex; flex-direction: column; gap: 8px; text-align: right; padding-bottom: 12px; font-size: 15px; line-height: 1.5; }
.vindex { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; padding-bottom: 12px; }
.vindex > .caps { padding-bottom: 12px; }
.vindex button { padding: 8px 0; display: flex; gap: 16px; align-items: baseline; }

/* Photo spreads: singles, pairs and triptychs on one bottom line */
.spread { position: absolute; left: 0; right: 0; top: 16px; bottom: 24px; display: flex; justify-content: center; align-items: stretch; gap: 56px; }
.spread.n3 { gap: 40px; }
.ph { display: flex; flex-direction: column; gap: 14px; }
.n1 .ph { width: 66%; }
.n2 .ph { width: calc((100% - 56px) / 2); }
.n3 .ph { width: calc((100% - 80px) / 3); }
.ph .img { position: relative; flex-grow: 1; min-height: 0; }
.ph button { position: absolute; inset: 0; width: 100%; height: 100%; cursor: zoom-in; }
.ph img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: contain; object-position: center bottom; transition: opacity 160ms ease; }
.ph figcaption { display: flex; align-items: baseline; justify-content: center; gap: 16px; }
.n2 .ph:first-child img, .n3 .ph:first-child img { object-position: right bottom; }
.n2 .ph:last-child img, .n3 .ph:last-child img { object-position: left bottom; }
.n2 .ph:first-child figcaption, .n3 .ph:first-child figcaption { justify-content: flex-end; }
.n2 .ph:last-child figcaption, .n3 .ph:last-child figcaption { justify-content: flex-start; }
@media (hover: hover) and (pointer: fine) { .ph button:hover img { opacity: 0.8; } }

/* Viewers on black */
.lb[hidden] { display: none; }
.lb {
	position: fixed; inset: 0; z-index: 100;
	background: var(--black); color: var(--ink-d);
	display: grid; grid-template-rows: 48px minmax(0, 1fr) 72px;
	padding: var(--pt) var(--px) var(--pb);
}
.lb .meta { color: var(--grey-d); }
.lb ::selection { background: var(--ink-d); color: var(--black); }
.bar2 { display: flex; justify-content: space-between; align-items: center; }
.bar2 button { padding: 12px 0; }
.lb-stage { position: relative; min-height: 0; margin-top: 16px; }
.lb-stage img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: contain; }
.lb-prev, .lb-next { position: absolute !important; top: 0; bottom: 0; width: 50%; }
.lb-prev { left: 0; cursor: w-resize !important; }
.lb-next { right: 0; cursor: e-resize !important; }
.lb-cap { display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.lb-t { display: flex; align-items: baseline; gap: 16px; }
.lb-cap .ttl { font-size: 26px; }
.vstage { min-height: 0; display: flex; align-items: center; justify-content: center; gap: 24px; padding-top: 16px; }
.vstage iframe { border: 0; display: block; background: var(--still); }
.vp-links { display: flex; gap: 24px; flex-wrap: wrap; justify-content: flex-end; }
.vp-links a { font-size: 14px; color: var(--grey-d); padding: 12px 0; }

/* Video pages */
.mid { font-size: clamp(36px, 4.4vw, 64px); font-weight: 400; line-height: 1.05; text-transform: uppercase; letter-spacing: 0.1em; }
.lead { font-size: 17px; line-height: 1.5; max-width: 440px; }
.still { position: relative; display: block; width: 100%; background: var(--still); overflow: hidden; }
.still img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: contain; }
.still .play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); transition: transform 200ms ease; }
@media (hover: hover) and (pointer: fine) { .still:hover .play { transform: translate(-50%, -50%) scale(1.08); } }
.r43 { aspect-ratio: 4 / 3; }
.r169 { aspect-ratio: 16 / 9; }
.vt { position: absolute; left: 0; right: 0; top: 16px; bottom: 24px; display: flex; flex-direction: column; justify-content: flex-end; gap: 40px; }
.vt-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 64px; }
.vt-head .lead { text-align: right; }
.vt-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
.vt-grid figure { display: flex; flex-direction: column; gap: 14px; }
.vt-grid figcaption { display: flex; justify-content: space-between; align-items: baseline; }
.vt-grid .still { width: min(100%, calc((100svh - 470px) * 4 / 3)); }
.vt-all { display: flex; justify-content: center; }
.btn { border: 1px solid var(--ink); padding: 14px 28px; }
.vs { position: absolute; left: 0; right: 0; top: 16px; bottom: 24px; display: flex; gap: 64px; align-items: flex-end; }
.vs figure { flex-shrink: 0; display: flex; flex-direction: column; gap: 14px; }
.vs .w43 { width: min(52%, calc((100svh - 300px) * 4 / 3)); }
.vs .w169 { width: min(62%, calc((100svh - 300px) * 16 / 9)); }
.vs-txt { flex-grow: 1; display: flex; flex-direction: column; gap: 24px; padding-bottom: 32px; }
.tag { align-self: flex-start; border: 1px solid var(--ink); padding: 6px 12px; }
.play-txt { align-self: flex-start; padding: 12px 0; }

/* Home: work by period */
.home-frame { grid-template-rows: 96px minmax(0, 1fr) auto; padding-top: 0; }
.home-bar { grid-template-columns: auto 1fr; }
.nav { justify-self: end; display: flex; gap: 32px; }
.nav a { padding: 12px 0; }
.nav .cta { border-bottom: 1px solid var(--ink); }
.cat { position: absolute; inset: 0; display: grid; grid-template-columns: minmax(0, 60%) minmax(0, 1fr); column-gap: 64px; padding: 8px 0 32px; }
.cat-img { position: relative; min-height: 0; }
.cat-img img { position: absolute; left: 0; top: 0; width: 100%; height: calc(100% - 28px); max-width: none; object-fit: contain; object-position: left center; }
.cat-img figcaption { position: absolute; left: 0; bottom: 0; }
.cat-txt { display: flex; flex-direction: column; gap: 28px; min-height: 0; overflow: auto; }
.period { font-size: clamp(36px, 3.9vw, 56px); font-weight: 400; line-height: 1.05; letter-spacing: 0.1em; text-transform: uppercase; }
.tracks { display: flex; flex-direction: column; gap: 18px; }
.tracks > div { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 16px; }
.tracks dt { font-size: 14px; font-weight: 600; padding-top: 4px; }
.tracks dd { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; font-size: 19px; line-height: 1.3; }
.tracks .work { border-bottom: 1px solid var(--ink); transition: opacity 160ms ease; }
.tracks .soon { color: var(--grey); }
@media (hover: hover) and (pointer: fine) { .tracks .work:hover { opacity: 0.6; } }
.periods { border-top: 1px solid var(--ink); padding: 16px 0 0; display: flex; gap: 48px; }
.periods button { padding: 6px 0; color: var(--grey); border-bottom: 1px solid transparent; transition: color 160ms ease; }
.periods button[aria-pressed="true"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--ink); }
@media (hover: hover) and (pointer: fine) { .periods button:hover { color: var(--ink); } }

/* Bio */
.bio-frame { grid-template-rows: 48px auto auto; }
.bio { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: 64px; align-items: start; padding: 72px 0 96px; }
.bio-side { position: sticky; top: var(--pt); display: flex; flex-direction: column; gap: 12px; }
.bio-side .big { margin-bottom: 20px; }
.bio-txt { max-width: 640px; display: flex; flex-direction: column; gap: 22px; font-size: 19px; line-height: 1.55; }
.bio-txt .first { font-size: 25px; line-height: 1.4; }
.bio-txt a { border-bottom: 1px solid var(--ink); transition: opacity 160ms ease; }
@media (hover: hover) and (pointer: fine) { .bio-txt a:hover { opacity: 0.6; } }
.bio-foot { border-top: 1px solid var(--ink); padding-top: 16px; display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.bio-foot a { padding: 6px 0; }
.bio-foot .cta { border-bottom: 1px solid var(--ink); }

/* Index (home): text only, the three disciplines as tabs */
.idx-frame { grid-template-rows: 96px auto minmax(0, 1fr); padding-top: 0; }
.idx-tabs { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 28px; padding: 24px 0 40px; }
.idx-tab, .idx-tabs .dot { font-size: clamp(28px, 3.4vw, 48px); font-weight: 400; letter-spacing: 0.02em; line-height: 1.2; }
.idx-tab { color: var(--grey); padding: 4px 0; border-bottom: 1px solid transparent; transition: color 200ms ease; }
.idx-tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.idx-tabs .dot { color: var(--line); }
.idx-cols { border-top: 1px solid var(--ink); padding-top: 24px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 64px; row-gap: 40px; }
.idx-col { display: flex; flex-direction: column; gap: 18px; }
.idx-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.idx-col .work, .idx-col .soon { display: inline-block; padding: 6px 0; font-size: clamp(20px, 2vw, 28px); line-height: 1.25; }
.idx-col .work { transition: transform 220ms cubic-bezier(0.23, 1, 0.32, 1); }
.idx-col .soon { color: #6b6b66; }
@media (hover: hover) and (pointer: fine) { .idx-tab:hover { color: var(--ink); } .idx-col .work:hover { transform: translateX(12px); } }
@media (prefers-reduced-motion: reduce) { .idx-col .work { transition: none; } }

/* Long texts on paper */
.read-txt { padding: 6px 0; border-bottom: 1px solid var(--ink); }
.vt-lead { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.vs-act { display: flex; gap: 40px; align-items: center; }
.lb.rd { background: var(--paper); color: var(--ink); grid-template-rows: 48px minmax(0, 1fr); row-gap: 16px; }
.lb.rd ::selection { background: var(--ink); color: var(--paper); }
.rd .bar2 { border-bottom: 1px solid var(--ink); }
.rd-body { min-height: 0; overflow-y: auto; }
.rd-col { max-width: 680px; margin: 0 auto; padding: 16px 0 64px; display: flex; flex-direction: column; gap: 18px; }
.rd-col p { margin: 0; font-size: 17px; line-height: 1.6; }
.rd-col h3 { margin: 28px 0 0; font-size: 14px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.12em; }
.rd-col h3:first-child { margin-top: 0; }
.rd-col .lead-in { font-style: italic; font-size: 19px; }

@media (max-width: 899px) {
	.idx-frame { grid-template-rows: auto auto auto; padding-top: 8px; }
	.idx-tabs { padding: 16px 0 24px; gap: 4px 16px; }
	.idx-cols { grid-template-columns: 1fr; }
	.vt-lead { align-items: flex-start; }
	.lb.rd { grid-template-rows: 48px minmax(0, 1fr); }
}

/* Phones and small screens: everything in one scroll */
@media (max-width: 899px) {
	:root { --px: 16px; --pt: 20px; --pb: 24px; }
	.frame { grid-template-rows: auto auto auto; }
	.bar-mid { display: none; }
	.bar { grid-template-columns: 1fr auto; }
	.foot, .periods { display: none; }
	.slide { position: static; }
	.opening, .spread, .vt, .vs, .cat { position: static; }
	.opening { flex-direction: column; align-items: flex-start; padding: 64px 0 48px; }
	.opening .side, .vindex { text-align: left; align-items: flex-start; }
	.spread { flex-direction: column; gap: 40px; padding: 24px 0; }
	.spread .ph { width: 100% !important; }
	.ph .img { flex-grow: 0; }
	.ph button { position: static; display: block; }
	.ph img { position: static; height: auto; }
	.ph figcaption { justify-content: flex-start !important; }
	.vt, .vs { flex-direction: column; align-items: stretch; gap: 24px; padding: 48px 0; border-top: 1px solid var(--ink); }
	.vt-head { flex-direction: column; align-items: flex-start; gap: 16px; }
	.vt-head .lead { text-align: left; }
	.vt-grid { grid-template-columns: 1fr; gap: 24px; }
	.vt-grid .still, .vs .w43, .vs .w169 { width: 100%; }
	.vs-txt { padding-bottom: 0; }
	.home-frame { grid-template-rows: auto auto; padding-top: 8px; }
	.home-bar { padding: 12px 0; }
	.nav { gap: 20px; }
	.cat { grid-template-columns: 1fr; row-gap: 24px; padding: 32px 0 48px; border-top: 1px solid var(--ink); }
	.cat-img { aspect-ratio: 5 / 4; }
	.cat-img img { height: calc(100% - 28px); }
	.cat-txt { overflow: visible; }
	.lb { padding: 20px 16px 24px; grid-template-rows: 48px minmax(0, 1fr) auto; }
	.lb-cap { flex-direction: column; align-items: flex-start; gap: 8px; }
	.vstage { flex-direction: column; }
	.bio { grid-template-columns: 1fr; row-gap: 40px; padding: 48px 0 64px; }
	.bio-side { position: static; }
	.bio-txt { font-size: 17px; }
	.bio-txt .first { font-size: 21px; }
}
