@media (600px <= width <= 700px) {
  main .detailgallery {
    column-count: 2;
    column-gap: 20px;
  }
}

.card-title-shadow {
  display: none;
}

@media (prefers-reduced-motion: no-preference) {
  .scroll-parallax {
    transform: translateY(var(--parallax-offset, 0px));
  }

  .photography-card .card-caption {
    --caption-copy-speed: 1.1;
    --caption-title-speed: 1.48;
    --title-depth-range: 32px;
    --caption-lift: calc((var(--caption-depth, 0) + 1) * .5);
    perspective: 680px;
    perspective-origin: 15% center;
  }

  .photography-card.scroll-parallax .card-caption > p {
    translate: 0 calc(var(--caption-offset, 0px) * var(--caption-copy-speed))
                 calc(3px + var(--caption-lift) * 6px);
    text-shadow: 0 1px 4px #f5f1e8, 0 2px 5px #332a2030;
  }

  .photography-card.scroll-parallax .card-caption > h3 {
    grid-area: 2 / 1;
    z-index: 1;
    translate: 0 calc(var(--caption-offset, 0px) * var(--caption-title-speed))
                 calc(8px + var(--caption-lift) * var(--title-depth-range));
    rotate: x calc(var(--caption-depth, 0) * 3deg);
    transform-origin: left center;
    text-shadow: 0 1px 2px #f5f1e8;
  }

  .photography-card.scroll-parallax .card-title-shadow {
    display: block;
    grid-area: 2 / 1;
    pointer-events: none;
    color: #382b20;
    opacity: calc(.43 - var(--caption-lift) * .14);
    --shadow-reach: calc(10px + var(--caption-lift) * 16px);
    translate: calc(var(--caption-light-x, 0) * var(--shadow-reach))
               calc(var(--caption-offset, 0px) * var(--caption-title-speed) + var(--caption-light-y, 0) * var(--shadow-reach));
    filter: blur(calc(1.4px + var(--caption-lift) * 3.6px));
    transform-origin: 15% center;
    scale: 1.035;
  }

  @media (max-width: 700px) {
    .photography-card > .card-image::after {
      background: radial-gradient(ellipse 100% 52% at 7% 86%, #f5f1e8f5, #f5f1e8c9 46%, transparent 100%);
    }

    .photography-card .card-caption {
      --caption-copy-speed: 1.3;
      --caption-title-speed: 1.95;
      --title-depth-range: 19px;
    }
  }

  .effects-ready .scroll-reveal {
    --scroll-distance: clamp(12px, 2vw, 24px);
    --scroll-duration: 600ms;
    transition: opacity var(--scroll-duration) var(--ease),
                translate var(--scroll-duration) var(--ease),
                scale var(--scroll-duration) var(--ease);
    transition-delay: var(--scroll-delay, 0ms);
  }

  .effects-ready .scroll-waiting {
    opacity: 0.18;
    translate: 0 var(--scroll-distance);
  }

  .effects-ready :is(.photography-card, .reportage-photo, .nature-opening, .about-photo, .widephoto).scroll-reveal {
    --scroll-duration: 740ms;
  }

  .effects-ready :is(.photography-card, .reportage-photo, .nature-opening, .about-photo, .widephoto).scroll-waiting {
    scale: 0.985;
  }

  .effects-ready .scroll-reveal:focus-within,
  .effects-ready[data-photo-transition] .photography-card.scroll-reveal {
    opacity: 1;
    translate: none;
    scale: none;
    transition: none;
  }

  @media (width > 700px) {
    main .detailgallery > .reportage-photo {
      /* Allow adjacent photos to approach each other while their frames stay separate. */
      margin-bottom: 46px;
    }

    main .detailgallery[data-reverse-parallax] > .reportage-photo {
      /* The faster column can close up to 126px of space between two photos. */
      margin-bottom: 128px;
    }
  }

  @media (max-width: 700px) {
    main .detailgallery > .reportage-photo {
      /* Leave room for both the parallax and the entrance movement. */
      margin-bottom: 50px;
    }

    main .photography-cards {
      row-gap: 54px;
    }
  }
}
