/*
Theme Name: Ustaz Gallery
Author: Ismail Osama
Description: Single-page portfolio set like a dark gallery room. Reels, Projects, Clients and contact details are all edited from the dashboard.
Version: 1.2.0
Requires at least: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: ustaz-gallery
*/

/* ------------------------------------------------------------
   Tokens
   ------------------------------------------------------------ */
@font-face {
	font-family: "Plex Arabic";
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url("assets/fonts/ibm-plex-sans-arabic-400.woff2") format("woff2");
	unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFC;
}

:root {
	--bg: #0b0b0c;
	--wall: #111112;
	--ink: #ece7df;
	--ink-2: #b9b3a9;
	--muted: #8a857d;
	--faint: #57534e;
	--line: rgba(236, 231, 223, 0.1);
	--line-2: rgba(236, 231, 223, 0.18);
	--glass: rgba(24, 23, 22, 0.42);
	--glass-hi: rgba(255, 250, 240, 0.045);
	--blur: 18px;
	--light: 255, 241, 222;

	--serif: "Cormorant", "Cormorant Garamond", Garamond, "Times New Roman", serif;
	--sans: "Hanken Grotesk", "Plex Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;

	--gutter: clamp(16px, 4.4vw, 72px);
	--max: 1680px;
	--radius: 14px;
	--ease: cubic-bezier(0.22, 0.61, 0.36, 1);
	--ease-out: cubic-bezier(0.16, 1, 0.3, 1);

	--p: 0; /* scroll progress, set by JS */
}

/* ------------------------------------------------------------
   Base
   ------------------------------------------------------------ */
*,
*::before,
*::after { box-sizing: border-box; }

html {
	overflow-x: hidden;
	overflow-x: clip;
	scroll-behavior: smooth;
	scroll-padding-top: 84px;
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--sans);
	font-weight: 400;
	font-size: 16px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow-x: hidden;
}

/* A whisper of grain so gradients don't band on large screens */
body::after {
	content: "";
	position: fixed;
	inset: 0;
	z-index: 100;
	pointer-events: none;
	opacity: 0.05;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
	mix-blend-mode: overlay;
}

img,
video,
iframe { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

button {
	font: inherit;
	color: inherit;
	background: none;
	border: 0;
	padding: 0;
	cursor: pointer;
}

ul { list-style: none; margin: 0; padding: 0; }

h1, h2, h3, p, figure, dl, dd { margin: 0; }

:focus-visible {
	outline: 1px solid rgba(var(--light), 0.7);
	outline-offset: 4px;
	border-radius: 4px;
}

::selection { background: rgba(var(--light), 0.22); }

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

.eyebrow {
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--muted);
}

.glass {
	background: linear-gradient(180deg, var(--glass-hi), transparent 60%), var(--glass);
	-webkit-backdrop-filter: blur(var(--blur)) saturate(1.1);
	backdrop-filter: blur(var(--blur)) saturate(1.1);
	border: 1px solid var(--line);
	border-radius: var(--radius);
}

/* ------------------------------------------------------------
   Ambient wall light (moves slowly with scroll)
   ------------------------------------------------------------ */
.ambient {
	position: fixed;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	overflow: hidden;
}

.wash {
	position: absolute;
	border-radius: 50%;
	filter: blur(40px);
	will-change: transform, opacity;
}

/* Ceiling spot washing down the left wall */
.wash--a {
	width: 70vw;
	height: 120vh;
	left: -18vw;
	top: -40vh;
	background: radial-gradient(closest-side, rgba(var(--light), 0.075), rgba(var(--light), 0.02) 55%, transparent);
	transform: translate3d(calc(var(--p) * 22vw), calc(var(--p) * 30vh), 0);
}

/* Cooler bounce on the right */
.wash--b {
	width: 60vw;
	height: 100vh;
	right: -20vw;
	top: 20vh;
	background: radial-gradient(closest-side, rgba(200, 212, 230, 0.045), transparent 70%);
	transform: translate3d(calc(var(--p) * -18vw), calc(var(--p) * -24vh), 0);
}

/* Floor light that warms as you walk deeper */
.wash--c {
	width: 90vw;
	height: 60vh;
	left: 5vw;
	bottom: -38vh;
	background: radial-gradient(closest-side, rgba(var(--light), 0.05), transparent 70%);
	opacity: calc(0.3 + var(--p) * 0.7);
}

main,
.contact { position: relative; z-index: 1; }

/* ------------------------------------------------------------
   Navigation
   ------------------------------------------------------------ */
.nav {
	position: fixed;
	z-index: 50;
	top: 14px;
	left: 50%;
	transform: translateX(-50%);
	width: min(calc(100% - 2 * var(--gutter)), var(--max));
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	padding: 10px 12px 10px 22px;
	border: 1px solid transparent;
	border-radius: 999px;
	transition: background-color 0.6s var(--ease), border-color 0.6s var(--ease), -webkit-backdrop-filter 0.6s, backdrop-filter 0.6s;
}

.nav.is-solid {
	background: rgba(16, 15, 14, 0.5);
	-webkit-backdrop-filter: blur(20px) saturate(1.15);
	backdrop-filter: blur(20px) saturate(1.15);
	border-color: var(--line);
}

.nav__mark {
	font-family: var(--serif);
	font-size: 21px;
	font-weight: 400;
	letter-spacing: 0.01em;
	white-space: nowrap;
}

.nav__links {
	display: flex;
	align-items: center;
	gap: 4px;
}

.nav__links a {
	font-size: 12.5px;
	letter-spacing: 0.06em;
	color: var(--ink-2);
	padding: 8px 12px;
	border-radius: 999px;
	transition: color 0.3s, background-color 0.3s;
}

.nav__links a:hover,
.nav__links a.is-active { color: var(--ink); }

.nav__links a.is-active { background: rgba(255, 250, 240, 0.06); }

.nav__links .nav__cta {
	margin-left: 8px;
	color: var(--ink);
	border: 1px solid var(--line-2);
	padding: 8px 16px;
}

.nav__links .nav__cta:hover { background: rgba(255, 250, 240, 0.08); }

.nav__toggle { display: none; }

@media (max-width: 1080px) {
	.nav { padding: 8px 8px 8px 20px; }

	.nav__toggle {
		display: grid;
		place-content: center;
		gap: 6px;
		width: 42px;
		height: 42px;
		border-radius: 50%;
		border: 1px solid var(--line-2);
	}

	.nav__toggle span:not(.screen-reader-text) {
		display: block;
		width: 16px;
		height: 1px;
		background: var(--ink);
		transition: transform 0.4s var(--ease);
	}

	.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(3.5px) rotate(45deg); }
	.nav__toggle[aria-expanded="true"] span:nth-child(2) { transform: translateY(-3.5px) rotate(-45deg); }

	.nav__links {
		position: absolute;
		top: calc(100% + 10px);
		right: 0;
		left: 0;
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		padding: 10px;
		background: rgba(16, 15, 14, 0.72);
		-webkit-backdrop-filter: blur(22px);
		backdrop-filter: blur(22px);
		border: 1px solid var(--line);
		border-radius: 22px;
		opacity: 0;
		visibility: hidden;
		transform: translateY(-6px);
		transition: opacity 0.35s var(--ease), transform 0.35s var(--ease), visibility 0.35s;
	}

	.nav.is-open .nav__links { opacity: 1; visibility: visible; transform: none; }
	.nav.is-open { background: rgba(16, 15, 14, 0.6); border-color: var(--line); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }

	.nav__links a { font-size: 15px; padding: 13px 16px; border-radius: 14px; }
	.nav__links .nav__cta { margin: 6px 0 0; text-align: center; }
}

/* ------------------------------------------------------------
   Hero
   ------------------------------------------------------------ */
.hero {
	position: relative;
	z-index: 1;
	min-height: 100vh;
	min-height: 100svh;
	display: flex;
	align-items: flex-end;
	overflow: hidden;
	isolation: isolate;
}

.hero__photo {
	position: absolute;
	inset: -4% 0 0;
	z-index: -2;
	will-change: transform;
}

.hero__photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center 30%;
	filter: saturate(0.78) contrast(1.08) brightness(0.8);
	/* visible from the first paint (it's the LCP image); only a slow settle */
	transform: scale(1.04);
	transition: transform 3.2s var(--ease-out);
}

.is-ready .hero__photo img { transform: scale(1); }

/* Vignette, fade into the room, and the spotlight from above */
.hero::before,
.hero::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
}

.hero::before {
	z-index: -1;
	background:
		radial-gradient(120% 90% at 50% 38%, transparent 38%, rgba(5, 5, 6, 0.55) 72%, rgba(5, 5, 6, 0.92) 100%),
		linear-gradient(180deg, rgba(11, 11, 12, 0.55) 0%, transparent 22%, transparent 48%, rgba(11, 11, 12, 0.7) 76%, var(--bg) 97%);
}

.hero__light {
	position: absolute;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background:
		radial-gradient(34% 46% at 54% 14%, rgba(var(--light), 0.2), rgba(var(--light), 0.06) 55%, transparent 75%),
		conic-gradient(from 180deg at 54% -8%, transparent 168deg, rgba(var(--light), 0.07) 180deg, transparent 192deg);
	mix-blend-mode: soft-light;
	opacity: 0;
	transition: opacity 2.4s var(--ease) 0.4s;
}

.is-ready .hero__light { opacity: 1; }

/* Portrait photo: hung as a full-height piece in the middle of the wall,
   its edges dissolving into the room. */
.hero--portrait .hero__photo img {
	filter: saturate(0.9) contrast(1.04) brightness(0.92);
}

@media (min-width: 861px) {
	.hero--portrait .hero__photo {
		inset: 0 auto 0 50%;
		width: min(100vw, calc(100vh * 0.805 * 1.12));
		width: min(100vw, calc(100svh * 0.805 * 1.12));
		margin-left: calc(min(100vw, calc(100svh * 0.805 * 1.12)) / -2);
		-webkit-mask-image:
			linear-gradient(90deg, transparent 0%, #000 22%, #000 78%, transparent 100%),
			linear-gradient(180deg, #000 0%, #000 62%, transparent 96%);
		-webkit-mask-composite: source-in;
		mask-image:
			linear-gradient(90deg, transparent 0%, #000 22%, #000 78%, transparent 100%),
			linear-gradient(180deg, #000 0%, #000 62%, transparent 96%);
		mask-composite: intersect;
	}

	.hero--portrait .hero__photo img { object-position: center 20%; }

	/* the photo brings its own spotlight; keep ours as a faint haze */
	.hero--portrait .hero__light { opacity: 0.5; }
	.is-ready .hero--portrait .hero__light { opacity: 0.5; }
}

@media (max-width: 860px) {
	/* Phone: photo fills the top of the screen, words start below the face */
	.hero--portrait { display: block; min-height: 0; }

	.hero--portrait .hero__photo {
		inset: 0 0 auto;
		height: 84vh;
		height: 84svh;
		-webkit-mask-image: linear-gradient(180deg, #000 55%, transparent 100%);
		mask-image: linear-gradient(180deg, #000 55%, transparent 100%);
	}

	.hero--portrait .hero__photo img { object-position: center 16%; }

	.hero--portrait .hero__inner { padding-top: 58vh; padding-top: 58svh; padding-bottom: 40px; }

	.hero--portrait::before {
		background:
			linear-gradient(180deg, rgba(11, 11, 12, 0.5) 0%, transparent 16%, transparent 44%, rgba(11, 11, 12, 0.85) 66%, var(--bg) 84%);
	}
}

/* No photo yet: the empty wall still gets its spotlight */
.hero--nophoto .hero__light {
	mix-blend-mode: normal;
	background:
		radial-gradient(30% 52% at 50% 0%, rgba(var(--light), 0.13), rgba(var(--light), 0.035) 60%, transparent 80%),
		radial-gradient(60% 40% at 50% 100%, rgba(var(--light), 0.04), transparent 70%);
}

.hero__inner {
	width: min(100% - 2 * var(--gutter), var(--max));
	margin: 0 auto;
	padding-bottom: clamp(72px, 12vh, 132px);
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 360px);
	align-items: end;
	gap: 48px;
}

.hero__id > * {
	transform: translateY(14px);
	transition: opacity 1.2s var(--ease), transform 1.4s var(--ease-out);
}

/* the name paints immediately (LCP candidate); the smaller lines fade in */
.hero__id > :not(.hero__name) { opacity: 0; }

.is-ready .hero__id > * { opacity: 1; transform: none; }
.is-ready .hero__id > :nth-child(2) { transition-delay: 0.1s; }
.is-ready .hero__id > :nth-child(3) { transition-delay: 0.25s; }
.is-ready .hero__id > :nth-child(4) { transition-delay: 0.4s; }

.hero__name {
	font-family: var(--serif);
	font-weight: 300;
	font-size: clamp(58px, 10.5vw, 176px);
	line-height: 0.88;
	letter-spacing: -0.02em;
	margin: 18px 0 22px -0.04em;
}

.hero__title {
	font-family: var(--sans);
	font-weight: 400;
	font-size: clamp(16px, 1.3vw, 19px);
	letter-spacing: 0.01em;
	color: var(--ink);
	opacity: 0.86;
	line-height: 1.45;
	max-width: 36ch;
}

.is-ready .hero__id > .hero__title { opacity: 0.86; }

.hero__stat {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 4px 12px;
	margin-top: 22px;
	padding-top: 18px;
	border-top: 1px solid var(--line-2);
	max-width: 360px;
}

.hero__stat strong {
	font-family: var(--serif);
	font-weight: 400;
	font-size: clamp(34px, 3vw, 46px);
	line-height: 1;
	letter-spacing: -0.01em;
	color: var(--ink);
}

.hero__stat span {
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--ink-2);
}

.placard {
	padding: 22px 24px;
	font-size: 13.5px;
	line-height: 1.7;
	color: var(--ink-2);
	opacity: 0;
	transition: opacity 1.4s var(--ease) 0.6s;
}

.is-ready .placard { opacity: 1; }

.placard__tools {
	margin-top: 14px;
	padding-top: 14px;
	border-top: 1px solid var(--line);
	font-size: 10.5px;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--muted);
}

.hero__cue {
	position: absolute;
	left: 50%;
	bottom: 22px;
	transform: translateX(-50%);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	font-size: 10px;
	letter-spacing: 0.3em;
	text-transform: uppercase;
	color: var(--muted);
}

.hero__cue::after {
	content: "";
	width: 1px;
	height: 38px;
	background: linear-gradient(var(--muted), transparent);
	animation: cue 2.8s var(--ease) infinite;
	transform-origin: top;
}

@keyframes cue {
	0% { transform: scaleY(0); opacity: 1; }
	60% { transform: scaleY(1); opacity: 1; }
	100% { transform: scaleY(1); opacity: 0; }
}

@media (max-width: 860px) {
	.hero { align-items: flex-end; }
	.hero__photo { inset: 0 0 18%; }
	.hero__inner { grid-template-columns: 1fr; gap: 28px; padding-bottom: 86px; }
	.placard { font-size: 13px; padding: 18px 20px; }
	.hero__cue { display: none; }
}

/* ------------------------------------------------------------
   Rooms (sections)
   ------------------------------------------------------------ */
.room {
	width: min(100% - 2 * var(--gutter), var(--max));
	margin: 0 auto;
	padding: clamp(80px, 13vh, 168px) 0 0;
}

.room__head {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: end;
	column-gap: 22px;
	row-gap: 10px;
	padding-bottom: 22px;
	margin-bottom: clamp(28px, 4vw, 48px);
	border-bottom: 1px solid var(--line);
}

.room__num {
	font-size: 11px;
	letter-spacing: 0.2em;
	color: var(--muted);
	padding-bottom: 0.9em;
	font-variant-numeric: tabular-nums;
}

.room__title {
	font-family: var(--serif);
	font-weight: 300;
	font-size: clamp(40px, 5.6vw, 84px);
	line-height: 0.95;
	letter-spacing: -0.015em;
}

.room__lede,
.room__count {
	grid-column: 2 / 3;
	font-size: 14px;
	color: var(--muted);
	max-width: 46ch;
}

.room__count {
	grid-column: 3 / 4;
	grid-row: 1;
	padding-bottom: 0.6em;
	font-size: 11px;
	letter-spacing: 0.2em;
	text-transform: uppercase;
}

.room__ctrls {
	grid-column: 3 / 4;
	grid-row: 1 / 3;
	display: flex;
	gap: 8px;
	align-self: end;
}

.ctrl {
	display: grid;
	place-items: center;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	border: 1px solid var(--line-2);
	background: rgba(20, 19, 18, 0.35);
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
	color: var(--ink);
	transition: background-color 0.3s, border-color 0.3s, opacity 0.3s;
}

.ctrl:hover { background: rgba(255, 250, 240, 0.08); border-color: rgba(236, 231, 223, 0.32); }
.ctrl:disabled { opacity: 0.3; cursor: default; }
.ctrl .icon { width: 18px; height: 18px; }

.empty-hint {
	padding: 40px;
	border: 1px dashed var(--line-2);
	border-radius: var(--radius);
	color: var(--muted);
	font-size: 14px;
	text-align: center;
}

.empty-hint a { color: var(--ink); border-bottom: 1px solid var(--line-2); }

@media (max-width: 700px) {
	.room__head { grid-template-columns: minmax(0, 1fr) auto; }
	.room__num { grid-column: 1 / -1; padding: 0; }
	.room__title { grid-column: 1 / 2; }
	.room__lede { grid-column: 1 / -1; }
	.room__count { grid-column: 2 / 3; grid-row: 2; }
	.room__ctrls { grid-column: 2 / 3; grid-row: 2; }
	.ctrl { width: 40px; height: 40px; }
}

/* Reveal on enter */
[data-room] .room__head,
[data-room] .reels,
[data-room] .strip,
[data-room] .grid,
[data-room] .logos,
.contact__panel {
	opacity: 0;
	transform: translateY(24px);
	transition: opacity 1.1s var(--ease), transform 1.3s var(--ease-out);
}

[data-room].is-in .room__head,
[data-room].is-in .reels,
[data-room].is-in .strip,
[data-room].is-in .grid,
[data-room].is-in .logos,
.contact.is-in .contact__panel { opacity: 1; transform: none; }

[data-room].is-in .reels,
[data-room].is-in .strip,
[data-room].is-in .grid,
[data-room].is-in .logos { transition-delay: 0.12s; }


/* ------------------------------------------------------------
   Reels — frames hanging in a 3D room
   ------------------------------------------------------------ */
.room--reels { padding-top: clamp(64px, 10vh, 120px); }

.reels {
	--rw: clamp(200px, min(22vw, 34vh), 320px);
	position: relative;
	/* full-bleed wall, clipped at the screen edges */
	width: 100vw;
	margin-left: calc(50% - 50vw);
	padding-top: 12px;
	overflow: hidden;
	overflow: clip;
	outline: none;
	user-select: none;
	-webkit-user-select: none;
}

.reels__stage {
	position: relative;
	height: calc(var(--rw) * 16 / 9 + 96px);
	perspective: 1600px;
	perspective-origin: 50% 42%;
	touch-action: pan-y;
	cursor: grab;
}

.reels__stage.is-dragging { cursor: grabbing; }

/* Soft floor shadow under the centre frame */
.reels__stage::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: 28px;
	width: calc(var(--rw) * 1.5);
	height: 38px;
	transform: translateX(-50%);
	background: radial-gradient(closest-side, rgba(0, 0, 0, 0.65), transparent);
	filter: blur(6px);
	pointer-events: none;
}

.reel {
	position: absolute;
	top: 0;
	left: 50%;
	width: var(--rw);
	margin-left: calc(var(--rw) / -2);
	transform-style: preserve-3d;
	will-change: transform, opacity;
	backface-visibility: hidden;
}

.reel__frame {
	position: relative;
	aspect-ratio: 9 / 16;
	border-radius: 18px;
	overflow: hidden;
	background: #161515;
	border: 1px solid var(--line);
	box-shadow:
		0 1px 0 rgba(255, 250, 240, 0.06) inset,
		0 30px 60px -18px rgba(0, 0, 0, 0.85),
		0 12px 24px -12px rgba(0, 0, 0, 0.6);
	transform: translateZ(0);
}

/* Each frame darkens as it turns away from the light */
.reel__frame::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	background: linear-gradient(180deg, rgba(var(--light), 0.06), transparent 30%), rgba(8, 8, 9, var(--shade, 0));
	pointer-events: none;
	transition: background-color 0.2s;
}

.reel__poster,
.reel__video,
.reel__frame iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border: 0;
	pointer-events: none;
}

.reel__video,
.reel__frame iframe { opacity: 0; transition: opacity 0.6s var(--ease); }
.reel.is-playing .reel__video,
.reel.is-playing iframe { opacity: 1; }

/* Horizontal sources cropped to fill the vertical frame */
.reel--horizontal .reel__frame iframe {
	max-width: none;
	width: calc(100% * 3.17);
	left: 50%;
	transform: translateX(-50%);
}

.reel__sound {
	position: absolute;
	right: 12px;
	bottom: 12px;
	z-index: 2;
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: rgba(12, 12, 12, 0.45);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	border: 1px solid var(--line);
	opacity: 0;
	transition: opacity 0.4s;
}

.reel__sound .icon { width: 16px; height: 16px; grid-area: 1 / 1; }
.reel__sound .icon + .icon,
.reel.has-sound .reel__sound .icon:first-child { opacity: 0; }
.reel.has-sound .reel__sound .icon + .icon { opacity: 1; }
.reel.is-active .reel__sound { opacity: 1; }

.reel__cap {
	padding: 18px 4px 0;
	text-align: center;
	opacity: 0;
	transform: translateY(6px);
	transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}

.reel.is-active .reel__cap { opacity: 1; transform: none; }

.reel__title {
	display: block;
	font-family: var(--serif);
	font-size: 22px;
	line-height: 1.2;
}

.reel__meta {
	display: block;
	margin-top: 4px;
	font-size: 11px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--muted);
}

.reels__ui {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 22px;
	margin-top: 8px;
}

.reels__count {
	font-size: 12px;
	letter-spacing: 0.2em;
	color: var(--muted);
	font-variant-numeric: tabular-nums;
	min-width: 72px;
	text-align: center;
}

.reels__count span { color: var(--ink); }
.reels__count i { font-style: normal; margin: 0 4px; color: var(--faint); }

.reels__hint {
	margin-top: 14px;
	text-align: center;
	font-size: 11.5px;
	color: var(--faint);
	letter-spacing: 0.04em;
}

@media (max-width: 700px) {
	.reels { --rw: min(60vw, 40vh, 300px); }
	.reels__hint { display: none; }
}

/* Featured: the same 3D slider with widescreen cards */
.reels--featured { --fw: min(78vw, 640px); }
.reels--featured .reel { width: var(--fw); margin-left: calc(var(--fw) / -2); }
.reels--featured .reel__frame { aspect-ratio: 16 / 9; }
.reels--featured .reels__stage { height: calc(var(--fw) * 0.5625 + 96px); }

/* Instagram cards: open the post on Instagram */
.reel--ig .reel__ig {
	position: absolute;
	inset: 0;
	z-index: 3;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	padding: 14px 10px;
	color: #fff;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0) 40%);
}

.reel--ig:not(.is-active) .reel__ig { pointer-events: none; }

.reel--ig .reel__badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 13px;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.5);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	font-size: 10px;
	line-height: 1;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	white-space: nowrap;
	opacity: 0;
	transform: translateY(6px);
	transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s ease, color 0.2s ease;
}

.reel--ig.is-active .reel__badge { opacity: 1; transform: none; }
.reel--ig .reel__badge svg { width: 10px; height: 10px; fill: currentColor; flex: none; }
.reel--ig .reel__ig:hover .reel__badge,
.reel--ig .reel__ig:focus-visible .reel__badge { background: rgba(255, 255, 255, 0.92); color: #111; }
.reel--ig .reel__title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Google Drive videos: show Drive's own player, scaled to fit the frame */
.reel[data-video-type="drive"] .reel__frame iframe {
	pointer-events: auto;
	position: absolute;
	top: 0;
	left: 0;
	width: 160%;
	height: 160%;
	max-width: none;
	transform: scale(0.625);
	transform-origin: 0 0;
	border: 0;
}

.reel[data-video-type="drive"]:not(.is-active) .reel__frame iframe { pointer-events: none; }
.reel[data-video-type="drive"] .reel__sound,
.reel--ig .reel__sound { display: none; }

/* Hero About panel: bold names and a stats row */
.placard p strong { font-weight: 600; color: #fff; }

.placard__stats {
	display: flex;
	flex-wrap: wrap;
	gap: 14px 22px;
	margin: 16px 0 4px;
	padding: 0;
	list-style: none;
}

.placard__stats li { display: flex; flex-direction: column; gap: 4px; }

.placard__stats strong {
	font-family: var(--serif);
	font-size: 26px;
	font-weight: 400;
	line-height: 1;
	color: #fff;
}

.placard__stats span {
	font-size: 9.5px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	opacity: 0.6;
}

/* ------------------------------------------------------------
   Tiles (16:9) — strips and grid
   ------------------------------------------------------------ */
.tile__inner {
	display: block;
	width: 100%;
	text-align: left;
}

.tile__frame {
	position: relative;
	display: block;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: 10px;
	background: #151414;
	border: 1px solid var(--line);
	box-shadow: 0 24px 48px -28px rgba(0, 0, 0, 0.9);
}

.tile__frame img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	filter: saturate(0.88) brightness(0.86);
	transform: scale(1.001);
	transition: transform 1.2s var(--ease-out), filter 0.8s var(--ease);
}

.tile__frame::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	box-shadow: inset 0 1px 0 rgba(255, 250, 240, 0.07);
	background: linear-gradient(180deg, rgba(var(--light), 0.05), transparent 40%);
	pointer-events: none;
}

.frame-empty { position: absolute; inset: 0; background: linear-gradient(135deg, #1a1918, #0f0f0f); }

.tile__play {
	position: absolute;
	left: 50%;
	top: 50%;
	z-index: 1;
	width: 54px;
	height: 54px;
	margin: -27px 0 0 -27px;
	border-radius: 50%;
	background: rgba(14, 14, 14, 0.35);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	border: 1px solid rgba(236, 231, 223, 0.28);
	opacity: 0;
	transform: scale(0.9);
	transition: opacity 0.4s var(--ease), transform 0.5s var(--ease);
}

.tile__play::before {
	content: "";
	position: absolute;
	left: 22px;
	top: 19px;
	border-left: 12px solid var(--ink);
	border-top: 8px solid transparent;
	border-bottom: 8px solid transparent;
}

.tile__inner:hover .tile__frame img,
.tile__inner:focus-visible .tile__frame img { transform: scale(1.035); filter: saturate(1) brightness(1); }

.tile__inner:hover .tile__play,
.tile__inner:focus-visible .tile__play { opacity: 1; transform: none; }

.tile__label { display: block; padding: 16px 2px 0; }

.tile__title {
	display: block;
	font-family: var(--serif);
	font-size: 23px;
	line-height: 1.18;
	color: var(--ink);
}

.tile__meta {
	display: block;
	margin-top: 6px;
	font-size: 10.5px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--muted);
}

/* Horizontal gallery walls */
.strip {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: clamp(260px, 30.4%, 520px);
	gap: clamp(18px, 2.2vw, 32px);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-padding-inline: 0;
	overscroll-behavior-x: contain;
	padding-bottom: 8px;
	margin-right: calc(-1 * var(--gutter));
	padding-right: var(--gutter);
	scrollbar-width: none;
	cursor: grab;
}

.strip::-webkit-scrollbar { display: none; }
.strip.is-dragging { cursor: grabbing; scroll-snap-type: none; }
.strip.is-dragging .tile__inner { pointer-events: none; }
.strip > .tile { scroll-snap-align: start; }

@media (max-width: 1100px) { .strip { grid-auto-columns: clamp(240px, 46%, 480px); } }
@media (max-width: 700px)  { .strip { grid-auto-columns: 82%; } .tile__title { font-size: 21px; } }

/* All Work grid: 5 / 3 / 2 */
.grid {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: clamp(22px, 2.2vw, 36px) clamp(14px, 1.4vw, 22px);
}

.tile--grid .tile__frame { border-radius: 8px; }
.tile--grid .tile__label { padding-top: 12px; }
.tile--grid .tile__title { font-size: 18px; }
.tile--grid .tile__meta { font-size: 9.5px; margin-top: 4px; }
.tile--grid .tile__play { width: 42px; height: 42px; margin: -21px 0 0 -21px; }
.tile--grid .tile__play::before { left: 17px; top: 14px; border-left-width: 10px; border-top-width: 7px; border-bottom-width: 7px; }

@media (max-width: 1100px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px)  { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tile--grid .tile__title { font-size: 16px; } }

/* ------------------------------------------------------------
   Colour — before / after
   ------------------------------------------------------------ */
.grade { max-width: min(1280px, calc(74vh * 16 / 9)); margin: 0 auto; }

.grade__slide[hidden] { display: none; }
.grade__slide.is-active { animation: grade-in 0.7s var(--ease); }

@keyframes grade-in { from { opacity: 0; } to { opacity: 1; } }

.grade__frame {
	--pos: 50%;
	position: relative;
	overflow: hidden;
	border-radius: 12px;
	background: #121111;
	border: 1px solid var(--line);
	box-shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.95);
	cursor: ew-resize;
	touch-action: pan-y;
	user-select: none;
	-webkit-user-select: none;
}

.grade__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	pointer-events: none;
}

.grade__before {
	position: absolute;
	inset: 0;
	clip-path: inset(0 calc(100% - var(--pos)) 0 0);
}

.grade__tag {
	position: absolute;
	top: 14px;
	z-index: 2;
	padding: 6px 12px;
	border-radius: 999px;
	font-size: 10.5px;
	font-weight: 500;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--ink);
	background: rgba(12, 12, 12, 0.42);
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
	border: 1px solid var(--line);
	pointer-events: none;
	transition: opacity 0.3s;
}

.grade__tag--before { left: 14px; }
.grade__tag--after { right: 14px; }

/* hide a label when the divider covers it */
.grade__frame.is-near-left .grade__tag--before,
.grade__frame.is-near-right .grade__tag--after { opacity: 0; }

.grade__handle {
	position: absolute;
	top: 0;
	bottom: 0;
	left: var(--pos);
	z-index: 3;
	width: 1px;
	margin-left: -0.5px;
	background: rgba(var(--light), 0.85);
	box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.3), 0 0 18px rgba(0, 0, 0, 0.45);
	pointer-events: none;
}

.grade__knob {
	position: absolute;
	top: 50%;
	left: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	margin: -26px 0 0 -26px;
	border-radius: 50%;
	background: rgba(14, 14, 14, 0.4);
	-webkit-backdrop-filter: blur(14px);
	backdrop-filter: blur(14px);
	border: 1px solid rgba(236, 231, 223, 0.45);
	color: var(--ink);
	transition: transform 0.3s var(--ease);
}

.grade__knob .icon { width: 14px; height: 14px; margin: 0 -1px; }
.grade__frame:hover .grade__knob,
.grade__frame.is-dragging .grade__knob { transform: scale(1.08); }

/* keyboard control: the range is invisible but focusable */
.grade__range {
	position: absolute;
	inset: 0;
	z-index: 4;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	pointer-events: none;
	-webkit-appearance: none;
	appearance: none;
}

.grade__range:focus-visible + .grade__handle .grade__knob {
	outline: 1px solid rgba(var(--light), 0.8);
	outline-offset: 4px;
}

.grade__cap {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 6px 18px;
	padding-top: 18px;
}

.grade__title { font-family: var(--serif); font-size: 24px; line-height: 1.2; }

.grade__meta {
	font-size: 10.5px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--muted);
}

.grade__thumbs {
	display: flex;
	gap: 10px;
	margin-top: 22px;
	overflow-x: auto;
	scrollbar-width: none;
	padding-bottom: 4px;
}

.grade__thumbs::-webkit-scrollbar { display: none; }

.grade__thumb {
	flex: 0 0 auto;
	width: 116px;
	aspect-ratio: 16 / 9;
	border-radius: 6px;
	overflow: hidden;
	border: 1px solid var(--line);
	opacity: 0.5;
	transition: opacity 0.3s, border-color 0.3s;
}

.grade__thumb img { width: 100%; height: 100%; object-fit: cover; }
.grade__thumb:hover { opacity: 0.85; }
.grade__thumb[aria-selected="true"] { opacity: 1; border-color: rgba(236, 231, 223, 0.6); }

[data-room] .grade {
	opacity: 0;
	transform: translateY(24px);
	transition: opacity 1.1s var(--ease) 0.12s, transform 1.3s var(--ease-out) 0.12s;
}

[data-room].is-in .grade { opacity: 1; transform: none; }

@media (max-width: 700px) {
	.grade__knob { width: 44px; height: 44px; margin: -22px 0 0 -22px; }
	.grade__tag { top: 10px; padding: 5px 10px; font-size: 9.5px; }
	.grade__tag--before { left: 10px; }
	.grade__tag--after { right: 10px; }
	.grade__title { font-size: 21px; }
	.grade__thumb { width: 96px; }
}

/* ------------------------------------------------------------
   Trusted clients
   ------------------------------------------------------------ */
.logos {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	padding: clamp(16px, 2.4vw, 32px);
}

.logo { flex: 0 0 12.5%; min-width: 0; }

.logo__inner {
	display: grid;
	place-items: center;
	height: 116px;
	padding: 16px 18px;
}

.logo img {
	height: 44px;
	width: auto;
	max-width: 100%;
	object-fit: contain;
	filter: grayscale(1) brightness(0) invert(0.92);
	opacity: 0.5;
	transition: opacity 0.4s var(--ease);
}

.logo__word {
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	text-align: center;
	line-height: 1.5;
	color: var(--ink);
	opacity: 0.5;
	transition: opacity 0.4s var(--ease);
}

.logo:hover img,
.logo:hover .logo__word { opacity: 0.95; }

@media (max-width: 1280px) { .logo { flex-basis: 25%; } }
@media (max-width: 700px) {
	.logo { flex-basis: 50%; }
	.logo__inner { height: 92px; padding: 12px 14px; }
	.logo img { height: 34px; }
}

/* ------------------------------------------------------------
   Contact
   ------------------------------------------------------------ */
.contact {
	width: min(100% - 2 * var(--gutter), var(--max));
	margin: 0 auto;
	padding: clamp(96px, 16vh, 200px) 0 28px;
}

.contact__panel {
	padding: clamp(36px, 6vw, 88px);
	display: grid;
	grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
	column-gap: 48px;
	align-items: end;
}

.contact__panel .eyebrow { grid-column: 1 / -1; margin-bottom: 18px; }

.contact__line {
	font-family: var(--serif);
	font-weight: 300;
	font-size: clamp(46px, 7vw, 116px);
	line-height: 0.95;
	letter-spacing: -0.02em;
}

.contact__sub {
	grid-column: 1 / 2;
	margin-top: 22px;
	color: var(--muted);
	font-size: 15px;
	max-width: 40ch;
}

.contact__list {
	grid-column: 2 / 3;
	grid-row: 2 / 4;
	align-self: end;
	display: grid;
	gap: 20px;
}

.contact__list div { border-top: 1px solid var(--line); padding-top: 14px; }

.contact__list dt {
	font-size: 10.5px;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--muted);
	margin-bottom: 4px;
}

.contact__list dd a {
	font-family: var(--serif);
	font-size: clamp(20px, 2vw, 28px);
	line-height: 1.3;
	word-break: break-word;
	background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
	transition: background-size 0.5s var(--ease);
}

.contact__list dd a:hover { background-size: 100% 1px; }

.contact__icons {
	grid-column: 1 / 2;
	display: flex;
	gap: 10px;
	margin-top: 36px;
}

.contact__icons a {
	display: grid;
	place-items: center;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	border: 1px solid var(--line-2);
	color: var(--ink-2);
	transition: color 0.3s, background-color 0.3s, border-color 0.3s;
}

.contact__icons a:hover { color: var(--ink); background: rgba(255, 250, 240, 0.07); border-color: rgba(236, 231, 223, 0.32); }

.contact__foot {
	margin-top: 28px;
	text-align: center;
	font-size: 11px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--faint);
}

.contact__foot i { font-style: normal; margin: 0 6px; }

@media (max-width: 860px) {
	.contact__panel { grid-template-columns: 1fr; }
	.contact__list { grid-column: 1; grid-row: auto; margin-top: 36px; }
	.contact__icons { grid-column: 1; }
}

/* ------------------------------------------------------------
   Lightbox
   ------------------------------------------------------------ */
.lightbox {
	width: 100%;
	max-width: 100%;
	height: 100%;
	max-height: 100%;
	margin: 0;
	padding: var(--gutter);
	border: 0;
	background: transparent;
	color: var(--ink);
	display: none;
	place-items: center;
	overflow: hidden;
}

.lightbox[open] { display: grid; }

.lightbox::backdrop {
	background: rgba(6, 6, 7, 0.82);
	-webkit-backdrop-filter: blur(18px);
	backdrop-filter: blur(18px);
}

.lightbox__body {
	width: min(100%, calc((100vh - 180px) * 16 / 9), 1440px);
	animation: lb-in 0.6s var(--ease-out);
}

.lightbox__frame {
	position: relative;
	aspect-ratio: 16 / 9;
	border-radius: 12px;
	overflow: hidden;
	background: #000;
	border: 1px solid var(--line);
	box-shadow: 0 50px 120px -30px rgba(0, 0, 0, 0.9);
}

.lightbox__frame iframe,
.lightbox__frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.lightbox__cap { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; padding-top: 18px; }
.lightbox__title { font-family: var(--serif); font-size: 26px; }
.lightbox__meta { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }

.lightbox__close { position: fixed; top: 18px; right: 18px; }

@keyframes lb-in {
	from { opacity: 0; transform: translateY(16px) scale(0.985); }
	to   { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------
   Reduced motion
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*,
	*::before,
	*::after { animation: none !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
	.wash { transform: none !important; }
}
