.case-portfolio {
  padding-block: clamp(60px, 7vw, 124px);
  color: var(--ink);
}
.case-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 12px 32px;
  margin-bottom: clamp(26px, 3vw, 52px);
}
.case-heading h2 {
  font-size: clamp(36px, 5.15vw, 84px);
  font-weight: 540;
  letter-spacing: -.055em;
  line-height: 1.06;
}
.case-all {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  min-height: 44px;
  border-bottom: 1px solid currentColor;
  font-size: clamp(15px, 1.2vw, 19px);
  font-weight: 600;
  white-space: nowrap;
}
.case-mosaic {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(38px, 4.6vw, 78px);
}
.case-feature {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 5fr);
  grid-template-areas: "copy photo";
  gap: clamp(24px, 4vw, 76px);
  align-items: center;
  min-width: 0;
  border-top: 1px solid var(--line);
  padding-top: clamp(22px, 2.25vw, 42px);
}
.case-frame {
  grid-area: photo;
  position: relative;
  width: 100%;
  aspect-ratio: var(--photo-ratio, 3 / 2);
  overflow: hidden;
  background: var(--ice);
}
.case-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: var(--photo-finish);
}
.case-feature-copy {
  grid-area: copy;
  min-width: 0;
}
.case-feature-copy h3 {
  margin: 0;
  font-size: clamp(26px, 2.25vw, 37px);
  font-weight: 620;
  line-height: 1.13;
  letter-spacing: -.035em;
  text-wrap: pretty;
  overflow-wrap: anywhere;
}
.case-meta {
  margin: .65em 0 0;
  color: var(--muted);
  font-size: clamp(13px, 1vw, 16px);
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}
.case-tenants {
  margin: .27em 0 0;
  color: var(--ink);
  font-size: clamp(19px, 1.8vw, 29px);
  font-weight: 480;
  letter-spacing: -.027em;
  line-height: 1.22;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}
.case-link .link-arrow {
  width: .53em;
  height: .53em;
}
.case-link {
  display: flex;
  align-items: center;
  gap: .28em;
  max-width: 100%;
  min-height: 44px;
  border: 0;
  padding: 0;
  background: transparent;
  font: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  text-align: start;
  text-wrap: inherit;
  cursor: pointer;
}
.case-link:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 4px;
}
.case-dialog {
  --dialog-gap-y: 24px;
  --dialog-close-inset: 16px;
  position: fixed;
  inset: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  width: min(790px, calc(100% - 48px));
  width: min(790px, calc(100% - 48px), max(380px, 110dvh));
  max-width: calc(100% - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
  max-height: calc(100% - 2 * var(--dialog-gap-y));
  max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 2 * var(--dialog-gap-y));
  padding: 0;
  margin: auto;
  overflow: hidden;
  color: var(--ink);
  background: var(--paper);
  border: 0;
}
.case-dialog:not([open]) { display: none; }
.case-dialog::backdrop { background: rgb(12 23 46 / 76%); }
body.case-dialog-open { overflow: hidden; }
.case-dialog .dialog-body {
  position: relative;
  isolation: isolate;
  max-height: inherit;
  overflow: auto;
  overscroll-behavior: contain;
  scroll-padding-top: calc(44px + 2 * var(--dialog-close-inset));
}
.case-dialog .dialog-close {
  position: absolute;
  top: var(--dialog-close-inset);
  right: var(--dialog-close-inset);
  z-index: 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  background: var(--paper);
  border: 1px solid #10204475;
  border-radius: 50%;
  color: var(--ink);
  cursor: pointer;
}
.case-dialog .dialog-close:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; box-shadow: 0 0 0 2px var(--paper); }
.case-dialog-photo {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: var(--photo-finish);
}
.case-dialog-copy {
  padding: clamp(24px, 4vw, 55px);
}
.dialog-body > :first-child.case-dialog-copy { padding-top: 74px; }
.case-dialog-copy h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 52px);
  font-weight: 580;
  line-height: 1.08;
  letter-spacing: -.04em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.case-occupants { margin: clamp(16px, 2vw, 24px) 0 0; }
.case-occupants dt { margin-bottom: 5px; color: var(--muted); font-size: 13px; line-height: 1.4; }
.case-occupants dd {
  margin: 0;
  font-size: clamp(22px, 2.25vw, 31px);
  font-weight: 530;
  line-height: 1.2;
  letter-spacing: -.025em;
  overflow-wrap: anywhere;
}
.case-location { margin: 10px 0 clamp(17px, 2vw, 25px); color: var(--muted); font-size: clamp(14px, 1.15vw, 16px); line-height: 1.4; }
.case-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(23px, 3.4vw, 65px);
  row-gap: 16px;
  padding: 17px 0;
  margin: 0;
  border-block: 1px solid #1020444d;
}
.case-facts > :last-child { grid-column: 1 / -1; }
.case-facts dt { font-size: 13px; color: #4e5463; line-height: 1.5; }
.case-facts dd { margin: 3px 0 0; font-size: clamp(17px, 1.7vw, 24px); letter-spacing: -.035em; }
.case-story { margin: 23px 0 0; max-width: 53ch; font-size: clamp(16px, 1.3vw, 19px); line-height: 1.55; }
.case-contact {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 44px;
  border-bottom: 1px solid currentColor;
  margin-top: clamp(15px, 2vw, 28px);
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
}
.case-contact svg { width: 16px; height: 16px; }
@media (hover: hover) and (pointer: fine) {
  .case-all:hover, .case-contact:hover, .case-link:hover { color: #8d1955; }
  .case-dialog .dialog-close:hover { background: var(--accent); }
}
@media (prefers-reduced-motion: no-preference) {
  .case-dialog[open] { animation: case-open 210ms var(--ease-out); }
  .case-visible .case-frame { animation: case-frame-in 1250ms var(--ease-out); }
  @keyframes case-open { from { opacity: 0; transform: translateY(7px); } }
  @keyframes case-frame-in { from { opacity: .45; transform: translateY(13px); } }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .case-link:hover .link-arrow { transform: translate(2px, -2px); }
  .case-all:hover .link-arrow { transform: translate(2px, -2px); }
  .case-dialog .dialog-close { transition: background-color 160ms ease; }
}
@media (max-width: 900px) {
  .case-feature { grid-template-columns: minmax(0, 1fr); grid-template-areas: "copy" "photo"; gap: 18px; }
}
@media (max-width: 740px) {
  .case-portfolio { padding-block: 56px; }
  .case-heading { align-items: start; flex-direction: column; gap: 8px; }
  .case-heading h2 { max-width: 14ch; }
  .case-mosaic { gap: 40px; }
}
@media (max-width: 480px) {
  .case-dialog { --dialog-gap-y: 12px; --dialog-close-inset: 8px; width: calc(100% - 20px); }
  .case-facts { column-gap: 18px; }
  .case-region { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .case-facts dt { font-size: 12px; }
}
.case-dialog-figure {
  position: relative;
  width: 100%;
  aspect-ratio: var(--photo-ratio, 3 / 2);
  margin: 0;
  overflow: hidden;
  background: var(--ice);
}
.case-gallery-track {
  display: flex;
  align-items: flex-start;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.case-gallery-track::-webkit-scrollbar { display: none; }
.case-gallery-track .case-dialog-figure {
  flex: 0 0 100%;
  min-width: 0;
  scroll-snap-align: start;
}
.case-gallery-controls {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px clamp(16px, 3vw, 32px);
  border-bottom: 1px solid var(--line);
}
.case-gallery-controls p {
  flex: 1;
  color: var(--muted);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.case-photo-step {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
}
.case-photo-step::before {
  content: '';
  width: 9px;
  height: 9px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: translateX(-2px) rotate(45deg);
}
.case-photo-step[data-photo-previous]::before { transform: translateX(2px) rotate(225deg); }
.case-photo-step[aria-disabled="true"] { opacity: .4; cursor: default; }
@media (hover: hover) and (pointer: fine) {
  .case-photo-step:not([aria-disabled="true"]):hover { background: var(--accent); border-color: var(--accent); }
}

/* On wide screens the address and transaction details sit alongside the photos. */
@media (min-width: 1000px) {
  .case-dialog:has(.with-photos) { width: min(1180px, calc(100% - 96px)); }
  .dialog-body.with-photos {
    display: grid;
    grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr);
    align-items: center;
    gap: clamp(26px, 3.5vw, 58px);
    padding: clamp(36px, 4vw, 66px);
  }
  .with-photos .case-dialog-copy { padding: 0; }
  .with-photos .case-dialog-copy h2 {
    font-size: clamp(34px, 3.1vw, 49px);
  }
  .with-photos .case-facts { column-gap: 14px; }
  .with-photos .case-facts dd { font-size: 19px; }
  .with-photos .case-gallery-controls {
    padding: 5px 0;
    border-bottom: 0;
  }
}
