@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400&display=swap");

:root {
  --paper: #ffffff;
  --ink: #000000;
  --muted: #797979;
  --caption: #969696;
  --accent: #9a4d36;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --motion: 820ms;
  --fade: 520ms;
  --max: 1880px;
  --type-body: 400 14px / 18px "Inter", sans-serif;
  --type-intro: 400 14px / 17px "Inter", sans-serif;
  --type-main-text: 400 12px / 16px "Inter", sans-serif;
  --type-caption: 400 11px / 16px "Inter", sans-serif;
  --type-nav: 400 12px / 16px "Inter", sans-serif;
  --type-title: 400 18px / 20px "Inter", sans-serif;
  --type-place: 400 14px / 20px "Inter", sans-serif;
  --editorial-text-field-width: clamp(480px, 28vw, 554px);
  --editorial-text-inset-start: clamp(64px, 4.3vw, 85px);
  --editorial-text-inset-end: clamp(48px, 3.5vw, 70px);
  --project-open-media-height: clamp(460px, 36vw, 620px);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: var(--type-body);
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  color: inherit;
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  column-gap: 48px;
  align-items: center;
  min-height: 66px;
  padding: 0 38px;
  background: #ffffff;
}

.brand {
  display: inline-flex;
  width: max-content;
  align-items: center;
  gap: clamp(5px, 0.7vw, 12px);
  justify-self: start;
  cursor: pointer;
}

.brand:focus {
  outline: none;
}

.brand:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 6px;
}

.brand-arrow {
  flex: 0 0 auto;
  width: clamp(18px, 1.3vw, 25px);
  height: clamp(18px, 1.3vw, 25px);
  align-self: flex-start;
  margin-top: 2px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-linecap: square;
  stroke-linejoin: miter;
  stroke-width: 2;
  animation: brand-arrow-nudge 2600ms var(--ease) 1200ms infinite;
  transition: transform 180ms var(--ease);
}

.brand:hover .brand-arrow,
.brand:focus-visible .brand-arrow {
  animation-play-state: paused;
  transform: translate(2px, 2px);
}

@keyframes brand-arrow-nudge {
  0%,
  76%,
  100% {
    transform: translate(0, 0);
  }

  84% {
    transform: translate(1.5px, 1.5px);
  }
}

.modular-logo {
  --logo-tile-size: clamp(18px, 1.35vw, 26px);
  --logo-gap: 3px;
  display: inline-flex;
  flex-direction: column;
  gap: var(--logo-gap);
}

.modular-logo__row {
  display: flex;
  gap: var(--logo-gap);
}

.logo-tile {
  position: relative;
  display: block;
  width: var(--logo-tile-size);
  height: var(--logo-tile-size);
  flex: 0 0 var(--logo-tile-size);
  overflow: hidden;
  background: #000000;
}

.logo-tile img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  transition:
    opacity 420ms ease,
    transform 420ms var(--ease),
    filter 420ms ease;
}

.logo-tile__letter {
  opacity: 1;
  transform: scale(1);
  filter: blur(0);
}

.logo-tile__project {
  opacity: 0;
  transform: scale(0.96);
  filter: blur(0.4px);
}

.logo-tile.is-project .logo-tile__letter {
  opacity: 0;
  transform: scale(0.96);
  filter: blur(0.4px);
}

.logo-tile.is-project .logo-tile__project {
  opacity: 1;
  transform: scale(1);
  filter: blur(0);
}

.nav {
  display: flex;
  justify-content: center;
  gap: 48px;
  color: var(--muted);
  font: var(--type-nav);
  text-transform: uppercase;
}

.nav a,
.project-search {
  white-space: nowrap;
}

.nav a:hover,
.footer a:hover {
  color: var(--accent);
}

.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;
}

.project-search {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  width: max-content;
  gap: 13px;
  margin: 0;
  color: var(--caption);
  cursor: text;
}

.project-search:focus-within {
  color: var(--muted);
}

.search-mark {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: var(--ink);
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: square;
  fill: none;
}

.search-field {
  position: relative;
  display: block;
  width: clamp(92px, 8.5vw, 160px);
}

.search-input {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: var(--type-nav);
  text-transform: uppercase;
  appearance: none;
}

.search-input::-webkit-search-decoration,
.search-input::-webkit-search-cancel-button {
  appearance: none;
}

.search-input:focus-visible {
  outline: none;
}

.search-example {
  position: absolute;
  left: 0;
  top: 50%;
  max-width: 100%;
  overflow: hidden;
  color: var(--caption);
  font: var(--type-nav);
  text-overflow: ellipsis;
  text-transform: uppercase;
  transform: translateY(-50%);
  transition:
    opacity 420ms ease,
    transform 420ms var(--ease);
  pointer-events: none;
}

.project-search.is-focused .search-example,
.project-search.has-value .search-example {
  opacity: 0;
  transform: translateY(calc(-50% + 3px));
}

.project-search.is-example-fading .search-example {
  opacity: 0;
  transform: translateY(calc(-50% - 3px));
}

.project-search:focus-within .search-mark {
  color: var(--muted);
}

.project-feed {
  max-width: var(--max);
  margin: 0 auto;
  padding: 42px 38px 120px;
}

.project {
  padding: 24px 0 28px;
}

.project.is-filtered-out {
  display: none;
}

.search-empty {
  margin: 72px 0 0;
  color: var(--caption);
  font: var(--type-nav);
  text-align: center;
  text-transform: uppercase;
}

.search-empty[hidden] {
  display: none;
}

.mobile-open-caption {
  display: none;
}

/* The wrapper is structural for mobile only; desktop keeps its existing grid. */
.mobile-project-anchor {
  display: contents;
}

.mobile-project-facts {
  display: none;
}

.project-card {
  display: grid;
  grid-template-columns: 210px clamp(500px, 29vw, 560px);
  justify-content: center;
  column-gap: 46px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: inherit;
  transition:
    grid-template-columns var(--motion) var(--ease),
    column-gap var(--motion) var(--ease),
    padding var(--motion) var(--ease);
}

.project-card:focus {
  outline: none;
}

.project-card:focus-visible {
  outline: 1px solid rgba(17, 17, 15, 0.55);
  outline-offset: 8px;
}

.project-meta {
  display: flex;
  min-height: 0;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  padding-top: 2px;
  text-align: right;
  transition: min-height var(--motion) var(--ease);
}

.project-mark {
  position: relative;
  display: block;
  width: 54px;
  height: 54px;
  margin-bottom: 24px;
  background: var(--ink);
  transition:
    width var(--motion) var(--ease),
    height var(--motion) var(--ease),
    margin var(--motion) var(--ease),
    transform 240ms ease,
    background 240ms ease;
}

.project-mark.project-mark--logo {
  background: #000000;
}

.project-mark.project-mark--logo img {
  display: none;
}

.project-card:hover .project-mark,
.project.is-open .project-mark {
  background: var(--accent);
  transform: translateY(-3px);
}

.project-card:hover .project-mark.project-mark--logo,
.project.is-open .project-mark.project-mark--logo {
  background: #000000;
}

.project-mark.ring span {
  position: absolute;
  inset: 14px 8px;
  border: 6px solid var(--paper);
  border-radius: 50%;
  transform: rotate(-22deg) skewX(-18deg);
  transition: inset var(--motion) var(--ease), border-width var(--motion) var(--ease);
}

.project-mark.plus span::before,
.project-mark.plus span::after,
.project-mark.bars span::before,
.project-mark.bars span::after {
  content: "";
  position: absolute;
  background: var(--paper);
}

.project-mark.plus span::before {
  width: 32px;
  height: 7px;
  left: 11px;
  top: 24px;
}

.project-mark.plus span::after {
  width: 7px;
  height: 32px;
  left: 24px;
  top: 11px;
}

.project-mark.bars span::before {
  width: 36px;
  height: 7px;
  left: 9px;
  top: 17px;
  box-shadow: 0 14px 0 var(--paper);
}

.project-mark.bars span::after {
  width: 16px;
  height: 7px;
  left: 19px;
  top: 31px;
  background: var(--paper);
}

.project-title {
  display: block;
  max-width: 240px;
  font: var(--type-title);
  color: var(--ink);
  text-wrap: pretty;
  transition: font-size var(--motion) var(--ease), color 240ms ease;
}

.project-place {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font: var(--type-place);
  text-transform: uppercase;
  transition: font-size var(--motion) var(--ease), color 240ms ease;
}

.project-facts {
  display: grid;
  gap: 14px;
  max-height: 0;
  margin-top: 0;
  overflow: hidden;
  opacity: 0;
  transition:
    max-height var(--motion) var(--ease),
    margin var(--motion) var(--ease),
    opacity var(--fade) ease 420ms;
}

.project-facts span,
.project-facts b,
.project-copy span,
.project-gallery-copy span {
  display: block;
}

.project-facts span {
  color: var(--ink);
  font: 400 14px / 18px "Inter", sans-serif;
}

.project-facts span:first-child {
  color: var(--muted);
  font: var(--type-place);
  text-transform: uppercase;
}

.project-facts b {
  margin-bottom: 2px;
  color: var(--caption);
  font: var(--type-caption);
  text-transform: uppercase;
}

.project-share {
  position: relative;
  display: grid;
  gap: 9px;
  max-height: 0;
  margin-top: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  pointer-events: none;
  transition:
    max-height var(--motion) var(--ease),
    margin var(--motion) var(--ease),
    opacity var(--fade) ease,
    transform var(--fade) var(--ease),
    visibility 0s linear var(--fade);
}

.project-share__label,
.project-share__status {
  display: block;
  color: var(--caption);
  font: var(--type-caption);
  text-transform: uppercase;
}

.project-share__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 3px;
}

.project-share__button {
  display: inline-grid;
  width: 20px;
  height: 20px;
  place-items: center;
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  user-select: none;
  transition:
    background 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.project-share__button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-share__button:hover,
.project-share__button:focus-visible {
  background: #333;
  outline: none;
  transform: translateY(-1px);
}

.project-share__status {
  position: absolute;
  right: 0;
  bottom: 0;
  min-height: 0;
  opacity: 0;
  transform: translateY(calc(100% + 4px));
  white-space: nowrap;
  transition: opacity 180ms ease;
}

.project-share.has-status .project-share__status {
  opacity: 1;
}

.project-share.has-status {
  overflow: visible;
}

.project-cover {
  display: block;
  min-width: 0;
  overflow: visible;
}

.project-cover img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
  background: #ded8cc;
  transform-origin: left top;
  transition:
    width var(--motion) var(--ease),
    height var(--motion) var(--ease),
    aspect-ratio var(--motion) var(--ease),
    opacity 720ms ease,
    filter 240ms ease,
    transform var(--motion) var(--ease);
}

.project-card:hover .project-cover img {
  filter: saturate(1.06) contrast(1.02);
  transform: translateY(-2px);
}

.project.is-open .project-card:hover .project-cover img,
.project.is-transitioning .project-card:hover .project-cover img {
  filter: none;
  transform: none;
}

.project-copy {
  display: block;
  width: min(34ch, 290px);
  max-width: 290px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  font: var(--type-intro);
  color: var(--ink);
  hyphens: auto;
  text-wrap: pretty;
  transition:
    max-height var(--motion) var(--ease),
    opacity var(--fade) ease,
    transform var(--fade) var(--ease),
    visibility 0s linear var(--fade);
}

.project-copy span + span {
  margin-top: 18px;
}

.project-gallery-image,
.project-gallery-copy,
.project-gallery-map {
  display: none;
  min-width: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition:
    opacity var(--fade) ease,
    transform var(--fade) var(--ease),
    visibility 0s linear var(--fade);
}

.project-gallery-image {
  width: max-content;
  max-width: none;
}

.project-gallery-image img,
.project-gallery-image video {
  display: block;
  height: clamp(460px, 36vw, 620px);
  width: auto;
  max-width: none;
  object-fit: contain;
  background: #ded8cc;
}

.project-gallery-image.is-video video {
  background: #11110f;
}

.project-gallery-copy {
  /*
   * Text blocks are full-height white fields in the desktop gallery. The
   * content sits inside the field rather than directly against an image.
   */
  min-height: clamp(460px, 36vw, 620px);
  font: var(--type-body);
  color: var(--ink);
  hyphens: auto;
  overflow-wrap: break-word;
  text-wrap: pretty;
}

.project-gallery-copy span + span {
  margin-top: 18px;
}

.project-gallery-copy:not(.is-quote) {
  display: flex;
  width: 370px;
  padding: 0 40px;
  align-items: flex-start;
  font: var(--type-main-text);
}

.project-gallery-copy.is-quote {
  display: flex;
  width: clamp(650px, 54.2vw, 795px);
  padding: 0 clamp(64px, 4.8vw, 74px) 0 clamp(56px, 4.4vw, 64px);
  flex-direction: column;
  justify-content: center;
  font: 400 clamp(20px, 1.5vw, 22px) / 1.12 "Inter", sans-serif;
}

.project-gallery-copy__author {
  display: block;
  margin-top: 42px;
  font: 400 12px / 16px "Inter", sans-serif;
  color: var(--caption);
  text-transform: uppercase;
}

.project-gallery-copy__author-name {
  color: var(--ink);
}

.project-gallery-copy__author-role {
  color: var(--caption);
}

.project-gallery-copy__author-role::before {
  content: " — ";
}

.project-gallery-map {
  position: relative;
  width: clamp(520px, 42vw, 720px);
  height: clamp(460px, 36vw, 620px);
  overflow: hidden;
  background: #efefed;
}

.project-gallery-map iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  filter: grayscale(1) contrast(1.08) brightness(1.04);
  pointer-events: none;
}

.project-gallery-map > span {
  position: absolute;
  left: 18px;
  bottom: 16px;
  color: var(--ink);
  font: 400 12px / 14px "Inter", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0;
  pointer-events: none;
}

.project.is-open {
  padding: 46px 0 58px;
  transition: padding var(--motion) var(--ease);
}

.project.is-open .project-card {
  grid-template-columns:
    minmax(250px, 330px)
    max-content
    370px;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  justify-content: start;
  align-items: start;
  /* One consistent editorial gutter between every item in the open sequence. */
  column-gap: clamp(24px, 2vw, 42px);
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding-bottom: 28px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  cursor: grab;
}

.project.is-open .project-meta {
  min-height: var(--project-open-media-height);
}

.project.is-open .project-meta > .project-mark {
  width: 64px;
  height: 64px;
  margin-bottom: 28px;
}

.project.is-open .project-meta > .project-mark.ring span {
  inset: 16px 10px;
  border-width: 7px;
}

.project.is-open .project-meta > .project-mark.plus span::before {
  width: 38px;
  height: 8px;
  left: 13px;
  top: 28px;
}

.project.is-open .project-meta > .project-mark.plus span::after {
  width: 8px;
  height: 38px;
  left: 28px;
  top: 13px;
}

.project.is-open .project-meta > .project-mark.bars span::before {
  width: 42px;
  height: 8px;
  left: 11px;
  top: 20px;
  box-shadow: 0 16px 0 var(--paper);
}

.project.is-open .project-meta > .project-mark.bars span::after {
  width: 18px;
  height: 8px;
  left: 23px;
  top: 36px;
}

.project.is-open .project-meta > .project-title {
  max-width: 300px;
  font: var(--type-title);
}

.project.is-open .project-meta > .project-place {
  margin-top: 8px;
  font: var(--type-place);
  color: var(--muted);
}

.project.is-open .project-facts {
  max-height: 420px;
  margin-top: 34px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
}

.project.is-open .project-share {
  max-height: 120px;
  margin-top: auto;
  padding-top: 0;
  align-self: stretch;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
}

.project.is-open .project-cover img {
  width: auto;
  max-width: none;
  aspect-ratio: auto;
  height: var(--project-open-media-height);
  object-fit: contain;
}

.project.is-open .project-cover {
  aspect-ratio: auto;
  overflow: visible;
  margin-left: clamp(34px, 4vw, 78px);
}

.project.is-open .project-copy {
  width: 370px;
  min-height: var(--project-open-media-height);
  max-width: none;
  max-height: none;
  padding: 0 40px;
  font: var(--type-main-text);
  opacity: 0;
  visibility: hidden;
  transform: translateX(32px);
  clip-path: inset(0 0 0 100%);
  transition:
    max-height var(--motion) var(--ease),
    opacity 520ms ease 130ms,
    transform 520ms var(--ease) 130ms,
    clip-path 520ms var(--ease) 130ms,
    visibility 0s linear 650ms;
}

.project.is-open .project-meta,
.project.is-open .project-cover,
.project.is-open .project-copy,
.project.is-open .project-gallery-image,
.project.is-open .project-gallery-copy,
.project.is-open .project-gallery-map {
  scroll-snap-align: start;
}

.project.is-open .project-gallery-image,
.project.is-open .project-gallery-copy,
.project.is-open .project-gallery-map {
  display: block;
}

/* Keep the editorial text fields as flex containers after they are revealed. */
.project.is-open .project-gallery-copy:not(.is-quote) {
  display: flex;
}

.project.is-open .project-gallery-copy.is-quote {
  display: flex;
}

.project.is-open.is-content-revealed .project-facts,
.project.is-open.is-content-revealed .project-share,
.project.is-open.is-content-revealed .project-copy,
.project.is-open.is-content-revealed .project-gallery-image,
.project.is-open.is-content-revealed .project-gallery-copy,
.project.is-open.is-content-revealed .project-gallery-map {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
  transition:
    opacity var(--fade) ease 120ms,
    transform var(--fade) var(--ease) 120ms,
    visibility 0s linear 0s;
}

.project.is-open.is-content-revealed .project-copy {
  transform: translateX(0);
  clip-path: inset(0);
  transition:
    max-height var(--motion) var(--ease),
    opacity 520ms ease 130ms,
    transform 520ms var(--ease) 130ms,
    clip-path 520ms var(--ease) 130ms,
    visibility 0s linear 0s;
}

.project.is-open .project-facts span {
  --reveal-index: 0;
  opacity: 0;
  transform: translateY(16px);
  clip-path: inset(0 0 100% 0);
}

.project.is-open .project-facts span:nth-child(2) {
  --reveal-index: 1;
}

.project.is-open .project-facts span:nth-child(3) {
  --reveal-index: 2;
}

.project.is-open .project-facts span:nth-child(4) {
  --reveal-index: 3;
}

.project.is-open .project-facts span:nth-child(5) {
  --reveal-index: 4;
}

.project.is-open.is-content-revealed .project-facts span {
  animation: revealProjectText 520ms var(--ease) both;
  animation-delay: calc(var(--reveal-index) * 48ms);
}

@keyframes revealProjectText {
  from {
    opacity: 0;
    transform: translateY(16px);
    clip-path: inset(0 0 100% 0);
  }

  to {
    opacity: 1;
    transform: translateY(0);
    clip-path: inset(0);
  }
}

.project.is-transitioning .project-card {
  overflow: hidden;
  scrollbar-width: none;
  pointer-events: none;
  transition: none !important;
}

.project.is-transitioning .project-card::-webkit-scrollbar {
  display: none;
}

.project.is-transitioning,
.project.is-transitioning .project-meta,
.project.is-transitioning .project-mark,
.project.is-transitioning .project-mark span,
.project.is-transitioning .project-cover,
.project.is-transitioning .project-cover img,
.project.is-transitioning .project-title,
.project.is-transitioning .project-place {
  transition: none !important;
}

.project.is-open.is-transitioning:not(.is-content-revealed) .project-facts,
.project.is-open.is-transitioning:not(.is-content-revealed) .project-share,
.project.is-open.is-transitioning:not(.is-content-revealed) .project-copy,
.project.is-open.is-transitioning:not(.is-content-revealed) .project-gallery-image,
.project.is-open.is-transitioning:not(.is-content-revealed) .project-gallery-copy,
.project.is-open.is-transitioning:not(.is-content-revealed) .project-gallery-map,
.project.is-closing .project-facts,
.project.is-closing .project-share,
.project.is-closing .project-copy,
.project.is-closing .project-gallery-image,
.project.is-closing .project-gallery-copy,
.project.is-closing .project-gallery-map {
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: none;
}

.practice {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  padding: 26px 38px;
  border-top: 1px solid #d9d9d9;
  border-bottom: 1px solid #d9d9d9;
  color: var(--ink);
}

.practice__item {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 42px;
  color: inherit;
  text-decoration: none;
  transition: opacity 180ms ease;
}

.practice__title {
  font: 400 12px / 14px "Inter", sans-serif;
  text-transform: uppercase;
}

.practice__meta {
  color: var(--muted);
  font: 400 11px / 16px "Inter", sans-serif;
  text-transform: uppercase;
}

.practice__item:hover,
.practice__item:focus-visible {
  opacity: 0.55;
  outline: none;
}

.practice__item:focus-visible .practice__title {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  padding: 30px 38px 42px;
  color: var(--caption);
  font: var(--type-nav);
  text-transform: uppercase;
  border-top: 1px solid #eeeeee;
}

.footer__contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px clamp(18px, 2vw, 34px);
}

.footer__contacts a,
.footer__year {
  white-space: nowrap;
}

.footer p {
  margin: 0;
}

@media (max-width: 1180px) {
  .site-header {
    grid-template-columns: max-content minmax(0, 1fr) max-content;
    column-gap: 32px;
  }

  .nav {
    gap: 36px;
    font: var(--type-nav);
  }
}

@media (min-width: 1181px) and (max-width: 1500px) {
  :root {
    --project-open-media-height: clamp(430px, 38vw, 560px);
  }

  .project-feed {
    padding-left: 30px;
    padding-right: 30px;
  }

  .project.is-open .project-card {
    grid-template-columns:
      minmax(210px, 250px)
      max-content
      370px;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    column-gap: 24px;
  }

  .project.is-open .project-cover {
    margin-left: 34px;
  }

  .project.is-open .project-cover img {
    width: auto;
    height: var(--project-open-media-height);
  }

  .project-copy {
    font: var(--type-body);
  }

  .project-gallery-copy {
    font: var(--type-body);
  }

  .project-gallery-image img,
  .project-gallery-image video {
    height: var(--project-open-media-height);
  }

  .project-gallery-map {
    height: var(--project-open-media-height);
  }
}

@media (max-width: 768px) {
  :root {
    --mobile-project-cover-fallback: calc((100vw - 36px) * 0.8065);
    --mobile-project-card-fallback: calc(var(--mobile-project-cover-fallback) + 63px);
  }

  html,
  body {
    overflow-x: hidden;
  }

  body {
    font: var(--type-body);
  }

  .site-header {
    grid-template-columns: 1fr auto;
    min-height: 62px;
    padding: 0 18px;
  }

  .brand {
    width: max-content;
  }

  .modular-logo {
    --logo-tile-size: clamp(17px, 4.8vw, 20px);
    --logo-gap: 2px;
  }

  .logo-tile img {
    transition-duration: 360ms;
  }

  .nav {
    grid-column: 1 / -1;
    order: 3;
    justify-content: flex-start;
    gap: 18px;
    padding: 0 0 14px;
    overflow-x: auto;
    font: var(--type-nav);
  }

  .project-search {
    width: max-content;
    gap: 9px;
    justify-self: end;
  }

  .search-field {
    width: clamp(78px, 24vw, 124px);
  }

  .search-mark {
    width: 13px;
    height: 13px;
    flex-basis: 13px;
  }

  .search-mark::after {
    width: 7px;
    right: -5px;
    bottom: -3px;
  }

  .search-input,
  .search-example {
    font: var(--type-nav);
  }

  .project-feed {
    padding: 24px 18px 74px;
  }

  .project-card {
    grid-template-columns: 1fr;
    gap: 11px;
  }

  .project {
    position: relative;
    padding: 12px 0 18px;
  }

  .mobile-open-caption {
    display: none;
  }

  .project-meta {
    order: 2;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    column-gap: 13px;
    row-gap: 4px;
    min-height: 0;
    align-items: center;
    text-align: left;
    padding-top: 0;
  }

  .project-mark {
    grid-row: 1 / span 2;
    width: 48px;
    height: 48px;
    margin-bottom: 0;
  }

  .project-mark.ring span {
    inset: 12px 7px;
    border-width: 5px;
  }

  .project-mark.plus span::before {
    width: 29px;
    height: 6px;
    left: 10px;
    top: 21px;
  }

  .project-mark.plus span::after {
    width: 6px;
    height: 29px;
    left: 21px;
    top: 10px;
  }

  .project-mark.bars span::before {
    width: 32px;
    height: 6px;
    left: 8px;
    top: 15px;
    box-shadow: 0 12px 0 var(--paper);
  }

  .project-mark.bars span::after {
    width: 14px;
    height: 6px;
    left: 17px;
    top: 27px;
  }

  .project-title {
    max-width: none;
    font: var(--type-title);
  }

  .project-place {
    grid-column: 2;
    margin-top: 0;
    font: var(--type-place);
  }

  .project-facts {
    grid-column: 1 / -1;
  }

  .project-cover {
    order: 1;
    overflow: visible;
  }

  .project-cover img,
  .project.is-open .project-cover img,
  .project-gallery-image video {
    width: 100%;
    max-width: 100%;
    aspect-ratio: auto;
    height: auto;
    object-fit: contain;
  }

  .project.is-open .project-facts {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    width: 100%;
    max-height: none;
    margin-top: 0;
  }

.project.is-open .project-share {
    max-height: none;
    margin-top: 22px;
    padding-top: 0;
  }

  .project-share__actions {
    justify-content: flex-start;
  }

  .project-copy {
    order: 3;
    grid-column: auto;
    width: min(84vw, 290px);
    max-width: 290px;
    font: var(--type-intro);
  }

  .project:not(.is-open) .project-copy {
    display: none;
  }

  .project-gallery-image,
  .project-gallery-copy,
  .project-gallery-map {
    width: 82vw;
  }

  .project-gallery-image img,
  .project-gallery-image video {
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: auto;
    object-fit: contain;
  }

  .project.is-open {
    padding: 12px 0 18px;
  }

  .project.is-open .project-card {
    display: flex;
    grid-template-columns: none;
    gap: 24px;
    align-items: flex-start;
    height: var(--mobile-project-card-height, var(--mobile-project-card-fallback));
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: pan-x pan-y;
    scroll-snap-type: none;
    padding-right: 18px;
    margin-right: -18px;
    cursor: grab;
    scrollbar-width: none;
    transition: none;
  }

  .project.is-open .project-card::-webkit-scrollbar {
    display: none;
  }

  .project.is-open .project-meta {
    order: 2;
    display: grid;
    grid-template-columns: 1fr;
    flex: 0 0 clamp(180px, 50vw, 220px);
    width: clamp(180px, 50vw, 220px);
    height: var(--mobile-project-cover-height, var(--mobile-project-cover-fallback));
    align-content: start;
    align-items: start;
    row-gap: 5px;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
  }

  .project.is-open .project-meta > .project-mark,
  .project.is-open .project-meta > .project-title,
  .project.is-open .project-meta > .project-place {
    display: none;
  }

  .project.is-open > .mobile-open-caption {
    position: absolute;
    z-index: 2;
    left: 0;
    top: calc(12px + var(--mobile-project-cover-height, var(--mobile-project-cover-fallback)) + 11px);
    display: grid;
    width: calc(100vw - 36px);
    grid-template-columns: 48px minmax(0, 1fr);
    column-gap: 13px;
    row-gap: 4px;
    align-items: center;
    pointer-events: none;
  }

  .mobile-open-caption .project-mark {
    grid-row: 1 / span 2;
    display: block;
    width: 48px;
    height: 48px;
    min-width: 48px;
    max-width: 48px;
    min-height: 48px;
    max-height: 48px;
    margin-bottom: 0;
    background: var(--accent);
    transform: none;
  }

  .mobile-open-caption .project-mark.ring span {
    inset: 12px 7px;
    border-width: 5px;
  }

  .mobile-open-caption .project-mark.plus span::before {
    width: 29px;
    height: 6px;
    left: 10px;
    top: 21px;
  }

  .mobile-open-caption .project-mark.plus span::after {
    width: 6px;
    height: 29px;
    left: 21px;
    top: 10px;
  }

  .mobile-open-caption .project-mark.bars span::before {
    width: 32px;
    height: 6px;
    left: 8px;
    top: 15px;
    box-shadow: 0 12px 0 var(--paper);
  }

  .mobile-open-caption .project-mark.bars span::after {
    width: 14px;
    height: 6px;
    left: 17px;
    top: 27px;
  }

  .mobile-open-caption .project-title {
    display: block;
    grid-column: 2;
    grid-row: 1;
    max-width: none;
    font: var(--type-title);
  }

  .mobile-open-caption .project-place {
    display: block;
    grid-column: 2;
    margin-top: 0;
    font: var(--type-place);
  }

  .project.is-open .project-meta::-webkit-scrollbar,
  .project.is-open .project-copy::-webkit-scrollbar,
  .project.is-open .project-gallery-copy::-webkit-scrollbar {
    display: none;
  }

  .project.is-open .project-title {
    grid-column: 2;
    grid-row: 1;
    margin-left: 0;
    padding-top: 0;
    max-width: none;
    font: var(--type-title);
  }

  .project.is-open .project-place {
    grid-column: 2;
    grid-row: 2;
    margin-left: 0;
    padding-top: 0;
    font: var(--type-place);
  }

  .project.is-open .project-facts {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
    gap: 13px;
    margin-top: 0;
  }

  .project.is-open .project-share {
    grid-column: 1;
    grid-row: 2;
  }

  .project.is-open .project-cover {
    order: 1;
    flex: 0 0 var(--mobile-project-cover-width, calc(100vw - 36px));
    width: var(--mobile-project-cover-width, calc(100vw - 36px));
    height: var(--mobile-project-cover-height, var(--mobile-project-cover-fallback));
    margin-left: 0;
  }

  .project.is-open .project-cover img {
    width: var(--mobile-project-cover-width, 100%);
    max-width: 100%;
    aspect-ratio: auto;
    height: var(--mobile-project-cover-height, var(--mobile-project-cover-fallback));
    object-fit: cover;
    transition: none;
  }

  .project.is-open .project-copy {
    order: 3;
    display: block;
    flex: 0 0 84vw;
    width: 84vw;
    max-width: none;
    max-height: none;
    min-height: 0;
    padding: 0;
    height: var(--mobile-project-cover-height, var(--mobile-project-cover-fallback));
    align-self: start;
    overflow-y: auto;
    overscroll-behavior: contain;
    font: var(--type-main-text);
  }

  .project.is-open .project-gallery-image,
  .project.is-open .project-gallery-copy,
  .project.is-open .project-gallery-map {
    order: 4;
    flex: 0 0 auto;
    width: auto;
    height: var(--mobile-project-cover-height, var(--mobile-project-cover-fallback));
    align-self: flex-start;
  }

  .project.is-open .project-gallery-map {
    flex-basis: 84vw;
    width: 84vw;
  }

  .project.is-open .project-gallery-copy {
    flex-basis: 84vw;
    width: 84vw;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .project.is-open .project-gallery-copy:not(.is-accent):not(.is-quote):not(.is-subhead):not(.is-caption),
  .project.is-open .project-gallery-copy.is-accent,
  .project.is-open .project-gallery-copy.is-quote,
  .project.is-open .project-gallery-copy.is-subhead,
  .project.is-open .project-gallery-copy.is-caption {
    flex: 0 0 84vw;
    width: 84vw;
    max-width: 84vw;
    padding-inline: 0;
    height: var(--mobile-project-cover-height, var(--mobile-project-cover-fallback));
    overflow-y: auto;
  }

  .project.is-open .project-gallery-copy:not(.is-accent):not(.is-quote):not(.is-subhead):not(.is-caption) {
    font: var(--type-main-text);
  }

  .project.is-open .project-gallery-copy.is-accent,
  .project.is-open .project-gallery-copy.is-quote {
    align-self: flex-start;
    font: 400 clamp(28px, 8vw, 36px) / 1.08 "Inter", sans-serif;
  }

  .project.is-open .project-gallery-copy.is-subhead {
    font: 400 14px / 18px "Inter", sans-serif;
  }

  .project.is-open .project-gallery-copy.is-caption {
    font: 400 12px / 14px "Inter", sans-serif;
  }

  .project-gallery-copy__author {
    margin-top: 28px;
    font: var(--type-caption);
  }

  .project.is-open .project-gallery-image img,
  .project.is-open .project-gallery-image video {
    width: auto;
    max-width: none;
    height: var(--mobile-project-cover-height, var(--mobile-project-cover-fallback));
    max-height: var(--mobile-project-cover-height, var(--mobile-project-cover-fallback));
    object-fit: contain;
  }

  .project.is-open .project-gallery-map iframe {
    height: var(--mobile-project-cover-height, var(--mobile-project-cover-fallback));
  }

  .project.is-open .project-meta,
  .project.is-open .project-cover,
  .project.is-open .project-copy,
  .project.is-open .project-gallery-image,
  .project.is-open .project-gallery-copy,
  .project.is-open .project-gallery-map {
    scroll-snap-align: none;
  }

  .project.is-open.is-content-revealed .project-facts,
  .project.is-open.is-content-revealed .project-share,
  .project.is-open.is-content-revealed .project-copy,
  .project.is-open.is-content-revealed .project-gallery-image,
  .project.is-open.is-content-revealed .project-gallery-copy,
  .project.is-open.is-content-revealed .project-gallery-map {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: none;
  }

  /* Mobile catalogue and the in-place horizontal project strip. */
  .site-header {
    min-height: 62px;
    align-items: center;
  }

  .site-header .nav {
    display: none;
  }

  .project-search {
    gap: 0;
    min-width: 20px;
  }

  .search-mark {
    width: 18px;
    height: 18px;
    flex-basis: 18px;
    stroke-width: 1.75;
  }

  .search-field {
    position: absolute;
    right: 18px;
    top: 62px;
    width: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: width 180ms ease, opacity 180ms ease;
  }

  .project-search:focus-within .search-field {
    width: min(210px, calc(100vw - 72px));
    opacity: 1;
    pointer-events: auto;
  }

  .project-feed {
    --mobile-gutter: 5vw;
    --mobile-card-width: 90vw;
    /* Gallery photos follow the cover width. Height is always natural. */
    --mobile-slide-width: var(--mobile-card-width);
    --mobile-copy-width: min(290px, calc(100vw - (var(--mobile-gutter) * 2)));
    padding: 24px var(--mobile-gutter) 74px;
  }

  .project.is-open {
    padding: 12px 0 26px;
  }

  .project.is-open > .mobile-open-caption {
    display: none;
  }

  .mobile-project-anchor {
    display: contents;
  }

  .mobile-project-facts {
    display: none;
  }

  .project:not(.is-open) .project-card {
    width: 100%;
    max-width: 100%;
    margin-inline: 0;
    overflow: visible;
  }

  .project:not(.is-open) .mobile-project-anchor {
    display: contents;
  }

  .project:not(.is-open) .project-cover,
  .project:not(.is-open) .project-cover img {
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0;
  }

  /* Closed cards contain only their cover and identity. The case slides must
     not reserve grid rows before the project is opened. */
  .project:not(.is-open) .project-copy,
  .project:not(.is-open) .project-gallery-image,
  .project:not(.is-open) .project-gallery-copy,
  .project:not(.is-open) .project-gallery-map {
    display: none;
  }

  .project.is-open .project-card {
    display: flex;
    flex-wrap: nowrap;
    gap: var(--mobile-gutter);
    align-items: start;
    height: auto;
    min-height: 0;
    width: 100vw;
    padding: 0;
    margin-left: calc(var(--mobile-gutter) * -1);
    margin-right: 0;
    overflow-x: auto;
    overflow-y: hidden;
    /* The selected card is positioned by script; snapping back to its start
       would cancel that editorial offset on tablet widths. */
    scroll-snap-type: none;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: pan-x pan-y;
  }

  .project.is-open .mobile-project-anchor {
    display: flex;
    flex: 0 0 var(--mobile-card-width);
    flex-direction: column;
    width: var(--mobile-card-width);
    min-width: 0;
  }

  .project.is-open .project-cover {
    order: 1;
    flex: 0 0 auto;
    width: 100%;
    height: auto;
    margin: 0;
    overflow: visible;
  }

  .project.is-open .project-cover img {
    width: 100%;
    height: auto;
    max-width: 100%;
    object-fit: contain;
  }

  .project.is-open .project-meta {
    order: 2;
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    column-gap: 13px;
    row-gap: 4px;
    width: 100%;
    height: auto;
    min-height: 0;
    padding: 12px 0 0;
    overflow: visible;
    text-align: left;
  }

  .project.is-open .project-meta > .project-mark,
  .project.is-open .project-meta > .project-title,
  .project.is-open .project-meta > .project-place {
    display: block;
  }

  .project.is-open .project-meta > .project-mark {
    grid-row: 1 / span 2;
    width: 48px;
    height: 48px;
    margin: 0;
    transform: none;
  }

  .project.is-open .project-title {
    grid-column: 2;
    grid-row: 1;
    font: var(--type-title);
  }

  .project.is-open .project-place {
    grid-column: 2;
    grid-row: 2;
    color: var(--muted);
    font: 400 11px / 14px "Inter", sans-serif;
    text-transform: uppercase;
  }

  .project.is-open .project-facts,
  .project.is-open .project-share {
    display: none;
  }

  .project.is-open .mobile-project-facts {
    display: flex;
    flex: 0 0 90px;
    flex-direction: column;
    align-self: flex-start;
    width: 90px;
    height: var(--mobile-project-cover-height, auto);
    min-height: 0;
    gap: 7px;
    padding: 0;
    color: var(--ink);
    font: 400 10px / 10px "Inter", sans-serif;
    text-align: left;
  }

  .project.is-open .mobile-project-facts span {
    display: grid;
    gap: 2px;
  }

  .project.is-open .mobile-project-facts b {
    color: var(--caption);
    font: inherit;
    text-transform: uppercase;
  }

  .project.is-open .mobile-project-share {
    display: grid;
    gap: 4px;
    margin-top: auto;
    padding: 0;
    overflow: visible;
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .project.is-open .mobile-project-share .project-share__label {
    display: block;
    color: var(--caption);
    font: 400 9px / 11px "Inter", sans-serif;
    text-transform: uppercase;
  }

  .project.is-open .mobile-project-share .project-share__actions {
    display: flex;
    gap: 2px;
    line-height: 0;
  }

  .project.is-open .mobile-project-share .project-share__button {
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
  }

  .project.is-open .project-copy,
  .project.is-open .project-gallery-image,
  .project.is-open .project-gallery-copy,
  .project.is-open .project-gallery-map {
    flex: 0 0 var(--mobile-slide-width);
    width: var(--mobile-slide-width);
    height: auto;
    min-height: 0;
    max-height: none;
    padding: 0;
    overflow: visible;
    align-self: start;
    scroll-snap-align: start;
  }

  .project.is-open .project-copy,
  .project.is-open .project-gallery-copy:not(.is-quote) {
    display: flex;
    flex-basis: var(--mobile-copy-width);
    width: var(--mobile-copy-width);
    padding: 0;
    font: var(--type-main-text);
    overflow: visible;
  }

  .project.is-open .project-gallery-copy.is-quote {
    display: flex;
    padding: 0;
    overflow: visible;
    font: 400 16px / 19px "Inter", sans-serif;
  }

  .project.is-open .project-gallery-image img,
  .project.is-open .project-gallery-image video {
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: none;
    object-fit: contain;
  }

  .project.is-open .project-gallery-map iframe {
    width: 100%;
    height: 243px;
  }

  .practice {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 22px 18px;
  }

  .footer {
    flex-direction: column;
    gap: 18px;
    padding-left: 18px;
    padding-right: 18px;
    font: var(--type-nav);
  }

  .footer__contacts {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

.project.is-open .project-share__actions {
  line-height: 0;
}

/*
 * Shared wide-layout system
 *
 * The gallery has one geometry at every non-mobile width.  Earlier rules
 * described the 769–1180px state as a collapsed desktop grid, while the
 * opened state still used the desktop media sizes.  That produced a 1900px
 * image inside a 1024px viewport.  These variables keep the closed cover,
 * opened cover and the following editorial fields on the same fluid grid.
 */
@media (min-width: 769px) {
  :root {
    --page-gutter: clamp(24px, 3vw, 38px);
    --closed-meta-width: clamp(170px, 15vw, 210px);
    --closed-cover-width: clamp(360px, 43vw, 560px);
    --open-meta-width: clamp(190px, 18vw, 330px);
    --open-copy-width: clamp(330px, 28vw, 370px);
    /* One shared media rail: cover and every gallery photo use this width.
       Their height stays natural, so portrait and landscape files keep their
       own proportions without appearing smaller than the cover. */
    --open-media-width: clamp(540px, 64vw, 925px);
    --open-media-height: clamp(360px, 42.7vw, 620px);
    --open-gutter: clamp(20px, 2.2vw, 42px);
  }

  .site-header {
    column-gap: clamp(20px, 3.6vw, 48px);
    padding-inline: var(--page-gutter);
  }

  .nav {
    gap: clamp(18px, 3.6vw, 48px);
  }

  .project-feed {
    width: min(100%, var(--max));
    padding-inline: var(--page-gutter);
  }

  .project-card {
    grid-template-columns: var(--closed-meta-width) minmax(0, var(--closed-cover-width));
    column-gap: clamp(26px, 3.6vw, 46px);
  }

  /* Closed cards contain only their identity and cover. Gallery slides must
     not reserve an implicit grid row before the project is opened. */
  .project:not(.is-open) .project-copy,
  .project:not(.is-open) .project-gallery-image,
  .project:not(.is-open) .project-gallery-copy,
  .project:not(.is-open) .project-gallery-map {
    display: none;
  }

  .project-cover,
  .project-cover img {
    inline-size: 100%;
    max-inline-size: 100%;
  }

  .project-cover img {
    block-size: auto;
    object-fit: contain;
    object-position: center center;
  }

  .project.is-open .project-card {
    grid-template-columns: var(--open-meta-width) max-content var(--open-copy-width);
    grid-auto-columns: max-content;
    column-gap: var(--open-gutter);
    justify-content: start;
    scroll-snap-type: none;
  }

  .project.is-open .project-meta {
    min-height: var(--open-media-height);
  }

  .project.is-open .project-cover {
    inline-size: var(--open-media-width);
    max-inline-size: var(--open-media-width);
    margin-left: 0;
  }

  .project.is-open .project-cover img {
    inline-size: 100%;
    max-inline-size: 100%;
    block-size: auto;
    height: auto;
    object-fit: contain;
    object-position: center center;
  }

  .project.is-open .project-copy,
  .project.is-open .project-gallery-copy:not(.is-quote) {
    inline-size: var(--open-copy-width);
    width: var(--open-copy-width);
    min-height: var(--open-media-height);
    padding-inline: clamp(34px, 3.2vw, 40px);
  }

  .project.is-open .project-gallery-image {
    inline-size: var(--open-media-width);
    max-inline-size: var(--open-media-width);
  }

  .project.is-open .project-gallery-image img,
  .project.is-open .project-gallery-image video {
    block-size: auto;
    height: auto;
    inline-size: 100%;
    width: 100%;
    max-inline-size: 100%;
    object-fit: contain;
    object-position: center center;
  }

  .project.is-open .project-gallery-map {
    block-size: var(--open-media-height);
    height: var(--open-media-height);
  }

  .practice,
  .footer {
    padding-inline: var(--page-gutter);
  }
}

/* Tablet is a real intermediate layout, not a compressed desktop. */
@media (min-width: 769px) and (max-width: 1180px) {
  :root {
    --closed-meta-width: clamp(160px, 18vw, 190px);
    --closed-cover-width: min(56vw, 560px);
    --open-meta-width: clamp(166px, 19vw, 230px);
    --open-copy-width: clamp(320px, 34vw, 360px);
    --open-media-width: clamp(540px, 64vw, 755px);
    --open-media-height: clamp(360px, 42.7vw, 505px);
    --open-gutter: clamp(18px, 2.6vw, 30px);
  }

  .project-feed {
    padding-top: clamp(30px, 4vw, 42px);
  }

  .project.is-open {
    padding-block: clamp(34px, 4vw, 46px) clamp(42px, 5vw, 58px);
  }

  .project.is-open .project-card {
    padding-bottom: clamp(20px, 3vw, 28px);
  }

  .project.is-open .project-meta > .project-mark {
    width: 58px;
    height: 58px;
    margin-bottom: 24px;
  }
}

/* Stage 2: page height and a single media coordinate system. */
body {
  display: flex;
  min-block-size: 100dvh;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
}

.project-gallery-map iframe {
  pointer-events: auto;
}

/* Desktop / wide editorial rail. All companion blocks use the actually
   rendered cover height, supplied by script.js after each open or resize. */
@media (min-width: 769px) {
  .project.is-open .project-copy,
  .project.is-open .project-gallery-copy:not(.is-quote) {
    block-size: var(--project-media-height, var(--open-media-height));
    min-block-size: var(--project-media-height, var(--open-media-height));
    overflow: hidden;
    touch-action: pan-x;
  }

  .project.is-open .project-gallery-copy.is-quote {
    block-size: var(--project-media-height, var(--open-media-height));
    min-block-size: var(--project-media-height, var(--open-media-height));
    justify-content: center;
    overflow: hidden;
    touch-action: pan-x;
  }

  .project.is-open .project-gallery-map {
    inline-size: var(--project-media-height, var(--open-media-height));
    block-size: var(--project-media-height, var(--open-media-height));
    width: var(--project-media-height, var(--open-media-height));
    height: var(--project-media-height, var(--open-media-height));
    aspect-ratio: 1;
    flex: 0 0 var(--project-media-height, var(--open-media-height));
  }

  .project.is-open .project-gallery-map iframe {
    inline-size: 100%;
    block-size: 100%;
  }
}

/*
 * Desktop order contract
 *
 * The project markup contains an old mobile wrapper with `display: contents`.
 * On intermediate desktop widths an older rule placed copy in column two,
 * while the cover was auto-placed. That made CSS Grid swap their positions
 * and then caused following gallery slides to share an implicit track.
 *
 * These rules deliberately establish one explicit desktop sequence:
 * meta → cover → introductory text → every following gallery slide.
 * Mobile rules below 769px keep their independent horizontal interaction.
 */
@media (min-width: 769px) {
  .project.is-open .project-card {
    display: grid;
    grid-template-columns: var(--open-meta-width) max-content var(--open-copy-width);
    grid-template-rows: max-content;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    align-items: start;
    justify-content: start;
    column-gap: var(--open-gutter);
    max-inline-size: 100%;
  }

  .project.is-open .project-meta {
    grid-column: 1;
    grid-row: 1;
  }

  .project.is-open .project-cover {
    grid-column: 2;
    grid-row: 1;
    inline-size: auto;
    max-inline-size: none;
    margin-inline-start: 0;
  }

  .project.is-open .project-cover img {
    display: block;
    inline-size: auto;
    width: auto;
    max-inline-size: none;
    block-size: var(--open-media-height);
    height: var(--open-media-height);
    object-fit: contain;
  }

  .project.is-open .project-copy {
    grid-column: 3;
    grid-row: 1;
  }

  .project.is-open .project-gallery-image,
  .project.is-open .project-gallery-copy,
  .project.is-open .project-gallery-map {
    grid-row: 1;
  }

  /* Every gallery image shares the cover's rendered height. Its own ratio
     determines width, so portrait and landscape source files never crop or
     overlap. */
  .project.is-open .project-gallery-image {
    inline-size: auto;
    width: auto;
    max-inline-size: none;
  }

  .project.is-open .project-gallery-image img,
  .project.is-open .project-gallery-image video {
    display: block;
    inline-size: auto;
    width: auto;
    max-inline-size: none;
    block-size: var(--project-media-height, var(--open-media-height));
    height: var(--project-media-height, var(--open-media-height));
    max-block-size: none;
    object-fit: contain;
  }
}

/* Compact project system: phones use the in-place horizontal strip.
   From 769px the single desktop grid takes over, with no competing rules. */
@media (max-width: 768px) {
  .project-feed {
    --mobile-gutter: 5vw;
    --mobile-card-width: 90vw;
    --mobile-copy-width: min(290px, calc(100vw - (var(--mobile-gutter) * 2)));
    --mobile-slide-width: var(--mobile-card-width);
    padding: 24px var(--mobile-gutter) 74px;
  }

  .project {
    padding: 12px 0 18px;
  }

  .project-card {
    display: grid;
    grid-template-columns: 1fr;
    gap: 11px;
    width: 100%;
  }

  .project-meta {
    order: 2;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    column-gap: 13px;
    row-gap: 4px;
    min-height: 0;
    align-items: center;
    padding-top: 0;
    text-align: left;
  }

  .project-mark {
    grid-row: 1 / span 2;
    width: 48px;
    height: 48px;
    margin: 0;
  }

  .project-title {
    max-width: none;
  }

  .project-place {
    grid-column: 2;
    margin-top: 0;
  }

  .project-cover {
    order: 1;
    overflow: visible;
  }

  .project-cover img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    object-position: center center;
  }

  .project:not(.is-open) .project-copy,
  .project:not(.is-open) .project-gallery-image,
  .project:not(.is-open) .project-gallery-copy,
  .project:not(.is-open) .project-gallery-map {
    display: none;
  }

  .project.is-open {
    padding: 12px 0 26px;
  }

  .project.is-open .project-card {
    display: flex;
    flex-wrap: nowrap;
    gap: var(--mobile-gutter);
    align-items: flex-start;
    width: 100vw;
    min-height: 0;
    height: auto;
    margin: 0 0 0 calc(var(--mobile-gutter) * -1);
    padding: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: none;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: pan-x pan-y;
  }

  .project.is-open .project-card::-webkit-scrollbar {
    display: none;
  }

  .project.is-open .mobile-project-anchor {
    display: flex;
    flex: 0 0 var(--mobile-card-width);
    flex-direction: column;
    width: var(--mobile-card-width);
    min-width: 0;
  }

  .project.is-open .project-cover {
    flex: 0 0 auto;
    inline-size: 100%;
    max-inline-size: 100%;
    width: 100%;
    margin: 0;
  }

  .project.is-open .project-meta {
    display: grid;
    flex: 0 0 auto;
    width: 100%;
    padding: 12px 0 0;
  }

  .project.is-open .project-facts,
  .project.is-open .project-share {
    display: none;
  }

  .project.is-open .mobile-project-facts {
    display: flex;
    flex: 0 0 90px;
    flex-direction: column;
    align-self: flex-start;
    width: 90px;
    height: var(--project-media-height, auto);
    gap: 7px;
    padding: 0;
    color: var(--ink);
    font: 400 10px / 10px "Inter", sans-serif;
    text-align: left;
  }

  .project.is-open .mobile-project-facts span {
    display: grid;
    gap: 2px;
  }

  .project.is-open .mobile-project-facts b {
    color: var(--caption);
    font: inherit;
    text-transform: uppercase;
  }

  .project.is-open .mobile-project-share {
    display: grid;
    gap: 4px;
    margin-top: auto;
  }

  .project.is-open .mobile-project-share .project-share__label {
    display: block;
    color: var(--caption);
    font: 400 9px / 11px "Inter", sans-serif;
    text-transform: uppercase;
  }

  .project.is-open .mobile-project-share .project-share__actions {
    display: flex;
    gap: 2px;
  }

  .project.is-open .mobile-project-share .project-share__button {
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
  }

  .project.is-open .project-copy,
  .project.is-open .project-gallery-copy:not(.is-quote) {
    display: flex;
    flex: 0 0 var(--mobile-copy-width);
    width: var(--mobile-copy-width);
    height: var(--project-media-height, auto);
    min-height: var(--project-media-height, auto);
    max-height: none;
    padding: 0;
    overflow: hidden;
    align-self: flex-start;
    font: var(--type-main-text);
    scroll-snap-align: start;
  }

  .project.is-open .project-gallery-copy.is-quote {
    display: flex;
    flex: 0 0 var(--mobile-copy-width);
    flex-direction: column;
    justify-content: center;
    width: var(--mobile-copy-width);
    height: var(--project-media-height, auto);
    min-height: var(--project-media-height, auto);
    padding: 0;
    overflow: hidden;
    font: 400 clamp(16px, 3.3vw, 22px) / 1.18 "Inter", sans-serif;
    scroll-snap-align: start;
  }

  .project.is-open .project-gallery-image {
    flex: 0 0 auto;
    height: var(--project-media-height, auto);
    scroll-snap-align: start;
  }

  .project.is-open .project-gallery-image img,
  .project.is-open .project-gallery-image video {
    display: block;
    width: auto;
    max-width: none;
    height: var(--project-media-height, auto);
    max-height: none;
    object-fit: contain;
    object-position: center center;
  }

  .project.is-open .project-gallery-map {
    display: block;
    flex: 0 0 var(--project-media-height, auto);
    width: var(--project-media-height, auto);
    height: var(--project-media-height, auto);
    min-height: 0;
    padding: 0;
    overflow: hidden;
    aspect-ratio: 1;
    scroll-snap-align: start;
  }

  .project.is-open .project-gallery-map iframe {
    width: 100%;
    height: 100%;
    pointer-events: auto;
  }
}

/* Modest high-density scaling. The reading measure stays capped. */
@media (min-width: 1921px) {
  :root {
    --max: clamp(1880px, 68vw, 2600px);
    --closed-meta-width: clamp(210px, 9vw, 290px);
    --closed-cover-width: clamp(560px, 20vw, 760px);
    --type-body: 400 clamp(14px, 0.42vw, 17px) / 1.3 "Inter", sans-serif;
    --type-title: 400 clamp(18px, 0.62vw, 24px) / 1.12 "Inter", sans-serif;
    --type-place: 400 clamp(14px, 0.44vw, 17px) / 1.35 "Inter", sans-serif;
    --type-nav: 400 clamp(12px, 0.38vw, 15px) / 1.3 "Inter", sans-serif;
    --type-main-text: 400 clamp(12px, 0.4vw, 16px) / 1.35 "Inter", sans-serif;
    --type-caption: 400 clamp(11px, 0.34vw, 14px) / 1.35 "Inter", sans-serif;
    --open-media-width: clamp(925px, 34vw, 1280px);
    --open-media-height: clamp(620px, 23vw, 860px);
    --open-copy-width: clamp(370px, 14vw, 470px);
    --page-gutter: clamp(38px, 3vw, 76px);
  }

  .modular-logo {
    --logo-tile-size: clamp(26px, 0.9vw, 34px);
  }

  .project.is-open .project-gallery-copy.is-quote {
    font: 400 clamp(22px, 0.9vw, 30px) / 1.12 "Inter", sans-serif;
  }
}

/*
 * Stable project rail
 *
 * Old iterations of the layout used both Grid and Flex for the open rail.
 * When a viewport crossed an intermediate breakpoint, the two placement
 * systems could disagree: an implicit grid column lost its gutter and a
 * following image appeared to touch, or visually cross, its neighbour.
 *
 * The rules below are the single placement contract for an OPEN project.
 * They intentionally use a one-dimensional flex rail on every viewport:
 * each photo, text field and map is one non-shrinking slide separated by the
 * same gap. The mobile anchor is only a structural wrapper for its cover and
 * passport; it remains a single slide on phones and disappears on desktop.
 */
@media (min-width: 769px) {
  .project.is-open .project-card {
    --rail-gap: clamp(18px, 2.2vw, 42px);
    display: flex;
    flex-flow: row nowrap;
    align-items: flex-start;
    gap: var(--rail-gap);
    width: 100%;
    max-width: none;
    min-width: 0;
    grid-template-columns: none;
    grid-template-rows: none;
    grid-auto-columns: auto;
    grid-auto-flow: unset;
    column-gap: var(--rail-gap);
    row-gap: 0;
    overflow-x: auto;
    overflow-y: hidden;
    isolation: isolate;
  }

  .project.is-open .mobile-project-anchor {
    display: contents;
  }

  .project.is-open .project-meta {
    flex: 0 0 var(--open-meta-width);
    min-width: 0;
    min-height: var(--open-media-height);
  }

  .project.is-open .project-cover,
  .project.is-open .project-gallery-image {
    flex: 0 0 auto;
    width: auto;
    min-width: max-content;
    max-width: none;
    margin: 0;
  }

  .project.is-open .project-cover img,
  .project.is-open .project-gallery-image img,
  .project.is-open .project-gallery-image video {
    display: block;
    width: auto;
    max-width: none;
    height: var(--open-media-height);
    max-height: none;
    object-fit: contain;
  }

  .project.is-open .project-copy,
  .project.is-open .project-gallery-copy:not(.is-quote) {
    flex: 0 0 var(--open-copy-width);
    width: var(--open-copy-width);
    min-width: 0;
    height: var(--open-media-height);
    min-height: var(--open-media-height);
  }

  .project.is-open .project-gallery-copy.is-quote {
    flex: 0 0 var(--editorial-text-field-width);
    width: var(--editorial-text-field-width);
    min-width: 0;
    height: var(--open-media-height);
    min-height: var(--open-media-height);
  }

  .project.is-open .project-gallery-map {
    flex: 0 0 var(--open-media-height);
    width: var(--open-media-height);
    height: var(--open-media-height);
    min-width: 0;
  }

  .project.is-open .project-copy,
  .project.is-open .project-gallery-image,
  .project.is-open .project-gallery-copy,
  .project.is-open .project-gallery-map {
    position: relative;
    z-index: 0;
    margin: 0;
  }
}

@media (max-width: 768px) {
  .project.is-open .project-card {
    --rail-gap: clamp(16px, 5vw, 24px);
    display: flex;
    flex-flow: row nowrap;
    align-items: flex-start;
    gap: var(--rail-gap);
    width: 100vw;
    min-width: 0;
    height: auto;
    margin: 0 0 0 calc(var(--mobile-gutter) * -1);
    padding: 0;
    column-gap: var(--rail-gap);
    row-gap: 0;
    overflow-x: auto;
    overflow-y: hidden;
    isolation: isolate;
  }

  .project.is-open .mobile-project-anchor {
    display: flex;
    flex: 0 0 var(--mobile-card-width);
    flex-direction: column;
    width: var(--mobile-card-width);
    min-width: 0;
  }

  .project.is-open .project-copy,
  .project.is-open .project-gallery-copy:not(.is-quote),
  .project.is-open .project-gallery-copy.is-quote {
    flex: 0 0 var(--mobile-copy-width);
    width: var(--mobile-copy-width);
    min-width: 0;
    height: var(--project-media-height);
    min-height: var(--project-media-height);
  }

  .project.is-open .project-gallery-image,
  .project.is-open .project-gallery-map {
    flex-shrink: 0;
    min-width: 0;
  }

  .project.is-open .project-copy,
  .project.is-open .project-gallery-image,
  .project.is-open .project-gallery-copy,
  .project.is-open .project-gallery-map {
    position: relative;
    z-index: 0;
    margin: 0;
  }
}

/* Mobile search stays inside the header: it replaces the logo in one row. */
@media (max-width: 768px) {
  .site-header {
    grid-template-columns: minmax(0, 1fr) auto;
    position: relative;
    overflow: hidden;
  }

  .site-header .brand {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    max-width: calc(100vw - 64px);
    overflow: hidden;
    opacity: 1;
    transform: translateX(0);
    transition:
      max-width 240ms var(--ease),
      opacity 160ms ease,
      transform 240ms var(--ease);
  }

  .site-header .project-search {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    display: flex;
    align-items: center;
    width: 20px;
    min-width: 20px;
    gap: 0;
    transition: width 240ms var(--ease), gap 240ms var(--ease);
  }

  .site-header .project-search .search-mark {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
  }

  .site-header .project-search .search-field {
    position: static;
    top: auto;
    right: auto;
    display: block;
    flex: 1 1 auto;
    width: 0;
    min-width: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 160ms ease;
  }

  .site-header:has(.project-search.is-focused) {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-header:has(.project-search.is-focused) .brand {
    max-width: 0;
    opacity: 0;
    transform: translateX(-12px);
    pointer-events: none;
  }

  .site-header:has(.project-search.is-focused) .project-search {
    grid-column: 1;
    justify-self: stretch;
    width: 100%;
    gap: 14px;
  }

  .site-header:has(.project-search.is-focused) .project-search .search-field {
    width: auto;
    opacity: 1;
    pointer-events: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .brand-arrow {
    animation: none;
  }

  .logo-tile img {
    transition: none;
  }

  .search-example {
    transition: none;
  }

  .project,
  .project-card,
  .project-meta,
  .project-cover img,
  .project-share,
  .project-copy,
  .project-gallery-image,
  .project-gallery-copy,
  .project-gallery-map {
    transition-duration: 120ms !important;
    animation-duration: 120ms !important;
  }

  .project.is-open.is-content-revealed .project-facts span {
    animation: none;
    opacity: 1;
    transform: none;
    clip-path: none;
  }
}
