/*
	About page: an immersive, scroll-driven CV.
	Layout: a fixed transparent WebGL canvas floats a 3D phone above normal-flow
	sections. The phone follows the `.slot` placeholders laid out here, so CSS
	decides where it sits at every breakpoint. Colours are the site's dark skin
	(see modern.css); the page commits to that single look.
	Without JavaScript or WebGL everything below is still plain, readable HTML.
*/

:root {
	--bg: #070b16;
	--bg-raise: #0d1425;
	--line: rgba(255, 255, 255, 0.1);
	--text: #b6c0d2;
	--strong: #eef2f9;
	--muted: #8b96ab;
	--teal: #2dd4a7;
	--blue: #4aa8ff;
	--violet: #8b5cf6;
	--grad: linear-gradient(120deg, #2dd4a7, #4aa8ff 55%, #8b5cf6);
	--sans: "Roboto Flex", "Source Sans Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
	--serif: "Instrument Serif", Georgia, "Times New Roman", serif;
	--mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
	--gut: clamp(18px, 5vw, 84px);
	--max: 1240px;
	color-scheme: dark;
}

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

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

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 400 17px/1.6 var(--sans);
	-webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
ul, ol { list-style: none; margin: 0; padding: 0; }
p { margin: 0; }
h1, h2, h3, h4 { margin: 0; color: var(--strong); text-wrap: balance; }

:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 4px; }

.wrap {
	max-width: calc(var(--max) + 2 * var(--gut));
	margin-inline: auto;
	padding-left: max(var(--gut), env(safe-area-inset-left, 0px));
	padding-right: max(var(--gut), env(safe-area-inset-right, 0px));
}

/* ---------------------------------------------------------------- type */

.eyebrow, .when {
	font: 500 0.72rem/1.4 var(--mono);
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--muted);
}

.when { color: var(--teal); }

h2 {
	font: 700 clamp(2.2rem, 5.4vw, 4.6rem)/0.98 var(--sans);
	font-stretch: 108%;
	letter-spacing: -0.035em;
}

h3 {
	font: 650 clamp(1.3rem, 2.1vw, 1.75rem)/1.12 var(--sans);
	letter-spacing: -0.02em;
}

h1 em, h2 em, .tagline em {
	font-family: var(--serif);
	font-style: italic;
	font-weight: 400;
	font-stretch: 100%;
	letter-spacing: -0.01em;
	padding-right: 0.08em;
	background: var(--grad);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.lead { font-size: clamp(1.08rem, 1.5vw, 1.3rem); line-height: 1.5; color: var(--strong); }

.head { display: grid; gap: 1rem; margin-bottom: clamp(2rem, 6vh, 4rem); }
.head .lead { max-width: 44ch; color: var(--text); }

.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chips li {
	padding: 0.28rem 0.62rem;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.03);
	font: 500 0.7rem/1.3 var(--mono);
	letter-spacing: 0.04em;
	color: var(--text);
	white-space: nowrap;
}
.chips.big li { font-size: 0.8rem; padding: 0.4rem 0.8rem; }

.more {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	font: 500 0.78rem/1.3 var(--mono);
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--strong);
	border-bottom: 1px solid rgba(255, 255, 255, 0.28);
	padding-bottom: 0.2rem;
	transition: border-color 0.2s, color 0.2s;
}
.more::after { content: "→"; transition: transform 0.2s; }
.more.ext::after { content: "↗"; }
.more:hover { color: var(--teal); border-color: var(--teal); }
.more:hover::after { transform: translateX(3px); }

/* ------------------------------------------------- fixed layers & nav */

.aurora {
	position: fixed;
	inset: 0;
	z-index: -1;
	background:
		radial-gradient(42vmax 42vmax at 12% 8%, rgba(45, 212, 167, 0.14), transparent 62%),
		radial-gradient(48vmax 48vmax at 92% 34%, rgba(139, 92, 246, 0.15), transparent 62%),
		radial-gradient(40vmax 40vmax at 40% 100%, rgba(74, 168, 255, 0.12), transparent 62%);
	background-size: 150% 150%;
	animation: drift 28s ease-in-out infinite alternate;
}
@keyframes drift { from { background-position: 0% 0%, 100% 0%, 30% 100%; } to { background-position: 60% 40%, 20% 70%, 90% 30%; } }
/* a soft light and a dot grid that follow the pointer */
.aurora::before {
	content: "";
	position: absolute;
	inset: 0;
	background: radial-gradient(520px circle at var(--mx, 70%) var(--my, 18%), rgba(74, 168, 255, 0.1), transparent 70%);
}
.aurora::after {
	content: "";
	position: absolute;
	inset: 0;
	background-image: radial-gradient(rgba(255, 255, 255, 0.22) 1px, transparent 1.3px);
	background-size: 28px 28px;
	-webkit-mask-image: radial-gradient(460px circle at var(--mx, 70%) var(--my, 18%), #000, transparent 72%);
	mask-image: radial-gradient(460px circle at var(--mx, 70%) var(--my, 18%), #000, transparent 72%);
}

#gl {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	z-index: 20;
	pointer-events: none;
	display: none;
}
html.gl #gl { display: block; }

.progress { position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 40; }
.progress i { display: block; height: 100%; background: var(--grad); transform-origin: left; transform: scaleX(0); }

.nav {
	position: fixed;
	inset: 0 0 auto 0;
	z-index: 30;
	height: 60px;
	display: flex;
	align-items: center;
	gap: 1.5rem;
	padding-left: max(var(--gut), env(safe-area-inset-left, 0px));
	padding-right: calc(max(var(--gut), env(safe-area-inset-right, 0px)) + 108px);
	border-bottom: 1px solid transparent;
	transition: background 0.3s, border-color 0.3s;
}
.nav.scrolled {
	background: rgba(7, 11, 22, 0.74);
	-webkit-backdrop-filter: blur(14px);
	backdrop-filter: blur(14px);
	border-color: var(--line);
}
.mark {
	display: flex;
	align-items: center;
	gap: 0.8rem;
	font: 300 1rem/1 var(--sans);
	letter-spacing: -0.01em;
	color: var(--strong);
	text-decoration: none;
}
.mark strong { font-weight: 800; font-stretch: 110%; }
/* The mark: an app icon made of three stacked layers that fan out on hover. */
.logo { position: relative; flex: none; width: 34px; height: 34px; display: grid; place-items: center; }
.logo i {
	position: absolute;
	inset: 0;
	border-radius: 11px;
	transition: transform 0.55s cubic-bezier(0.3, 1.5, 0.4, 1);
}
.logo i:nth-child(1) { background: var(--violet); transform: translate(5px, 5px) rotate(9deg); }
.logo i:nth-child(2) { background: var(--blue); transform: translate(2.5px, 2.5px) rotate(4.5deg); }
.logo i:nth-child(3) { background: linear-gradient(150deg, #1b2540, #0a101f); border: 1px solid rgba(255, 255, 255, 0.24); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18); }
.logo b {
	position: relative;
	font: 850 0.8rem/1 var(--sans);
	font-stretch: 122%;
	letter-spacing: -0.04em;
	background: var(--grad);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	transition: transform 0.55s cubic-bezier(0.3, 1.5, 0.4, 1);
}
.mark:hover .logo i:nth-child(1) { transform: translate(10px, 10px) rotate(18deg); }
.mark:hover .logo i:nth-child(2) { transform: translate(5px, 5px) rotate(9deg); }
.mark:hover .logo i:nth-child(3), .mark:hover .logo b { transform: translate(-2px, -2px) rotate(-5deg); }
.nav nav { margin-left: auto; display: flex; gap: 1.5rem; }
.nav nav a {
	font: 500 0.7rem/1 var(--mono);
	letter-spacing: 0.12em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--muted);
	transition: color 0.2s;
}
.nav nav a:hover { color: var(--strong); }

/* Language: English by default, Italian when html[data-lang="it"] (saved as 'sm-lang', the key the rest of the site uses). */
html:not([data-lang="it"]) .lang-it { display: none !important; }
html[data-lang="it"] .lang-en { display: none !important; }

.lang-toggle {
	position: fixed;
	top: 13px;
	right: max(var(--gut), env(safe-area-inset-right, 0px));
	z-index: 31;
	width: 88px;
	height: 34px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.16);
	border-radius: 999px;
	background: rgba(13, 20, 37, 0.72);
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
	overflow: hidden;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}
.lang-toggle:hover { border-color: rgba(255, 255, 255, 0.34); }
.lang-toggle .lt {
	position: absolute;
	top: 0;
	width: 50%;
	height: 100%;
	display: grid;
	place-items: center;
	font: 600 0.68rem/1 var(--mono);
	letter-spacing: 0.12em;
	color: var(--muted);
	transition: color 0.3s ease;
	z-index: 2;
}
.lang-toggle .lt-en { left: 0; }
.lang-toggle .lt-it { right: 0; }
html:not([data-lang="it"]) .lang-toggle .lt-en, html[data-lang="it"] .lang-toggle .lt-it { color: #04121a; }
.lang-toggle .lt-knob {
	position: absolute;
	top: 3px;
	left: 3px;
	width: calc(50% - 3px);
	height: calc(100% - 6px);
	border-radius: 999px;
	background: var(--grad);
	box-shadow: 0 4px 16px rgba(45, 212, 167, 0.4);
	z-index: 1;
	transition: transform 0.5s cubic-bezier(0.3, 1.4, 0.4, 1);
}
html[data-lang="it"] .lang-toggle .lt-knob { transform: translateX(100%); }

/* Short notice, e.g. after the e-mail address has been copied. */
.toast {
	position: fixed;
	left: 50%;
	bottom: calc(26px + env(safe-area-inset-bottom, 0px));
	z-index: 50;
	transform: translate(-50%, 20px);
	padding: 0.8rem 1.2rem;
	border: 1px solid rgba(45, 212, 167, 0.5);
	border-radius: 999px;
	background: rgba(13, 20, 37, 0.94);
	font: 500 0.82rem/1.3 var(--mono);
	color: var(--strong);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s, transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
	max-width: calc(100vw - 32px);
	text-align: center;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------------------------------------------------------- phone slot */

.slot { position: relative; min-width: 0; touch-action: pan-y; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

/* Hint above the phone: its apps can be used. */
.tap {
	position: absolute;
	left: 50%;
	top: -0.5rem;
	transform: translateX(-50%);
	display: flex;
	align-items: center;
	gap: 0.55rem;
	white-space: nowrap;
	font: 500 0.66rem/1 var(--mono);
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--muted);
	z-index: 2;
}
.tap > span, .slot:not([data-hint]) .tap, .slot[data-hint="none"] .tap { display: none; }
.slot[data-hint="tap"] .tap .k-tap, .slot[data-hint="hold"] .tap .k-hold { display: inline; }
.tap { color: var(--teal); }
.tap::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--teal); animation: pulse 1.8s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(45, 212, 167, 0.55); } 100% { box-shadow: 0 0 0 12px rgba(45, 212, 167, 0); } }

html.over-screen, html.over-screen body * { cursor: pointer !important; }
html.over-phone, html.over-phone body * { cursor: grab !important; }
html.grabbing, html.grabbing body * { cursor: grabbing !important; -webkit-user-select: none; user-select: none; }

/* City skylines behind the phone: one strip, panned from city to city. */
.sky {
	position: absolute;
	left: -22%;
	right: -22%;
	bottom: 0;
	height: 54%;
	overflow: hidden;
	pointer-events: none;
	-webkit-mask-image: linear-gradient(90deg, transparent, #000 13%, #000 87%, transparent);
	mask-image: linear-gradient(90deg, transparent, #000 13%, #000 87%, transparent);
}
.sky-strip { display: flex; width: 400%; height: 100%; transform: translateX(calc(var(--c, 0) * -25%)); transition: transform 1.4s cubic-bezier(0.7, 0, 0.2, 1); }
.city { position: relative; flex: none; width: 25%; height: 100%; overflow: hidden; }
.city-art { position: absolute; left: 0; right: 0; bottom: 0; aspect-ratio: 1000 / 420; }
.city-art > canvas:first-child { display: block; width: 100%; height: 100%; }
.veh { position: absolute; left: -16%; height: auto; }
.veh.bus { animation: drive 15s linear infinite; }
.veh.tram { animation: drive 19s linear infinite reverse; }
@keyframes drive { from { left: -16%; } to { left: 104%; } }
/* The London bike crosses the bridge slowly: the bus overtakes it. */
.veh.bike { animation: drive 32s linear infinite; animation-delay: -11s; }
/* The red bike climbs the three hairpins to San Luca (the points of ROAD in about-cities.js), then starts again. */
.veh.climb { transform-origin: 50% 100%; animation: climb 15s linear infinite; }
@keyframes climb {
	0% { left: -1.4%; bottom: 13.33%; transform: rotate(-11deg); opacity: 0; }
	4% { opacity: 1; }
	40% { left: 12.2%; bottom: 20%; transform: rotate(-11deg); }
	41% { left: 12.2%; bottom: 20%; transform: rotate(17deg) scaleX(-1); }
	69% { left: 2.8%; bottom: 27.14%; transform: rotate(17deg) scaleX(-1); }
	70% { left: 2.8%; bottom: 27.14%; transform: rotate(-21deg); }
	92% { left: 10.4%; bottom: 34.29%; transform: rotate(-21deg); opacity: 1; }
	100% { left: 10.4%; bottom: 34.29%; transform: rotate(-21deg); opacity: 0; }
}
.sky-label { position: absolute; left: -16%; top: 30%; display: grid; gap: 0.3rem; pointer-events: none; }
.sky-label b { font: 800 clamp(1.5rem, 2.4vw, 2.2rem)/1 var(--sans); font-stretch: 114%; letter-spacing: -0.03em; text-transform: uppercase; color: transparent; -webkit-text-stroke: 1px rgba(238, 242, 249, 0.6); }
.sky-label span { font: 500 0.76rem/1 var(--mono); letter-spacing: 0.14em; color: var(--teal); }
.sky-label.pop { animation: rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.slot .fallback {
	position: absolute;
	inset: 0;
	margin: auto;
	height: 88%;
	width: auto;
	aspect-ratio: 9 / 19.5;
	object-fit: cover;
	border-radius: 30px;
	border: 7px solid #111a2e;
	box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.7);
}
html.gl .slot .fallback { visibility: hidden; }

/* ----------------------------------------------------------------- hero */

.hero {
	min-height: 100vh;
	min-height: 100svh;
	display: grid;
	grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
	align-items: center;
	gap: 2rem;
	max-width: calc(var(--max) + 2 * var(--gut));
	margin-inline: auto;
	padding: 84px max(var(--gut), env(safe-area-inset-right, 0px)) 40px max(var(--gut), env(safe-area-inset-left, 0px));
}
.hero-copy { display: grid; gap: clamp(1rem, 2.4vh, 1.7rem); justify-items: start; min-width: 0; }
.hero-copy > * { animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.hero-copy > :nth-child(2) { animation-delay: 0.08s; }
.hero-copy > :nth-child(3) { animation-delay: 0.18s; }
.hero-copy > :nth-child(4) { animation-delay: 0.28s; }
.hero-copy > :nth-child(5) { animation-delay: 0.5s; }
@keyframes rise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }

.hero .eyebrow { display: flex; align-items: center; gap: 0.7rem; }
.live { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 5px rgba(45, 212, 167, 0.18); }

.display {
	font-size: clamp(3rem, 8vw, 7rem);
	line-height: 0.88;
	letter-spacing: -0.045em;
	font-stretch: 112%;
}
.display span { display: block; }
.display i { display: inline-block; font-style: normal; transform-origin: 50% 100%; animation: letter 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: calc(var(--i) * 30ms + 120ms); }
.hero-copy > .display.split { animation: none; perspective: 600px; }
@keyframes letter { from { opacity: 0; transform: translateY(0.55em) rotateX(-80deg); } to { opacity: 1; transform: none; } }
.display span:first-child { font-weight: 300; }
.display span:last-child { font-weight: 850; }

.tagline { font-size: clamp(1.25rem, 2.3vw, 1.9rem); line-height: 1.25; color: var(--strong); max-width: 24ch; }
.tagline em { font-size: 1.12em; }

.cta { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.btn {
	display: inline-flex;
	align-items: center;
	padding: 0.85rem 1.3rem;
	border: 1px solid rgba(255, 255, 255, 0.22);
	border-radius: 999px;
	background: transparent;
	cursor: pointer;
	font: 600 0.95rem/1 var(--sans);
	color: var(--strong);
	text-decoration: none;
	transform: translate(var(--bx, 0px), var(--by, 0px));
	transition: border-color 0.2s, background 0.2s, transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.25s;
}
.btn:hover { border-color: var(--teal); transform: translate(var(--bx, 0px), calc(var(--by, 0px) - 2px)); }
.btn.primary:hover { box-shadow: 0 14px 40px -12px rgba(45, 212, 167, 0.7); }
.btn.primary { background: var(--grad); border-color: transparent; color: #04121a; }

.hint {
	display: inline-flex;
	align-items: center;
	gap: 0.7rem;
	margin-top: 0.4rem;
	font: 500 0.7rem/1 var(--mono);
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--muted);
}
.hint::before {
	content: "";
	width: 1px;
	height: 38px;
	background: var(--grad);
	transform-origin: top;
	animation: drip 2s ease-in-out infinite;
}
@keyframes drip { 0% { transform: scaleY(0); } 55% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

.hero .slot { height: min(78vh, 740px); }

/* ---------------------------------------------------------------- about */

section { position: relative; }
.about, .road, .apps, .life { padding-top: clamp(80px, 14vh, 150px); padding-bottom: clamp(60px, 10vh, 110px); }

.about { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.about-copy { display: grid; gap: 1.2rem; }
.about-copy p:not(.eyebrow):not(.lead) { max-width: 62ch; }

.stats { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.stats li { display: grid; gap: 0.3rem; padding: clamp(1.1rem, 2.4vw, 1.8rem); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 0.92rem; color: var(--muted); }
.stats b {
	font: 800 clamp(2.6rem, 5.2vw, 4.4rem)/0.9 var(--sans);
	font-stretch: 112%;
	letter-spacing: -0.04em;
	font-variant-numeric: tabular-nums;
	background: var(--grad);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.facts { grid-column: 1 / -1; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.5rem; padding-top: 1.6rem; border-top: 1px solid var(--line); }
.facts dt { font: 500 0.7rem/1.4 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.4rem; }
.facts dd { margin: 0; font-size: 1.15rem; font-weight: 600; color: var(--strong); }
.facts small { display: block; font-size: 0.9rem; font-weight: 400; color: var(--muted); }

/* ----------------------------------------------------------------- road */

.road-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr); gap: clamp(2rem, 6vw, 6rem); }
.steps { position: relative; padding-left: 34px; }
.rail { position: absolute; left: 5px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.rail i { display: block; height: 100%; background: var(--grad); transform-origin: top; transform: scaleY(0); }

.step {
	position: relative;
	min-height: 64vh;
	display: grid;
	align-content: center;
	justify-items: start;
	gap: 0.7rem;
	opacity: 0.3;
	transition: opacity 0.45s;
}
.step.on { opacity: 1; }
.steps .step::before {
	content: "";
	position: absolute;
	left: -34px;
	top: 50%;
	width: 12px;
	height: 12px;
	margin-top: -6px;
	border-radius: 50%;
	background: var(--bg);
	border: 2px solid var(--muted);
	transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
}
.steps .step.on::before { border-color: var(--teal); background: var(--teal); box-shadow: 0 0 0 6px rgba(45, 212, 167, 0.18); }
.step h3 { font-size: clamp(1.9rem, 4vw, 3.4rem); font-weight: 750; letter-spacing: -0.035em; }
.step > p:not(.when) { max-width: 44ch; font-size: clamp(1rem, 1.3vw, 1.18rem); }

.road .slot, .apps .slot { position: sticky; top: 12vh; height: 76vh; align-self: start; }

/* ----------------------------------------------------------------- work */

.work { padding-top: clamp(80px, 14vh, 150px); padding-bottom: clamp(40px, 8vh, 90px); }
.work-pin { display: grid; align-content: center; gap: clamp(1.2rem, 3vh, 2rem); }
.work-pin .head { margin-bottom: 0; width: 100%; }
.work-pin.pinned { min-height: 100vh; padding: 70px 0 20px; }
.work-pin.pinned h2 { font-size: clamp(2rem, 4.2vw, 3.6rem); }

.track-wrap { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x mandatory; }
.track-wrap::-webkit-scrollbar { display: none; }
.pinned .track-wrap { overflow: hidden; scroll-snap-type: none; }

.track {
	display: flex;
	gap: clamp(14px, 1.8vw, 24px);
	width: max-content;
	padding: 6px max(var(--gut), env(safe-area-inset-right, 0px)) 6px max(var(--gut), env(safe-area-inset-left, 0px));
}
.card {
	flex: none;
	scroll-snap-align: center;
	width: min(82vw, 410px);
	min-height: min(52vh, 400px);
	display: grid;
	grid-template-rows: auto auto auto 1fr auto auto;
	align-content: start;
	justify-items: start;
	gap: 0.8rem;
	padding: clamp(1.25rem, 2.2vw, 1.8rem);
	border: 1px solid var(--line);
	border-radius: 22px;
	background: linear-gradient(165deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.015));
	position: relative;
	overflow: hidden;
	transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
	transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1), border-color 0.3s;
}
.card::after, .tiles a::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.3s; background: radial-gradient(340px circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, 0.14), transparent 65%); }
.card:hover::after, .tiles a:hover::after { opacity: 1; }
.card:hover { border-color: rgba(255, 255, 255, 0.28); }
.card .ico { width: 40px; height: 40px; fill: none; stroke: var(--blue); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.card p:not(.when) { font-size: 0.95rem; line-height: 1.5; }
.card.now { border-color: rgba(45, 212, 167, 0.55); background: linear-gradient(165deg, rgba(45, 212, 167, 0.16), rgba(74, 168, 255, 0.04)); box-shadow: 0 30px 80px -40px rgba(45, 212, 167, 0.6); }
.card.now .ico { stroke: var(--teal); }

.work-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; width: 100%; }
.swipe { font: 500 0.7rem/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.pinned .swipe { visibility: hidden; }

/* ---------------------------------------------------------------- stack */

.stack-pin {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	align-items: center;
	gap: clamp(1.5rem, 4vw, 4rem);
	min-height: 100vh;
	max-width: calc(var(--max) + 2 * var(--gut));
	margin-inline: auto;
	padding: 76px max(var(--gut), env(safe-area-inset-right, 0px)) 28px max(var(--gut), env(safe-area-inset-left, 0px));
}
.stack-copy { display: grid; gap: 1.1rem; min-width: 0; }
.stack .slot { height: 80vh; }

.layers { display: grid; }
.layers > li { display: grid; gap: 0.5rem; padding: 0.85rem 0; border-top: 1px solid var(--line); transition: opacity 0.35s; }
.layers h3 { display: flex; align-items: baseline; gap: 0.8rem; font-size: clamp(1.15rem, 1.8vw, 1.45rem); }
.layers .n { font: 500 0.72rem var(--mono); letter-spacing: 0.1em; color: var(--muted); }
.layers p { font-size: 0.95rem; }

/* While the section is pinned only the layer in focus is open. */
.layers.focus > li { opacity: 0.34; }
.layers.focus > li.on { opacity: 1; }
.layers.focus > li:not(.on) p, .layers.focus > li:not(.on) .chips { display: none; }
.layers.focus > li.on .n { color: var(--teal); }
.layers.focus > li.on .chips li { border-color: rgba(45, 212, 167, 0.4); color: var(--strong); }

/* ----------------------------------------------------------------- apps */

.apps-grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 6rem); }
.app h3 { font-size: clamp(2rem, 4.4vw, 3.6rem); font-weight: 800; font-stretch: 110%; letter-spacing: -0.04em; }

/* ---------------------------------------------------------------- talks */

.talks { padding-top: clamp(80px, 14vh, 150px); }
.talk { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr); gap: clamp(1.5rem, 5vw, 5rem); align-items: center; margin-bottom: clamp(48px, 10vh, 110px); }
.talk.flip { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); }
.talk figure { margin: 0; border-radius: 26px; overflow: hidden; border: 1px solid var(--line); background: var(--bg-raise); }
.talk img { width: 100%; height: auto; }
.talk:not(.flip) figure { max-height: 78vh; }
.talk:not(.flip) img { height: 100%; object-fit: cover; object-position: 40% 20%; }
.talk-copy { display: grid; gap: 0.9rem; justify-items: start; }
.talk .slot { height: min(74vh, 680px); }
.talk.flip { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr); }

.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 24px; background: rgba(4, 7, 14, 0.88); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.modal[hidden] { display: none; }
/* The box takes its width from whichever is smaller, the room across or the room down, so the
   whole portrait video and its close button stay on screen on a phone too. */
.modal-box { position: relative; width: min(100vw - 48px, 86vh * 9 / 16, 495px); aspect-ratio: 9 / 16; }
@supports (height: 1dvh) { .modal-box { width: min(100vw - 48px, 86dvh * 9 / 16, 495px); } }
.modal video { width: 100%; height: 100%; object-fit: cover; border-radius: 24px; background: #000; box-shadow: 0 40px 120px -20px rgba(45, 212, 167, 0.4); }
.modal-x { position: absolute; top: -14px; right: -14px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg-raise); color: var(--strong); font: 400 1.5rem/1 var(--sans); cursor: pointer; }
html.modal-open { overflow: hidden; }
.talk-copy h3 { font-size: clamp(1.6rem, 3vw, 2.6rem); letter-spacing: -0.03em; }
.venue { font: 500 0.82rem/1.4 var(--mono); color: var(--strong); }
.links { display: flex; flex-wrap: wrap; gap: 1.2rem; padding-top: 0.4rem; }

.cities { overflow: hidden; border-block: 1px solid var(--line); padding: clamp(14px, 2.6vh, 24px) 0; margin-bottom: clamp(40px, 8vh, 80px); }
.cities-track {
	display: flex;
	width: max-content;
	white-space: nowrap;
	font: 800 clamp(1.9rem, 5vw, 4.2rem)/1.1 var(--sans);
	font-stretch: 112%;
	letter-spacing: -0.03em;
	text-transform: uppercase;
	color: var(--strong);
	animation: marquee 46s linear infinite;
}
.cities-track b { font-weight: inherit; }
.cities-track b:nth-child(even) { color: transparent; -webkit-text-stroke: 1.2px rgba(238, 242, 249, 0.7); }
@keyframes marquee { to { transform: translateX(-50%); } }

.events { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: clamp(1.5rem, 4vw, 3.5rem); padding-bottom: clamp(60px, 10vh, 110px); }
.events-title { grid-column: 1 / -1; font-size: clamp(1.4rem, 2.6vw, 2.1rem); max-width: 26ch; }
.era h4 { display: flex; align-items: baseline; gap: 0.8rem; padding-bottom: 0.8rem; border-bottom: 1px solid var(--line); font: 700 1.35rem/1 var(--sans); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.era small { font: 500 0.7rem var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.era li { display: flex; align-items: baseline; justify-content: space-between; gap: 0.8rem; padding: 0.55rem 0; border-bottom: 1px solid rgba(255, 255, 255, 0.06); font-size: 0.95rem; }
.era a { text-decoration: none; transition: color 0.2s; }
.era a:hover { color: var(--teal); }
.tag { flex: none; padding: 0.15rem 0.5rem; border-radius: 999px; background: var(--grad); font: 700 0.62rem/1.4 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: #04121a; }

/* ----------------------------------------------------------------- life */

.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(10px, 1.4vw, 18px); }
.tiles a { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 20px; border: 1px solid var(--line); text-decoration: none; transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1); }
.tiles img { width: 100%; height: 100%; object-fit: cover; filter: saturate(0.92) brightness(0.94); transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.4s; }
.tiles a:hover img { transform: scale(1.06); filter: none; }
.tiles a > span { position: absolute; inset: auto 0 0 0; padding: 3rem 1.1rem 1rem; background: linear-gradient(transparent, rgba(7, 11, 22, 0.92)); font: 600 1.05rem/1.2 var(--sans); color: var(--strong); }

/* -------------------------------------------------------------- contact */

.contact {
	min-height: 92vh;
	display: grid;
	grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
	align-items: center;
	gap: 2rem;
	max-width: calc(var(--max) + 2 * var(--gut));
	margin-inline: auto;
	padding: clamp(80px, 12vh, 140px) max(var(--gut), env(safe-area-inset-right, 0px)) 60px max(var(--gut), env(safe-area-inset-left, 0px));
}
.contact-copy { display: grid; gap: 1.3rem; justify-items: start; min-width: 0; }
.mail {
	max-width: 100%;
	font: 600 clamp(1.3rem, 3.6vw, 2.9rem)/1.2 var(--sans);
	letter-spacing: -0.02em;
	color: var(--strong);
	text-decoration: none;
	overflow-wrap: anywhere;
	border-bottom: 2px solid var(--teal);
	padding-bottom: 0.2rem;
	transition: color 0.2s;
}
.mail:hover { color: var(--teal); }
.socials, .where { display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; }
.socials a, .where a { font: 500 0.78rem/1.6 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none; color: var(--text); transition: color 0.2s; }
.socials a:hover, .where a:hover { color: var(--teal); }
.where { padding-top: 1rem; border-top: 1px solid var(--line); width: 100%; }
.where a { color: var(--muted); }
.contact .slot { height: min(70vh, 640px); }

.foot {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 1rem;
	padding: 1.4rem max(var(--gut), env(safe-area-inset-right, 0px)) calc(1.4rem + env(safe-area-inset-bottom, 0px)) max(var(--gut), env(safe-area-inset-left, 0px));
	border-top: 1px solid var(--line);
	font: 500 0.72rem/1.4 var(--mono);
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--muted);
}
.foot a { margin-left: 1.4rem; text-decoration: none; }
.foot a:hover { color: var(--strong); }

/* --------------------------------------------------------------- reveal */

html.has-rv .rv { opacity: 0; transform: translateY(28px); transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1); }
html.has-rv .rv.in { opacity: 1; transform: none; }
html.has-rv .rv h2 { clip-path: inset(0 -5% 100% -5%); transform: translateY(0.45em); transition: clip-path 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) 0.1s, transform 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) 0.1s; }
html.has-rv .rv.in h2 { clip-path: inset(-12% -5% -30% -5%); transform: none; }

/* Photo that follows the pointer over an event row. */
/* The photo of an event, whole: upright by default, .wide for the landscape ones. */
.peek { position: fixed; left: 0; top: 0; z-index: 25; width: 246px; aspect-ratio: 3 / 4; border-radius: 16px; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.22); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.8); pointer-events: none; opacity: 0; transition: opacity 0.25s ease; will-change: transform; }
.peek.wide { width: 320px; aspect-ratio: 4 / 3; }
.peek.on { opacity: 1; }
.peek img { width: 100%; height: 100%; object-fit: cover; }
.era li[data-peek] a::after { content: " ●"; font-size: 0.5em; vertical-align: middle; color: var(--teal); }

/* Closing wordmark: the full name on two lines, always as wide as the page. */
.mega {
	padding: clamp(30px, 8vh, 90px) max(var(--gut), env(safe-area-inset-right, 0px)) clamp(10px, 3vh, 30px) max(var(--gut), env(safe-area-inset-left, 0px));
	font-size: 11vw;
	font-family: var(--sans);
	font-stretch: 116%;
	letter-spacing: -0.05em;
	line-height: 0.86;
	text-transform: uppercase;
	overflow: hidden;
}
.mega span { display: block; width: max-content; white-space: nowrap; }
.mega span:first-child { font-weight: 300; color: var(--strong); }
.mega span:last-child { font-weight: 850; }
.mega i { display: inline-block; font-style: normal; }
/* one gradient running across the letters of the surname */
.mega span:last-child i { background: var(--grad); background-size: 1100% 100%; background-position: var(--p, 0%) 0; -webkit-background-clip: text; background-clip: text; color: transparent; }

html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

/* --------------------------------------------------------------- narrow */

@media (max-width: 860px) {
	.nav nav { display: none; }
	.mark-name { display: none; }

	.hero { grid-template-columns: minmax(0, 1fr); align-content: start; gap: 1rem; padding-top: 96px; }
	.hero .slot { height: 54vh; }
	.hint { display: none; }

	.about { grid-template-columns: minmax(0, 1fr); }
	.facts { grid-template-columns: minmax(0, 1fr); gap: 1.1rem; }

	.road-grid, .apps-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
	.road .slot, .apps .slot {
		order: -1;
		top: 58px;
		height: 52vh; /* more room for the phone and the city, less for the text under them */
		z-index: 5;
		margin-inline: calc(-1 * var(--gut));
		background: linear-gradient(var(--bg) 93%, rgba(7, 11, 22, 0));
	}
	.step { min-height: 50vh; }

	.stack-pin { grid-template-columns: minmax(0, 1fr); grid-template-rows: 38vh auto; align-items: start; align-content: start; gap: 0.5rem; padding-top: 62px; padding-bottom: 12px; }
	.stack .slot { order: -1; height: 100%; }
	.stack-copy { gap: 0.5rem; }
	.stack-copy .eyebrow { display: none; }
	.stack-copy h2 { font-size: 1.8rem; }
	.layers > li { padding: 0.45rem 0; gap: 0.3rem; }
	.layers p { font-size: 0.88rem; }

	.talk, .talk.flip { grid-template-columns: minmax(0, 1fr); }
	.talk .slot { height: 58vh; }
	.sky { left: 0; right: 0; height: 60%; }
	/* city and coordinates on one line across the top, above the phone: large, and never under it */
	.sky-label { left: 14px; top: 8px; display: flex; align-items: baseline; gap: 0.65rem; white-space: nowrap; }
	.sky-label b { font-size: clamp(1.3rem, 5.8vw, 1.9rem); }
	.sky-label span { font-size: clamp(0.72rem, 3vw, 0.9rem); letter-spacing: 0.12em; }
	/* under the phone, on its own dark pill: it stays readable over the skyline too */
	.tap { top: auto; bottom: 0.35rem; padding: 0.4rem 0.8rem; border-radius: 999px; background: rgba(7, 11, 22, 0.82); }
	.talk:not(.flip) figure { max-height: 62vh; }
	.events { grid-template-columns: minmax(0, 1fr); }

	.tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.tiles a > span { font-size: 0.92rem; }

	.contact { grid-template-columns: minmax(0, 1fr); min-height: 0; }
	.contact .slot { height: 50vh; }
}

@media (max-width: 860px) and (max-height: 720px) {
	.road .slot, .apps .slot { height: 46vh; }
	.sky-label { top: 5px; }
	.sky-label b { font-size: 1.1rem; }
	.stack-pin { grid-template-rows: 34vh auto; }
	.layers.focus > li.on p { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	.hero-copy > *, .display i, .aurora, .hint::before, .veh, .tap::before, .sky-label.pop, .cities-track { animation: none; }
	.sky-strip { transition: none; }
	.veh.bike { left: 7%; }
	.veh.climb { left: 4%; }
	.step, .layers > li, .tiles img, .btn { transition: none; }
}
