:root {
  --bg-top: #ffeaf7;
  --bg-mid: #f6d8f3;
  --bg-bottom: #d8efff;
  --ink: #260c3a;
  --ink-soft: rgba(38, 12, 58, 0.76);
  --panel: rgba(255, 250, 252, 0.84);
  --panel-strong: rgba(255, 246, 251, 0.96);
  --border: #291132;
  --pink: #d3138d;
  --pink-bright: #ff4fba;
  --sky: #5dd4ff;
  --gold: #ffe6a3;
  --plum: #472053;
  --plum-soft: rgba(71, 32, 83, 0.7);
  --hero-progress: 0;
  --scroll-progress: 0;
  --scroll-shift: 0px;
  --wash-a: rgba(255, 82, 171, 0.22);
  --wash-b: rgba(91, 211, 255, 0.22);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background:
    radial-gradient(circle at 18% 10%, rgba(255, 118, 193, 0.18) 0%, rgba(255, 118, 193, 0) 26%),
    radial-gradient(circle at 84% 10%, rgba(93, 212, 255, 0.18) 0%, rgba(93, 212, 255, 0) 24%),
    linear-gradient(180deg, var(--bg-top) 0%, #fadbf2 34%, #eadff8 70%, var(--bg-bottom) 100%);
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  overflow-x: clip;
  color: var(--ink);
  font-family: "Cormorant Garamond", serif;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.26), transparent 26%),
    radial-gradient(circle at 14% 20%, var(--wash-a) 0%, rgba(255, 82, 171, 0.08) 18%, rgba(255, 82, 171, 0) 34%),
    radial-gradient(circle at 88% 14%, var(--wash-b) 0%, rgba(91, 211, 255, 0.08) 18%, rgba(91, 211, 255, 0) 34%),
    radial-gradient(circle at 74% 78%, rgba(255, 176, 221, 0.14) 0%, rgba(255, 176, 221, 0.04) 18%, rgba(255, 176, 221, 0) 34%),
    radial-gradient(circle at 24% 84%, rgba(154, 222, 255, 0.16) 0%, rgba(154, 222, 255, 0.05) 18%, rgba(154, 222, 255, 0) 34%),
    linear-gradient(180deg, var(--bg-top) 0%, #fadcf3 30%, var(--bg-mid) 62%, var(--bg-bottom) 100%);
  transition: background 500ms ease;
}

body[data-preload="loading"],
body[data-intro="playing"] {
  overflow: hidden;
}

body[data-scene="hero"] {
  --bg-top: #b8e5ff;
  --bg-mid: #f8d8e7;
  --bg-bottom: #f3b4d5;
  --wash-a: rgba(255, 221, 171, 0.12);
  --wash-b: rgba(255, 236, 201, 0.1);
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 228, 176, 0.26) 0%, rgba(255, 228, 176, 0) 20%),
    radial-gradient(circle at 82% 14%, rgba(255, 238, 210, 0.18) 0%, rgba(255, 238, 210, 0) 18%),
    linear-gradient(180deg, #b8e5ff 0%, #d5ebff 22%, #f6dde9 48%, #f3b4d5 100%);
}

body[data-scene="ceremony"] {
  --bg-top: #ffedf7;
  --bg-mid: #f8dcf4;
  --bg-bottom: #def1ff;
  --wash-a: rgba(255, 95, 180, 0.2);
  --wash-b: rgba(94, 208, 255, 0.2);
}

body[data-scene="party"] {
  --bg-top: #ffe4f3;
  --bg-mid: #f4c8ec;
  --bg-bottom: #cfe8ff;
  --wash-a: rgba(211, 19, 141, 0.24);
  --wash-b: rgba(93, 212, 255, 0.24);
}

body[data-scene="rsvp"] {
  --bg-top: #fff0f8;
  --bg-mid: #f7ddf4;
  --bg-bottom: #dbf0ff;
  --wash-a: rgba(255, 124, 188, 0.2);
  --wash-b: rgba(96, 224, 255, 0.22);
}

a {
  color: inherit;
}

.comic-page {
  position: relative;
  width: min(100%, 1380px);
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 2rem);
  overflow: visible;
}

.page-title-badge {
  position: fixed;
  left: clamp(0.8rem, 2.3vw, 1.6rem);
  top: clamp(0.85rem, 2.6vw, 1.3rem);
  z-index: 12;
  display: block;
  opacity: clamp(0, (var(--hero-progress) - 0.18) * 4.5, 1);
  transform:
    translate3d(calc((1 - clamp(0, (var(--hero-progress) - 0.18) * 4.5, 1)) * -0.7rem), 0, 0)
    scale(calc(0.96 + clamp(0, (var(--hero-progress) - 0.18) * 4.5, 1) * 0.04));
  pointer-events: none;
  transition:
    opacity 180ms linear,
    transform 180ms linear;
}

.page-title-badge__title {
  font-family: "Astloch", serif;
  font-size: clamp(1.4rem, 2.8vw, 2rem);
  font-weight: 400;
  letter-spacing: 0.015em;
  line-height: 0.92;
  color: rgba(96, 38, 78, 0.92);
  text-shadow:
    0 0 0.7rem rgba(255, 225, 170, 0.16),
    0 1px 0 rgba(255, 247, 233, 0.9);
}

.page-rsvp-cta {
  position: fixed;
  right: clamp(0.8rem, 2.3vw, 1.6rem);
  top: clamp(0.85rem, 2.6vw, 1.3rem);
  z-index: 12;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.9rem;
  padding: 0.72rem 1.2rem 0.68rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 220, 170, 0.42);
  background:
    linear-gradient(180deg, rgba(255, 223, 152, 0.98), rgba(255, 171, 94, 0.98));
  color: #5a1c18;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-decoration: none;
  text-transform: uppercase;
  box-shadow:
    0 1rem 2rem rgba(34, 5, 19, 0.18),
    inset 0 1px 0 rgba(255, 247, 227, 0.8);
  opacity: clamp(0, (var(--hero-progress) - 0.18) * 4.5, 1);
  transform:
    translate3d(calc((1 - clamp(0, (var(--hero-progress) - 0.18) * 4.5, 1)) * 0.7rem), 0, 0)
    scale(calc(0.96 + clamp(0, (var(--hero-progress) - 0.18) * 4.5, 1) * 0.04));
  pointer-events: auto;
  transition:
    opacity 180ms linear,
    transform 180ms linear,
    box-shadow 160ms ease,
    filter 160ms ease;
}

.page-rsvp-cta:hover {
  box-shadow:
    0 1.1rem 2.2rem rgba(34, 5, 19, 0.22),
    inset 0 1px 0 rgba(255, 247, 227, 0.86);
  filter: saturate(1.05);
}

.page-rsvp-cta:focus-visible {
  outline: 3px solid rgba(255, 245, 209, 0.95);
  outline-offset: 4px;
}

body[data-scene="rsvp"] .page-rsvp-cta {
  opacity: 0;
  transform: translate3d(0.6rem, 0, 0) scale(0.96);
  pointer-events: none;
}

body[data-scene="hero"][data-chips="ready"] .chip-canvas,
body[data-scene="hero"] .chip-canvas {
  opacity: 0 !important;
}

.preload-screen {
  position: fixed;
  inset: 0;
  z-index: 30;
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0) 18%),
    linear-gradient(180deg, #060606 0%, #090909 55%, #030303 100%);
  pointer-events: none;
  opacity: 1;
  visibility: visible;
  transition:
    opacity 280ms ease,
    visibility 0s linear 0s;
}

body[data-preload="ready"] .preload-screen {
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 280ms ease,
    visibility 0s linear 280ms;
}

.curtain-intro {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  overflow: hidden;
  opacity: 1;
  visibility: visible;
  transition:
    opacity 30ms linear,
    visibility 30ms linear;
}

body[data-preload="loading"] .curtain-intro,
body[data-intro="waiting"] .curtain-intro {
  opacity: 0;
  visibility: hidden;
}

.curtain-intro__panel {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 52vw;
  background:
    linear-gradient(180deg, rgba(255, 141, 74, 0.1), rgba(64, 0, 0, 0) 16%, rgba(0, 0, 0, 0.28) 100%),
    radial-gradient(circle at 50% 0%, rgba(255, 141, 74, 0.24) 0%, rgba(255, 141, 74, 0) 34%),
    url("assets/curtain.png?v=49135ac3");
  background-position: center center, center center, left center;
  background-repeat: no-repeat;
  background-size: 100% 100%, 100% 100%, 200% 100%;
  box-shadow:
    inset -3rem 0 5rem rgba(0, 0, 0, 0.26),
    inset 0 -1.3rem 0 rgba(20, 0, 0, 0.55),
    0 0 3rem rgba(12, 0, 0, 0.24);
  transform-origin: center;
  will-change: transform;
}

.curtain-intro__panel::before,
.curtain-intro__panel::after {
  content: "";
  position: absolute;
  inset: 0;
}

.curtain-intro__panel::before {
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.05) 0 1.25rem,
      rgba(0, 0, 0, 0.12) 1.25rem 1.65rem,
      rgba(255, 255, 255, 0.06) 1.65rem 2rem,
      rgba(73, 0, 0, 0.08) 2rem 2.6rem
    );
  mix-blend-mode: soft-light;
  opacity: 0.82;
}

.curtain-intro__panel::after {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 10%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0) 10%);
}

.curtain-intro__panel-left {
  left: 0;
}

.curtain-intro__panel-right {
  right: 0;
  transform: scaleX(-1);
}

body[data-preload="ready"][data-intro="playing"] .curtain-intro__panel-left {
  animation: curtain-open-left 1s cubic-bezier(0.24, 0.78, 0.38, 0.98) 0.3s forwards;
}

body[data-preload="ready"][data-intro="playing"] .curtain-intro__panel-right {
  animation: curtain-open-right 1s cubic-bezier(0.24, 0.78, 0.38, 0.98) 0.3s forwards;
}

body[data-intro="done"] .curtain-intro__panel-left {
  transform: translateX(-118%) scaleX(0.985);
}

body[data-intro="done"] .curtain-intro__panel-right {
  transform: translateX(118%) scaleX(-0.985);
}

body[data-intro="done"] .curtain-intro {
  opacity: 0;
  visibility: hidden;
}

.comic-page::before,
.comic-page::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.comic-page::before {
  z-index: 0;
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 244, 189, 0.26) 0%, rgba(255, 244, 189, 0.06) 12%, rgba(255, 244, 189, 0) 24%),
    radial-gradient(circle at 82% 8%, rgba(93, 212, 255, 0.14) 0%, rgba(93, 212, 255, 0.04) 12%, rgba(93, 212, 255, 0) 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.04) 16%, rgba(255, 255, 255, 0) 34%);
  opacity: 0.9;
}

.comic-page::after {
  z-index: 0;
  background:
    radial-gradient(circle at 50% 56%, transparent 46%, rgba(71, 32, 83, 0.04) 78%, rgba(71, 32, 83, 0.12) 100%),
    linear-gradient(90deg, rgba(71, 32, 83, 0.08), transparent 18%, transparent 82%, rgba(71, 32, 83, 0.08));
}

.rsvp-button:focus-visible {
  outline: 3px solid rgba(93, 212, 255, 0.95);
  outline-offset: 4px;
}

.chip-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms ease;
}

.chip-canvas {
  z-index: 2;
  filter: blur(2px);
  transform: scale(1.008);
}

body[data-chips="ready"] .chip-canvas {
  opacity: 1;
}

body[data-chips="ready"] .chip-canvas {
  opacity: 0.78;
}

.ambient,
.halftone,
.trail,
.marquee,
.spark {
  position: fixed;
  inset: auto;
  pointer-events: none;
  transition:
    transform 500ms ease,
    opacity 500ms ease,
    background 500ms ease;
}

.ambient {
  z-index: 0;
  filter: blur(18px);
}

.ambient-top {
  top: -7rem;
  left: -6rem;
  width: 28rem;
  height: 28rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 92, 176, 0.26) 0%, rgba(255, 92, 176, 0) 72%);
  transform: translate3d(calc(var(--scroll-progress) * 2.5rem), calc(var(--scroll-progress) * 1.5rem), 0);
  animation: float-glow-a 10s ease-in-out infinite alternate;
}

.ambient-bottom {
  right: -7rem;
  bottom: -8rem;
  width: 32rem;
  height: 32rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(93, 212, 255, 0.24) 0%, rgba(93, 212, 255, 0) 74%);
  transform: translate3d(calc(var(--scroll-progress) * -3rem), calc(var(--scroll-progress) * -2rem), 0);
  animation: float-glow-b 12s ease-in-out infinite alternate;
}

.halftone {
  z-index: 0;
  width: 18rem;
  height: 18rem;
  opacity: 0.48;
  background:
    radial-gradient(circle, rgba(41, 17, 50, 0.18) 0 1.5px, transparent 2px);
  background-size: 14px 14px;
  animation: drift-halftone 14s linear infinite alternate;
}

.halftone-left {
  left: -5rem;
  top: 26rem;
  transform: translate3d(calc(var(--scroll-progress) * 1.2rem), calc(var(--scroll-progress) * -0.6rem), 0) rotate(-8deg);
}

.halftone-right {
  right: -4rem;
  top: 10rem;
  transform: translate3d(calc(var(--scroll-progress) * -1.4rem), calc(var(--scroll-progress) * 0.8rem), 0) rotate(12deg);
}

.trail {
  z-index: 0;
  border-radius: 999px;
  opacity: 0.78;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 117, 193, 0.94) 0 20px,
      rgba(255, 226, 239, 0.95) 20px 40px
    );
  box-shadow: 0 0 2rem rgba(211, 19, 141, 0.12);
  animation: sway-trail 8s ease-in-out infinite alternate;
}

.trail-left {
  left: -10rem;
  top: 38rem;
  width: 36rem;
  height: 2.8rem;
  transform: translate3d(calc(var(--scroll-progress) * 2rem), calc(var(--scroll-progress) * -1rem), 0) rotate(42deg);
}

.trail-right {
  right: -10rem;
  top: 19rem;
  width: 28rem;
  height: 2.3rem;
  transform: translate3d(calc(var(--scroll-progress) * -1.8rem), calc(var(--scroll-progress) * 0.9rem), 0) rotate(-34deg);
}

.marquee {
  z-index: 0;
  width: 22rem;
  height: 8rem;
  opacity: 0.96;
  border-radius: 0 0 999px 999px;
}

.marquee::before,
.marquee::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.marquee::before {
  background:
    radial-gradient(circle, rgba(255, 245, 189, 0.98) 0 0.42rem, transparent 0.5rem);
  background-size: 2.5rem 2.5rem;
  background-repeat: repeat-x;
  background-position: 0 100%;
  filter:
    drop-shadow(0 0 0.55rem rgba(255, 244, 168, 0.95))
    drop-shadow(0 0 1.4rem rgba(255, 187, 73, 0.38));
  animation: bulb-glow 2.4s steps(2) infinite;
}

.marquee-left {
  top: 1.5rem;
  left: -2rem;
  transform: translate3d(calc(var(--scroll-progress) * 0.8rem), calc(var(--scroll-progress) * 0.4rem), 0) rotate(6deg);
}

.marquee-right {
  top: 1rem;
  right: -3rem;
  transform: translate3d(calc(var(--scroll-progress) * -0.9rem), calc(var(--scroll-progress) * 0.5rem), 0) rotate(-7deg);
}

.spark {
  z-index: 0;
  width: 4.4rem;
  aspect-ratio: 1;
  opacity: 0.84;
  background:
    linear-gradient(90deg, transparent 46%, rgba(255, 255, 255, 0.95) 46% 54%, transparent 54%),
    linear-gradient(transparent 46%, rgba(255, 255, 255, 0.95) 46% 54%, transparent 54%);
  transform: rotate(45deg);
  filter:
    drop-shadow(0 0 0.8rem rgba(255, 255, 255, 0.6))
    drop-shadow(0 0 1.4rem rgba(255, 93, 180, 0.34));
  animation: twinkle 2.6s ease-in-out infinite;
}

.spark::before,
.spark::after {
  content: "";
  position: absolute;
  inset: 0;
  background: inherit;
}

.spark::before {
  transform: rotate(22deg);
}

.spark::after {
  transform: rotate(-22deg);
}

.spark-one {
  top: 11rem;
  left: 20%;
  transform: translate3d(calc(var(--scroll-progress) * 0.8rem), calc(var(--scroll-progress) * -0.4rem), 0) rotate(45deg);
}

.spark-two {
  top: 18rem;
  right: 18%;
  width: 3.2rem;
  transform: translate3d(calc(var(--scroll-progress) * -0.8rem), calc(var(--scroll-progress) * 0.4rem), 0) rotate(45deg);
  animation-delay: 0.5s;
}

.spark-three {
  top: 30rem;
  right: 9%;
  width: 2.8rem;
  opacity: 0.72;
  transform: translate3d(calc(var(--scroll-progress) * -0.5rem), calc(var(--scroll-progress) * 0.6rem), 0) rotate(45deg);
  animation-delay: 1s;
}

.hero-stage,
.chapter {
  position: relative;
  z-index: 3;
}

.hero-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.85fr) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  align-items: end;
  gap: clamp(1rem, 2vw, 2rem);
  min-height: calc(100dvh - clamp(2rem, 6vw, 4rem));
  max-height: calc(100dvh - clamp(2rem, 6vw, 4rem));
  padding: clamp(0.75rem, 3.2vw, 2rem) 0 clamp(0.8rem, 2vw, 1.4rem);
  isolation: isolate;
}

.hero-stage::before,
.hero-stage::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.hero-stage::before {
  top: 1.8rem;
  left: 50%;
  width: min(100vw, 980px);
  height: min(50vw, 560px);
  transform: translateX(-50%);
  z-index: 0;
  background: url("assets/image.png?v=76302b27") center / contain no-repeat;
  opacity: 0.64;
  filter:
    sepia(0.24)
    saturate(0.82)
    hue-rotate(-10deg)
    brightness(1.04);
}

.hero-stage::after {
  content: none;
}

.hero-copy {
  position: relative;
  z-index: 3;
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  justify-self: center;
  text-align: center;
  transform: translateY(calc(var(--hero-progress) * -14px));
  transition: transform 180ms linear;
}

.eyebrow {
  margin: 0;
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(71, 32, 83, 0.86);
}

.hero-copy h1 {
  position: relative;
  margin: 0.3rem 0 0;
}

.hero-title {
  display: inline-grid;
  place-items: center;
  padding: 0.2rem 0.6rem 0.5rem;
}

.hero-title::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(100%, 18rem);
  height: 1.05rem;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 215, 136, 0.55) 0%, rgba(255, 215, 136, 0) 72%);
  transform: translateX(-50%);
  filter: blur(8px);
}

.hero-title span {
  position: relative;
  display: block;
  white-space: nowrap;
  font-family: "Astloch", serif;
  font-size: clamp(3.9rem, 8vw, 7rem);
  line-height: 0.92;
  color: #ffd47f;
  letter-spacing: 0.02em;
  background:
    linear-gradient(180deg, #fff1c5 0%, #ffd889 26%, #ff9acb 58%, #ff5eb3 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow:
    0 0 1.6rem rgba(255, 173, 95, 0.24),
    0 0.4rem 0 rgba(77, 22, 55, 0.22);
}

.hero-title span + span {
  margin-top: -0.16em;
}

.hero-title span::before {
  content: attr(data-ghost);
  position: absolute;
  inset: 0;
  z-index: -1;
  color: rgba(255, 246, 231, 0.96);
  -webkit-text-fill-color: initial;
  transform: translate(0.18rem, 0.18rem);
  text-shadow:
    -3px -3px 0 rgba(255, 246, 231, 0.92),
    3px -3px 0 rgba(255, 246, 231, 0.92),
    -3px 3px 0 rgba(255, 246, 231, 0.92),
    3px 3px 0 rgba(255, 246, 231, 0.92),
    0 0 1rem rgba(255, 120, 193, 0.18);
}

.hero-phrase {
  max-width: 31rem;
  margin: 1rem auto 0;
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  line-height: 1.08;
  color: rgba(38, 12, 58, 0.9);
  text-shadow: 0 1px 0 rgba(255, 250, 252, 0.5);
}

.scroll-hint {
  display: none;
}

.figure-card {
  position: relative;
  z-index: 3;
  display: grid;
  grid-row: 1 / 3;
  justify-items: center;
  gap: 0.8rem;
  align-self: end;
  transform-origin: bottom center;
  transition:
    transform 500ms ease,
    filter 500ms ease;
}

.figure-card-left {
  grid-column: 1;
  justify-self: end;
  transform: translateX(1.5rem) translateY(calc(var(--hero-progress) * 14px - 1.1rem)) rotate(-5deg);
}

.figure-card-right {
  grid-column: 3;
  justify-self: start;
  transform: translateX(-1.5rem) translateY(calc(var(--hero-progress) * 10px - 0.9rem)) rotate(5deg);
}

.figure-frame {
  position: relative;
  width: min(100%, 24rem);
  padding: 1rem 0.5rem 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.figure-frame::before {
  content: none;
}

.figure-frame img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: min(50dvh, 38rem);
  height: auto;
  position: relative;
  z-index: 1;
  filter:
    drop-shadow(0 0 0 rgba(255, 250, 252, 0.98))
    drop-shadow(5px 0 0 rgba(255, 250, 252, 0.98))
    drop-shadow(-5px 0 0 rgba(255, 250, 252, 0.98))
    drop-shadow(0 5px 0 rgba(255, 250, 252, 0.98))
    drop-shadow(0 -5px 0 rgba(255, 250, 252, 0.98))
    drop-shadow(0 24px 36px rgba(71, 32, 83, 0.26));
}

.hero-flowers {
  position: relative;
  z-index: 2;
  grid-column: 1 / -1;
  grid-row: 2;
  align-self: end;
  justify-self: center;
  width: min(66vw, 40rem);
  max-height: min(40dvh, 52rem);
  height: auto;
  margin-bottom: -0.2rem;
  pointer-events: none;
  filter:
    drop-shadow(0 0.6rem 1.2rem rgba(62, 18, 45, 0.12))
    drop-shadow(0 0.2rem 0.7rem rgba(255, 214, 223, 0.25));
}

.figure-card figcaption {
  margin-top: -0.1rem;
  color: var(--pink);
  font-family: "Astloch", serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 0.95;
  text-shadow:
    -3px -3px 0 rgba(255, 250, 252, 0.98),
    3px -3px 0 rgba(255, 250, 252, 0.98),
    -3px 3px 0 rgba(255, 250, 252, 0.98),
    3px 3px 0 rgba(255, 250, 252, 0.98);
}

.chapter {
  min-height: 92vh;
  display: grid;
  align-items: center;
  padding: 3rem 0;
}

.chapter-ceremony {
  --chapter-glow: rgba(255, 218, 165, 0.18);
  --chapter-wash: rgba(244, 175, 203, 0.12);
}

.chapter-party {
  --chapter-glow: rgba(255, 208, 156, 0.2);
  --chapter-wash: rgba(237, 164, 197, 0.14);
}

.chapter-rsvp {
  --chapter-glow: rgba(255, 225, 176, 0.18);
  --chapter-wash: rgba(234, 173, 206, 0.12);
}

.chapter-panel {
  position: relative;
  width: min(100%, 1060px);
  margin: 0 auto;
  padding: clamp(2rem, 4vw, 3rem) clamp(1.4rem, 3vw, 2.6rem) clamp(1.7rem, 3vw, 2.4rem);
  border: 3px solid rgba(126, 72, 88, 0.96);
  border-radius: 2.8rem;
  background:
    radial-gradient(circle at 50% -12%, rgba(255, 233, 196, 0.18) 0%, rgba(255, 233, 196, 0) 30%),
    radial-gradient(circle at 0% 100%, var(--chapter-wash) 0%, rgba(228, 135, 183, 0) 40%),
    radial-gradient(circle at 100% 0%, var(--chapter-glow) 0%, rgba(255, 214, 127, 0) 36%),
    linear-gradient(180deg, rgba(144, 75, 109, 0.98) 0%, rgba(125, 60, 97, 0.98) 42%, rgba(108, 47, 84, 0.99) 100%);
  box-shadow:
    0 36px 72px rgba(68, 24, 47, 0.24),
    inset 0 0 0 2px rgba(245, 212, 196, 0.26),
    inset 0 1.2rem 2.4rem rgba(255, 231, 204, 0.07);
  overflow: hidden;
}

.chapter-panel::before,
.chapter-panel::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.chapter-panel::before {
  inset: 1rem;
  border: 1px solid rgba(244, 214, 198, 0.34);
  border-radius: 2.2rem;
  box-shadow:
    inset 0 0 0 1px rgba(255, 240, 225, 0.1),
    inset 0 -1.4rem 2rem rgba(53, 17, 34, 0.18);
}

.chapter-panel::after {
  inset: 0;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 241, 214, 0.18) 0%, rgba(255, 241, 214, 0) 18%),
    linear-gradient(90deg, rgba(255, 223, 183, 0.09), rgba(255, 223, 183, 0) 12%, rgba(255, 223, 183, 0) 88%, rgba(255, 223, 183, 0.09));
  opacity: 0.72;
}

.chapter-bulbs {
  position: absolute;
  left: 2.4rem;
  right: 2.4rem;
  top: 0.7rem;
  height: 1.45rem;
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(255, 243, 212, 0.98) 0 0.34rem, transparent 0.44rem);
  background-size: 2rem 100%;
  background-position: center;
  filter:
    drop-shadow(0 0 0.48rem rgba(255, 239, 207, 0.95))
    drop-shadow(0 0 1.1rem rgba(255, 210, 152, 0.38));
  opacity: 0.94;
  animation: bulb-glow 1.8s steps(2) infinite;
}

.chapter-sparkle {
  position: absolute;
  width: 5.2rem;
  height: 5.2rem;
  pointer-events: none;
  opacity: 0.96;
  transform-origin: center;
  animation: chapter-sparkle-drift 4.2s ease-in-out infinite;
}

.chapter-sparkle::before,
.chapter-sparkle::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
}

.chapter-sparkle::before {
  background:
    radial-gradient(circle, rgba(255, 255, 255, 1) 0 0.18rem, rgba(255, 242, 210, 0.98) 0.19rem 0.34rem, transparent 0.38rem),
    linear-gradient(90deg, transparent 47%, rgba(255, 251, 240, 0.98) 47% 53%, transparent 53%),
    linear-gradient(transparent 47%, rgba(255, 251, 240, 0.98) 47% 53%, transparent 53%),
    linear-gradient(45deg, transparent 48%, rgba(255, 215, 238, 0.82) 48% 52%, transparent 52%),
    linear-gradient(-45deg, transparent 48%, rgba(255, 215, 238, 0.82) 48% 52%, transparent 52%);
  width: 100%;
  height: 100%;
  filter:
    drop-shadow(0 0 0.45rem rgba(255, 255, 255, 0.78))
    drop-shadow(0 0 1rem rgba(255, 135, 196, 0.32));
  animation: chapter-sparkle-twinkle 2.5s ease-in-out infinite;
}

.chapter-sparkle::after {
  background:
    radial-gradient(circle at 24% 74%, rgba(255, 255, 255, 0.98) 0 0.16rem, rgba(255, 236, 189, 0.95) 0.17rem 0.28rem, transparent 0.32rem),
    linear-gradient(90deg, transparent 47%, rgba(255, 248, 232, 0.95) 47% 53%, transparent 53%) 24% 74% / 0.82rem 0.08rem no-repeat,
    linear-gradient(transparent 47%, rgba(255, 248, 232, 0.95) 47% 53%, transparent 53%) 24% 74% / 0.08rem 0.82rem no-repeat,
    radial-gradient(circle at 79% 26%, rgba(255, 255, 255, 0.96) 0 0.12rem, rgba(255, 221, 239, 0.94) 0.13rem 0.22rem, transparent 0.26rem),
    linear-gradient(90deg, transparent 47%, rgba(255, 239, 248, 0.9) 47% 53%, transparent 53%) 79% 26% / 0.6rem 0.07rem no-repeat,
    linear-gradient(transparent 47%, rgba(255, 239, 248, 0.9) 47% 53%, transparent 53%) 79% 26% / 0.07rem 0.6rem no-repeat,
    radial-gradient(circle at 70% 82%, rgba(255, 237, 196, 0.9) 0 0.09rem, transparent 0.14rem),
    radial-gradient(circle at 52% 14%, rgba(255, 255, 255, 0.74) 0 0.06rem, transparent 0.1rem);
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 0.55rem rgba(255, 219, 238, 0.24));
  animation: chapter-sparkle-twinkle 3.2s ease-in-out infinite reverse;
}

.chapter-sparkle-left {
  left: 1.4rem;
  bottom: 1.25rem;
  --sparkle-tilt: -8deg;
  animation-delay: 0.25s;
}

.chapter-sparkle-right {
  right: 1.45rem;
  top: 1.35rem;
  width: 4.3rem;
  height: 4.3rem;
  --sparkle-tilt: 12deg;
  opacity: 0.88;
  animation-delay: 0.8s;
}

.chapter-label {
  display: inline-flex;
  margin: 0;
  padding: 0.42rem 1rem;
  border: 2px solid rgba(229, 200, 182, 0.76);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 245, 229, 0.98), rgba(241, 224, 207, 0.98));
  color: #724655;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  box-shadow:
    0 0.5rem 1.1rem rgba(60, 27, 42, 0.12),
    inset 0 1px 0 rgba(255, 250, 244, 0.74);
}

.chapter-panel h2 {
  margin: 1rem 0 0;
  font-family: "Astloch", serif;
  font-size: clamp(2.8rem, 6vw, 5.1rem);
  line-height: 0.9;
  color: #ffe6c1;
  text-shadow:
    0 0 1rem rgba(255, 222, 166, 0.2),
    0 0.3rem 0 rgba(94, 41, 62, 0.42);
}

.chapter-intro {
  max-width: 40rem;
  margin: 0.9rem 0 0;
  font-size: clamp(1.45rem, 2.7vw, 2rem);
  line-height: 1.08;
  color: rgba(255, 242, 231, 0.92);
  text-wrap: balance;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.1rem;
  margin-top: 1.8rem;
}

.info-card {
  position: relative;
  display: grid;
  gap: 0.55rem;
  min-height: 10.3rem;
  padding: 1.25rem 1.15rem;
  border: 1px solid rgba(221, 193, 178, 0.5);
  border-radius: 1.75rem;
  background:
    linear-gradient(180deg, rgba(255, 249, 239, 0.98), rgba(247, 236, 223, 0.96)),
    rgba(252, 245, 236, 0.96);
  box-shadow:
    0 1rem 1.9rem rgba(73, 32, 46, 0.12),
    inset 0 0 0 1px rgba(255, 252, 248, 0.72);
  transform: rotate(var(--card-tilt, 0deg));
}

.info-card::before {
  content: "";
  position: absolute;
  inset: 0.55rem;
  border: 1px solid rgba(168, 126, 137, 0.2);
  border-radius: 1.2rem;
  pointer-events: none;
}

.info-card-accent,
.info-card-wide {
  background:
    linear-gradient(180deg, rgba(255, 232, 202, 0.26), rgba(244, 206, 219, 0.18)),
    linear-gradient(180deg, rgba(255, 249, 239, 0.98), rgba(247, 236, 223, 0.96));
}

.info-card-wide {
  grid-column: span 2;
}

.info-card:nth-child(odd) {
  --card-tilt: -1.4deg;
}

.info-card:nth-child(even) {
  --card-tilt: 1.2deg;
}

.info-title {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(120, 72, 86, 0.82);
}

.info-card strong {
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  line-height: 0.98;
  color: #43242e;
}

.chapter-panel-rsvp {
  text-align: center;
}

.chapter-panel-rsvp .chapter-intro {
  margin-inline: auto;
}

.rsvp-box {
  display: grid;
  justify-items: center;
  gap: 1.1rem;
  margin-top: 1.9rem;
  padding: 1.5rem 1rem 0.4rem;
}

.deadline {
  margin: 0;
  font-size: clamp(1.35rem, 2.3vw, 1.85rem);
  font-weight: 700;
  color: rgba(255, 239, 219, 0.94);
}

.rsvp-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.3rem;
  padding: 0.85rem 1.9rem;
  border: 3px solid var(--border);
  border-radius: 999px;
  background: linear-gradient(180deg, var(--pink-bright) 0%, var(--pink) 100%);
  color: #fff8fb;
  font-size: clamp(1.2rem, 2.1vw, 1.6rem);
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 18px 30px rgba(211, 19, 141, 0.18);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    filter 160ms ease;
}

.rsvp-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 36px rgba(211, 19, 141, 0.24);
  filter: saturate(1.05);
}

.reveal {
  opacity: 0;
  transform: translateY(42px) scale(0.98);
  transition:
    opacity 550ms ease,
    transform 650ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

body[data-scene="ceremony"] .trail-right {
  transform: translate3d(calc(var(--scroll-progress) * -1.4rem), calc(var(--scroll-progress) * -0.2rem), 0) rotate(-18deg) translateY(-1.2rem);
}

body[data-scene="party"] .trail-left {
  transform: translate3d(calc(var(--scroll-progress) * 2.2rem), calc(var(--scroll-progress) * -1.4rem), 0) rotate(30deg) translateY(-1.8rem);
}

body[data-scene="party"] .ambient-top {
  transform: translate3d(calc(var(--scroll-progress) * 2.5rem), calc(var(--scroll-progress) * 1.5rem), 0) scale(1.08);
}

body[data-scene="rsvp"] .ambient-bottom {
  transform: translate3d(calc(var(--scroll-progress) * -3rem), calc(var(--scroll-progress) * -2rem), 0) scale(1.12);
}

body[data-scene="party"] .spark {
  opacity: 0.96;
}

body[data-scene="rsvp"] .marquee::before {
  animation-duration: 1.8s;
}

@keyframes float-glow-a {
  from {
    filter: blur(14px) saturate(1);
  }
  to {
    filter: blur(18px) saturate(1.08);
  }
}

@keyframes float-glow-b {
  from {
    filter: blur(14px) saturate(1);
  }
  to {
    filter: blur(19px) saturate(1.12);
  }
}

@keyframes drift-halftone {
  from {
    opacity: 0.36;
  }
  to {
    opacity: 0.54;
  }
}

@keyframes sway-trail {
  from {
    box-shadow: 0 0 1.4rem rgba(211, 19, 141, 0.09);
  }
  to {
    box-shadow: 0 0 2.6rem rgba(211, 19, 141, 0.18);
  }
}

@keyframes bulb-glow {
  0%,
  100% {
    opacity: 0.92;
  }
  50% {
    opacity: 0.62;
  }
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.62;
    filter:
      drop-shadow(0 0 0.8rem rgba(255, 255, 255, 0.45))
      drop-shadow(0 0 1rem rgba(255, 93, 180, 0.24));
  }
  50% {
    opacity: 1;
    filter:
      drop-shadow(0 0 1rem rgba(255, 255, 255, 0.7))
      drop-shadow(0 0 1.8rem rgba(255, 93, 180, 0.4));
  }
}

@keyframes chapter-sparkle-twinkle {
  0%,
  100% {
    opacity: 0.58;
    transform: translate(-50%, -50%) scale(0.82) rotate(0deg);
  }
  45% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.04) rotate(6deg);
  }
  70% {
    opacity: 0.86;
    transform: translate(-50%, -50%) scale(0.92) rotate(-4deg);
  }
}

@keyframes chapter-sparkle-drift {
  0%,
  100% {
    opacity: 0.82;
    transform: translate3d(0, 0, 0) rotate(var(--sparkle-tilt, 0deg));
  }
  50% {
    opacity: 1;
    transform: translate3d(0, -0.28rem, 0) rotate(calc(var(--sparkle-tilt, 0deg) + 4deg));
  }
}

@keyframes curtain-open-left {
  0% {
    transform: translateX(0) scaleX(1.1);
  }
  100% {
    transform: translateX(-100%) scaleX(0.99);
  }
}

@keyframes curtain-open-right {
  0% {
    transform: translateX(0) scaleX(-1.1);
  }
  100% {
    transform: translateX(100%) scaleX(-0.99);
  }
}

@media (max-width: 1080px) {
  .hero-stage {
    grid-template-columns: minmax(0, 0.86fr) minmax(320px, 1fr) minmax(0, 0.86fr);
    grid-template-rows: auto minmax(0, 1fr);
    min-height: calc(100dvh - clamp(1.6rem, 5vw, 3rem));
    max-height: calc(100dvh - clamp(1.6rem, 5vw, 3rem));
    gap: clamp(0.5rem, 1.4vw, 1rem);
  }

  .hero-copy {
    grid-column: 2;
    order: 0;
    margin-bottom: 0;
  }

  .hero-phrase {
    margin-inline: auto;
  }

  .figure-frame {
    width: min(100%, 18rem);
  }

  .figure-frame img {
    max-height: min(44dvh, 31rem);
  }

  .hero-flowers {
    width: min(72vw, 42rem);
    max-height: min(18dvh, 9rem);
  }

}

@media (max-width: 820px) {
  .chapter {
    min-height: auto;
    padding: 2rem 0;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .info-card-wide {
    grid-column: auto;
  }

  .chapter-bulbs {
    left: 1.6rem;
    right: 1.6rem;
    top: 0.55rem;
    background-size: 1.6rem 100%;
  }

  .chapter-sparkle {
    width: 4.3rem;
    height: 4.3rem;
    opacity: 0.82;
  }

  .chapter-sparkle-left {
    left: 0.95rem;
    bottom: 1rem;
  }

  .chapter-sparkle-right {
    right: 1rem;
    top: 1rem;
  }

  .trail-left {
    width: 24rem;
    left: -9rem;
    top: 34rem;
  }

  .trail-right {
    width: 18rem;
    right: -6rem;
    top: 17rem;
  }

  .marquee {
    width: 16rem;
  }

  .curtain-intro__panel {
    width: 54vw;
  }

}

@media (max-width: 640px) {
  .comic-page {
    padding-inline: 0.8rem;
  }

  .hero-stage {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    min-height: calc(100dvh - 1.6rem);
    max-height: calc(100dvh - 1.6rem);
    padding: 0.75rem 0 12.8rem;
    overflow: hidden;
    row-gap: 0.5rem;
  }

  .hero-copy {
    grid-column: 1;
    align-self: start;
    max-width: min(18.25rem, calc(100vw - 1.8rem));
  }

  .eyebrow {
    font-size: clamp(1.08rem, 4vw, 1.34rem);
    letter-spacing: 0.15em;
  }

  .figure-card {
    position: absolute;
    bottom: 0.8rem;
    z-index: 3;
    grid-row: auto;
    width: min(35vw, 8.8rem);
    align-self: auto;
  }

  .figure-card-left {
    left: -0.45rem;
    justify-self: auto;
    transform: rotate(-3deg);
  }

  .figure-card-right {
    right: -0.45rem;
    justify-self: auto;
    transform: rotate(3deg);
  }

  .figure-frame {
    width: 100%;
    padding-top: 0;
  }

  .figure-frame img {
    width: auto;
    max-width: 145%;
    max-height: min(31dvh, 17rem);
    margin-left: 0;
  }

  .hero-copy h1 {
    padding-inline: 0;
  }

  .hero-title span {
    font-size: clamp(3.35rem, 15vw, 5.15rem);
  }

  .hero-phrase {
    max-width: 17.25rem;
    font-size: clamp(1.22rem, 4.8vw, 1.48rem);
    line-height: 1.02;
  }

  .hero-stage::before {
    top: 1rem;
    width: min(72vw, 520px);
    height: min(46vw, 280px);
    opacity: 0.48;
  }

  .hero-flowers {
    width: min(92vw, 28rem);
    max-height: min(10dvh, 4.5rem);
  }

  .ambient-top,
  .ambient-bottom,
  .halftone-right,
  .trail-right,
  .marquee-right,
  .spark-three {
    display: none;
  }

  .halftone-left {
    top: 30rem;
    left: -8rem;
  }

  .trail-left {
    width: 18rem;
    height: 1.8rem;
    top: 31rem;
    left: -8rem;
  }

  .marquee-left {
    width: 13rem;
    left: -2rem;
    top: 2.25rem;
  }

  .spark-one {
    left: 10%;
    top: 13rem;
  }

  .spark-two {
    right: 10%;
    top: 21rem;
  }

  .chapter-panel {
    padding: 1.6rem 1rem 1.35rem;
    border-radius: 1.9rem;
  }

  .chapter-bulbs {
    left: 1.15rem;
    right: 1.15rem;
    top: 0.5rem;
    height: 1.15rem;
    background-size: 1.35rem 100%;
  }

  .chapter-sparkle {
    display: none;
  }

  .chapter-panel h2 {
    font-size: clamp(2.25rem, 10vw, 3.5rem);
  }

  .page-title-badge {
    left: 0.65rem;
    top: 0.7rem;
  }

  .page-title-badge__title {
    font-size: 1.18rem;
  }

  .page-rsvp-cta {
    right: 0.65rem;
    top: 0.7rem;
    min-height: 2.55rem;
    padding: 0.62rem 0.9rem 0.58rem;
    font-size: 0.82rem;
  }

  .chapter-intro {
    font-size: clamp(1.24rem, 5vw, 1.6rem);
  }

  .info-card {
    min-height: auto;
    transform: none;
  }
}

@media (max-width: 390px) {
  .hero-stage {
    padding-bottom: 11.5rem;
    row-gap: 0.4rem;
  }

  .hero-copy {
    max-width: min(17rem, calc(100vw - 1.5rem));
  }

  .figure-frame {
    width: 100%;
  }

  .figure-frame img {
    max-width: 138%;
    max-height: min(28dvh, 15rem);
    margin-left: 0;
  }

  .curtain-intro__panel {
    width: 56vw;
  }

  .hero-flowers {
    max-height: min(13dvh, 5rem);
  }

  .figure-card {
    width: min(34vw, 7.7rem);
    bottom: 1rem;
  }

  .figure-card-left {
    left: -0.35rem;
    transform: rotate(-3deg);
  }

  .figure-card-right {
    right: -0.35rem;
    transform: rotate(3deg);
  }

  .figure-frame {
    width: 100%;
  }

  .figure-frame img {
    max-width: 140%;
    max-height: min(29dvh, 15.5rem);
  }

  .hero-title span {
    font-size: clamp(3rem, 14vw, 4.35rem);
  }

  .hero-phrase {
    max-width: 16rem;
    font-size: clamp(1.14rem, 4.7vw, 1.34rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-preload="loading"],
  body[data-intro="playing"] {
    overflow: auto;
  }

  .preload-screen,
  .curtain-intro {
    display: none;
  }
}
