:root {
  --background: #fbfbf8;
  --surface: #ecece7;
  --ink: #111111;
  --muted: #686864;
  --line: rgba(17, 17, 17, 0.26);
  --page-x: clamp(1.25rem, 2.7vw, 2.75rem);
  --header-height: 5rem;
  --space-s: 1rem;
  --space-m: clamp(1.75rem, 3.5vw, 3.75rem);
  --space-l: clamp(4rem, 8vw, 8rem);
  --space-xl: clamp(7rem, 14vw, 14rem);
  --mono: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--background);
  color: var(--ink);
  color-scheme: light;
  font-family: var(--mono);
  font-size: 100%;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 20rem;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  overflow-x: clip;
  background: var(--background);
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.5;
}

img {
  display: block;
  max-width: 100%;
}

picture {
  display: contents;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration: none;
}

a:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 0.3rem;
}

h1,
h2,
p,
figure,
dl,
dd {
  margin: 0;
}

ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.skip-link {
  position: fixed;
  top: 0;
  left: var(--page-x);
  z-index: 100;
  padding: 0.65rem 0.8rem;
  transform: translateY(-120%);
  background: var(--ink);
  color: var(--background);
  font-size: 0.875rem;
}

.skip-link:focus {
  transform: translateY(0.5rem);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: var(--header-height);
  padding: 0 var(--page-x);
  border-bottom: 1px solid var(--line);
  background: var(--background);
  font-size: 0.875rem;
  letter-spacing: 0.045em;
}

.site-name,
.site-nav a {
  text-decoration: none;
}

.site-name {
  width: max-content;
  font-weight: 500;
}

.site-nav {
  display: flex;
  gap: clamp(1.5rem, 3.2vw, 3rem);
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
}

.site-nav a[aria-current] {
  text-decoration: underline;
}

/* Work index */
.index-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(20rem, 0.78fr);
  gap: clamp(2.5rem, 6vw, 7rem);
  min-height: calc(100svh - var(--header-height));
  padding: clamp(2rem, 4vw, 4rem) var(--page-x) var(--page-x);
  align-items: start;
}

.index-column {
  min-width: 0;
}

.index-heading {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: clamp(2.25rem, 5vh, 4rem);
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.index-heading h1 {
  font: inherit;
}

.desktop-scroll-cue {
  display: none;
}

.project-list {
  border-bottom: 1px solid var(--line);
}

.project-item {
  border-top: 1px solid var(--line);
}

.project-link {
  display: grid;
  grid-template-columns: 2.7rem minmax(0, 1fr) minmax(12rem, 0.46fr);
  gap: 1rem;
  align-items: baseline;
  padding: clamp(1.05rem, 2.3vh, 1.55rem) 0;
  text-decoration: none;
}

.project-number,
.project-meta {
  font-size: 0.75rem;
  letter-spacing: 0.025em;
}

.project-number,
.project-meta time {
  font-variant-numeric: tabular-nums;
}

.project-title {
  max-width: 22ch;
  font-size: clamp(1.35rem, 2.55vw, 2.85rem);
  font-weight: 400;
  letter-spacing: -0.06em;
  line-height: 0.97;
  transition: transform 160ms ease;
}

.project-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.85rem;
  align-items: start;
  color: var(--muted);
  line-height: 1.35;
}

.project-meta time {
  color: var(--ink);
}

.project-link:hover .project-title,
.project-link:focus-visible .project-title {
  transform: translateX(0.16em);
}

.project-inline-preview {
  display: none;
}

.preview-stage {
  position: sticky;
  top: calc(var(--header-height) + clamp(2rem, 4vw, 4rem));
  min-width: 0;
  height: calc(100svh - var(--header-height) - clamp(4rem, 8vw, 8rem));
  min-height: 30rem;
}

.preview-panel {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.preview-panel.is-active {
  opacity: 1;
}

/* Images and graceful fallbacks */
.media-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: var(--ratio, 3 / 2);
  background: var(--surface);
}

.media-frame--preview {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  background: transparent;
}

.media-image {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.project-inline-preview .media-image {
  object-fit: cover;
}

.js .media-image {
  opacity: 0;
  transition: opacity 180ms ease;
}

.js .media-frame.is-loaded .media-image {
  opacity: 1;
}

.media-frame.is-missing .media-image {
  display: none;
}

.media-placeholder {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem;
  align-content: end;
  padding: clamp(0.8rem, 1.5vw, 1.25rem);
  color: var(--muted);
  font-size: 0.6875rem;
  letter-spacing: 0.025em;
  line-height: 1.3;
  opacity: 0;
}

.media-placeholder span:last-child {
  justify-self: end;
  overflow-wrap: anywhere;
  text-align: right;
}

.js .media-placeholder {
  opacity: 1;
  transition: opacity 180ms ease;
}

.js .media-frame.is-loaded .media-placeholder {
  opacity: 0;
}

.media-frame--preview .media-placeholder {
  align-content: center;
  justify-content: center;
  grid-template-columns: auto;
  text-align: center;
}

.media-frame--preview .media-placeholder span:last-child {
  justify-self: center;
  max-width: 28ch;
  color: var(--ink);
  font-size: 0.875rem;
  text-align: center;
}

/* Project pages */
.project-page {
  padding: clamp(3.5rem, 7vw, 7rem) var(--page-x) var(--page-x);
}

.project-intro {
  display: grid;
  grid-template-columns: 3rem minmax(17rem, 1fr) minmax(15rem, 22rem);
  column-gap: var(--space-m);
  row-gap: clamp(2.25rem, 4vw, 4rem);
  align-items: start;
}

.project-intro > .project-number {
  padding-top: 0.45rem;
}

.project-intro-title h1 {
  max-width: 15ch;
  font-size: clamp(2.4rem, 5vw, 5.8rem);
  font-weight: 400;
  letter-spacing: -0.07em;
  line-height: 0.9;
}

.project-page--long-title .project-intro-title h1 {
  max-width: 19ch;
  font-size: clamp(2.1rem, 4.25vw, 4.9rem);
}

.project-details {
  display: grid;
  gap: 0.8rem;
  font-size: 0.8125rem;
  line-height: 1.45;
}

.project-details div {
  display: grid;
  grid-template-columns: 5.25rem 1fr;
  gap: 0.75rem;
}

.project-details dt {
  color: var(--muted);
}

.project-details dd {
  overflow-wrap: anywhere;
}

.project-copy {
  grid-column: 2;
  display: grid;
  gap: 1.15rem;
  max-width: 64ch;
  font-size: 1rem;
  line-height: 1.58;
}

.project-copy em {
  font-style: normal;
}

.project-gallery {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(1.5rem, 3.5vw, 4rem);
  row-gap: clamp(5rem, 11vw, 12rem);
  align-items: start;
  margin-top: var(--space-xl);
}

.gallery-item {
  min-width: 0;
}

.gallery-item--full {
  grid-column: 1 / -1;
}

.gallery-item--wide-left {
  grid-column: 1 / 10;
}

.gallery-item--wide-right {
  grid-column: 4 / -1;
}

.gallery-item--center {
  grid-column: 3 / 11;
}

.gallery-item--half-left {
  grid-column: 1 / 7;
}

.gallery-item--half-right {
  grid-column: 7 / -1;
}

.gallery-item--portrait-left {
  grid-column: 1 / 6;
}

.gallery-item--portrait-right {
  grid-column: 8 / -1;
}

.gallery-item--portrait-center {
  grid-column: 4 / 10;
}

.gallery-item--drop {
  margin-top: clamp(3rem, 8vw, 9rem);
}

.gallery-item figcaption {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.55rem;
  color: var(--muted);
  font-size: 0.6875rem;
  letter-spacing: 0.03em;
}

.project-navigation {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  margin-top: var(--space-xl);
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.875rem;
}

/* Info, legal pages and 404 */
.info-page {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  min-height: calc(100svh - var(--header-height));
  padding: clamp(3.5rem, 8vw, 8rem) var(--page-x) var(--page-x);
  column-gap: var(--space-m);
}

.info-page > h1,
.info-page > .page-label {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.info-content {
  width: min(100%, 54rem);
}

.bio h1,
.bio h2 {
  margin-bottom: clamp(2.5rem, 6vh, 5rem);
  font-size: clamp(1.8rem, 4.5vw, 4.75rem);
  font-weight: 400;
  letter-spacing: -0.06em;
  line-height: 0.95;
}

.bio p {
  max-width: 48ch;
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  line-height: 1.5;
}

.bio p + p {
  margin-top: 1rem;
}

.bio-portrait {
  width: min(62%, 17rem);
  margin: 0 0 clamp(2rem, 5vh, 3.5rem);
}

.bio-portrait img {
  width: 100%;
  height: auto;
}

.contact {
  display: grid;
  grid-template-columns: minmax(6rem, 0.35fr) 1fr;
  gap: 1rem;
  margin-top: var(--space-l);
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.contact h2,
.contact dl {
  font-size: 0.875rem;
  font-weight: 400;
}

.contact dl {
  display: grid;
  gap: 0.7rem;
}

.contact dl div {
  display: grid;
  grid-template-columns: minmax(6rem, 0.4fr) 1fr;
  gap: 1rem;
}

.contact dt {
  color: var(--muted);
}

.contact dd {
  overflow-wrap: anywhere;
}

.info-footer {
  grid-column: 2;
  align-self: end;
  margin-top: var(--space-l);
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.875rem;
  text-align: right;
}

.legal-page {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  column-gap: var(--space-m);
  min-height: calc(100svh - var(--header-height));
  padding: clamp(3.5rem, 8vw, 8rem) var(--page-x) var(--space-l);
}

.legal-label {
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.legal-document {
  width: min(100%, 46rem);
}

.legal-document h1 {
  margin-bottom: var(--space-l);
  font-size: clamp(1.8rem, 4.25vw, 4.25rem);
  font-weight: 400;
  letter-spacing: -0.06em;
  line-height: 0.95;
}

.legal-document h2 {
  margin-top: 2.75rem;
  margin-bottom: 0.85rem;
  font-size: 0.875rem;
  font-weight: 400;
}

.legal-document h2:first-of-type {
  margin-top: 0;
}

.legal-document p,
.legal-document address {
  max-width: 68ch;
  font-size: 0.875rem;
  line-height: 1.65;
}

.legal-document p + p {
  margin-top: 0.9rem;
}

.legal-document address {
  font-style: normal;
}

.legal-document address + p {
  margin-top: 0.9rem;
}

.legal-footer {
  display: flex;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 0 var(--page-x) 1rem;
  color: var(--muted);
  font-size: 0.6875rem;
  letter-spacing: 0.035em;
  line-height: 1.4;
  text-transform: uppercase;
}

.legal-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  text-decoration: none;
}

.legal-footer a:hover,
.legal-footer a:focus-visible,
.legal-footer a[aria-current="page"] {
  text-decoration: underline;
}

.not-found {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(100svh - var(--header-height));
  padding: var(--page-x);
}

.not-found p {
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.not-found h1 {
  margin-bottom: 3rem;
  font-size: clamp(2rem, 5vw, 5rem);
  font-weight: 400;
  letter-spacing: -0.06em;
}

.not-found a {
  width: max-content;
  font-size: 0.875rem;
}

@media (max-width: 68rem) and (min-width: 48rem) {
  .index-shell {
    grid-template-columns: minmax(0, 1.4fr) minmax(17rem, 0.72fr);
    gap: 2.25rem;
  }

  .project-link {
    grid-template-columns: 2.3rem minmax(0, 1fr);
    gap: 0.75rem;
  }

  .project-meta {
    grid-column: 2;
    margin-top: 0.25rem;
  }

  .project-intro {
    grid-template-columns: 2.5rem minmax(15rem, 1fr) minmax(12rem, 0.5fr);
  }
}

/* Image-led work index for laptops and desktops with a precise pointer. */
@media (min-width: 48rem) and (any-hover: hover) and (any-pointer: fine) {
  .page-home .index-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "preview"
      "index";
    gap: 0;
    min-height: calc(100svh - var(--header-height));
    padding-top: 0;
  }

  .page-home .preview-stage {
    grid-area: preview;
    top: var(--header-height);
    z-index: 5;
    height: 60svh;
    min-height: 18rem;
    border-bottom: 1px solid var(--line);
    background: var(--background);
  }

  .page-home .preview-panel {
    inset: clamp(1rem, 2vh, 1.5rem) 0;
  }

  .page-home .index-column {
    grid-area: index;
    min-width: 0;
    padding-top: 1.5rem;
  }

  .page-home .index-heading {
    margin-bottom: 1.5rem;
  }

  .page-home .project-link {
    grid-template-columns: 2.7rem minmax(0, 1fr) minmax(12rem, 0.46fr);
    gap: 1rem;
    padding-block: clamp(0.9rem, 2vh, 1.35rem);
  }

  .page-home .project-title {
    position: relative;
    font-size: clamp(1.2rem, 2.25vw, 2.5rem);
  }

  .page-home .project-title::before {
    content: ">";
    position: absolute;
    top: 0.21em;
    right: calc(100% + 0.55em);
    color: var(--muted);
    font-size: 0.68em;
    letter-spacing: 0;
    line-height: 1;
    opacity: 0;
    transform: translateX(-0.12em) scaleX(1.12);
    transform-origin: center;
    transition:
      opacity 160ms ease,
      transform 160ms ease;
  }

  .page-home .project-link:hover .project-title,
  .page-home .project-link:focus-visible .project-title {
    transform: translateX(0.42em);
  }

  .page-home .project-link:hover .project-title::before,
  .page-home .project-link:focus-visible .project-title::before {
    opacity: 1;
    transform: translateX(0) scaleX(1.12);
  }

  .page-home .project-meta {
    grid-column: auto;
    margin-top: 0;
  }

  .page-home .desktop-scroll-cue {
    display: inline;
  }
}

@media (min-width: 48rem) and (max-height: 50rem) and (any-hover: hover) and (any-pointer: fine) {
  .page-home .preview-stage {
    height: 55svh;
  }

  .page-home .index-column {
    padding-top: 1.25rem;
  }

  .page-home .index-heading {
    margin-bottom: 1.25rem;
  }
}

@media (max-width: 47.99rem) {
  :root {
    --header-height: 4.5rem;
    --page-x: 1rem;
  }

  .site-header {
    font-size: 0.8125rem;
  }

  .site-nav {
    gap: 1.25rem;
  }

  .index-shell {
    display: block;
    min-height: auto;
    padding-top: 1.5rem;
  }

  .index-heading {
    margin-bottom: 2rem;
  }

  .project-link {
    grid-template-columns: 2.25rem minmax(0, 1fr);
    gap: 0.75rem;
    align-items: start;
    padding: 1rem 0 1.25rem;
  }

  .project-title {
    max-width: none;
    font-size: clamp(1.4rem, 7vw, 2.15rem);
    line-height: 0.98;
  }

  .project-meta {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    justify-content: space-between;
    gap: 1.25rem;
    margin-top: 0.2rem;
  }

  .project-inline-preview {
    display: block;
    grid-column: 1 / -1;
    grid-row: 3;
    width: 100%;
    margin-top: 1rem;
  }

  .preview-stage {
    display: none;
  }

  .project-link:hover .project-title,
  .project-link:focus-visible .project-title {
    transform: none;
  }

  .project-page {
    padding-top: clamp(2.25rem, 6vh, 4rem);
  }

  .project-intro {
    grid-template-columns: 2.25rem minmax(0, 1fr);
    column-gap: 0.75rem;
    row-gap: 2rem;
  }

  .project-intro > .project-number {
    padding-top: 0.2rem;
  }

  .project-intro-title h1 {
    max-width: none;
    font-size: clamp(2.15rem, 11vw, 4rem);
    line-height: 0.92;
  }

  .project-page--long-title .project-intro-title h1 {
    max-width: none;
    font-size: clamp(1.75rem, 9.2vw, 3.4rem);
  }

  .project-details,
  .project-copy {
    grid-column: 2;
  }

  .project-details {
    gap: calc(0.8rem - 1px);
  }

  .project-details div {
    grid-template-columns: 4.75rem minmax(0, 1fr);
  }

  .project-gallery {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    row-gap: clamp(4rem, 17vw, 6rem);
    margin-top: clamp(4.5rem, 16vw, 7rem);
  }

  .gallery-item--full,
  .gallery-item--wide-left,
  .gallery-item--wide-right,
  .gallery-item--center,
  .gallery-item--half-left,
  .gallery-item--half-right {
    grid-column: 1 / -1;
  }

  .gallery-item--portrait-left,
  .gallery-item--portrait-right,
  .gallery-item--portrait-center {
    grid-column: 1 / -1;
    width: 84%;
  }

  .gallery-item--portrait-left {
    justify-self: start;
  }

  .gallery-item--portrait-right {
    justify-self: end;
  }

  .gallery-item--portrait-center {
    justify-self: center;
  }

  .gallery-item--drop {
    margin-top: 0;
  }

  .project-navigation {
    align-items: flex-start;
    margin-top: clamp(5rem, 20vw, 8rem);
    font-size: 0.8125rem;
  }

  .info-page {
    display: block;
    min-height: calc(100svh - var(--header-height));
    padding-top: clamp(2.75rem, 8vh, 5rem);
  }

  .info-page > h1,
.info-page > .page-label {
    margin-bottom: clamp(3.5rem, 12vh, 6rem);
  }

  .contact {
    display: block;
  }

  .contact h2 {
    margin-bottom: 2.5rem;
  }

  .contact dl div {
    grid-template-columns: 5.5rem minmax(0, 1fr);
  }

  .info-footer {
    margin-top: var(--space-l);
  }

  .legal-page {
    display: block;
    padding-top: clamp(2.75rem, 8vh, 5rem);
  }

  .legal-label {
    margin-bottom: clamp(3.5rem, 12vh, 6rem);
  }

  .legal-document h1 {
    margin-bottom: clamp(3.5rem, 12vw, 5rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Venues and festivals: quieter than work titles and primary links. */
.venue-link {
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-color: #9a9a94;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
}

.venue-link:hover,
.venue-link:focus-visible {
  text-decoration-color: currentColor;
}

/* "Credits ↓" jump link and the full credits block at the end of film pages. */
html {
  scroll-behavior: smooth;
}

.credits-jump {
  margin-left: 0.5em;
  color: var(--muted);
  white-space: nowrap;
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-color: #9a9a94;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
}

.credits-jump:hover,
.credits-jump:focus-visible {
  color: var(--ink);
  text-decoration-color: currentColor;
}

.project-credits {
  display: grid;
  grid-template-columns: 3rem minmax(17rem, 1fr) minmax(15rem, 22rem);
  column-gap: var(--space-m);
  align-items: start;
  margin-top: var(--space-xl);
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  scroll-margin-top: calc(var(--header-height) + 1.5rem);
}

.project-credits h2 {
  grid-column: 2;
  font-size: 0.875rem;
  font-weight: 400;
}

.project-credits .project-details {
  grid-column: 3;
}

.project-credits .project-details div {
  grid-template-columns: 10.5rem minmax(0, 1fr);
}

.project-credits + .project-navigation {
  margin-top: var(--space-l);
}

@media (max-width: 68rem) and (min-width: 48rem) {
  .project-credits {
    grid-template-columns: 2.5rem minmax(15rem, 1fr) minmax(12rem, 0.5fr);
  }
}

@media (max-width: 47.99rem) {
  .project-credits {
    grid-template-columns: 2.25rem minmax(0, 1fr);
    column-gap: 0.75rem;
    row-gap: 1.5rem;
  }

  .project-credits h2,
  .project-credits .project-details {
    grid-column: 2;
  }

  .project-credits .project-details div {
    grid-template-columns: 10.75rem minmax(0, 1fr);
  }
}

.legal-links {
  display: flex;
  gap: 1.25rem;
}
