:root {
  --brown: #66512d;
  --dark-brown: #43351f;
  --ink: #f8efdd;
  --gold-accent: #d8c39a;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--brown);
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--brown);
  color: var(--ink);
  font-family: Georgia, 'Times New Roman', serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.invitation-locked {
  overflow: hidden;
  touch-action: none;
}

@font-face {
  font-family: 'SEGO';
  src: url('SEGO.ttf') format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Dreaming Outloud Sans';
  src: url('dreaming-outloud-pro-regular.otf') format('opentype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

/* Base page structure */
.design-page {
  width: 100%;
  background: var(--brown);
  line-height: 0;
}

.design-page img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 1080px;
  margin: 0 auto;
}

@media (min-width: 1081px) {
  body {
    background: var(--dark-brown);
  }
  .design-page {
    background: var(--dark-brown);
  }
  .design-page img {
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.25);
  }
}

/* Kinetic letter animation - Silky smooth glide */
.letter {
  display: inline-block;
  opacity: 0;
  transform: translate3d(0, 16px, 0);
  animation: letter-in 0.85s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: var(--letter-delay);
  will-change: transform, opacity;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.letter.space {
  width: 0.28em;
}

@keyframes letter-in {
  from {
    opacity: 0;
    transform: translate3d(0, 16px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

/* Pause letter animations until section enters viewport */
.design-page:not(.cover-page):not(.in-view) [data-animate-text] .letter {
  animation-play-state: paused;
}

.design-page.in-view [data-animate-text] .letter {
  animation-play-state: running;
}

/* =========================================================
   PAGE 1: COVER PAGE
   ========================================================= */
.cover-page {
  position: relative;
  width: 100%;
  min-height: 100svh;
  min-height: 100dvh;
  height: 100svh;
  height: 100dvh;
  max-width: 100%;
  margin: 0 auto;
  overflow: hidden;
  background: #66512d;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cover-stage {
  position: relative;
  container-type: inline-size;
  width: min(100vw, calc((100dvh - env(safe-area-inset-bottom, 0px)) * (1080 / 1920)));
  height: min(calc(100dvh - env(safe-area-inset-bottom, 0px)), calc(100vw * (1920 / 1080)));
  max-width: 1080px;
  max-height: 1920px;
  aspect-ratio: 1080 / 1920;
  overflow: hidden;
  background: #66512d;
}

.cover-stage > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}

.cover-bg {
  z-index: 1;
}

.cover-asset {
  z-index: 2;
  transform-origin: 50% 50%;
  animation: wayang-vertical-spin 8s ease-in-out infinite;
  filter: drop-shadow(0 16px 12px rgba(42, 31, 13, 0.18));
  backface-visibility: visible;
}

@keyframes wayang-vertical-spin {
  0%, 100% {
    transform: perspective(1100px) rotateY(-8deg) translateY(2px);
  }
  25% {
    transform: perspective(1100px) rotateY(0deg) translateY(-3px);
  }
  50% {
    transform: perspective(1100px) rotateY(180deg) translateY(-5px);
  }
  75% {
    transform: perspective(1100px) rotateY(350deg) translateY(-3px);
  }
}

.cover-copy {
  position: absolute;
  z-index: 3;
  top: 23.6%;
  left: 8%;
  width: 84%;
  text-align: center;
  color: #f8efdd;
  font-family: 'SEGO', 'Segoe Script', 'SignPainter', cursive;
}

.cover-eyebrow {
  font: 500 clamp(22px, 5.2cqw, 60px) / 0.9 'SEGO', 'Segoe Script', 'SignPainter', cursive;
  margin: 0 0 10px;
}

.cover-copy h1 {
  font: 600 clamp(28px, 6.8cqw, 74px) / 0.85 'SEGO', 'Segoe Script', 'SignPainter', cursive;
  margin: 0;
}

.cover-date {
  font: 600 clamp(20px, 4.4cqw, 48px) 'SEGO', 'Segoe Script', 'SignPainter', cursive;
  margin: 16px 0 0;
}

.guest-name {
  position: absolute;
  z-index: 4;
  left: 6%;
  width: 88%;
  text-align: center;
  color: #f8efdd;
  top: 84.8%;
  font: 600 clamp(16px, 3.2cqw, 36px) 'Cormorant Garamond', Georgia, serif;
  margin: 0;
  overflow-wrap: anywhere;
  letter-spacing: 0.02em;
}

.open-invitation {
  position: absolute;
  z-index: 5;
  top: 90.5%;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: clamp(8px, 1.4cqw, 12px) clamp(20px, 3.4cqw, 32px);
  border: 1px solid rgba(248, 239, 221, 0.85);
  border-radius: 999px;
  color: #f8efdd;
  background: rgba(102, 81, 45, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  font: 600 clamp(13px, 1.8cqw, 20px) 'Cormorant Garamond', Georgia, serif;
  letter-spacing: 0.03em;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.22);
  transition: background 0.25s, transform 0.25s, box-shadow 0.25s;
  white-space: nowrap;
}

.open-invitation:hover, .open-invitation:focus-visible {
  background: rgba(248, 239, 221, 0.22);
  transform: translateX(-50%) translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  outline: none;
}

.open-invitation:active {
  transform: translateX(-50%) translateY(0);
}

.open-invitation span {
  font-size: 1.15em;
  line-height: 0.7;
}

/* =========================================================
   PAGE 2: COUPLE PAGE
   ========================================================= */
.couple-page {
  position: relative;
  max-width: 1080px;
  margin: 0 auto;
  aspect-ratio: 1080 / 1920;
  overflow: hidden;
  background: #66512d;
}

.couple-page > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}

.couple-bg {
  z-index: 1;
}

.couple-flower {
  z-index: 2;
  object-fit: contain !important;
}

.flower-top-left {
  inset: 18% auto auto 0 !important;
  width: 49% !important;
  height: auto !important;
  --flower-delay: 0.05s;
}

.flower-top-right {
  inset: 19% 0 auto auto !important;
  width: 44% !important;
  height: auto !important;
  --flower-delay: 0.2s;
}

.flower-bottom-left {
  inset: auto auto -1% -1% !important;
  width: 34% !important;
  height: auto !important;
  --flower-delay: 0.35s;
}

.flower-bottom-right {
  inset: auto -1% -8% auto !important;
  width: 34% !important;
  height: auto !important;
  --flower-delay: 0.5s;
}

.page2-copy {
  position: absolute;
  z-index: 3;
  top: 8.4%;
  left: 7%;
  width: 86%;
  text-align: center;
  color: #f8efdd;
  font-family: 'SEGO', 'Segoe Script', 'SignPainter', cursive;
}

.page2-eyebrow {
  font: 500 clamp(24px, 5vw, 58px) / 0.9 'SEGO', 'Segoe Script', 'SignPainter', cursive;
  margin: 0 0 10px;
}

.page2-copy h2 {
  font: 600 clamp(30px, 6vw, 70px) / 0.85 'SEGO', 'Segoe Script', 'SignPainter', cursive;
  margin: 0;
}

.page2-copy .letter {
  animation-delay: calc(var(--letter-delay) + 0.25s);
}

.couple-page .couple-flower {
  opacity: 0;
  transform: translate3d(0, 28px, 0) scale(0.96);
  animation: none !important;
}

.couple-page.in-view .couple-flower {
  animation: flower-reveal 1.15s cubic-bezier(0.2, 0.75, 0.25, 1) var(--flower-delay) forwards,
             flower-drift 6s ease-in-out calc(var(--flower-delay) + 1.15s) infinite !important;
}

@keyframes flower-drift {
  0%, 100% {
    transform: translate3d(0, 0, 0) rotate(-0.6deg);
  }
  50% {
    transform: translate3d(0, -8px, 0) rotate(0.8deg);
  }
}

@keyframes flower-reveal {
  from {
    opacity: 0;
    transform: translate3d(0, 28px, 0) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

/* =========================================================
   PAGE 3: QURAN VERSE PAGE
   ========================================================= */
.quran-page {
  position: relative;
  max-width: 1080px;
  margin: 0 auto;
  aspect-ratio: 1080 / 1920;
  overflow: hidden;
  background: #f5ecd9;
}

.quran-page > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}

.quran-bg {
  z-index: 1;
}

.quran-frame {
  z-index: 2;
}

.quran-copy {
  position: absolute;
  z-index: 3;
  top: 32.8%;
  left: 16%;
  width: 68%;
  height: 38%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #6a552f;
  font-family: 'Dreaming Outloud Sans', 'Dreaming Outloud', 'SEGO', cursive;
}

.quran-lines {
  width: 100%;
  text-align: center;
}

.quran-copy .quote-line {
  font: 400 clamp(13px, 2.3vw, 26px) / 1.5 'Dreaming Outloud Sans', 'Dreaming Outloud', 'SEGO', cursive;
  margin: 0;
  white-space: nowrap;
}

.quran-copy .quote-ref {
  font: 400 clamp(14px, 2.4vw, 27px) / 1.5 'Dreaming Outloud Sans', 'Dreaming Outloud', 'SEGO', cursive;
  margin: 12px 0 0;
}

.quran-copy .letter {
  animation-duration: 0.45s;
  animation-play-state: paused;
}

.quran-page.in-view .quran-copy .letter {
  animation-play-state: running;
}

/* =========================================================
   PAGE 4: BRIDE & GROOM PAGE
   ========================================================= */
.bridegroom-page {
  position: relative;
  max-width: 1080px;
  margin: 0 auto;
  aspect-ratio: 1080 / 1920;
  overflow: hidden;
  background: #66512d;
}

.bridegroom-page > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}

.bridegroom-bg {
  z-index: 1;
}

.bridegroom-asset {
  z-index: 2;
  object-fit: contain !important;
  height: auto !important;
}

.bridegroom-flower-left {
  inset: auto auto -1% 0 !important;
  width: 38% !important;
}

.bridegroom-flower-right {
  inset: auto 0 -1% auto !important;
  width: 40% !important;
}

.janur-asset {
  inset: -1% -2% auto auto !important;
  width: 48% !important;
  transform-origin: 68% 12%;
  animation: janur-wind 4.8s ease-in-out infinite;
  filter: drop-shadow(0 8px 8px rgba(37, 29, 14, 0.14));
}

@keyframes janur-wind {
  0%, 100% {
    transform: rotate(-0.8deg) skewX(0deg);
  }
  25% {
    transform: rotate(0.4deg) skewX(-0.6deg) translateX(-2px);
  }
  50% {
    transform: rotate(1.5deg) skewX(1deg) translateX(3px);
  }
  75% {
    transform: rotate(0.3deg) skewX(-0.4deg) translateX(-1px);
  }
}

.bridegroom-title {
  position: absolute;
  z-index: 4;
  top: 9.2%;
  left: 10%;
  width: 80%;
  margin: 0;
  text-align: center;
  color: #f8efdd;
  font: 400 clamp(30px, 6vw, 75px) / 0.9 'SEGO', 'Segoe Script', cursive;
  pointer-events: none;
}

.instagram-hit {
  position: absolute;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(248, 239, 221, 0.3);
}

.instagram-budi {
  left: 62.5%;
  top: 38.3%;
  width: 10%;
  height: 4.8%;
  min-width: 44px;
  min-height: 44px;
  transform: translate(-10%, -10%);
}

.instagram-nida {
  left: 27%;
  top: 63.9%;
  width: 10%;
  height: 4.8%;
  min-width: 44px;
  min-height: 44px;
  transform: translate(-10%, -10%);
}

.instagram-hit::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: transparent;
  transition: background 0.2s;
}

.instagram-hit:active::after {
  background: rgba(248, 239, 221, 0.25);
}

/* =========================================================
   PAGE 5: WEDDING EVENT PAGE
   ========================================================= */
.wedding-event-page {
  position: relative;
  max-width: 1080px;
  margin: 0 auto;
  aspect-ratio: 1080 / 1920;
  overflow: hidden;
  background: #66512d;
  color: #f8efdd;
}

.wedding-event-bg {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover;
  box-shadow: none !important;
}

.wedding-event-copy {
  position: absolute;
  z-index: 2;
  inset: 0 6% 32%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
}

.wedding-event-title {
  margin: 10% 0 0;
  font: 400 clamp(28px, 5.8vw, 62px) / 1 'SEGO', 'Segoe Script', cursive;
  letter-spacing: 0.01em;
}

.event-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(14px, 3vh, 44px);
  margin-top: clamp(20px, 4.5vh, 56px);
  width: 100%;
}

.event-card {
  width: 100%;
}

.event-card h3 {
  margin: 0 0 clamp(4px, 1.2vh, 14px);
  font: 400 clamp(24px, 5vw, 56px) / 1 'SEGO', 'Segoe Script', cursive;
}

.event-card p {
  margin: 0;
  font: 400 clamp(14px, 2.8vw, 30px) / 1.55 'Dreaming Outloud Sans', 'SEGO', cursive;
  letter-spacing: 0.015em;
}

.maps-picker {
  position: relative;
  display: inline-block;
  margin-top: clamp(10px, 1.8vh, 18px);
}

.maps-button {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  padding: 0.55em 1.1em;
  border: 1px solid rgba(248, 239, 221, 0.85);
  border-radius: 999px;
  color: #f8efdd;
  background: rgba(102, 81, 45, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  font: 600 clamp(13px, 2vw, 20px) / 1 'Cormorant Garamond', Georgia, serif;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  transition: background 0.25s, transform 0.25s;
}

.maps-button:hover, .maps-picker.open .maps-button {
  background: rgba(248, 239, 221, 0.2);
  transform: translateY(-2px);
}

.maps-icon {
  width: 1.15em;
  height: 1.15em;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

.maps-button span {
  font-size: 1.05em;
}

.map-links {
  position: absolute;
  z-index: 10;
  left: 50%;
  bottom: calc(100% + 10px);
  display: grid;
  gap: 7px;
  min-width: 205px;
  padding: 10px;
  border: 1px solid rgba(248, 239, 221, 0.5);
  border-radius: 14px;
  background: rgba(67, 53, 31, 0.98);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 6px);
  transition: opacity 0.2s, transform 0.2s;
}

.maps-picker.open .map-links {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.map-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 9px 12px;
  border-radius: 8px;
  color: #f8efdd;
  font: 600 clamp(13px, 1.8vw, 18px) / 1 'Cormorant Garamond', Georgia, serif;
  text-decoration: none;
  white-space: nowrap;
}

.map-links a:hover {
  background: rgba(248, 239, 221, 0.16);
}

.wedding-event-page [data-animate-text] .letter {
  animation-duration: 0.65s;
}

.wedding-event-page:not(.in-view) [data-animate-text] .letter {
  animation-play-state: paused;
}

.wedding-event-page.in-view [data-animate-text] .letter {
  animation-play-state: running;
}

/* =========================================================
   PAGE 7: GALLERY PAGE & LIGHTBOX
   ========================================================= */
.gallery-page {
  position: relative;
  max-width: 1080px;
  margin: 0 auto;
  aspect-ratio: 1080 / 1920;
  overflow: hidden;
  background: #eee6d4;
}

.gallery-collage {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover;
  box-shadow: none !important;
}

.gallery-hotspots {
  position: absolute;
  z-index: 2;
  inset: 0;
}

.gallery-hotspot {
  position: absolute;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  transform-origin: center;
  transition: background 0.2s, box-shadow 0.2s;
}

.gallery-hotspot:hover, .gallery-hotspot:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.8);
  outline: none;
}

.gallery-hotspot-1 { left: 6.5%; top: 18.2%; width: 36%; height: 16.2%; transform: rotate(-11deg); }
.gallery-hotspot-2 { left: 11.5%; top: 32.1%; width: 36%; height: 14%; transform: rotate(-11deg); }
.gallery-hotspot-3 { left: 16%; top: 46.4%; width: 31%; height: 15%; transform: rotate(-11deg); }
.gallery-hotspot-4 { left: 21%; top: 61%; width: 28%; height: 14.5%; transform: rotate(-11deg); }
.gallery-hotspot-5 { left: 58%; top: 28.4%; width: 37%; height: 14%; transform: rotate(12deg); }
.gallery-hotspot-6 { left: 54%; top: 41.7%; width: 35%; height: 13%; transform: rotate(12deg); }
.gallery-hotspot-7 { left: 49%; top: 54.2%; width: 36%; height: 14.5%; transform: rotate(12deg); }
.gallery-hotspot-8 { left: 43.5%; top: 67.2%; width: 37%; height: 15.5%; transform: rotate(12deg); }

.lightbox {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 40px);
  background: rgba(18, 14, 9, 0.94);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.lightbox.open {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.lightbox[hidden] {
  display: none !important;
}

.lightbox-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: min(88vw, 860px);
  max-height: 86dvh;
}

.lightbox-image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(78dvh, 920px);
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 16px 60px rgba(0, 0, 0, 0.6);
  user-select: none;
  -webkit-user-select: none;
  cursor: pointer;
  /* Prevent any alt text flash */
  font-size: 0;
  color: transparent;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Tap zones over the image: left for prev, right for next */
.lightbox-tap-zone {
  position: absolute;
  top: 0;
  bottom: 34px;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  z-index: 3;
}

.lightbox-tap-prev {
  left: 0;
  width: 38%;
  cursor: w-resize;
}

.lightbox-tap-next {
  right: 0;
  width: 62%;
  cursor: e-resize;
}

/* Nav arrow buttons on left and right */
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 48px;
  height: 48px;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid rgba(248, 239, 221, 0.6);
  border-radius: 50%;
  color: #f8efdd;
  background: rgba(30, 24, 16, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
  padding: 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.lightbox-nav:hover {
  background: rgba(216, 195, 154, 0.35);
  border-color: rgba(248, 239, 221, 0.95);
  transform: translateY(-50%) scale(1.08);
}

.lightbox-nav:active {
  transform: translateY(-50%) scale(0.95);
}

.lightbox-prev {
  left: max(16px, env(safe-area-inset-left, 16px));
}

.lightbox-next {
  right: max(16px, env(safe-area-inset-right, 16px));
}

@media (max-width: 600px) {
  .lightbox-nav {
    width: 42px;
    height: 42px;
    background: rgba(20, 16, 10, 0.75);
  }
  .lightbox-prev {
    left: max(8px, env(safe-area-inset-left, 8px));
  }
  .lightbox-next {
    right: max(8px, env(safe-area-inset-right, 8px));
  }
  .lightbox-stage {
    max-width: 96vw;
  }
}

.lightbox-counter {
  margin-top: 12px;
  padding: 4px 14px;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(248, 239, 221, 0.25);
  color: #f8efdd;
  font-family: 'SEGO', Georgia, serif;
  font-size: 13px;
  letter-spacing: 1px;
  pointer-events: none;
  z-index: 2;
  user-select: none;
}

.lightbox-close {
  position: absolute;
  top: max(16px, env(safe-area-inset-top, 16px));
  right: max(16px, env(safe-area-inset-right, 16px));
  z-index: 10;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(248, 239, 221, 0.8);
  border-radius: 50%;
  color: #f8efdd;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  font: 300 28px / 1 Georgia, serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
}

.lightbox-close:hover {
  background: rgba(248, 239, 221, 0.25);
  transform: scale(1.06);
}

/* =========================================================
   PAGE 8: RSVP & WISHES MODAL
   ========================================================= */
.rsvp-page {
  position: relative;
  max-width: 1080px;
  margin: 0 auto;
  aspect-ratio: 1080 / 1920;
  overflow: hidden;
  background: #66512d;
}

.rsvp-design {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover;
  box-shadow: none !important;
}

.rsvp-hotspots {
  position: absolute;
  z-index: 2;
  inset: 0;
}

.rsvp-hotspot {
  position: absolute;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 12px;
  transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
}

.rsvp-hotspot:hover, .rsvp-hotspot:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 0 2px rgba(112, 75, 35, 0.55);
  outline: none;
}

.rsvp-hotspot:active {
  transform: scale(0.96);
  background: rgba(255, 255, 255, 0.2);
}

.rsvp-hotspot-attend { left: 24%; top: 45.8%; width: 21%; height: 4.2%; }
.rsvp-hotspot-decline { left: 54.5%; top: 45.8%; width: 22%; height: 4.2%; }
.rsvp-hotspot-wishes { left: 38.5%; top: 66.2%; width: 24%; height: 4.6%; }

.wishes-modal {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(20, 16, 10, 0.85);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.wishes-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.wishes-panel {
  position: relative;
  width: min(100%, 430px);
  max-height: min(85dvh, 580px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 32px 24px 24px;
  border: 1px solid #d8c39a;
  border-radius: 18px;
  background: #eee3ca;
  color: #66512d;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.4);
}

.wishes-panel h2 {
  margin: 0 0 8px;
  text-align: center;
  font: 400 clamp(28px, 6vw, 44px) / 1 'SEGO', 'Segoe Script', cursive;
}

.wishes-panel > p {
  margin: 0 0 20px;
  text-align: center;
  font: 400 16px / 1.4 'Dreaming Outloud Sans', 'SEGO', cursive;
}

.wishes-panel label {
  display: block;
  margin: 12px 0 6px;
  font: 600 16px / 1 'Cormorant Garamond', Georgia, serif;
}

.wishes-panel input, .wishes-panel textarea {
  display: block;
  width: 100%;
  border: 1px solid #b89d6e;
  border-radius: 9px;
  padding: 11px 12px;
  color: #66512d;
  background: #f8efdd;
  font: 400 16px / 1.35 'Dreaming Outloud Sans', 'SEGO', cursive;
  resize: vertical;
}

.wishes-panel input:focus, .wishes-panel textarea:focus {
  border-color: #66512d;
  outline: 2px solid rgba(102, 81, 45, 0.25);
}

.wishes-status {
  min-height: 1.2em;
  margin: 12px 0 0;
  text-align: center;
  color: #8b3f2e;
  font: 400 15px / 1.3 'Cormorant Garamond', Georgia, serif;
}

.wishes-submit {
  display: block;
  width: 100%;
  margin-top: 18px;
  padding: 12px;
  border: 1px solid #66512d;
  border-radius: 999px;
  color: #f8efdd;
  background: #66512d;
  font: 600 17px / 1 'Cormorant Garamond', Georgia, serif;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.wishes-submit:hover {
  background: #4f3e23;
}

.wishes-submit:active {
  transform: scale(0.98);
}

.wishes-submit:disabled {
  opacity: 0.65;
  cursor: wait;
}

.wishes-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 1px solid #a88d60;
  border-radius: 50%;
  color: #66512d;
  background: transparent;
  font: 300 24px / 1 Georgia, serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.wishes-close:hover {
  background: rgba(102, 81, 45, 0.1);
}

/* =========================================================
   PAGE 9: WEDDING GIFT & TOAST
   ========================================================= */
.gift-page {
  position: relative;
  max-width: 1080px;
  margin: 0 auto;
  aspect-ratio: 1080 / 1920;
  overflow: hidden;
  background: #eee6d4;
}

.gift-design {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover;
  box-shadow: none !important;
}

.gift-actions {
  position: absolute;
  z-index: 2;
  inset: 0;
}

.copy-button {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.52em 1.1em;
  border: 1px solid rgba(102, 81, 45, 0.85);
  border-radius: 999px;
  color: #66512d;
  background: rgba(248, 239, 221, 0.85);
  font: 600 clamp(12px, 1.8vw, 20px) / 1 'Cormorant Garamond', Georgia, serif;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(102, 81, 45, 0.15);
  transition: background 0.25s, transform 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}

.copy-button:hover, .copy-button:focus-visible {
  background: #f8efdd;
  transform: translateX(-50%) translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 81, 45, 0.25);
  outline: none;
}

.copy-button:active {
  transform: translateX(-50%) translateY(0);
}

.copy-account-bni { top: 35.6%; }
.copy-account-mandiri { top: 59.6%; }
.copy-address { top: 85.1%; }

.copy-toast {
  position: fixed;
  z-index: 120;
  left: 50%;
  bottom: max(24px, calc(env(safe-area-inset-bottom, 24px) + 12px));
  padding: 12px 22px;
  border: 1px solid rgba(248, 239, 221, 0.3);
  border-radius: 999px;
  color: #f8efdd;
  background: rgba(67, 53, 31, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  font: 600 clamp(14px, 2.5vw, 17px) / 1 'Cormorant Garamond', Georgia, serif;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.25s, transform 0.25s;
}

.copy-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* =========================================================
   FLOATING MUSIC BUTTON
   ========================================================= */
.music-toggle {
  position: fixed;
  z-index: 90;
  right: max(18px, env(safe-area-inset-right, 18px));
  bottom: max(24px, calc(env(safe-area-inset-bottom, 24px) + 8px));
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid rgba(248, 239, 221, 0.9);
  background: rgba(67, 53, 31, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #f8efdd;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s, background 0.2s, opacity 0.3s;
}

.music-toggle:hover {
  background: rgba(102, 81, 45, 0.95);
  transform: scale(1.08);
}

.music-toggle:active {
  transform: scale(0.95);
}

.music-toggle.playing .music-disc-icon {
  animation: music-spin 4s linear infinite;
}

.music-disc-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes music-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* =========================================================
   ACCESSIBILITY & PREFERS-REDUCED-MOTION
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  .letter {
    opacity: 1;
    transform: none;
    animation: none;
  }
  .cover-asset,
  .janur-asset,
  .couple-flower,
  .couple-page.in-view .couple-flower,
  .music-toggle.playing .music-disc-icon {
    animation: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
  .lightbox, .wishes-modal, .copy-toast {
    transition: none !important;
  }
}
