.project-showcase {
  margin-top: clamp(1.75rem, 4vw, 3.25rem);
}

.showcase-options[hidden],
.showcase-panel[hidden],
.scene-viewer[hidden] {
  display: none;
}

.showcase-options {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: .9rem;
}

.showcase-options button,
.scene-controls button,
.scene-enlarge,
.scene-dialog-bar button {
  min-height: 44px;
  padding: .55rem .85rem;
  border: 1px solid currentColor;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: .875rem;
  line-height: 1.3;
  cursor: pointer;
}

.showcase-options button {
  border-color: var(--field-line);
  color: var(--navy);
}

.showcase-options button:hover {
  border-color: var(--navy);
}

.showcase-options button[aria-pressed="true"] {
  border-color: var(--copper);
  background: var(--copper);
  color: var(--paper);
}

.showcase-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, 27%);
  align-items: stretch;
  background: var(--navy);
  color: var(--paper);
}

.project-showcase:not(.showcase-ready) .showcase-panel + .showcase-panel {
  margin-top: 1.2rem;
}

.showcase-photo {
  position: relative;
  min-width: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--midnight);
}

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

.showcase-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: clamp(1.5rem, 3.6vw, 3.5rem);
}

.showcase-copy h3 {
  margin: .3rem 0 .65rem;
  color: inherit;
  font: var(--font-heading-weight) clamp(1.85rem, 3.2vw, 3.3rem)/1.1 var(--font-text);
  letter-spacing: -.035em;
  overflow-wrap: anywhere;
}

.showcase-location,
.showcase-types {
  margin: 0;
  color: var(--muted-on-dark);
  font-size: .9rem;
}

.showcase-copy .primary-link {
  margin-top: 1.35rem;
  border: 1px solid var(--line-on-dark);
  background: var(--copper-light);
  color: var(--midnight);
  font-size: .875rem;
}

.showcase-copy .primary-link:hover {
  background: var(--copper-highlight);
}

.project-story {
  --scene-top: 6.65rem;
  --scene-surface: var(--navy);
  --scene-border: var(--line-on-dark);
  --scene-accent: var(--copper-light);
  display: block;
  padding: clamp(1rem, 3vw, 3rem) 5%;
}

.project-story .project-steps {
  min-width: 0;
  margin: 0;
  pointer-events: auto;
}

.project-story .project-step {
  display: grid;
  min-height: auto;
  align-content: center;
  padding: 2rem 0;
}

.project-story .project-step .eyebrow {
  display: none;
}

.scene-inline-photo {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: 1.6rem;
}

.project-story .project-step p {
  max-width: 37rem;
  font-size: 1rem;
}

.scene-tour-ready {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  gap: clamp(1.25rem, 5vw, 6rem);
}

.scene-tour-ready .project-step {
  min-height: max(23rem, 55vh);
}

.scene-tour-ready .scene-inline-photo {
  display: none;
}

.scene-viewer {
  position: sticky;
  top: var(--scene-top);
  z-index: 2;
  align-self: start;
  min-width: 0;
  background: var(--scene-surface);
}

.scene-photo {
  position: relative;
  display: grid;
  height: min(53vh, 33rem);
  overflow: hidden;
  isolation: isolate;
  background: var(--midnight);
}

.scene-picture,
.scene-image {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.scene-image {
  display: block;
  object-fit: cover;
}

.scene-overlay {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: .5rem;
  padding: clamp(.55rem, 1.5vw, 1.35rem);
  background: linear-gradient(transparent, var(--image-scrim));
}

.scene-caption {
  margin: 0;
  color: white;
  font-size: clamp(.875rem, 1.8vw, 1.25rem);
  font-weight: 600;
  line-height: 1.2;
}

.scene-enlarge {
  flex-shrink: 0;
  border-color: var(--muted-on-dark);
  background: var(--image-scrim);
  color: white;
}

.scene-controls {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  padding-top: .6rem;
}

.scene-controls button,
.scene-dialog-bar button {
  border-color: var(--scene-border);
  color: var(--paper);
}

.scene-controls button:hover,
.scene-dialog-bar button:hover {
  border-color: var(--scene-accent);
}

.scene-controls button[aria-pressed="true"],
.scene-zoom[aria-pressed="true"] {
  border-color: var(--scene-accent);
  background: var(--scene-accent);
  color: var(--midnight);
}

.project-showcase :is(a, button):focus-visible,
.project-story :is(button, .scene-dialog-viewport):focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.scene-dialog {
  width: min(72rem, 96vw);
  max-width: 96vw;
  max-height: 95dvh;
  padding: .85rem;
  border: 1px solid var(--scene-border);
  background: var(--scene-surface);
  color: var(--paper);
}

.scene-dialog::backdrop {
  background: var(--image-scrim);
}

.scene-dialog-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: .6rem;
}

.scene-dialog-bar h2 {
  margin: 0;
  font: 625 clamp(1.1rem, 3vw, 1.8rem)/1.2 var(--font-text);
}

.scene-dialog-bar > div {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.scene-dialog-viewport {
  height: min(72dvh, 52rem);
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--midnight);
}

.scene-dialog-viewport img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.scene-zoomed img {
  width: max(130%, var(--image-width));
  height: auto;
  max-width: none;
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .showcase-photo img {
    transition: transform .27s ease-out;
  }

  .showcase-photo.depth-active img {
    transform: scale(1.07) perspective(1000px) rotateX(var(--depth-x)) rotateY(var(--depth-y));
  }
}

@media (prefers-reduced-motion: no-preference) {
  .scene-image {
    animation: scene-enter .42s ease-out;
  }

  @keyframes scene-enter {
    from { opacity: .65; transform: scale(1.025); }
    to { opacity: 1; transform: scale(1); }
  }
}

@media (max-width: 800px) {
  .showcase-panel {
    grid-template-columns: 1fr;
  }

  .showcase-copy {
    padding: 1.25rem;
  }

  .scene-tour-ready {
    display: block;
  }

  .scene-photo {
    height: min(38dvh, 22rem);
  }

  .scene-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: .45rem;
  }

  .scene-tour-ready .project-step {
    min-height: 18rem;
    padding: 1.5rem .4rem;
  }

  .project-story .project-step h2 {
    font-size: clamp(1.8rem, 6vw, 3rem);
  }
}

@media (max-width: 760px) {
  .project-story {
    --scene-top: 5.5rem;
  }
}

@media (max-height: 540px) and (max-width: 800px) {
  .scene-photo {
    height: 27dvh;
  }
}
