/* Keep the washi and its brocade still while the foreground passes over it. */
.kakemono[data-scroll-stage] { background: #eed0a3; }
.kakemono[data-scroll-stage]::before,
.kakemono[data-scroll-stage]::after { display: none; }
.kakemono-backdrop {
  position: sticky;
  top: 0;
  z-index: 0;
  height: 100vh;
  height: 100svh;
  margin-bottom: -100vh;
  margin-bottom: -100svh;
  pointer-events: none;
  background: linear-gradient(90deg, rgb(92 56 28 / .13), rgb(248 229 193 / .28) 16%, rgb(255 239 210 / .34) 58%, rgb(248 229 193 / .22) 87%, rgb(92 56 28 / .12)),
    var(--paper-grain) center top / clamp(500px, 54vw, 740px) auto repeat #eed0a3;
}
.kakemono-backdrop::before,
.kakemono-backdrop::after {
  content: "";
  position: absolute;
  inset-block: 0;
  width: var(--brocade-edge);
  background: var(--side-brocade) center top / 100% auto repeat-y #2e3944;
  border-inline: 1px solid #947144;
}
.kakemono-backdrop::before { left: 0; }
.kakemono-backdrop::after { right: 0; }
.kakemono[data-scroll-stage] > .section { position: relative; z-index: 1; }
.kakemono[data-scroll-stage] .history[data-history-art="5"] .history-art {
  aspect-ratio: 3 / 4;
  overflow: visible;
  margin-bottom: clamp(64px, 9vw, 126px);
}
.kakemono[data-scroll-stage] .history[data-history-art="5"] .history-art > img {
  object-fit: cover;
  aspect-ratio: 3 / 4;
  mix-blend-mode: multiply;
}
.kakemono[data-scroll-stage] .history-art .history-calligraphy {
  inset: 24% 0 auto;
  top: 24%;
  right: 0;
  bottom: auto;
  left: 0;
  aspect-ratio: 100 / 75;
  translate: none;
}
.kakemono[data-scroll-stage] .history-calligraphy-art {
  top: -25%;
  right: 0;
  bottom: auto;
  left: 0;
  mix-blend-mode: multiply;
}
/* Keep a measurable animation surface in older iPad Safari. */
@supports not (aspect-ratio: 1 / 1) {
  .kakemono[data-scroll-stage] .history-art .history-calligraphy {
    height: 0;
    padding-top: 75%;
  }
}
@supports not (translate: 0px) {
  .kakemono[data-scroll-stage] [data-kakemono-float] {
    transform: translate(var(--float-x, 0px), var(--float-y, 0px));
  }
  .kakemono[data-scroll-stage] .history-art .history-calligraphy { transform: none; }
}
.kakemono[data-scroll-stage] .history-milestones { padding-block: 26px 40px; }
.kakemono[data-scroll-stage] .works { overflow: visible; }
.kakemono[data-scroll-stage] .exhibition-photos {
  --work-column-gap: clamp(35px, 10vw, 150px);
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(75px, 12vw, 170px) clamp(35px, 10vw, 150px);
  padding-block: 50px 80px;
  align-items: start;
}
/* Retain the previous artwork widths while centering each on the scroll. */
.kakemono[data-scroll-stage] .work-card { grid-column: 1; justify-self: center; margin-top: 0; }
.kakemono[data-scroll-stage] .work-scroll { width: calc((100% - var(--work-column-gap)) * .88 / 1.88 * .82); }
.kakemono[data-scroll-stage] .work-flag { width: calc((100% - var(--work-column-gap)) / 1.88); }
.kakemono[data-scroll-stage] .work-daruma {
  width: calc((100% - var(--work-column-gap)) / 1.88 * .85);
  margin-top: clamp(28px, 4vw, 56px);
}
.kakemono[data-scroll-stage] [data-kakemono-float] {
  translate: var(--float-x, 0px) var(--float-y, 0px);
}
@media (max-width: 790px) {
  .kakemono[data-scroll-stage] .exhibition-photos {
    grid-template-columns: minmax(0, 1fr);
    gap: 94px;
    padding-block: 30px 58px;
  }
  .kakemono[data-scroll-stage] .work-scroll { width: 79%; }
  .kakemono[data-scroll-stage] .work-flag { width: 96%; }
  .kakemono[data-scroll-stage] .work-daruma { width: 86%; }
  .kakemono[data-scroll-stage] .history-milestones { padding-block: 10px 28px; }
}
@media (prefers-reduced-motion: reduce) {
  html:not(.preview-motion-enabled) .kakemono[data-scroll-stage] [data-kakemono-float] { translate: none; }
}
html.preview-motion-paused .kakemono[data-scroll-stage] [data-kakemono-float] { translate: none; }

/* The original ink and crow stay on the paper behind the scrolling content.
   A sticky, clipped layer confines both motifs to this hanging scroll. */
.history-calligraphy[data-ink-state="static"] .history-calligraphy-art {
  visibility: hidden;
}
.kakemono-echo {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 100vh;
  height: 100svh;
  margin-bottom: -100vh;
  margin-bottom: -100svh;
  overflow: clip;
  clip-path: inset(0 var(--brocade-edge));
  pointer-events: none;
  user-select: none;
  opacity: 0;
  mix-blend-mode: multiply;
}
.kakemono-echo > svg {
  position: absolute;
  display: block;
  max-width: none;
  overflow: visible;
}
.kakemono-echo .kakemono-echo-crow { overflow: hidden; opacity: .22; }
.kakemono[data-scroll-stage] > .section,
.kakemono[data-scroll-stage] .history[data-history-art="5"] {
  z-index: auto;
  isolation: auto;
}
.kakemono[data-scroll-stage] .history-layout,
.kakemono[data-scroll-stage] :is(.works, .news) > .frame {
  position: relative;
  z-index: 2;
}
.kakemono[data-scroll-stage] .history-art .history-calligraphy { z-index: 2; }
