.photographer-collage {
  padding-block: clamp(1.8rem,3.3vw,4rem);
  background: var(--canvas);
  color: var(--ink);
  overflow: clip;
}

.collage-layout {
  position: relative;
  width: min(100%,112rem);
  height: clamp(35rem,53.6vw,60rem);
  margin-inline: auto;
  display: grid;
  place-items: center;
}

.collage-intro {
  position: relative;
  z-index: 1;
  text-align: center;
}

.collage-intro h2 {
  font: 400 clamp(4.5rem,8.8vw,10rem)/.94 var(--serif);
  letter-spacing: -.045em;
}

.collage-intro p {
  font: 400 1rem/1.4 var(--sans);
  color: var(--soft);
  margin-top: 1rem;
}

.collage-intro .text-link {
  margin-top: .3rem;
}

.collage-prints {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(48,minmax(0,1fr));
  grid-template-rows: repeat(32,minmax(0,1fr));
  pointer-events: none;
}

.collage-print {
  --ratio: 4 / 5;
  align-self: start;
  min-width: 0;
  transform: translate(calc(var(--drift-x,0px) * var(--depth,1)),calc(var(--drift-y,0px) * var(--depth,1)));
  transition: transform .35s ease-out;
}

.collage-print img {
  width: 100%;
  height: auto;
  aspect-ratio: var(--ratio);
  object-fit: cover;
  object-position: var(--crop,50% 45%);
}

.collage-print figcaption {
  margin-top: .4rem;
  font: 400 .75rem/1.22 var(--sans);
  color: var(--soft);
}

.collage-print:nth-child(1)  { grid-column: 2 / span 5; grid-row: 2; }
.collage-print:nth-child(2)  { grid-column: 9 / span 5; grid-row: 1; --ratio: 3 / 2; --depth: -.55; }
.collage-print:nth-child(3)  { grid-column: 15 / span 4; grid-row: 3; --depth: .5; }
.collage-print:nth-child(4)  { grid-column: 21 / span 5; grid-row: 1; --ratio: 3 / 2; --depth: -.7; }
.collage-print:nth-child(5)  { grid-column: 28 / span 4; grid-row: 3; }
.collage-print:nth-child(6)  { grid-column: 35 / span 5; grid-row: 1; --ratio: 1; --depth: -.5; }
.collage-print:nth-child(7)  { grid-column: 42 / span 6; grid-row: 3; --depth: .6; }
.collage-print:nth-child(8)  { grid-column: 2 / span 5; grid-row: 14; --ratio: 5 / 4; --crop: 50% 30%; --depth: -.6; }
.collage-print:nth-child(9)  { grid-column: 43 / span 5; grid-row: 15; --ratio: 4 / 5; }
.collage-print:nth-child(10) { grid-column: 5 / span 6; grid-row: 23; --ratio: 1; --depth: .6; }
.collage-print:nth-child(11) { grid-column: 21 / span 5; grid-row: 25; --ratio: 1; --crop: 50% 30%; --depth: -.6; }
.collage-print:nth-child(12) { grid-column: 36 / span 6; grid-row: 24; --ratio: 5 / 4; }

@media(max-width:700px) {
  .photographer-collage { padding-block: 1.75rem; }
  .collage-layout { width: min(100%,31rem); height: clamp(35rem,152vw,46rem); }
  .collage-intro h2 { font-size: clamp(3.1rem,12vw,5.3rem); }
  .collage-intro p { margin-top: .6rem; }
  .collage-print figcaption { display: none; }
  .collage-print:nth-child(1)  { grid-column: 3 / span 12; grid-row: 3; }
  .collage-print:nth-child(2)  { grid-column: 18 / span 9; grid-row: 2; }
  .collage-print:nth-child(3)  { grid-column: 31 / span 7; grid-row: 3; }
  .collage-print:nth-child(4)  { grid-column: 40 / span 7; grid-row: 1; }
  .collage-print:nth-child(5)  { grid-column: 18 / span 8; grid-row: 7; }
  .collage-print:nth-child(6)  { grid-column: 34 / span 10; grid-row: 8; }
  .collage-print:nth-child(7)  { grid-column: 2 / span 10; grid-row: 22; }
  .collage-print:nth-child(8)  { grid-column: 14 / span 9; grid-row: 24; }
  .collage-print:nth-child(9)  { grid-column: 26 / span 10; grid-row: 21; }
  .collage-print:nth-child(10) { grid-column: 38 / span 9; grid-row: 23; }
  .collage-print:nth-child(11) { grid-column: 7 / span 7; grid-row: 29; }
  .collage-print:nth-child(12) { grid-column: 31 / span 9; grid-row: 28; }
}

@media(prefers-reduced-motion:reduce) {
  .collage-print { transform: none; transition: none; }
}

.photo-archive {
  --archive-card: min(76vw, 57svh, 24rem);
  position: relative;
  background: var(--canvas);
}

.archive-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.archive-frames {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0;
  padding: clamp(1.5rem, 6svh, 3.25rem) var(--gutter);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  list-style: none;
}

.archive-frame {
  flex: 0 0 var(--archive-card);
  width: var(--archive-card);
  aspect-ratio: 8 / 11;
  scroll-snap-align: start;
}

.archive-frame a,
.archive-frame img {
  display: block;
  width: 100%;
  height: 100%;
}

.archive-frame a {
  position: relative;
}

.archive-frame img {
  object-fit: cover;
  background: var(--canvas);
}

.archive-frame a:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

/* Snap to the focused photograph when tabbing through the filmstrip. */
.archive-frames:has(a:focus-visible) .archive-frame:not(:focus-within) {
  scroll-snap-align: none;
}

.photo-archive[data-enhanced] {
  --archive-card: min(42svh, clamp(13rem, 22.3vw, 25rem));
  height: 400svh;
}

.photo-archive[data-enhanced] .archive-stage {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
}

.photo-archive[data-enhanced] .archive-frames {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: visible;
}

.photo-archive[data-enhanced] .archive-frame {
  position: absolute;
  left: 50%;
  top: 50%;
  transform-origin: 50% 100%;
}
