/* Hallmark: photographic project stories on a staggered stage. */
/* Critique: images carry the identity of each job, and only the current story takes reading focus. */
.project-stories {
  --story-ink: var(--ink);
  --story-muted: var(--muted);
  --story-highlight: var(--accent);
  --story-stage: var(--surface);
  --story-canvas: var(--canvas);
  --story-line: var(--line);
  --story-shadow: rgb(2 8 24 / .5);
  color: var(--story-ink);
  background: var(--story-stage);
  border-block: 1px solid var(--story-line);
  padding-block: clamp(3.2rem, 7vw, 6.8rem);
}

.project-stories-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .68fr);
  gap: 1.6rem clamp(1.75rem, 4vw, 4rem);
  align-items: end;
  padding-bottom: clamp(1.7rem, 3.4vw, 3.15rem);
  border-bottom: 1px solid var(--story-line);
}

.project-stories-heading h2 {
  min-width: 0;
  max-width: 12ch;
  overflow-wrap: break-word;
}

.project-stories-heading p {
  margin-top: .8rem;
  font-size: clamp(.93rem, 1.25vw, 1.12rem);
  color: var(--story-muted);
}

.project-stories-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(.8rem, 2vw, 2rem);
  margin: 0;
}

.project-stories-metrics div {
  display: flex;
  flex-direction: column-reverse;
  gap: .35rem;
  min-width: 0;
  border-inline-start: 1px solid var(--story-line);
  padding-inline-start: clamp(.75rem, 1.7vw, 1.45rem);
}

.project-stories-metrics dd {
  color: var(--story-highlight);
  font-weight: 780;
  font-size: clamp(2.1rem, 5.1vw, 4.45rem);
  line-height: .93;
  letter-spacing: -.045em;
  margin: 0;
}

.project-stories-metrics dt {
  color: var(--story-ink);
  font-size: clamp(.85rem, 1.3vw, 1.03rem);
  line-height: 1.35;
}

.project-carousel-window {
  padding: clamp(1.8rem, 4.6vw, 4.2rem) .08rem;
  overflow: clip;
}

.project-carousel-stage {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 1rem;
}

.project-story {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  background: var(--story-canvas);
  border-radius: .23rem .23rem .23rem 1.12rem;
  overflow: clip;
  box-shadow: 0 1.2rem 2.5rem var(--story-shadow);
}

.project-story > img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2.33;
  object-fit: cover;
}

.project-story-drink > img { object-position: center 56%; }
.project-story-cruze > img { object-position: center 58%; }
.project-story-victa > img { object-position: center 57%; }

.project-story-body {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: .55rem;
  min-width: 0;
  padding: clamp(.95rem, 2.15vw, 1.8rem);
}

.project-story .project-story-credit {
  color: var(--story-highlight);
  font-size: .87rem;
  font-weight: 620;
}

.project-story h3 {
  min-width: 0;
  font-size: clamp(1.55rem, 4vw, 2.8rem);
  line-height: 1.05;
  overflow-wrap: break-word;
}

.project-story p {
  max-width: 53ch;
  color: var(--story-muted);
  font-size: clamp(.91rem, 1.2vw, 1.05rem);
  line-height: 1.54;
}

.project-story a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  font-size: .88rem;
  font-weight: 730;
  color: var(--story-ink);
  text-decoration: underline;
  text-decoration-color: var(--story-highlight);
  text-underline-offset: .24em;
}

.project-story a:hover { color: var(--story-highlight); }
.project-carousel :is(a, button):focus-visible {
  outline: 2px solid var(--story-highlight);
  outline-offset: 3px;
}

.project-carousel[data-enhanced] .project-carousel-window {
  perspective: clamp(37rem, 85vw, 96rem);
  perspective-origin: center 48%;
  touch-action: pan-y pinch-zoom;
}

.project-carousel[data-enhanced] .project-carousel-stage {
  grid-template-columns: minmax(0, min(65%, 37rem));
  justify-content: center;
  gap: 0;
  transform-style: preserve-3d;
}

.project-carousel[data-enhanced] .project-story {
  grid-area: 1 / 1;
  align-self: start;
  transition: transform .58s var(--ease), opacity .45s var(--ease);
  opacity: .51;
}

.project-carousel[data-enhanced] .project-story-body {
  opacity: 0;
  transition: opacity .26s var(--ease);
}

.project-carousel[data-enhanced] .project-story[data-position="current"] .project-story-body {
  opacity: 1;
}

.project-carousel[data-enhanced] .project-story[data-position="previous"] {
  transform: translate3d(-69%, .9rem, -7.5rem) rotateY(36deg);
}

.project-carousel[data-enhanced] .project-story[data-position="next"] {
  transform: translate3d(69%, .9rem, -7.5rem) rotateY(-36deg);
}

.project-carousel[data-enhanced] .project-story[data-position="current"] {
  z-index: 1;
  opacity: 1;
  transform: translate3d(0, 0, 0) rotateY(0);
}

.project-carousel-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(.75rem, 3.2vw, 2.2rem);
}

.project-carousel-controls button {
  min-height: 2.75rem;
  color: var(--story-ink);
  background: none;
  border: 0;
  border-block-end: 1px solid var(--story-line);
  font-size: .94rem;
  font-weight: 700;
}

.project-carousel-controls button:hover {
  color: var(--story-highlight);
  border-color: var(--story-highlight);
}

.project-carousel-index {
  min-inline-size: 4ch;
  color: var(--story-muted);
  font-variant-numeric: tabular-nums;
  text-align: center;
  font-size: .86rem;
}

.project-carousel-index small {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: clip;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 48rem) {
  .project-stories-heading {
    grid-template-columns: minmax(0, 1fr);
  }

  .project-stories-metrics {
    max-width: 32rem;
  }

  .project-carousel[data-enhanced] .project-carousel-stage {
    grid-template-columns: minmax(0, 88.5%);
  }

  .project-carousel[data-enhanced] .project-story[data-position="previous"] {
    transform: translate3d(-57%, .45rem, -5.8rem) rotateY(30deg);
  }

  .project-carousel[data-enhanced] .project-story[data-position="next"] {
    transform: translate3d(57%, .45rem, -5.8rem) rotateY(-30deg);
  }

  .project-carousel-stage {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .project-carousel[data-enhanced] :is(.project-story, .project-story-body) {
    transition: none;
    transition-duration: 0s !important;
  }
}
