/* SIHA WORKS. Mobile first. States: phone (base), 600px, 720px (work rows side by side),
   900px (desktop spacing + timeline labels), 1200px (wide).

   Why it looks like this (v3, kaz: "a little more minimalistic/modern"):
   - One family, Figtree (SIL Open Font License, free for commercial use), two weights.
     Bold speaks, Regular explains.
   - Black, white and one grey. The footage and the photos bring the colour.
   - Square corners and no filled panels, so the only shapes on the page are the pictures.
   - The one accent is the timeline playhead (and the keyboard focus ring). */

/* To try another font, change these two faces and --display / --sans below.
   The weights are chosen by eye and measurement, see tools/build_fonts.py: the 400 face is Figtree at 475 and the
   700 face is Figtree at 800, because Figtree's own Regular and Bold look too light here. */
@font-face {
  font-family: "Figtree";
  src: url(fonts/figtree-regular.woff) format("woff");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Figtree";
  src: url(fonts/figtree-extrabold.woff) format("woff");
  font-weight: 700;
  font-display: swap;
}
/* Only for the running timecode, so its numbers can't jitter as they count. */
@font-face {
  font-family: "DM Mono";
  src: url(fonts/dm-mono-400.woff2) format("woff2");
  font-weight: 400;
  font-display: swap;
}
/* The lists in About (kaz 11-12, after a reference he sent: small grey headings, firm capitals). Same family as the timecode. */
@font-face {
  font-family: "DM Mono";
  src: url(fonts/dm-mono-500.woff2) format("woff2");
  font-weight: 500;
  font-display: swap;
}
/* Only for the signature on the booking request, so typing your name reads as signing it. */
@font-face {
  font-family: "Herr Von Muellerhoff";
  src: url(fonts/herr-von-muellerhoff.woff2) format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0a0a0a;
  --fg: #f2f2f0;
  --muted: #a0a09d;
  --line: #262626;
  --surface: #161616;
  --accent: #ff5a1f;     /* playhead + focus ring, nowhere else */
  --err: #ff8a7a;
  --paper: #f5f4f0;      /* the request the client signs */
  --ink: #141413;

  --display: "Figtree", "Helvetica Neue", Arial, sans-serif;
  --mono: "DM Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --sans: "Figtree", "Helvetica Neue", Arial, sans-serif;

  --gutter: 16px;
  --header-h: 56px;
  --section-y: calc(88px * var(--space, 1));
  --s-body: calc(var(--size-all, 1) * var(--size-body, 1));
  --s-heading: calc(var(--size-all, 1) * var(--size-heading, 1));
  --s-small: calc(var(--size-all, 1) * var(--size-small, 1));
  --s-menu: calc(var(--size-all, 1) * var(--size-menu, 1));
  --s-button: calc(var(--size-all, 1) * var(--size-button, 1));
  --tl-top: 32px;
  --tl-ruler: 12px;
  --tl-clips: 56px;
  --tl-h: calc(var(--tl-top) + var(--tl-ruler) + var(--tl-clips) + 28px);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f5f3;
  --fg: #0d0d0c;
  --muted: #62625f;
  --line: #d8d8d4;
  --surface: #e9e9e5;
  --accent: #e8470f;
  --err: #b3261e;
  --paper: #ffffff;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;   /* Android's blue flash fights the look; a press dims instead */
}
html.is-locked { overflow: hidden; }
a:active, button:active { opacity: .7; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 calc(15px * var(--s-body))/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, video { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
p { margin: 0; }

/* Small caps-style captions: the bar under each tile on the "Untitled." grid kaz liked. */
.cap { font-size: calc(12px * var(--s-small)); line-height: 1.35; letter-spacing: .035em; text-transform: uppercase; }
.tc { font: 400 calc(12px * var(--s-small))/1 "DM Mono", ui-monospace, "SFMono-Regular", Menlo, monospace; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.skip {
  position: absolute; left: 8px; top: -100px; z-index: 50;
  padding: 12px 16px; background: var(--fg); color: var(--bg); text-decoration: none;
}
.skip:focus { top: 8px; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 0 22px;
  border: 1px solid transparent; border-radius: var(--radius-button, 0);
  font: 700 calc(14px * var(--s-button))/1 var(--sans); text-decoration: none; cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s, opacity .2s;
}
.btn-solid { background: var(--btn-bg, var(--fg)); color: var(--btn-fg, var(--bg)); }
.btn-solid:hover { opacity: .86; }
/* kaz 11-13: "the booking button can be like be boxed around, slightly smaller": an outline, small spaced capitals. */
.btn-box {
  min-height: 44px; padding: 0 1.6em;
  border-color: currentColor; background: transparent; color: var(--fg);
  font-size: calc(12.5px * var(--s-button)); letter-spacing: .18em; text-transform: uppercase;
}
.btn-box:hover { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.btn-ghost { background: transparent; color: var(--fg); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--fg); }
.btn:disabled { opacity: .6; cursor: progress; }

/* Even padding keeps the word centred in its focus box; the negative margin keeps the word on the page's edge. */
.btn-text {
  min-height: 44px; padding: 0 8px; margin-right: -8px;
  background: none; border: 0; cursor: pointer;
  font: 700 calc(14px * var(--s-button))/1 var(--sans);
}
.btn-text:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- header ---------- */

.site-header {
  position: fixed; inset: 0 0 auto; z-index: 20;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 0 var(--gutter);
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: background-color .25s, border-color .25s, color .25s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
/* Only the landing page has a full-screen video under the header to see through to. */
body.hero-full[data-view="home"] .site-header:not(.is-scrolled) { background: transparent; color: var(--hero-text, #fff); }

.wordmark {
  display: inline-flex; align-items: center; min-height: 44px;
  font: 700 calc(14px * var(--s-menu))/1 var(--display); letter-spacing: .04em; text-transform: uppercase;
  text-decoration: none; white-space: nowrap;
}
.nav { display: flex; align-items: center; margin-right: -8px; }
.nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px;
  font-size: calc(13.5px * var(--s-menu)); text-decoration: none; white-space: nowrap;
}
.nav a:hover, .nav a[aria-current] { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
.nav-contact { font-weight: 700; }
.nav-full { display: none; }

/* ---------- hero ---------- */

.hero { position: relative; padding-top: var(--header-h); }

.hero-frame {
  position: relative;
  margin: 0 var(--gutter);
  height: min(calc(100vh - var(--header-h) - var(--tl-h) - 8px), 125vw);
  height: min(calc(100svh - var(--header-h) - var(--tl-h) - 8px), 125vw);
  min-height: 300px;
  overflow: hidden;
  background: #000;
}
.hero-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
}
.hero-video.is-shown { opacity: 1; }

/* Kaz asked for little to no vignetting: one soft fade under the name, nothing around the edges. */
.hero-shade {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(0, 0, 0, var(--hero-fade, .28)), rgba(0, 0, 0, 0) 32%);
}

.hero-clip {
  position: absolute; top: 12px; left: 14px;
  color: var(--hero-text, #fff); font-weight: 700;
  text-shadow: 0 0 2px rgba(0, 0, 0, .55), 0 1px 12px rgba(0, 0, 0, .75);   /* holds up over a bright sky */
}
.hero-copy {
  position: absolute; left: 14px; right: 14px; bottom: 14px;
  color: var(--hero-text, #fff);
}
.hero-role { margin-bottom: 10px; font-weight: 700; text-shadow: 0 1px 10px rgba(0, 0, 0, .65); }
.hero-name {
  margin: 0;
  width: max-content; max-width: none;
  font: 700 44px/.92 var(--display);
  text-transform: uppercase; letter-spacing: -.012em;
  white-space: nowrap;
  text-shadow: 0 2px 30px rgba(0, 0, 0, .22);
}

/* full-screen opening */
.hero[data-mode="full"] { height: 100vh; height: 100svh; min-height: 520px; padding-top: 0; }
.hero[data-mode="full"] .hero-frame {
  position: absolute; inset: 0; margin: 0; height: auto; min-height: 0;
}
.hero[data-mode="full"] .hero-shade {
  background:
    linear-gradient(to top, rgba(0, 0, 0, var(--hero-fade, .5)), rgba(0, 0, 0, 0) 42%),
    linear-gradient(to bottom, rgba(0, 0, 0, .3), rgba(0, 0, 0, 0) 20%);
}
.hero[data-mode="full"] .hero-clip { top: calc(var(--header-h) + 8px); left: var(--gutter); }
.hero[data-mode="full"] .hero-copy {
  left: var(--gutter); right: var(--gutter); bottom: calc(var(--tl-h) + 4px);
}
.hero[data-mode="full"] .timeline {
  position: absolute; left: 0; right: 0; bottom: 0;
  color: var(--hero-text, #fff);
  --fg: var(--hero-text, #fff); --muted: rgba(255, 255, 255, .72); --line: rgba(255, 255, 255, .32);
}

/* ---------- timeline ---------- */

.timeline { padding: 12px var(--gutter) 16px; }

.tl-top {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--tl-top);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.tl-top #tcNow { color: var(--fg); }
.tl-toggle {
  min-height: 44px; min-width: 64px; padding: 0 12px; margin: -6px 0;
  background: none; border: 0; cursor: pointer;
  color: var(--fg);
}
.tl-toggle:hover { text-decoration: underline; text-underline-offset: 3px; }

.tl-track { position: relative; }
.tl-ruler {
  position: relative;
  height: var(--tl-ruler);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(to right, var(--line) 1px, transparent 1px) 0 100% / calc(100% / var(--secs, 25)) 5px repeat-x;
  cursor: pointer;
  touch-action: manipulation;
}
.tl-ruler::before { content: ""; position: absolute; inset: -14px 0 0; }  /* bigger hit area for seeking */

.tl-clips {
  display: flex; gap: 2px;
  height: var(--tl-clips);
  margin: 0; padding: 0; list-style: none;
}
.tl-clips li { flex: var(--d, 5) 1 0; min-width: 0; }
.clip {
  width: 100%; height: 100%;
  display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 4px;
  padding: 6px 0 0;
  background: none; border: 0;
  color: var(--muted); text-align: left; cursor: pointer;
}
.clip-no { font-size: calc(12px * var(--s-small)); line-height: 1; letter-spacing: .03em; }
.clip-name { display: none; }
.clip img {
  width: 100%; height: 100%; min-height: 0;
  object-fit: cover;
  opacity: .55;
  transition: opacity .25s;
}
.clip.is-active { color: var(--fg); }
.clip.is-active img, .clip:hover img { opacity: 1; }

.tl-playhead {
  position: absolute; top: 0; bottom: 0; left: 0;
  width: 2px; margin-left: -1px;
  background: var(--accent);
  pointer-events: none;
  will-change: transform;
}
.tl-playhead::before {
  content: ""; position: absolute; top: -2px; left: 50%;
  width: 10px; height: 8px; transform: translateX(-50%);
  background: var(--accent);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

/* ---------- sections ---------- */

.section { padding: var(--section-y) var(--gutter); }
.sec-title {
  margin: 0 0 32px;
  font: 700 calc(clamp(22px, 2.3vw, 30px) * var(--s-heading))/1.15 var(--display);
  letter-spacing: -.012em;
}

/* ---------- selected work (gavnfx's alternating rows, with the panels taken away) ---------- */

.work-list { display: grid; gap: 44px; margin: 0; padding: 0; list-style: none; }
.work-link { display: grid; gap: 12px; text-decoration: none; }
.work-media {
  position: relative; margin: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--surface);
}
.work-media img, .work-media video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.work-media video { opacity: 0; transition: opacity .5s; }
.work-media video.is-playing { opacity: 1; }

.work-text, .work-info { display: grid; gap: 3px; }
.work-no { display: none; color: var(--muted); }
.work-title { margin: 0; font: 700 calc(19px * var(--s-heading))/1.2 var(--display); letter-spacing: -.008em; }
.work-meta { color: var(--muted); font-size: calc(13.5px * var(--s-small)); }
.work-link:hover .work-title { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }

/* The way from the highlights to everything else. */
.all-work {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  margin-top: 44px; padding: 20px 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.all-work-text { font: 700 calc(clamp(20px, 2vw, 26px) * var(--s-heading))/1.1 var(--display); letter-spacing: -.01em; }
.all-work-count { color: var(--muted); white-space: nowrap; }
.all-work:hover .all-work-text { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }

/* ---------- photography: a grid of covers, each one opens its shoot as a carousel ---------- */

.covers {
  display: grid; grid-template-columns: repeat(var(--cover-cols-phone, 2), minmax(0, 1fr)); gap: 30px 6px;
  margin: 0; padding: 0; list-style: none;
}
.cover:only-child { grid-column: 1 / -1; }   /* one shoot doesn't sit beside an empty half */
.cover-link { display: grid; gap: 10px; text-decoration: none; }
.cover-media { margin: 0; aspect-ratio: 3 / 4; overflow: hidden; background: var(--surface); }
.cover-media img { width: 100%; height: 100%; object-fit: cover; }
.cover-cap { display: grid; gap: 3px; }
.cover-title { font-weight: 700; }
.cover-sub { color: var(--muted); }
.cover-link:hover .cover-title { text-decoration: underline; text-underline-offset: 3px; }

.viewer-arrow svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.5; }

/* ---------- portfolio pages (Film grid: the "Untitled." layout kaz liked; Photography) ---------- */

.work-page { padding: calc(var(--header-h) + 36px) var(--gutter) var(--section-y); }
.wp-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 22px; margin-bottom: 14px; }
.wp-title {
  margin: 0;
  font: 700 calc(clamp(30px, 5vw, 60px) * var(--s-heading))/1.12 var(--display);
  letter-spacing: -.02em;
  text-decoration: none;
}
.wp-title:focus { outline: none; }
.wp-other { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); transition: color .2s; }
.wp-other:hover { color: var(--fg); }
.wp-other:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wp-count { margin-bottom: 20px; color: var(--muted); }

/* Phones: one scrolling row of filters instead of three wrapped ones. */
.filters {
  display: flex; gap: 18px;
  margin: 0 calc(-1 * var(--gutter)) 24px; padding: 0 var(--gutter);
  overflow-x: auto; scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }
.filter {
  flex: none;
  display: inline-flex; align-items: baseline; gap: 6px;
  min-height: 44px; padding: 13px 0 0;
  background: none; border: 0;
  color: var(--muted);
  font-size: calc(13.5px * var(--s-small)); line-height: 1.2; cursor: pointer; white-space: nowrap;
  transition: color .15s;
}
.filter:hover { color: var(--fg); }
.filter-n { font-size: calc(12px * var(--s-small)); }
.filter[aria-pressed="true"] { color: var(--fg); font-weight: 700; }

.grid {
  display: grid; grid-template-columns: repeat(var(--grid-cols-phone, 1), minmax(0, 1fr)); gap: 30px 6px;
  margin: 0; padding: 0; list-style: none;
}
.tile-link { display: grid; gap: 10px; text-decoration: none; }
.tile-media {
  position: relative; margin: 0;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--surface);
}
.tile-media img, .tile-media video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.tile-media video { opacity: 0; transition: opacity .4s; }
.tile-media video.is-playing { opacity: 1; }
/* 9:16 pieces stay whole, standing on a blurred copy of their own frame. */
.tile-media.is-tall .tile-bg { filter: blur(28px) brightness(.5); transform: scale(1.2); }
.tile-media.is-tall .tile-poster, .tile-media.is-tall video { object-fit: contain; }

.tile-cap { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 16px; }
.tile-title { font-weight: 700; }
.tile-sub { grid-column: 1; color: var(--muted); }
.tile-year, .tile-len { grid-column: 2; color: var(--muted); text-align: right; }
.tile-year { grid-row: 1; }
.tile-len { grid-row: 2; }
.tile-link:hover .tile-title { text-decoration: underline; text-underline-offset: 3px; }

.grid-empty { padding: 48px 0; color: var(--muted); }

/* The photo sets, under the films on the same page. With the Photography filter on, they move up under the filters. */
.wp-photos { margin-top: 72px; }
.work-page[data-filter="photo-sets"] .wp-photos { margin-top: 0; }
.wp-sub {
  margin: 0 0 24px;
  font: 700 calc(clamp(22px, 2.3vw, 30px) * var(--s-heading))/1.15 var(--display);
  letter-spacing: -.012em;
}

/* kaz 11-13: the bottom of Home and Work holds CONTACT in the middle, where the Contact page holds BOOKING. */
.wp-foot {
  display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center;
  margin-top: 64px; padding-top: 32px; border-top: 1px solid var(--line);
}
.wp-foot-text { font: 700 calc(clamp(20px, 2vw, 26px) * var(--s-heading))/1.15 var(--display); letter-spacing: -.01em; }
.home-book { padding-top: 0; }
.home-book .wp-foot { margin-top: 0; }

/* ---------- about (kaz 11-12): short lists in capitals on the left, his words on the right, over one of his films, blurred ---------- */

.about { position: relative; isolation: isolate; overflow: hidden; }
.about-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.bg-media {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  filter: blur(var(--blur, 26px));
  transform: scale(1.15);          /* a blur fades out at the edges: the extra size keeps those soft edges off screen */
}
.about-bg video, .contact-bg video { opacity: 0; transition: opacity .8s; }
.about-bg video.is-playing, .contact-bg video.is-playing { opacity: 1; }
/* Darkened so the words read, and melted into the page's own colour at the top and bottom, so the section has no hard edge. */
.about-bg::before, .about-bg::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.about-bg { --blur: var(--about-blur, 26px); }
.about-bg::before { background: var(--bg); opacity: var(--about-dim, .55); }
.about-bg::after { background: linear-gradient(var(--bg), transparent 24%, transparent 76%, var(--bg)); }

.about-grid { display: grid; gap: 56px; }
.about-lists { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 40px 24px; align-content: start; }
.al-title {
  margin: 0 0 16px;
  color: var(--muted);
  font: 400 calc(12.5px * var(--s-small))/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase;
}
.about-list ul { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; }
.about-list li {
  color: var(--heading, var(--fg));
  font: 500 calc(13.5px * var(--s-body))/1.4 var(--mono); letter-spacing: .04em; text-transform: uppercase;
}
.al-note { grid-column: 1 / -1; max-width: 46ch; color: var(--muted); font-size: calc(13.5px * var(--s-body)); }

.about-body { display: grid; gap: 18px; align-content: start; }
.about-body p { max-width: 62ch; color: var(--muted); }
.custom-body { max-width: 62ch; color: var(--muted); white-space: pre-line; }
.about-body .about-lead {
  max-width: 30ch;
  color: var(--heading, var(--fg));
  font-size: calc(clamp(21px, 2.7vw, 34px) * var(--s-heading)); line-height: 1.25; font-weight: 700; letter-spacing: -.015em;
}
/* ---------- contact (kaz 11-13, his own mockup): a film behind, the name big on the left in the middle, how to reach him
   along the bottom, BOOKING in a box. White words over the film whatever the site's colours, like the opening video. ---------- */

.contact-page {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 100svh;
  display: grid; grid-template-rows: minmax(0, 1fr) auto auto; gap: 28px;
  padding: calc(var(--header-h) + 28px) var(--gutter) 28px;
  color: var(--hero-text, #fff);
}
.contact-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; background: #000; --blur: var(--contact-blur, 10px); }
.contact-bg::before { content: ""; position: absolute; inset: 0; z-index: 1; background: #000; opacity: var(--contact-dim, .3); }
.contact-head { align-self: center; justify-self: start; display: grid; justify-items: end; gap: 4px; max-width: 100%; }
.contact-name {
  margin: 0 -.16em 0 0;                       /* the spacing after the last letter shouldn't push the name off centre */
  font: 700 calc(clamp(34px, 8.4vw, 116px) * var(--s-heading))/1 var(--display);
  letter-spacing: .16em; text-transform: uppercase; overflow-wrap: anywhere;
}
.contact-name:focus { outline: none; }
.contact-role { font: 700 calc(13px * var(--s-small))/1.2 var(--sans); letter-spacing: .16em; text-transform: uppercase; }
.contact-reach { display: grid; gap: 26px; }
.contact-label { margin-bottom: 12px; opacity: .8; font: 400 calc(14px * var(--s-small))/1.2 var(--sans); letter-spacing: .16em; text-transform: uppercase; }
.contact-link {
  display: inline-flex; align-items: center; min-height: 32px;
  font: 700 calc(15px * var(--s-body))/1.2 var(--sans); letter-spacing: .1em; text-transform: uppercase; text-decoration: none;
  overflow-wrap: anywhere;
}
.contact-link:hover { text-decoration: underline; text-underline-offset: 5px; }
.contact-links { display: grid; grid-template-columns: repeat(2, max-content); gap: 0 28px; margin: 0; padding: 0; list-style: none; }
.contact-book { justify-self: center; color: inherit; }
.contact-book:hover { background: var(--hero-text, #fff); border-color: var(--hero-text, #fff); color: #000; }

/* Text boxes kaz places himself (app.js makeFreeBoxes): spots in % of the part of the page they belong to. */
.has-free { position: relative; }
.free-box {
  position: absolute; z-index: 3; max-width: min(90%, 60ch);
  font: 700 calc(18px * var(--s-body))/1.3 var(--display); white-space: pre-line;
}

/* Logo icons, in About and the footer. 44 px to tap, pulled left so the logo itself lines up with the text. */
.social, .foot-links { display: flex; flex-wrap: wrap; gap: 0 4px; margin: 0 0 0 -11px; padding: 0; list-style: none; }
.social-link {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px;
  color: var(--fg); transition: opacity .2s;
}
.social-link svg { width: 22px; height: 22px; fill: currentColor; }
.social-link:hover { opacity: .6; }

/* ---------- booking ---------- */

.book { display: grid; gap: 40px; }
.book-intro .sec-title { margin-bottom: 14px; }
.book-intro .sec-title:focus { outline: none; }
.book-lede { max-width: 42ch; color: var(--muted); }
.book-lede a { padding-block: 13px; }   /* a 44 px tap target that doesn't move the lines around it */
.book-steps { display: grid; gap: 0; margin: 28px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.book-steps li {
  display: grid; grid-template-columns: 32px 1fr; gap: 2px 8px;
  padding: 13px 0; border-bottom: 1px solid var(--line);
}
.book-steps .cap { color: var(--muted); padding-top: 3px; }
.book-steps strong { font-weight: 700; }
.book-steps span:last-child { grid-column: 2; color: var(--muted); font-size: calc(14px * var(--s-body)); }

.field { display: grid; gap: 4px; margin-bottom: 22px; min-width: 0; }
.field label { font-size: calc(13.5px * var(--s-small)); font-weight: 700; }
.err { color: var(--err); font-size: calc(12.5px * var(--s-small)); font-weight: 700; }
.err:empty { display: none; }

/* Fields are a line to write on, not a box. */
input[type="text"] {
  width: 100%; min-height: 44px;
  padding: 10px 0;
  background: transparent; color: var(--fg);
  border: 0; border-bottom: 1px solid var(--muted); border-radius: 0;
  font: 400 max(16px, calc(16px * var(--s-body)))/1.4 var(--sans);   /* never under 16px: that stops iOS zooming into the field */
  -webkit-appearance: none; appearance: none;
}
input::placeholder { color: var(--muted); opacity: 1; font-size: 14px; }
input[type="text"]:focus-visible { outline: none; border-bottom-color: var(--fg); box-shadow: 0 1px 0 var(--fg); }
[aria-invalid="true"] { border-bottom-color: var(--err) !important; }

.prefixed { display: flex; align-items: stretch; border-bottom: 1px solid var(--muted); }
.prefixed span { display: flex; align-items: center; padding-right: 2px; color: var(--muted); }
.prefixed input { border: 0; }
.prefixed input:focus-visible { box-shadow: none; }
.prefixed:focus-within { border-bottom-color: var(--fg); box-shadow: 0 1px 0 var(--fg); }
.prefixed:has([aria-invalid="true"]) { border-bottom-color: var(--err); }

/* kaz's agreement as a sheet of paper: title centred at the top, numbered clauses that hang in the margin,
   all the text on one column, and the blanks are ruled lines the client writes on.
   It's the one raised object on the page (the shadow), because it's the thing you put your name to. */
.contract {
  --fg: var(--ink); --muted: #5d5b56; --line: #d6d3ca; --err: #b3261e;
  /* The sheet's soft colours follow its paper and words, so a dark sheet stays readable. */
  --muted: color-mix(in srgb, var(--ink) 68%, var(--paper));
  --line: color-mix(in srgb, var(--ink) 14%, var(--paper));
  --clause-no: 24px;
  color-scheme: light;   /* native radio buttons drawn for paper, not for the dark page around it */
  margin: 0 0 24px;
  padding: 26px 18px 18px;
  background: var(--paper); color: var(--ink);
  font-size: calc(14px * var(--s-body)); line-height: 1.5;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .3);
}
:root[data-theme="light"] .contract { box-shadow: 0 1px 2px rgba(0, 0, 0, .1), 0 12px 30px rgba(0, 0, 0, .08); }

.contract-head {
  display: grid; justify-items: center; gap: 6px;
  padding-bottom: 18px; border-bottom: 1px solid var(--ink);
  text-align: center;
}
.contract-brand { font: 700 calc(19px * var(--s-heading))/1 var(--display); letter-spacing: .04em; text-transform: uppercase; }
.contract-title { margin: 0; color: var(--ink); font-weight: 700; text-wrap: balance; }
.contract-parties { padding: 16px 0; text-align: center; text-wrap: balance; }

.clause { padding: 14px 0 16px; border-top: 1px solid var(--line); }
.clause-head {
  display: grid; grid-template-columns: var(--clause-no) minmax(0, 1fr); align-items: baseline;
  margin: 0 0 8px; font: inherit;
}
.clause-no { color: var(--muted); font-size: calc(12px * var(--s-small)); }
.clause-title { font-weight: 700; }
.clause-body { display: grid; gap: 8px; margin-left: var(--clause-no); min-width: 0; }
.clause-body ul, .pack ul { display: grid; gap: 2px; margin: 0; padding-left: 16px; }
.clause-text { display: grid; gap: 8px; }

/* A blank: its label, then a ruled line to write on. */
.blank { gap: 0; margin: 0; }
.blank label, .blank-label { font-size: calc(14px * var(--s-body)); font-weight: 400; }
.blank input[type="text"], .blank .prefixed { border-bottom-color: var(--ink); }
.blank-value { display: block; min-height: 44px; padding: 10px 0; border-bottom: 1px solid var(--ink); font-size: calc(16px * var(--s-body)); line-height: 1.4; overflow-wrap: anywhere; }

.packs-field { margin: 0 0 6px; gap: 6px; }
.packs { display: grid; }
.pack { padding: 4px 0 12px; border-top: 1px solid var(--line); cursor: pointer; }
.pack-head { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: calc(14px * var(--s-body)) !important; cursor: pointer; }
.pack-head input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--ink); }
.pack ul { margin-left: 28px; font-size: calc(13.5px * var(--s-body)); }
/* Once a package is picked, the others step back, like circling one option on paper. */
.packs:has(input:checked) .pack:not(:has(input:checked)) { color: var(--muted); }
.packs:has(input:checked) .pack:not(:has(input:checked)) .pack-head { font-weight: 400; }

.contract-thanks { padding-top: 16px; border-top: 1px solid var(--ink); text-align: center; text-wrap: balance; }

.sign-line { display: flex; align-items: flex-end; gap: 8px; border-bottom: 1px solid var(--ink); }
.sign-line input[type="text"]::placeholder { font: 400 14px/1.4 var(--sans); }
.sign-line input[type="text"] {
  min-height: 62px; padding: 10px 0 0;
  background: transparent; border: 0;
  color: var(--ink);
  font: 400 42px/1.1 "Herr Von Muellerhoff", cursive;
}
.sign-line input[type="text"]:focus-visible { outline: none; box-shadow: none; }
.sign-line:focus-within { box-shadow: 0 1px 0 var(--ink); }   /* same focus mark as every other field */
.sign-line:has([aria-invalid="true"]) { border-bottom-color: var(--err); }

.form-nav { display: flex; justify-content: flex-end; margin-top: 8px; }
.form-nav .btn { min-width: 160px; }
.form-error { margin-top: 12px; }

.book-done { display: grid; gap: 14px; justify-items: start; }
.book-done:focus { outline: none; }
.done-title { margin: 0; font: 700 calc(clamp(26px, 4vw, 40px) * var(--s-heading))/1.1 var(--display); letter-spacing: -.018em; }
.done-text { max-width: 44ch; }
.done-proto { color: var(--muted); max-width: 50ch; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 13px; }

/* ---------- footer ---------- */

.site-footer {
  display: grid; gap: 6px;
  padding: 28px var(--gutter) calc(24px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: calc(13px * var(--s-small));
}
.foot-name { color: var(--fg); font: 700 calc(14px * var(--s-heading))/1.4 var(--display); letter-spacing: .04em; text-transform: uppercase; }

/* ---------- film view ---------- */

dialog.project {
  width: 100%; height: 100%;
  max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: var(--bg); color: var(--fg);
  overflow-y: auto; overscroll-behavior: contain;
}
dialog.project::backdrop { background: var(--bg); }
.project-bar {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  height: var(--header-h); padding: 0 var(--gutter);
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.project-bar .cap { color: var(--muted); }
.project-body { max-width: 1400px; margin: 0 auto; padding: 24px var(--gutter) 48px; }
.project-head { display: grid; gap: 14px; margin-bottom: 22px; }
.project-title { margin: 0; font: 700 calc(clamp(26px, 4.2vw, 52px) * var(--s-heading))/1.12 var(--display); letter-spacing: -.02em; }
.project-facts {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px;
  margin: 0;
}
.project-facts dt { color: var(--muted); }
.project-facts dd { margin: 1px 0 0; font-size: calc(14px * var(--s-body)); }

.player {
  --r: 16 / 9;
  width: min(100%, calc((100vh - var(--header-h) - 48px) * var(--r)));
  width: min(100%, calc((100svh - var(--header-h) - 48px) * var(--r)));
  aspect-ratio: var(--r);
  margin: 0 auto 12px;
  background: #000; overflow: hidden;
}
.player video { width: 100%; height: 100%; object-fit: contain; background: #000; }

.project-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin-top: 36px; padding-top: 16px; border-top: 1px solid var(--line);
}
.project-step { display: grid; gap: 3px; align-content: start; min-height: 44px; text-decoration: none; }
.project-step span:first-child { color: var(--muted); }
.project-step span:last-child { font: 700 calc(clamp(15px, 1.7vw, 22px) * var(--s-heading))/1.2 var(--display); letter-spacing: -.008em; }
.project-step:hover span:last-child { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.project-step-next { text-align: right; justify-items: end; }

/* ---------- photo viewer: the same carousel, one photo at a time, on black ---------- */

dialog.viewer {
  width: 100%; height: 100%;
  max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: var(--viewer, #000); color: #f2f2f0;
  overflow: hidden; overscroll-behavior: contain;
}
dialog.viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); }
dialog.viewer::backdrop { background: var(--viewer, #000); }
.viewer-bar {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px;
  height: var(--header-h); padding: 0 var(--gutter);
}
.viewer-title { overflow: hidden; font: 700 calc(14px * var(--s-heading))/1.2 var(--display); white-space: nowrap; text-overflow: ellipsis; }
.viewer-count { color: rgba(242, 242, 240, .8); font-size: calc(13px * var(--s-small)); }
.viewer-close { justify-self: end; color: inherit; }
.viewer-rail {
  display: flex; min-height: 0;
  margin: 0; padding: 0; list-style: none;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain;
}
.viewer-rail::-webkit-scrollbar { display: none; }
.viewer-slide {
  flex: 0 0 100%; min-width: 0; height: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 0 0 calc(12px + env(safe-area-inset-bottom));
  scroll-snap-align: center; scroll-snap-stop: always;
}
.viewer-slide img, .viewer-slide video { width: 100%; height: 100%; object-fit: contain; }
/* On a computer the arrows sit right beside the photo, level with its middle, so the mouse barely travels (USER 11-04).
   --shown-w = the photo's width on screen, set in app.js. A wide photo that leaves no room keeps them just inside the
   window, on top of the picture, where the shadow keeps them visible. */
.viewer-arrow {
  position: absolute; top: calc((100% + var(--header-h) - 12px) / 2); display: none; place-items: center;
  width: 56px; height: 96px; margin-top: -48px; padding: 0;
  background: none; border: 0; color: inherit; cursor: pointer;
  filter: drop-shadow(0 0 4px rgba(0, 0, 0, .65));
  transition: opacity .2s;
}
.viewer-arrow[aria-disabled="true"] { opacity: .38; cursor: default; }
.viewer-prev { left: max(4px, calc(50% - var(--shown-w, 30vw) / 2 - 56px)); }
.viewer-next { right: max(4px, calc(50% - var(--shown-w, 30vw) / 2 - 56px)); }

/* ---------- prototype switcher (delete with prototype: false) ---------- */

/* A slim tab on the right edge: the bottom corners belong to the timeline and the form buttons. */
.proto {
  position: fixed; right: 0; top: 50%; z-index: 30;
  display: flex; flex-direction: row-reverse; align-items: center; gap: 8px;
  transform: translateY(-50%);
  transition: opacity .25s, transform .25s;
}
.proto.is-tucked { opacity: 0; transform: translate(100%, -50%); pointer-events: none; }
.proto-toggle {
  width: 26px; min-height: 96px; padding: 10px 0;
  writing-mode: vertical-rl; transform: rotate(180deg);
  background: rgba(12, 12, 11, .82); color: rgba(255, 255, 255, .85);
  border: 0; cursor: pointer;
  font-size: 10px;
}
.proto-toggle[aria-expanded="true"] { color: #fff; }
.proto-panel {
  width: min(300px, calc(100vw - 56px));
  padding: 14px;
  background: var(--surface); color: var(--fg);
  border: 1px solid var(--line);
}
.proto-note { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.proto-row { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.proto-row .cap { width: 64px; color: var(--muted); }
.proto-row button {
  min-height: 44px; padding: 0 12px;
  background: transparent; border: 1px solid var(--line);
  font-size: 13px; cursor: pointer;
}
.proto-row button[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }

/* ================= 600px ================= */
@media (min-width: 600px) {
  :root { --gutter: 24px; }
  .nav-short { display: none; }
  .nav-full { display: inline; }
  .nav a { padding: 0 10px; font-size: calc(14px * var(--s-menu)); }
  .project-facts { grid-template-columns: repeat(4, auto); justify-content: start; gap: 10px 40px; }
  .site-footer { grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; }
  .foot-meta { grid-column: 1; grid-row: 2; }
  .foot-links { grid-column: 2; grid-row: 1 / span 2; }
  .foot-copy { grid-column: 3; grid-row: 1 / span 2; justify-self: end; }

  .contract { --clause-no: 34px; padding: 36px 34px 26px; }
  /* Label and line on one row, the way a paper form reads. */
  .blank { grid-template-columns: auto minmax(0, 1fr); column-gap: 8px; align-items: end; }
  .blank label, .blank-label { padding-bottom: 11px; white-space: nowrap; }
  .blank .err { grid-column: 1 / -1; }
}

/* ================= 720px: work rows side by side ================= */
@media (min-width: 720px) {
  .work-list { gap: 72px; }
  .work-link { grid-template-columns: 8fr 4fr; gap: 28px; align-items: stretch; }
  .work-row:nth-child(even) .work-link { grid-template-columns: 4fr 8fr; }
  .work-row:nth-child(even) .work-media { order: 2; }
  .work-text { align-content: space-between; }
  .work-info { gap: 6px; }
  .work-no { display: block; }
  .work-title { font-size: calc(clamp(20px, 2.2vw, 30px) * var(--s-heading)); }

  .filters { flex-wrap: wrap; overflow: visible; margin: 0 0 28px; padding: 0; gap: 4px 22px; }
  .grid { grid-template-columns: repeat(var(--grid-cols, 2), minmax(0, 1fr)); gap: 40px 6px; }
  .covers { grid-template-columns: repeat(var(--cover-cols, 3), minmax(0, 1fr)); gap: 40px 6px; }
  /* A single shoot keeps a cover's size, with its caption beside it, like the selected-work rows. */
  .cover:only-child .cover-link { grid-template-columns: calc((100% - 12px) / 3) minmax(0, 1fr); gap: 20px; align-items: end; }
  .viewer-arrow { display: grid; }
}

/* ================= 900px ================= */
@media (min-width: 900px) {
  :root {
    --gutter: 32px;
    --header-h: 64px;
    --section-y: calc(136px * var(--space, 1));
    --tl-clips: 76px;
  }
  .wordmark { font-size: calc(15px * var(--s-menu)); }
  .nav a { padding: 0 14px; }

  .hero-frame { height: calc(100svh - var(--header-h) - var(--tl-h) - 8px); min-height: 420px; }
  .hero-clip { top: 18px; left: 22px; }
  .hero-copy { left: 22px; right: 22px; bottom: 20px; }

  .clip { grid-template-columns: auto 1fr; grid-template-rows: auto minmax(0, 1fr); column-gap: 8px; padding: 8px 0 0; }
  .clip-name { display: block; font-size: calc(12px * var(--s-small)); line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .clip img { grid-column: 1 / -1; width: auto; max-width: 112px; aspect-ratio: 16 / 9; height: 100%; }

  .sec-title { margin-bottom: 44px; }

  /* Contact on a computer: the email bottom left, the social links bottom right, BOOKING between them, as in his mockup. */
  .contact-page { padding: calc(var(--header-h) + 36px) clamp(32px, 7vw, 120px) 36px; }
  .contact-head { margin-left: clamp(0px, 1vw, 24px); }
  .contact-reach { grid-template-columns: 1fr auto; align-items: start; }
  .contact-book { margin-top: -8px; }

  /* Lists on the left, his words to the right of them, the way kaz laid it out. Tall enough for the film behind to be seen. */
  .about { min-height: min(100svh, 920px); }
  .about-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 64px; }
  .about-lists { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 64px 32px; }
  .about-body { padding-top: 34px; }

  .book { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 72px; align-items: start; }
  .book-intro { position: sticky; top: 96px; }   /* stays beside the agreement while it's being read */

  .project-head { grid-template-columns: 1fr auto; align-items: end; }
  .project-body { padding-top: 36px; }
}

/* ---------- what the editor can switch on ---------- */
.sec-title, .wp-title:not(.wp-other), .wp-sub, .work-title, .all-work-text, .wp-foot-text, .project-title { color: var(--heading, inherit); }
.work-media, .tile-media, .cover-media, .player, .hero-frame { border-radius: var(--radius-image, 0); }

.site-logo { display: block; height: var(--logo-height, 32px); width: auto; max-width: 40vw; object-fit: contain; }
.wordmark.has-logo { gap: 10px; }
/* A phone has room for the menu and a modest logo, so a big logo stays modest there and the name steps aside. */
@media (max-width: 599px) {
  .site-logo { height: min(var(--logo-height-phone, var(--logo-height, 32px)), 40px); max-width: 28vw; object-position: left center; }
  .wordmark.has-logo span { display: none; }
  /* The menu has to fit one line on a phone, whatever size the rest of the text is set to. */
  .wordmark { font-size: min(calc(14px * var(--s-menu)), 16px); }
  .nav a { font-size: min(calc(13.5px * var(--s-menu)), 14.5px); padding: 0 6px; }
}
.hero-logo { display: block; width: 100%; height: auto; object-fit: contain; object-position: left bottom; }
.foot-logo { display: block; height: var(--logo-height, 32px); width: auto; margin-bottom: 8px; }

.custom-wrap { display: grid; gap: 24px; }
.custom-picture { width: 100%; height: auto; display: block; border-radius: var(--radius-image, 0); }
.custom-button { justify-self: start; margin-top: 18px; }
.custom-copy { display: grid; align-content: center; justify-items: start; }
@media (min-width: 800px) {
  .custom-wrap[data-picture="left"], .custom-wrap[data-picture="right"] { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: center; }
  .custom-wrap[data-picture="right"] .custom-picture { order: 2; }
}

.no-counters .work-no, .no-counters #projectIndex, .no-counters .viewer-count, .no-counters .clip-no { display: none; }
.no-timecode #tcNow, .no-timecode #tcTotal { visibility: hidden; }

/* The watermark sits over the picture. It's on the page, not in the file. */
.has-wm { container-type: inline-size; }
.cover-media.has-wm, .player.has-wm, .viewer-slide.has-wm { position: relative; }
.wm { position: absolute; z-index: 2; pointer-events: none; }
.wm-image { width: calc(var(--wm-size, 15) * 1cqw); height: auto; }
.wm-text { font: 700 calc(var(--wm-size, 15) * .3cqw)/1 var(--display); letter-spacing: .02em; color: var(--wm-color, #fff); text-shadow: 0 1px 6px rgba(0, 0, 0, .6); white-space: nowrap; }
.wm[data-at="top-left"] { top: 4%; left: 3%; }
.wm[data-at="top-right"] { top: 4%; right: 3%; }
.wm[data-at="bottom-left"] { bottom: 4%; left: 3%; }
.wm[data-at="bottom-right"] { bottom: 4%; right: 3%; }
.wm[data-at="center"] { top: 50%; left: 50%; transform: translate(-50%, -50%); }

/* kaz 11-12: "His site fades to it, rather than loading like a generic website". The site fades in when it opens; going between the
   home page and Work fades out quickly and the new page fades in (app.js fadeThen). Films and photos fade in when they open. */
@keyframes fade-in { from { opacity: 0; } }
main, .site-footer { animation: fade-in .7s ease backwards; transition: opacity .42s ease; }
body.is-leaving main, body.is-leaving .site-footer { opacity: 0; transition-duration: .16s; }
dialog.project[open], dialog.viewer[open] { animation: fade-in .35s ease; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
  main, .site-footer, dialog.project[open], dialog.viewer[open] { animation: none; }
}
