@font-face {
  font-family: "DM Sans";
  src: url("assets/dm-sans.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f4f4ef;
  --ink: #181b1c;
  --muted: #51565b;
  --rule: #bfc3c4;
  --blue: #a3bff0;
  --edge: clamp(18px, 3.15vw, 64px);
  --sans: "DM Sans", Arial, sans-serif;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
body:is([data-layout="browse"], [data-layout="portfolio"]) {
  color-scheme: dark;
  --paper: #101113;
  --ink: #fff;
  --muted: #c2c5c9;
  --rule: #434549;
  color: var(--ink);
  background: var(--paper);
}
a { color: inherit; text-underline-offset: .2em; }
button { font: inherit; }
h1, h2, h3, p { margin: 0; }
img, video { display: block; }
::selection { color: #181b1c; background: var(--blue); }
:focus-visible { outline: 3px solid #456dcc; outline-offset: 4px; }
:is([data-layout="browse"], [data-layout="portfolio"]) :focus-visible { outline-color: var(--blue); }
[hidden] { display: none !important; }

.visually-hidden, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link:focus {
  position: fixed;
  inset: 10px auto auto 10px;
  z-index: 5;
  padding: 10px 14px;
  color: #181b1c;
  background: var(--blue);
}

.site-header {
  width: min(100%, 1700px);
  margin-inline: auto;
  padding: 9px var(--edge);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px clamp(24px, 4vw, 68px);
}
.identity {
  display: inline-grid;
  min-height: 44px;
  align-items: center;
  font-size: clamp(1rem, 1.65vw, 1.43rem);
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.05;
}
.site-navigation { display: flex; align-items: center; justify-content: space-between; flex: 1; gap: 8px 24px; }
.menu-toggle { display: none; }
.identity:focus-visible, .site-header :is(nav, .site-actions) :focus-visible { outline-offset: 2px; }
.site-header :is(nav, .site-actions) {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 2px clamp(12px, 2vw, 28px);
  font-size: .875rem;
}
.site-header :is(nav, .site-actions) a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  text-decoration: none;
  white-space: nowrap;
}
.site-header :is(nav, .site-actions) a:hover, .site-header :is(nav, .site-actions) a:focus-visible { text-decoration: underline; }
.site-header .portfolio-tabs { justify-content: flex-start; }
.portfolio-tabs a[aria-current], .site-actions a[aria-current] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: .48em;
}
.site-header .site-actions { flex-shrink: 0; }
.motion-control {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 0;
  min-height: 42px;
  cursor: pointer;
  white-space: nowrap;
}
.motion-control:hover { color: var(--ink); text-decoration: underline; }

.frame {
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  aspect-ratio: var(--frame-ratio);
  min-width: 0;
  width: 100%;
  background: #16191a;
}
.frame > picture, .frame > video { grid-area: 1 / 1; min-height: 0; min-width: 0; }
.frame img, .frame video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.frame video { visibility: hidden; pointer-events: none; }
.frame video[data-playing] { visibility: visible; }

.project-detail {
  width: min(100%, 1700px);
  margin-inline: auto;
  padding-inline: var(--edge);
}
.project-link { display: block; text-decoration: none; }
.project-caption p {
  margin-top: 4px;
  color: var(--muted);
  font-size: .875rem;
}

.screenings .project-card + .project-card { border-top: 2px solid #101113; }
.screenings .project-link:focus-visible { outline-offset: -4px; }
.screenings .frame { position: relative; overflow: hidden; }
.screenings .project-caption {
  position: absolute;
  inset: 0;
  color: #fff;
  background: linear-gradient(180deg, transparent 14%, #06070864 40%, #06070899 65%, #060708ce);
  pointer-events: none;
}
.screenings .caption-copy {
  position: absolute;
  inset: min(61%, max(24%, calc(100svh - 11rem))) var(--edge) auto;
  text-shadow: 0 1px 12px #060708bf;
}
/* Reveal the preview and remove its title and scrim in the same state change. */
.screenings .frame:has(video[data-playing]) .project-caption { opacity: 0; }
.screenings h2 {
  font-size: clamp(1.45rem, 3.4vw, 4rem);
  font-weight: 500;
  line-height: 1.03;
  letter-spacing: -.035em;
  text-wrap: pretty;
}
.screenings .project-caption p { color: #e4e5e6; }
.watch-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 50px;
  padding: 5px var(--edge);
  font-size: .875rem;
}
.watch-mark {
  position: relative;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 32px;
  aspect-ratio: 1;
  border: 1px solid currentColor;
  border-radius: 50%;
}
.watch-mark::before {
  content: "";
  margin-inline-start: 3px;
  width: 8px;
  height: 10px;
  background: currentColor;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
/* Only the first card names the action; the rest show just the play mark, kept on the right. */
.watch-mark:only-child { margin-inline-start: auto; }
.project-link:hover .watch-mark { color: #101113; background: var(--blue); border-color: var(--blue); }

[data-layout="browse"] :is(.site-header, main, .site-footer) { max-width: 860px; margin-inline: auto; }
[data-layout="browse"] .site-header { padding: 8px var(--edge); }
[data-layout="browse"] .screenings .project-card + .project-card { border-top: 1px solid var(--rule); }

.archive {
  max-width: 1600px;
  margin-inline: auto;
  padding: clamp(34px, 6vw, 92px) var(--edge) 0;
}
.archive h2 {
  margin-bottom: clamp(17px, 2.5vw, 32px);
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-weight: 500;
  letter-spacing: -.035em;
}
.treatment-list { list-style: none; padding: 0; max-width: 42rem; }
.treatment-list li { border-top: 1px solid var(--rule); }
.treatment-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  gap: 12px;
  padding-block: 10px;
}
.treatment-list span { color: var(--muted); font-size: .875rem; }
.archive-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: clamp(19px, 3vw, 40px) clamp(12px, 2.2vw, 36px);
}
.archive-section + .archive-section { margin-top: clamp(24px, 4vw, 56px); }
.archive-section h3 { margin-bottom: 14px; font-size: 1.125rem; font-weight: 500; }
.archive .project-caption { padding-block: 10px 12px; }
.archive .project-caption :is(h3, h4) { margin: 0; font-size: clamp(1rem, 2vw, 1.55rem); font-weight: 500; letter-spacing: -.025em; }
.archive .project-link:hover :is(h3, h4) { text-decoration: underline; }
[data-layout="browse"] .archive-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.site-footer {
  max-width: 1700px;
  margin: clamp(45px, 8vw, 108px) auto 0;
  padding: clamp(25px, 4vw, 55px) var(--edge);
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px 28px;
}
[data-layout="browse"] .site-footer { margin-top: 42px; }
.footer-directory {
  display: flex;
  flex: 0 0 100%;
  flex-wrap: wrap;
  gap: 0 clamp(18px, 3vw, 42px);
  font-size: .9375rem;
}
.footer-directory a {
  display: flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
}
.footer-directory a:is(:hover, :focus-visible, [aria-current]) { text-decoration: underline; }
@media (max-width: 480px) {
  .footer-directory { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.footer-contact {
  font: 500 clamp(2.4rem, 5vw, 4.6rem)/1 var(--sans);
  letter-spacing: -.04em;
  text-decoration: none;
}
.footer-contact:hover { text-decoration: underline; }
.footer-email { font-size: 1rem; text-underline-offset: .25em; }
.footer-legal { flex: 0 0 100%; color: var(--muted); font-size: .8125rem; }

.project-detail { max-width: 1240px; }
.back-link {
  display: inline-block;
  padding-block: 10px;
  color: var(--muted);
  font-size: .875rem;
}
.detail-caption { padding-block: clamp(10px, 2vw, 26px) clamp(15px, 2vw, 26px); }
.detail-caption h1 {
  font: 500 clamp(2.15rem, 6vw, 5.25rem)/1 var(--sans);
  letter-spacing: -.04em;
  text-wrap: pretty;
}
.detail-caption p { margin-top: 10px; color: var(--muted); }
.detail-caption p span { margin-inline: 5px; }
.full-film { position: relative; aspect-ratio: var(--frame-ratio); background: #16191a; }
.full-film video { width: 100%; height: 100%; }
.play-film {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  border: 1px solid var(--blue);
  border-radius: 999px;
  padding: 0 26px 0 22px;
  color: #101113;
  background: var(--blue);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 6px 30px #0006;
  transition: background-color .2s ease, border-color .2s ease;
}
.play-film::before { content: ""; width: 10px; height: 12px; background: currentColor; clip-path: polygon(0 0, 100% 50%, 0 100%); }
.play-film:hover, .play-film:focus-visible { background: #fff; border-color: #fff; }
.quality-link button, .video-error button, .project-actions button {
  color: var(--ink);
  background: transparent;
  border: 0;
  padding: 10px 0;
  text-decoration: underline;
  text-underline-offset: .2em;
  cursor: pointer;
}
.project-notes {
  margin-block: 22px 10px;
  max-width: 66ch;
  line-height: 1.6;
}
.project-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 12px; }
.project-actions span { color: var(--muted); font-size: .875rem; }
.detail-link { width: fit-content; color: #253d71; }
.related { border-top: 1px solid var(--rule); padding-top: 23px; margin-top: 32px; }
.related h2 { font-size: 1.85rem; font-weight: 500; line-height: 1.1; margin-bottom: 15px; }
.related-link { display: inline-grid; gap: 9px; width: min(100%, 390px); text-decoration: none; }
.related-link:hover { text-decoration: underline; }
.related-link span { font-size: 1.05rem; padding-bottom: 4px; }

@media (max-width: 760px) {
  .site-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2px 12px;
  }
  .site-header .identity { grid-row: 1; grid-column: 1; }
  .site-navigation { grid-column: 1 / -1; flex-wrap: wrap; }
  .site-header .portfolio-tabs { gap: 0 16px; }
  .site-header[data-menu-ready] .menu-toggle {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
    min-width: 70px;
    min-height: 44px;
    padding: 0;
    border: 0;
    color: inherit;
    background: none;
    font-size: .875rem;
    cursor: pointer;
  }
  .menu-icon {
    display: block;
    width: 18px;
    height: 7px;
    border-block: 1px solid currentColor;
  }
  .site-header[data-menu-ready]:not([data-menu-open]) .site-navigation { display: none; }
  .site-header[data-menu-open] .site-navigation { display: block; padding-block: 14px 8px; }
  .site-header[data-menu-open] .portfolio-tabs {
    display: grid;
    align-items: start;
    grid-template-columns: 1fr;
    font-size: clamp(1.4rem, 6vw, 2.15rem);
    font-weight: 500;
    letter-spacing: -.025em;
  }
  .site-header[data-menu-open] .portfolio-tabs a[aria-current] { text-underline-offset: .23em; }
  .site-header[data-menu-open] .site-actions {
    justify-content: flex-start;
    border-top: 1px solid var(--rule);
    margin-top: 12px;
  }
  .archive-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .frame { aspect-ratio: var(--phone-ratio, var(--frame-ratio)); }
  .site-header { align-items: flex-start; padding-block: 9px; }
  .identity { align-self: center; max-width: 20ch; }
  .site-header .site-actions { gap: 2px 12px; }
  .site-header :is(nav, .site-actions) a { min-height: 44px; }
  .site-header .motion-control { min-height: 36px; }
  .full-film { width: calc(100% + var(--edge) * 2); margin-inline: calc(var(--edge) * -1); }
}
@media (max-width: 420px) {
  .site-header .portfolio-tabs {
    gap: 0 clamp(4px, calc((100vw - 320px) / 4), 16px);
    font-size: .8125rem;
  }
}
@media (max-width: 360px) {
  .identity { font-size: .94rem; }
}

@media (max-width: 760px) and (orientation: portrait) {
  html:has(.screenings) { scroll-snap-type: y proximity; }
  body:has(.screenings) { position: relative; }
  body:has(.screenings) .site-header[data-menu-ready] {
    position: absolute;
    z-index: 3;
    inset: 0 0 auto;
    padding: max(10px, env(safe-area-inset-top)) var(--edge) 20px;
    background: linear-gradient(180deg, #101113cf, #10111370 68%, transparent);
  }
  body:has(.screenings) .site-header[data-menu-open] { background: var(--paper); }
  .screenings .project-card { position: relative; }
  .site-header[data-menu-ready] + main .screenings .project-card:first-child,
  .screenings .project-card + .project-card { scroll-snap-align: start; }
  .screenings .project-card .frame {
    aspect-ratio: 9 / 16;
    height: auto;
  }
  .screenings .project-card .frame :is(img, video) {
    object-fit: cover;
  }
  /* Blurred card with titles -> titles fade -> preview dissolves in over the un-blurring still. */
  .screenings .project-card .frame img { transition: filter .9s ease, transform .9s ease; }
  .screenings [data-preview-pending] .frame img {
    filter: blur(12px);
    transform: scale(1.095);
  }
  .screenings .project-card .frame video {
    visibility: visible;
    opacity: 0;
    transition: opacity .9s ease;
  }
  .screenings .project-card .frame video[data-playing] { opacity: 1; }
  .screenings .project-caption {
    background: linear-gradient(180deg, transparent 22%, #101113a8 53%, #10111331 79%, #10111366);
    transition: opacity .55s ease;
  }
  .screenings [data-preview-start] .project-caption { opacity: 0; }
  .screenings .caption-copy { inset-block-start: 52%; }
  .screenings .project-caption h2 {
    font-size: clamp(1.75rem, 8vw, 3.3rem);
    font-weight: 400;
    line-height: 1.06;
    letter-spacing: -.03em;
    text-wrap: pretty;
  }
  .screenings .project-caption p { margin-top: 8px; font-size: clamp(.95rem, 4.5vw, 1.24rem); }
}

/* Short dark pages: keep the area below the footer dark too. */
:root:has(body:is([data-layout="browse"], [data-layout="portfolio"])) { background: #101113; }

/* Buttons: one filled blue pill for the main action, one outline. */
.button-primary, .button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 28px;
  border-radius: 999px;
  font: 600 1rem/1 var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}
.button-primary { color: #101113; background: var(--blue); border: 1px solid var(--blue); }
.button-primary:hover, .button-primary:focus-visible { background: #fff; border-color: #fff; }
.button-secondary { color: var(--ink); background: transparent; border: 1px solid var(--rule); }
.button-secondary:hover, .button-secondary:focus-visible { border-color: var(--ink); }

/* Header Contact reads as a button on every page. */
.site-header .site-actions a[href="/contact/"] {
  min-height: 36px;
  padding: 0 18px;
  border: 1px solid var(--blue);
  border-radius: 999px;
  transition: background-color .2s ease, color .2s ease;
}
.site-header .site-actions a[href="/contact/"]:is(:hover, :focus-visible, [aria-current]) {
  color: #101113;
  background: var(--blue);
  text-decoration: none;
}
[data-layout="project"] .site-header .site-actions a[href="/contact/"] { border-color: var(--ink); }
[data-layout="project"] .site-header .site-actions a[href="/contact/"]:is(:hover, :focus-visible) { color: var(--paper); background: var(--ink); }

/* Contact: question, label, hello, button; portrait beside on wide screens. */
.contact {
  max-width: 1600px;
  margin-inline: auto;
  padding: clamp(40px, 8vw, 120px) var(--edge) 0;
  display: grid;
  gap: clamp(40px, 6vw, 96px);
  align-items: end;
}
.contact:has(.contact-portrait) { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.contact-question {
  max-width: 16ch;
  font-size: clamp(2.1rem, 5.4vw, 4.75rem);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -.04em;
  text-wrap: balance;
}
.contact-label {
  margin-top: clamp(40px, 6vw, 80px);
  color: var(--muted);
  font-size: .8125rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.contact-email {
  display: inline-block;
  margin-top: 6px;
  font-size: clamp(1.15rem, 2.4vw, 2.1rem);
  font-weight: 500;
  letter-spacing: -.02em;
  line-height: 1.1;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.email-user {
  display: block;
  margin-inline-start: -.055em; /* optical: pull the h stem onto the column edge */
  font-size: clamp(5rem, 15vw, 11.5rem);
  line-height: .86;
  letter-spacing: -.055em;
}
.contact-email:is(:hover, :focus-visible) { text-decoration: underline; text-decoration-color: var(--blue); text-decoration-thickness: 2px; }
.contact-buttons { display: flex; flex-wrap: wrap; gap: 12px 14px; margin-top: clamp(28px, 3.5vw, 44px); }
.contact-portrait { width: 100%; max-width: 560px; height: auto; justify-self: end; }
.not-found .contact-question { margin-top: 14px; }
.not-found .contact-label { margin-top: 0; }
@media (max-width: 860px) {
  .contact:has(.contact-portrait) { grid-template-columns: minmax(0, 1fr); }
  .contact-portrait { justify-self: stretch; max-width: none; }
}
@media (max-width: 480px) {
  .contact-buttons > * { flex: 1 1 100%; }
}
