.map-stage { perspective: 1050px; }
.city-svg {
  transform: rotateX(var(--map-tilt, 0deg)) rotateY(var(--map-turn, 0deg)) scale(var(--zoom, 1));
  transition: transform .26s ease-out;
}
.map-building.is-previewed .building-body {
  transform: translateY(-8px);
  filter: drop-shadow(0 5px 13px #ffffff45);
}
.map-building.is-previewed .marker-ring { stroke: white; stroke-width: 2; }
.map-tooltip, .map-tooltip.visible {
  z-index: 4;
  left: auto;
  right: 5%;
  bottom: 14%;
  display: grid;
  grid-template-columns: 72px 1fr;
  width: min(255px, 38%);
  padding: 0;
  gap: 0;
  transform: translateY(7px);
  background: #09090aee;
}
.map-tooltip.visible { transform: translateY(0); }
.map-tooltip img { width: 100%; height: 100%; min-height: 86px; object-fit: cover; }
.map-tooltip > div { display: grid; align-content: center; gap: 4px; padding: 9px 13px; }
#tooltip-title { font: 18px/1.05 Georgia, serif; }
#tooltip-location { color: #bcbcbc; font: 8px var(--mono); }
#map-visited { font: 9px var(--mono); color: #b4b4b4; }
.station-strip {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  margin: 0 4% 30px;
  overflow-x: auto;
  border-block: 1px solid #333;
  scrollbar-width: thin;
}
.station-strip a {
  display: grid;
  gap: 6px;
  min-height: 96px;
  align-content: center;
  padding: 12px;
  border-right: 1px solid #333;
  transition: background .2s, color .2s;
}
.station-strip a:last-child { border: 0; }
.station-strip a:focus-visible { outline-offset: -3px; }
.station-strip a > span { font: 10px var(--mono); color: #aaa; }
.station-strip a.is-visited > span::after { content: ' · ✓'; color: #eee; }
.station-strip strong { font: 700 9px var(--mono); }
.station-strip small { font: 15px/1.05 Georgia, serif; }
.station-strip .is-previewed { background: #e7e7e7; color: #080808; }
.station-strip .is-previewed > span, .station-strip .is-previewed > span::after { color: #454545; }
.project-card img { filter: saturate(.35); }
.project-card:is(:hover, :focus-visible) img { filter: saturate(1); }

#panel.case-mode {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  border: 0;
  background: #060606;
  overscroll-behavior: contain;
}
.case-mode .close-panel {
  position: fixed;
  top: 14px;
  right: max(16px, 3vw);
  z-index: 6;
  background: #0a0a0af0;
  color: #eee;
}
.case-cover {
  position: relative;
  display: grid;
  align-items: end;
  min-height: min(84svh, 850px);
  overflow: hidden;
  isolation: isolate;
  border-bottom: 1px solid #333;
  background: radial-gradient(ellipse at 75% 52%, #242424, #070707 70%);
}
.case-cover .case-hero {
  position: absolute;
  inset: 0 0 0 auto;
  z-index: -2;
  width: 68%;
  height: 100%;
  max-height: none;
  object-fit: contain;
  background: none;
  mask-image: linear-gradient(90deg, transparent, black 24%);
}
.case-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(0deg, #050505 1%, #05050500 62%),
              linear-gradient(90deg, #050505 2%, #050505b0 38%, #05050500 76%);
}
.case-cover-content { width: min(72%, 960px); padding: 76px 0 clamp(42px, 7vh, 90px) 5%; }
.case-cover h2 {
  margin: 18px 0 24px;
  font: 400 clamp(53px, 9.2vw, 138px)/.86 Georgia, serif;
  letter-spacing: -.075em;
  text-wrap: balance;
  text-shadow: 0 4px 25px #0009;
}
.case-lede { max-width: 55ch; color: #e2e2e2; font-size: 15px; line-height: 1.65; }
.case-enter {
  display: inline-flex;
  align-items: center;
  gap: 20px;
  margin-top: 12px;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid #8a8a8a;
  background: transparent;
  font: 10px var(--mono);
  text-transform: uppercase;
}
.case-enter span { font: 20px Georgia, serif; }
.case-enter:hover { border-color: white; }
.case-cover-actions { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.case-film-link {
  padding: 7px 17px;
  border: 1px solid #dedede;
  background: #dedede;
  color: #090909;
}
.case-film-link:hover { background: #fff; }

.case-nav {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #080808f3;
  border-bottom: 1px solid #393939;
}
.case-nav-links {
  display: flex;
  overflow-x: auto;
  gap: 9px;
  min-height: 66px;
  align-items: center;
  padding: 9px max(5%, 20px);
  margin-right: 135px;
  scrollbar-width: thin;
}
.case-nav button {
  flex: none;
  min-height: 37px;
  padding: 8px 11px;
  border: 1px solid transparent;
  background: transparent;
  white-space: nowrap;
  color: #c3c3c3;
  font: 10px var(--mono);
}
.case-nav button span { margin-right: 5px; opacity: .7; }
.case-nav button:is(:hover, [aria-current]) { color: #fff; border-color: #6a6a6a; }
.case-nav button:focus-visible { outline-offset: -2px; }
.case-progress {
  position: absolute;
  inset: auto 0 -1px;
  height: 2px;
  background: #ddd;
  transform: scaleX(var(--case-progress, 0));
  transform-origin: left;
}
.case-mode .case-info { grid-template-columns: minmax(160px, 1fr) 3fr; padding-top: clamp(38px, 8vw, 108px); }
.case-mode .case-facts { align-self: start; }
.case-mode .case-story section {
  min-height: 190px;
  padding: 28px 0 40px;
  border-top: 1px solid #393939;
}
.case-mode .case-story section + section { margin-top: 0; }
.case-chapter-number { color: #aaa; font: 10px var(--mono); }
.case-mode .case-story h3 {
  max-width: 22ch;
  margin: 14px 0 16px;
  font-size: clamp(32px, 4.5vw, 63px);
  line-height: 1;
  letter-spacing: -.045em;
}
.case-gallery-section { padding: 36px 5% 58px; border-top: 1px solid #333; background: #0d0d0d; }
.case-film { padding: 38px 5% 58px; border-top: 1px solid #333; background: #0a0a0a; }
.case-film > header { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 16px; margin-bottom: 24px; }
.case-film h3 { margin: 8px 0 0; font: 400 clamp(39px, 6vw, 82px)/1 Georgia, serif; letter-spacing: -.06em; }
.case-film-duration { margin: 0; color: #c8c8c8; font: 11px var(--mono); }
.case-film video {
  display: block;
  width: min(100%, 1120px);
  aspect-ratio: 16 / 9;
  margin: auto;
  background: #000;
  object-fit: contain;
}
.case-gallery-section > header { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 24px; }
.case-gallery-section h3 { margin: 8px 0 0; font: 400 clamp(43px, 7vw, 88px)/1 Georgia, serif; letter-spacing: -.07em; }
.case-gallery-controls { display: flex; align-items: center; gap: 12px; font: 10px var(--mono); white-space: nowrap; }
.case-gallery-controls button { width: 42px; height: 42px; border: 1px solid #6a6a6a; border-radius: 50%; background: transparent; font-size: 18px; }
.case-gallery-controls button:disabled { opacity: .35; cursor: default; }
.case-gallery-controls button:hover:not(:disabled) { background: #ddd; color: #080808; }
.case-mode .case-gallery {
  --gallery-width: 77%;
  --gallery-gap: 16px;
  display: flex;
  overflow-x: auto;
  gap: var(--gallery-gap);
  padding: 0 0 15px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}
.case-mode .case-gallery::after { content: ''; flex: 0 0 calc(100% - var(--gallery-width) - var(--gallery-gap)); }
.case-mode .case-gallery figure { flex: 0 0 var(--gallery-width); min-width: 0; scroll-snap-align: start; }
.case-mode .case-gallery button:focus-visible { outline-offset: -4px; }
.case-mode .case-gallery img { height: clamp(225px, 62vh, 600px); object-fit: contain; }
.case-mode .case-gallery figcaption { font-size: 12px; }

@media (max-width: 760px) {
  .map-tooltip, .map-tooltip.visible { width: min(225px, 56%); right: 5%; bottom: 16%; }
  .station-strip { grid-template-columns: repeat(6, minmax(132px, 1fr)); }
  .case-cover { min-height: 78svh; }
  .case-cover .case-hero { width: 100%; height: 59%; bottom: auto; mask-image: linear-gradient(black 62%, transparent); }
  .case-cover::after { background: linear-gradient(0deg, #050505 24%, transparent 86%); }
  .case-cover-content { width: 100%; padding: 240px 6% 36px; }
  .case-cover h2 { font-size: clamp(48px, 12.5vw, 88px); }
  .case-lede { font-size: 13px; }
  .case-nav-links { margin-right: 105px; padding-inline: 12px; }
  .case-nav button { font-size: 9px; }
  .case-mode .close-panel { gap: 8px; padding-inline: 11px; }
  .case-mode .case-info { grid-template-columns: 1fr; }
  .case-mode .case-gallery { --gallery-width: 86%; --gallery-gap: 10px; }
  .case-gallery-controls { gap: 7px; }
  .case-gallery-controls button { width: 34px; height: 34px; }
}

@media (prefers-reduced-motion: no-preference) {
  .case-cover .case-hero { animation: case-image-in .8s ease-out both; }
  .case-cover-content { animation: case-content-in .65s .12s ease-out both; }
  @keyframes case-image-in {
    from { opacity: .3; transform: scale(1.09); }
    to { opacity: 1; transform: scale(1); }
  }
  @keyframes case-content-in {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
  }
  @supports (animation-timeline: view()) {
    .map-area .map-stage, .case-mode .case-story section {
      animation: enter-archive linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 85%;
    }
    @keyframes enter-archive {
      from { opacity: .35; transform: translateY(32px); }
      to { opacity: 1; transform: translateY(0); }
    }
  }
}
