:root {
  /* Index lens falloff: 1 = gentle, 2–4 = side images shrink to zero. */
  --index-falloff: 2.8;
  font-family: Waldenburg, Arial, Helvetica, sans-serif;
  font-size: 13px;
  line-height: 1;
  color: #000;
  background: #f6f6f6;
  --paper: #f6f6f6;
  --ink: #000;
  --muted: #b5b5b5;
  --surface: #e6e6e6;
  --inset: 15px;
  --layout-max-width: 1728px;
  --layout-inset: max(var(--inset), calc((100vw - var(--layout-max-width)) / 2));
  --layout-column: calc((min(100vw - 30px, var(--layout-max-width)) - 30px) / 3);
  --gap: 12.5px;
  --tile-height: 50vh;
  --tile-width: calc(var(--tile-height) * 4 / 5);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; }
a { color: inherit; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 2px solid #838383; outline-offset: 4px; }
p { margin: 0; }
.masthead { position: fixed; z-index: 5000; inset: 15px var(--layout-inset) auto; display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.studio { display: grid; grid-template-columns: calc((100vw - 60px) / 3) minmax(0, 1fr); gap: 15px; min-width: 0; flex: 1; }
.studio-logo { display: block; height: 34px; width: 100%; overflow: hidden; }
.about { max-width: 703px; font-weight: 500; text-transform: uppercase; color: var(--muted); }
.about strong { display: block; color: var(--ink); font-weight: 500; }
.mobile-menu-trigger { display: none; }
.menu { display: flex; flex: none; gap: 8px; align-items: center; height: 34px; }
.menu button { position: relative; isolation: isolate; display: grid; place-items: center; height: 34px; min-width: 34px; padding: 0 6px; background: transparent; text-transform: uppercase; }
.menu button[data-project="0"] { width: 44px; }
.menu button[data-project="1"] { width: 38px; }
.menu button.selected { width: auto; padding-inline: 14px; }
.menu-number { letter-spacing: .3px; }
.menu-label { display: none; white-space: nowrap; }
.menu button.selected .menu-number { display: none; }
.menu button.selected .menu-label { display: block; }
.menu-shape-definitions { position: absolute; pointer-events: none; }
.menu-reveal { display: none; }
.menu button.menu-revealed { width: auto; padding-inline: 14px; }
.menu button.menu-revealed > :not(.menu-reveal) { position: absolute; visibility: hidden; }
.menu-revealed .menu-reveal { display: block; position: relative; white-space: nowrap; }
.menu-reveal::before { content: attr(data-label); visibility: hidden; }
.menu-reveal > span { position: absolute; inset: 0; overflow: hidden; text-align: left; }
::highlight(scrambled-text) { color: transparent; }
.text-scramble-overlay { position: fixed; inset: 0; z-index: 5100; pointer-events: none; }
.text-scramble-overlay span { position: absolute; text-align: center; }
.portfolio { position: fixed; inset: auto 0 0; }
.rail { width: 100%; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; overscroll-behavior-x: contain; touch-action: pan-x; scroll-snap-type: none; }
.rail::-webkit-scrollbar { display: none; }
.track { display: flex; align-items: flex-end; gap: var(--gap); width: max-content; padding-inline: var(--inset); padding-top: 16px; }
.tile { position: relative; display: flex; flex-direction: column; flex: 0 0 var(--tile-width); width: var(--tile-width); gap: 15px; cursor: pointer; color: var(--ink); text-decoration: none; }
.tile > :is(img, video) { display: block; flex: none; width: 100%; height: var(--tile-height); object-fit: cover; background: #eee; }
.tile > .tile-preview { position: absolute; inset: auto 0 0; pointer-events: none; }
.tile-caption { order: -1; position: relative; min-width: 0; }
.tile-caption .caption-values { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 15px; padding-right: 12px; }
.meta-pair { display: inline-flex; align-items: baseline; gap: 3px; min-width: 0; max-width: 100%; }
.meta-value { font-weight: 500; text-transform: uppercase; overflow-wrap: anywhere; }
.meta-label { flex: none; color: var(--muted); letter-spacing: .3px; }
.tile-services { position: absolute; bottom: calc(100% + 4px); left: 0; right: 0; letter-spacing: .3px; color: var(--muted); opacity: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity 200ms ease; }
.tile:is(:hover, :focus-visible) .tile-services { opacity: 1; }
.tile:is(:hover, :focus-visible) .tile-caption::after { content: '●'; position: absolute; right: 0; bottom: 0; }
.tile:focus-visible { outline-offset: -2px; }
#status { margin: 0 var(--layout-inset) 30px; }
.imprint-page { overflow-y: auto; }
/* The imprint reuses the animated masthead logo, scrolling with the page. */
.imprint-page .masthead { position: relative; inset: auto; margin: 15px var(--layout-inset) 0; }
.imprint-back { flex: none; color: inherit; text-decoration: none; }
.imprint-content { margin: 80px var(--layout-inset) 30px; padding-left: calc(var(--layout-column) + 15px); text-transform: uppercase; }
.imprint-content { max-width: calc(var(--layout-column) + 15px + 580px); }
.imprint-content h1, .imprint-content h2 { font: inherit; font-weight: 500; margin: 0 0 15px; }
.imprint-content h1 { margin-bottom: 30px; }
.imprint-content section { margin-bottom: 30px; }
.imprint-content :is(address, p) { margin: 0; font-style: normal; color: var(--muted); }
.imprint-content a { color: inherit; }
@media (max-width: 600px) {
  .imprint-content { margin-top: 40px; padding-left: 0; }
}
.orbit-gallery { position: fixed; inset: var(--index-top, 89px) 0 0; overflow: hidden; background: var(--paper); cursor: grab; touch-action: none; user-select: none; }
.orbit-gallery.pointer-focused:focus { outline: none; }
.orbit-gallery.is-dragging { cursor: grabbing; }
.orbit-gallery:focus-visible:not(.pointer-focused) { outline-offset: -4px; }
.orbit-field { position: absolute; inset: 0; pointer-events: none; -webkit-mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent); mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent); }
.orbit-tile { position: absolute; top: 0; left: 0; width: var(--width); height: var(--height); margin: 0; opacity: var(--opacity, 0); transform: translate3d(var(--x, 0), var(--y, 0), 0) scale(var(--scale, .4)); transform-origin: center; will-change: transform, opacity; pointer-events: auto; cursor: pointer; }
.orbit-tile :is(img, video) { display: block; width: 100%; height: 100%; border-radius: var(--orbit-radius, 2px); object-fit: cover; }
.index-filters { position: absolute; top: 4px; left: 25%; width: 49.5%; display: flex; justify-content: center; flex-wrap: wrap; gap: 4px; padding-inline: 15px; }
.index-filters button { background: var(--surface); color: var(--muted); min-height: 22px; padding: 4px 6px; border-radius: 4px; text-transform: uppercase; }
.index-filters button[aria-pressed="true"], .index-filters button:hover { color: var(--ink); }
.project-detail { position: fixed; z-index: 4000; inset: 0; overflow-y: auto; overflow-x: hidden; background: #000; color: #fff; overscroll-behavior: contain; scrollbar-width: none; }
.project-detail::-webkit-scrollbar { display: none; }
.project-detail:focus, .studio-detail:focus { outline: none; }
.project-detail-content { margin: 0 var(--layout-inset); padding-top: calc(var(--index-top, 152px) + 16px); }
.project-detail-info { padding-block: 15px; }
/* Project, Client and Info sit side by side on wide screens; Info takes its own row on phones. */
.project-facts { display: flex; align-items: flex-start; gap: clamp(24px, 4.166667vw, 80px); margin: 0; color: #b5b5b5; text-transform: uppercase; overflow-wrap: anywhere; }
.project-facts > div { min-width: 0; }
.project-facts dt { color: #e5e5e5; }
.project-facts dd { margin: 0; white-space: pre-line; }
.project-hero { display: block; width: 100%; aspect-ratio: 1410 / 575; object-fit: cover; background: #111; }
.project-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 15px; margin-top: 15px; align-items: start; }
.project-grid figure { margin: 0; min-width: 0; grid-column: span var(--columns); }
.project-grid :is(img, video) { width: 100%; aspect-ratio: var(--ratio); height: auto; object-fit: cover; display: block; background: #111; }
.project-grid.custom-layout { grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-rows: minmax(1vw, auto); gap: 0 15px; }
.project-grid.custom-layout :is(img, video) { aspect-ratio: auto; }
.project-open { --paper: #000; --ink: #fff; --surface: #2a2a2a; }
.project-open .masthead::before { content: ''; position: absolute; inset: -15px -15px -15px; z-index: -1; background: #000; pointer-events: none; }
.project-open .menu button { color: #fff; }
.studio-detail { position: fixed; inset: var(--index-top, 89px) 0 0; z-index: 3000; overflow-y: auto; background: var(--paper); padding: 80px var(--layout-inset) 30px; }
.studio-detail-copy { margin-left: calc(var(--layout-column) + 15px); max-width: 580px; text-transform: uppercase; }
.studio-detail-copy h1, .studio-detail-copy h2 { font: inherit; font-weight: 500; margin: 0 0 15px; }
.studio-detail-copy p { color: var(--muted); margin-bottom: 30px; white-space: pre-line; }
/* Keep the masthead in the background crossfade and slide the page content. */
::view-transition { pointer-events: none; }
.project-transitioning::view-transition-group(root) { animation-duration: 360ms; }
.project-transitioning .rail { pointer-events: none; }
.project-transitioning :is(.portfolio, .orbit-gallery, .studio-detail, .project-detail-content) {
  view-transition-name: project-outgoing;
}
.project-transition-in :is(.portfolio, .orbit-gallery, .studio-detail, .project-detail-content) {
  view-transition-name: project-incoming;
}
::view-transition-old(project-outgoing) { animation: project-page-out 200ms ease-in both; }
::view-transition-new(project-incoming) { animation: project-page-in 340ms ease-out 60ms both; }
@keyframes project-page-out { to { opacity: 0; transform: translateY(-8px); } }
@keyframes project-page-in { from { opacity: 0; transform: translateY(10px); } }
.page-out { animation: page-out 400ms ease-in both; }
.page-out-back { animation: page-out-back 400ms ease-in both; }
.page-in { animation: page-in 800ms cubic-bezier(0, .635, .345, 1) both; }
.page-in-back { animation: page-in-back 800ms cubic-bezier(0, .635, .345, 1) both; }
@keyframes page-out { from { opacity: var(--page-exit-opacity, 1); transform: var(--page-exit-transform, none); } 80% { opacity: 0; } to { opacity: 0; transform: translate3d(-10px, 0, 0); } }
@keyframes page-out-back { from { opacity: var(--page-exit-opacity, 1); transform: var(--page-exit-transform, none); } 80% { opacity: 0; } to { opacity: 0; transform: translate3d(10px, 0, 0); } }
@keyframes page-in { from { opacity: 0; transform: translate3d(max(1vw, 25px), 0, 0); } to { opacity: 1; transform: none; } }
@keyframes page-in-back { from { opacity: 0; transform: translate3d(min(-1vw, -25px), 0, 0); } to { opacity: 1; transform: none; } }
@media (min-width: 601px) and (max-width: 1100px) {
  .studio { grid-template-columns: 203px minmax(0, 1fr); }
  .about { max-width: 46vw; }
  .index-filters { left: 203px; right: 220px; width: auto; }
}
@media (max-width: 600px) {
  .masthead { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 15px; }
  .studio { display: contents; }
  .studio-logo { width: 203px; max-width: 100%; grid-column: 1; grid-row: 1; }
  .about { grid-column: 1 / -1; grid-row: 3; margin-top: 30px; width: 100%; max-width: none; }
  .mobile-menu-trigger { display: block; grid-column: 2; grid-row: 1; min-width: 70px; height: 34px; padding: 0 14px; border-radius: 4px; background: var(--surface); color: var(--ink); }
  .mobile-menu-trigger[aria-expanded="true"] { background: var(--ink); color: var(--paper); border-radius: 0; }
  .menu { display: none; grid-column: 1 / -1; grid-row: 2; justify-content: flex-end; margin-top: 30px; }
  .menu.mobile-menu-open { display: flex; }
  .meta-label { display: none; }
  .tile-caption .caption-values { gap: 4px 15px; }
  .tile-services { opacity: 1; }
  .index-filters { position: static; grid-column: 1 / -1; grid-row: 3; margin-top: 25px; width: 100%; padding: 0; justify-content: flex-start; }
  .project-detail-info { padding-block: 0 15px; }
  .project-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
  .project-facts > div:last-child { grid-column: 1 / -1; }
  .project-hero { aspect-ratio: 1; }
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-grid figure { grid-column: span var(--mobile-columns, 1); }
  .project-grid :is(img, video) { aspect-ratio: var(--mobile-ratio, 4 / 5); }
  .project-grid.custom-layout { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
  .project-grid.custom-layout figure { grid-column: span 1 !important; grid-row: auto !important; }
  .studio-detail { padding-top: 40px; }
  .studio-detail-copy { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .tile-services { transition: none; }
  .page-out, .page-out-back, .page-in, .page-in-back { animation: none; }
  ::view-transition-group(*) { animation-duration: 0s !important; }
}

/* Preserve automatic compositions when entering the seven-column editor. */
.project-grid.custom-layout.composed-layout { width: calc(100% + 15px); grid-template-columns: repeat(84, minmax(0, 1fr)); grid-auto-rows: minmax(0, auto); gap: 15px 0; }
.project-grid.composed-layout figure { margin-right: 15px; }
.project-grid.composed-layout :is(img, video) { aspect-ratio: var(--layout-ratio, auto); }
.project-grid-spacer { grid-column: 1 / -1; pointer-events: none; }
@media (max-width: 600px) {
  .project-grid.custom-layout.composed-layout { width: auto; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
  .project-grid.composed-layout figure { margin-right: 0; }
  .project-grid.composed-layout :is(img, video) { aspect-ratio: var(--mobile-ratio); }
  .project-grid-spacer { display: none; }
}

.project-grid.twelve-layout { grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-rows: minmax(0, auto); gap: 15px; }
.project-grid.twelve-layout :is(img, video) { aspect-ratio: var(--layout-ratio); }
.project-text { color: #fff; margin: 0; padding-block: 15px; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .project-grid.twelve-layout { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-grid.twelve-layout figure { grid-column: span var(--mobile-columns, 1) !important; grid-row: auto !important; }
  .project-grid.twelve-layout :is(img, video) { aspect-ratio: var(--mobile-ratio, 1); }
  .project-grid.twelve-layout .project-text { grid-column: 1 / -1 !important; grid-row: auto !important; }
}

.studio-logo .logo-highlight,
.highlight-about,
.menu-highlight { display: none; }

body {
  --highlight-logo-height: 3lh;
  @supports (text-box: trim-both cap alphabetic) {
    --highlight-logo-height: calc(2lh + 1cap);
  }
  font-family: Haffer, Arial, Helvetica, sans-serif;

  & .masthead { font-size: 13px; line-height: 1.2; }

  & .studio-logo {
    position: relative;
    width: calc(var(--highlight-logo-height) * 326.816 / 50.923);
    height: var(--highlight-logo-height);
    overflow: visible;
  }
  & .studio-logo:focus-visible { outline-offset: -2px; }
  & .about:not(.highlight-about) { display: none; }
  & .studio-logo .logo-highlight {
    position: absolute;
    inset: calc(-1 * var(--logo-top, 15px)) auto auto calc(-1 * var(--logo-left, 15px));
    display: block;
    /* Scale the full composition without moving its internal artwork. */
    width: calc(100% * 446 / 326.816);
    aspect-ratio: 446 / 213;
    pointer-events: none;
  }
  & .highlight-about {
    display: block;
    max-width: 774px;
    color: #999;
    font-weight: 400;
    overflow-wrap: anywhere;
    text-box: trim-both cap alphabetic;
  }
  & .highlight-about strong { display: inline; font-weight: inherit; }
  & .highlight-links { color: #c9c9c9; }
  & .highlight-links a { text-decoration: none; }
  & .highlight-links a:is(:hover, :focus-visible) { color: var(--ink); text-decoration: underline; }
}

.menu { height: auto; gap: 4px; line-height: 1; }
.menu button[data-project] {
  --menu-fill: #dfdfdf;
  --point: 0px;
  width: auto;
  min-width: 0;
  height: auto;
  padding: 7px 10px;
  background: transparent;
  font-weight: 500;
}
/* The fill lives on ::before so shaped clips never cut the focus ring.
   Resting buttons are rectangles; each shape appears on hover/focus or when
   active. Vertex counts stay fixed so clip-path shapes animate smoothly. */
.menu button[data-project]::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--menu-fill);
  border-radius: 0;
  filter: none;
  pointer-events: none;
  transition: clip-path .22s cubic-bezier(.2,.7,.25,1), border-radius .22s cubic-bezier(.2,.7,.25,1);
}
.menu button[data-project="2"]::before {
  clip-path: polygon(var(--point) 0, calc(100% - var(--point)) 0, 100% 50%, calc(100% - var(--point)) 100%, var(--point) 100%, 0 50%);
}
.menu button[data-project]:not(.selected):is(:hover, :focus-visible, .menu-revealed) { --menu-fill: #d3d3d3; }
.menu button.selected { --menu-fill: #000; color: #fff; }
.menu button[data-project]:is(:hover, :focus-visible, .menu-revealed, .selected) {
  &[data-project="1"]::before { border-radius: 20px; }
  &[data-project="2"] { --point: 12px; padding-inline: 20px; }
  &[data-project="3"]::before { border-radius: 5px; }
}
@media (prefers-reduced-motion: reduce) {
  .menu button[data-project]::before { transition: none; }
}
.menu-number { font: inherit; letter-spacing: normal; }
.menu button.selected[data-project="0"] .menu-label { display: none; }
.menu button.selected .menu-highlight { display: block; }
.project-open .menu button { --menu-fill: #b6b6b6; color: #000; }
.project-open .menu button.selected { --menu-fill: #fff; }

.project-open .studio-logo .logo-highlight { filter: invert(1); }
.project-open .highlight-links { color: #777; }

@media (hover: hover) and (pointer: fine) {
  :root {
    --dot-cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Ccircle cx='8' cy='8' r='5' fill='black'/%3E%3C/svg%3E") 8 8, auto;
  }
  .project-open {
    --dot-cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Ccircle cx='8' cy='8' r='5' fill='white'/%3E%3C/svg%3E") 8 8, auto;
  }
  body, body :is(a, button, .tile, .orbit-gallery, .orbit-gallery.is-dragging, .orbit-tile) {
    cursor: var(--dot-cursor);
  }
  .cursor-managed { --dot-cursor: none; }
}

.idle-cursor {
  position: fixed;
  z-index: 5200;
  width: 27.5px;
  height: 27.5px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.idle-cursor::before {
  content: '';
  position: absolute;
  inset: 50% auto auto 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #000;
  transform: translate(-50%, -50%);
}
.idle-cursor > svg { visibility: hidden; }
.cursor-idle .idle-cursor::before { display: none; }
.cursor-idle .idle-cursor > svg { visibility: visible; }
.project-open .idle-cursor { filter: invert(1); }

@media (max-width: 1100px) {
  body {
    --stacked-logo-unit: min(calc(var(--highlight-logo-height) / 50.923), calc(100vw / 446));

    & .masthead { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 15px; }
    & .studio { display: contents; }
    & .menu:not(.mobile-menu-open) { grid-area: 1 / 2; }
    & :is(.menu:not(.mobile-menu-open), .mobile-menu-trigger, .imprint-back) {
      align-self: start;
      margin-top: calc(var(--stacked-logo-unit) * 50.921 - var(--logo-top, 15px));
    }
    & .mobile-menu-trigger { height: calc(var(--stacked-logo-unit) * 50.923); }
    & .studio-logo {
      grid-area: 1 / 1;
      width: calc(var(--stacked-logo-unit) * 326.816);
      /* Reserve space down to the opening A's baseline within the canvas. */
      height: calc(var(--stacked-logo-unit) * 101.844 - var(--logo-top, 15px));
    }
    & .highlight-about {
      grid-area: 3 / 1 / auto / -1;
      width: auto;
      margin: 40px 0 0 calc(var(--stacked-logo-unit) * 50.921 - var(--logo-left, 15px));
    }
    & .highlight-about .desktop-break { display: none; }
    & .index-filters {
      position: static;
      grid-area: 4 / 1 / auto / -1;
      width: auto;
      margin: 25px 0 0 calc(var(--stacked-logo-unit) * 50.921 - var(--logo-left, 15px));
      padding: 0;
      justify-content: flex-start;
    }
    & .portfolio {
      --tile-height: max(1px, min(50vh, calc(100vh - var(--index-top, 240px) - 64px)));
      --tile-width: calc(var(--tile-height) * 4 / 5);
    }
  }
}

@media (min-width: 1101px) {
  :root {
    --project-rail-image-height: 60vh;
    --rail-bottom: var(--gap);
    --rail-caption-gap: 11px;
  }

  body {
    --highlight-inset: 42px;
    --highlight-layout-inset: calc(var(--highlight-inset) + max(0px, (100% - var(--layout-max-width)) / 2));

    /* The opening artwork starts 50.921 units down on the Lottie canvas. */
    & .masthead {
      --logo-top: calc(var(--highlight-logo-height) * 50.921 / 50.923);
      --logo-left: var(--highlight-inset);
      inset: var(--logo-top) var(--highlight-layout-inset) auto;
      gap: 20px;
    }
    & .studio { grid-template-columns: auto minmax(0, 1fr); gap: 80px; }
    & .masthead { flex-wrap: wrap; }
    &.imprint-page .masthead { margin: var(--logo-top) var(--highlight-layout-inset) 0; }
    /* About starts on the same left edge as the masthead's studio text. */
    & .studio-detail { padding-left: var(--studio-copy-left, calc(var(--layout-column) + 15px + var(--layout-inset))); }
    & .studio-detail-copy { margin-left: 0; }
    /* Index filters wrap onto their own row, aligned with the studio copy. */
    & .index-filters {
      position: static;
      order: 1;
      flex: 1 0 100%;
      width: auto;
      margin-top: 4px;
      padding: 0 0 0 calc(var(--highlight-logo-height) * 326.816 / 50.923 + 80px);
      justify-content: flex-start;
    }
  }

  body:has(> .project-detail:not([hidden])) {
    & .masthead::before {
      /* Extend across the side gutters while keeping the project info clear. */
      inset: calc(-1 * var(--logo-top)) calc(-1 * var(--highlight-layout-inset)) -15px;
    }
    & .project-detail-content {
      margin-inline: var(--highlight-layout-inset);
      /* Match the top of the rail's title and services caption. */
      padding-top: max(
        calc(var(--index-top, 152px) + 16px),
        calc(100vh - var(--rail-bottom) - var(--project-rail-image-height) - var(--rail-caption-gap) - 2lh)
      );
    }
    & .project-detail-info { display: block; padding: 0 0 11px; }
    & .project-hero { height: var(--project-rail-image-height); aspect-ratio: auto; }
  }

  .portfolio {
    bottom: var(--rail-bottom);
    --tile-height: var(--project-rail-image-height);
    --tile-width: calc(var(--tile-height) * 4 / 5);
  }
  .portfolio .track { padding-inline: 0; }
}

/* Rail captions share the alternate title-over-services style at every width. */
.portfolio .tile { gap: var(--rail-caption-gap, 11px); }
.portfolio .tile > :is(img, video) { border-radius: 1px; }
.portfolio .tile :is(.meta-label, .tile-client) { display: none; }
.portfolio .tile-caption .caption-values { padding: 0; }
.portfolio .tile :is(.caption-values, .tile-services) { text-transform: uppercase; }
.portfolio .tile .meta-value { font-weight: 400; }
.portfolio .tile .tile-services { position: static; min-height: 1lh; letter-spacing: normal; opacity: 1; }
.portfolio .tile:is(:hover, :focus-visible) .tile-caption::after { content: none; }

@media (max-width: 1100px) {
  /* Compact masthead: the studio copy only shows on the landing view, so
     Index, About and project pages are not covered by a tall fixed header. */
  :root:is(.index-open, .about-open, .project-open) .highlight-about { display: none; }
  .portfolio { bottom: var(--gap); }
  body .portfolio {
    --tile-height: max(1px, min(50svh, calc(100svh - var(--index-top, 240px) - 64px - var(--gap))));
  }
  /* About copy starts on the masthead copy's left edge, like the wide layout. */
  body .studio-detail { padding-left: calc(var(--layout-inset) + var(--stacked-logo-unit) * 50.921 - var(--logo-left, 15px)); }
  .studio-detail-copy { margin-left: 0; }
}

@media (max-width: 600px) {
  body {
    /* Shrink the logo so its artwork (A to ©, 377.737 canvas units) clears
       the fixed-width MENU/CLOSE button. */
    --mobile-trigger-width: 72px;
    --stacked-logo-unit: min(
      calc(var(--highlight-logo-height) / 50.923),
      calc((100vw - 2 * var(--inset) - var(--mobile-trigger-width) - 12px) / 377.737)
    );
  }
  body .mobile-menu-trigger { width: var(--mobile-trigger-width); min-width: 0; padding: 0; }
  /* Touch has no hover reveal, so the open menu names each destination. */
  .menu button .menu-number { display: none; }
  .menu button:not([data-project="0"]) .menu-label,
  .menu button[data-project="0"] .menu-highlight { display: block; }
  body .menu.mobile-menu-open { margin-top: 20px; }
  .menu button[data-project] { padding: 9px 12px; }
}

.service-badges { display: flex; flex-wrap: wrap; gap: 5px; grid-column: 1 / -1; margin-top: 10px; }
.service-badges span { border: 1px solid #777; border-radius: 100px; padding: 4px 9px; }
.project-grid .fill-row { align-self: stretch; }
.project-grid .fill-row :is(img, video) { height: 100%; object-fit: cover; }
