/* =========================================================
   ZENYTH STUDIOS — premium post-production
   Typefaces kept from the current site:
   - Cactus Classical Serif (headings)
   - Montserrat Light (body / UI)
   ========================================================= */

:root {
  --bg: #0b0b0c;
  --bg-2: #121214;
  --line: rgba(236, 232, 225, 0.12);
  --line-strong: rgba(236, 232, 225, 0.28);
  --text: #ece8e1;
  --muted: #8d8a85;
  --accent: #c9b99a;           /* warm champagne — reads premium, not flashy */
  --serif: "Cactus Classical Serif", "Times New Roman", serif;
  --sans: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --pad: clamp(20px, 4vw, 64px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* Film grain overlay — subtle, gives the "graded" feel */
body::after {
  content: "";
  position: fixed; inset: -50%;
  pointer-events: none; z-index: 100;
  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%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -3%); } 60% { transform: translate(-2%, -1%); }
  80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}

.eyebrow {
  font-size: 11px; letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--muted); font-weight: 400;
}
.serif { font-family: var(--serif); font-weight: 400; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  /* same look on landing and while scrolling */
  padding: 16px var(--pad);
}
/* The frosted bar lives on a pseudo-element: a blur on the header itself would trap
   the full-screen mobile menu inside the 63px bar. */
.site-header::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: rgba(11, 11, 12, 0.72);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.logo img { height: 30px; width: auto; }
.nav { display: flex; gap: 40px; align-items: center; }
.nav a {
  font-size: 12px; letter-spacing: 0.24em; text-transform: uppercase;
  position: relative; padding: 4px 0; color: var(--text);
}
.nav a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 1px; width: 100%;
  background: var(--accent); transform: scaleX(0); transform-origin: right;
  transition: transform .5s var(--ease);
}
.nav a:hover::after, .nav a.active::after { transform: scaleX(1); transform-origin: left; }
.nav .cta {
  border: 1px solid var(--line-strong); padding: 10px 20px; border-radius: 100px;
  transition: background .4s var(--ease), color .4s var(--ease), border-color .4s;
}
.nav .cta::after { display: none; }
.nav .cta:hover { background: var(--text); color: var(--bg); border-color: var(--text); }
.menu-btn { display: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative; height: 100svh; min-height: 620px; overflow: hidden;
  display: flex; align-items: flex-end;
}
.hero video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transform: scale(1.08);
  transition: opacity 1.6s var(--ease), transform 9s linear;
}
.hero video.on { opacity: 1; transform: scale(1); }
.hero::before { /* grade + vignette */
  content: ""; position: absolute; inset: 0; z-index: 1;
  background:
    radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,.55) 100%),
    linear-gradient(180deg, rgba(11,11,12,.35) 0%, rgba(11,11,12,0) 30%, rgba(11,11,12,.9) 100%);
}
/* letterbox bars that open on load */
.hero .bar { position: absolute; left: 0; right: 0; height: 50%; background: var(--bg); z-index: 3; transition: transform 1.6s var(--ease) .2s; }
.hero .bar.top { top: 0; } .hero .bar.bottom { bottom: 0; }
.loaded .hero .bar.top { transform: translateY(-88%); }
.loaded .hero .bar.bottom { transform: translateY(88%); }
.loaded .hero .bar { transform-origin: center; }
.hero-inner {
  position: relative; z-index: 2; width: 100%;
  padding: 0 var(--pad) clamp(70px, 12vh, 130px);
  display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: end;
}
.hero h1 {
  font-family: var(--serif); font-weight: 400; margin: 18px 0 0;
  font-size: clamp(44px, 7.4vw, 124px); line-height: 0.98; letter-spacing: -0.01em;
}
/* padding gives descenders (g, p, y) room inside the reveal mask so they never clip */
.hero h1 .line { display: block; overflow: hidden; padding-bottom: .14em; margin-bottom: -.14em; }
.hero h1 .line span { display: inline-block; transform: translateY(110%); transition: transform 1.4s var(--ease); }
.loaded .hero h1 .line span { transform: translateY(0); }
.loaded .hero h1 .line:nth-child(2) span { transition-delay: .12s; }
.loaded .hero h1 .line:nth-child(3) span { transition-delay: .24s; }
.hero h1 em { font-style: italic; color: var(--accent); }

.hud { /* post-production "viewer" detail */
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px; letter-spacing: .12em; color: rgba(236,232,225,.7);
  text-align: right; line-height: 2;
}
.hud .rec { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #d4483b; margin-right: 8px; animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.hero .corner { position: absolute; z-index: 2; width: 18px; height: 18px; border-color: rgba(236,232,225,.5); border-style: solid; border-width: 0; }
/* corner markers only where there's no text: top left, top right, bottom right */
.corner.tl { top: 100px; left: var(--pad); border-top-width: 1px; border-left-width: 1px; }
.corner.tr { top: 100px; right: var(--pad); border-top-width: 1px; border-right-width: 1px; }
/* --hero-floor clears the bottom letterbox bar (6% of the hero, min-height 620px) */
.hero { --hero-floor: calc(max(6svh, 37.2px) + 26px); }
.corner.br { bottom: var(--hero-floor); right: var(--pad); border-bottom-width: 1px; border-right-width: 1px; }
/* short clip progress bar under the headline (not full width): one segment per clip */
.reel-progress { display: flex; gap: 6px; width: 180px; margin-top: clamp(22px, 3vw, 36px); }
.reel-progress span { position: relative; flex: 1; height: 2px; background: rgba(236,232,225,.22); overflow: hidden; }
.reel-progress i { position: absolute; inset: 0; background: var(--text); transform: scaleX(0); transform-origin: left; }
.reel-progress span.done i { transform: scaleX(1); }
.reel-progress span.active i { animation: reelFill var(--dur, 7000ms) linear forwards; }
@keyframes reelFill { to { transform: scaleX(1); } }
/* desktop: progress bar sits centred at the bottom of the hero, level with the bottom-right corner marker */
@media (min-width: 721px) {
  .reel-progress { position: absolute; left: 50%; bottom: var(--hero-floor); transform: translateX(-50%); margin-top: 0; }
  /* keep the headline where it sat when the bar was underneath it */
  .hero h1 { margin-bottom: calc(clamp(22px, 3vw, 36px) + 2px); }
}

/* ---------- Sections ---------- */
section { position: relative; }
.wrap { padding: clamp(90px, 14vw, 180px) var(--pad); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 40px; margin-bottom: clamp(40px, 6vw, 80px); flex-wrap: wrap; }
.section-head h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(34px, 4.6vw, 72px); line-height: 1.04; margin: 14px 0 0; max-width: 14ch; }

.statement { font-family: var(--serif); font-size: clamp(28px, 3.6vw, 56px); line-height: 1.22; max-width: 22ch; margin: 0; }
.statement .w { opacity: .14; transition: opacity .6s var(--ease); }
.statement .w.lit { opacity: 1; }
.intro-grid { display: grid; grid-template-columns: 1fr 1.6fr; gap: 60px; }
.intro-grid p.body { color: var(--muted); max-width: 46ch; margin-top: 36px; }

/* client marquee */
.marquee { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow: hidden; padding: 30px 0; }
.marquee-track { display: flex; gap: 70px; width: max-content; animation: marquee 48s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee span { font-family: var(--serif); font-size: clamp(22px, 2.4vw, 34px); color: var(--muted); white-space: nowrap; transition: color .3s; }
.marquee span:hover { color: var(--text); }
.marquee span::after { content: "✦"; font-size: .45em; margin-left: 70px; color: var(--accent); vertical-align: middle; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* featured work (home) */
.feature-list { border-top: 1px solid var(--line); }
.feature-row {
  display: grid; grid-template-columns: 70px 1fr auto 40px; align-items: center; gap: 24px;
  padding: 30px 0; border-bottom: 1px solid var(--line); position: relative;
}
.feature-row .num { font-size: 12px; color: var(--muted); letter-spacing: .1em; }
.feature-row h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(26px, 3.4vw, 52px); margin: 0; line-height: 1.1; transition: transform .6s var(--ease), color .4s; }
.feature-row .tags { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.feature-row .arrow { transition: transform .5s var(--ease); }
.feature-row:hover h3 { transform: translateX(18px); }
.feature-row:hover .arrow { transform: translateX(6px) rotate(-45deg); }

/* capabilities */
.caps { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.cap { padding: 40px 28px 40px 0; border-right: 1px solid var(--line); }
.cap + .cap { padding-left: 28px; }
.cap:last-child { border-right: 0; }
.cap .n { font-size: 11px; color: var(--accent); letter-spacing: .2em; }
.cap-top { display: flex; justify-content: space-between; align-items: flex-start; }
/* line icons: thin strokes that draw themselves in when the section is revealed (pathLength set in main.js) */
.ico { width: 40px; height: 40px; fill: none; stroke: var(--text); stroke-width: .9; stroke-linecap: round; stroke-linejoin: round; opacity: .85; transition: stroke .4s; }
.ico * { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.6s var(--ease); }
.caps.in .ico *, .step.in .ico * { stroke-dashoffset: 0; }
.cap:nth-child(2) .ico *, .step:nth-child(2) .ico * { transition-delay: .15s; }
.cap:nth-child(3) .ico *, .step:nth-child(3) .ico * { transition-delay: .3s; }
.cap:nth-child(4) .ico * { transition-delay: .45s; }
.cap:hover .ico, .step:hover .ico { stroke: var(--accent); }
.step .ico { display: block; margin-bottom: 18px; }
.cap h3 { font-family: var(--serif); font-weight: 400; font-size: 28px; margin: 28px 0 14px; }
.cap p { color: var(--muted); font-size: 14px; margin: 0; }

/* process */
.process { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; counter-reset: step; }
.step { padding: 0 28px 0 0; position: relative; }
.step .line { height: 1px; background: var(--line); margin-bottom: 26px; position: relative; overflow: hidden; }
.step .line::after { content: ""; position: absolute; inset: 0; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 1.2s var(--ease); }
.step.in .line::after { transform: scaleX(1); }
.step:nth-child(2) .line::after { transition-delay: .2s; }
.step:nth-child(3) .line::after { transition-delay: .4s; }
.step h4 { font-family: var(--serif); font-weight: 400; font-size: 24px; margin: 10px 0; }
.step p { color: var(--muted); font-size: 14px; margin: 0; max-width: 30ch; }

/* CTA */
.cta-block { text-align: center; border-top: 1px solid var(--line); }
.cta-block h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 5.8vw, 100px); line-height: 1.04; margin: 20px 0 clamp(56px, 6vw, 88px); }
.cta-block a.big {
  display: inline-flex; align-items: center; gap: 14px; font-size: 13px; letter-spacing: .24em; text-transform: uppercase;
  border: 1px solid var(--line-strong); border-radius: 100px; padding: 20px 36px;
  transition: background .4s var(--ease), color .4s var(--ease);
}
.cta-block a.big:hover { background: var(--text); color: var(--bg); }

/* footer */
.site-footer { padding: 40px var(--pad); border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; font-size: 12px; color: var(--muted); letter-spacing: .06em; }
.site-footer a:hover { color: var(--text); }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 1.1s var(--ease), transform 1.1s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* =========================================================
   WORK PAGE
   ========================================================= */
.work-hero { padding: calc(140px + 4vw) var(--pad) 40px; }
.work-hero h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 5.8vw, 100px); line-height: 1.04; margin: 16px 0 0; }
.work-hero h1 .star { font-size: .28em; color: var(--accent); vertical-align: top; margin-left: 14px; position: relative; top: .35em; }
.work-hero p { color: var(--muted); max-width: 52ch; margin-top: 28px; }

.filter-bar {
  /* --header-h is the header's measured height (main.js); tuck 1px under it so the two border lines merge with no sliver between */
  position: sticky; top: calc(var(--header-h, 63px) - 1px); z-index: 30;
  display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap;
  padding: 18px var(--pad); background: rgba(11, 11, 12, .82); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.filters { display: flex; flex-wrap: wrap; gap: 8px; position: relative; }
.chip {
  position: relative; font-size: 11px; letter-spacing: .2em; text-transform: uppercase;
  padding: 10px 16px; border: 1px solid var(--line); border-radius: 100px; color: var(--muted);
  transition: color .35s var(--ease), border-color .35s, background .35s;
}
.chip sup { font-size: 9px; margin-left: 4px; opacity: .7; letter-spacing: 0; }
.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip[aria-pressed="true"] { color: var(--bg); background: var(--text); border-color: var(--text); }
.view-toggle { display: flex; gap: 4px; border: 1px solid var(--line); border-radius: 100px; padding: 4px; }
.view-toggle button { font-size: 10px; letter-spacing: .2em; text-transform: uppercase; padding: 7px 14px; border-radius: 100px; color: var(--muted); transition: all .3s var(--ease); }
.view-toggle button[aria-pressed="true"] { background: var(--bg-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }
.result-count { font-size: 11px; letter-spacing: .2em; color: var(--muted); text-transform: uppercase; min-width: 90px; }

/* grid view */
/* Full-width stack: one project per row, a wide cinematic frame with the title set large over it,
   like scrolling through a reel one film at a time. Hovering plays a few silent seconds (js/work.js). */
.grid {
  display: grid; grid-template-columns: 1fr; row-gap: clamp(14px, 1.6vw, 24px);
  padding: clamp(30px, 5vw, 70px) var(--pad) clamp(80px, 10vw, 140px);
}
.card { position: relative; cursor: pointer; display: block; }
.card .media { position: relative; overflow: hidden; aspect-ratio: 21 / 9; max-height: 78vh; width: 100%; background: var(--bg-2); }
/* gradient so the title always reads over the image */
.grid:not(.list) .card .media::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(0deg, rgba(8,8,9,.85) 0%, rgba(8,8,9,.25) 45%, rgba(8,8,9,0) 70%);
}
.grid:not(.list) .card .meta {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; pointer-events: none;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 30px;
  padding: clamp(24px, 3.4vw, 56px);
}
.grid:not(.list) .card .meta-main { display: flex; flex-direction: column; }
.grid:not(.list) .card .cats { order: -1; display: block; text-align: left; margin-bottom: 14px; color: rgba(236,232,225,.7); }
.grid.list .card .meta-main { display: contents; }
.grid:not(.list) .card h3 { font-size: clamp(34px, 4.6vw, 80px); line-height: 1.04; padding-bottom: .08em; transition: transform .8s var(--ease); }
.grid:not(.list) .card .role { display: block; margin-top: 12px; font-size: 13px; letter-spacing: .06em; color: rgba(236,232,225,.8); }
.grid:not(.list) .card:hover h3 { transform: translateX(10px); }
/* "View project" sits bottom right as a frosted button, revealed on hover */
.grid:not(.list) .card .year {
  display: inline-flex; align-items: center; gap: 10px; flex: none; border-radius: 100px; padding: 13px 24px;
  font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: var(--text);
  background: rgba(11,11,12,.25); border: 1px solid rgba(236,232,225,.6);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: 0; transform: translateY(8px); transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.grid:not(.list) .card:hover .year { opacity: 1; transform: none; }
.grid:not(.list) .card .play, .grid:not(.list) .card .idx { display: none; }
@media (hover: none) { .grid:not(.list) .card .year { display: none; } }
.card .role { display: none; }
/* the title and button fill the bottom, so corner markers only go top left and top right */
.grid:not(.list) .card .media::after {
  z-index: 2;
  background:
    linear-gradient(var(--c), var(--c)) top left / var(--l) 1px,
    linear-gradient(var(--c), var(--c)) top left / 1px var(--l),
    linear-gradient(var(--c), var(--c)) top right / var(--l) 1px,
    linear-gradient(var(--c), var(--c)) top right / 1px var(--l);
  background-repeat: no-repeat;
}
.card img, .card .media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card img { transform: scale(1.04); filter: saturate(.85) brightness(.88); transition: transform 1.2s var(--ease), filter .8s var(--ease), opacity .6s var(--ease); }
.card:hover img { transform: scale(1.0); filter: saturate(1) brightness(1); }
.card .media video { opacity: 0; transition: opacity .6s var(--ease); }
.card .media video.on { opacity: 1; }
/* corner markers on hover — same language as the homepage hero */
.card .media::after {
  --c: rgba(236,232,225,.75); --l: 18px;
  content: ""; position: absolute; inset: 14px; pointer-events: none; opacity: 0;
  background:
    linear-gradient(var(--c), var(--c)) top left / var(--l) 1px,
    linear-gradient(var(--c), var(--c)) top left / 1px var(--l),
    linear-gradient(var(--c), var(--c)) top right / var(--l) 1px,
    linear-gradient(var(--c), var(--c)) top right / 1px var(--l),
    linear-gradient(var(--c), var(--c)) bottom left / var(--l) 1px,
    linear-gradient(var(--c), var(--c)) bottom left / 1px var(--l),
    linear-gradient(var(--c), var(--c)) bottom right / var(--l) 1px,
    linear-gradient(var(--c), var(--c)) bottom right / 1px var(--l);
  background-repeat: no-repeat;
  transition: opacity .6s var(--ease), inset .6s var(--ease);
}
.card:hover .media::after { inset: 20px; opacity: 1; }
.card .play {
  position: absolute; left: 50%; top: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px; border-radius: 50%;
  display: grid; place-items: center; font-size: 10px; letter-spacing: .2em; text-transform: uppercase;
  transform: scale(.6); opacity: 0; transition: transform .5s var(--ease), opacity .5s var(--ease), background .4s, color .4s;
}
.card:hover .play { transform: scale(1); opacity: 1; }

/* Frosted glass — the "Play film" treatment, reused wherever controls sit over imagery */
.glass, .card .play, .big-play span, .glass-btn, .lightbox .close, .lightbox .lb-prev, .lightbox .lb-next, .p-next .glass-btn {
  background: rgba(11, 11, 12, .25);
  border: 1px solid rgba(236, 232, 225, .6);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  color: var(--text);
}
.glass-btn {
  display: inline-flex; align-items: center; gap: 12px; border-radius: 100px; padding: 14px 26px;
  font-size: 11px; letter-spacing: .24em; text-transform: uppercase;
  transition: background .4s var(--ease), color .4s var(--ease), transform .5s var(--ease);
}
.glass-btn:hover, .lightbox .close:hover, .lightbox .lb-prev:hover, .lightbox .lb-next:hover { background: rgba(236,232,225,.92); color: var(--bg); }
.card .meta { display: flex; justify-content: space-between; gap: 16px; padding-top: 16px; align-items: baseline; }
.card h3 { font-family: var(--serif); font-weight: 400; font-size: 22px; margin: 0; line-height: 1.2; }
.card .cats { font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); text-align: right; white-space: nowrap; }

.card[hidden] { display: none !important; }

/* filter transitions */
.card.leaving { opacity: 0; transform: scale(.96); transition: opacity .35s var(--ease), transform .35s var(--ease); }
.card.entering { opacity: 0; transform: translateY(30px); }
.card.entered { opacity: 1; transform: none; transition: opacity .8s var(--ease), transform .8s var(--ease); }

/* index (list) view */
.grid.list { display: block; }
.grid.list .card { display: grid; grid-template-columns: 60px 1fr 1fr 170px; align-items: center; gap: 20px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.grid.list .card .media { display: none; }
.grid.list .card .meta { display: contents; }
.grid.list .card h3 { font-size: clamp(22px, 2.4vw, 36px); transition: transform .5s var(--ease); }
.grid.list .card:hover h3 { transform: translateX(14px); }
.grid.list .card .idx { display: block; }
.grid.list .card .cats { text-align: left; }
.grid.list .card .year { display: block; text-align: right; }
.card .idx, .card .year { display: none; font-size: 11px; color: var(--muted); letter-spacing: .1em; }

.empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 80px 0; }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(5,5,6,.94); display: grid; place-items: center; opacity: 0; pointer-events: none; transition: opacity .5s var(--ease); }
.lightbox.on { opacity: 1; pointer-events: auto; }
.lightbox .inner { width: min(1200px, 90vw); }
.lightbox img { width: 100%; aspect-ratio: 16/9; object-fit: cover; transform: scale(.96); transition: transform .7s var(--ease); }
.lightbox.on img { transform: none; }
.lightbox .lb-meta { display: flex; justify-content: space-between; padding-top: 20px; gap: 20px; }
.lightbox h3 { font-family: var(--serif); font-weight: 400; font-size: 34px; margin: 0; }
.lightbox .close { position: absolute; top: 28px; right: var(--pad); font-size: 11px; letter-spacing: .24em; text-transform: uppercase; border-radius: 100px; padding: 12px 22px; z-index: 2; transition: background .4s, color .4s; }

/* =========================================================
   PROJECT PAGE
   ========================================================= */
.p-hero { padding: calc(130px + 3vw) var(--pad) clamp(30px, 4vw, 56px); }
.p-hero .back { display: inline-block; margin-bottom: clamp(30px, 5vw, 70px); color: var(--muted); transition: color .3s; }
.p-hero .back:hover { color: var(--text); }
/* sized to match the Work title; padding keeps descenders (Pringles' g) inside the reveal mask */
.p-title { font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 5.8vw, 100px); line-height: 1.04; margin: 16px 0 0; overflow: hidden; padding-bottom: .16em; margin-bottom: -.16em; }
.p-title span { display: inline-block; transform: translateY(105%); transition: transform 1.3s var(--ease) .1s; }
.ready .p-title span { transform: none; }
.p-title .star { font-size: .28em; color: var(--accent); vertical-align: top; margin-left: 14px; position: relative; top: .35em; transform: none; }

/* Everything on a project page shares the video's width, so text never runs past the film's edges.
   --media-w is the widest the film can be (86% of screen height × its aspect ratio); js/project.js sets it per film. */
.project-page { --media-w: calc(86vh * 16 / 9); }
.p-hero, .p-player, .p-info, .p-gallery, .p-credits {
  max-width: calc(var(--media-w) + 2 * var(--pad)); margin-left: auto; margin-right: auto;
}
.p-player { padding: 0 var(--pad); }
.player {
  position: relative; background: #000; overflow: hidden; aspect-ratio: 16 / 9;
  max-height: 86vh; margin: 0 auto; transition: aspect-ratio .6s var(--ease);
}
.player.portrait { max-width: min(560px, 100%); }
.player video { width: 100%; height: 100%; object-fit: contain; cursor: pointer; }
.big-play {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,.45));
  transition: opacity .6s var(--ease);
}
.big-play span {
  width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid rgba(236,232,225,.6); backdrop-filter: blur(8px); background: rgba(11,11,12,.25);
  font-size: 10px; letter-spacing: .24em; text-transform: uppercase; transition: transform .6s var(--ease), background .4s;
}
.big-play:hover span { transform: scale(1.08); background: rgba(236,232,225,.92); color: var(--bg); }
.player.started .big-play { opacity: 0; pointer-events: none; }
.player-ui {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 22px;
  padding: 18px 22px; background: linear-gradient(0deg, rgba(0,0,0,.7), transparent);
  font-size: 10px; letter-spacing: .2em; text-transform: uppercase;
  opacity: 0; transform: translateY(10px); transition: all .4s var(--ease);
}
.player.started:hover .player-ui, .player.started:not(.playing) .player-ui { opacity: 1; transform: none; }
.player-ui button { font-size: 10px; letter-spacing: .2em; text-transform: uppercase; white-space: nowrap; }
.scrub { flex: 1; height: 14px; display: flex; align-items: center; cursor: pointer; position: relative; }
.scrub::before { content: ""; position: absolute; left: 0; right: 0; height: 1px; background: rgba(236,232,225,.3); }
.scrub-fill { position: absolute; left: 0; right: 0; height: 1px; background: var(--accent); transform-origin: left; transform: scaleX(0); }
.tc { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .08em; }

.cutdowns { margin-top: 26px; display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.cut-list { display: flex; gap: 12px; flex-wrap: wrap; }
.cut { width: 170px; text-align: left; opacity: .55; transition: opacity .3s; }
.cut:hover, .cut.on { opacity: 1; }
.cut img { aspect-ratio: 16/9; width: 100%; object-fit: cover; border: 1px solid transparent; }
.cut.on img { border-color: var(--accent); }
.cut span { display: block; margin-top: 8px; font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }

.p-info { display: grid; grid-template-columns: 1.7fr 1fr; gap: clamp(40px, 7vw, 120px); padding-bottom: clamp(60px, 8vw, 110px); }
.p-lead p { font-family: var(--serif); font-size: clamp(22px, 2.2vw, 32px); line-height: 1.4; margin: 0 0 1em; }
.p-facts { margin: 0; border-top: 1px solid var(--line); }
.p-facts div { padding: 18px 0; border-bottom: 1px solid var(--line); }
.p-facts dt { margin-bottom: 6px; }
.p-facts dd { margin: 0; }

.p-gallery { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(10px, 1.4vw, 20px); padding: 0 var(--pad); }
.still { margin: 0; overflow: hidden; cursor: zoom-in; aspect-ratio: 3/2; background: var(--bg-2); }
.still.full { grid-column: 1 / -1; aspect-ratio: 16/9; }
.still img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); transition: transform 1.6s var(--ease); }
.still.in img { transform: scale(1); }
.still:hover img { transform: scale(1.02); }

.credit-list { columns: 3 260px; column-gap: clamp(30px, 4vw, 70px); margin: 0; }
.credit { break-inside: avoid; padding: 14px 0; border-top: 1px solid var(--line); }
.credit dt { font-size: 10px; letter-spacing: .2em; color: var(--muted); margin-bottom: 4px; }
.credit dd { margin: 0; font-size: 15px; }
.credit.extra { display: none; }
.credit-list.all .credit.extra { display: block; animation: fadeUp .6s var(--ease) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } }
.more-credits { margin-top: 36px; color: var(--text); border: 1px solid var(--line-strong); border-radius: 100px; padding: 14px 26px; transition: background .3s, color .3s; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.more-credits:hover { background: var(--text); color: var(--bg); }

.p-next a { position: relative; display: block; height: clamp(320px, 55vh, 560px); overflow: hidden; }
.p-next img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(.45) saturate(.8); transform: scale(1.06); transition: transform 1.6s var(--ease), filter .8s var(--ease); }
.p-next a:hover img { transform: scale(1); filter: brightness(.6) saturate(1); }
.p-next-inner { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 0 var(--pad); }
.p-next-title { font-family: var(--serif); font-size: clamp(40px, 5.8vw, 100px); line-height: 1.1; margin: 18px 0 30px; transition: transform .8s var(--ease); }
.p-next a:hover .p-next-title { transform: translateY(-6px); }

.lightbox .lb-prev, .lightbox .lb-next { position: absolute; top: 50%; z-index: 2; width: 56px; height: 56px; border-radius: 50%; font-size: 18px; transform: translateY(-50%); transition: background .4s, color .4s; }
.lightbox .lb-prev { left: 10px; } .lightbox .lb-next { right: 10px; }
.lightbox .inner img { aspect-ratio: auto; max-height: 86vh; object-fit: contain; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .intro-grid { grid-template-columns: 1fr; gap: 20px; }
  .caps, .process { grid-template-columns: 1fr 1fr; }
  .cap { border-right: 0; border-bottom: 1px solid var(--line); padding-left: 0 !important; }
  .step { margin-bottom: 40px; }
  .card .media { aspect-ratio: 16 / 9; }
  .hero-inner { grid-template-columns: 1fr; }
  .p-info { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .p-gallery { grid-template-columns: 1fr; }
  .still, .still.full { aspect-ratio: 4/3; }
  .player-ui { gap: 12px; padding: 12px 14px; }
  .player-ui .fs, .player-ui .tc { display: none; }
  .big-play span { width: 90px; height: 90px; }
}
@media (max-width: 720px) {
  .nav { display: none; }
  .nav.open { display: flex; position: fixed; inset: 0; z-index: 55; flex-direction: column; justify-content: center; align-items: center; background: var(--bg); gap: 34px; }
  .nav.open a { font-size: 22px; }
  .menu-btn { display: block; position: relative; font-size: 11px; letter-spacing: .24em; text-transform: uppercase; z-index: 60; }
  .caps, .process { grid-template-columns: 1fr; }
  .card .media { aspect-ratio: 4 / 3; }
  .feature-row { grid-template-columns: 40px 1fr 30px; }
  .feature-row .tags { display: none; }
  /* index view: keep the number in its own column, title/role/categories stacked beside it */
  .grid.list .card { grid-template-columns: 34px 1fr auto; column-gap: 10px; row-gap: 4px; }
  .grid.list .card .idx { grid-column: 1; grid-row: 1; align-self: center; }
  .grid.list .card .meta-main > * { grid-column: 2; }
  /* categories sit on the right, level with the title */
  .grid.list .card .meta-main > .cats { grid-column: 3; grid-row: 1; align-self: center; text-align: right; max-width: 38vw; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .grid.list .card .year { display: none; }
  .filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
  .chip { white-space: nowrap; }
  /* phone-only refinements */
  .hero .corner.br { display: none; }                              /* read as a stray vertical line on phones */
  .marquee { padding: 22px 0; }
  .marquee-track { gap: 28px; }
  .marquee span { font-size: 22px; }
  .marquee span::after { margin-left: 28px; }
  .cta-block h2 { font-size: 13vw; line-height: 1.02; }            /* ~49px on a 375px phone, was 40px */
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal, .hero h1 .line span { opacity: 1; transform: none; }
}
