@font-face {
  font-family: 'Folio';
  src: url('fonts/FolioStd-Book.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* Header styles */
.header {
  position: fixed;
  top: 60px;
  left: 30px;
  font-size: calc(13px + .5pt);
  font-family: 'Folio', sans-serif;
  padding: 0;
  white-space: nowrap;
  user-select: none;
  cursor: pointer;
  text-decoration: none;
  z-index: 2000;
  -webkit-tap-highlight-color: transparent;
}
.header a {
  color: black;
  text-decoration: none;
  transition: opacity 0.3s ease;
}
.header a:hover {
  opacity: 0.7;
}

/* Top right navigation links */
.top-nav {
  position: fixed;
  top: 60px;
  right: 30px;
  display: flex;
  gap: 20px;
  z-index: 2000;
  font-size: calc(13px + .5pt);
  font-family: 'Folio', sans-serif;
}
.top-nav a {
  color: black;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.3s ease;
}
.top-nav a:hover {
  opacity: 0.7;
}
@media (max-width: 768px) {
  .top-nav {
    top: 40px;
    right: 15px;
    gap: 15px;
  }
}

.main-text {
  position: relative;
  display: inline-block;
}
.main-text::after {
  display: none !important;
}

/* Shared twelve-column geometry: 2 text / 8 image / 2 text. */
:root {
  --page-gutter: clamp(20px, 2.1vw, 40px);
  --layout-gap: clamp(20px, 2vw, 36px);
  --layout-top: 100px;
  --layout-bottom: 60px;
  --text-track: calc((100vw - 2 * var(--page-gutter) - 2 * var(--layout-gap)) / 6);
  --image-inset: calc(var(--page-gutter) + var(--text-track) + var(--layout-gap));
}
.header { top: 40px; left: var(--page-gutter); }
.top-nav { top: 40px; left: calc(var(--page-gutter) + 155px); }
.carousel-container {
  top: var(--layout-top); bottom: var(--layout-bottom);
  left: var(--image-inset); right: var(--image-inset); padding: 0;
}
.carousel { width: 100%; height: 100%; margin: 0; }
.carousel img { max-width: 100%; max-height: 100%; }
#footer-main { height: 0; padding: 0; }
.caption-container {
  position: fixed; left: var(--page-gutter); right: auto;
  width: var(--text-track); height: auto;
  top: calc(var(--layout-top) + (100dvh - var(--layout-top) - var(--layout-bottom)) / 2);
  transform: none;
}
.caption { left: 0; width: 100%; height: auto; transform: none; text-align: left; }
.caption-text { white-space: normal; overflow-wrap: anywhere; }
#homepageSecondaryCaption {
  position: fixed; left: auto; right: var(--page-gutter); width: var(--text-track);
  top: calc(var(--layout-top) + (100dvh - var(--layout-top) - var(--layout-bottom)) / 2);
  bottom: auto; margin: 0; line-height: 1.4; text-align: left;
  max-height: calc((100dvh - var(--layout-top) - var(--layout-bottom)) / 2);
  overflow-y: auto; overflow-wrap: anywhere;
}
.image-overlay { padding: 0; }
.image-overlay-content {
  position: absolute; inset: var(--layout-top) var(--image-inset) var(--layout-bottom);
  width: auto; max-width: none; max-height: none;
}
.image-wrapper { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.image-overlay-content img { max-width: 100%; max-height: 100%; width: auto; height: auto; }
.image-caption-block {
  position: fixed; left: auto; right: var(--page-gutter); width: var(--text-track);
  top: calc(var(--layout-top) + (100dvh - var(--layout-top) - var(--layout-bottom)) / 2);
  bottom: auto; overflow: visible; max-height: none;
}
.image-mobile-client {
  position: fixed; left: var(--page-gutter); width: var(--text-track);
  top: calc(var(--layout-top) + (100dvh - var(--layout-top) - var(--layout-bottom)) / 2);
  transform: none; margin: 0; overflow-wrap: anywhere;
}
.image-caption-block .image-overlay-caption {
  margin: 0; max-width: 100%; max-height: calc((100dvh - var(--layout-top) - var(--layout-bottom)) / 2);
  overflow-y: auto; overflow-wrap: anywhere; text-align: left;
}
.grid-container { padding-left: var(--page-gutter); padding-right: var(--page-gutter); }
/* Narrow or short screens: full-width image above a separate caption row. */
@media (max-width: 1100px), (max-height: 600px) {
  :root {
    --page-gutter: 20px;
    --layout-top: 90px;
    --layout-bottom: calc(30dvh + 40px);
    --image-inset: var(--page-gutter);
  }
  .caption-container, .image-mobile-client {
    top: auto; bottom: auto; transform: none;
    top: calc(70dvh - 20px);
    width: calc((100vw - 2 * var(--page-gutter) - 20px) / 3);
    max-height: calc(30dvh - 20px); overflow-y: auto;
  }
  .caption-container { height: calc(30dvh - 20px); }
  #homepageSecondaryCaption, .image-caption-block {
    top: calc(70dvh - 20px); bottom: auto;
    width: calc((100vw - 2 * var(--page-gutter) - 20px) * 2 / 3);
    max-height: calc(30dvh - 20px); overflow-y: auto;
  }
  .image-caption-block .image-overlay-caption { max-height: none; }
  .caption-desktop { display: none; }
  .caption-mobile { display: block; white-space: pre-line; }
  .image-mobile-client { position: fixed; }
}
@media (max-width: 480px) {
  :root { --page-gutter: 15px; --layout-top: 80px; }
  .header, .top-nav { top: 30px; }
}
@media (max-width: 380px) {
  .header, .top-nav { font-size: calc(11px + .5pt); }
  .top-nav { left: calc(var(--page-gutter) + 130px); gap: 12px; }
}

/* Navigation shares the lower-left page margin. */
.top-nav {
  top: auto;
  bottom: calc(40px + env(safe-area-inset-bottom, 0px));
  left: var(--page-gutter);
  right: auto;
}
@media (max-width: 1100px), (max-height: 600px) {
  .caption-container, .image-mobile-client,
  #homepageSecondaryCaption, .image-caption-block {
    max-height: max(24px, calc(30dvh - 80px - env(safe-area-inset-bottom, 0px)));
  }
  .caption-container { height: max(24px, calc(30dvh - 80px - env(safe-area-inset-bottom, 0px))); }
}
@media (max-width: 480px) {
  .top-nav { bottom: calc(30px + env(safe-area-inset-bottom, 0px)); }
}

/* Navigation at top right; credits at bottom left. */
.top-nav {
  top: 40px;
  bottom: auto;
  left: auto;
  right: var(--page-gutter);
}
#homepageSecondaryCaption, .image-caption-block {
  top: auto;
  bottom: calc(40px + env(safe-area-inset-bottom, 0px));
  left: var(--page-gutter);
  right: auto;
  width: var(--text-track);
  max-height: calc((100dvh - var(--layout-top) - var(--layout-bottom)) / 2 - 30px);
  text-align: left;
}
@media (max-width: 1100px), (max-height: 600px) {
  /* Keep client and credits in separate rows beneath the image. */
  .caption-container, .image-mobile-client {
    top: calc(70dvh - 20px);
    bottom: auto;
    width: calc(100vw - 2 * var(--page-gutter));
    height: 20px;
    max-height: 20px;
  }
  #homepageSecondaryCaption, .image-caption-block {
    width: calc(100vw - 2 * var(--page-gutter));
    max-height: max(24px, calc(30dvh - 60px - env(safe-area-inset-bottom, 0px)));
  }
}
@media (max-width: 480px) {
  .top-nav { top: 30px; bottom: auto; left: auto; right: var(--page-gutter); }
  #homepageSecondaryCaption, .image-caption-block { bottom: calc(30px + env(safe-area-inset-bottom, 0px)); }
}

/* Shared header and footer rules. */
:root { --page-chrome-height: 76px; }
body::before, body::after {
  content: '';
  position: fixed;
  left: var(--page-gutter);
  right: var(--page-gutter);
  height: 1px;
  background: #000;
  pointer-events: none;
  z-index: 210;
}
body::before { top: var(--page-chrome-height); }
body::after { bottom: calc(var(--page-chrome-height) + env(safe-area-inset-bottom, 0px)); }
.site-contact-footer {
  position: fixed;
  left: var(--page-gutter);
  bottom: calc(40px + env(safe-area-inset-bottom, 0px));
  z-index: 210;
  color: #000;
  font: calc(13px + .5pt)/16px 'Folio', Arial, sans-serif;
  text-decoration: none;
}
.site-contact-footer:hover { text-decoration: none; }
#homepageSecondaryCaption, .image-caption-block {
  bottom: calc(100px + env(safe-area-inset-bottom, 0px));
}
@media (min-width: 1101px) and (min-height: 601px) {
  :root { --layout-bottom: 100px; }
}
@media (max-width: 1100px), (max-height: 600px) {
  :root { --layout-bottom: calc(30dvh + 100px); }
  .caption-container, .image-mobile-client { top: calc(70dvh - 80px); }
  #homepageSecondaryCaption, .image-caption-block {
    max-height: max(24px, calc(30dvh - 60px - env(safe-area-inset-bottom, 0px)));
  }
}
@media (max-width: 480px) {
  .site-contact-footer { bottom: calc(30px + env(safe-area-inset-bottom, 0px)); }
  #homepageSecondaryCaption, .image-caption-block { bottom: calc(90px + env(safe-area-inset-bottom, 0px)); }
}

.image-counter {
  position: fixed;
  right: var(--page-gutter);
  bottom: calc(40px + env(safe-area-inset-bottom, 0px));
  z-index: 210;
  color: #000;
  font: calc(13px + .5pt)/16px 'Folio', Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}
.image-counter[hidden] { display: none; }
@media (max-width: 480px) {
  .image-counter { bottom: calc(30px + env(safe-area-inset-bottom, 0px)); }
}

/* London clock and contact details beneath the footer rule. */
.site-contact-footer { left: auto; right: var(--page-gutter); }
.london-clock {
  position: fixed;
  left: var(--page-gutter);
  bottom: calc(40px + env(safe-area-inset-bottom, 0px));
  z-index: 210;
  color: #000;
  font: calc(13px + .5pt)/16px 'Folio', Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}
.clock-colon { opacity: 1; }
.image-counter { bottom: calc(100px + env(safe-area-inset-bottom, 0px)); }
@media (max-width: 1100px), (max-height: 600px) {
  #homepageSecondaryCaption, .image-caption-block { width: calc(100vw - 2 * var(--page-gutter) - 64px); }
}
@media (max-width: 700px) {
  .london-clock { bottom: calc(62px + env(safe-area-inset-bottom, 0px)); right: var(--page-gutter); font-size: calc(11px + .5pt); }
  .site-contact-footer { bottom: calc(30px + env(safe-area-inset-bottom, 0px)); }
  .image-counter, #homepageSecondaryCaption, .image-caption-block { bottom: calc(120px + env(safe-area-inset-bottom, 0px)); }
  :root { --layout-bottom: calc(30dvh + 130px); }
  .caption-container, .image-mobile-client { top: calc(70dvh - 110px); }
}
@media (prefers-reduced-motion: reduce) { .clock-colon { animation: none; } }

/* Mobile: distinct header, image, caption and footer regions. */
@media (max-width: 768px) {
  :root {
    --page-gutter: 16px;
    --page-chrome-height: 56px;
    --mobile-top: calc(var(--page-chrome-height) + env(safe-area-inset-top, 0px));
    --mobile-footer: calc(var(--page-chrome-height) + env(safe-area-inset-bottom, 0px));
    --mobile-captions: clamp(96px, 13dvh, 112px);
    --layout-top: calc(var(--mobile-top) + 16px);
    --layout-bottom: calc(var(--mobile-footer) + var(--mobile-captions) + 16px);
    --image-inset: var(--page-gutter);
  }
  .header, .top-nav {
    top: calc(24px + env(safe-area-inset-top, 0px));
    bottom: auto;
    font-size: calc(12px + .5pt);
    line-height: 16px;
  }
  .header { left: var(--page-gutter); }
  .top-nav { left: auto; right: var(--page-gutter); gap: 14px; }
  body::before { background: white; top: var(--mobile-top); box-shadow: 0 -40px 0 40px white; }
  body::after { background: white; bottom: var(--mobile-footer); box-shadow: 0 60px 0 60px white; }
  body::before, body::after { left: 0; right: 0; }
  .carousel-container { top: var(--layout-top); bottom: var(--layout-bottom); padding: 0; }
  .carousel { width: 100%; height: 100%; }
  .carousel img, .image-overlay-content img { max-width: 100%; max-height: 100%; }
  .image-overlay { padding: 0; }
  .image-overlay-content { inset: var(--layout-top) var(--page-gutter) var(--layout-bottom); }
  .caption-container, .image-mobile-client {
    position: fixed;
    top: calc(100dvh - var(--mobile-footer) - var(--mobile-captions));
    bottom: auto;
    left: var(--page-gutter);
    right: 80px;
    width: auto;
    height: 32px;
    max-height: 32px;
    margin: 0;
    transform: none;
    font-size: calc(12px + .5pt);
    line-height: 16px;
    overflow-y: auto;
    touch-action: pan-y;
  }
  .caption { font-size: calc(12px + .5pt); line-height: 16px; }
  #homepageSecondaryCaption, .image-caption-block {
    position: fixed;
    top: calc(100dvh - var(--mobile-footer) - var(--mobile-captions) + 40px);
    bottom: calc(var(--mobile-footer) + 12px);
    left: var(--page-gutter);
    right: var(--page-gutter);
    width: auto;
    max-width: none;
    max-height: none;
    height: auto;
    margin: 0;
    font-size: calc(12px + .5pt);
    line-height: 17px;
    text-align: left;
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
  }
  .image-caption-block .image-overlay-caption {
    margin: 0; max-height: none; font-size: calc(12px + .5pt); line-height: 17px; overflow: visible;
  }
  .caption-desktop { display: none; }
  .caption-mobile { display: block; white-space: pre-line; }
  .image-counter {
    top: calc(100dvh - var(--mobile-footer) - var(--mobile-captions));
    bottom: auto;
    right: var(--page-gutter);
    font-size: calc(12px + .5pt);
    line-height: 16px;
  }
  .london-clock {
    bottom: calc(42px + env(safe-area-inset-bottom, 0px));
    left: var(--page-gutter); right: var(--page-gutter);
    font-size: calc(11px + .5pt); line-height: 16px;
  }
  .site-contact-footer {
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    left: auto; right: var(--page-gutter);
    font-size: calc(12px + .5pt); line-height: 16px;
  }
  .grid-container {
    padding: calc(var(--mobile-top) + 20px) var(--page-gutter) calc(var(--mobile-footer) + 24px);
  }
  .image-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; }
  .grid-item { height: clamp(190px, 60vw, 420px); }
}
@media (max-width: 359px) {
  .header, .top-nav { font-size: calc(11px + .5pt); }
  .top-nav { gap: 10px; }
  .london-clock { font-size: calc(10px + .5pt); }
}
@media (max-width: 768px) and (max-height: 500px) {
  :root { --page-chrome-height: 48px; --mobile-captions: 88px; }
  .header, .top-nav { top: 16px; }
  .london-clock { bottom: calc(34px + env(safe-area-inset-bottom, 0px)); }
  .site-contact-footer { bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
}

/* Captions are labels, not links. */
.caption-text::after, .image-overlay-caption::after { content: none; border: 0; }

/* Desktop: use all available height and the right-hand page margin. */
@media (min-width: 769px) {
  :root {
    --layout-top: 100px;
    --layout-bottom: calc(100px + env(safe-area-inset-bottom, 0px));
    --image-inset: calc(var(--page-gutter) + var(--text-track) + var(--layout-gap));
  }
  .image-counter { display: none; }
  .carousel-container {
    left: var(--image-inset);
    right: var(--page-gutter);
  }
  .image-overlay-content {
    inset: var(--layout-top) var(--page-gutter) var(--layout-bottom) var(--image-inset);
  }
  .carousel img {
    top: 0;
    left: 0;
    transform: none;
  }
  .carousel img, .image-overlay-content img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: right bottom;
  }
  .caption-container, .image-mobile-client {
    top: calc(var(--layout-top) + (100dvh - var(--layout-top) - var(--layout-bottom)) / 2);
    bottom: auto;
    width: var(--text-track);
    height: auto;
    max-height: none;
  }
  #homepageSecondaryCaption, .image-caption-block {
    top: auto;
    bottom: var(--layout-bottom);
    width: var(--text-track);
    max-height: calc((100dvh - var(--layout-top) - var(--layout-bottom)) / 2 - 30px);
  }
}

/* A single desktop breakpoint also applies on touch-capable laptops. */
@media (min-width: 769px) {
  .header, .top-nav { top: 40px; bottom: auto; }
  .carousel-container { top: var(--layout-top); bottom: var(--layout-bottom); }
  .carousel, .image-wrapper { min-width: 0; min-height: 0; }
  .caption-container, .image-mobile-client { right: auto; transform: none; }
  .caption-container { min-height: 48px; overflow: visible; }
  .image-caption-block { overflow: visible; }
  .image-caption-block .image-overlay-caption { max-height: inherit; }
}
.caption:not(.active) { pointer-events: none; }
#captionContainer { z-index: 250; cursor: pointer; }
#clientViewHint {
  display: block;
  position: relative;
  margin-top: 24px;
  color: #808080;
  font: calc(12px + .5pt)/16px 'Folio', Arial, sans-serif;
  opacity: 0;
  transition: opacity 180ms ease;
}
#captionContainer:hover #clientViewHint,
#captionContainer:focus-visible #clientViewHint { opacity: 1; }
#captionContainer:focus-visible { outline: 1px solid #808080; outline-offset: 5px; }
.client-projects {
  position: fixed;
  top: var(--layout-top);
  bottom: var(--layout-bottom);
  left: var(--image-inset);
  right: var(--page-gutter);
  z-index: 180;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
  touch-action: pan-y;
}
.client-projects::-webkit-scrollbar { display: none; }
.client-project {
  height: 100%;
  width: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}
.client-project img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: right bottom;
}
.client-view-active .carousel-container { visibility: hidden; }
html:has(.client-view-active), body.client-view-active { touch-action: pan-y; }
@media (max-width: 768px) {
  #captionContainer { height: 52px; max-height: 52px; overflow: visible; }
  #clientViewHint { margin-top: 32px; font-size: calc(11px + .5pt); line-height: 14px; }
  #homepageSecondaryCaption { top: calc(100dvh - var(--mobile-footer) - var(--mobile-captions) + 56px); }
  .client-project img { object-position: center; }
}
@media (hover: none) { #clientViewHint { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { #clientViewHint { transition: none; } }

/* Fixed captions must be anchored to the viewport, not a transformed footer. */
#footer-main { left: 0; right: 0; bottom: 0; width: auto; transform: none; }

/* Show neighbouring frames around a padded, snapping photograph. */
.client-projects {
  --project-peek: 80px;
  --project-gap: 32px;
  top: calc(var(--layout-top) - var(--project-peek));
  bottom: calc(var(--layout-bottom) - var(--project-peek));
  padding-block: calc(var(--project-peek) - var(--project-gap) / 2);
  box-sizing: border-box;
}
.client-project {
  height: calc(100dvh - var(--layout-top) - var(--layout-bottom) + var(--project-gap));
  padding-block: calc(var(--project-gap) / 2);
  box-sizing: border-box;
  scroll-snap-align: center;
}
#captionContainer {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  width: max-content;
  max-width: calc(var(--image-inset) - var(--page-gutter) - 16px);
  height: auto;
  max-height: none;
  min-height: 0;
  text-align: left;
  white-space: normal;
}
#captionContainer .caption.active { position: relative; width: auto; flex: 0 1 auto; }
#captionContainer .caption:not(.active) { visibility: hidden; }
#clientViewHint { margin: 0; font: inherit; line-height: inherit; white-space: nowrap; }
@media (max-width: 768px) {
  .client-projects { --project-peek: 24px; --project-gap: 16px; }
  #captionContainer { max-width: calc(100vw - 2 * var(--page-gutter)); right: var(--page-gutter); font-size: calc(12px + .5pt); line-height: 16px; }
}

.photo-lightbox {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: clamp(20px, 4vw, 60px);
  box-sizing: border-box;
  border: 0;
  background: white;
  opacity: 0;
  transition: opacity 250ms ease;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Ctext x='16' y='24' text-anchor='middle' font-family='Arial' font-size='32' fill='black'%3E%C3%97%3C/text%3E%3C/svg%3E") 16 16, pointer;
}
.photo-lightbox[open] { display: flex; align-items: center; justify-content: center; }
.photo-lightbox.visible { opacity: 1; }
.photo-lightbox::backdrop { background: transparent; }
.photo-lightbox img { width: 100%; height: 100%; object-fit: contain; cursor: inherit; }
.photo-lightbox-close {
  position: absolute; top: 16px; right: 16px; padding: 8px;
  background: white; border: 0; color: black;
  font: calc(28px + .5pt)/28px Arial, sans-serif; cursor: inherit;
  opacity: 0;
}
.photo-lightbox-close:focus-visible { opacity: 1; outline: 1px solid black; }
@media (hover: none) { .photo-lightbox-close { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .photo-lightbox { transition: none; } }

/* Full-height lightbox and the same drawn × as Overview. */
.photo-lightbox {
  padding: 0;
  overflow: auto;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='M4 4 L12 12 M12 4 L4 12' stroke='black' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") 8 8, pointer;
}
.photo-lightbox[open] { display: block; }
.photo-lightbox img { width: auto; height: 100dvh; max-width: none; max-height: none; margin: 0 auto; display: block; }
.carousel-nav { left: 0; right: 0; width: 100%; height: 25%; }
.carousel-nav.nav-prev { top: 0; bottom: auto; }
.carousel-nav.nav-next { top: auto; bottom: 0; }

/* Keep the live page typography above the full-height photograph. */
.photo-lightbox { background: #000; color: #fff; }
.photo-lightbox [data-lightbox-chrome],
.photo-lightbox [data-lightbox-chrome] a,
.photo-lightbox .caption, .photo-lightbox .caption-text,
.photo-lightbox #homepageSecondaryCaption { color: #fff; }
.photo-lightbox #clientViewHint { color: #808080; }
.photo-lightbox-close { background: #000; color: #fff; z-index: 2200; }
.photo-lightbox::before, .photo-lightbox::after { display: none; }

/* Contiguous full-viewport frames slide beneath the stationary text. */
.photo-lightbox { overflow: hidden; }
.lightbox-frame {
  position: absolute;
  inset: 0;
  height: 100%;
  width: 100%;
  display: flex;
  justify-content: center;
  overflow: hidden;
  cursor: inherit;
}
.photo-lightbox .lightbox-frame img {
  flex: 0 0 auto;
  height: 100%;
  width: auto;
  margin: 0;
  padding: 0;
  max-width: none;
}

/* Simultaneous text layers crossfade without an empty interval. */
#captionContainer { display: grid; grid-template-columns: minmax(0, max-content) max-content; align-items: start; }
#captionContainer .caption,
#captionContainer .caption.active,
#captionContainer .caption:not(.active) {
  position: relative;
  grid-area: 1 / 1;
  visibility: visible;
  width: auto;
  transition: opacity 450ms linear;
}
#clientViewHint { grid-area: 1 / 2; }
#homepageSecondaryCaption { display: grid; align-content: end; }
.caption-crossfade { grid-area: 1 / 1; align-self: end; white-space: pre-line; }
.photo-lightbox::before, .photo-lightbox::after {
  display: block;
  content: '';
  position: fixed;
  left: var(--page-gutter);
  right: var(--page-gutter);
  height: 1px;
  background: white;
  z-index: 0;
  pointer-events: none;
}
.photo-lightbox::before { top: var(--page-chrome-height); }
.photo-lightbox::after { bottom: calc(var(--page-chrome-height) + env(safe-area-inset-bottom, 0px)); }
.lightbox-frame { z-index: 1; }
@media (max-width: 768px) {
  .photo-lightbox::before { top: var(--mobile-top); }
  .photo-lightbox::after { bottom: var(--mobile-footer); }
}
@media (prefers-reduced-motion: reduce) { #captionContainer .caption { transition: none; } }

/* Mobile: fixed page furniture with a centered, uncropped image. */
@media (max-width: 768px) {
  .header, .top-nav { position: fixed; }
  .london-clock, .site-contact-footer { position: fixed; }
  #clientViewHint, .image-counter { display: none; }
  #captionContainer { cursor: default; grid-template-columns: minmax(0, 1fr); width: auto; left: var(--page-gutter); right: var(--page-gutter); }
  #captionContainer .caption, #captionContainer .caption-text { cursor: default; }
  #homepageSecondaryCaption { top: calc(100dvh - var(--mobile-footer) - var(--mobile-captions) + 40px); }
  .carousel-container { left: var(--page-gutter); right: var(--page-gutter); }
  .carousel img {
    top: 0; left: 0; transform: none;
    width: 100%; height: 100%; max-width: 100%; max-height: 100%;
    object-fit: contain; object-position: center;
  }
  .image-overlay-content { left: var(--page-gutter); right: var(--page-gutter); }
  .image-overlay-content img {
    width: 100%; height: 100%; max-width: 100%; max-height: 100%;
    object-fit: contain; object-position: center;
  }
}

/* Mobile captions need room to flow; footer sits above the page masks. */
@media (max-width: 768px) {
  .london-clock, .site-contact-footer { z-index: 300; }
  #homepageSecondaryCaption {
    top: calc(100dvh - var(--mobile-footer) - var(--mobile-captions) + 24px);
    align-content: start;
  }
  #homepageSecondaryCaption .caption-crossfade { align-self: start; }
  #homepageSecondaryCaption .caption-crossfade[aria-hidden="true"] { display: none; }
  #captionContainer .caption, #captionContainer .caption.active, #captionContainer .caption:not(.active) { transition: none; }
  #captionContainer .caption:not(.active) { visibility: hidden; }
  .carousel img, body.secondary-caption-active .carousel img.active {
    filter: none; -webkit-filter: none; transition: none; will-change: auto;
  }
  body.secondary-caption-active .carousel img.active { opacity: 1; }
}

@media (max-width: 768px) { .london-clock { text-align: left; } }

/* A single contact footer leaves room for complete mobile captions. */
.site-contact-footer { left: var(--page-gutter); right: auto; text-align: left; }
@media (max-width: 768px) {
  :root {
    --mobile-captions: 128px;
  }
  #homepageSecondaryCaption, .image-caption-block {
    top: calc(100dvh - var(--mobile-footer) - var(--mobile-captions) + 24px);
    bottom: calc(var(--mobile-footer) + 8px);
    line-height: 17px;
    align-content: start;
    padding: 0 0 2px;
    box-sizing: border-box;
  }
  .site-contact-footer { left: var(--page-gutter); right: auto; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
}

/* Mobile header and footer dividers. */
@media (max-width: 768px) {
  body::before, body::after { background: #000; }
}

/* Desktop retains the London clock; mobile keeps the contact-only footer. */
@media (min-width: 769px) {
  .site-contact-footer { left: auto; right: var(--page-gutter); }
  .london-clock { left: var(--page-gutter); right: auto; text-align: left; }
}
@media (max-width: 768px) {
  .london-clock { display: none; }
}

/* Homepage client names are labels, without a secondary browsing mode. */
#captionContainer, #captionContainer .caption, #captionContainer .caption-text { cursor: default; }
#captionContainer { grid-template-columns: minmax(0, max-content); }
@media (min-width: 769px) {
  .header {
    font-family: 'Folio', Helvetica, Arial, sans-serif;
    font-size: calc(13px + .5pt);
    font-weight: 400;
    line-height: 16px;
    letter-spacing: normal;
    top: 40px;
    left: var(--page-gutter);
  }
}

/* Left/right navigation and simultaneous mobile crossfades. */
.carousel-nav { top: 0; bottom: 0; width: 50%; height: 100%; }
.carousel-nav.nav-prev { left: 0; right: auto; top: 0; bottom: 0; }
.carousel-nav.nav-next { left: auto; right: 0; top: 0; bottom: 0; }
@media (max-width: 768px) {
  .carousel img, body.secondary-caption-active .carousel img.active {
    transition: opacity 450ms linear;
    filter: none;
    -webkit-filter: none;
  }
  #captionContainer .caption,
  #captionContainer .caption.active,
  #captionContainer .caption:not(.active) {
    visibility: visible;
    transition: opacity 450ms linear;
  }
  #homepageSecondaryCaption .caption-crossfade[aria-hidden="true"] { display: block; }
}
@media (prefers-reduced-motion: reduce) {
  .carousel img, #captionContainer .caption, #captionContainer .caption.active, #captionContainer .caption:not(.active) { transition: none; }
}

/* Compact mobile clock and contact share a single footer baseline. */
@media (max-width: 768px) {
  .london-clock {
    display: block;
    left: var(--page-gutter);
    right: auto;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    font-size: calc(11px + .5pt);
    line-height: 16px;
    white-space: nowrap;
  }
  .site-contact-footer {
    left: auto;
    right: var(--page-gutter);
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    font-size: calc(11px + .5pt);
    line-height: 16px;
  }
}

/* Center the shared footer labels inside the footer band. */
.london-clock, .site-contact-footer {
  bottom: calc((var(--page-chrome-height) - 16px) / 2 + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 769px) {
  :root { --desktop-label-inset: calc((var(--page-chrome-height) - 18px) / 2); }
  .header, .top-nav, .cursor-client, .london-clock, .site-contact-footer { line-height: 18px; }
  .header, .top-nav, .cursor-client { top: var(--desktop-label-inset); }
  .london-clock, .site-contact-footer {
    bottom: calc(var(--desktop-label-inset) + env(safe-area-inset-bottom, 0px));
  }
}

/* Mobile typography uses one scale across content and page furniture. */
@media (max-width: 768px) {
  :root { --mobile-text-size: calc(12px + .5pt); }
  .header, .top-nav, .london-clock, .site-contact-footer, #captionContainer, .caption, #homepageSecondaryCaption, .image-mobile-client {
    font-family: 'Folio', Helvetica, Arial, sans-serif;
    font-size: var(--mobile-text-size);
    font-weight: 400;
    line-height: 16px;
  }
}
@media (max-width: 359px) { :root { --mobile-text-size: calc(11px + .5pt); } }

/* Mobile captions sit together, 16px above the footer rule. */
@media (max-width: 768px) {
  #footer-main {
    left: var(--page-gutter);
    right: var(--page-gutter);
    bottom: calc(var(--mobile-footer) + 16px);
    height: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  #captionContainer {
    position: relative;
    inset: auto;
    width: 100%;
    max-width: none;
    height: auto;
    margin: 0;
  }
  #homepageSecondaryCaption {
    position: relative;
    inset: auto;
    width: 100%;
    height: auto;
    max-height: calc(var(--mobile-captions) - 40px);
    margin: 0;
    padding: 0;
    align-content: end;
  }
  #homepageSecondaryCaption .caption-crossfade { align-self: end; }
  .image-caption-block {
    top: auto;
    bottom: calc(var(--mobile-footer) + 16px);
    height: auto;
    max-height: var(--mobile-captions);
  }
  .image-caption-block .image-mobile-client {
    position: static;
    width: auto;
    height: auto;
    max-height: none;
    margin: 0 0 8px;
  }
  .carousel img, .carousel img.active,
  #captionContainer .caption, #captionContainer .caption.active, #captionContainer .caption:not(.active) {
    transition: opacity 450ms linear;
  }
}
@media (prefers-reduced-motion: reduce) {
  .carousel img, .carousel img.active,
  #captionContainer .caption, #captionContainer .caption.active, #captionContainer .caption:not(.active) { transition: none; }
}

/* Image clicks advance; empty image-frame space returns to Overview. */
.carousel-nav { display: none; }
@media (min-width: 769px) {
  .cursor-client {
    left: 50%;
    right: auto;
    top: var(--desktop-label-inset);
    transform: translateX(-50%);
    text-align: center;
    font: calc(13px + .5pt)/18px 'Folio', Helvetica, Arial, sans-serif;
    max-width: calc(100vw - 480px);
  }
}

/* Overview captions use the homepage's line breaks and overlapping fades. */
#mobileClientName, #overlayCaption {
  display: grid;
  text-align: left;
  font-family: 'Folio', Helvetica, Arial, sans-serif;
}
#mobileClientName { line-height: 16px; }
#mobileClientName .caption-crossfade { align-self: start; }
#overlayCaption { line-height: 1.4; }
#overlayCaption .caption-crossfade { align-self: end; }
@media (max-width: 768px) {
  .image-caption-block { padding: 0; }
  .image-caption-block #overlayCaption {
    font-size: var(--mobile-text-size);
    line-height: 16px;
    max-height: calc(var(--mobile-captions) - 40px);
    overflow-y: auto;
  }
  .image-caption-block #mobileClientName {
    font-size: var(--mobile-text-size);
    line-height: 16px;
  }
}

/* Overview image-size controls; preserve the responsive default until adjusted. */
.grid-size-controls {
  position: fixed; top: 86px; right: var(--page-gutter); z-index: 300;
  display: flex; gap: 20px; align-items: center;
}
.grid-size-controls button {
  appearance: none; background: none; border: 0; padding: 0;
  width: 24px; height: 24px; color: black; font: calc(18px + .5pt)/24px 'Folio', sans-serif;
  cursor: pointer;
}
.grid-size-controls button:disabled { opacity: .25; cursor: default; }
.grid-size-controls button:focus-visible { outline: 1px solid currentColor; outline-offset: 2px; }
.grid-size-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.image-grid.grid-size-adjusted { grid-template-columns: repeat(var(--overview-columns), minmax(0, 1fr)); }
.image-grid.grid-size-adjusted .grid-item { height: auto; aspect-ratio: 1 / 1.15; }
body.image-overlay-open .grid-size-controls { visibility: hidden; }
@media (max-width: 768px) {
  .grid-size-controls { top: calc(20px + env(safe-area-inset-top, 0px)); gap: 12px; }
  .grid-size-controls button { width: 16px; }
  .grid-container { padding-top: calc(var(--mobile-top) + 20px); }
}

/* Center grid controls in the same header slot as the hover client. */
.grid-size-controls {
  top: calc((var(--page-chrome-height) - 24px) / 2); left: 50%; right: auto; transform: translateX(-50%);
  transition: opacity 180ms ease;
}
body:has(.image-grid.has-hover) .grid-size-controls { opacity: 0; pointer-events: none; }
.image-grid.grid-size-adjusted .grid-item { transform-origin: top left; }
@media (max-width: 768px) {
  .grid-size-controls { top: calc(20px + env(safe-area-inset-top, 0px)); gap: 12px; }
  .grid-size-controls button { width: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .grid-size-controls { transition: none; }
}

/* Replace grid sizing with a close control while an image is open. */
#gridClose { display: none; }
body.image-overlay-open .grid-size-controls {
  visibility: visible; opacity: 1; pointer-events: auto; z-index: 2100;
}
body.image-overlay-open #gridSmaller,
body.image-overlay-open #gridLarger { display: none; }
body.image-overlay-open #gridClose { display: block; font-size: calc(18px + .5pt); }

/* Soften imagery beyond the header/footer rules while keeping type sharp. */
.edge-blur {
  position: fixed; left: 0; right: 0; z-index: 205; pointer-events: none;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, .18);
}
.edge-blur-top { top: 0; height: var(--page-chrome-height); }
.edge-blur-bottom { bottom: 0; height: calc(var(--page-chrome-height) + env(safe-area-inset-bottom, 0px)); }
@media (max-width: 768px) {
  .edge-blur-top { height: var(--mobile-top); }
  body::before, body::after { box-shadow: none; }
}

/* Cross-document transitions retain shared chrome and dissolve content directly. */
@view-transition { navigation: auto; }
body { opacity: 1; transition: none; }
.page-transition { display: none !important; }
.internal-navigation #main-content { opacity: 1; transition: none; }
.internal-navigation #splashModal { display: none; }
.header { view-transition-name: site-brand; }
.top-nav { view-transition-name: site-navigation; }
.london-clock { view-transition-name: site-clock; }
.site-contact-footer { view-transition-name: site-email; }
body::before { view-transition-name: header-rule; }
body::after { view-transition-name: footer-rule; }
::view-transition-group(*) { animation-duration: 450ms; animation-timing-function: ease-in-out; }
::view-transition-old(root) { animation: none; }
::view-transition-new(root) { animation: page-dissolve 450ms ease-in-out both; }
@keyframes page-dissolve { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation-duration: 1ms; }
}

/* The opening screen uses the same quiet layout as the site. */
#splashModal { padding: 0; display: block; transition: opacity 650ms ease; }
#splashModal .splash-name { top: 40px; left: var(--page-gutter); font: calc(13px + .5pt)/16px 'Folio', sans-serif; }
#splashModal .splash-text {
  position: absolute; left: var(--page-gutter);
  top: calc(var(--layout-top) + (100dvh - var(--layout-top) - var(--layout-bottom)) / 2);
  width: var(--text-track); font: calc(13px + .5pt)/16px 'Folio', sans-serif;
  text-align: left; white-space: normal;
}
.splash-portrait {
  position: absolute; left: var(--page-gutter); bottom: 40px;
  height: clamp(150px, 30dvh, 260px); width: auto; object-fit: contain;
}
body:has(#splashModal)::before, body:has(#splashModal)::after,
body:has(#splashModal) > .london-clock, body:has(#splashModal) > .site-contact-footer { z-index: 3000; }
@media (max-width: 768px) {
  #splashModal .splash-name { top: calc(24px + env(safe-area-inset-top, 0px)); font-size: var(--mobile-text-size); }
  #splashModal .splash-text {
    top: auto; bottom: calc(var(--mobile-footer) + 196px);
    width: calc(100% - 2 * var(--page-gutter)); font-size: var(--mobile-text-size);
  }
  .splash-portrait { bottom: calc(52px + env(safe-area-inset-bottom, 0px)); height: 160px; width: 154px; max-width: 45%; object-position: left bottom; }
}

/* Loader portrait is centered independently of the caption column. */
#splashModal .splash-portrait {
  left: 50%; top: 50%; bottom: auto;
  transform: translate(-50%, -50%); object-position: center;
}
@media (max-width: 768px) {
  #splashModal .splash-text { bottom: calc(var(--mobile-footer) + 16px); }
}

/* Minimal opening screen; reveal the shared chrome as it finishes. */
#splashModal .splash-portrait { transform: translate(-50%, -50%) scale(.6); }
body:has(#splashModal) > .london-clock,
body:has(#splashModal) > .site-contact-footer,
body:has(#splashModal)::before,
body:has(#splashModal)::after { z-index: 210; }

/* Loader: title and description flank the centered portrait. */
#splashModal .splash-name {
  top: 50%; left: var(--page-gutter); transform: translateY(-50%);
}
#splashModal .splash-text {
  top: 50%; bottom: auto; left: auto; right: var(--page-gutter);
  transform: translateY(-50%); width: var(--text-track); text-align: left;
}
@media (max-width: 768px) {
  #splashModal .splash-name, #splashModal .splash-text {
    width: calc((100vw - 2 * var(--page-gutter) - 110px) / 2);
    white-space: normal;
  }
}

/* Loader text starts at the header margin, with a small portrait below. */
#splashModal .splash-name {
  top: 40px; left: var(--page-gutter); transform: none; width: auto;
}
#splashModal .splash-text {
  top: 64px; left: var(--page-gutter); right: auto; bottom: auto;
  transform: none; width: min(320px, calc(100vw - 2 * var(--page-gutter)));
}
#splashModal .splash-portrait {
  top: auto; left: var(--page-gutter); bottom: 40px;
  transform: scale(.6); transform-origin: bottom left;
}
@media (max-width: 768px) {
  #splashModal .splash-name { top: calc(24px + env(safe-area-inset-top, 0px)); }
  #splashModal .splash-text { top: calc(48px + env(safe-area-inset-top, 0px)); }
  #splashModal .splash-portrait { bottom: calc(52px + env(safe-area-inset-bottom, 0px)); }
}

/* One persistent title sits above the loader and the arriving page. */
body > #mainHeader { z-index: 2001; }
body:has(#splashModal) #main-content { opacity: 1; transition: none; }
@media (max-width: 768px) {
  .carousel-container { bottom: var(--mobile-image-bottom, var(--layout-bottom)); }
}
.london-clock { cursor: default; }

/* Keep opacity-only mobile dissolves even when spatial motion is reduced. */
@media (max-width: 768px) {
  .carousel img, .carousel img.active,
  body.secondary-caption-active .carousel img.active,
  #captionContainer .caption, #captionContainer .caption.active,
  #captionContainer .caption:not(.active) {
    transition: opacity 450ms linear;
    visibility: visible;
  }
  #homepageSecondaryCaption .caption-crossfade[aria-hidden="true"] { display: block; }

  /* Keep the blur under the viewport edge as mobile browser chrome moves. */
  .edge-blur-bottom {
    --footer-blur-overhang: 48px;
    --footer-blur-overhang: calc(100lvh - 100svh + 48px);
    bottom: calc(-1 * var(--footer-blur-overhang));
    height: calc(var(--mobile-footer) + var(--footer-blur-overhang));
    background: rgba(255, 255, 255, .3);
  }
}

#splashModal .splash-text { white-space: pre-line; }

/* The homepage gallery uses vertical client pages and horizontal image tracks. */
:root { --homepage-footer: calc(var(--page-chrome-height) + env(safe-area-inset-bottom, 0px)); }
body:has(#mobileHomepage) .carousel-container,
body:has(#mobileHomepage) #footer-main { display: none; }
#mobileHomepage {
  position: fixed; z-index: 100;
  top: var(--page-chrome-height); bottom: var(--homepage-footer); left: 0; right: 0;
  overflow-y: auto; overflow-x: hidden;
  scroll-snap-type: y mandatory;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
}
#mobileHomepage::-webkit-scrollbar { display: none; }
.mobile-project {
  position: relative; height: 100%; overflow: hidden;
  scroll-snap-align: start; scroll-snap-stop: always;
}
.mobile-project-layer {
  padding: 60px var(--page-gutter) 16px;
  display: flex; flex-direction: column; gap: 24px;
  background: white;
}
.mobile-project-image {
  display: block; width: 100%; height: 0; min-height: 0; flex: 1 1 0;
  object-fit: contain; object-position: center; cursor: pointer;
}
.mobile-project-captions {
  flex: 0 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 16px; align-items: end; text-align: left;
  font: var(--mobile-text-size, calc(13px + .5pt))/16px 'Folio', sans-serif;
  white-space: pre-line; overflow-wrap: anywhere;
}
.mobile-client-counter { color: #808080; font-size: calc(10px + .5pt); text-align: right; white-space: nowrap; }
.mobile-project-layer .mobile-project-captions { opacity: 0; }
.mobile-caption-overlay {
  position: absolute;
  z-index: 2;
  inset: 4px var(--page-gutter) 16px;
  display: grid;
  pointer-events: none;
}
.mobile-caption-overlay > .mobile-project-captions {
  grid-area: 1 / 1;
  align-self: end;
}
.mobile-client-trigger,
#mobileClientPicker button {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.mobile-client-trigger {
  grid-area: 1 / 1;
  align-self: start;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  min-width: 44px;
  font: var(--mobile-text-size, calc(13px + .5pt))/16px 'Folio', sans-serif;
  text-align: left;
  pointer-events: auto;
}
#mobileClientPicker {
  position: fixed;
  z-index: 110;
  inset: calc(var(--mobile-top) + 1px) 0 calc(var(--homepage-footer) + 1px);
  background: rgba(255, 255, 255, .94);
  color: black;
  font: var(--mobile-text-size, calc(13px + .5pt))/18px 'Folio', sans-serif;
  opacity: 0;
  visibility: hidden;
  transition: opacity 220ms ease, visibility 220ms;
}
#mobileClientPicker[data-open] {
  opacity: 1;
  visibility: visible;
}
@supports (backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px)) {
  #mobileClientPicker {
    background: rgba(255, 255, 255, .78);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }
}
#mobileClientPicker .mobile-client-close {
  position: absolute;
  z-index: 1;
  top: 0;
  right: var(--page-gutter);
  min-height: 44px;
  min-width: 44px;
  font-size: calc(18px + .5pt);
  text-align: right;
}
.mobile-client-list {
  box-sizing: border-box;
  height: 100%;
  padding-inline: var(--page-gutter) calc(var(--page-gutter) + 44px);
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
}
#mobileClientPicker .mobile-client-list button {
  display: flex;
  align-items: flex-start;
  box-sizing: border-box;
  width: max-content;
  max-width: 100%;
  min-width: 44px;
  height: var(--client-row-height, 36px);
  /* Match the trigger's text position below the header rule. */
  padding-top: 17px;
  color: #505050;
  line-height: 16px;
  text-align: left;
  scroll-snap-align: start;
  -webkit-tap-highlight-color: transparent;
}
#mobileClientPicker .mobile-client-list button[aria-current],
#mobileClientPicker .mobile-client-list button:focus-visible { color: black; }
#mobileClientPicker .mobile-client-list button:focus { outline: none; }
@media (prefers-reduced-motion: reduce) {
  #mobileClientPicker { transition: none; }
}
#desktopHomepage { display: none; }
@media (min-width: 769px) {
  #mobileClientPicker,
  .mobile-caption-overlay,
  body:has(#desktopHomepage) #mobileHomepage,
  body:has(#desktopHomepage) .carousel-container,
  body:has(#desktopHomepage) #footer-main { display: none; }

  #desktopHomepage {
    --desktop-client-width: clamp(250px, 26vw, 340px);
    --desktop-gallery-gap: clamp(16px, 3vw, 42px);
    --desktop-credit-space: min(126px, 24dvh);
    position: fixed;
    z-index: 100;
    inset: 100px var(--page-gutter) calc(var(--homepage-footer) + 24px);
    display: block;
    font: calc(13px + .5pt)/18px 'Folio', sans-serif;
  }
  .desktop-client-list {
    position: absolute;
    z-index: 1;
    inset: 0 auto var(--desktop-credit-space) 0;
    width: var(--desktop-client-width);
    display: flex;
    flex-direction: column;
    pointer-events: none;
  }
  .desktop-client-list-trigger {
    align-self: flex-start;
    width: 100%;
    flex: 0 0 18px;
    border: 0;
    padding: 0;
    background: transparent;
    pointer-events: auto;
  }
  .desktop-client-options {
    position: absolute;
    inset: 0 0 auto;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    overflow-y: auto;
    scrollbar-width: none;
    pointer-events: auto;
  }
  .desktop-client-label {
    display: flex;
    gap: 8px;
    position: absolute;
    top: 0;
    left: 0;
    max-width: var(--desktop-client-width);
    visibility: hidden;
  }
  .desktop-current-client {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .desktop-client-name {
    appearance: none;
    padding: 0;
    border: 0;
    color: #767676;
    background: none;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: color 220ms ease, opacity 220ms ease;
    flex: none;
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .desktop-client-name:hover,
  .desktop-client-name[aria-pressed="true"] { color: #000; }
  @media (hover: hover) {
    .desktop-client-label { visibility: visible; }
    #desktopHomepage:has(.desktop-client-list:hover, .desktop-client-list :focus-visible) .desktop-client-label {
      visibility: hidden;
    }
    .desktop-client-options {
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
      transition: opacity 220ms ease, visibility 220ms;
    }
    .desktop-client-list:is(:hover, :has(:focus-visible)) .desktop-client-options {
      opacity: 1;
      visibility: visible;
      pointer-events: auto;
    }
  }
  .desktop-client-stage, .desktop-client-frame { position: absolute; inset: 0; }
  .desktop-client-stage { overflow: clip; }
  .desktop-client-frame {
    display: grid;
    grid-template-columns: var(--desktop-client-width) minmax(0, 1fr);
    column-gap: var(--desktop-gallery-gap);
    pointer-events: none;
  }
  .desktop-client-credits {
    align-self: end;
    text-align: left;
    max-height: calc(var(--desktop-credit-space) - 12px);
    overflow: auto;
    white-space: pre-line;
  }
  .desktop-client-image {
    appearance: none;
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    min-width: 0;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    pointer-events: auto;
    cursor: pointer;
  }
  .desktop-client-frame[aria-hidden="true"] .desktop-client-image { pointer-events: none; }
  .desktop-client-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: right bottom;
  }
  .desktop-client-counter {
    color: #808080;
    flex: none;
    font: inherit;
    white-space: nowrap;
  }
}
@media (prefers-reduced-motion: reduce) {
  .desktop-client-name, .desktop-client-options { transition: none; }
}
@media (max-width: 768px) {
  :root { --homepage-footer: var(--mobile-footer); }
  #mobileHomepage { top: var(--mobile-top); }
}
/* Loader presets share the page gutter, caption baseline and image column. */
#splashModal {
  --loader-caption-bottom: 100px;
  --loader-portrait-bottom: 40px;
}
#splashModal[data-text-position="center-left"] .splash-text {
  top: 50%; bottom: auto; transform: translateY(-50%);
}
#splashModal[data-text-position="bottom-left"] .splash-text {
  top: auto; bottom: var(--loader-caption-bottom); transform: none;
}
#splashModal[data-image-position="center"] .splash-portrait {
  left: 50%; right: auto; top: 50%; bottom: auto;
  transform: translate(-50%, -50%) scale(.6); transform-origin: center;
}
#splashModal[data-image-position="center-right"] .splash-portrait {
  left: auto; right: var(--page-gutter); top: 50%; bottom: auto;
  transform: translateY(-50%) scale(.6); transform-origin: right center;
}
/* When both occupy the lower left, reserve the caption area beneath the image. */
#splashModal[data-text-position="bottom-left"][data-image-position="bottom-left"] .splash-portrait {
  bottom: calc(var(--loader-caption-bottom) + 96px);
}
@media (max-width: 768px) {
  #splashModal { --loader-caption-bottom: calc(var(--mobile-footer) + 16px); }
  /* Narrow screens stack middle-position text below the image. */
  #splashModal[data-text-position="center-left"][data-image-position="center"] .splash-text,
  #splashModal[data-text-position="center-left"][data-image-position="center-right"] .splash-text {
    top: calc(50% + 80px); transform: none;
  }
}

@media (max-width: 768px) { html { touch-action: pan-x pan-y; } }

@media (max-width: 768px) {
  body:has(#mobileHomepage) { touch-action: pan-x pan-y; }
}
.mobile-client-slides {
  display: flex;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.mobile-client-slides::-webkit-scrollbar { display: none; }
.mobile-tap-track {
  position: absolute;
  inset: 0;
  display: flex;
  z-index: 1;
  pointer-events: none;
}
.mobile-tap-track > .mobile-project-layer,
.mobile-client-slides > .mobile-project-layer {
  box-sizing: border-box;
  flex: 0 0 100%;
  min-width: 0;
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}
/* The opener shares the homepage footer and centers its copy beside the portrait. */
html:not(.internal-navigation) body:has(#splashModal) .top-nav { visibility: hidden; }
html:not(.internal-navigation) body:has(#splashModal)::before,
html:not(.internal-navigation) body:has(#splashModal)::after,
html:not(.internal-navigation) body:has(#splashModal) > .london-clock,
html:not(.internal-navigation) body:has(#splashModal) > .site-contact-footer { z-index: 2001; }
#splashModal[data-home-layout] .splash-text {
  left: var(--page-gutter);
  right: auto;
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
  text-align: left;
}
#splashModal[data-home-layout] .splash-portrait {
  top: 50%;
  right: var(--page-gutter);
  bottom: auto;
  left: auto;
  transform: translateY(-50%) scale(.6);
  transform-origin: right center;
  object-position: right center;
}
@media (max-width: 768px) {
  #splashModal[data-home-layout] .splash-text {
    width: calc(100% - 2 * var(--page-gutter) - 110px);
    font: var(--mobile-text-size, calc(12px + .5pt))/16px 'Folio', sans-serif;
  }
}
