/* pinned-name-gallery: the property's name pinned mid-screen while its photos rise over it one per screen, each an
   arch-rise-photo frame placed left / right by shape; at the end the name's letters tip up and out one after another.
   Needs ../arch-rise-photo/part.css + part.js. Measured on Casa Momo's unit page at 1440 x 900 and 390 x 844. */
.png {
  --png-pad: 48px;                  /* page side margin (1344 content at 1440) */
  --png-head-gap: 256px;            /* pinned screen -> first photo */
  --png-gap: 320px;                 /* photo row -> next photo row */
  --png-col-gap: 12px;              /* the 4-column grid the frames sit on */
  --png-cap-gap: 12px;              /* frame -> caption */
  --png-head-pad: 32px;             /* kept free under the pinned name (96px on phones) */
  --png-name-size: 12.5vw;          /* 180px at 1440 */
  --png-name-lead: .95;
  --png-name-track: -.02em;
  --png-cap-size: 15px;
  --png-ink: #fff0ca;
  --png-chip: rgb(255 240 202 / .07);
  --png-font: "Lay Grotesk", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --png-bob: 2.4s;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--png-head-gap);
  padding: 0 var(--png-pad);
  color: var(--png-ink);
  font-family: var(--png-font);
}

/* the pinned screen: hint chip + name, centred in one window (32px kept free at the bottom, 96px on phones) */
.png-head {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 100vh;
  height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-bottom: var(--png-head-pad);
  box-sizing: border-box;
}
.png-hint { display: inline-flex; gap: 2px; font-size: 15px; line-height: 15px; }
.png-hint-key {
  width: 30px; height: 30px; display: grid; place-items: center;
  background: var(--png-chip); border-radius: 2px;
}
.png-hint-key svg { width: 14px; height: 14px; display: block; animation: png-bob var(--png-bob) cubic-bezier(.45, 0, .55, 1) infinite; }
.png-hint-text {
  display: inline-flex; align-items: center; height: 30px; box-sizing: border-box;
  padding: 7px 12px 8px; border-radius: 64px; background: var(--png-chip); color: rgb(255 240 202 / .8);
}
@keyframes png-bob {
  0% { translate: 0 -1.5px; }
  50% { translate: 0 3px; }
  100% { translate: 0 -1.5px; }
}
.png-name {
  margin: 0;
  max-width: 100%;
  font-weight: 400;
  font-size: var(--png-name-size);
  line-height: var(--png-name-lead);
  letter-spacing: var(--png-name-track);
  text-align: center;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: .28em;
}
/* each word in its own clip (the letters leave through its top edge) */
.png-mask {
  display: inline-flex;
  overflow: hidden;
  padding: 0 .06em 4px;
  margin: 0 -.06em -4px;
}
.png-w { display: inline-block; white-space: nowrap; }
.png-l { display: inline-block; white-space: pre; position: relative; transform-origin: 0% 100%; }

/* the photos: a 4-column grid; wide (3:2) spans 3, portrait (4:5) and square (1:1) span 2; sides alternate */
.png-list {
  position: relative;
  z-index: 2;                       /* photos pass over the pinned name */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--png-gap);
}
.png-item {
  --png-col: calc((100% - 3 * var(--png-col-gap)) / 4);
  margin: 0;
  width: calc(var(--png-col) * 2 + var(--png-col-gap));
}
.png-item[data-png-is="wide"] { width: calc(var(--png-col) * 3 + 2 * var(--png-col-gap)); }
.png-item[data-png-at="right"] { margin-left: auto; }
.png-item > img { display: block; width: 100%; height: auto; }   /* before the script wraps it (no JS) */
.png-item .arp { --arp-ratio: 3 / 2; }
.png-item[data-png-is="portrait"] .arp { --arp-ratio: 4 / 5; }
.png-item[data-png-is="square"] .arp { --arp-ratio: 1 / 1; }
.png-cap {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: var(--png-cap-gap);
  font-size: var(--png-cap-size);
  line-height: 1;
}
.png-count { display: inline-flex; gap: 3px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.png-of { opacity: .6; }
.png-tail { flex: none; }

/* phones: 12px sides, every frame 3/4 wide (keeps its own ratio), sides still alternate */
@media (max-width: 809.98px) {
  .png { --png-pad: 12px; --png-head-gap: 96px; --png-gap: 96px; --png-head-pad: 96px; --png-name-size: 56px; --png-cap-size: 13px; }
  .png-hint { font-size: 13px; line-height: 13px; }
  .png-hint-key { width: 28px; height: 28px; }
  .png-hint-text { height: 28px; padding: 7px 12px; }
  .png-item, .png-item[data-png-is="wide"] { width: calc(var(--png-col) * 3 + 2 * var(--png-col-gap)); }
}
@media (prefers-reduced-motion: reduce) {
  .png-hint-key svg { animation: none; }
  .png-l { translate: none !important; rotate: none !important; }
}
