/* ── Type scale ──
   The whole site runs on two sizes. They are variables so that the phone can
   step both up at once: 12px is fine on a desktop monitor and mean on a
   handset held at arm's length. */
:root {
  --text: 12px;
  --text-small: 10px;
}

@media (max-width: 768px) {
  :root {
    --text: 14px;
    --text-small: 12px;
  }
}

body {
  /* Every name in the old stack -- Lucida Grande, Geneva, Helvetica Neue,
     Helvetica -- ships only on a Mac, so Windows fell through all four to
     generic sans-serif and rendered the site in Arial. Lucida Sans Unicode
     has shipped with Windows since 98 and is the same typeface family, so it
     lands close; Verdana is the backstop. There is no webfont to load here,
     and nothing to download. */
  font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', Geneva,
    Verdana, sans-serif;
  background: #ffffff;
  margin: 0;
  padding: 0;
  font-size: var(--text);
  line-height: 1.2;
  color: #606060;
  -webkit-font-smoothing: antialiased;
}

.page-wrap {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 2000px;
  margin-left: auto;
  margin-right: auto;
}

main {
  flex: 1;
}

/* Screen-reader-only utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Intro animation (hidden until JS reveals) ── */
.intro,
.project-section {
  visibility: hidden;
}

/* ── Intro Section ── */
.intro {
  display: flex;
  gap: 40px;
  padding: 24px 12px;
  margin-bottom: 0px;
  align-items: flex-start;
  flex-wrap: wrap;
}

/* Intro logo column */
.intro-logo {
  flex: 0 0 auto;
}

.intro-logo svg {
  display: block;
  width: 320px;
  height: auto;
  color: #000;
}

.intro-subtitle {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 8px;
  font-size: var(--text);
  color: #606060;
  line-height: 1.2;
}

/* Intro bio column */
.intro-bio {
  flex: 1;
  min-width: 300px;
  max-width: 500px;
}

.bio {
  font-size: var(--text);
  line-height: 1.2;
  color: #606060;
  margin: 0 0 16px;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: var(--text);
  line-height: 1.2;
  color: #606060;
}

.contact-info a {
  color: #606060;
  text-decoration: none;
}

.contact-info a:hover {
  text-decoration: underline;
}

/* Intro clients column */
.intro-clients {
  flex: 0 0 auto;
}

.clients-heading {
  font-size: var(--text);
  font-weight: 400;
  color: #606060;
  margin: 0 0 12px;
}

/* Logo grid */
.logo-grid {
  /* The cell width and the nominal optical height of a logo. Both are read by
     the per-logo scale below, so the breakpoint only has to change --logo-cell. */
  --logo-cell: 80px;
  --logo-height: 28px;

  display: grid;
  grid-template-columns: repeat(5, var(--logo-cell));
  gap: 12px 24px;
  align-items: center;
}

/* --logo-scale is the editorial size adjustment, set inline per logo from
   Sanity (default 1). It shrinks the box the image is fitted into rather than
   transforming the painted result: `transform: scale()` leaves the original
   box in the layout, so a logo above 1 overlapped its neighbours and one
   below 1 drifted right of the column it was supposed to line up with. */
.logo-grid-item {
  --logo-scale: 1;
  height: calc(var(--logo-height) * var(--logo-scale));
  display: flex;
  align-items: center;
}

/* A symbol mark narrow enough to leave a hole in its column reads better
   centred than flush left. Which logos qualify is decided in
   src/_data/logos.js from the image's aspect ratio. */
.logo-grid-item.is-centred {
  justify-content: center;
}

.logo-grid-item img {
  /* Both axes must be scaled, or a wide logo would grow to the full cell
     width and ignore its scale entirely. 100% is the column the item sits
     in, which equals --logo-cell where the columns are fixed and tracks the
     column where they are fractions, as they are on a phone. */
  max-width: calc(100% * var(--logo-scale));
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  opacity: 0.5;
  filter: grayscale(100%);
}

/* ── Filters ── */
.filter-overlay {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
  padding: 24px 12px 16px;
}

.filter-options {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.filter-option {
  position: relative;
  display: flex;
  align-items: center;
  font-size: var(--text);
  cursor: pointer;
  padding: 2px 6px;
  color: #555;
  white-space: nowrap;
  border: 1px solid #ccc;
  border-radius: 2px;
  transition: border-color 0.15s, color 0.15s;
}

.filter-option:hover {
  border-color: #888;
  color: #000;
}

.filter-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.filter-option:has(input[type="radio"]:checked) {
  font-weight: bold;
  color: #ffffff;
  border-color: #000;
  background-color: #000;
}

/* ── View toggle (Image / List) ── */
/* Borrows .filter-option wholesale so the two controls stay identical; the
   only difference is that the pair is welded into one segmented control,
   which is what separates "which view" from "which category". */
.view-toggle {
  display: flex;
}

.view-toggle .filter-option {
  border-radius: 0;
}

.view-toggle .filter-option:first-child {
  border-radius: 2px 0 0 2px;
}

.view-toggle .filter-option:last-child {
  border-radius: 0 2px 2px 0;
  /* Collapse the shared edge so the pair reads as one control. */
  margin-left: -1px;
}

/* Keep whichever segment is lit (hovered or selected) above its neighbour,
   or the neighbour's border paints over its own. */
.view-toggle .filter-option:hover,
.view-toggle .filter-option:has(input:checked) {
  z-index: 1;
}

/* ── List View ── */
/* Hidden by default: the image view is what loads, and main.js sets
   [data-view] on <body> when the toggle is used. */
.project-list {
  display: none;
  list-style: none;
  margin: 0;
  padding: 0 12px 64px;
}

body[data-view="list"] .project-list {
  display: block;
}

body[data-view="list"] .project-section {
  display: none;
}

.project-row {
  margin-bottom: 28px;
}

.project-row.hidden {
  display: none;
}

.project-row-head {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  margin-bottom: 6px;
  text-decoration: none;
}

.project-row-title {
  font-size: var(--text);
  font-weight: bold;
  color: #000000;
}

.project-row-head:hover .project-row-title {
  text-decoration: underline;
}

.project-row-year {
  font-size: var(--text);
  color: #606060;
}

/* One horizontal run of tiles per project. It scrolls rather than wrapping:
   a wrapped second line would read as a second project. The scrollbar is
   hidden because at most widths there is nothing to scroll. */
.project-row-assets {
  --tile-height: 88px;

  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 2px;
}

.project-row-assets::-webkit-scrollbar {
  display: none;
}

/* Only a row with tiles past its edge is worth grabbing; main.js sets this. */
.project-row-assets.is-scrollable {
  cursor: grab;
}

.project-row-assets.is-dragging {
  cursor: grabbing;
}

/* While a drag is running, the pointer is doing something other than
   pointing at a project, and text under it should not select. */
body.is-dragging {
  user-select: none;
}

body.is-dragging .cursor-label {
  opacity: 0;
}

.project-row-asset {
  flex: 0 0 auto;
  display: block;
  width: calc(var(--tile-height) * 190 / 88);
  height: var(--tile-height);
  background: #d9d9d9;
  overflow: hidden;
}

.project-row-asset img,
.project-row-asset video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.15s;
}

.project-row-asset:hover img,
.project-row-asset:hover video {
  opacity: 0.75;
}

/* ── Project Page ── */
.project-page {
  padding: 24px 12px 80px;
}

.project-page-head {
  max-width: 500px;
  margin-bottom: 20px;
}

.project-back {
  display: inline-block;
  font-size: var(--text);
  color: #606060;
  text-decoration: none;
  margin-bottom: 16px;
}

.project-back:hover {
  color: #000000;
  text-decoration: underline;
}

.project-page-title {
  font-family: inherit;
  font-size: var(--text);
  font-weight: bold;
  line-height: 1.2;
  color: #000000;
  margin: 0 0 2px;
}

.project-page-meta {
  display: flex;
  gap: 12px;
  font-size: var(--text);
  color: #606060;
  margin: 0 0 8px;
}

.project-page-intro p {
  margin: 0 0 4px;
}

.project-page-foot {
  margin-top: 48px;
}

/* ── Page builder blocks ── */
/* One rhythm for every block, so a page reads the same however its blocks are
   arranged in the Studio. */
.pb-block {
  margin: 0 0 24px;
}

.pb-caption {
  font-size: var(--text);
  color: #606060;
  margin-top: 6px;
}

.pb-image {
  background: #ededed;
  overflow: hidden;
  border-radius: 6px;
}

.pb-image img,
.pb-image video {
  width: 100%;
  height: auto;
  display: block;
}

.pb-image.is-zoomable {
  cursor: zoom-in;
}

/* Full width image */
.pb-full-image img {
  width: 100%;
}

/* Image grid. --pb-cols comes from the block; the floor keeps a 4-across grid
   from becoming four slivers on a phone. */
.pb-grid-items {
  display: grid;
  grid-template-columns: repeat(var(--pb-cols, 2), 1fr);
  gap: 12px;
  align-items: start;
}

/* Matching shapes are opt-in: without it each image keeps its own
   proportions, which suits stills of different formats sitting together. */
.pb-grid.is-cropped .pb-image {
  aspect-ratio: 16 / 9;
}

.pb-grid.is-cropped .pb-image img,
.pb-grid.is-cropped .pb-image video {
  height: 100%;
  object-fit: cover;
}

/* Text */
.pb-text.is-narrow {
  max-width: 500px;
}

.pb-text p {
  margin: 0 0 8px;
}

.pb-text h3 {
  font-family: inherit;
  font-size: var(--text);
  font-weight: bold;
  color: #000000;
  margin: 16px 0 4px;
}

.pb-text ul {
  margin: 0 0 8px;
  padding-left: 16px;
}

.pb-text a {
  color: #606060;
}

/* Video */
.pb-video.is-narrow {
  max-width: 500px;
}

.pb-video .video-embed {
  position: relative;
  aspect-ratio: var(--embed-aspect, 16 / 9);
  overflow: hidden;
  border-radius: 6px;
  background: #111;
}

.pb-video.is-portrait {
  max-width: 420px;
}

.pb-video .video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background-size: cover;
  background-position: center;
}

/* ── Whole-project click target ── */
/* The project is hovered and clicked as one thing, so the cursor has to say
   so everywhere inside it, not only over the links. */
[data-project-href] {
  cursor: pointer;
}

/* ── Media overlay link ── */
/* Covers a video or image so the whole thing opens the project and the cursor
   label can track across it: pointer events never reach us from inside a
   cross-origin Vimeo frame. Under the mute button, which keeps z-index 10. */
.media-link {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: block;
}

/* ── Cursor label ── */
/* Rides alongside the pointer over anything carrying data-cursor. The
   pointer itself stays the ordinary one; this is a label beside it, so it
   must never take the pointer or it would fight the element underneath. */
.cursor-label {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 90;
  padding: 3px 7px 4px;
  background: #000000;
  color: #ffffff;
  font-size: var(--text);
  line-height: 1.2;
  white-space: nowrap;
  /* Matches .filter-option, so the label reads as part of the same set of
     controls. */
  border-radius: 2px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s;
  will-change: transform;
}

.cursor-label.is-visible {
  opacity: 1;
}

/* No pointer to ride alongside. */
@media (hover: none) {
  .cursor-label {
    display: none;
  }
}

/* ── Lightbox ── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(255, 255, 255, 0.96);
  cursor: zoom-out;
  opacity: 0;
  transition: opacity 0.15s;
}

/* display:flex above beats the user agent's own `[hidden] { display: none }`,
   so without this the closed overlay stays laid out at opacity 0 over the
   whole viewport and eats every click on the page behind it. */
.lightbox[hidden] {
  display: none;
}

.lightbox.is-open {
  opacity: 1;
}

.lightbox-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: 100%;
  /* The media is the one thing in here that is not backdrop, so a click on it
     must not count as a click outside. */
  cursor: default;
}

.lightbox-frame.is-video {
  width: 100%;
  /* A player has a fixed shape, unlike a still, so the box is given one and
     the height cap keeps a wide window from pushing it off the screen. */
  max-width: min(100%, calc((100vh - 48px) * 16 / 9));
  aspect-ratio: 16 / 9;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.lightbox iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* ── Zoom target over a video ── */
/* The page's embeds are backgrounds with no controls, so there is nothing to
   click; this gives the player a surface. Under the mute button (z-index 10),
   like the homepage's .media-link. */
.media-zoom {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}

.lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  padding: 4px 8px;
  font: inherit;
  font-size: var(--text);
  color: #606060;
  cursor: pointer;
}

.lightbox-close:hover {
  color: #000000;
}

/* ── Reel Video ── */
.reel-video {
  position: relative;
  margin: 0 0 48px;
  padding-bottom: 56.25%;
  height: 0;
  border-radius: 0px;
  overflow: hidden;
  background: #111;
}

.reel-video iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.reel-video .video-mute-btn {
  z-index: 10;
}

@media (min-width: 2000px) {
  .reel-video {
    border-radius: 6px;
    margin-top: 24px;
  }
}

/* ── Project Sections ── */
.project-section {
  position: relative;
  padding: 0 12px;
  margin-bottom: 48px;
}

.project-section.hidden {
  display: none;
}

/* ── Project Heading ── */
.project-heading {
  font-family: inherit;
  font-size: var(--text);
  font-weight: 400;
  line-height: 1.2;
  color: #000000;
  margin-bottom: 0px;
}

.project-heading a {
  color: inherit;
  text-decoration: none;
}

.project-heading a:hover {
  text-decoration: underline;
}

.project-body p {
  margin-top: 0px;
  margin-bottom: 4px;
  padding-bottom: 4px;
}

/* ── Sticky Main Video ── */
.main-video {
  position: sticky;
  top: 40px;
  height: calc(100dvh - 80px);
  width: 100%;
  overflow: hidden;
  z-index: 1;
  background: #111;
  border-radius: 6px;
}

.main-video iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 177.78vh;
  height: 56.25vw;
  min-width: 100%;
  min-height: 100%;
  border: 0;
  background-size: cover;
  background-position: center;
}

.main-video .video-mute-btn {
  z-index: 10;
}

/* ── Sticky hero wrapper (info + main media stick together) ── */
.project-sticky-hero {
  position: sticky;
  top: 40px;
  height: calc(100dvh - 80px);
  display: flex;
  flex-direction: column;
  /* gap: 12px; */
}

.project-info {
  flex-shrink: 0;
  max-width: 500px;
}

.project-sticky-hero .main-video,
.project-sticky-hero .main-image {
  position: relative;
  top: auto;
  flex: 1;
  min-height: 0;
}

/* ── Sticky Main Image ── */
.main-image {
  position: sticky;
  top: 40px;
  height: calc(100dvh - 80px);
  width: 100%;
  overflow: hidden;
  z-index: 1;
  background: #111;
  border-radius: 6px;
}

.main-image > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Mute Button ── */
.video-mute-btn {
  position: absolute;
  bottom: 0.75rem;
  left: 0.75rem;
  z-index: 10;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.5);
  transition: color 0.2s;
}

.video-mute-btn:hover {
  color: rgba(255, 255, 255, 0.9);
}

.video-mute-btn svg {
  width: 1rem;
  height: 1rem;
  display: block;
}

.video-mute-btn .icon-unmuted { display: none; }
.video-mute-btn.unmuted .icon-muted { display: none; }
.video-mute-btn.unmuted .icon-unmuted { display: block; }

/* Mute button position on main hero */
.main-video .video-mute-btn {
  bottom: 0.75rem;
  left: 0.75rem;
}

/* ── Supporting Media ── */
.supporting-media {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2rem;
  padding: 2rem 24px 20dvh 0;
  padding-top: 2rem;
  pointer-events: none;
}

.supporting-item {
  max-width: 420px;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  background: #1a1a1a;
  pointer-events: auto;
}

.supporting-item img,
.supporting-item video {
  width: 100%;
  height: auto;
  display: block;
}

/* Supporting video embeds */
/* --embed-aspect is the video's real shape, set inline from oEmbed. A third
   of the videos are phone-shaped or square, and the 56.25% this replaced
   letterboxed every one of them inside bars of dead space. */
.supporting-video .video-embed {
  position: relative;
  aspect-ratio: var(--embed-aspect, 16 / 9);
  overflow: hidden;
}

/* A portrait clip at the full column width would stand two and a half
   screens tall, so it gets a narrower column of its own. */
.supporting-item.is-portrait {
  max-width: 260px;
}

.supporting-video .video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background-size: cover;
  background-position: center;
}

.supporting-video .video-mute-btn {
  z-index: 10;
}

/* ── Mobile ── */
@media (max-width: 768px) {
  .intro {
    flex-direction: column;
    gap: 16px;
    padding: 20px 12px 0;
    margin-bottom: 0px;
  }

  /* The aside under the wordmark is a desktop flourish. On a phone it is
     three lines between the name and the first real content. */
  .intro-subtitle {
    display: none;
  }

  /* The phone leads with the name, how to get hold of him, and who he has
     worked for. The bio is the one thing here that needs sitting down with,
     so it goes; the contact lines read better stacked once they are not
     sharing the row with it. */
  .bio {
    display: none;
  }

  .intro-bio {
    min-width: 0;
  }

  .intro-logo svg {
    width: 200px;
  }

  /* The wall ran at three fixed 70px cells, leaving most of the screen
     empty beside it. It now spans the full width and the logos grow with
     it. --logo-cell stays as the fallback the item height is derived from. */
  .intro-clients {
    width: 100%;
  }

  /* A grid gives every mark the same column, so a narrow one leaves a hole
     and the wall runs three rows deep. Packing them at their own widths
     fits the same eleven logos into two. */
  .logo-grid {
    /* 15px is the tallest these go while all eleven still land in two rows
       on a 375px screen; 16px tips the last one onto a row of its own. A
       narrower phone wraps to three, which is fine. */
    --logo-height: 15px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    width: 100%;
  }

  .logo-grid-item {
    flex: 0 0 auto;
  }

  .logo-grid-item img {
    /* There is no column to fit into now: height is the common measure and
       width is whatever the mark needs. */
    max-width: none;
    height: 100%;
    width: auto;
  }

  .project-section {
    padding: 0 12px;
    margin-bottom: 32px;
  }

  /* The standfirst is a paragraph between the title and the work. On a phone
     the work should follow the title straight away; the copy is still there
     on the project page. */
  .project-section .project-body {
    display: none;
  }

  .project-section .project-heading {
    margin-bottom: 10px;
  }

  .filter-overlay {
    padding: 14px 12px 10px;
  }

  /* Roomier tap targets; the size itself now comes from the type scale. */
  .filter-option {
    padding: 5px 10px;
  }

  .filter-overlay {
    gap: 12px;
  }

  .project-row-assets {
    --tile-height: 64px;
    gap: 6px;
  }

  .project-row {
    margin-bottom: 20px;
  }

  .project-page {
    padding: 16px 12px 56px;
  }

  /* Three and four across become slivers on a phone. */
  .pb-grid-items {
    grid-template-columns: repeat(min(var(--pb-cols, 2), 2), 1fr);
    gap: 8px;
  }

  .lightbox {
    padding: 12px;
  }

  .main-video,
  .main-image {
    top: 8px;
    height: calc(100dvh - 16px);
  }

  .supporting-media {
    padding: 1rem 12px 10dvh 0;
    padding-top: 2rem;
    gap: 1rem;
    align-items: flex-end;
  }

  .supporting-item {
    max-width: 75%;
  }

  .main-video .video-mute-btn {
    top: 0.5rem;
    left: 0.5rem;
  }
}

/* ── Footer ── */
/* Scoped to the site footer, the one direct child of .page-wrap. Unscoped,
   this painted its gradient and padding onto any other <footer> on the page,
   such as the back link closing a project page. */
.page-wrap > footer {
  padding: 12px 40px;
  font-size: var(--text-small);
  background: linear-gradient(to bottom, #ffffff, #f4f4f4, #d0d0d0);
}

.bottom-boring-text {
  color: #555;
  padding-top: 12px;
  display: flex;
  justify-content: space-between;
}

/* Dot header (footer) */
.dot-header {
  display: flex;
  align-items: center;
  width: 100%;
}

.letter {
  flex: 1;
  line-height: 0;
}

.letter-space {
  flex: 0.5;
}

.letter svg {
  width: 100%;
  height: auto;
  display: block;
  color: #222;
  visibility: hidden;
}

.letter svg.split {
  visibility: visible;
}
