: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;
  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="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: hidden;
}

.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;
}

.intro-spotlight-canvas {
  position: fixed;
  inset: 0;
  z-index: 21;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 1;
  visibility: visible;
  transition:
    opacity 100ms ease-out,
    visibility 0s linear 0s;
}

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

body[data-intro="done"] .intro-spotlight-canvas {
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 2000ms ease-in,
    visibility 0s linear 2000ms;
}

.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");
  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-blur-canvas,
.chip-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms ease;
}

.chip-blur-canvas {
  z-index: 1;
  filter: blur(22px);
  transform: scale(1.04);
}

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

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

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

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: 32rem;
  height: 32rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 92, 176, 0.38) 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: 38rem;
  height: 38rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(93, 212, 255, 0.34) 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);
  align-items: end;
  gap: clamp(1rem, 2vw, 2rem);
  min-height: min(100vh, 950px);
  padding: clamp(1rem, 4vw, 3rem) 0 2rem;
}

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

.hero-copy {
  position: relative;
  z-index: 2;
  align-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 {
  margin: 0.3rem 0 0;
  font-family: "Astloch", serif;
  font-size: clamp(3.9rem, 8vw, 7rem);
  line-height: 0.92;
  color: var(--pink);
  text-shadow:
    -6px -6px 0 rgba(255, 250, 252, 0.98),
    6px -6px 0 rgba(255, 250, 252, 0.98),
    -6px 6px 0 rgba(255, 250, 252, 0.98),
    6px 6px 0 rgba(255, 250, 252, 0.98),
    0 0 1.4rem rgba(255, 82, 171, 0.26),
    0 0.35rem 0 rgba(71, 32, 83, 0.2);
}

.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 {
  margin: 1rem 0 0;
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(71, 32, 83, 0.62);
}

.figure-card {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 0.8rem;
  transform-origin: bottom center;
  transition:
    transform 500ms ease,
    filter 500ms ease;
}

.figure-card-left {
  transform: translateY(calc(var(--hero-progress) * 22px)) rotate(-5deg);
}

.figure-card-right {
  transform: translateY(calc(var(--hero-progress) * 14px)) rotate(5deg);
}

.figure-frame {
  position: relative;
  width: min(100%, 24rem);
  padding: 1rem 0.5rem 0;
}

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

.figure-frame img {
  display: block;
  width: 100%;
  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));
}

.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-panel {
  position: relative;
  width: min(100%, 1060px);
  margin: 0 auto;
  padding: clamp(1.4rem, 3vw, 2.2rem);
  border: 5px solid var(--border);
  border-radius: 2.4rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.94)),
    var(--panel);
  box-shadow:
    0 28px 58px rgba(71, 32, 83, 0.18),
    inset 0 0 0 5px rgba(255, 255, 255, 0.55);
  overflow: hidden;
}

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

.chapter-panel::before {
  inset: auto -2rem -3rem auto;
  width: 16rem;
  height: 16rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(93, 212, 255, 0.2) 0%, rgba(93, 212, 255, 0) 70%);
}

.chapter-panel::after {
  left: -3rem;
  top: -3rem;
  width: 13rem;
  height: 13rem;
  background:
    radial-gradient(circle, rgba(41, 17, 50, 0.16) 0 1.5px, transparent 2px);
  background-size: 14px 14px;
  opacity: 0.45;
}

.chapter-label {
  display: inline-flex;
  margin: 0;
  padding: 0.35rem 0.8rem;
  border: 3px solid var(--border);
  border-radius: 999px;
  background: #fff9e8;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.chapter-panel h2 {
  margin: 0.8rem 0 0;
  font-family: "Astloch", serif;
  font-size: clamp(2.8rem, 6vw, 5.1rem);
  line-height: 0.94;
  color: var(--pink);
}

.chapter-intro {
  max-width: 40rem;
  margin: 0.9rem 0 0;
  font-size: clamp(1.45rem, 2.7vw, 2rem);
  line-height: 1.08;
  color: var(--ink-soft);
}

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

.info-card {
  position: relative;
  display: grid;
  gap: 0.45rem;
  padding: 1.1rem 1rem;
  border: 3px solid rgba(38, 12, 58, 0.16);
  border-radius: 1.5rem;
  background: rgba(255, 255, 255, 0.7);
}

.info-card-accent,
.info-card-wide {
  background:
    linear-gradient(180deg, rgba(255, 95, 180, 0.08), rgba(93, 212, 255, 0.08)),
    rgba(255, 255, 255, 0.82);
}

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

.info-title {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(38, 12, 58, 0.6);
}

.info-card strong {
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  line-height: 1;
}

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

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

.rsvp-box {
  display: grid;
  justify-items: center;
  gap: 1rem;
  margin-top: 1.6rem;
}

.deadline {
  margin: 0;
  font-size: clamp(1.35rem, 2.3vw, 1.85rem);
  font-weight: 700;
}

.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 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: 1fr 1fr;
  }

  .hero-copy {
    grid-column: 1 / -1;
    order: -1;
    margin-bottom: 0.8rem;
  }

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

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

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

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

  .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: repeat(2, minmax(0, 1fr));
    min-height: auto;
    padding-top: 1rem;
    column-gap: 0.35rem;
  }

  .hero-copy {
    grid-column: 1 / -1;
  }

  .figure-card {
    align-self: end;
  }

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

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

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

  .figure-frame img {
    width: 136%;
    max-width: none;
    margin-left: -18%;
  }

  .hero-copy h1 {
    text-shadow:
      -4px -4px 0 rgba(255, 250, 252, 0.96),
      4px -4px 0 rgba(255, 250, 252, 0.96),
      -4px 4px 0 rgba(255, 250, 252, 0.96),
      4px 4px 0 rgba(255, 250, 252, 0.96);
  }

  .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 {
    border-radius: 1.6rem;
  }

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

@media (max-width: 390px) {
  .hero-stage {
    column-gap: 0.15rem;
  }

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

  .figure-frame img {
    width: 132%;
    margin-left: -16%;
  }

  .curtain-intro__panel {
    width: 56vw;
  }
}

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

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