/* The chapter cue is outside the canvas so asset replacement cannot erase it. */
html.native-story-scroll .story-panel-date.relief-ready > .relief-chapter-label {
  position: absolute;
  top: clamp(16px, 2.8svh, 25px);
  left: 8.2%;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  width: auto;
  margin: 0;
  padding: 0;
  color: #997548;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: .18em;
  writing-mode: horizontal-tb;
  pointer-events: none;
}

.relief-chapter-label::before {
  content: "";
  width: 22px;
  border-top: 1px solid currentColor;
}

.relief-chapter-label.is-arrived {
  animation: relief-chapter-ink 2.8s ease-in-out both;
}

@keyframes relief-chapter-ink {
  0%, 100% { color: #997548; }
  18%, 68% { color: #9e3b2c; text-shadow: 0 0 .35px currentColor; }
}

html.native-story-scroll .native-scroll-root .story-panel-ending.native-ending-page.closing-paper-finale {
  container-type: inline-size;
  position: relative !important;
  isolation: isolate;
  display: flex !important;
  align-items: center;
  justify-content: center;
  min-height: 100svh !important;
  height: auto !important;
  padding: clamp(76px, 10svh, 112px) 8% max(64px, env(safe-area-inset-bottom)) !important;
  overflow: hidden;
  color: #62462e;
  background: #f6eedf url("./relief/paper.webp") center / cover no-repeat !important;
}

html.native-story-scroll .native-scroll-root .closing-paper-finale > .reveal {
  display: block !important;
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: none;
  padding: 0;
  margin: 0;
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
}

.closing-paper-finale .ink-bloom,
.closing-paper-finale .ending-mark {
  display: none !important;
}

.closing-keepsake {
  display: grid;
  justify-items: center;
  width: 100%;
  text-align: center;
}

.closing-heading {
  position: relative;
  width: fit-content;
  max-width: 100%;
  padding: 0 12px;
}

html.native-story-scroll .native-scroll-root .closing-paper-finale .closing-heading h2 {
  margin: 0;
  color: #62472f;
  font-family: "Wedding Closing Brush", "Kaiti SC", "STKaiti", serif;
  font-size: clamp(42px, 15.5cqw, 70px);
  font-weight: 400;
  font-synthesis: none;
  line-height: 1.3;
  letter-spacing: .07em;
  text-indent: .07em;
  white-space: nowrap;
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
  text-shadow: none;
}

.closing-small-seal {
  position: absolute;
  right: -7px;
  bottom: 8px;
  width: 15px;
  height: 24px;
  object-fit: contain;
}

.closing-corner-branch {
  position: absolute;
  top: -28px;
  right: -18px;
  z-index: 1;
  width: 31%;
  max-width: 160px;
  height: auto;
  transform-origin: 95% 5%;
  pointer-events: none;
  animation: closing-branch-breeze 9s ease-in-out infinite;
}

.closing-garden {
  position: relative;
  width: 119%;
  height: clamp(192px, 56cqw, 280px);
  margin: clamp(18px, 3svh, 30px) -9.5% 20px;
  overflow: hidden;
  pointer-events: none;
}

.closing-garden > img,
.closing-couple > img {
  position: absolute;
  display: block;
  object-fit: contain;
  object-position: center bottom;
  user-select: none;
  -webkit-user-drag: none;
}

.closing-tree {
  z-index: 0;
  bottom: 11%;
  width: 42%;
  height: 89%;
  transform-origin: center bottom;
  animation: closing-branch-breeze 10s ease-in-out infinite;
}

.closing-tree-left { left: -12%; opacity: .9; }
.closing-tree-right { right: -11%; opacity: .83; animation-delay: -4s; }
.closing-ground { left: -3%; bottom: 0; width: 106%; height: 23%; z-index: 1; }
.closing-flower-arch { left: 25%; bottom: 9%; width: 50%; height: 89%; z-index: 2; }

.closing-couple {
  position: absolute;
  left: 40.5%;
  bottom: 10%;
  z-index: 3;
  width: 21%;
  height: 65%;
}

.closing-couple > img { inset: 0; width: 100%; height: 100%; }
.closing-couple-portrait { clip-path: inset(0 0 48% 0); }
.closing-couple-gown {
  clip-path: inset(52% 0 0 0);
  transform-origin: 50% 52%;
  animation: closing-dress-breeze 7s ease-in-out infinite;
}

.closing-sprig {
  bottom: 0;
  z-index: 4;
  width: 23%;
  height: 30%;
  transform-origin: center bottom;
  animation: closing-branch-breeze 8s ease-in-out infinite;
}

.closing-sprig-left { left: -2%; animation-delay: -3s; }
.closing-sprig-right { right: -1%; animation-delay: -6s; }

.closing-garden .closing-petal {
  z-index: 5;
  width: 12px;
  height: 17px;
  opacity: 0;
  animation: closing-petal-fall 14s linear infinite;
}

.closing-petal-one { left: 30%; top: 12%; animation-delay: -2s !important; }
.closing-petal-two { left: 65%; top: 5%; animation-delay: -7s !important; animation-duration: 17s !important; }
.closing-petal-three { left: 48%; top: 16%; animation-delay: -11s !important; animation-duration: 19s !important; }

.closing-message { width: 100%; max-width: 21em; }

html.native-story-scroll .native-scroll-root .closing-paper-finale .closing-message p {
  width: 100%;
  max-width: none;
  margin: 0;
  color: #72543b;
  font-family: "Noto Serif SC", "Songti SC", "STSong", serif;
  font-size: clamp(15px, 4.1cqw, 18px);
  font-weight: 500;
  line-height: 1.95;
  letter-spacing: .065em;
  text-align: center;
  text-indent: 0;
  text-wrap: pretty;
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
}

html.native-story-scroll .native-scroll-root .closing-paper-finale .closing-message p + p { margin-top: 10px; }

.closing-signoff {
  width: fit-content;
  max-width: 100%;
  margin-top: clamp(22px, 3.4svh, 34px);
  padding: 16px 24px 0;
  border-top: 1px solid #ceb38d;
}

html.native-story-scroll .native-scroll-root .closing-paper-finale .closing-signoff p {
  width: auto;
  max-width: none;
  margin: 0;
  color: #9f4835;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(17px, 4.8cqw, 22px);
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: .12em;
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
}

html.native-story-scroll .native-scroll-root .closing-paper-finale .closing-date-wrap .ending-date {
  width: auto;
  max-width: 100%;
  margin: 13px 0 0;
  padding: 0;
  border: 0;
  color: #8a7054;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.9;
  letter-spacing: .06em;
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
}

.closing-is-in-view .closing-heading { animation: closing-arrive 1.25s cubic-bezier(.2,.65,.3,1) both; }
.closing-is-in-view .closing-message { animation: closing-arrive 1.5s .2s cubic-bezier(.2,.65,.3,1) both; }
.closing-is-in-view .closing-signoff { animation: closing-arrive 1.5s .4s cubic-bezier(.2,.65,.3,1) both; }
.closing-paper-finale:not(.closing-is-in-view) *,
.closing-paper-finale.closing-is-background * { animation-play-state: paused !important; }

@keyframes closing-arrive {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes closing-branch-breeze {
  0%, 100% { transform: rotate(-.7deg); }
  50% { transform: rotate(1.1deg); }
}

@keyframes closing-dress-breeze {
  0%, 100% { transform: skewX(-.5deg); }
  50% { transform: skewX(.8deg); }
}

@keyframes closing-petal-fall {
  0% { opacity: 0; transform: translate3d(0, 0, 0) rotate(-20deg); }
  14% { opacity: .8; }
  45% { transform: translate3d(-16px, 58px, 0) rotate(42deg); }
  80% { opacity: .7; }
  100% { opacity: 0; transform: translate3d(13px, 145px, 0) rotate(110deg); }
}

@media (max-height: 700px) {
  html.native-story-scroll .native-scroll-root .story-panel-ending.native-ending-page.closing-paper-finale {
    padding-top: 64px !important;
    padding-bottom: max(48px, env(safe-area-inset-bottom)) !important;
  }
  .closing-garden { height: clamp(172px, 49cqw, 225px); margin-top: 16px; margin-bottom: 15px; }
  .closing-signoff { margin-top: 18px; padding-top: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .relief-chapter-label,
  .closing-paper-finale * { animation: none !important; }
  .closing-garden .closing-petal { opacity: .65; }
}
