/* Inter, self-hosted. Only the upright variable cut is shipped — the site
   sets no italics, and one file covers every weight it does use. */
@font-face {
  font-family: InterVariable;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/static/fonts/InterVariable.woff2') format('woff2');
}

:root {
  --bg: #000;
  --fg: #fff;
  --dim: #8a8a8a;
  --rule: #262626;
  --placeholder: #111;
  --gap: clamp(1.5rem, 5vw, 3rem);
  /* Caps the line length on wide screens. Below this the page is fluid, so
     phones and tablets are unaffected. */
  --measure: 78rem;
  font-family: InterVariable, Inter, system-ui, sans-serif;
  font-feature-settings: 'liga' 1, 'calt' 1;
}

/* Cross-fade between the filter pages instead of a white flash. Pure
   enhancement: browsers without cross-document view transitions (Firefox as
   of 2026) just navigate as before. */
@view-transition {
  navigation: auto;
}

/* The shell is the same on every page, so hold it still and let only the
   work below it cross-fade. */
header { view-transition-name: site-header; }
.tags { view-transition-name: filter-nav; }

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.22s;
  animation-timing-function: ease;
}

* { box-sizing: border-box; }

/* On the root, not just body: body is capped at --measure and centred, so a
   background set only there leaves the margins showing the browser default. */
html {
  background: var(--bg);
  color-scheme: dark;
}

body {
  margin: 0 auto;
  min-height: 100vh;
  max-width: var(--measure);
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  padding: var(--gap);
}

a { color: inherit; text-decoration: none; }

/* Header: name left, navigation right */
header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

h1 {
  margin: 0;
  font-size: clamp(2.5rem, 9vw, 5.5rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
}

nav {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15em;
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 300;
  line-height: 1.2;
}

nav a {
  color: var(--dim);
  transition: color 0.25s ease;
}

nav a:hover,
nav a:focus-visible { color: var(--fg); }

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: var(--gap) 0;
  width: 100%;
}

/* ── Landing page ─────────────────────────────────────────────── */

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: clamp(2.5rem, 8vh, 5rem);
}

.about {
  max-width: 46ch;
  font-size: clamp(1.125rem, 2.5vw, 1.5rem);
  font-weight: 300;
  line-height: 1.45;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: pretty;
}

/* One entry per line. Each still wraps internally when the viewport is too
   narrow, but never shares a line with the next. */
.about span { display: block; }

.about a {
  border-bottom: 1px solid var(--rule);
  transition: border-color 0.25s ease;
}

.about a:hover,
.about a:focus-visible { border-color: var(--fg); }

.contact {
  list-style: none;
  margin: 0;
  padding: 0;
  scroll-margin-top: var(--gap);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: clamp(0.9rem, 2vw, 1.05rem);
  font-weight: 300;
}

.contact li {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
}

.contact .label {
  color: var(--dim);
  min-width: 4.5rem;
  flex-shrink: 0;
}

.contact a {
  color: var(--fg);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1px;
  transition: border-color 0.25s ease;
}

.contact a:hover,
.contact a:focus-visible { border-color: var(--fg); }

/* ── Portfolio ────────────────────────────────────────────────── */

/* Kind filter, above the contents list. Laid out as a row that wraps, so it
   reads as one line of options rather than the stacked film index below. */
.tags {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 1.1rem;
  font-size: clamp(1rem, 2vw, 1.15rem);
  font-weight: 300;
  margin-bottom: var(--gap);
}

.tags a {
  color: var(--dim);
  transition: color 0.25s ease;
}

.tags a:hover,
.tags a:focus-visible { color: var(--fg); }

/* The current page is not a link; mark it as where you are */
.tags [aria-current="page"] { color: var(--fg); }

/* Contents list of films, sitting under the header rule */
.index {
  /* Overrides the column layout the header nav uses */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
  scroll-margin-top: var(--gap);
  font-size: clamp(1rem, 2vw, 1.15rem);
  font-weight: 300;
  margin-bottom: var(--gap);
  padding-bottom: var(--gap);
  border-bottom: 1px solid var(--rule);
}

.index a {
  color: var(--dim);
  transition: color 0.25s ease;
}

.index a:hover,
.index a:focus-visible { color: var(--fg); }

/* Smooth jumps, unless the visitor prefers otherwise */
html { scroll-behavior: smooth; }

/* One piece of work per screen, as wide as the page allows */
.work {
  margin: 0 0 clamp(4rem, 12vh, 9rem);
  /* Keeps a jumped-to video off the very top edge of the viewport */
  scroll-margin-top: var(--gap);
}

.work:last-of-type { margin-bottom: var(--gap); }

/* Aspect-ratio boxes; no padding-top hack needed. Black rather than the
   placeholder grey, so any letterboxing reads as part of the film. */
.frame {
  position: relative;
  background: var(--bg);
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}


/* Stills size themselves; no fixed ratio, no letterboxing */
.work > img,
.work > picture,
.work > picture img {
  width: 100%;
  height: auto;
  display: block;
  background: var(--placeholder);
}

/* Quiet caption, sitting just beneath its work */
figcaption {
  margin-top: 0.85rem;
  font-size: clamp(0.85rem, 1.8vw, 1rem);
  font-weight: 300;
  color: var(--dim);
  letter-spacing: 0.01em;
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: baseline;
}

figcaption .year {
  color: var(--rule);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

/* Way back to the film list, sitting at the far end of the caption. Quiet
   until hovered — it's an escape hatch, not part of the work. */
figcaption .back {
  margin-left: auto;
  flex-shrink: 0;
  color: var(--rule);
  transition: color 0.25s ease;
}

figcaption .back:hover,
figcaption .back:focus-visible { color: var(--dim); }

footer {
  border-top: 1px solid var(--rule);
  padding-top: var(--gap);
  font-size: clamp(0.9rem, 2vw, 1.05rem);
  font-weight: 300;
  color: var(--dim);
}

footer a {
  color: var(--fg);
  border-bottom: 1px solid var(--rule);
  transition: border-color 0.25s ease;
}

footer a:hover,
footer a:focus-visible { border-color: var(--fg); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  html { scroll-behavior: auto; }

  /* View transitions are animations, so the rule above doesn't reach them.
     Cut them to nothing rather than disabling @view-transition, which would
     bring back the flash this is meant to avoid. */
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}
