/* ============================================================
   JULIAN KING — 2026
   One committed visual world: the screening room. Every color is
   painted explicitly from a token on :root.
   ============================================================ */

:root {
	--ground:    #0A0C0D;
	--surface:   #141719;
	--sunk:      #060809;
	--rule:      #282D31;
	--rule-soft: #1B1F22;
	--ink:       #F0F2F2;
	--muted:     #79838A;
	--dim:       #4A5257;

	--tile-rest: saturate(0.66) brightness(0.86) contrast(1.03);
	--tile-live: saturate(1.04) brightness(1.06) contrast(1);

	--sans: Archivo, "Helvetica Neue", Helvetica, Arial, sans-serif;
	--mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

	--gutter:  clamp(18px, 3.4vw, 46px);
	--head-h:  clamp(58px, 7vw, 74px);
	--measure: 62ch;
}

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

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

body {
	margin: 0;
	background: var(--ground);
	color: var(--ink);
	font-family: var(--sans);
	font-size: 15px;
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}

img, video { max-width: 100%; display: block; }

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

:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 200;
	padding: 12px 18px;
	background: var(--ink);
	color: var(--ground);
	font-family: var(--mono);
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: .14em;
}
.skip-link:focus { left: 0; }

.mono {
	font-family: var(--mono);
	font-size: 10px;
	letter-spacing: .15em;
	text-transform: uppercase;
	color: var(--muted);
}

.tc { font-variant-numeric: tabular-nums; letter-spacing: .12em; }

.wrap { padding-inline: var(--gutter); }

/* The pipe: Julian's own CLIENT | TITLE convention as a typographic system. */
.pipe {
	display: inline-block;
	width: 1px;
	height: .82em;
	background: currentColor;
	opacity: .38;
	margin-inline: .62em;
	vertical-align: -.02em;
}
.t-client { font-weight: 600; letter-spacing: -.005em; }
.t-work   { font-weight: 400; color: var(--muted); letter-spacing: -.005em; }

/* ============================================================
   HEADER
   ============================================================ */

.site-head {
	position: fixed;
	inset: 0 0 auto 0;
	z-index: 60;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	height: var(--head-h);
	padding-inline: var(--gutter);
	/* Reads over any footage, light or dark, without a background plate. */
	mix-blend-mode: difference;
	color: #fff;
	transition: transform .42s cubic-bezier(.2, .7, .2, 1);
}
.site-head[data-hidden="true"] { transform: translateY(-100%); }

.site-head__mark {
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .02em;
	text-transform: uppercase;
}

.site-head__nav { display: flex; gap: clamp(12px, 2vw, 28px); align-items: center; }
.site-head__nav a {
	font-family: var(--mono);
	font-size: 10px;
	letter-spacing: .18em;
	text-transform: uppercase;
	opacity: .62;
	padding-block: 4px;
	border-bottom: 1px solid transparent;
	transition: opacity .25s ease;
}
.site-head__nav a:hover,
.site-head__nav a[aria-current="page"] { opacity: 1; border-bottom-color: currentColor; }

/* ============================================================
   HERO
   ============================================================ */

.hero {
	position: relative;
	height: 100svh;
	min-height: 420px;
	overflow: hidden;
	display: grid;
	place-items: center;
	background: var(--sunk);
	isolation: isolate;
}

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

/* Difference blend inverts what's behind it, so against mid-gray the type turns
   mid-gray and disappears. This montage is full of fog, sky and concrete, which sit
   exactly there. A barely-visible floor under the type keeps it from failing closed. */
.hero__floor {
	position: absolute;
	inset: 0;
	background: radial-gradient(58% 44% at 50% 50%, rgba(0, 0, 0, .34) 0%, rgba(0, 0, 0, 0) 70%);
}

.hero__title {
	position: relative;
	z-index: 2;
	margin: 0;
	padding-inline: var(--gutter);
	font-size: clamp(38px, 11vw, 168px);
	font-weight: 700;
	letter-spacing: -.045em;
	line-height: .9;
	text-align: center;
	text-transform: uppercase;
	text-wrap: balance;
	color: #fff;
	mix-blend-mode: difference;
}

.hero__cue {
	position: absolute;
	bottom: 22px;
	left: 50%;
	translate: -50% 0;
	z-index: 2;
	color: #fff;
	mix-blend-mode: difference;
	opacity: .7;
	animation: cue 2.8s ease-in-out infinite;
}
@keyframes cue {
	0%, 100% { transform: translateY(0); opacity: .45; }
	50%      { transform: translateY(4px); opacity: .9; }
}

/* ============================================================
   GRID
   ============================================================ */

.grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: clamp(26px, 3.4vw, 54px) clamp(14px, 1.8vw, 26px);
	padding: clamp(40px, 7vw, 96px) var(--gutter);
}

.tile__frame {
	position: relative;
	aspect-ratio: 1 / 1;   /* square by decision; focal point art-directs the crop */
	overflow: hidden;
	background: var(--surface);
}

/* The lead film runs anamorphic, a scope frame above the square grid. */
.tile--lead { grid-column: 1 / -1; }
.tile--lead .tile__frame { aspect-ratio: 2.39 / 1; max-height: 68svh; }

.tile__img,
.tile__loop {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	filter: var(--tile-rest);
	transition: filter .5s ease, transform 1.3s cubic-bezier(.2, .7, .2, 1), opacity .45s ease;
}

.tile__loop { opacity: 0; }
.tile__loop[data-playing="true"] { opacity: 1; }

/* The fader: bring one tile up and take its neighbors down. */
.grid:has(.tile:hover) .tile:not(:hover) .tile__img,
.grid:has(.tile:hover) .tile:not(:hover) .tile__loop { opacity: .3; }
.grid:has(.tile:hover) .tile:not(:hover) .tile__title { opacity: .34; }
.grid:has(.tile:hover) .tile:hover .tile__loop[data-playing="true"] { opacity: 1; }

.tile:hover .tile__img,
.tile:hover .tile__loop,
.tile__link:focus-visible .tile__img {
	filter: var(--tile-live);
	transform: scale(1.035);
}

.tile__title {
	margin: 0;
	padding-top: 12px;
	font-size: clamp(12px, 1.15vw, 16px);
	line-height: 1.25;
	text-transform: uppercase;
	text-wrap: balance;
	transition: opacity .45s ease;
}
.tile--lead .tile__title { font-size: clamp(15px, 2vw, 28px); }

.empty { padding: clamp(60px, 14vh, 160px) var(--gutter); text-align: center; }

/* ============================================================
   PROJECT
   ============================================================ */

.project { padding-bottom: clamp(50px, 9vw, 120px); }

.project__hero {
	position: relative;
	aspect-ratio: 16 / 9;
	max-height: calc(100svh - var(--head-h));
	overflow: hidden;
	background: var(--sunk);
}
.project__poster { width: 100%; height: 100%; object-fit: cover; filter: saturate(.92) brightness(.88); }

.project__hero iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.project__play {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	background: none;
	border: 0;
	cursor: pointer;
	color: #fff;
	mix-blend-mode: difference;
	font: inherit;
}
.project__play span {
	display: grid;
	place-items: center;
	width: clamp(58px, 7vw, 86px);
	aspect-ratio: 1;
	border: 1px solid currentColor;
	border-radius: 50%;
	font-family: var(--mono);
	font-size: 9px;
	letter-spacing: .18em;
	text-transform: uppercase;
	transition: transform .35s cubic-bezier(.2, .7, .2, 1);
}
.project__play:hover span { transform: scale(1.09); }

.project__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 24px;
	flex-wrap: wrap;
	padding-block: clamp(22px, 3vw, 40px) clamp(14px, 2vw, 22px);
	border-bottom: 1px solid var(--rule);
}
.project__title {
	margin: 0;
	font-size: clamp(20px, 3.4vw, 48px);
	font-weight: 600;
	letter-spacing: -.024em;
	line-height: 1.06;
	text-transform: uppercase;
	text-wrap: balance;
}

.project__cols {
	display: grid;
	grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
	gap: clamp(26px, 5vw, 88px);
	padding-block: clamp(26px, 4vw, 54px);
}
.project__about p {
	margin: 0;
	max-width: var(--measure);
	font-size: clamp(15px, 1.4vw, 19px);
	line-height: 1.5;
	letter-spacing: -.008em;
}

.block-label {
	display: block;
	padding-bottom: 13px;
	margin-bottom: 15px;
	border-bottom: 1px solid var(--rule-soft);
}

/* Credits are a call sheet, so they are set like one. */
.project__credits pre {
	margin: 0;
	font-family: var(--mono);
	font-size: 11.5px;
	line-height: 1.95;
	color: var(--muted);
	white-space: pre-wrap;
	overflow-x: auto;
}

.project__gallery { padding-block: clamp(10px, 2vw, 24px); }

/* CSS columns rather than grid masonry: predictable in every browser today. */
.masonry { columns: 3 260px; column-gap: 10px; }
.masonry__item { width: 100%; height: auto; margin-bottom: 10px; break-inside: avoid; }

.project__pager {
	display: flex;
	justify-content: space-between;
	gap: 20px;
	padding-top: clamp(30px, 5vw, 60px);
	margin-top: clamp(30px, 5vw, 60px);
	border-top: 1px solid var(--rule);
}
.project__pager a { display: block; max-width: 46%; }
.project__pager .mono { display: block; margin-bottom: 6px; }
.project__pager .t { font-size: clamp(12px, 1.2vw, 16px); text-transform: uppercase; line-height: 1.28; }
.project__pager .next { text-align: right; margin-left: auto; }

.page-title {
	padding-top: calc(var(--head-h) + 30px);
	font-size: clamp(20px, 3vw, 34px);
	text-transform: uppercase;
	letter-spacing: -.02em;
}

/* ============================================================
   FOOTER
   ============================================================ */

.site-foot {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 18px;
	flex-wrap: wrap;
	padding: clamp(28px, 5vw, 54px) var(--gutter);
	border-top: 1px solid var(--rule);
}
.site-foot__links { display: flex; gap: clamp(12px, 2vw, 26px); flex-wrap: wrap; }
.site-foot__links a:hover { color: var(--ink); }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1100px) {
	.grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 700px) {
	.grid { grid-template-columns: 1fr; }
	.tile--lead .tile__frame { aspect-ratio: 16 / 9; }
	.project__cols { grid-template-columns: 1fr; }
	.masonry { columns: 1; }
	.site-head__nav { gap: 11px; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .01ms !important;
	}
	.tile:hover .tile__img, .tile:hover .tile__loop { transform: none; }
	.hero__cue { animation: none; }
}

.sr-only {
	position: absolute;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}
