/* A quiet editorial finish. Hero transitions and page content stay unchanged. */

/* Balance short headings without forcing line breaks at individual widths. */
:is(.pcard h3, .sec-head h2, .about-page h1, .about-page h2,
    .about-case h3, .origin-grid h2, .story-body h3) {
  text-wrap: balance;
  word-break: keep-all;
}
:is(.slide-sum, .sec-head > p, .about-hero-description, .about-lead p) {
  text-wrap: pretty;
}

/* Keep the card still; its photograph carries the small hover response. */
.pcard {
  transition: border-color .25s ease, box-shadow .25s ease;
}
.pcard:hover {
  transform: none;
  box-shadow: none;
}
.pcard-media {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  overflow: clip;
  background: var(--ivory-2);
}
.pcard-media .pcard-img {
  display: block;
  width: 100%;
  height: 100%;
  transition: transform .75s cubic-bezier(.2,.65,.3,1);
}
.pcard .go {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.about-scroll > span {
  transition: transform .3s cubic-bezier(.2,.65,.3,1);
}
.pcard:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}
@media (hover: hover) and (pointer: fine) {
  .pcard:hover {
    border-color: var(--accent-line, #aeb5d6);
    box-shadow: 0 8px 24px rgb(0 0 0 / .045);
  }
  .pcard:hover .pcard-img { transform: scale(1.035); }
  .about-scroll:hover > span { transform: translateY(3px); }
}
.pcard:focus-visible .pcard-img { transform: scale(1.035); }

/* A stable window reserves space before loading and keeps captions stationary. */
.photo-window {
  position: relative;
  overflow: hidden;
  overflow: clip;
  aspect-ratio: 5 / 4;
  border-radius: 3px;
  background: var(--ivory-2);
}
.city-chapter .photo-window { aspect-ratio: 4 / 5; }
.about-case .photo-window { aspect-ratio: 16 / 10; }
.photo-window > img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  object-fit: cover;
  border-radius: 0;
}

/* Optional enhancement: unsupported browsers retain the static photograph.
   The timeline belongs to the untransformed frame, never to the moving image. */
@supports (animation-timeline: view()) {
  @media (min-width: 901px) and (prefers-reduced-motion: no-preference) {
    /* overflow:hidden would make body the nearest, non-scrolling timeline. */
    body:is(.program-story, .about-page) { overflow-x: clip; }
    .photo-window { view-timeline: --photo-window block; }
    .photo-window > img {
      animation: editorial-photo-drift 1s linear both;
      animation-timeline: --photo-window;
      animation-range: cover 0% cover 100%;
    }
  }
}
@keyframes editorial-photo-drift {
  from { transform: scale(1.055) translateY(-1.7%); }
  to { transform: scale(1.055) translateY(1.7%); }
}
@media (max-width: 700px) {
  :is(.story-visual, .city-chapter) .photo-window { aspect-ratio: 4 / 3; }
}
@media (prefers-reduced-motion: reduce) {
  .pcard,
  .pcard-media .pcard-img,
  .about-scroll > span { transition: none; }
  .pcard:is(:hover, :focus-visible) .pcard-img,
  .about-scroll:hover > span { transform: none; }
}
