:root {
  --ground: #B7D3CA;   /* glacial green, from the Soca river footage */
  --ink: #000;
  --film-black: #000;
  --film-white: #E9EDEA;
  --tbc: #FFE600;      /* placeholder highlight: anything in this colour still needs real content */

  --display: "Archivo", "Arial Black", sans-serif;
  --mono: "Martian Mono", ui-monospace, Menlo, monospace;

  --gutter: clamp(1rem, 2.2vw, 2rem);
  --nav-h: 3.25rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 1rem); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--display);
  transition: background-color .45s ease, color .45s ease;
}
img, video { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ul, dl, dd { margin: 0; padding: 0; }
ul { list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid currentColor; outline-offset: 3px; }

.skip { position: absolute; left: var(--gutter); top: -4rem; z-index: 50; background: var(--film-black); color: var(--film-white); padding: .75rem 1rem; }
.skip:focus { top: .5rem; }

/* Type roles */
.display {
  font-family: var(--display);
  font-weight: 900;
  font-stretch: 112%;
  font-variation-settings: "wdth" 112, "wght" 900;
  letter-spacing: -.035em;
  line-height: .92;
  text-transform: uppercase;
}
.mono {
  font-family: var(--mono);
  font-size: .75rem;
  line-height: 1.45;
  text-transform: uppercase;
  letter-spacing: .01em;
}
.tbc {
  background: var(--tbc);
  color: #000;
  padding: .05em .4em;
  font-family: var(--mono);
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.5;
  text-transform: none;
  white-space: normal;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* Header */
.site-head {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: var(--nav-h);
  padding: 0 var(--gutter);
  background: var(--ground);
  border-bottom: 1px solid var(--ink);
  transition: background-color .45s ease, border-color .45s ease, color .45s ease;
}
.wordmark { display: flex; align-items: center; gap: .5rem; font-size: 1.05rem; letter-spacing: -.02em; text-decoration: none; line-height: 1; padding: .6rem 0; }
.wordmark svg { width: 1.25rem; height: 1.25rem; flex: none; }
.site-nav ul { display: flex; gap: clamp(.75rem, 2vw, 1.75rem); }
.site-nav a { display: inline-block; padding: .9rem 0; text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current] { text-decoration: underline; text-underline-offset: .3em; text-decoration-thickness: 2px; }

/* Hero */
.hero {
  position: relative; display: flex; flex-direction: column;
  min-height: calc(100svh - var(--nav-h));
  padding: 1rem var(--gutter) var(--gutter);
  container-type: inline-size;
  overflow: hidden;
}
.hero-meta { display: flex; justify-content: space-between; gap: 2rem; margin-bottom: .6rem; }
.hero-meta > :last-child { text-align: right; display: grid; gap: .3rem; justify-items: end; }
/* Both lines are sized to span the column edge to edge */
.hero-tc { --tc-size: min(15cqw, 30svh); font-size: var(--tc-size); white-space: nowrap; font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; margin-top: .02em; }
.hero h1 { font-size: min(16.4cqw, 33svh); white-space: nowrap; }

/* Hover reel: the hero fades to black and the name and timecode shrink into the reel's corner */
.hero-meta { position: relative; z-index: 1; transition: opacity .5s ease; }
.hero h1, .hero-tc {
  position: relative; z-index: 2;
  transform-origin: 0 0;
  transition: transform .7s cubic-bezier(.65, 0, .2, 1), color .5s ease;
  will-change: transform;
}
.hero-stage { flex: 1; display: flex; align-items: flex-end; min-height: 6rem; position: relative; z-index: 1; transition: opacity .3s ease; }
.reel-layer { position: absolute; inset: 0; background: var(--film-black); opacity: 0; transition: opacity .6s ease; pointer-events: none; }
.reel-layer video { width: 100%; height: 100%; object-fit: contain; }
.reel-bar {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: var(--gutter); z-index: 3;
  display: flex; justify-content: space-between; align-items: flex-end; gap: .75rem; flex-wrap: wrap;
  opacity: 0; visibility: hidden;
  transition: opacity .3s ease, visibility 0s .3s;
}
.reel-bar .databox { position: static; }
.reel-ctl { display: flex; flex-wrap: wrap; gap: .5rem; }
.reel-ctl a.ctl { display: inline-flex; align-items: center; text-decoration: none; }

.reel-on .hero-meta, .reel-on .hero-stage { opacity: 0; pointer-events: none; }
.reel-on .hero-stage { visibility: hidden; }
.reel-on .reel-layer { opacity: 1; }
.reel-on .hero h1, .reel-on .hero-tc { color: var(--film-white); text-shadow: 0 0 .06em rgba(0, 0, 0, .9), 0 0 .22em rgba(0, 0, 0, .85); transform: translate(var(--lock-x, 0), var(--lock-y, 0)) scale(var(--lock-s, 1)); }
.reel-on .reel-bar { opacity: 1; visibility: visible; transition: opacity .4s ease .35s, visibility 0s; }
.reel-on .site-head { --ground: var(--film-black); --ink: var(--film-white); color: var(--film-white); }

/* Screen: full-bleed moving image with data overlays */
.screen { position: relative; background: var(--film-black); color: var(--film-white); }
.screen video, .screen > img, .screen iframe { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border: 0; }
.screen-tc {
  position: absolute; top: var(--gutter); right: var(--gutter);
  font-family: var(--mono); font-weight: 700; font-size: clamp(.8rem, 1.2vw, 1rem);
  font-variant-numeric: tabular-nums;
  padding: .15rem .5rem;
  background: var(--ground); color: var(--ink);
}
.databox {
  position: absolute; left: var(--gutter); bottom: var(--gutter);
  background: var(--ground); color: var(--ink);
  border: 1px solid var(--ink);
  padding: .8rem 1rem;
  min-width: 15rem; max-width: min(24rem, 60%);
  transition: background-color .45s ease;
}
.databox dl { display: grid; grid-template-columns: auto 1fr; gap: .15rem .9rem; }
.databox dt { opacity: 1; }
.screen-controls { position: absolute; right: var(--gutter); bottom: var(--gutter); display: flex; align-items: center; gap: .5rem; }
.ctl {
  min-height: 44px; min-width: 44px; padding: 0 1rem;
  background: var(--ground); color: var(--ink);
  border: 1px solid var(--ink);
  font-family: var(--mono); font-size: .75rem; text-transform: uppercase;
  transition: background-color .15s ease, color .15s ease;
}
.ctl:hover { background: var(--ink); color: var(--ground); }

/* Work list */
.section-head { padding: clamp(2.5rem, 5vw, 4.5rem) var(--gutter) 1.25rem; }
.section-head h2 { font-size: clamp(2.2rem, 6vw, 5rem); }
.work { border-top: 1px solid var(--ink); }
.work-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: var(--gutter); padding: 0 var(--gutter) clamp(3rem, 6vw, 5rem); align-items: start; }
.film-list { border-top: 1px solid var(--ink); }
.film-row { border-bottom: 1px solid var(--ink); }
.film-row a {
  display: grid; grid-template-columns: 1.25rem 1fr; align-items: baseline; gap: 0 .75rem;
  padding: .55rem 0 .4rem; text-decoration: none;
}
.film-row .display { font-size: clamp(1.7rem, 3.9vw, 3.5rem); line-height: .98; }
.film-row .mono { font-variant-numeric: tabular-nums; }
.film-row a:hover .display, .film-row a:focus-visible .display { text-decoration: underline; text-decoration-thickness: .07em; text-underline-offset: .09em; }
.film-row img { display: none; }
.work-preview { position: sticky; top: calc(var(--nav-h) + 1rem); }
.work-preview img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--film-black); }
.work-preview p { margin-top: .5rem; }

/* Filmstrip */
.strip-section { background: var(--film-black); color: var(--film-white); padding: clamp(2.5rem, 5vw, 4.5rem) 0 clamp(2rem, 4vw, 3rem); }
.strip-section .section-head { padding-top: 0; display: flex; justify-content: space-between; align-items: end; gap: 1rem; flex-wrap: wrap; }
.strip-section .ctl { background: var(--film-black); color: var(--film-white); border-color: var(--film-white); }
.strip-section .ctl:hover { background: var(--film-white); color: var(--film-black); }
.strip-ctl { display: flex; gap: .5rem; }
.strip {
  overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
  padding: 26px 0;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='14'%3E%3Crect x='7' y='0' width='15' height='14' rx='3' fill='%23E9EDEA'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='14'%3E%3Crect x='7' y='0' width='15' height='14' rx='3' fill='%23E9EDEA'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-position: 0 5px, 0 calc(100% - 5px);
  background-attachment: local;
}
.strip::-webkit-scrollbar { display: none; }
@media (hover: hover) and (pointer: fine) {
  .strip { cursor: grab; user-select: none; -webkit-user-select: none; scroll-snap-type: none; }
  .strip.dragging { cursor: grabbing; }
}
.strip.drifting { scroll-snap-type: none; }
.strip.drifting li { scroll-snap-align: none; }
.strip ul { display: flex; gap: 10px; width: max-content; padding: 0 var(--gutter); }
.strip li { scroll-snap-align: center; }
.strip img { height: clamp(11rem, 26vw, 22rem); width: auto; }
.strip-section > p { padding: 1rem var(--gutter) 0; }
.strip-section > p a { display: inline-block; padding: .6rem 0; }

/* About */
.about { border-top: 1px solid var(--ink); }
.about-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: clamp(1.5rem, 5vw, 5rem); padding: 0 var(--gutter) clamp(3rem, 6vw, 5rem); }
.portraits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-items: start; }
.portraits img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; }
.about-copy { max-width: 62ch; display: grid; gap: 2rem; align-content: start; font-size: clamp(1.15rem, 1.7vw, 1.4rem); line-height: 1.45; }
.bio { display: grid; gap: 1em; }
.about-copy dl { display: grid; grid-template-columns: 6rem 1fr; gap: .6rem 1rem; font-size: 1rem; }
.about-copy dt { padding-top: .25rem; }

/* Footer */
.site-foot { background: var(--film-black); color: var(--film-white); padding: clamp(2.5rem, 5vw, 4.5rem) var(--gutter) 1.5rem; }
.foot-mark { font-size: min(13.6vw, 13rem); }
.foot-grid { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; margin-top: clamp(2rem, 4vw, 3rem); }
.foot-links { display: grid; gap: .35rem; justify-items: end; text-align: right; }
.foot-links a { display: inline-block; padding: .2rem 0; }

/* Film page */
.titlebar { padding: 1rem var(--gutter) clamp(1.25rem, 3vw, 2rem); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem 2rem; }
.titlebar h1 { font-size: clamp(2.2rem, 8.4vw, 8rem); margin-top: .4rem; }
.titlebar-name { grid-column: 1; min-width: 0; }
.titlebar .subtitle { margin-top: .6rem; font-size: clamp(1.15rem, 2.2vw, 1.9rem); font-weight: 600; line-height: 1.2; }
.titlebar .credits { grid-column: 2; grid-row: 1 / span 2; max-width: 22rem; }
.film-about { padding: clamp(1.5rem, 3vw, 2.5rem) var(--gutter); }
.film-about p { max-width: 62ch; font-size: clamp(1.15rem, 1.7vw, 1.4rem); line-height: 1.45; }
.credits dl { display: grid; grid-template-columns: auto auto; gap: .15rem .75rem; justify-content: end; }
.film-stills { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; background: var(--film-black); padding-top: 4px; }
.film-stills img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.next-film { display: block; padding: clamp(1.5rem, 3vw, 2.5rem) var(--gutter); text-decoration: none; background: var(--next-bg); color: var(--next-ink); }
.next-film .display { font-size: clamp(2.2rem, 6.5vw, 6rem); margin-top: .35rem; }
.next-film:hover .display { text-decoration: underline; text-decoration-thickness: .06em; text-underline-offset: .08em; }

/* Photography page */
.photo-grid { columns: 3; column-gap: 8px; padding: 8px var(--gutter) clamp(3rem, 6vw, 5rem); }
.photo-grid li { break-inside: avoid; margin-bottom: 8px; }
.photo-grid button { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.photo-grid img { width: 100%; height: auto; }
.lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: var(--film-black); color: var(--film-white); }
.lightbox[open] { display: grid; grid-template-rows: 1fr auto; }
.lightbox::backdrop { background: var(--film-black); }
.lightbox img { width: 100%; height: 100%; object-fit: contain; min-height: 0; padding: var(--gutter); }
.lightbox-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .5rem var(--gutter) 1rem; }
.lightbox .ctl { background: var(--film-black); color: var(--film-white); border-color: var(--film-white); }
.lightbox .ctl:hover { background: var(--film-white); color: var(--film-black); }
.lightbox-actions { display: flex; gap: .5rem; }

/* Tablet and below */
@media (max-width: 860px) {
  .work-grid { grid-template-columns: 1fr; }
  .work-preview { display: none; }
  .film-row img { display: block; grid-column: 1 / -1; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; margin-top: .5rem; }
  .about-grid { grid-template-columns: 1fr; }
  .photo-grid { columns: 2; }
  .titlebar { grid-template-columns: 1fr; }
  .titlebar .credits { grid-column: 1; grid-row: auto; }
  .credits dl { justify-content: start; }
}

/* Phone: overlays drop below the picture so nothing covers it */
@media (max-width: 640px) {
  .hero { min-height: calc(100svh - 5.25rem); }
  .hero-meta { flex-wrap: wrap; gap: .15rem 1rem; }
  .hero-meta > :last-child span { white-space: nowrap; }
  .reel-layer video { object-position: 50% 5rem; }
  .site-head { position: static; flex-wrap: wrap; gap: 0; padding-top: .35rem; }
  .site-nav { width: 100%; }
  .site-nav ul { justify-content: space-between; }
  .site-nav a { padding: .75rem 0; }
  html { scroll-padding-top: 1rem; }
  .databox { position: static; max-width: none; border-width: 0; padding-inline: var(--gutter); }
  .screen-controls { position: static; padding: 0 var(--gutter) .9rem; background: var(--ground); justify-content: space-between; transition: background-color .45s ease; }
  .film-stills { grid-template-columns: 1fr; }
  .foot-links { justify-items: start; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}

/* Series pages: vertical films sit side by side, each with its info card below */
.series-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; background: var(--film-black); padding-top: 4px; }
.screen-vertical { display: flex; flex-direction: column; }
.vertical-frame { position: relative; flex: 1; display: grid; place-items: center; padding: clamp(1rem, 3vw, 2.5rem) 0; }
.screen-vertical .vertical-frame video,
.screen-vertical .vertical-frame iframe { width: min(100%, calc(80svh * 9 / 16)); aspect-ratio: 9 / 16; height: auto; object-fit: cover; }
.screen-vertical .screen-tc { top: clamp(1rem, 3vw, 2.5rem); }
.vertical-info { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem; padding: 1rem var(--gutter) 1.25rem; background: var(--ground); color: var(--ink); }
.vertical-info h2 { font-size: clamp(1.6rem, 3vw, 2.6rem); flex-basis: 100%; }
.vertical-info .databox { position: static; border: 0; padding: 0; min-width: 0; max-width: none; background: none; }
.vertical-info .screen-controls { position: static; padding: 0; background: none; }
@media (max-width: 640px) {
  .series-pair { grid-template-columns: 1fr; }
  .vertical-info .databox { padding: 0; }
}
.series-heading { grid-column: 1 / -1; background: var(--ground); color: var(--ink); padding: clamp(1.25rem, 3vw, 2rem) var(--gutter) .9rem; font-size: clamp(2rem, 5vw, 4rem); }
.vertical-info .mono:first-child { flex-basis: 100%; margin-bottom: -.5rem; }

/* Series stills: mixed wide and vertical frames, all the same height */
.series-stills { grid-template-columns: var(--still-columns); }
.series-stills img { aspect-ratio: auto; height: 100%; }

/* Wider screens: each info card sits beside its vertical video instead of below it */
@media (min-width: 1360px) {
  .screen-vertical { display: grid; grid-template-columns: min(calc(80svh * 9 / 16 + var(--gutter)), 62%) minmax(0, 1fr); }
  .screen-vertical .vertical-frame video,
  .screen-vertical .vertical-frame iframe { width: 100%; }
  .screen-vertical .vertical-frame { padding: 2.5rem 0 2.5rem var(--gutter); }
  .screen-vertical .screen-tc { right: auto; left: calc(var(--gutter) + .75rem); top: 3.25rem; }
  .vertical-info { align-content: flex-end; align-items: flex-start; flex-direction: column; flex-wrap: nowrap; margin: 2.5rem var(--gutter) 2.5rem 1.25rem; }
  .vertical-info h2 { flex-basis: auto; font-size: clamp(1.4rem, 2.2vw, 2.4rem); }
  .vertical-info dd { white-space: nowrap; }
  .vertical-info .screen-controls { flex-wrap: wrap; }
}
@media (max-width: 860px) {
  .series-stills { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .series-stills img:first-child { grid-column: 1 / -1; }
}
