/* Multitude — brand tokens from Multitude-Brand Guidelines (2026), vol. 01 §2.6–2.8 */
:root {
  --ink: #052730;
  --ink-raised: #0c2f38;
  --paper: #f5f3f0;
  --silver: #e3e2df;
  --steel: #8a8d8c;
  /* Signal: the brand's production-system blue. Used only for the video player, at the client's request. */
  --signal: #1b5bec;

  --on-ink: var(--paper);
  --on-ink-2: rgba(245, 243, 240, 0.72);
  --on-ink-line: rgba(245, 243, 240, 0.16);
  --on-paper: var(--ink);
  --on-paper-2: rgba(5, 39, 48, 0.72);
  --on-paper-line: rgba(5, 39, 48, 0.16);

  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* Type scale: brand Display 64 / H1 44 / H3 22 / Body 16, rebuilt fluid so phones get their own sizes */
  --fs-display: clamp(2.5rem, 1.5rem + 4vw, 4rem);
  --fs-h1: clamp(1.875rem, 1.3rem + 2.2vw, 2.75rem);
  --fs-h3: clamp(1.1875rem, 1.1rem + 0.35vw, 1.375rem);
  --fs-lead: clamp(1.0625rem, 0.98rem + 0.4vw, 1.25rem);
  --fs-body: 1rem;
  --fs-small: 0.875rem;
  --fs-meta: 0.75rem;

  --gutter: clamp(1rem, 0.55rem + 1.9vw, 2.5rem);
  --section-y: clamp(4rem, 2.75rem + 5vw, 8rem);
  --header-h: 72px;
  --max: 1320px;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
}

@media (max-width: 767px) {
  :root { --header-h: 60px; }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: var(--header-h);
  scrollbar-color: var(--steel) var(--ink);
  background: var(--ink);
}
html:not(.lenis) { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html:not(.lenis) { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.62;
  color: var(--on-ink);
  background: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}
img, svg, video, iframe { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, p, ul { margin: 0; }
ul[role="list"], .nav ul, .menu-nav ul { list-style: none; padding: 0; }

::selection { background: var(--paper); color: var(--ink); }
.paper ::selection { background: var(--ink); color: var(--paper); }

:focus-visible { outline: 2px solid var(--paper); outline-offset: 3px; }
.paper :focus-visible { outline-color: var(--ink); }

.icon {
  width: 24px; height: 24px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.6;
  stroke-linecap: butt; stroke-linejoin: miter;
}

.skip {
  position: fixed; left: var(--gutter); top: 8px; z-index: 100;
  padding: 10px 16px; background: var(--paper); color: var(--ink);
  font-weight: 500; transform: translateY(-160%);
  transition: transform 200ms var(--ease-out);
}
.skip:focus-visible { transform: translateY(0); }

.wrap {
  width: 100%; max-width: calc(var(--max) + var(--gutter) * 2);
  margin-inline: auto; padding-inline: max(var(--gutter), env(safe-area-inset-left));
}

/* ---------- Type ---------- */
.display {
  font-size: var(--fs-display);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.h1 {
  font-size: var(--fs-h1);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.h3 {
  font-size: var(--fs-h3);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.lead {
  font-size: var(--fs-lead);
  line-height: 1.55;
  max-width: 40ch;
  text-wrap: pretty;
}

/* ---------- Surfaces ---------- */
.section { padding-block: var(--section-y); position: relative; }
.ink { background: var(--ink); color: var(--on-ink); }
.paper { background: var(--paper); color: var(--on-paper); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 28px;
  font-size: var(--fs-small); font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
  border: 1px solid transparent; border-radius: 0;
  transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease, transform 160ms var(--ease-out);
}
.btn:active { transform: scale(0.97); }
.btn-paper { background: var(--paper); color: var(--ink); }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-line { border-color: var(--on-ink-line); color: var(--on-ink); }
@media (hover: hover) and (pointer: fine) {
  .btn-paper:hover { background: var(--silver); }
  .btn-ink:hover { background: var(--ink-raised); }
  .btn-line:hover { border-color: var(--paper); }
}

.icon-btn {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; color: inherit;
  transition: background-color 200ms ease, transform 160ms var(--ease-out);
}
.icon-btn:active { transform: scale(0.94); }
.icon-btn--line { border: 1px solid var(--on-paper-line); }
@media (hover: hover) and (pointer: fine) {
  .icon-btn--line:hover { border-color: var(--ink); }
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: var(--ink);
  border-bottom: 1px solid transparent;
  transition: border-color 300ms ease;
}
.site-header.is-scrolled { border-bottom-color: var(--on-ink-line); }
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; min-height: 44px; }
.brand img { width: 148px; height: auto; }
.nav ul { display: flex; gap: clamp(20px, 2.2vw, 40px); }
.nav a {
  position: relative; display: inline-block; padding-block: 12px;
  font-size: 0.9375rem; color: var(--on-ink-2);
  transition: color 200ms ease;
}
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 6px; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: left;
  transition: transform 300ms var(--ease-out);
}
.nav a[aria-current] { color: var(--on-ink); }
.nav a[aria-current]::after { transform: scaleX(1); }
@media (hover: hover) and (pointer: fine) {
  .nav a:hover { color: var(--on-ink); }
  .nav a:hover::after { transform: scaleX(1); }
}
.menu-btn { display: none; margin-right: -10px; }

@media (max-width: 1099px) { /* six header items need the room; below this they live in the menu */
  .nav { display: none; }
  .menu-btn { display: inline-grid; }
}
@media (max-width: 767px) {
  .brand img { width: 120px; }
}

/* ---------- Mobile menu sheet ---------- */
.menu {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0 0 env(safe-area-inset-bottom); border: 0;
  background: var(--ink); color: var(--on-ink);
  clip-path: inset(0 0 100% 0);
  transition: clip-path 420ms var(--ease-drawer), overlay 420ms allow-discrete, display 420ms allow-discrete;
}
.menu[open] { clip-path: inset(0 0 0 0); }
@starting-style { .menu[open] { clip-path: inset(0 0 100% 0); } }
.menu::backdrop { background: transparent; }
.menu-head { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; }
.menu-head .icon-btn { margin-right: -10px; }
.menu-nav { padding-top: clamp(24px, 8vh, 64px); }
.menu-nav li { border-bottom: 1px solid var(--on-ink-line); }
.menu-nav a {
  display: flex; align-items: center; min-height: 64px;
  font-size: clamp(1.5rem, 1.1rem + 2vw, 2rem); font-weight: 500; letter-spacing: -0.02em;
}
.menu-nav li { opacity: 0; transform: translateY(12px); transition: opacity 300ms var(--ease-out), transform 300ms var(--ease-out); }
.menu[open] .menu-nav li { opacity: 1; transform: none; }
.menu[open] .menu-nav li:nth-child(1) { transition-delay: 120ms; }
.menu[open] .menu-nav li:nth-child(2) { transition-delay: 160ms; }
.menu[open] .menu-nav li:nth-child(3) { transition-delay: 200ms; }
.menu[open] .menu-nav li:nth-child(4) { transition-delay: 240ms; }
.menu[open] .menu-nav li:nth-child(5) { transition-delay: 280ms; }
@starting-style { .menu[open] .menu-nav li { opacity: 0; transform: translateY(12px); } }

/* ---------- Hero ---------- */
.hero {
  position: relative; isolation: isolate; overflow: clip;
  min-height: calc(100svh - var(--header-h));
  display: flex; align-items: flex-end;
  padding-block: clamp(5rem, 14vh, 9rem) clamp(3rem, 9vh, 6rem);
}
.hero-media { position: absolute; inset: 0; z-index: -2; }
.hero-media picture, .hero-media img { width: 100%; height: 100%; }
.hero-media img { object-fit: cover; object-position: 62% 50%; }
.hero-shade {
  position: absolute; inset: 0; z-index: -1;
  /* Shades use the still's own shadow tone; the top fades from the header's Ink so there's no hard line,
     and the bottom fades to Ink for the section below */
  background:
    linear-gradient(to bottom, rgba(5, 39, 48, 0.85) 0%, rgba(5, 39, 48, 0) 28%),
    linear-gradient(to top, rgba(5, 39, 48, 0.92) 0%, rgba(6, 30, 44, 0.5) 30%, rgba(6, 30, 44, 0) 62%),
    linear-gradient(to right, rgba(6, 30, 44, 0.72) 0%, rgba(6, 30, 44, 0) 60%);
}
.hero-content { display: grid; gap: clamp(20px, 3vh, 32px); }
.hero .display { max-width: 13ch; }
.hero-copy { display: grid; gap: 16px; justify-items: start; }
.hero-copy .lead { color: rgba(245, 243, 240, 0.86); }
.hero-copy .btn { margin-top: 12px; }

/* Letterbox: the brand's frame. Bars close the hero to a widescreen strip, then open on load. */
.letterbox { position: absolute; inset: 0; z-index: 0; pointer-events: none; display: none; }
.letterbox span { position: absolute; left: 0; right: 0; height: 50%; background: var(--ink); transform: scaleY(0); }
.letterbox span:first-child { top: 0; transform-origin: top; }
.letterbox span:last-child { bottom: 0; transform-origin: bottom; }
.js .letterbox { display: block; }

/* First paint already matches the intro's start frame (bars closed, copy hidden), so nothing flashes
   before main.js runs. The 2.5s fallback animation guarantees content shows even if scripts fail. */
@media (prefers-reduced-motion: no-preference) {
  .js .letterbox span { transform: scaleY(1); animation: intro-fallback-bars 0s 2.5s forwards; }
  .js:not(.motion-ready) .hero-content { visibility: hidden; animation: intro-fallback-show 0s 2.5s forwards; }
}
@keyframes intro-fallback-bars { to { transform: scaleY(0); } }
@keyframes intro-fallback-show { to { visibility: visible; } }

@media (max-width: 640px) {
  .hero { min-height: calc(92svh - var(--header-h)); padding-bottom: 40px; }
  .hero-media img { object-position: 50% 40%; }
  .hero-shade {
    background:
      linear-gradient(to bottom, rgba(5, 39, 48, 0.8) 0%, rgba(5, 39, 48, 0) 20%),
      linear-gradient(to top, rgba(5, 39, 48, 0.95) 0%, rgba(6, 30, 44, 0.72) 42%, rgba(6, 30, 44, 0.12) 80%);
  }
  .hero-copy .btn { width: 100%; }
}

/* split-line reveal */
[data-split] .w { display: inline-block; overflow: clip; vertical-align: top; padding-bottom: 0.08em; margin-bottom: -0.08em; }
[data-split] .w > span { display: inline-block; }

/* ---------- Services ---------- */
.services .h1 { margin-bottom: clamp(28px, 4vw, 56px); }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(10px, 1.2vw, 20px); }
.tile {
  position: relative; display: block; overflow: hidden; isolation: isolate;
  aspect-ratio: 4 / 5; background: var(--ink-raised);
}
.tile picture, .tile img { width: 100%; height: 100%; }
.tile img { object-fit: cover; transition: transform 900ms var(--ease-out); }
.tile::after {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(to top, rgba(5, 39, 48, 0.88) 0%, rgba(5, 39, 48, 0) 46%);
}
.tile-label {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: clamp(14px, 1.6vw, 24px);
  font-size: clamp(0.8125rem, 0.75rem + 0.3vw, 1rem); font-weight: 500; letter-spacing: 0.14em;
}
.tile-label .icon { transition: transform 300ms var(--ease-out); }
/* The original, ungraded photo sits on top and fades in on hover */
.tile-color {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 500ms ease, transform 900ms var(--ease-out);
}
.tile:focus-visible .tile-color { opacity: 1; }
@media (hover: hover) and (pointer: fine) {
  .tile:hover img { transform: scale(1.04); }
  .tile:hover .tile-color { opacity: 1; }
  .tile:hover .tile-label .icon { transform: translateX(4px); }
}
@media (max-width: 767px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .tile-label .icon { width: 20px; height: 20px; }
}

/* ---------- Clients ---------- */
.clients { padding-bottom: calc(var(--section-y) * 0.85); }
.clients-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: clamp(32px, 4.5vw, 64px); }
.clients-head .icon-btn .icon-play { display: none; }
.clients-head .icon-btn[aria-pressed="true"] .icon-pause { display: none; }
.clients-head .icon-btn[aria-pressed="true"] .icon-play { display: block; }

.marquee {
  display: grid; gap: clamp(20px, 3vw, 40px); overflow: clip;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
}
.marquee-row { display: flex; width: max-content; }
.marquee-track { display: flex; align-items: center; flex: none; }
.marquee { --logo-scale: 1; }
.marquee-track li { flex: none; padding-inline: clamp(20px, 2.6vw, 44px); }
/* --h is set per logo by tools/render.py so every logo carries a similar visual area */
.marquee-track img { height: calc(var(--h, 48) * var(--logo-scale) * 1px); width: auto; max-width: none; }
@media (max-width: 1023px) { .marquee { --logo-scale: 0.86; } }
@media (max-width: 599px) { .marquee { --logo-scale: 0.72; } }
.marquee-row { animation: marquee var(--marquee-dur, 70s) linear infinite; }
.marquee-row:nth-child(2) { animation-direction: reverse; --marquee-dur: 80s; }
.marquee.is-paused .marquee-row, .marquee.is-offscreen .marquee-row { animation-play-state: paused; }
@media (hover: hover) and (pointer: fine) {
  .marquee:hover .marquee-row { animation-play-state: paused; }
}
@keyframes marquee { to { transform: translateX(-50%); } }

@media (prefers-reduced-motion: reduce) {
  .marquee { -webkit-mask-image: none; mask-image: none; }
  .marquee-row { animation: none; width: auto; justify-content: center; }
  .marquee-track { flex-wrap: wrap; justify-content: center; row-gap: 28px; }
  .marquee-track[aria-hidden="true"] { display: none; }
  .clients-head .icon-btn { display: none; }
}

/* ---------- Work ---------- */
.work .h1 { margin-bottom: clamp(24px, 3vw, 40px); }
.filters {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: clamp(28px, 3.5vw, 48px);
}
.filter {
  min-height: 44px; padding: 0 18px;
  border: 1px solid var(--on-ink-line);
  font-size: var(--fs-small); color: var(--on-ink-2); white-space: nowrap;
  transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease;
}
.filter[aria-pressed="true"] { background: var(--paper); border-color: var(--paper); color: var(--ink); }
.filter .count { font-family: var(--font-mono); font-size: var(--fs-meta); margin-left: 8px; opacity: 0.8; }
@media (hover: hover) and (pointer: fine) {
  .filter:not([aria-pressed="true"]):hover { border-color: var(--paper); color: var(--on-ink); }
}
@media (max-width: 767px) {
  .filters {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
    margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter);
    scroll-padding-inline: var(--gutter);
    -webkit-mask-image: linear-gradient(to right, #000 85%, transparent);
    mask-image: linear-gradient(to right, #000 85%, transparent);
  }
  .filters::-webkit-scrollbar { display: none; }
}

.work-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: clamp(36px, 3.5vw, 56px) clamp(16px, 1.8vw, 28px);
}
.card { position: relative; display: grid; align-content: start; gap: 14px; }
.card[hidden] { display: none; }
.card-media {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--ink-raised);
}
.card-media::before {
  /* placeholder: brand mark ghost while the Drive thumbnail loads or if it fails */
  content: ""; position: absolute; inset: 0; margin: auto; width: 44px; height: 40px; opacity: 0.12;
  background: var(--paper);
  -webkit-mask: url("../assets/brand/mark.svg") center / contain no-repeat;
  mask: url("../assets/brand/mark.svg") center / contain no-repeat;
}
.card-media img {
  position: relative; width: 100%; height: 100%; object-fit: cover;
  transition: transform 700ms var(--ease-out), opacity 400ms ease;
}
.card-media img.is-broken { opacity: 0; }
/* Same round play button as the Plyr player it opens (client reference), in the brand Signal blue */
.card-play {
  position: absolute; left: 50%; top: 50%;
  display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%;
  background: var(--signal); color: #fff; opacity: 0.92;
  transform: translate(-50%, -50%);
  transition: transform 300ms var(--ease-out), opacity 200ms ease;
}
.card-play svg { width: 18px; height: 18px; fill: currentColor; margin-left: 3px; }
.card-preview {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 400ms ease;
}
.card.is-previewing .card-preview { opacity: 1; }
/* YouTube hover preview: no pointer events (the card stays the click target); scaled up to crop YouTube's overlays */
.card-preview--yt { border: 0; pointer-events: none; transform: scale(1.3); }
.work-grid .card.is-previewing .card-play { opacity: 0; transform: translate(-50%, -50%) scale(0.9); } /* beats the hover rule */
.card-play, .card-dur { z-index: 1; }
/* A film whose Drive file can't be played yet: visible, clearly marked, not clickable */
.card-unavailable {
  position: absolute; left: 12px; bottom: 12px; z-index: 1; padding: 4px 8px;
  font-family: var(--font-mono); font-size: var(--fs-meta); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--on-ink-2); background: rgba(5, 39, 48, 0.85); border: 1px solid var(--on-ink-line);
}
.card--unavailable .card-link { cursor: default; color: inherit; }
.card--unavailable .card-media img { opacity: 0.5; }
.card-dur {
  position: absolute; right: 12px; bottom: 12px; padding: 3px 7px;
  background: rgba(5, 39, 48, 0.82); color: var(--paper);
  font-family: var(--font-mono); font-size: var(--fs-meta); letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}
.card-meta {
  font-family: var(--font-mono); font-size: var(--fs-meta); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--on-ink-2);
}
.card-title { font-size: 1.0625rem; font-weight: 500; line-height: 1.3; letter-spacing: -0.005em; }
.card-link { text-align: left; }
.card-link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.card-link:focus-visible { outline: none; }
.card:has(.card-link:focus-visible) .card-media { outline: 2px solid var(--paper); outline-offset: 3px; }
.card-desc {
  font-size: 0.9375rem; line-height: 1.55; color: var(--on-ink-2);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
@media (hover: hover) and (pointer: fine) {
  .card:hover .card-media img { transform: scale(1.035); }
  .card:hover .card-play { transform: translate(-50%, -50%) scale(1.08); opacity: 1; }
}
.work-more { display: flex; justify-content: center; margin-top: clamp(40px, 5vw, 72px); }
.work-more[hidden] { display: none; }

@media (max-width: 1023px) { .work-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 599px) {
  /* Phones: a compact row per film — thumbnail beside title. The full description lives in the player. */
  .work-grid { grid-template-columns: 1fr; gap: 0; }
  .card {
    grid-template-columns: 132px 1fr; column-gap: 14px; row-gap: 4px;
    padding-block: 14px; border-bottom: 1px solid var(--on-ink-line);
  }
  .card:first-child { border-top: 1px solid var(--on-ink-line); }
  .card-media { grid-row: span 3; align-self: start; }
  .card-play { width: 34px; height: 34px; }
  .card-play svg { width: 12px; height: 12px; margin-left: 2px; }
  .card-dur { right: 6px; bottom: 6px; padding: 1px 5px; font-size: 0.6875rem; }
  .card-meta { font-size: 0.6875rem; }
  .card-title { font-size: 0.9375rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .card-desc { display: none; }
  .work-more .btn { width: 100%; }
}

/* ---------- Contact ---------- */
.contact-grid {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  grid-template-areas: "title form" "info form";
  grid-template-rows: auto 1fr;
  column-gap: clamp(48px, 7vw, 120px); row-gap: clamp(32px, 4vw, 56px); align-items: start;
}
.contact-title { grid-area: title; }
.form-panel { grid-area: form; }
.contact-info { grid-area: info; display: grid; gap: clamp(32px, 4vw, 48px); }
.info-block { display: grid; gap: 12px; }
.info-block p { max-width: 32ch; color: var(--on-paper-2); }
.text-link {
  display: inline-block; padding-block: 8px; min-height: 44px;
  font-size: var(--fs-lead); font-weight: 500;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px;
  text-decoration-color: var(--on-paper-line);
  transition: text-decoration-color 200ms ease;
}
@media (hover: hover) and (pointer: fine) { .text-link:hover { text-decoration-color: currentColor; } }
.social { display: grid; margin-top: 8px; border-top: 1px solid var(--on-paper-line); }
.social a {
  display: flex; align-items: center; justify-content: space-between; min-height: 52px;
  border-bottom: 1px solid var(--on-paper-line);
}
.social .icon { width: 20px; height: 20px; transform: rotate(-45deg); transition: transform 300ms var(--ease-out); }
.social-name { display: inline-flex; align-items: center; gap: 14px; }
.social-logo { width: 20px; height: 20px; flex: none; fill: currentColor; }
@media (hover: hover) and (pointer: fine) { .social a:hover .icon { transform: rotate(-45deg) translateX(3px); } }

/* The form is a framed Ink panel: it opens like the hero's letterbox, then each field's rule draws in. */
.form-panel {
  --field-rule: rgba(245, 243, 240, 0.45); /* 3.9:1 on Ink, meets non-text contrast */
  --field-error: #ff9c85;                    /* 7.4:1 on Ink */
  background: var(--ink); color: var(--on-ink);
  padding: clamp(28px, 4.5vw, 64px);
}
.form-panel ::selection { background: var(--paper); color: var(--ink); }
.form-panel :focus-visible { outline-color: var(--paper); }
.form-fields { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 3vw, 36px) clamp(20px, 2.4vw, 32px); }
.field--wide { grid-column: 1 / -1; }
.field { position: relative; padding-top: 20px; }
.field input, .field textarea {
  display: block; width: 100%; min-height: 48px; padding: 10px 0 12px;
  font-size: 1.0625rem; line-height: 1.5;
  background: transparent; color: var(--paper); caret-color: var(--paper);
  border: 0; border-radius: 0; outline: none;
  -webkit-appearance: none; appearance: none;
}
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus-visible, .field textarea:focus-visible { outline: none; } /* the drawn rule below is the focus indicator */
.field input:-webkit-autofill {
  -webkit-text-fill-color: var(--paper); caret-color: var(--paper);
  box-shadow: inset 0 0 0 100px var(--ink); transition: background-color 9999s;
}

/* Floating label: sits in the field, lifts when the field is focused or filled */
.field label {
  position: absolute; left: 0; top: 31px;
  font-size: 1rem; color: var(--on-ink-2);
  transform-origin: left top; pointer-events: none;
  transition: transform 250ms var(--ease-out), color 200ms ease;
}
.field :is(input, textarea):is(:focus, :not(:placeholder-shown)) + label {
  transform: translateY(-28px) scale(0.8125); color: var(--paper);
}
.field input:-webkit-autofill + label { transform: translateY(-28px) scale(0.8125); }

/* Rule: 1px base line; ::after is the 2px focus line that draws from the left */
.field-rule { position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--field-rule); transform-origin: left; }
.field-rule::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: var(--paper); transform: scaleX(0); transform-origin: left;
  transition: transform 450ms var(--ease-out), background-color 200ms ease;
}
.field :is(input, textarea):focus ~ .field-rule::after { transform: scaleX(1); }
.form-panel.was-validated .field :is(input, textarea):invalid ~ .field-rule::after { transform: scaleX(1); background: var(--field-error); }
.form-panel.was-validated .field :is(input, textarea):invalid + label { color: var(--field-error); }

.form-submit { margin-top: clamp(32px, 3.5vw, 48px); min-width: 200px; justify-content: space-between; gap: 24px; }
.form-submit .icon { width: 20px; height: 20px; transition: transform 300ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .form-submit:hover .icon { transform: translateX(4px); } }
.form-panel.is-sending .form-submit { opacity: 0.6; cursor: progress; }
.form-status { margin-top: 18px; font-size: var(--fs-small); line-height: 1.5; color: var(--on-ink-2); }
.form-status:empty { display: none; }

@media (max-width: 899px) {
  .contact-grid { grid-template-columns: 1fr; grid-template-areas: "title" "form" "info"; grid-template-rows: none; }
  .form-panel { margin-inline: calc(var(--gutter) * -1); }
}
@media (max-width: 599px) {
  .form-fields { grid-template-columns: 1fr; }
  .form-submit { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .field label, .field-rule::after { transition-duration: 1ms; }
}

/* ---------- Footer ---------- */
.site-footer { position: relative; overflow: clip; background: var(--ink); padding-block: 56px calc(56px + env(safe-area-inset-bottom)); }
.footer-mark {
  position: absolute; right: -6vw; top: 50%; width: clamp(220px, 34vw, 520px); height: auto;
  transform: translateY(-50%); fill: rgba(245, 243, 240, 0.045); pointer-events: none;
}
.footer-inner { position: relative; }

/* ---------- Player ---------- */
.player {
  /* 16:9 frame plus the caption must fit the viewport height on short laptop screens */
  width: min(1180px, 100vw - 2 * var(--gutter), (100svh - 220px) * 16 / 9); max-width: none; max-height: none;
  margin: auto; padding: 0; border: 0; overflow: visible;
  background: transparent; color: var(--on-ink);
  /* Opacity only: the expand from the card (main.js) provides the movement */
  opacity: 0;
  transition: opacity 200ms var(--ease-out), overlay 200ms allow-discrete, display 200ms allow-discrete;
}
.player[open] { opacity: 1; }
@starting-style { .player[open] { opacity: 0; } }
.player::backdrop {
  background: rgba(3, 26, 32, 0.94);
  opacity: 0; transition: opacity 240ms ease, overlay 240ms allow-discrete, display 240ms allow-discrete;
}
.player[open]::backdrop { opacity: 1; }
@starting-style { .player[open]::backdrop { opacity: 0; } }
.player.is-closing::backdrop { opacity: 0; transition: opacity 400ms ease; }
.player .plyr__controls { display: none; } /* no bottom bar: client request */
.player-inner { display: grid; gap: 20px; }
.player-frame { position: relative; aspect-ratio: 16 / 9; background: #000; }
.player-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; pointer-events: auto; }
.player-frame > video, .player-frame > .plyr { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; }
.player-frame video { object-fit: contain; }
.player .plyr {
  --plyr-color-main: var(--signal);
  --plyr-font-family: var(--font-sans);
  --plyr-video-background: #000;
  --plyr-control-icon-size: 18px;
  --plyr-range-thumb-background: #fff;
  --plyr-range-fill-background: var(--signal);
}
/* the big round play button, as in the client reference */
.player .plyr__control--overlaid { opacity: 1; padding: clamp(18px, 2.2vw, 26px); }
.player .plyr__control--overlaid svg { width: clamp(16px, 1.8vw, 22px); height: clamp(16px, 1.8vw, 22px); left: 2px; }
.player .plyr__poster { background-size: cover; }
.player-info { display: grid; gap: 8px; max-width: 72ch; }
.player-info p { color: var(--on-ink-2); font-size: 0.9375rem; }
.player-close { position: absolute; top: -56px; right: -10px; color: var(--paper); }
@media (max-width: 767px) {
  .player { width: 100vw; }
  .player-info { padding-inline: var(--gutter); }
  .player-close { top: -52px; right: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .player, .menu { transform: none; transition-duration: 1ms; }
  .menu { clip-path: none; }
  .menu-nav li { transform: none; }
}

/* ---------- Reveal defaults (JS sets the start state; content is visible without JS) ---------- */
@media (prefers-reduced-motion: reduce) {
  .tile img, .card-media img { transition: none; }
}

/* ---------- Shared helpers (home, labs) ---------- */
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.text-arrow {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px;
  font-size: var(--fs-small); font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--on-ink-2); transition: color 200ms ease;
}
.text-arrow .icon { width: 20px; height: 20px; transition: transform 300ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .text-arrow:hover { color: var(--on-ink); }
  .text-arrow:hover .icon { transform: translateX(4px); }
}

/* ---------- Curtain: the letterbox closes on leaving a page via a [data-enter] link (home, Switch to…) ---------- */
.curtain { position: fixed; inset: 0; z-index: 300; pointer-events: none; }
.curtain span {
  position: absolute; left: 0; right: 0; height: 50.5%;
  background: var(--ink); transform: scaleY(0);
  transition: transform 500ms var(--ease-in-out);
}
.curtain span:first-child { top: 0; transform-origin: top; }
.curtain span:last-child { bottom: 0; transform-origin: bottom; }
.curtain.is-closing span { transform: scaleY(1); }

/* ---------- "Switch to Labs / Films" in the header ---------- */
.nav .nav-switch {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; margin-block: 2px;
  border: 1px solid var(--on-ink-line); color: var(--on-ink);
  font-size: 0.8125rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase;
  transition: border-color 200ms ease, background-color 200ms ease;
}
.nav .nav-switch::after { display: none; }
.nav .nav-switch .icon { width: 16px; height: 16px; transition: transform 300ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .nav .nav-switch:hover { border-color: var(--paper); }
  .nav .nav-switch:hover .icon { transform: translateX(3px); }
}
.menu-nav .menu-switch { display: flex; align-items: center; justify-content: space-between; color: var(--on-ink-2); }
.menu-nav .menu-switch .icon { width: 24px; height: 24px; }

/* ---------- Footer: logo + copyright ---------- */
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; }
.footer-copy { font-size: var(--fs-small); color: var(--on-ink-2); }
