:root {
  --crimson: #8b1e24;
  --crimson-dark: #631116;
  --paper: #fdfaf6;
  --gold: #e5c158;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Poppins', sans-serif;
  background-color: #160a0c;
  color: #fff;
  overflow-x: hidden;
  min-height: 100vh;
}

body.lock-scroll {
  overflow: hidden;
  height: 100vh;
}

.hidden {
  display: none !important;
}

.relative-z {
  position: relative;
  z-index: 2;
}

/* =========================================
   BINGKAI UTAMA TAMPILAN HP (430px)
   ========================================= */
.mobile-shell {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  background-color: var(--crimson);
  position: relative;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.85);
  overflow-x: hidden;
}

/* =========================================
   ANIMASI FOTO GERAK-GERAK TERUS MENERUS
   ========================================= */
@keyframes floatEnvelope {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(1.5deg); }
}

@keyframes floatCardA {
  0%, 100% { transform: translateY(0px) rotate(-2.5deg); }
  50% { transform: translateY(-8px) rotate(0.5deg); }
}

@keyframes floatCardB {
  0%, 100% { transform: translateY(-4px) rotate(2.5deg); }
  50% { transform: translateY(7px) rotate(-0.5deg); }
}

@keyframes swayLeft {
  0%, 100% { transform: rotate(-2.5deg) translateY(0px); }
  50% { transform: rotate(1deg) translateY(-7px); }
}

@keyframes swayRight {
  0%, 100% { transform: rotate(2.5deg) translateY(0px); }
  50% { transform: rotate(-1deg) translateY(-7px); }
}

@keyframes bgZoomPan {
  0% { transform: scale(1) translate(0px, 0px); }
  50% { transform: scale(1.09) translate(-6px, -6px); }
  100% { transform: scale(1) translate(0px, 0px); }
}

@keyframes kenBurnsPhoto {
  0% { transform: scale(1); }
  50% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

@keyframes bounceGentle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes popIn {
  0% { opacity: 0; transform: scale(0.9) translateY(16px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes spinVinyl {
  100% { transform: rotate(360deg); }
}

.float-envelope { animation: floatEnvelope 3.2s ease-in-out infinite; }
.float-a { animation: floatCardA 3.8s ease-in-out infinite; }
.float-b { animation: floatCardB 4.2s ease-in-out infinite; }
.sway-left { animation: swayLeft 4.4s ease-in-out infinite; }
.sway-right { animation: swayRight 4.8s ease-in-out infinite; }
.bounce-gentle { animation: bounceGentle 2s ease-in-out infinite; }
.animate-pop { animation: popIn 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards; }

/* =========================================
   ANIMASI MUNCUL SAAT DI-SCROLL
   ========================================= */
.js-ready .reveal-box {
  opacity: 0;
  transition: opacity 0.75s ease, transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}

.js-ready .reveal-up { transform: translateY(36px); }
.js-ready .reveal-left { transform: translateX(-32px); }
.js-ready .reveal-right { transform: translateX(32px); }
.js-ready .reveal-zoom { transform: scale(0.88); }
.js-ready .reveal-stagger { transform: translateY(32px) scale(0.93); }

.js-ready .reveal-box.is-visible {
  opacity: 1;
  transform: translate(0, 0) scale(1);
}

/* =========================================
   1. LAYAR PEMBUKA AMPLOP
   ========================================= */
.envelope-overlay {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 430px;
  margin: 0 auto;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background-color: var(--crimson-dark);
  transition: opacity 0.65s ease;
  overflow: hidden;
  cursor: pointer;
}

.envelope-bg {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-size: cover;
  background-position: center;
  filter: blur(4px) brightness(0.52);
  animation: bgZoomPan 16s ease-in-out infinite;
  pointer-events: none;
}

.envelope-content {
  position: relative;
  z-index: 5;
  padding: 20px;
}

.script-title {
  font-family: 'Great Vibes', cursive;
  font-size: 2.6rem;
  margin-bottom: 16px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.envelope-box {
  width: 215px;
  height: 140px;
  background: #a9232b;
  border-radius: 8px;
  margin: 0 auto 14px;
  position: relative;
  cursor: pointer;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  border: 2px solid #d1434c;
}

.envelope-flap {
  position: absolute;
  top: 0;
  left: 0;
  border-left: 107px solid transparent;
  border-right: 107px solid transparent;
  border-top: 80px solid #82151c;
  pointer-events: none;
}

.wax-seal {
  position: absolute;
  top: 52%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  background: radial-gradient(circle, #f8e082, #c49526);
  color: #7c181e;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.tap-hint {
  font-size: 0.86rem;
  letter-spacing: 0.4px;
  opacity: 0.92;
}

/* TOMBOL MUSIK MENGAMBANG */
.music-fab {
  position: fixed;
  bottom: 18px;
  right: 18px;
  right: max(18px, calc(50% - 195px));
  z-index: 90;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: #1db954;
  color: #fff;
  font-size: 1.15rem;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
}

/* =========================================
   2. HERO BANNER (BACKGROUND FOTO SENDIRI)
   ========================================= */
.hero-section {
  min-height: 86vh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  background-color: #d9b8ba;
}

.hero-bg-zoom {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-size: cover;
  background-position: center;
  animation: bgZoomPan 18s ease-in-out infinite;
  z-index: 0;
}

.hero-overlay {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 86vh;
  background: rgba(255, 255, 255, 0.36);
  backdrop-filter: blur(1px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px 18px;
}

.hero-title {
  font-family: 'Great Vibes', cursive;
  font-size: 3.15rem;
  color: var(--crimson);
  line-height: 1.12;
  text-shadow: 0 2px 14px rgba(255, 255, 255, 0.95);
}

.sub-script {
  display: block;
  font-size: 0.52em;
  margin-top: 10px;
}

.flourish-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  color: var(--crimson);
}

.flourish-line span {
  width: 58px;
  height: 1.5px;
  background: var(--crimson);
}

.scroll-cue {
  position: absolute;
  bottom: 22px;
  font-size: 0.78rem;
  color: var(--crimson-dark);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.85);
  padding: 6px 15px;
  border-radius: 20px;
  animation: bounceGentle 2s ease-in-out infinite;
}

/* SECTION UMUM (OTOMATIS MENDUKUNG BACKGROUND FOTO) */
.crimson-section {
  padding: 50px 16px;
  background-color: var(--crimson);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  position: relative;
  overflow: hidden;
}

.section-script-heading {
  font-family: 'Great Vibes', cursive;
  font-size: 2.35rem;
  text-align: center;
  margin-bottom: 26px;
  color: #fff;
  line-height: 1.15;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

/* =========================================
   3. KARTU UCAPAN & 2 FOTO KOLASE HP
   ========================================= */
.mobile-duo-photos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 24px;
}

.photo-card {
  background: #fff;
  padding: 7px 7px 18px;
  border-radius: 4px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
}

.photo-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.bordered-message-box {
  border: 1.5px solid rgba(255, 255, 255, 0.8);
  padding: 24px 18px;
  text-align: center;
  border-radius: 4px;
  background: rgba(99, 17, 22, 0.48);
  backdrop-filter: blur(2px);
}

.bordered-message-box h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.bordered-message-box p {
  font-family: 'Playfair Display', serif;
  font-size: 0.9rem;
  line-height: 1.72;
  color: #f7eaea;
}

/* =========================================
   4. LAYER BACKGROUND FOTO TIAP SECTION
   ========================================= */
.section-bg-zoom {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-size: cover;
  background-position: center;
  animation: bgZoomPan 20s ease-in-out infinite;
  z-index: 0;
}

.crimson-photo-tint {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(115, 18, 24, 0.72);
  z-index: 1;
}

.mobile-connecting-line {
  position: absolute;
  top: 70px;
  left: 0;
  width: 100%;
  height: calc(100% - 80px);
  pointer-events: none;
  z-index: 1;
}

.mobile-connecting-line path {
  fill: none;
  stroke: rgba(255, 255, 255, 0.45);
  stroke-width: 2.2;
  stroke-dasharray: 6 6;
}

.polaroid-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px 14px;
  padding-bottom: 18px;
}

.col-right-offset {
  margin-top: 18px;
}

.polaroid {
  background: #fff;
  padding: 8px 8px 20px;
  border-radius: 3px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
  color: #444;
  text-align: center;
}

.polaroid img {
  width: 100%;
  height: 145px;
  object-fit: cover;
  display: block;
  margin-bottom: 6px;
}

.polaroid span {
  font-family: 'Great Vibes', cursive;
  font-size: 1.15rem;
  color: var(--crimson);
}

/* =========================================
   5. ROLL FILM + ZOOM FOTO
   ========================================= */
.caps-subtitle {
  font-family: 'Playfair Display', serif;
  letter-spacing: 2px;
  font-size: 0.82rem;
  margin: 14px 0;
  text-align: center;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
}

.film-strip {
  background: #141414;
  padding: 14px 10px;
  border-radius: 4px;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.45);
}

.film-holes {
  height: 10px;
  background-image: repeating-linear-gradient(
    to right,
    #fff 0px,
    #fff 12px,
    transparent 12px,
    transparent 24px
  );
  opacity: 0.85;
}

.film-frames {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 10px 0;
}

.ken-burns-box {
  overflow: hidden;
  height: 165px;
  background: #242424;
}

.ken-burns-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: kenBurnsPhoto 9s ease-in-out infinite;
}

.text-center {
  text-align: center;
}

.mini-mail-link {
  display: inline-block;
  margin-top: 8px;
  color: #fff;
  text-decoration: none;
  border: 1px dashed rgba(255, 255, 255, 0.75);
  background: rgba(99, 17, 22, 0.4);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
}

/* =========================================
   6. KERTAS SURAT
   ========================================= */
.paper-sheet {
  background: var(--paper);
  color: #2c2222;
  padding: 28px 20px;
  border-radius: 4px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
}

.paper-photo {
  position: relative;
  max-width: 175px;
  margin: 0 auto 22px;
}

.washi-tape {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(-3deg);
  width: 64px;
  height: 20px;
  background: rgba(139, 30, 36, 0.35);
  z-index: 4;
}

.paper-text p {
  font-family: 'Playfair Display', serif;
  font-size: 0.92rem;
  line-height: 1.75;
  margin-bottom: 13px;
}

/* =========================================
   7. KOLASE PIKNIK
   ========================================= */
.gingham-cloth {
  position: relative;
  padding: 22px 16px;
  border-radius: 12px;
  background-color: #fff;
  background-image:
    linear-gradient(90deg, rgba(196, 43, 51, 0.35) 50%, transparent 50%),
    linear-gradient(rgba(196, 43, 51, 0.35) 50%, transparent 50%);
  background-size: 28px 28px;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.35);
}

.picnic-photos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.camera-lens-btn {
  position: absolute;
  bottom: -14px;
  right: -8px;
  width: 48px;
  height: 48px;
  background: #1b1b1b;
  color: #fff;
  border: 3px solid #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
}

/* =========================================
   8. VINYL & SPOTIFY
   ========================================= */
.vinyl-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
}

.vinyl-disc {
  width: 215px;
  height: 215px;
  border-radius: 50%;
  background:
    repeating-radial-gradient(circle, #181818 0px, #181818 4px, #262626 5px, #141414 7px);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5);
  border: 4px solid #0d0d0d;
}

.vinyl-disc.spinning {
  animation: spinVinyl 8s linear infinite;
}

.vinyl-label {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid #fff;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
}

.vinyl-label img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.spotify-wrapper {
  width: 100%;
}

.spotify-embed-box {
  margin: 14px 0 20px;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.35);
  border-radius: 12px;
  overflow: hidden;
  min-height: 152px;
}

.spotify-embed-box iframe {
  width: 100% !important;
  height: 152px !important;
  border: 0;
  display: block;
}

.click-here-link {
  background: transparent;
  border: none;
  color: #fff;
  text-decoration: underline;
  font-size: 0.95rem;
  cursor: pointer;
}

/* =========================================
   9. LAYAR PENUTUP
   ========================================= */
.ending-overlay {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 430px;
  margin: 0 auto;
  z-index: 950;
  overflow: hidden;
  background-color: var(--crimson-dark);
}

.ending-backdrop {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  background: rgba(99, 17, 22, 0.45);
  backdrop-filter: blur(1.5px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
}

.white-glow {
  color: #fff;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.65);
}

.tap-hint-btn {
  margin-top: 22px;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  border: 1px solid #fff;
  padding: 8px 22px;
  border-radius: 20px;
  cursor: pointer;
}

/* =========================================
   MODAL QR CODE (?qr=1)
   ========================================= */
.qr-modal {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 430px;
  margin: 0 auto;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.qr-card {
  background: #fff;
  color: #222;
  padding: 24px;
  border-radius: 14px;
  text-align: center;
  width: 100%;
  max-width: 310px;
}

#qrcode-container {
  margin: 16px auto;
  display: flex;
  justify-content: center;
}

.qr-url-text {
  font-size: 0.78rem;
  color: #666;
  word-break: break-all;
  margin-bottom: 14px;
}

.qr-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.btn-primary {
  background: var(--crimson);
  color: #fff;
  border: none;
  padding: 9px 14px;
  border-radius: 8px;
  cursor: pointer;
}

.btn-secondary {
  background: #ddd;
  color: #222;
  border: none;
  padding: 9px 14px;
  border-radius: 8px;
  cursor: pointer;
}