/* ==========================================================================
   SURVEILLANCE — site styles
   Two colours, one typeface, two sizes. Everything else is spacing and 1px lines.
   ========================================================================== */

/* GT Standard, self-hosted. Only the weights a page actually uses get downloaded. */
@font-face { font-family: "GT Standard"; src: url("../fonts/GtStandard-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "GT Standard"; src: url("../fonts/GtStandard-Medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "GT Standard"; src: url("../fonts/GtStandard-SemiBold.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "GT Standard"; src: url("../fonts/GtStandard-ExtraBold.woff2") format("woff2"); font-weight: 800; font-style: normal; font-display: swap; }

:root {
  --ink: #030303;
  --paper: #F8F8F6;
  /* Light mode: ink type on a paper ground. Lines and secondary text are ink
     mixed into paper, so the palette stays two colours. */
  --line: color-mix(in srgb, var(--ink) 26%, var(--paper));
  --muted: color-mix(in srgb, var(--ink) 62%, var(--paper));
  --raise: color-mix(in srgb, var(--ink) 5%, var(--paper));

  --font: "GT Standard", "Helvetica Neue", Helvetica, Arial, sans-serif;

  /* Two type sizes only: headings and everything else. */
  --fs-text: clamp(14px, 0.4vw + 12.5px, 17px);
  --fs-head: clamp(21px, 0.4vw + 19px, 25px);
  /* Project breakdown copy (brief, direction, deliverables) reads larger. */
  --fs-body: clamp(18px, 0.7vw + 14px, 26px);
  /* Titles (h1-h3): large GT Standard ExtraBold, tracked -40. */
  --fs-title: clamp(36px, 4.4vw, 60px);

  /* One page edge and three spacing steps, used everywhere. */
  --edge: clamp(20px, 5vw, 96px);
  --space-s: clamp(24px, 3vw, 40px);   /* inside cells and rows */
  --space-m: clamp(48px, 6vw, 80px);   /* hero bottom, between a heading and content */
  --space-l: clamp(64px, 9vw, 120px);  /* between sections */
  --gutter: 10px;                      /* between gallery media, across and down */
  --nav-h: 56px;

  /* Motion: one curve for everything that moves. Sharp start, soft landing. */
  --ease: cubic-bezier(0.7, 0, 0.2, 1);
}

/* Animatable custom properties for the motion below.
   --draw: how far a 1px rule has drawn across (100% = fully drawn).
   --trace: how far a perimeter trace has run around a box (0 to 1). */
@property --draw { syntax: "<percentage>"; inherits: false; initial-value: 100%; }
@property --trace { syntax: "<number>"; inherits: false; initial-value: 0; }

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--fs-text)/1.45 var(--font);
  letter-spacing: -0.04em; /* -40, same as the headings */
  text-transform: uppercase;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, p, ul, ol, fieldset, legend { margin: 0; padding: 0; font-weight: 400; }
h1, h2, h3 {
  font: 800 var(--fs-title)/0.95 var(--font);
  letter-spacing: -0.04em;
}
ul, ol { list-style: none; }
fieldset { border: 0; min-width: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
}
button { background: none; border: 0; padding: 0; cursor: pointer; }

[hidden] { display: none !important; }
::selection { background: var(--ink); color: var(--paper); }
:focus-visible { outline: 1px solid currentColor; outline-offset: 3px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: var(--edge);
  top: -100px;
  z-index: 100;
  padding: 8px 12px;
  background: var(--ink);
  color: var(--paper);
}
.skip:focus { top: 8px; }

/* --------------------------------------------------------------------------
   Links and buttons. Every hover is an instant state change, no fades.
   -------------------------------------------------------------------------- */

.arrow { display: inline-block; transition: transform 320ms var(--ease); }

.link {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
}
a:hover .arrow,
button:hover .arrow { transform: translateX(4px); }

/* Links inside muted copy stand out by colour, not underline. */
.inline { color: var(--ink); }
.inline:hover { color: var(--muted); }

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.8em;
  padding: 12px 18px;
  border: 1px solid currentColor;
}
.button:focus-visible { outline: none; }

/* Full-bleed action bar: form submit, "back to all work". */
.bar {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px var(--edge);
  background: linear-gradient(var(--line) 0 0) left bottom / var(--draw) 1px no-repeat;
  font-size: var(--fs-head);
  text-align: left;
}
.bar:not(:disabled):hover,
.bar:focus-visible { background-color: var(--ink); color: var(--paper); outline: none; }
.bar:disabled { opacity: 0.5; cursor: wait; }

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 var(--edge);
  /* Bottom rule draws across on every page load. */
  background: linear-gradient(var(--line) 0 0) left bottom / var(--draw) 1px no-repeat var(--paper);
  animation: draw-in 1100ms var(--ease) 80ms both;
}
@keyframes draw-in { from { --draw: 0%; } }

.nav__mark img,
.footer__mark img { height: 14px; width: auto; }

.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.2vw, 36px);
}
.nav__links a { padding: 4px 0; }
/* No underlines: hover dims the link; the current section stays dimmed
   (aria-current="page" on the page itself, "true" on pages inside it). */
.nav__links a:hover,
.nav__links a[aria-current] { color: var(--muted); }

.nav__toggle { display: none; padding: 8px 0; }

@media (max-width: 900px) {
  .nav__toggle { display: block; }
  .nav__links {
    position: fixed;
    inset: var(--nav-h) 0 0 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--paper);
    font-size: var(--fs-head);
    visibility: hidden;
  }
  .nav.is-open .nav__links { visibility: visible; }
  /* Menu rules draw in one after another as the menu opens. */
  .nav__links li {
    --draw: 0%;
    background: linear-gradient(var(--line) 0 0) left bottom / var(--draw) 1px no-repeat;
  }
  .nav.is-open .nav__links li {
    --draw: 100%;
    transition: --draw 700ms var(--ease) calc(var(--i, 0) * 70ms);
  }
  .nav__links a {
    display: flex;
    justify-content: space-between;
    padding: var(--space-s) var(--edge);
    border: 0;
  }
  .nav__links a:hover { background: var(--ink); color: var(--paper); }
  body.nav-locked { overflow: hidden; }
}

/* --------------------------------------------------------------------------
   Hero: the same on every page. The homepage version fills the screen.
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  display: flex;
  align-items: end;
  padding: calc(var(--nav-h) + var(--space-m)) var(--edge) var(--space-m);
  isolation: isolate;
  overflow: hidden;
  /* The hero is isolated, so it needs its own ground: the `difference` layers
     inside it (filter wipes, the homepage copy over the eye) blend against it. */
  background: var(--paper);
}
.hero--full { min-height: 100vh; min-height: 100svh; }
/* Work page: intro on the left, filters flush right and top-aligned with
   the title, cards close underneath. */
.hero--tight {
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  padding-bottom: 24px;
}

/* Videos are only ever muted loops: no native controls, no play button
   (iOS draws one when Low Power Mode blocks autoplay). A blocked video goes
   transparent so the still underneath shows until it can play. */
video { pointer-events: none; }
video::-webkit-media-controls,
video::-webkit-media-controls-panel,
video::-webkit-media-controls-overlay-play-button,
video::-webkit-media-controls-start-playback-button {
  display: none !important;
  -webkit-appearance: none;
  opacity: 0 !important;
}
video.is-blocked { opacity: 0; }

/* Motion reel slot, full bleed behind the copy. Hidden until it has a source. */
.reel { position: absolute; inset: 0; z-index: -1; }
.reel video { width: 100%; height: 100%; object-fit: cover; }
/* Still frame under the video until it plays. A <picture> rather than the
   video's poster attribute so it can swap to a mobile still. */
.reel img { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; object-fit: cover; }
/* Mobile hero: add these two lines inside .reel, above the desktop ones
     <source srcset="assets/media/NAME-hero-mobile.jpg" media="(max-width: 700px)">        (in <picture>)
     <source src="assets/media/NAME-hero-mobile.mp4" type="video/mp4" media="(max-width: 700px)">  (in <video>)
   Phones up to 700px wide take the first source that fits; everything else
   falls through to the desktop files. Chosen once on load, not on resize. */
.reel video:not([src]):not(:has(source)) { display: none; }
/* Copy over footage stays paper on every page, light mode or not. */
.hero:has(> .reel) {
  --line: color-mix(in srgb, var(--paper) 26%, var(--ink));
  --muted: color-mix(in srgb, var(--paper) 62%, var(--ink));
  color: var(--paper);
}
/* Dark fade along the bottom so the hero copy stays readable over bright footage. */
.reel::after {
  content: "";
  position: absolute;
  inset: 45% 0 0;
  background: linear-gradient(to top, color-mix(in srgb, var(--ink) 85%, transparent), transparent);
  pointer-events: none;
}

.hero__inner { display: grid; gap: 18px; max-width: 60ch; }
.hero__title { max-width: 34ch; }
.hero__sub { color: var(--muted); max-width: 60ch; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 6px; }

/* Homepage: 1-bit eye (assets/js/hero-eye.js), right aligned to the page
   edge and centred under the nav. Copy flips to paper if it crosses it:
   under `difference` paper type shows as ink on the ground and paper on the
   ink glyphs. The sub is set so it lands on the same grey as --muted. */
.hero-eye {
  position: absolute;
  z-index: -1;
  right: var(--edge);
  top: calc(50% + var(--nav-h) / 2);
  translate: 0 -50%;
  width: min(40vw, calc(100svh - var(--nav-h) - 2 * var(--space-m)));
  aspect-ratio: 1;
  image-rendering: pixelated;
  pointer-events: none;
}
.hero--eye .hero__inner,
.hero--saw .hero__inner { mix-blend-mode: difference; color: var(--paper); }
.hero--eye .hero__sub,
.hero--saw .hero__sub { color: color-mix(in srgb, var(--paper) 62%, var(--ink)); }

/* Homepage saw blade: hub just inside the right edge so the right half runs
   off the page, left teeth about a third in. Centred top to bottom, but never
   lower than --space-s above the hero's bottom edge: on wide, short screens
   it rises and only the top (under the nav) is cut. Never taller than the
   screen. Idles slowly clockwise and turns further as the page scrolls
   (--spin, set in main.js). The wrap covers the hero on desktop; on phones
   it becomes the row above the copy (see below). */
.hero-saw-wrap {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.hero-saw {
  --saw: min(62vw, 100svh);
  position: absolute;
  left: calc(98% - var(--saw) / 2);
  max-width: none;
  top: min(50%, 100% - var(--saw) / 2 - var(--space-s));
  width: var(--saw);
  height: auto;
  aspect-ratio: 1;
  translate: 0 -50%;
  rotate: var(--spin, 0deg);
  /* 1-bit art: scale by nearest pixel so the grain stays pure ink and
     paper instead of averaging to a grey blur. */
  image-rendering: pixelated;
  pointer-events: none;
  user-select: none;
}
/* Phones: the headline wraps to a height we can't predict, so the blade gets
   its own row, everything between the nav and the copy, and is never bigger
   than that row (cqh), so it can't run into the headline. Hub at 88vw. */
@media (max-width: 700px) {
  .hero--saw {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    row-gap: var(--space-s);
  }
  .hero-saw-wrap {
    position: relative;
    inset: auto;
    align-self: stretch;
    container-type: size;
  }
  .hero-saw {
    --saw: min(100vw, 100cqh);
    left: calc(88vw - var(--edge) - var(--saw) / 2);
    top: 50%;
  }
}
@media (max-width: 700px) {
  .hero-eye {
    top: calc(var(--nav-h) + var(--space-m));
    translate: none;
    width: min(76vw, 44svh);
  }
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */

.section-head {
  display: grid;
  gap: 12px;
  padding: var(--space-l) var(--edge) var(--space-s);
}
.section-head h2 { max-width: 34ch; }
.section-head .sub { color: var(--muted); max-width: 60ch; }

.page-end { padding-bottom: var(--space-l); }

/* Closing call to action, inverted. */
.cta {
  padding: var(--space-l) var(--edge);
  background: var(--ink);
  color: var(--paper);
}
.cta__inner { display: grid; gap: 18px; max-width: 46ch; }
.cta .button { justify-self: start; margin-top: 12px; }

/* --------------------------------------------------------------------------
   Grid of cells: service cards, agency models, contact form.
   1px gaps over a line-coloured background draw the rules between cells.
   -------------------------------------------------------------------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border-block: 1px solid var(--line);
}
.grid--3 { --cols: 3; }
.grid + .grid { border-top: 0; }

.cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: var(--space-s) var(--edge);
  background: var(--paper);
}
.cell p { color: var(--muted); max-width: 46ch; }
.cell__key { color: var(--muted); }
.cell__title { font-size: var(--fs-head); line-height: 1.15; }
/* A title in a grid cell is full size unless its longest word (PERFORMANCE)
   would overflow the cell, then it shrinks just enough to fit. */
.grid > .cell { container-type: inline-size; }
.grid > .cell > h2, .grid > .cell > h3 { font-size: min(var(--fs-title), 13.5cqi); }

.cell--link .link { margin-top: auto; padding-top: 10px; }
.cell--link:focus-visible { outline: none; }
/* Pointer screens: a paper layer set to `difference` wipes in from the left
   and out to the right, like the buttons. */
@media (hover: hover) {
  .cell--link { position: relative; isolation: isolate; }
  .cell--link::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: var(--paper);
    mix-blend-mode: difference;
    pointer-events: none;
    transform: scaleX(0);
    transform-origin: 100% 50%;
    transition: transform 420ms var(--ease);
  }
  .cell--link:hover::before,
  .cell--link:focus-visible::before { transform: scaleX(1); transform-origin: 0% 50%; }
  /* Muted copy goes to full ink so the inversion lands on true paper. */
  .cell--link:hover p,
  .cell--link:focus-visible p { color: var(--ink); }
}
/* Wide touch screens (tablets) keep the plain invert. */
@media (hover: none) and (min-width: 901px) {
  .cell--link:hover,
  .cell--link:focus-visible { background: var(--ink); color: var(--paper); }
  .cell--link:hover p,
  .cell--link:focus-visible p { color: var(--paper); }
}

/* Touch screens, one column: the card crossing the middle of the screen is
   selected. A paper layer set to `difference` wipes across it in the scroll
   direction, inverting the card underneath, and hands off to the next card
   as the line leaves one and enters the other. main.js sets .is-active and
   --wipe-from (top or bottom). */
@media (hover: none) and (max-width: 900px) {
  .cell--link { position: relative; isolation: isolate; }
  .cell--link::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: var(--paper);
    mix-blend-mode: difference;
    pointer-events: none;
    transform: scaleY(0);
    transform-origin: 50% var(--wipe-from, 0%);
    transition: transform 460ms var(--ease);
  }
  .cell--link.is-active::before { transform: scaleY(1); }
  /* Muted copy goes to full paper so the inversion lands on true ink. */
  .cell--link.is-active p { color: var(--ink); }
  .cell--link.is-active .arrow { transform: translateX(4px); }
  /* The sticky tap :hover would fight the scroll selection. */
  .cell--link:hover { background: var(--paper); color: var(--ink); }
  .cell--link:hover p { color: var(--muted); }
  .cell--link.is-active:hover p { color: var(--ink); }
}

@media (max-width: 900px) { .grid--3 { --cols: 1; } }
@media (max-width: 700px) { .grid { --cols: 1; } }

/* --------------------------------------------------------------------------
   Numbered list (service deliverables, agency capabilities)
   -------------------------------------------------------------------------- */

.list {
  counter-reset: item;
  background: linear-gradient(var(--line) 0 0) left top / var(--draw) 1px no-repeat;
}
.list li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  column-gap: 16px;
  row-gap: 6px;
  align-items: baseline;
  padding: 18px var(--edge);
  background: linear-gradient(var(--line) 0 0) left bottom / var(--draw) 1px no-repeat;
  font-size: var(--fs-head);
  line-height: 1.2;
}
.list li::before {
  counter-increment: item;
  content: counter(item, decimal-leading-zero);
  font-size: var(--fs-text);
  color: var(--muted);
}
.list li > * { grid-column: 2; }
.list li p { font-size: var(--fs-text); line-height: 1.45; color: var(--muted); max-width: 60ch; }

/* Unnumbered (agency capabilities): rows sit flush on the page edge. */
.list--plain li { grid-template-columns: minmax(0, 1fr); }
.list--plain li::before { content: none; }
.list--plain li > * { grid-column: 1; }

/* Deliverable frames (service pages). Hovering a row inverts it and floats
   outlines of what it delivers, at their real aspect ratios, round the
   cursor. main.js builds them from the row's data-frames. Each frame is a
   box that grows out from the cursor point like a selection box, and folds
   back into it; its edges move rather than being clipped, so the stroke is
   there the whole way. The layer is one --frame-unit wide so the script can
   read the unit off it. */
@media (hover: hover) {
  .list--frames li:hover { background-color: var(--ink); color: var(--paper); }
  .list--frames li:hover::before { color: color-mix(in srgb, var(--paper) 55%, var(--ink)); }
}
.frames {
  --frame-unit: clamp(120px, 13vw, 230px);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 40;
  width: var(--frame-unit);
  height: 0;
  pointer-events: none;
}
.frames__frame {
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform;
}
.frames__frame i {
  position: absolute;
  inset: var(--shut);
  background: var(--paper);
  border: 1px solid var(--ink);
  transition: inset 140ms var(--ease);
}
.frames__set.is-open .frames__frame i {
  inset: 0;
  transition: inset 240ms var(--ease) var(--d, 0ms);
}
/* A frame with an image (a path after its ratio in data-frames): the image
   fills the whole frame and is clipped to the same growing box, with the
   outline drawn over it. clip-path runs on the same timings as the inset
   above so the two stay together. */
.frames__frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--paper);
  clip-path: inset(var(--shut));
  transition: clip-path 140ms var(--ease);
}
.frames__set.is-open .frames__frame img {
  clip-path: inset(0);
  transition: clip-path 240ms var(--ease) var(--d, 0ms);
}
.frames__frame.has-img i { background: none; }

/* --------------------------------------------------------------------------
   Project cards (homepage + work page)
   -------------------------------------------------------------------------- */

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-m) clamp(16px, 2vw, 28px);
  padding: 0 var(--edge);
}
/* Three columns only once the longest meta line (about 22em) fits on one line in a column. */
@media (max-width: 1599px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) { .cards { grid-template-columns: 1fr; } }
/* Homepage: a fourth card fills the second row only while the grid is two
   columns; at three columns and on phones it shows the first three. */
@media (min-width: 1600px), (max-width: 680px) {
  .cards--pair-fill > :nth-child(4) { display: none; }
}

.card { display: grid; gap: 12px; align-content: start; }
.card .media { aspect-ratio: 4 / 5; margin-bottom: 6px; }
/* .is-active is the hover on touch screens: main.js sets it on the homepage
   card crossing the middle of the screen as you scroll. */
.card:hover .media,
.card.is-active .media { border-color: var(--ink); }
.card:hover .media img,
.card:hover .media video,
.card.is-active .media img,
.card.is-active .media video { transform: scale(1.03); }
.card.is-active .arrow { transform: translateX(4px); }
/* Hover loop sits over the cover and only shows once it is actually playing.
   img.loop is the same loop played as an image when Low Power Mode refuses
   the video (main.js). */
.card .media video,
.card .media img.loop { visibility: hidden; }
.card .media.is-playing video,
.card .media.is-playing img.loop { visibility: visible; }
/* Meta stays on one line so every title in a row sits at the same height.
   The client name gives way with an ellipsis if a column is ever too narrow. */
.card__meta { display: flex; min-width: 0; white-space: nowrap; color: var(--muted); }
.card__meta span { flex: none; }
.card__meta span:nth-child(2) { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.card__meta span + span::before { content: "/"; margin: 0 0.5em; }
/* One column has no neighbours to line up with, so the meta can wrap instead of cutting the client name. */
@media (max-width: 680px) {
  .card__meta { flex-wrap: wrap; white-space: normal; }
  .card__meta span:nth-child(2) { overflow: visible; }
  /* The slash ends a line rather than starting the next one. */
  .card__meta span + span::before { content: none; }
  .card__meta span:not(:last-child)::after { content: "/"; margin: 0 0.5em; }
}
.card .link { justify-self: start; margin-top: 4px; }

.media {
  position: relative;
  overflow: hidden;
  background: var(--raise);
  border: 1px solid var(--line);
}
.media img,
.media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.media__ph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  color: var(--muted);
  text-align: center;
}

/* Work page filters (inside the hero) */
.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
@media (max-width: 700px) { .filters { justify-content: flex-start; } }
.filter { padding: 8px 12px; border: 1px solid var(--line); }
.filter[aria-pressed="true"] { border-color: var(--ink); }

/* --------------------------------------------------------------------------
   Case study
   -------------------------------------------------------------------------- */

.hero__inner:has(.cs-meta) { gap: 6px; }
.cs-meta { display: flex; flex-wrap: wrap; gap: 12px clamp(32px, 5vw, 72px); margin: 14px 0 0; }
.cs-meta dt { color: var(--muted); margin-bottom: 2px; }
.cs-meta dd { margin: 0; }
.cs-cover { aspect-ratio: 16 / 9; border-inline: 0; }

.approach { padding: var(--space-l) var(--edge); }
.approach--stack {
  padding-block: var(--space-m);
  background: linear-gradient(var(--line) 0 0) left top / var(--draw) 1px no-repeat;
}
.approach__copy { display: grid; gap: 18px; max-width: 58ch; }
.approach__copy p,
.approach__copy li { font: 400 var(--fs-body)/1.3 var(--font); }
.approach__copy p { color: var(--muted); }
.approach__copy .button { justify-self: start; margin-top: 12px; }

/* Desktop: brief, direction and deliverables sit in a 2x2 box of cells,
   1px rules between them like .grid. The fourth square stays empty (the
   ::after fills it with paper so the line colour doesn't show through).
   Below 900px the sections stack as before. */
@media (min-width: 901px) {
  .approach-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    background: var(--line);
    border-bottom: 1px solid var(--line);
  }
  .approach-grid > .approach,
  .approach-grid::after {
    padding: var(--space-m) var(--edge);
    background: var(--paper);
  }
  .approach-grid::after { content: ""; }
}

.plain-list li {
  padding: 10px 0;
  background: linear-gradient(var(--line) 0 0) left bottom / var(--draw) 1px no-repeat;
}
.plain-list li:first-child {
  background:
    linear-gradient(var(--line) 0 0) left top / var(--draw) 1px no-repeat,
    linear-gradient(var(--line) 0 0) left bottom / var(--draw) 1px no-repeat;
}

/* Gallery: a 6-column grid with a tight 10px gutter, so media reads as one
   dense run. Rows for stills (videos stay .media--wide, 16:9):
     .media              half width, 4:5 (two per row)
     .media--wide        full width, 16:9
     .media--still       full width, 1.65:1 (a wide still)
     .media--big         two thirds, 4:5
     .media--third       one third, 4:5
     .media--square      1:1, add to any of the above
     .gallery__stack     one third, media stacked down it; the last piece
                         stretches so the stack ends level with its row
   Big + stack:    <div class="media media--big">  + <div class="gallery__stack">
   Stack + big:    <div class="gallery__stack">    + <div class="media media--big">
   Half and half:  <div class="media media--square"> + <div class="media"> */
.gallery {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--gutter);
  padding: 0 var(--edge);
}
.gallery .media { grid-column: span 3; aspect-ratio: 4 / 5; }
/* Project videos are always 16:9. Other footage is cropped to fit. */
.gallery .media--wide { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
.gallery .media--still { grid-column: 1 / -1; aspect-ratio: 1.65; }
.gallery .media--big { grid-column: span 4; }
.gallery .media--third { grid-column: span 2; }
.gallery .media--square { aspect-ratio: 1; }
.gallery__stack { grid-column: span 2; display: flex; flex-direction: column; gap: var(--gutter); }
.gallery__stack .media { aspect-ratio: 4 / 5; }
.gallery__stack .media--square { aspect-ratio: 1; }
.gallery__stack .media:last-child { flex: 1 1 auto; aspect-ratio: auto; min-height: 120px; }
/* Every card 16:9, for galleries of uncropped landscape video. */
.gallery--landscape .media { aspect-ratio: 16 / 9; }
@media (max-width: 600px) {
  .gallery { grid-template-columns: 1fr; }
  .gallery > * { grid-column: 1 / -1 !important; }
  .gallery__stack .media:last-child { aspect-ratio: 4 / 5; }
  .gallery__stack .media--square:last-child { aspect-ratio: 1; }
}

/* --------------------------------------------------------------------------
   Contact form: inquiry type + fields as one gridded sheet.
   -------------------------------------------------------------------------- */

/* Inquiry type: the chosen option is inverted, like a hover that stays. */
.choice__opt { cursor: pointer; }
/* Muted key goes to full paper so the fill's inversion lands on true ink. */
.choice__opt:has(input:checked) .cell__key { color: var(--ink); }
.choice__opt:has(input:focus-visible) { outline: 1px solid var(--ink); outline-offset: -6px; }

/* Form cells are compact, about the height of a button:
   label and input share one line while the cell is wide enough for both,
   and the input drops under its label when it isn't. The label column fits
   the longest half-width label (COMPANY / ARTIST) in the wide caps face. */
.inquiry .cell { padding-block: 14px; }
.field {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 16px;
}
.field--full { grid-column: 1 / -1; }
.field label { flex: 0 0 10.6em; color: var(--muted); }
/* Wide enough for the longest project type (WHITE-LABEL PRODUCTION) and
   arrow, so a narrow cell stacks the field instead of clipping it. */
.field > :not(label) { flex: 1 1 16em; min-width: 0; }
.field:focus-within label { color: var(--ink); }

/* Same one-line height and text size as the fields below. */
.choice__opt {
  flex-direction: row;
  align-items: baseline;
  gap: 14px;
}
.choice__opt .cell__title { font-size: var(--fs-text); }

@media (max-width: 600px) {
  .field label { flex-basis: 100%; }
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  appearance: none;
  outline: none;
  color: var(--ink);
}
.field textarea { resize: vertical; min-height: 1.45em; }
.field select {
  padding-right: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M.5.5 5 5 9.5.5' fill='none' stroke='%23030303'/%3E%3C/svg%3E") no-repeat right 2px center / 10px 6px;
  cursor: pointer;
}
.field select option { background: var(--paper); color: var(--ink); }
/* An unanswered select reads like a placeholder. */
.field select:has(option[value=""]:checked) { color: var(--line); }
.field ::placeholder { color: var(--line); }
.field input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 100px var(--paper) inset;
  -webkit-text-fill-color: var(--ink);
}

.inquiry__error:empty,
.inquiry__status:empty { display: none; }
.inquiry__error { padding: 18px var(--edge) 0; color: var(--muted); }
.inquiry__status {
  padding: 0 var(--edge);
  max-width: calc(var(--edge) + 46ch);
  font-size: var(--fs-head);
  line-height: 1.3;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 40px clamp(40px, 6vw, 96px);
  padding: 56px var(--edge) 32px;
  background: linear-gradient(var(--line) 0 0) left top / var(--draw) 1px no-repeat;
}
.footer__brand { display: grid; gap: 12px; align-content: start; }
.footer__mark { justify-self: start; }
.footer__brand span { color: var(--muted); max-width: 36ch; }
.footer__nav,
.footer__social { display: grid; gap: 10px; align-content: start; }
.footer__nav a,
.footer__social a { color: var(--muted); }
.footer__nav a:hover,
.footer__social a:hover { color: var(--ink); }
.footer__base {
  grid-column: 1 / -1;
  padding-top: 24px;
  background: linear-gradient(var(--line) 0 0) left top / var(--draw) 1px no-repeat;
  color: var(--muted);
}

@media (max-width: 700px) {
  .footer { grid-template-columns: 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; }
}

/* --------------------------------------------------------------------------
   Motion. Lines draw, fills wipe, borders trace. No fades: every move is a
   line or a block travelling across, on the one --ease curve.
   -------------------------------------------------------------------------- */

/* Rules draw left to right as they scroll into view. main.js marks rules
   that start below the fold with .rule-wait, then .rule-in when they enter.
   Rules already on screen at load are left drawn. */
.rule-wait { --draw: 0%; }
.rule-wait.rule-in { --draw: 100%; transition: --draw 1000ms var(--ease) var(--d, 0ms); }

/* Fill wipe: a paper layer set to `difference` inverts whatever is under it,
   so the same layer works on ink and paper sections. It enters from the left
   and leaves to the right. No `isolation` here: the layer has to blend with
   the section behind it, since these elements have no background of their own. */
.button, .filter, .choice__opt { position: relative; }
.button::after, .filter::after, .choice__opt::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--paper);
  mix-blend-mode: difference;
  pointer-events: none;
  transform: scaleX(0);
  transform-origin: 100% 50%;
  transition: transform 360ms var(--ease);
}
.button:hover::after,
.button:focus-visible::after,
.filter[aria-pressed="true"]::after,
.choice__opt:has(input:checked)::after { transform: scaleX(1); transform-origin: 0% 50%; }

/* Perimeter trace: a 1px line runs clockwise round the box from the top left,
   top, right, bottom, left, and unwinds the same way back. */
.field { position: relative; }
.field::after, .filter::before, .choice__opt::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(var(--ink) 0 0) left top / calc(clamp(0, var(--trace) * 4, 1) * 100%) 1px no-repeat,
    linear-gradient(var(--ink) 0 0) right top / 1px calc(clamp(0, var(--trace) * 4 - 1, 1) * 100%) no-repeat,
    linear-gradient(var(--ink) 0 0) right bottom / calc(clamp(0, var(--trace) * 4 - 2, 1) * 100%) 1px no-repeat,
    linear-gradient(var(--ink) 0 0) left bottom / 1px calc(clamp(0, var(--trace) * 4 - 3, 1) * 100%) no-repeat;
  transition: --trace 560ms var(--ease);
}
.filter::before { inset: -1px; }
.field:focus-within::after,
.filter:hover::before,
.choice__opt:hover::before { --trace: 1; }


@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .rule-wait { --draw: 100%; }
}
