main { padding-bottom: 72px; }
.introduction {
  position: relative;
  z-index: 1;
  text-wrap: balance;
}
.introduction.scroll-parallax { --photo-x: 0px; --photo-from: 0px; --scroll-start: 0px; }
.photographs { position: relative; margin-top: 55px; outline: none; }
.intro-line { display: block; }
.is-grid .introduction { margin-top: calc(var(--page-top) + 32px); }
.is-grid .photographs { margin-top: 88px; }
.message { margin: 100px 0; color: var(--quiet); font-size: 14px; }
.message a { text-decoration: underline; }
.message:empty { display: none; }
.is-loading .introduction, .is-loading .photograph { opacity: 0; }

/* MARK: - Photographs */

.photograph {
  position: absolute;
  top: 0;
  left: 0;
  margin: 0;
  transform-origin: 0 0;
}
.scroll-parallax {
  animation: photograph-parallax linear both;
  animation-timeline: scroll(root block);
  animation-range: var(--scroll-start) var(--scroll-end);
}
@keyframes photograph-parallax {
  from { transform: translate3d(var(--photo-x), var(--photo-from), 0); }
  to { transform: translate3d(var(--photo-x), var(--photo-to), 0); }
}
.print {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  text-align: inherit;
  overflow: hidden;
  background: transparent;
  appearance: none;
  box-shadow: none;
  isolation: isolate;
  cursor: pointer;
  touch-action: manipulation;
}
.print:focus { outline: none; }
.print img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  -webkit-user-drag: none;
  transition: filter 450ms ease;
}
.photographic-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.print img, .print .photographic-canvas, .print::after { scale: var(--press-scale, 1); }
.print::after {
  content: '';
  position: absolute;
  inset: 0;
  background: #e31308;
  mix-blend-mode: multiply;
  opacity: 0;
  pointer-events: none;
  transition: opacity 450ms ease;
}
@media (min-width: 701px) and (hover: hover) {
  .print:where(:not(:has(.is-developing))):is(:hover, :focus-visible)::after { opacity: 1; }
  .print:where(:not(:has(.is-developing))):is(:hover, :focus-visible) img { filter: grayscale(1) contrast(1.12) brightness(.88); }
}
figcaption {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-top: 12px;
  font-size: clamp(.875rem, 1.25vw, 1rem);
  line-height: 1.35;
  transition: opacity 250ms;
}
figcaption.is-detail-caption { opacity: 0; transition: none; }
.camera:empty { display: none; }
.caption-location { display: flex; flex-wrap: wrap; gap: 3px 6px; }
.caption-location > span { min-width: 0; overflow-wrap: anywhere; }
.place-name { display: none; }
figcaption span { transition: opacity 500ms ease-in-out; }
.camera, .coordinates { transition: opacity 220ms cubic-bezier(.16, 1, .3, 1); }
[data-legend='0'] figcaption { opacity: 0; visibility: hidden; }
[data-legend='1'] .caption-location, [data-legend='3'] .caption-location { opacity: .5; }
[data-legend='1'] .camera, [data-legend='3'] .camera { opacity: 0; }
[data-legend='3'] .coordinates { opacity: 0; }
[data-legend='3'] .place-name { display: block; }
@media (min-width: 701px) and (hover: hover) {
  :is([data-legend='1'], [data-legend='3']) .print:not(:has(.is-developing)):is(:hover, :focus-visible) + figcaption .camera { opacity: .5; transition: opacity 500ms ease-in-out; }
  [data-legend='3'] .print:not(:has(.is-developing)):is(:hover, :focus-visible) + figcaption .coordinates { opacity: 1; transition: opacity 500ms ease-in-out; }
}
.is-grid figcaption { display: none; }
.is-grid.is-changing-view figcaption { display: flex; position: absolute; top: 100%; left: 0; width: 100%; pointer-events: none; }
.is-captionless .photograph figcaption { display: none; }
.unavailable .print::before { content: 'View photograph'; position: absolute; inset: 45% 0 auto; text-align: center; font-size: 13px; }

/* MARK: - A closer look */

/* Hide only the scrollbar's paint. Keep its gutter and native scrolling so
   opening, returning and immediately scrolling cannot move the grid sideways. */
html:has(.detail[open]) { scrollbar-color: transparent transparent; }
html:has(.detail[open])::-webkit-scrollbar,
html:has(.detail[open])::-webkit-scrollbar-track,
html:has(.detail[open])::-webkit-scrollbar-thumb,
html:has(.detail[open])::-webkit-scrollbar-corner {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
html:has(.detail[open])::-webkit-scrollbar-button { display: none; }


html:has(.detail[open]) .print:not(.is-opening)::after { opacity: 0; transform: none; transition: none; }
html:has(.detail[open]) .print:not(.is-opening) img { transform: none; filter: none; transition: none; }
.print.is-opening::after { opacity: var(--opening-red); transform: none; transition: none; }
.print.is-opening img { filter: var(--opening-filter); transform: none; transition: none; }
.detail {
  --detail-paper: var(--paper);
  --detail-ink: rgba(36, 36, 34, .5);
  /* Fixed layers are clipped above Safari's floating toolbar. Stay in page
     coordinates for the whole interaction, including opening and return. */
  position: absolute;
  z-index: 10;
  inset: 0;
  width: 100%;
  max-width: none;
  min-height: 100vh;
  height: 100lvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  outline: none;
  color: var(--detail-ink);
  background: transparent;
  overflow: visible;
  overscroll-behavior: contain;
  touch-action: none;
}
.detail[data-background='black'] { --detail-paper: #000; --detail-ink: rgba(247, 247, 245, .5); }
.detail.is-closing, .detail.is-closing * { pointer-events: none; }
.detail > .detail-panel { z-index: 1; }
.detail-background {
  position: absolute;
  /* Cover the document visible behind Safari's bars as they expand/collapse.
     Only the paper extends; image fitting and controls keep their own bounds. */
  inset: calc(-1 * max(env(safe-area-inset-top, 0px), 100lvh - 100svh)) 0
    calc(-1 * max(env(safe-area-inset-bottom, 0px), 100lvh - 100svh));
  background: var(--detail-paper);
  pointer-events: none;
  transition: background-color 200ms;
}
.detail-ui { position: absolute; inset: 0 0 auto; height: 100dvh; z-index: 2; pointer-events: none; }
.detail-close { position: absolute; top: max(32px, calc(env(safe-area-inset-top) + 16px)); right: var(--edge); padding: 0; font-size: 16px; line-height: 1.35; pointer-events: auto; }
.detail-close::before { content: ''; position: absolute; inset: -12px; }
.detail-close:hover { color: color-mix(in srgb, var(--detail-ink) 65%, transparent); }
.detail-close { transition: color 180ms ease; }
.detail-info { position: absolute; left: var(--edge); bottom: max(44px, calc(env(safe-area-inset-bottom) + 24px)); min-height: 73px; max-width: calc(100% - 2 * var(--edge)); font-size: 16px; line-height: 1.35; }
.detail-info p { margin: 0; }
.detail-info p + p { margin-top: 4px; }
.detail-purchase { position: relative; display: block; width: fit-content; margin-top: 4px; pointer-events: auto; touch-action: manipulation; transition: color 180ms ease; }
.detail-purchase::before { content: ''; position: absolute; inset: -12px; }
.detail-purchase:hover { color: color-mix(in srgb, var(--detail-ink) 65%, transparent); }
.detail-info[inert] .detail-purchase { pointer-events: none; }
.detail-stage { position: absolute; inset: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; touch-action: none; outline: none; }
.detail[open] .detail-stage { overscroll-behavior: contain; }
.detail-stage::-webkit-scrollbar { display: none; }
.detail-stage.is-native { scroll-snap-type: x mandatory; }
.detail-track { position: relative; height: 100%; }
.detail-slot { position: absolute; top: 0; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; }
.detail-panel { position: absolute; inset: 0; pointer-events: none; will-change: transform; }
.detail-print { position: absolute; transform-origin: center; isolation: isolate; }
.detail-image { position: relative; display: block; width: 100%; height: 100%; object-fit: contain; -webkit-user-drag: none; }
.detail-tint { position: absolute; inset: 0; background: #e31308; mix-blend-mode: multiply; pointer-events: none; }

/* MARK: - Quiet navigation */

.home-return {
  display: flex;
  width: max-content;
  align-items: center;
  white-space: nowrap;
  color: rgb(36 36 34 / .5);
  cursor: pointer;
  transition: color 240ms cubic-bezier(.22, 1, .36, 1);
}
.home-return:focus-visible { color: var(--ink); }
@media (hover: hover) { .home-return:hover { color: var(--ink); } }

.locations {
  position: fixed;
  right: 0;
  top: 50%;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  width: 136px;
  padding: 40px 16px 40px 0;
  transform: translateY(-50%);
  transition: opacity 250ms, visibility 250ms;
}
.location {
  --bar-width: 12px;
  --bar-open: 44px;
  --reveal-delay: 0ms;
  --ease: cubic-bezier(.22, 1, .36, 1);
  position: relative;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  width: 64px;
  height: 10px;
  padding: 0;
}
.location::after {
  content: '';
  width: var(--bar-width);
  height: 1px;
  background: #b9b9b4;
  opacity: 0;
  transform: scaleX(.25);
  transform-origin: right;
  transition: width 560ms var(--ease), background 300ms,
    opacity 360ms ease var(--reveal-delay), transform 560ms var(--ease) var(--reveal-delay);
}
.location[aria-current='location'] { --bar-width: 24px; }
.location[aria-current='location']::after { background: var(--ink); }
.is-revealed .location::after { opacity: 1; transform: scaleX(1); }
.location span {
  position: absolute;
  right: calc(var(--bar-open) + 12px);
  white-space: nowrap;
  font-size: 16px;
  opacity: 0;
  transform: translateX(calc(var(--bar-open) - var(--bar-width)));
  pointer-events: none;
  transition: opacity 140ms cubic-bezier(.16, 1, .3, 1), transform 560ms var(--ease);
}
.location.is-hovered, .location:focus-visible { --bar-width: var(--bar-open); }
.location.is-hovered::after, .location:focus-visible::after { background: var(--ink); transition-delay: 0ms; }
.location.is-hovered span, .location:focus-visible span {
  opacity: 1;
  transition: opacity 360ms ease, transform 560ms var(--ease);
}

.announcement, .detail-status, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: fixed; top: 12px; left: 12px; z-index: 10; padding: 12px; background: var(--paper); }

@media (max-width: 700px) {
  .photographs { margin-top: 64px; }
  .is-grid .introduction { margin-top: calc(var(--page-top) + 24px); }
  .is-grid .photographs { margin-top: 80px; }
  .locations { display: none; }
  figcaption { padding-top: 8px; gap: 4px; font-size: 14px; }
  .detail-info, .detail-close { font-size: 14px; }
  .detail-info { min-height: 0; bottom: max(24px, calc(env(safe-area-inset-bottom) + 12px)); }
}

@media (any-pointer: coarse), (hover: none) {
  .locations { display: none; }
}


@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .scroll-parallax { animation: none; }
  *, *::before, *::after { transition: none !important; }
}
