:root {
  color-scheme: dark;
  --black: #0c0d0d;
  --paper: #f1ede4;
  --muted: #b3b4ac;
  --accent: #e4efb8;
  --line: rgb(241 237 228 / 20%);
  --head: 4.5rem;
  font-family: Inter, Arial, sans-serif;
  color: var(--paper);
  background: var(--black);
}
* { box-sizing: border-box; }
html { min-height: 100%; }
body { margin: 0; min-width: 280px; }
button, a { color: inherit; }
button { font: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
a { text-decoration: none; }
a:focus-visible, button:focus-visible, ol:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
[hidden] { display: none !important; }

.masthead {
  position: fixed; z-index: 5; inset: 0 0 auto; height: var(--head);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0 clamp(1rem, 3vw, 3rem);
  background: linear-gradient(180deg, rgb(7 8 8 / 92%), rgb(7 8 8 / 0%));
}
.wordmark { font-size: clamp(1.05rem, 2.1vw, 1.55rem); font-weight: 500; letter-spacing: -.06em; white-space: nowrap; }
.masthead nav { display: flex; gap: clamp(.65rem, 2vw, 1.7rem); align-items: center; }
.masthead nav a { font-size: .83rem; color: var(--paper); padding: .38rem 0; border-bottom: 1px solid transparent; }
.masthead nav a[aria-current="page"] { border-color: var(--accent); }

.featured { height: 100svh; min-height: 480px; position: relative; isolation: isolate; overflow: hidden; background: var(--black); }
.film-image, .film-layer, .film-layer img, .film-layer video, .film-layer iframe,
.feature-shade, .archive-shade, .frame-hit { position: absolute; inset: 0; width: 100%; height: 100%; }
.film-image, .feature-shade, .archive-shade { pointer-events: none; }
.film-layer { opacity: 0; transition: opacity 650ms ease; overflow: hidden; }
.film-layer.is-visible { opacity: 1; }
.film-layer img, .film-layer video { object-fit: cover; }
.film-layer video, .film-layer iframe { opacity: 0; transition: opacity 500ms ease; }
.film-layer.is-playing video, .film-layer.is-playing iframe { opacity: 1; }
.film-layer iframe { border: 0; }
/* Vimeo encodes can contain letterboxing even when their outer frame is 16:9. */
.film-layer.is-embed iframe {
  width: max(calc(100% / var(--picture-width, 1)), calc(177.78dvh / var(--picture-height, 1)));
  height: max(calc(100% / var(--picture-height, 1)), calc(56.25dvw / var(--picture-width, 1)));
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
}
.feature-shade {
  background: linear-gradient(90deg, rgb(5 6 6 / 57%), transparent 38%, transparent 66%, rgb(5 6 6 / 30%));
}
.frame-hit { z-index: 1; cursor: pointer; }
.frame-hit:focus-visible { outline-offset: -9px; }
.text-button { font-size: .69rem; color: var(--muted); }
.text-button:hover { color: white; }
ol { list-style: none; padding: 0; margin: 0; }
#archive-list { overflow: auto; overscroll-behavior: contain; }
.film-pick {
  display: flex; align-items: center; justify-content: space-between; text-align: left; gap: .65rem;
  width: 100%; padding: .86rem 1rem .86rem 0; color: var(--paper);
}
.film-pick:hover, .film-pick[aria-current="true"] { color: var(--accent); }
.film-pick span { display: block; font-size: .94rem; font-weight: 500; }
.film-pick small { display: block; margin-top: .2rem; font-size: .69rem; font-weight: 400; color: #c1c1b6; }
.film-pick[aria-current="true"]::after { content: "●"; color: var(--accent); font-size: .55rem; }
.feature-caption, .archive-caption {
  position: absolute; z-index: 2; bottom: clamp(1.35rem, 6vh, 5rem); right: clamp(1rem, 4vw, 5rem);
  left: clamp(15rem, 28vw, 28rem); text-align: left; pointer-events: none;
}
.client { margin: 0 0 .5rem; font-size: .77rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.feature-caption h1, .archive-caption h2, .screening-caption h2 {
  font-size: clamp(2.5rem, 7vw, 7.4rem); line-height: .91; font-weight: 500; letter-spacing: -.055em;
  margin: 0 0 1.1rem; text-wrap: balance;
}
.watch {
  pointer-events: auto; display: inline-flex; align-items: center; gap: .55rem;
  padding: .35rem 0; font-size: .84rem; background: none;
  
}
.watch:hover { text-decoration: underline; text-underline-offset: .3em; }

.watch span { font-size: .63rem; }

.archive { display: grid; grid-template-columns: minmax(17rem, 31%) 1fr; height: 100svh; min-height: 480px; padding-top: var(--head); }
.archive-index { display: flex; flex-direction: column; min-height: 0; padding: 1rem clamp(1rem, 3vw, 3rem) 1.25rem; }
.archive-index header { display: flex; justify-content: space-between; align-items: baseline; gap: .6rem; border-bottom: 1px solid var(--line); padding-bottom: .95rem; }
.archive-index header h1, .contact h1 { margin: 0; font-size: clamp(2.5rem, 4vw, 3.8rem); letter-spacing: -.079em; line-height: 1; }
#archive-count { color: var(--muted); font-size: .75rem; }
#archive-list { padding: max(5px, min(12vh, 60px)) 3px 32vh; scroll-snap-type: y proximity; min-height: 0; }
#archive-list li { scroll-snap-align: start; border-bottom: 1px solid var(--line); }
#archive-list li:first-child { border-top: 1px solid var(--line); }
#archive-list .film-pick { min-height: 66px; padding: .67rem .65rem; }
#archive-list .film-pick:hover, #archive-list .film-pick[aria-current="true"] { background: rgb(228 239 184 / 7%); }
.archive-stage { position: relative; isolation: isolate; margin: 0 .9rem .9rem 0; overflow: hidden; background: #171917; }
.archive-shade { background: linear-gradient(0deg, rgb(5 6 6 / 84%), transparent 62%); }
.archive-caption { left: clamp(1.1rem, 4vw, 3.5rem); bottom: clamp(1.1rem, 5vh, 4rem); }
.archive-caption h2 { font-size: clamp(2.2rem, 5.8vw, 5.6rem); }

/* Let the on-set photo carry the page, with the copy on the darker side. */
.director {
  display: grid; justify-items: end; position: relative; isolation: isolate; min-height: 100svh;
}
.director-image { position: absolute; inset: 0; margin: 0; z-index: -2; background: #171917; }
.director-image img { display: block; position: absolute; width: 100%; height: 100%; object-fit: cover; object-position: 42% 40%; }
.director::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(90deg, transparent 30%, rgb(5 6 6 / 25%) 52%, rgb(5 6 6 / 80%) 72%, rgb(5 6 6 / 94%) 100%),
              linear-gradient(0deg, rgb(5 6 6 / 20%), transparent 43%);
}
.director-copy {
  align-self: center; width: min(38rem, 37vw); margin-right: clamp(1.5rem, 5vw, 7rem);
  padding: calc(var(--head) + 1.5rem) 0 3rem; 
}
.director h1 {
  margin: .75rem 0 1.15rem;
  font-size: clamp(1.85rem, 3.3vw, 3.35rem);
  font-weight: inherit;
  letter-spacing: -.04em;
  line-height: 1.08;
}
.director-copy p:not(.client), .contact p { color: #eeeae0; line-height: 1.6; }

.text-link { color: var(--accent); display: inline-block; border-bottom: 1px solid currentColor; padding-bottom: .2rem; }
.contact { min-height: 100svh; display: grid; place-content: center; justify-items: start; padding: var(--head) clamp(1rem, 8vw, 8rem) 2rem; gap: 1.4rem; }
.contact p { margin: 0; }

#screening {
  position: fixed; width: 100%; height: 100%; max-width: none; max-height: none; inset: 0; margin: 0;
  color: var(--paper); background: #000; border: 0; padding: 0; overflow: hidden;
}
#screening::backdrop { background: #000; }
#screening-film, #screening-film video, #screening-film iframe { position: absolute; inset: 0; height: 100%; width: 100%; border: 0; }
#screening-film video { object-fit: cover; }
#screening-film iframe {
  inset: 50% auto auto 50%;
  width: max(calc(100% / var(--picture-width, 1)), calc(100dvh * var(--film-ratio, 1.77778) / var(--picture-height, 1)));
  height: max(calc(100% / var(--picture-height, 1)), calc(100dvw / var(--film-ratio, 1.77778) / var(--picture-width, 1)));
  transform: translate(-50%, -50%);
}
#screening-film.is-framed video,
#screening-surface:fullscreen #screening-film video { object-fit: contain; }
#screening-film.is-framed iframe,
#screening-surface:fullscreen #screening-film iframe { inset: 0; width: 100%; height: 100%; transform: none; }
#screening-film.is-ended { visibility: hidden; }
.screening-caption {
  position: absolute; z-index: 1; inset: 50% 17% auto; transform: translateY(-50%);
  text-align: center; pointer-events: none;  transition: opacity 500ms ease;
}
.screening-caption.is-faded { opacity: 0; }
.screening-caption h2 { font-size: clamp(2rem, 6vw, 6.5rem); }
.screening-caption a { pointer-events: auto; }
/* Minimal text controls stay outside the central image and title. */
.screening-controls { display: contents; }
.screening-controls button, #screening-close {
  position: absolute; z-index: 2; padding: .7rem .25rem;
  font-size: .78rem; font-weight: 400;
  
}
.screening-controls button:hover, #screening-close:hover { text-decoration: underline; text-underline-offset: .3em; }
#screening-fullscreen, #screening-play, #screening-audio { left: clamp(1rem, 2.5vw, 2.7rem); }
#screening-fullscreen { top: 1.05rem; }
#screening-play { top: 50%; transform: translateY(-50%); }
#screening-audio { bottom: max(1.05rem, env(safe-area-inset-bottom)); }
#screening-close { right: clamp(1rem, 2.5vw, 2.7rem); top: 50%; transform: translateY(-50%); }
#screening-close span { margin-left: .2rem; }

@media (max-width: 750px) {
  :root { --head: 3.7rem; }
  .masthead nav a { font-size: .72rem; }

  .feature-caption { left: 1rem; right: 1rem; }
  .feature-caption h1 { font-size: clamp(2.95rem, 12vw, 5.7rem); }
  .archive { grid-template-columns: 1fr; grid-template-rows: minmax(10rem, 51%) 1fr; }
  .archive-stage { grid-row: 1; margin: 0 .55rem; }
  .archive-index { grid-row: 2; padding: .8rem 1rem; }
  .archive-index header h1 { font-size: 2rem; }
  #archive-list { padding-top: .35rem; padding-bottom: 10svh; }
  #archive-list .film-pick { min-height: 48px; }
  .archive-caption h2 { margin-bottom: .6rem; }
  .director { justify-items: start; }
  .director-image img { object-position: 55% 25%; }
  .director::after { background: linear-gradient(0deg, rgb(5 6 6 / 96%) 0%, rgb(5 6 6 / 78%) 42%, transparent 80%); }
  .director-copy { align-self: end; width: min(100%, 36rem); margin: 0; padding: max(var(--head), 37svh) 1.2rem 2.3rem; }
  #screening-close { top: 1.05rem; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .001s !important; scroll-behavior: auto !important; }
}

/* Keep the opening image clear. The film index opens only on request. */
.masthead { padding-inline: clamp(1rem, 3.7vw, 4rem); }
.wordmark { font-size: clamp(1.55rem, 3.3vw, 3.25rem); letter-spacing: -.06em; line-height: 1; }
.feature-shade {
  background: linear-gradient(90deg, rgb(5 6 6 / 57%), transparent 38%, transparent 66%, rgb(5 6 6 / 30%));
}
.feature-caption { left: clamp(1rem, 3.7vw, 4rem); bottom: clamp(5rem, 10vh, 7.4rem); }
.feature-caption h1 { font-size: clamp(2.6rem, 5.8vw, 6.2rem); }
.feature-browse {
  position: absolute; z-index: 3; bottom: clamp(1rem, 3.4vh, 2.7rem); left: clamp(1rem, 3.7vw, 4rem);
  display: flex; align-items: center; gap: 1.1rem;
}
.feature-browse a { font-size: .78rem; color: var(--paper); }
.feature-browse a:hover { text-decoration: underline; text-underline-offset: .3em; }
.feature-caption { transition: opacity 220ms ease, transform 220ms ease; }
.film-actions { display: flex; flex-wrap: wrap; gap: .45rem 1.35rem; }
.watch.secondary { color: #dedbd2; }
.archive-filters { display: flex; flex-wrap: wrap; gap: .28rem .45rem; padding: .85rem 0 .6rem; }
.archive-filters button { text-align: left; border: 1px solid transparent; padding: .27rem .5rem; border-radius: 1rem; color: var(--muted); font-size: .7rem; }
.archive-filters button[aria-pressed="true"] { border-color: var(--line); color: var(--accent); }
.archive-filters button:hover { color: var(--paper); }
@media (max-width: 750px) {
  .wordmark { font-size: clamp(1.2rem, 5vw, 2rem); }
  .feature-caption { bottom: 4rem; }
  .archive-filters { padding: .45rem 0 .35rem; }
}
#screening-surface { position: absolute; inset: 0; background: #000; }
#screening-surface::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(90deg, rgb(0 0 0 / 40%), transparent 20%, transparent 80%, rgb(0 0 0 / 36%));
}

/* Archive: a scrolling film index with a dedicated frame for the selected film. */
.archive {
  display: block; position: relative; isolation: isolate; height: 100svh; overflow: hidden;
  padding: 0; background: #0a0b0b; --archive-row: 38px;
}
.archive-stage { position: absolute; inset: 0; margin: 0; background: #0c0d0d; isolation: auto; pointer-events: none; }
.archive-index { position: absolute; z-index: 2; inset: var(--head) 0 0; padding: 0; pointer-events: none; }
.archive-index header {
  position: absolute; z-index: 2; top: .8rem; left: clamp(1rem, 3.7vw, 4rem);
  display: flex; gap: .8rem; align-items: baseline; padding: 0; border: 0;
}
.archive-index header h1 { font-size: clamp(1.25rem, 2.1vw, 1.8rem); letter-spacing: -.05em; }
.archive-filters {
  position: absolute; z-index: 2; right: clamp(1rem, 3.7vw, 4rem); top: .65rem;
  pointer-events: auto; padding: 0; justify-content: flex-end;
}
.archive-filters button { border: 0; border-radius: 0; background: none; color: var(--paper); }
.archive-filters button[aria-pressed="true"] { color: var(--accent); text-decoration: underline; text-underline-offset: .35em; }
#archive-list {
  position: absolute; inset: 3.4rem 0 0;
  pointer-events: auto; scroll-snap-type: y mandatory; scrollbar-width: none;
  padding: calc((100svh - var(--head) - 3.4rem - var(--archive-row)) / 2) 0;
  mask-image: linear-gradient(0deg, transparent, black 22%, black 80%, transparent);
}
#archive-list::-webkit-scrollbar { display: none; }
#archive-list li, #archive-list li:first-child { border: 0; height: var(--archive-row); scroll-snap-align: center; }
#archive-list .film-pick {
  width: max-content; min-width: min(29rem, 81vw); height: var(--archive-row); min-height: 0;
  margin: auto; padding: .3rem .65rem; gap: .2rem; justify-content: center; text-align: center;
  opacity: var(--fade, 1);
  transform: translateY(var(--offset, 0px));
   white-space: nowrap;
}
#archive-list .film-pick > div { display: flex; align-items: baseline; gap: .7rem; }
#archive-list .film-pick span { font-size: .9rem; opacity: calc(1 - var(--lift, 0)); }
#archive-list .film-pick small { margin-top: 0; color: #dad6cd; font-size: .73rem; transform: translateX(var(--split, 0px)); }
#archive-list .film-position { font-size: .66rem; font-weight: 400; color: #dad6cd; transform: translateX(calc(-1 * var(--split, 0px))); }
#archive-list .film-pick[aria-current="true"], #archive-list .film-pick:hover { background: transparent; }
#archive-list .film-pick[aria-current="true"]::after { display: none; }
.archive-shade {
  background: linear-gradient(90deg, rgb(0 0 0 / 40%), transparent 28%, transparent 72%, rgb(0 0 0 / 40%));
}
.archive-caption {
  z-index: 3; inset: calc(50% + (var(--head) + 3.4rem) / 2) 9% auto;
  transform: translateY(-50%); text-align: center;
}
.archive-caption h2 { font-size: clamp(2.2rem, 6.1vw, 5.6rem); }
.archive-caption .film-actions { justify-content: center; }
.archive-caption .client { display: none; }
.archive .frame-hit { pointer-events: none; }
@media (max-width: 750px) {
  .archive-index header { top: .55rem; }
  .archive-filters { top: 2.3rem; left: 1rem; right: 1rem; justify-content: flex-start; }
  #archive-list { inset-block-start: 4.5rem; padding-block: calc((100svh - var(--head) - 4.5rem - var(--archive-row)) / 2); }
  #archive-list .film-pick span { font-size: .76rem; }
  #archive-list .film-pick small { font-size: .62rem; opacity: calc(1 - var(--lift, 0)); }
  .archive-caption .client { display: block; }
  .archive-caption { inset-block-start: calc(50% + (var(--head) + 4.5rem) / 2); }
}

#featured-image:empty {
  background: var(--black) url("./preview-media/new-balance-new-mom.jpg") 50% 50% / cover no-repeat;
}

@media (max-width: 750px), (pointer: coarse) {
  .masthead nav a, .feature-browse a, .feature-browse button, .watch {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
  .feature-browse a { gap: .35rem; }
  .featured, .archive { min-height: 0; }
  .archive { --archive-row: 44px; }
  #archive-list { overflow-x: hidden; touch-action: pan-y; }
  #archive-list .film-pick { min-width: 0; max-width: 100%; }
  #archive-list .film-pick > div { min-width: 0; }
  #archive-list .film-pick span, #archive-list .film-pick small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  #screening-film video { object-fit: contain; }
  #screening-film iframe { inset: 0; width: 100%; height: 100%; transform: none; }
  .screening-controls button, #screening-close { min-width: 44px; min-height: 44px; }
  #screening-fullscreen, #screening-close { top: max(.55rem, env(safe-area-inset-top)); }
  #screening-close { transform: none; }
  #screening-play, #screening-audio {
    top: auto;
    bottom: max(.55rem, env(safe-area-inset-bottom));
    transform: none;
  }
  #screening-audio { left: auto; right: clamp(1rem, 2.5vw, 2.7rem); }
}

@media (max-width: 750px) {
  .archive {
    --list-top: 5.1rem;
  }
  .archive-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .archive-filters button { flex: 0 0 auto; min-height: 44px; white-space: nowrap; }
  #archive-list {
    inset-block-start: var(--list-top);
    padding-block: max(0px, calc((100svh - var(--head) - var(--list-top) - var(--archive-row)) / 2));
  }
  .archive-caption { inset-block-start: calc(50% + (var(--head) + var(--list-top)) / 2); }
  .archive-caption h2 { font-size: clamp(1.7rem, 7vw, 2.35rem); }
  .director-image, .director::after { position: fixed; }
  .director::after { background: linear-gradient(0deg, rgb(5 6 6 / 96%) 0%, rgb(5 6 6 / 80%) 58%, transparent 96%); }
  .director-copy { background: linear-gradient(transparent 23svh, rgb(5 6 6 / 68%) 35svh, rgb(5 6 6 / 83%)); }
}

@media (max-width: 480px) {
  :root { --head: 5.65rem; }
  .masthead { flex-direction: column; align-items: stretch; justify-content: center; gap: 0; }
  .wordmark { align-self: flex-start; }
  .masthead nav { justify-content: space-between; gap: .5rem; }
}
