/* Justin McLean – site styles. Brand: Ink / Paper / Grey / Signal Blue, Geist + Geist Mono. */
:root {
  color-scheme: dark;
  --ink: #0B0B0B;
  --paper: #F4F4F2;
  --grey: #8A8A8A;
  --blue: #244CE8;
  --sans: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --gutter: clamp(16px, 3vw, 40px);
  --header-h: 77px;
  --row-h: clamp(240px, 26vw, 460px);
  --ease: cubic-bezier(.22, .61, .36, 1);
}
@media (max-width: 719px) { :root { --header-h: 60px; } }

*, *::before, *::after { box-sizing: border-box; }
/* Ink on <html> too, so the browser's elastic bounce at the top and bottom shows Ink, not white */
html { background: var(--ink); scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overscroll-behavior-y: auto; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--ink); color: var(--paper);
  font: 400 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--paper); color: var(--ink); padding: 8px 12px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

/* Small tracked capitals: nav, labels, buttons, credits */
.caps, .site-nav a, .menu-toggle, .filters button, .row-credit {
  font: 500 12px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase;
}

/* Brush logos: one transparent PNG each, coloured by currentColor */
.mark { display: block; background: currentColor; -webkit-mask: var(--src) center / contain no-repeat; mask: var(--src) center / contain no-repeat; }
.mark-jm { --src: url(/logos/jm-mark-paper.png); width: 60px; aspect-ratio: 953 / 556; }
/* Hero wordmark: sized as on the original site – 28% of the window on tablet/desktop, near full width on phones */
.mark-wordmark { --src: url(/logos/wordmark-paper.png); width: 28.4vw; aspect-ratio: 1745 / 413; }
@media (max-width: 767px) { .mark-wordmark { width: 88vw; } }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 20; height: var(--header-h);
  display: flex; align-items: center; gap: 24px; padding: 0 var(--gutter);
  color: var(--paper); transition: background-color .4s var(--ease);
}
/* Ink/Paper switch for the light dancer slide. One animatable colour (--hero-fg) drives the logo,
   menu, wordmark and arrow together, on the original site's timing: 0.9s ease. */
@property --hero-fg { syntax: '<color>'; inherits: true; initial-value: #F4F4F2; }
body { --hero-fg: var(--paper); transition: --hero-fg .9s ease; }
body.hero-light { --hero-fg: var(--ink); }
.site-header:not(.is-solid) { color: var(--hero-fg); }
.site-header.is-solid { background: var(--ink); }
.logo { flex: none; text-decoration: none; }
.header-slot { flex: 1; display: flex; justify-content: center; min-width: 0; }
.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav .nav-icon { display: grid; place-items: center; padding: 4px 0; background: none; transition: opacity .9s ease var(--delay, 0s); }
.site-nav .nav-icon:hover { color: var(--blue); }
.nav-icon svg { width: 16px; height: 16px; }
.site-nav a { text-decoration: none; padding: 6px 0; background: linear-gradient(var(--blue), var(--blue)) left bottom / 0 1.5px no-repeat; transition: opacity .9s ease var(--delay, 0s), background-size .3s var(--ease); }
.site-nav a:hover { background-size: 100% 1.5px; }
.menu-toggle { display: none; }

@media (max-width: 719px) {
  .menu-toggle { display: block; margin-left: auto; padding: 10px 0; }
  .header-slot { display: none; }
  .site-nav {
    position: fixed; inset: var(--header-h) 0 auto; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--ink); color: var(--paper); padding: 8px var(--gutter) 24px;
    transform: translateY(-8px); opacity: 0; visibility: hidden; transition: opacity .25s, transform .25s, visibility .25s;
  }
  .site-nav a { font-size: 14px; padding: 16px 0; border-top: 1px solid #222; background: none; }
  .site-nav .nav-icon { place-items: center start; padding: 16px 0; }
  .menu-open .site-nav { opacity: 1; visibility: visible; transform: none; }
  /* open menu sits above the sticky filter bar */
  .menu-open .site-header { background: var(--ink); color: var(--paper); z-index: 40; }
}

/* ---------- Hero ---------- */
.hero { position: relative; height: 100vh; height: 100svh; min-height: 480px; overflow: hidden; background: var(--ink); }
.hero-slides, .hero-slide { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-slide { object-fit: cover; opacity: 0; transition: opacity var(--fade, 1600ms) ease; }
.hero-slide.is-active { opacity: 1; }
.hero-shade {
  position: absolute; inset: 0 0 auto; height: 180px; pointer-events: none;
  background: linear-gradient(rgba(11,11,11,.38), rgba(11,11,11,0)); transition: opacity .9s ease;
}
body.hero-light .hero-shade { opacity: 0; }
.hero-title { position: absolute; inset: 0; margin: 0; display: grid; place-items: center; color: var(--hero-fg); pointer-events: none; }
/* Down arrow: thin V chevron with a periodic nudge; quicker bob on hover (as on the original site) */
.hero-arrow {
  position: absolute; left: 50%; bottom: 5vh; translate: -50% 0;
  display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 56px;
  color: var(--hero-fg); text-decoration: none;
}
.hero-arrow::before {
  content: ""; display: block; width: 24px; height: 24px;
  border-right: 2.25px solid currentColor; border-bottom: 2.25px solid currentColor;
  transform: translateY(-7px) rotate(45deg);
  animation: jm-nudge 2.8s ease-in-out 1.5s infinite;
}
@keyframes jm-nudge {
  0%, 55%, 100% { transform: translateY(-7px) rotate(45deg); }
  68% { transform: translateY(5px) rotate(45deg); }
  78% { transform: translateY(-5px) rotate(45deg); }
  87% { transform: translateY(1px) rotate(45deg); }
}
@keyframes jm-bob { 0%, 100% { transform: translateY(-7px) rotate(45deg); } 50% { transform: translateY(4px) rotate(45deg); } }
@media (hover: hover) { .hero-arrow:hover::before { animation: jm-bob .9s ease-in-out infinite; } }
.hero-arrow:focus-visible { outline: 1px solid currentColor; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .hero-arrow::before, .hero-arrow:hover::before { animation: none; } }

/* ---------- Filters ---------- */
/* The bar sits at the top of the project list. Once it reaches the header the script pins it
   (position: fixed), so it stays locked in place right to the bottom of the page, bounce included.
   The wrapper keeps its space in the layout, so pinning never makes the page jump. */
.work { position: relative; }
.filters-wrap { position: relative; z-index: 25; height: var(--header-h); margin-bottom: calc(var(--header-h) * -1); }
/* the wrap is only a placeholder: let clicks through to the header when it sits under it */
.filters-wrap { pointer-events: none; }
.filters {
  position: absolute; inset: 0 0 auto; height: var(--header-h);
  display: flex; align-items: center; justify-content: center; gap: 28px;
  pointer-events: none;
}
.filters.is-fixed { position: fixed; top: 0; z-index: 25; }
.filters > * { pointer-events: auto; }
.filters button { padding: 8px 0; color: var(--grey); transition: color .2s; background: linear-gradient(var(--blue), var(--blue)) left bottom / 0 1.5px no-repeat; }
.filters button:hover { color: var(--paper); }
.filters button[aria-pressed="true"] { color: var(--paper); background-size: 100% 1.5px; }
.filters button[hidden] { display: none; }
.rows { padding-top: var(--header-h); min-height: 100vh; min-height: 100svh; } /* a short filtered list can still lock the filter bar */
/* Narrower windows: filters sit in their own bar just under the header, never over the nav */
@media (max-width: 959px) {
  .filters-wrap { height: 48px; margin-bottom: 0; }
  .filters { height: 48px; background: var(--ink); gap: 24px; overflow-x: auto; scrollbar-width: none; padding: 0 var(--gutter); }
  .filters.is-fixed { top: var(--header-h); }
  .filters button { white-space: nowrap; }
  .rows { padding-top: 0; }
}
@media (max-width: 479px) {
  .filters { gap: 10px; justify-content: space-between; }
  .filters button { font-size: 10.5px; letter-spacing: .06em; }
}

/* ---------- Project rows ---------- */
.row { position: relative; display: grid; place-items: center; height: var(--row-h); overflow: hidden; text-decoration: none; background: #151515; }
.row[hidden] { display: none; }
.row-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(var(--zoom, 1)); transition: transform .9s var(--ease); }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .row:hover .row-img { transform: scale(calc(var(--zoom, 1) * 1.04)); }
}
/* Title + credit: sizes, spacing and shadows measured from the original site */
/* 15% Ink over every folio image, as on the original, so titles read on bright frames */
.row::after { content: ""; position: absolute; inset: 0; background: var(--ink); opacity: .15; pointer-events: none; }
.row-text { position: relative; z-index: 1; display: grid; justify-items: center; gap: 7px; padding: 0 var(--gutter); text-align: center; }
.row-title { margin: 0; font: 500 30.12px/1.15 var(--sans); letter-spacing: normal; color: #fff; text-shadow: 0 1px 14px rgba(0,0,0,.35), 0 0 2px rgba(0,0,0,.25); }
.row-credit { line-height: 1.4; color: var(--paper); text-shadow: 0 1px 10px rgba(0,0,0,.35), 0 0 2px rgba(0,0,0,.25); }
@media (max-width: 1023px) { .row-title { font-size: 23.86px; } }
@media (max-width: 767px) { .row-title { font-size: 24.12px; } }

/* ---------- Footer ---------- */
.site-footer { padding: 3vw 0; overflow: hidden; }
.marquee { display: block; overflow: hidden; text-decoration: none; }
.marquee-track { display: flex; width: max-content; animation: marquee 28s linear infinite; }
.marquee-track span { font: 500 clamp(17px, 1.625vw, 26px)/1.4 var(--sans); padding-right: 1.8em; white-space: nowrap; }
.marquee:not(.marquee-static):hover .marquee-track { animation-play-state: paused; }
.marquee:not(.marquee-static):hover .marquee-track span { text-decoration: underline; text-decoration-color: var(--blue); text-decoration-thickness: .04em; text-underline-offset: .12em; }
@keyframes marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none; } }

/* ---------- Fade-in animations ----------
   Matches the original site's Squarespace setting: fade, 0.9s, ease.
   Header items fade in on load with a short stagger; everything else fades in as it scrolls into view.
   Only active when <html class="anim"> (scripts on, motion allowed). */
[data-anim] { transition: opacity .9s ease var(--delay, 0s); }
.anim [data-anim]:not(.is-in) { opacity: 0; }
/* Content blocks also rise a little as they fade in */
[data-anim="rise"] { transition: opacity .9s ease var(--delay, 0s), transform 1.1s cubic-bezier(.2,.7,.2,1) var(--delay, 0s); }
.anim [data-anim="rise"]:not(.is-in) { transform: translateY(28px); }
/* Images wait until fully loaded, then fade in */
.anim img.img-wait { opacity: 0; }
.anim img.img-in { animation: img-in .7s ease both; }
@keyframes img-in { from { opacity: 0; } }
.anim .hero-slide.is-first { animation: hero-in 1.4s ease both; }
@keyframes hero-in { from { opacity: 0; } }
.hero-arrow { transition: opacity .9s ease var(--delay, 0s); }
.row, .filters button { transition: opacity .9s ease var(--delay, 0s), color .2s, background-size .3s var(--ease); }

/* ---------- Light pages (Paper background, Ink type) – e.g. Don't Stop the Dance ---------- */
html.theme-light, html.theme-light body { background: var(--paper); color: var(--ink); }
html.theme-light body { --hero-fg: var(--ink); }
html.theme-light .site-header, html.theme-light .site-header.is-solid { background: var(--paper); color: var(--ink); }
@media (max-width: 719px) {
  html.theme-light .menu-open .site-header { background: var(--ink); color: var(--paper); }
}

/* ---------- Project pages (ported from the original "JM project page" code) ---------- */
.mono { font: 400 13px/1.5 var(--mono); letter-spacing: 0; }
.page-project main { padding-top: var(--header-h); }
.project {
  --g: clamp(16px, 4vw, 64px); --gap: clamp(12px, 1.6vw, 28px);
  padding: clamp(8px, 1.5vw, 24px) var(--g) clamp(64px, 8vw, 128px);
}
.project a { text-decoration: none; border-bottom: 1.5px solid currentColor; transition: border-color .2s, color .2s; }
.project a:hover { border-bottom-color: var(--blue); }
.project .caps { line-height: 1.5; }

/* film: as large as fits on screen, never cropped */
.project { --placeholder: #1A1A1A; }
html.theme-light .project { --placeholder: #E4E4E0; }
.project-film { width: min(100%, calc((100svh - 150px) * (var(--aspect)))); aspect-ratio: var(--aspect); margin: 0 auto; position: relative; background: var(--placeholder); }
.project-film-caption { width: min(100%, calc((100svh - 150px) * (var(--aspect, 16/9)))); margin: 14px auto 0; display: flex; gap: 16px; align-items: baseline; color: var(--grey); }
.project-film iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }

/* title, copy, credits */
.project-intro { max-width: 1440px; margin: clamp(48px, 7vw, 112px) auto 0; display: grid; grid-template-columns: repeat(12, 1fr); gap: 40px var(--gap); align-items: start; }
.project-head { grid-column: 1 / span 7; }
.project-meta { display: flex; gap: 20px; align-items: baseline; margin: 0 0 20px; }
.project h1 { font: 500 clamp(36px, 5vw, 72px)/1.02 var(--sans); letter-spacing: -.02em; margin: 0; text-wrap: balance; }
.project-copy { font-size: clamp(17px, 1.35vw, 20px); line-height: 1.5; max-width: 40ch; margin: 28px 0 0; }
.project-credits { grid-column: 9 / span 4; margin: 0; padding-top: 6px; display: grid; grid-template-columns: auto 1fr; gap: 14px 24px; align-items: baseline; }
.project-credits dt { margin: 0; }
.project-credits dd { margin: 0; font-size: 16px; line-height: 1.4; }

/* stills: 12-column editorial grid */
.project-stills { max-width: 1440px; margin: clamp(80px, 10vw, 160px) auto 0; }
.project-stills-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; border-top: 1.5px solid currentColor; padding-top: 14px; margin-bottom: clamp(28px, 4vw, 56px); }
.project-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gap); align-items: end; }
.project-grid figure { margin: 0; }
.project-grid button { all: unset; display: block; width: 100%; cursor: zoom-in; }
.project-grid button:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
.project-grid img { display: block; width: 100%; height: auto; background: var(--placeholder); }
.slot-third { grid-column: span 4; }
.slot-wide { grid-column: 2 / span 10; margin: calc(var(--gap) * 2.5) 0 !important; }
.slot-pair-left { grid-column: 2 / span 5; }
.slot-pair-right { grid-column: 7 / span 5; }
.slot-inset-left { grid-column: 3 / span 4; }
.slot-inset-right { grid-column: 7 / span 4; }
.slot-space { grid-column: 1 / -1; height: calc(var(--gap) * 1.5); }
/* landscape film frames: a full-width frame, then a pair */
.slot-full { grid-column: 1 / -1; }
.slot-half-left { grid-column: 1 / span 6; }
.slot-half-right { grid-column: 7 / span 6; }
.slot-half-right + .slot-full { margin-top: calc(var(--gap) * 2) !important; }
.slot-full + .slot-half-left, .slot-full + .slot-half-left + .slot-half-right { margin-top: 0; }

.project-end { max-width: 1440px; margin: clamp(80px, 10vw, 160px) auto 0; display: flex; justify-content: space-between; gap: 16px; }
.project-end a { border-bottom-color: transparent; }
.project-end a:hover { border-bottom-color: var(--blue); }

/* lightbox: Paper background, arrows, Esc, 01 / 11 counter */
.lightbox { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px 88px; /* controls live in the corners and side gutters, so the photo gets nearly the full window */ background: var(--paper); color: var(--ink); }
html:not(.theme-light) .lightbox { background: var(--ink); color: var(--paper); }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; width: auto; height: auto; display: block; }
.lightbox button { appearance: none; background: none; border: 0; padding: 12px; cursor: pointer; color: inherit; position: absolute; font: inherit; }
.lightbox button:hover { color: var(--blue); }
.lightbox .lb-close { top: 10px; right: 8px; padding: 12px 8px; }
.lightbox .lb-prev, .lightbox .lb-next { top: 50%; transform: translateY(-50%); font-size: 24px; }
.lightbox .lb-prev { left: 16px; }
.lightbox .lb-next { right: 16px; }
.lightbox .lb-count { position: absolute; bottom: 22px; left: 24px; }

@media (max-width: 900px) {
  .project-head, .project-credits { grid-column: 1 / -1; }
  .project-intro { gap: 36px var(--gap); }
}
@media (max-width: 640px) {
  .project-film { width: 100%; }
  .project-grid { grid-template-columns: 1fr; gap: 16px; }
  .project-grid > figure { grid-column: 1 / -1 !important; margin: 0 !important; }
  .slot-space { display: none; }
  .project-grid button { cursor: default; }
}

/* ---------- Dark project pages (Ink) ---------- */
html:not(.theme-light) .project-grid img { background: #1A1A1A; }
html:not(.theme-light) .project-credits dt,
html:not(.theme-light) .project-meta .caps { color: var(--paper); }

/* Pull quote: the text a film is built on (e.g. MHS cantata), with a short note beside it */
.project-quote {
  max-width: 1440px; margin: clamp(80px, 10vw, 160px) auto 0;
  display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px var(--gap); align-items: end;
  border-top: 1.5px solid currentColor; padding-top: 14px;
}
.project-quote-label { grid-column: 1 / -1; margin: 0 0 clamp(20px, 3vw, 44px); }
.project-quote blockquote {
  grid-column: 1 / span 7; margin: 0;
  font: 500 clamp(26px, 3.2vw, 48px)/1.12 var(--sans); letter-spacing: -.015em; text-wrap: balance;
}
.project-quote blockquote span { display: block; }
.project-quote-note { grid-column: 9 / span 4; margin: 0; font-size: clamp(16px, 1.15vw, 18px); line-height: 1.5; max-width: 38ch; }
@media (max-width: 900px) {
  .project-quote blockquote, .project-quote-note { grid-column: 1 / -1; }
}

/* Full credits: folded under a toggle, groups in columns */
.project-full-credits { max-width: 1440px; margin: clamp(80px, 10vw, 160px) auto 0; border-top: 1.5px solid currentColor; }
.project-full-credits summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center;
  padding: 14px 0; user-select: none;
}
.project-full-credits summary::-webkit-details-marker { display: none; }
.project-full-credits summary:hover .caps { text-decoration: underline; text-decoration-color: var(--blue); text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
.project-full-credits summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
.project-full-credits .toggle { position: relative; width: 14px; height: 14px; }
.project-full-credits .toggle::before, .project-full-credits .toggle::after {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1.5px; margin-top: -.75px; background: currentColor;
  transition: transform .3s var(--ease);
}
.project-full-credits .toggle::after { transform: rotate(90deg); }
.project-full-credits[open] .toggle::after { transform: rotate(0deg); }
.fc-groups { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px var(--gap); padding: clamp(20px, 3vw, 40px) 0 8px; }
.fc-group h2 { margin: 0 0 22px; color: var(--grey); }
.fc-group dl { margin: 0; display: grid; gap: 16px; }
.fc-group dt { margin: 0 0 4px; }
.fc-group dd { margin: 0; font-size: 15px; line-height: 1.45; }
@media (max-width: 900px) { .fc-groups { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .fc-groups { grid-template-columns: 1fr; } }

/* Copy can run to more than one paragraph */
.project-copy + .project-copy { margin-top: 1em; }
/* Full credits sit directly under the main metadata, so a smaller gap above them */
.project-intro + .project-full-credits { margin-top: clamp(48px, 6vw, 96px); }

/* Full credits: one column per group (up to 3) */
.fc-groups { grid-template-columns: repeat(var(--groups, 3), 1fr); }
@media (max-width: 900px) { .fc-groups { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .fc-groups { grid-template-columns: 1fr; } }

/* Awards & festivals: poster beside a numbered-free list of festivals */
.project-festivals { max-width: 1440px; margin: clamp(80px, 10vw, 160px) auto 0; }
.project-full-credits + .project-festivals { margin-top: clamp(48px, 6vw, 96px); }
.project-section-head { border-top: 1.5px solid currentColor; padding-top: 14px; margin-bottom: clamp(28px, 4vw, 56px); }
.festivals-body { display: grid; grid-template-columns: repeat(12, 1fr); gap: 32px var(--gap); align-items: start; }
.festivals-poster { grid-column: 1 / span 3; margin: 0; }
.festivals-poster img { width: 100%; height: auto; display: block; background: #1A1A1A; }
.festivals-list { grid-column: 1 / -1; list-style: none; margin: 0; padding: 0; }
.festivals-body.has-poster .festivals-list { grid-column: 5 / -1; }
.festivals-list li {
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "name year" "result result";
  gap: 6px 24px; padding: 18px 0; border-bottom: 1px solid rgba(244,244,242,.18);
}
html.theme-light .festivals-list li { border-bottom-color: rgba(11,11,11,.18); }
.festivals-list li:first-child { padding-top: 0; }
.fest-name { grid-area: name; font: 500 clamp(18px, 1.6vw, 24px)/1.25 var(--sans); letter-spacing: -.005em; }
.fest-year { grid-area: year; color: var(--grey); }
.fest-result { grid-area: result; color: var(--grey); }
.festivals-list li.is-win .fest-result { color: inherit; }
@media (max-width: 900px) {
  .festivals-poster { grid-column: 1 / span 5; }
  .festivals-body.has-poster .festivals-list { grid-column: 1 / -1; }
}
@media (max-width: 640px) { .festivals-poster { grid-column: 1 / span 8; } }

/* Case study: label column + text column, one row per topic */
.project-case { max-width: 1440px; margin: clamp(80px, 10vw, 160px) auto 0; }
.case-row { display: grid; grid-template-columns: repeat(12, 1fr); gap: 12px var(--gap); padding: 0 0 clamp(28px, 3.5vw, 48px); }
.case-row h2 { grid-column: 1 / span 3; margin: 0; padding-top: 4px; }
.case-text { grid-column: 5 / span 6; }
.case-text p { margin: 0; font-size: clamp(17px, 1.35vw, 20px); line-height: 1.5; max-width: 52ch; }
.case-text p + p { margin-top: 1em; }
.case-links { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 18px !important; font-size: 16px !important; }
@media (max-width: 900px) {
  .case-row h2 { grid-column: 1 / -1; }
  .case-text { grid-column: 1 / -1; }
}

/* Labelled groups inside a stills grid */
.slot-label { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 24px; padding-top: clamp(28px, 4vw, 64px); }
.slot-label:first-child { padding-top: 0; }
.slot-label h3 { margin: 0; }
.slot-label p { margin: 0; font-size: 16px; line-height: 1.4; color: var(--grey); }
html.theme-light .slot-label p { color: #5E5E5E; }
@media (max-width: 640px) { .project-grid > .slot-label { grid-column: 1 / -1 !important; padding-top: 24px; } }

/* ---------- Info page (ported from the live "JM Info page" code) ---------- */
/* Desktop: screenplay on the left (cols ~6–45vw), headshot on the right, sticky while the script scrolls */
.info-main {
  /* wider side margins; the photo keeps a 4:5 portrait shape at any width */
  --shot-w: min(36vw, calc(min(100vh - 150px, 860px) * .8));
  display: grid; grid-template-columns: minmax(9vw, 1fr) minmax(0, 760px) 6vw var(--shot-w) minmax(9vw, 1fr); align-items: start;
  padding: calc(var(--header-h) + max(3vw, 24px)) 0 0;
}
.info-script { grid-column: 2; }
.info-headshot { grid-column: 4; margin: 0; position: sticky; top: 110px; aspect-ratio: 4 / 5; border-radius: 12px; overflow: hidden; margin-bottom: max(10vw, 120px); }
.info-headshot img { width: 100%; height: 100%; object-fit: cover; display: block; background: #1A1A1A; }

/* Screenplay: Geist Mono, standard script indents */
.script { font: 400 clamp(13px, 1.05vw, 15px)/1.55 var(--mono); max-width: 62ch; color: var(--paper); padding: 0 0 1em; }
.script p { margin: 0; }
.script .sh { font-weight: 500; margin-bottom: 1.55em; }
.script .ac { margin-bottom: .2em; }
.script .ch { margin: 1.55em 0 0 22ch; }
.script .pa { margin-left: 16ch; }
.script .dl { margin-left: 10ch; max-width: 36ch; }
.script .dl + .dl { margin-top: 1.55em; }
.script .tr { text-align: right; margin-top: 2.5em; }

/* Credits / Awards accordion */
.info-acc { padding: 3vw 0 max(10vw, 120px); max-width: 640px; }
.acc-item { border-bottom: 1px solid rgba(244,244,242,.25); }
.acc-item:first-child { border-top: 1px solid rgba(244,244,242,.25); }
.acc-item summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; padding: 30px 0; }
.acc-item summary::-webkit-details-marker { display: none; }
.acc-item summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
.acc-title { font: 500 16.68px/1.2 var(--sans); color: #D6D6D2; transition: color .2s; }
.acc-item summary:hover .acc-title { color: var(--paper); }
.acc-icon { position: relative; width: 14px; height: 14px; flex: none; }
.acc-icon::before, .acc-icon::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: currentColor; transition: transform .3s var(--ease); }
.acc-icon::after { transform: rotate(90deg); }
.acc-item[open] .acc-icon::after { transform: rotate(0deg); }
.acc-body { overflow: hidden; }
.acc-inner { padding: 0 0 30px; font: 400 15px/24px var(--sans); }
.acc-inner p { margin: 0; }
.acc-inner p + p { margin-top: 24px; }
.acc-inner strong { font-weight: 500; }
.acc-inner ul { margin: 0; padding-left: 1.2em; }
.award-name { text-decoration: underline; text-underline-offset: 2px; }

/* SAY HELLO strip between the main section and the contact block */
.info-marquee { padding: 2.8vw 0; overflow: hidden; }

/* Contact block over the Zambia still */
.info-contact { position: relative; min-height: max(42vw, 480px); display: flex; align-items: center; overflow: hidden; }
.info-contact-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.info-contact::after { content: ""; position: absolute; inset: 0; background: var(--ink); opacity: .15; pointer-events: none; }
.info-contact-text { position: relative; z-index: 1; margin-left: 14vw; padding: 48px 0; color: var(--paper); }
.info-contact-text .cta { font: 400 clamp(17px, 1.5vw, 21px)/1.4 var(--sans); max-width: 30ch; margin: 0 0 1.6em; }
.contact-link { margin: 0 0 .9em; }
.contact-link a {
  font: 500 clamp(17px, 1.35vw, 20px)/1.4 var(--sans); white-space: nowrap; text-decoration: none; color: var(--paper);
  background: linear-gradient(var(--paper), var(--paper)) 0 100% / 100% 1.5px no-repeat; padding-bottom: 5px;
  transition: background-size .35s ease;
}
.contact-link a::after { content: "\2192"; display: inline-block; margin-left: .45em; transition: transform .35s ease; }
@media (hover: hover) {
  .contact-link a:hover { background-image: linear-gradient(var(--blue), var(--blue)); background-size: 100% 3px; }
  .contact-link a:hover::after { transform: translateX(4px); }
}
.contact-link a:focus-visible { outline: 2px solid var(--blue); outline-offset: 6px; }
@media (prefers-reduced-motion: reduce) { .contact-link a, .contact-link a::after { transition: none; } }

/* Phones: headshot, then script, then accordion */
@media (max-width: 767px) {
  .info-main { grid-template-columns: var(--gutter) minmax(0, 1fr) var(--gutter); }
  .info-headshot { grid-column: 2; grid-row: 1; position: static; border-radius: 8px; margin-bottom: 0; }
  .info-script { grid-column: 2; grid-row: 2; padding-top: 10vw; }
  .script { font-size: 13px; }
  .script .ch { margin-left: 12ch; }
  .script .pa { margin-left: 8ch; }
  .script .dl { margin-left: 3ch; max-width: none; }
  .info-acc { padding: 10vw 0 18vw; }
  .info-contact { min-height: 120vw; }
  .info-contact-text { margin: 0 var(--gutter); }
}

/* ---------- Home-page intro (assets/intro.js) ---------- */
.jm-intro { display: none; }
html.intro .jm-intro { display: grid; place-items: center; position: fixed; inset: 0; z-index: 300; color: var(--paper); cursor: pointer; }
.jm-intro > * { grid-area: 1 / 1; }
.intro-bg { position: absolute; inset: 0; background: var(--ink); transition: opacity .9s ease; }
.intro-word { position: relative; display: inline-block; white-space: nowrap; line-height: 1.1; visibility: hidden; font-kerning: normal; }
.intro-mark { position: relative; opacity: 0; }
.jm-intro.is-mark .intro-word { display: none; }
.jm-intro.is-mark .intro-mark { opacity: 1; }
.jm-intro.is-out { pointer-events: none; }
.jm-intro.is-out .intro-bg { opacity: 0; }
/* the first hero still starts its fade-in as the intro hands over, not underneath it */
html.intro:not(.intro-done) .hero-slide.is-first { animation: none; opacity: 0; }

/* ---------- 404 ---------- */
.notfound { min-height: 100vh; min-height: 100svh; display: grid; place-content: center; justify-items: center; gap: 18px; text-align: center; padding: var(--header-h) var(--gutter); }
.notfound h1 { font: 500 clamp(28px, 3.4vw, 48px)/1.15 var(--sans); margin: 0; max-width: 18ch; }
.notfound p { margin: 0; }
.notfound .caps { color: var(--grey); }
.notfound-link { font: 500 clamp(17px, 1.35vw, 20px)/1.4 var(--sans); color: inherit; text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1.5px no-repeat; padding-bottom: 5px; }
.notfound-link::after { content: "\2192"; display: inline-block; margin-left: .45em; transition: transform .35s ease; }
@media (hover: hover) { .notfound-link:hover { background-image: linear-gradient(var(--blue), var(--blue)); background-size: 100% 3px; } .notfound-link:hover::after { transform: translateX(4px); } }

/* ---------- Video portraits + large portrait slots (Valerie Browning) ---------- */
/* Videos run edge to edge (full bleed); the article clips the overhang so no sideways scroll */
.project:has(video) { overflow-x: clip; }
.project-film-video { width: 100vw; max-width: none; margin-left: calc(50% - 50vw); }
.slot-video { grid-column: 1 / -1; position: relative; aspect-ratio: var(--aspect); width: 100vw; margin: calc(var(--gap) * 2.5) 0 calc(var(--gap) * 2.5) calc(50% - 50vw) !important; }
.project-film video, .slot-video video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; background: #1A1A1A; }
/* Portraits: as large as the window allows (never taller than the screen), always at their true shape */
.slot-portrait { grid-column: 1 / -1; margin: calc(var(--gap) * 2.5) 0 !important; }
.slot-portrait-left { grid-column: 1 / span 6; }
.slot-portrait-right { grid-column: 7 / span 6; }
.project-grid :is(.slot-portrait, .slot-portrait-left, .slot-portrait-right) button { display: flex; }
.project-grid :is(.slot-portrait, .slot-portrait-left, .slot-portrait-right) img {
  width: auto; height: auto; max-width: 100%; max-height: min(calc(100vh - 120px), 1400px); max-height: min(calc(100svh - 120px), 1400px);
  aspect-ratio: auto; background: none;
}
.slot-portrait img { margin: 0 auto; }
.slot-portrait-left img { margin-left: auto; }
.slot-portrait-right img { margin-right: auto; }
.project-links { margin: 24px 0 0; display: flex; flex-wrap: wrap; gap: 8px 24px; }
.project-links a { font: 500 15px/1.4 var(--sans); color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
@media (hover: hover) { .project-links a:hover { text-decoration-color: var(--blue); text-decoration-thickness: 1.5px; } }
@media (max-width: 640px) {
  .project-grid :is(.slot-portrait, .slot-portrait-left, .slot-portrait-right) img { width: 100%; max-height: none; }
  .project-grid > figure.slot-video { margin: 8px 0 8px calc(50% - 50vw) !important; }
}

/* ---------- Full-bleed film / video at the top of project pages, running behind the header ---------- */
.page-project:has([data-cover]) main { padding-top: 0; }
.project:has([data-cover]) { padding-top: 0; overflow-x: clip; }
.project-film[data-cover] {
  width: 100vw; max-width: none; margin: 0 0 0 calc(50% - 50vw); aspect-ratio: auto;
  height: min(calc(100vw / (var(--aspect))), 100vh); height: min(calc(100vw / (var(--aspect))), 100svh);
  background: var(--ink);
}
/* the silent video portrait fills the whole screen */
.project-film-video[data-cover] { height: 100vh; height: 100svh; }
.project-film[data-cover] + .project-film-caption { width: auto; max-width: 1440px; }
/* header sits transparent over it (Paper, with a soft shade for legibility), solid again once past */
html body.has-cover:not(.menu-open) .site-header:not(.is-solid) { background: transparent; color: var(--paper); }
body.has-cover:not(.menu-open) .site-header::before {
  content: ""; position: absolute; inset: 0 0 auto; height: calc(var(--header-h) * 1.8); z-index: -1; pointer-events: none;
  background: linear-gradient(rgba(11,11,11,.42), rgba(11,11,11,0)); opacity: 1; transition: opacity .4s var(--ease);
}
body.has-cover .site-header.is-solid::before { opacity: 0; }

/* A row whose cover has the face in the middle: title sits near the bottom edge instead ("coverText": "bottom") */
.row-text-bottom { place-items: end center; }
.row-text-bottom .row-text { padding-bottom: clamp(18px, 2.4vw, 40px); }

/* Embedded film inside a gallery (Vimeo / YouTube): full bleed, true shape, never taller than the screen */
.slot-film { grid-column: 1 / -1; position: relative; aspect-ratio: var(--aspect); width: 100vw; margin: calc(var(--gap) * 2.5) 0 0 calc(50% - 50vw) !important; background: #1A1A1A; }
.slot-film iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.slot-film-caption { grid-column: 1 / -1; display: flex; gap: 20px; align-items: baseline; margin: 14px 0 calc(var(--gap) * 2.5); }
@media (max-width: 640px) { .project-grid > figure.slot-film { width: 100vw; margin: 8px 0 0 calc(50% - 50vw) !important; } }

/* Still at the top of a project page instead of a film: fills the screen, behind the header */
.project-film-image[data-cover] { height: 100vh; height: 100svh; }
.project-film-image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }

/* Section label with a rule above it (a line between sections, e.g. Barbara May Foundation) */
.slot-label.has-rule { border-top: 1.5px solid currentColor; padding-top: 14px; margin-top: clamp(40px, 6vw, 96px); }
.slot-label.has-rule:first-child { margin-top: 0; }
@media (max-width: 640px) { .project-grid > .slot-label.has-rule { padding-top: 14px; margin-top: 40px; } .project-grid > .slot-label.has-rule:first-child { margin-top: 0; } }

/* Unequal pair: one photo dominant (8 of 12 columns), its partner smaller (4) */
.slot-major-left { grid-column: 1 / span 8; }
.slot-minor-right { grid-column: 9 / span 4; }
.slot-minor-left { grid-column: 1 / span 4; }
.slot-major-right { grid-column: 5 / span 8; }

/* Row of photos at one height, no cropping */
.slot-row { grid-column: 1 / -1; display: flex; gap: var(--gap); align-items: flex-start; }
.slot-row figure { margin: 0; min-width: 0; }
@media (max-width: 640px) { .project-grid > .slot-row { flex-direction: column; gap: 16px; } .slot-row figure { flex: none !important; } }

/* Faster reveal so it keeps up with quick scrolling (21 Oct): shorter, smaller rise, short stagger */
[data-anim] { transition-duration: .55s; }
[data-anim="rise"] { transition: opacity .55s ease var(--delay, 0s), transform .75s cubic-bezier(.2,.7,.2,1) var(--delay, 0s); }
.anim [data-anim="rise"]:not(.is-in) { transform: translateY(18px); }
.anim [data-anim].anim-now { transition: none !important; }
.anim img.img-in { animation-duration: .4s; }

/* Project / Info pages open blank at the top, then the first screen appears together (see site.js) */
html { overflow-anchor: none; }
html.opening .site-header, html.opening main, html.opening footer { opacity: 0; }
html.opened .site-header, html.opened main, html.opened footer { animation: page-in .4s ease backwards; }
@keyframes page-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { html.opened .site-header, html.opened main, html.opened footer { animation: none; } }

/* Next project: a work-page row at the end of every project page, full width */
.project { overflow-x: clip; }
.project a.next-project { display: grid; margin: clamp(80px, 10vw, 160px) calc(-1 * var(--g)) 0; border-bottom: 0; color: inherit; }
.next-project .row-text { gap: 10px; }
.next-project .row-title span { display: inline-block; transition: transform .3s var(--ease); }
@media (hover: hover) { .next-project:hover .row-title span { transform: translateX(6px); } }
.next-project + .project-end { margin-top: clamp(28px, 3vw, 48px); }
/* Reel carousel: vertical social clips drifting slowly sideways, looping. Hover pauses it. */
.reel { overflow: hidden; margin: 0 calc(-1 * var(--g)); padding: clamp(8px, 1.5vw, 24px) 0 0; }
.reel-track { display: flex; gap: clamp(8px, 1vw, 16px); width: max-content; animation: reel-drift var(--reel-dur, 90s) linear infinite; }
.reel-card { margin: 0; flex: none; height: clamp(380px, 72svh, 780px); aspect-ratio: 9 / 16; background: var(--placeholder, #1A1A1A); overflow: hidden; }
.reel-card video { display: block; width: 100%; height: 100%; object-fit: cover; }
@keyframes reel-drift { to { transform: translateX(calc(-50% - clamp(4px, .5vw, 8px))); } }
@media (hover: hover) { .reel:hover .reel-track { animation-play-state: paused; } }
@media (max-width: 640px) { .reel-card { height: 62svh; } }
@media (prefers-reduced-motion: reduce) { .reel { overflow-x: auto; } .reel-track { animation: none; } .reel-card[aria-hidden] { display: none; } }
/* Reel: rounded (bevelled) corners, each clip opens large in a viewer */
.reel-card { border-radius: clamp(10px, 1.2vw, 18px); }
.reel-open { appearance: none; display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.reel-lb video { display: block; max-width: 100%; max-height: 100%; height: 100%; aspect-ratio: 9 / 16; object-fit: contain; border-radius: clamp(10px, 1.2vw, 18px); background: #000; }
body.lb-open { overflow: hidden; }
@media (max-width: 640px) { .reel-lb { padding: 56px 12px; } .reel-lb .lb-prev, .reel-lb .lb-next { top: auto; bottom: 8px; transform: none; } .reel-lb .lb-prev { left: auto; right: 64px; } }
