/* JPD Portfolio: design direction "Paff Night Edition" */

@font-face {
	font-family: "Bricolage Grotesque";
	src: url("../fonts/bricolage.woff2") format("woff2");
	font-weight: 200 800;
	font-display: swap;
}
@font-face {
	font-family: "Geist";
	src: url("../fonts/geist.woff2") format("woff2");
	font-weight: 100 900;
	font-display: swap;
}

@font-face {
	font-family: "Water Brush";
	src: url("../fonts/waterbrush.woff2") format("woff2");
	font-weight: 400;
	font-display: swap;
}

@view-transition { navigation: auto; }

:root {
	--bg: #121110;
	--surface: #1c1b19;
	--raised: #262422;
	--ink: #f1eee8;
	--muted: #9a948b;
	--line: #2f2c29;
	--accent: #00ffea;
	--accent-ink: #121110;

	--font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
	--font-body: "Geist", ui-sans-serif, system-ui, sans-serif;
	--font-script: "Water Brush", sans-serif;

	--fs-hero: clamp(2.75rem, 1rem + 5vw, 5.25rem);
	--fs-h1: clamp(3rem, 1.6rem + 6vw, 7.5rem);
	--fs-h2: clamp(2.25rem, 1.5rem + 3.2vw, 4.75rem);
	--fs-h3: clamp(1.5rem, 1.25rem + 0.9vw, 2.125rem);
	--fs-lede: clamp(1.125rem, 1rem + 0.5vw, 1.4375rem);
	--fs-body: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
	--fs-small: 0.875rem;

	--space-xs: 8px;
	--space-sm: 16px;
	--space-md: 32px;
	--space-lg: clamp(48px, 6vw, 64px);
	--space-xl: clamp(80px, 11vw, 128px);

	--radius-sm: 6px;
	--radius-md: 14px;
	--radius-pill: 999px;

	--gutter: clamp(16px, 4vw, 48px);
	--max: 1440px;
	--header-h: 72px;
	--ease: cubic-bezier(.2, .7, .2, 1);
}

/* Reset (zero specificity so components always win) */
:where(*, *::before, *::after) { box-sizing: border-box; }
:where(html) { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
:where(body, h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul) { margin: 0; padding: 0; }
:where(ul[role="list"]) { list-style: none; }
:where(img, video, svg) { display: block; max-width: 100%; height: auto; }
:where(button) { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:where(a) { color: inherit; }

body.jpd {
	background: var(--bg);
	color: var(--ink);
	font-family: var(--font-body);
	font-size: var(--fs-body);
	line-height: 1.6;
	font-feature-settings: "ss01";
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	overflow-x: clip;
}
body.jpd ::selection { background: var(--accent); color: var(--accent-ink); }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.accent { color: var(--accent); }

.skip {
	position: absolute; left: var(--gutter); top: -100px; z-index: 100;
	background: var(--accent); color: var(--accent-ink); padding: 10px 16px; border-radius: var(--radius-pill);
	font-weight: 600; text-decoration: none;
}
.skip:focus { top: 12px; }

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

/* Buttons */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 52px; padding: 0 26px; border-radius: var(--radius-pill);
	font-family: var(--font-body); font-weight: 600; font-size: 1rem; line-height: 1;
	text-decoration: none; white-space: nowrap;
	transition: transform .2s var(--ease), background-color .2s, color .2s, border-color .2s;
}
.btn:active { transform: translateY(1px) scale(.98); }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: var(--ink); }
.btn--ghost { border: 1px solid var(--ink); color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--bg); }
.btn--sm { min-height: 40px; padding: 0 18px; font-size: .9375rem; }

/* Header */
.site-header {
	position: sticky; top: 0; z-index: 50;
	background: color-mix(in srgb, var(--bg) 82%, transparent);
	-webkit-backdrop-filter: saturate(140%) blur(14px);
	backdrop-filter: saturate(140%) blur(14px);
	border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
	view-transition-name: site-header;
}
body.admin-bar .site-header { top: var(--wp-admin--admin-bar--height, 32px); }
.site-header__inner { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); }
.wordmark {
	font-family: var(--font-display); font-weight: 700; font-size: 1.375rem; letter-spacing: -0.02em;
	text-decoration: none; display: inline-flex; align-items: baseline;
}
.wordmark { color: var(--ink); transition: color .25s; }
.wordmark__logo { display: block; height: 46px; width: auto; }
.wordmark:hover { color: var(--accent); }
@media (max-width: 560px) { .wordmark__logo { height: 38px; } }
.site-nav { display: flex; align-items: center; gap: clamp(16px, 2.4vw, 32px); }
.site-nav a:not(.btn) { text-decoration: none; color: var(--muted); font-weight: 500; transition: color .2s; }
.site-nav a:not(.btn):hover, .site-nav a[aria-current="page"] { color: var(--ink); }
@media (max-width: 560px) {
	.site-nav a:not(.btn):not([href*="/work"]) { display: none; }
	.wordmark { font-size: 1.2rem; }
}

/* Hero */
.hero {
	display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: center;
	gap: var(--space-lg);
	min-height: min(calc(100svh - var(--header-h)), 900px);
	padding-block: var(--space-lg);
}
.hero__title {
	font-family: var(--font-display); font-weight: 700; font-size: var(--fs-hero);
	line-height: .95; letter-spacing: -0.045em; text-wrap: balance;
	font-variation-settings: "wdth" 90;
}
.hero__lede { margin-top: var(--space-md); max-width: 34ch; font-size: var(--fs-lede); color: var(--muted); line-height: 1.5; text-wrap: pretty; }
.hero__actions { margin-top: var(--space-md); display: flex; flex-wrap: wrap; gap: 12px; }

.hero__stack { position: relative; aspect-ratio: 4 / 5; }
.hero__card { position: absolute; margin: 0; }
.hero__card-inner {
	display: block; width: 100%; height: 100%; overflow: hidden;
	border-radius: var(--radius-md); background: var(--surface);
	box-shadow: 0 0 0 1px var(--line);
	transition: translate .7s var(--ease), rotate .7s var(--ease), scale .7s var(--ease), box-shadow .4s, filter .4s;
}
.hero__card img { width: 100%; height: 100%; object-fit: cover; transition: scale 1s var(--ease); }
.hero__card--1 { inset: 4% 18% 30% 0; rotate: -4deg; z-index: 2; --straighten: 4deg; --fan: -7% -3%; }
.hero__card--2 { inset: 33% -3% 14% 6%; rotate: 3deg; z-index: 3; --straighten: -3deg; --fan: 4% 6%; }
.hero__card--3 { inset: 0 0 58% 52%; rotate: 6deg; z-index: 1; --straighten: -6deg; --fan: 7% -8%; }

/* Hero cards: idle float, then fan out and lift on rollover */
@media (prefers-reduced-motion: no-preference) {
	.hero__card-inner { animation: jpd-float 7s ease-in-out infinite; }
	.hero__card--2 .hero__card-inner { animation-duration: 8.5s; animation-delay: -2.5s; }
	.hero__card--3 .hero__card-inner { animation-duration: 9.5s; animation-delay: -5s; }
}
@keyframes jpd-float {
	0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
	50% { transform: translate3d(0, -12px, 0) rotate(.9deg); }
}
@media (hover: hover) and (pointer: fine) {
	.hero__stack:hover .hero__card-inner { animation-play-state: paused; translate: var(--fan); }
	.hero__stack:hover .hero__card:not(:hover) .hero__card-inner { filter: brightness(.55) saturate(.7); }
	.hero__card:hover { z-index: 10; }
	.hero__stack .hero__card:hover .hero__card-inner {
		scale: 1.07; rotate: var(--straighten);
		box-shadow: 0 0 0 1.5px var(--accent);
	}
	.hero__card:hover img { scale: 1.05; }
}

@media (max-width: 899px) {
	.hero__card--2 { inset: 26% -2% 4% 14%; }
	.hero { grid-template-columns: 1fr; min-height: 0; padding-block: var(--space-lg) var(--space-md); }
	.hero__stack { aspect-ratio: 5 / 4; max-width: 560px; width: 100%; justify-self: center; }
}

/* Section titles */
.section-title {
	font-family: var(--font-display); font-weight: 700; font-size: var(--fs-h2);
	line-height: 1; letter-spacing: -0.035em; text-wrap: balance;
}

/* Work grid */
.work { padding-block: var(--space-xl) var(--space-lg); }
.work__head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--space-md); margin-bottom: var(--space-lg); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
	min-height: 40px; padding: 0 16px; border-radius: var(--radius-pill);
	border: 1px solid var(--line); color: var(--muted); font-size: .9375rem; font-weight: 500;
	transition: color .2s, border-color .2s, background-color .2s;
}
.chip:hover { color: var(--ink); border-color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.grid {
	display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
	column-gap: clamp(16px, 2.6vw, 40px); row-gap: clamp(48px, 6vw, 88px);
	align-items: start;
}
.tile { grid-column: span 6; position: relative; }
.tile[hidden] { display: none; }
.tile__link { display: block; text-decoration: none; color: inherit; }
.tile__frame { position: relative; overflow: hidden; border-radius: var(--radius-md); background: var(--surface); aspect-ratio: 4 / 3; }
.tile__media { width: 100%; height: 100%; object-fit: cover; transition: scale .9s var(--ease), filter .6s; }
.tile__link:hover .tile__media, .tile__link:focus-visible .tile__media { scale: 1.045; }
.tile__caption { display: grid; grid-template-columns: 1fr; padding-top: 18px; padding-right: 56px; }
.tile__title { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-h3); line-height: 1.05; letter-spacing: -0.025em; }
.tile__meta { color: var(--ink); font-size: var(--fs-small); font-weight: 500; margin-top: 6px; }
.tile__tagline { grid-column: 1 / -1; margin-top: 8px; color: var(--muted); max-width: 52ch; }
.tile__caption { position: relative; }
.tile__arrow {
	position: absolute; right: 0; top: 16px;
	width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
	border: 1px solid var(--line); color: var(--ink);
	transition: background-color .25s, color .25s, border-color .25s, rotate .35s var(--ease);
}
.tile__link:hover .tile__arrow { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); rotate: 45deg; }

/* Editorial rhythm: varied spans, ratios and a staggered second column */
@media (min-width: 900px) {
	.tile--a { grid-column: 1 / span 7; }
	.tile--a .tile__frame { aspect-ratio: 5 / 4; }
	.tile--b { grid-column: 9 / span 4; margin-top: clamp(80px, 12vw, 200px); }
	.tile--b .tile__frame { aspect-ratio: 4 / 5; }
	.tile--c { grid-column: 1 / span 5; margin-top: clamp(-120px, -6vw, -40px); }
	.tile--c .tile__frame { aspect-ratio: 4 / 3; }
	.tile--d { grid-column: 6 / span 7; }
	.tile--d .tile__frame { aspect-ratio: 16 / 10; }
	.tile--e { grid-column: 1 / span 8; }
	.tile--e .tile__frame { aspect-ratio: 21 / 10; }
	.tile--f { grid-column: 9 / span 4; margin-top: clamp(40px, 6vw, 120px); }
	.tile--f .tile__frame { aspect-ratio: 3 / 4; }

	.grid.is-filtered .tile { grid-column: span 6; margin-top: 0; }
	.grid.is-filtered .tile__frame { aspect-ratio: 4 / 3; }
}
@media (max-width: 899px) {
	.tile { grid-column: 1 / -1; }
}
.grid__empty { color: var(--muted); padding-block: var(--space-lg); }

/* Audiences */
.audiences { padding-block: var(--space-xl); }
.rows { margin-top: var(--space-lg); border-top: 1px solid var(--line); }
.row {
	display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--space-md);
	padding-block: clamp(24px, 3.4vw, 44px); border-bottom: 1px solid var(--line);
	transition: background-color .3s;
}
.row__label { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-h3); line-height: 1.1; letter-spacing: -0.02em; }
.row__text { color: var(--muted); max-width: 58ch; font-size: var(--fs-lede); line-height: 1.5; }
.row__text a { color: var(--ink); text-underline-offset: 4px; text-decoration-color: var(--accent); }
.row:hover .row__label { color: var(--accent); }
@media (max-width: 760px) { .row { grid-template-columns: 1fr; gap: 10px; } }

/* Clients wall */
.clients { padding-block: var(--space-lg) var(--space-xl); }
.clients__list {
	margin-top: var(--space-lg); display: flex; flex-wrap: wrap; column-gap: .55em; row-gap: .1em;
	font-family: var(--font-display); font-weight: 500; font-size: clamp(1.75rem, 1.1rem + 2.6vw, 3.5rem);
	line-height: 1.15; letter-spacing: -0.03em; color: var(--muted);
}
.clients__list li { transition: color .25s; }
.clients__list li:not(:last-child)::after { content: "/"; margin-left: .55em; color: var(--line); }
.clients__list li:hover { color: var(--ink); }

/* CTA band */
.cta-band { border-top: 1px solid var(--line); padding-block: var(--space-xl); }
.cta-band__inner { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--space-lg); align-items: end; }
.cta-band__title {
	font-family: var(--font-display); font-weight: 700; font-size: var(--fs-h1);
	line-height: .95; letter-spacing: -0.045em; text-wrap: balance;
}
.cta-band__side p { color: var(--muted); font-size: var(--fs-lede); line-height: 1.5; max-width: 40ch; margin-bottom: var(--space-md); }
@media (max-width: 899px) { .cta-band__inner { grid-template-columns: 1fr; } }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding-block: 28px; color: var(--muted); font-size: var(--fs-small); }
.site-footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }
.site-footer nav { display: flex; gap: 24px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--ink); }

/* Case study */
.case__head { padding-block: var(--space-lg) var(--space-lg); }
.back {
	display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none;
	font-weight: 500; margin-bottom: var(--space-md); transition: color .2s, gap .2s;
}
.back:hover { color: var(--ink); gap: 10px; }
.case__title {
	font-family: var(--font-display); font-weight: 700; font-size: var(--fs-h1);
	line-height: .95; letter-spacing: -0.045em; text-wrap: balance; max-width: 14ch;
	padding-bottom: .04em;
}
.case__tagline { margin-top: var(--space-sm); font-size: var(--fs-lede); color: var(--muted); max-width: 46ch; line-height: 1.5; }
.facts {
	margin-top: var(--space-lg); display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	border-top: 1px solid var(--line);
}
.facts__item { padding: 18px 24px 18px 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); font-size: var(--fs-small); margin-bottom: 4px; }
.facts dd { font-weight: 500; line-height: 1.45; }

.case__lead { margin: 0; padding-inline: var(--gutter); max-width: calc(var(--max) + 240px); margin-inline: auto; }
.case__lead img, .case__lead .yt {
	width: 100%; max-height: 82svh; object-fit: cover; border-radius: var(--radius-md); background: var(--surface);
}
.case__intro { padding-block: var(--space-xl) var(--space-lg); display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.case__intro p {
	grid-column: 5 / -1; font-size: clamp(1.25rem, 1.05rem + 0.8vw, 1.75rem); line-height: 1.45;
	letter-spacing: -0.01em; max-width: 40ch; text-wrap: pretty;
}
@media (max-width: 899px) { .case__intro p { grid-column: 1 / -1; } }

/* Gallery */
.gallery {
	display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-flow: dense;
	gap: clamp(16px, 2.4vw, 32px); align-items: start; padding-bottom: var(--space-xl);
}
.shot { grid-column: span 6; }
.shot--wide { grid-column: span 8; }
.shot--tall { grid-column: span 4; }
.shot--wide:nth-of-type(3n + 1) { grid-column: 1 / -1; }
.shot__btn { display: block; width: 100%; border-radius: var(--radius-md); overflow: hidden; background: var(--surface); cursor: zoom-in; }
.shot__btn img { width: 100%; transition: scale .8s var(--ease); }
.shot__btn:hover img { scale: 1.025; }
.shot--tall .shot__btn img { max-height: 110svh; object-fit: cover; object-position: top; }
.shot--small .shot__btn { display: grid; place-items: center; padding: clamp(24px, 4vw, 56px); background: var(--raised); }
.shot--small .shot__btn img { width: auto; max-width: 100%; border-radius: var(--radius-sm); }
.shot figcaption { margin-top: 12px; font-size: var(--fs-small); color: var(--muted); }
.shot figcaption span { display: block; color: color-mix(in srgb, var(--muted) 80%, var(--bg)); margin-top: 2px; }
@media (max-width: 760px) {
	.shot, .shot--wide, .shot--tall, .shot--wide:nth-of-type(3n + 1) { grid-column: 1 / -1; }
}

/* Even gallery: equal square cells, images shown whole, never upscaled */
.gallery--even { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-flow: row; align-items: stretch; }
.gallery--even .shot, .gallery--even .shot--wide, .gallery--even .shot--tall, .gallery--even .shot--wide:nth-of-type(3n + 1) { grid-column: auto; }
.gallery--even .shot__btn, .gallery--even .shot--small .shot__btn {
	--pad: clamp(16px, 2.4vw, 32px); position: relative; aspect-ratio: 1 / 1; display: block; padding: 0;
	background: var(--raised); border: 1px solid var(--line);
}
/* Large images: fill the padded box, scaled down to fit (contain), so nothing is cropped or stretched */
.gallery--even .shot__btn img, .gallery--even .shot--tall .shot__btn img {
	position: absolute; inset: var(--pad); width: calc(100% - 2 * var(--pad)); height: calc(100% - 2 * var(--pad));
	max-width: none; max-height: none; object-fit: contain; object-position: center;
	filter: drop-shadow(0 14px 22px rgb(0 0 0 / .45));
}
/* Small images (ads, gifs): native size, centred, never enlarged */
/* Width comes from the image's own size (inline style) so Safari can lay it out and lazy-load it before it arrives */
.gallery--even .shot--small .shot__btn img {
	position: absolute; inset: 0; margin: auto; height: auto;
	max-width: calc(100% - 2 * var(--pad)); max-height: calc(100% - 2 * var(--pad)); object-fit: contain;
	border-radius: var(--radius-sm); filter: drop-shadow(0 14px 22px rgb(0 0 0 / .45));
}
.gallery--even .shot__btn:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
/* Long scrolling documents: show the top of the page at full cell width, fade out, click for the whole thing */
.gallery--even .shot--long .shot__btn img { object-fit: cover; object-position: top center; filter: none; border-radius: var(--radius-sm); }
.gallery--even .shot--long .shot__btn::after {
	content: ""; position: absolute; inset: auto var(--pad) var(--pad); height: 45%; pointer-events: none;
	background: linear-gradient(to bottom, transparent, var(--raised));
}
.shot__more {
	position: absolute; left: 50%; bottom: calc(var(--pad) + 12px); translate: -50% 0; z-index: 1;
	padding: 8px 14px; border-radius: 999px; font-size: var(--fs-small); font-weight: 600;
	background: var(--ink); color: var(--bg); white-space: nowrap; transition: background .25s, color .25s;
}
.shot__btn:hover .shot__more { background: var(--accent); color: var(--accent-ink); }
.gallery--even.gallery--two { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: calc(var(--max) * .78); }
@media (max-width: 899px) { .gallery--even { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .gallery--even { grid-template-columns: 1fr; } }

/* Featured project inside a case study (e.g. Aegis on Web Design) */
.feature { padding-bottom: var(--space-xl); }
.feature__head {
	display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-md) var(--space-lg);
	align-items: end; padding-top: var(--space-lg); border-top: 1px solid var(--line); margin-bottom: var(--space-lg);
}
.feature__eyebrow { font-size: var(--fs-small); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.feature__title { display: flex; flex-direction: column; gap: clamp(14px, 1.6vw, 24px); }
.feature__name { font-family: var(--font-script); font-weight: 400; font-size: var(--fs-h1); line-height: .9; letter-spacing: 0; }
.feature__sub { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-h3); line-height: 1.1; letter-spacing: -0.025em; }
.feature__desc { font-size: var(--fs-lede); line-height: 1.55; color: color-mix(in srgb, var(--ink) 82%, var(--bg)); text-wrap: pretty; }
.feature__facts { margin-top: var(--space-md); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.feature__facts > div { padding: 14px 16px 0 0; }
.feature__facts dt { color: var(--muted); font-size: var(--fs-small); margin-bottom: 4px; }
.feature__facts dd { font-weight: 500; line-height: 1.45; }
.gallery--feature { --gap: clamp(16px, 2.4vw, 32px); gap: var(--gap); grid-template-columns: repeat(2, minmax(0, 1fr)); padding-bottom: 0; }
.gallery--feature .shot__btn { --pad: 0px; aspect-ratio: 4 / 3; border: 0; background: var(--surface); }
.gallery--feature .shot__btn img { filter: none; }
.gallery--feature .shot:last-child:nth-child(odd) { grid-column: 1 / -1; justify-self: center; width: calc(50% - var(--gap) / 2); }
.more-title {
	font-family: var(--font-display); font-weight: 700; font-size: var(--fs-h3); letter-spacing: -0.025em;
	padding-top: var(--space-lg); border-top: 1px solid var(--line); margin-bottom: var(--space-lg);
}
@media (max-width: 899px) {
	.feature__head { grid-template-columns: 1fr; }
	.feature__facts { grid-template-columns: 1fr; }
	.feature__facts > div { padding: 12px 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 560px) {
	.gallery--feature { grid-template-columns: 1fr; }
	.gallery--feature .shot:last-child:nth-child(odd) { width: auto; justify-self: stretch; }
}

/* See screens button + carousel dialog */
.btn-screens {
	margin-top: var(--space-md); display: inline-flex; align-items: center; gap: 10px;
	padding: 14px 22px; border-radius: 999px; background: var(--accent); color: var(--accent-ink);
	font-weight: 600; cursor: pointer; transition: translate .25s var(--ease), box-shadow .25s;
}
.btn-screens:hover { translate: 0 -2px; box-shadow: 0 10px 30px -10px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn-screens:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.btn-screens__count { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding-inline: 7px; border-radius: 999px; background: color-mix(in srgb, var(--accent-ink) 14%, transparent); font-size: var(--fs-small); }
.screens {
	width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
	background: color-mix(in srgb, var(--bg) 96%, black); color: var(--ink);
	display: none; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; overscroll-behavior: contain; overflow: hidden;
}
.screens[open] { display: grid; }
.screens::backdrop { background: rgb(0 0 0 / .7); }
.screens__bar { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; padding: 14px var(--gutter); border-bottom: 1px solid var(--line); }
.screens__count { font-variant-numeric: tabular-nums; color: var(--muted); font-size: var(--fs-small); }
.screens__cap { font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.screens__close, .screens__nav { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; transition: background .2s, border-color .2s; }
.screens__close:hover, .screens__nav:hover { border-color: var(--accent); }
.screens__stage { position: relative; min-height: 0; min-width: 0; }
.screens__track {
	display: flex; width: 100%; height: 100%; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scroll-behavior: smooth;
	scrollbar-width: none; margin: 0; padding: 0; list-style: none;
}
.screens__track::-webkit-scrollbar { display: none; }
.screens__slide { flex: 0 0 100%; height: 100%; min-height: 0; scroll-snap-align: center; display: flex; align-items: center; justify-content: center; box-sizing: border-box; padding: clamp(16px, 3vw, 40px) clamp(16px, 7vw, 96px); }
.screens__slide img { flex: 0 1 auto; min-width: 0; min-height: 0; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: var(--radius-md); box-shadow: 0 30px 80px -30px rgb(0 0 0 / .8); background: var(--surface); }
.screens__slide--tall img { border-radius: 28px; }
.screens__nav { position: absolute; top: 50%; translate: 0 -50%; z-index: 1; }
.screens__nav--prev { left: var(--gutter); }
.screens__nav--next { right: var(--gutter); }
.screens__thumbs { display: flex; gap: 10px; justify-content: safe center; overflow-x: auto; padding: 12px var(--gutter) 16px; border-top: 1px solid var(--line); scrollbar-width: thin; }
.screens__thumb { flex: 0 0 auto; height: 64px; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; background: var(--surface); cursor: pointer; opacity: .55; transition: opacity .2s, border-color .2s; }
.screens__thumb img { height: 100%; width: auto; display: block; }
.screens__thumb:hover { opacity: .85; }
.screens__thumb[aria-selected="true"] { opacity: 1; border-color: var(--accent); }
@media (max-width: 760px) {
	.screens__nav { display: none; }
	.screens__slide { padding: 16px; }
	.screens__thumb { height: 52px; }
}
@media (prefers-reduced-motion: reduce) { .screens__track { scroll-behavior: auto; } }

/* Video facades */
.videos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(16px, 2.4vw, 32px); padding-bottom: var(--space-xl); }
.videos .video:nth-child(3n + 1) { grid-column: 1 / -1; }
.yt { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius-md); background: var(--surface); }
.yt img { width: 100%; height: 100%; object-fit: cover; transition: scale .8s var(--ease), opacity .3s; }
.yt:hover img { scale: 1.03; }
.yt__play {
	position: absolute; left: 50%; top: 50%; translate: -50% -50%;
	width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center;
	background: var(--accent); color: var(--accent-ink); transition: scale .25s var(--ease);
}
.yt__play svg { margin-left: 3px; }
.yt:hover .yt__play { scale: 1.08; }
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video figcaption { margin-top: 12px; color: var(--muted); font-size: var(--fs-small); }
.case__lead--video .yt { max-height: none; }
/* Even layout: show the whole lead image at its own shape, never cropped or enlarged */
.case--even .case__lead img { display: block; width: auto; height: auto; max-width: 100%; max-height: 82svh; margin-inline: auto; object-fit: contain; background: none; }
@media (max-width: 760px) { .videos { grid-template-columns: 1fr; } }

/* Next project */
.next { padding-bottom: var(--space-xl); }
.next__link {
	display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 30%); grid-template-rows: auto 1fr; column-gap: var(--space-lg);
	align-items: end; text-decoration: none; padding-top: var(--space-lg); border-top: 1px solid var(--line);
}
.next__label { color: var(--muted); font-weight: 500; }
.next__title {
	grid-column: 1; font-family: var(--font-display); font-weight: 700; font-size: var(--fs-h2);
	line-height: 1; letter-spacing: -0.035em; transition: color .25s;
}
.next__media { grid-column: 2; grid-row: 1 / span 2; border-radius: var(--radius-md); overflow: hidden; aspect-ratio: 4 / 3; background: var(--surface); }
.next__media .tile__media { width: 100%; height: 100%; object-fit: cover; }
.next__link:hover .next__title { color: var(--accent); }
.next__link:hover .tile__media { scale: 1.05; }
@media (max-width: 760px) {
	.next__link { grid-template-columns: 1fr; row-gap: 12px; }
	.next__media { grid-column: 1; grid-row: auto; }
}

/* Lightbox */
.lightbox {
	width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: clamp(16px, 4vw, 56px);
	border: 0; background: color-mix(in srgb, var(--bg) 96%, transparent); color: var(--ink);
	display: none; place-items: center; grid-template-rows: 1fr auto;
}
.lightbox[open] { display: grid; }
.lightbox::backdrop { background: transparent; }
.lightbox img { max-width: 100%; max-height: calc(100dvh - 140px); width: auto; height: auto; object-fit: contain; border-radius: var(--radius-sm); }
.lightbox__caption { margin-top: 14px; color: var(--muted); font-size: var(--fs-small); text-align: center; min-height: 1.4em; }
.lightbox__btn {
	position: absolute; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
	border: 1px solid var(--line); background: var(--surface); color: var(--ink); transition: background-color .2s, color .2s;
}
.lightbox__btn:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.lightbox__close { top: 16px; right: 16px; }
.lightbox__prev { left: 16px; top: 50%; translate: 0 -50%; }
.lightbox__next { right: 16px; top: 50%; translate: 0 -50%; }


/* Water Brush script: short expressive headings and accent words only */
.section-title, .case__title, .next__title {
	font-family: var(--font-script); font-weight: 400; letter-spacing: 0;
	line-height: 1.15; padding-bottom: .08em; font-variation-settings: normal;
}
.section-title { font-size: clamp(3rem, 2rem + 4.4vw, 6.25rem); }
.case__title { font-size: clamp(3.75rem, 2.2rem + 6.6vw, 9rem); max-width: 16ch; }
.next__title { font-size: clamp(2.75rem, 1.8rem + 4vw, 5.75rem); }
.hero__title .accent, .cta-band__title .accent {
	font-family: var(--font-script); font-weight: 400; letter-spacing: 0;
	font-size: 1.22em; line-height: .8; display: inline-block; padding-bottom: .06em;
}
/* Motion: CSS scroll-driven reveals (progressive enhancement, content visible without support) */
@media (prefers-reduced-motion: no-preference) {
	@supports (animation-timeline: view()) {
		.reveal {
			animation: jpd-reveal linear both;
			animation-timeline: view();
			animation-range: entry 0% entry 70%;
		}
		.hero__card--1 { animation: jpd-drift-a linear both; animation-timeline: scroll(root); animation-range: 0 90vh; }
		.hero__card--2 { animation: jpd-drift-b linear both; animation-timeline: scroll(root); animation-range: 0 90vh; }
		.hero__card--3 { animation: jpd-drift-c linear both; animation-timeline: scroll(root); animation-range: 0 90vh; }
	}
	.hero__title, .hero__lede, .hero__actions, .case__title, .case__tagline { animation: jpd-rise .9s var(--ease) both; }
	.hero__lede, .case__tagline { animation-delay: .08s; }
	.hero__actions { animation-delay: .16s; }
	::view-transition-old(root), ::view-transition-new(root) { animation-duration: .35s; }
	::view-transition-group(*) { animation-duration: .5s; animation-timing-function: var(--ease); }
}
@keyframes jpd-reveal { from { opacity: 0; translate: 0 48px; } to { opacity: 1; translate: 0 0; } }
@keyframes jpd-rise { from { opacity: 0; translate: 0 24px; } to { opacity: 1; translate: 0 0; } }
@keyframes jpd-drift-a { to { translate: -6% -10%; rotate: -8deg; } }
@keyframes jpd-drift-b { to { translate: 4% -18%; rotate: 5deg; } }
@keyframes jpd-drift-c { to { translate: 8% -4%; rotate: 11deg; } }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
	@view-transition { navigation: none; }
}

/* Work page night sky background */
html:has(.starfield) { background: var(--bg); }
body.jpd:has(.starfield) { background: transparent; }
.starfield {
	position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none;
	opacity: 0; transition: opacity 1.2s ease;
	-webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 70%, rgb(0 0 0 / .55) 100%);
	mask-image: linear-gradient(to bottom, #000 0%, #000 70%, rgb(0 0 0 / .55) 100%);
}
.starfield.is-ready { opacity: 1; }

/* Crosshair cursor; links and buttons keep the hand so they still read as clickable */
body.jpd { cursor: crosshair; }
body.jpd :is(a, button, [role="button"], summary, label, select) { cursor: pointer; }
body.jpd :is(input, textarea) { cursor: text; }
body.jpd .shot__btn { cursor: zoom-in; }

/* Project tiles float like the hero cards (same keyframes and timings, staggered) */
@media (prefers-reduced-motion: no-preference) {
	.grid .tile__frame { animation: jpd-float 7s ease-in-out infinite; will-change: transform; }
	.grid .tile:nth-child(3n + 2) .tile__frame { animation-duration: 8.5s; animation-delay: -2.5s; }
	.grid .tile:nth-child(3n) .tile__frame { animation-duration: 9.5s; animation-delay: -5s; }
	.grid .tile:nth-child(4n) .tile__frame { animation-delay: -6.5s; }
}

/* Tile hover outline, matching the hero cards */
.grid .tile__frame { box-shadow: 0 0 0 1px var(--line); transition: box-shadow .4s; }
.grid .tile__link:hover .tile__frame, .grid .tile__link:focus-visible .tile__frame { box-shadow: 0 0 0 1.5px var(--accent); }

/* Feature header: title + description left, facts + button right */
.feature__head { align-items: start; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.feature__intro .feature__desc { margin-top: var(--space-md); max-width: 62ch; }
.feature__body { padding-top: 6px; }
.feature__body .feature__facts { margin-top: 0; grid-template-columns: 1fr; border-top: 1px solid var(--line); }
.feature__body .feature__facts > div { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 16px; align-items: baseline; padding: 14px 0; border-bottom: 1px solid var(--line); }
.feature__body .feature__facts dt { margin-bottom: 0; }
@media (max-width: 899px) { .feature__body { padding-top: 0; } }

/* Feature header v2: title on top; description and facts side by side, top-aligned */
.feature__head { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); grid-template-areas: "intro intro" "desc body"; row-gap: var(--space-md); align-items: start; }
.feature__intro { grid-area: intro; }
.feature__head > .feature__desc { grid-area: desc; margin-top: 0; max-width: 62ch; }
.feature__body { grid-area: body; padding-top: 0; }
@media (max-width: 899px) { .feature__head { grid-template-columns: 1fr; grid-template-areas: "intro" "desc" "body"; } }

/* Cyan bullets before Role / Scope / Details */
.feature__facts dt { display: flex; align-items: center; gap: 10px; }
.feature__facts dt::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: #00ffea; box-shadow: 0 0 8px rgb(0 255 234 / .55); }

/* Bullet pulse: brightens, glows, then fades back (staggered per row) */
@keyframes jpd-bullet-pulse {
	0%, 100% { opacity: .55; box-shadow: 0 0 4px rgb(0 255 234 / .35); }
	50% { opacity: 1; box-shadow: 0 0 6px rgb(0 255 234 / .95), 0 0 16px rgb(0 255 234 / .6); }
}
@media (prefers-reduced-motion: no-preference) {
	.feature__facts dt::before { animation: jpd-bullet-pulse 2.4s ease-in-out infinite; }
	.feature__facts > div:nth-child(2) dt::before { animation-delay: .4s; }
	.feature__facts > div:nth-child(3) dt::before { animation-delay: .8s; }
}
