/* ===== V11 DARK VINTAGE GOLD POSTCARD ===== */
/* Responsive-first: clamp() everywhere, no fixed pixel heights on hero */
/* Struktur: V9 (Rustic Postcard) | Warna: V1 (Dark Luxury Gold) */

/* ─── DESIGN TOKENS ─── */
:root {
  --bg:       #0d0b08;          /* Very dark warm black */
  --bg2:      #141209;
  --fg:       #ede8de;          /* Warm ivory — clearly readable */
  --gray:     #c0b8ae;          /* Secondary text — readable */
  --accent:   #c8a96e;          /* Antique gold */
  --accent-h: #e0bf80;          /* Hover gold */
  --accent2:  #8a7a5a;          /* Muted gold */
  --card:     #1c1812;          /* Warm dark card — distinct from bg */
  --card2:    #221e18;          /* Slightly lighter card surface */
  --border:   #302820;          /* Warm dark border */
  --bd2:      rgba(200,169,110,.25); /* Gold tint border */
  --input:    #171310;
  --muted:    #9a9088;          /* Muted — still readable */
  --serif:    'Cormorant Garamond', Georgia, serif;
  --display:  'Cinzel', serif;
  --script:   'Italianno', cursive;
  --sans:     'Jost', sans-serif;
  --bali:     'Noto Serif Balinese', serif;
}

/* ─── LIGHT MODE ─── */
[data-theme="light"] {
  --bg:       #faf7f2;          /* Warm off-white */
  --bg2:      #f0ebe2;
  --fg:       #1a1510;          /* Very dark — max contrast */
  --gray:     #4a3e30;          /* Dark brown — readable */
  --accent:   #8a6820;          /* Darkened gold for light bg */
  --accent-h: #a07c28;
  --accent2:  #6a5218;
  --card:     #f0ebe2;          /* Slightly off from bg */
  --card2:    #e8e2d8;
  --border:   #d8d0c0;
  --bd2:      rgba(110,80,20,.30); /* Dark gold border */
  --input:    #e4ddd0;
  --muted:    #6a5e4e;          /* Readable on light */
}

/* ─── RESET ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: auto; overflow-x: clip; width: 100%; }
h1, h2, h3, h4, h5, h6 { font-weight: normal; }

/* ─── BODY ─── */
body {
  background-color: var(--bg);
  /* No tile/SVG background — grain canvas handles texture */
  color: var(--fg);
  font-family: var(--sans);
  /* overflow-x: clip — berbeda dengan hidden: TIDAK membuat body menjadi
     scroll container baru, sehingga hanya html yang punya scrollbar (satu saja) */
  overflow-x: clip;
  width: 100%;
  position: relative;
  transition: background-color .5s, color .5s;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
/* Cover page: blokir scroll di body DAN html sekaligus agar tidak ada
   scrollbar yang terlihat saat postcard cover sedang ditampilkan */
body.no-scroll { overflow: hidden; }
html:has(body.no-scroll) { overflow: hidden; }

/* #grain-canvas CSS dihapus — elemen dinonaktifkan di HTML (tidak digunakan di V11 Pro) */

/* ─── LOTTIE LOADER ─── */
.lottie-loader-wrap {
  width: 90px;
  height: 90px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: hue-rotate(10deg) saturate(1.2);
}
[data-theme="light"] .lottie-loader-wrap {
  filter: hue-rotate(20deg) saturate(0.9) brightness(0.85);
}

/* ─── BLOCKER ─── */
#blocked-page {
  display: none; position: fixed; inset: 0; z-index: 9999;
  background: var(--bg); flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: 40px;
}
#blocked-page.show { display: flex; }
.blocked-title {
  font-family: var(--display); font-size: clamp(20px,5vw,34px);
  margin-bottom: 14px; color: var(--accent); letter-spacing: 4px;
}
.blocked-sub { font-size: 14px; line-height: 2; color: var(--gray); }

/* ─── FLOATING BUTTONS ─── */
.theme-btn, .music-btn {
  position: fixed; right: 16px; z-index: 500;
  width: 42px; height: 42px;
  background: var(--card);
  border: 1px solid var(--bd2);
  color: var(--accent);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  transition: transform .3s, background .3s;
  font-size: 17px;
}
.theme-btn { top: 16px; }
.theme-btn:hover { transform: scale(1.1); background: var(--card2); }
.music-btn {
  top: 68px; display: none; background: var(--card);
  align-items: flex-end; justify-content: center; gap: 3px; padding-bottom: 13px;
}
.music-btn.active { display: flex; }
.m-bar {
  width: 3px; background: var(--accent); border-radius: 1px;
  transition: height 0.3s; height: 3px;
}
.music-btn.playing .m-bar {
  animation: equalize 1s infinite alternate ease-in-out;
}
.music-btn.playing .m-bar1 { height: 10px; animation-delay: -0.4s; }
.music-btn.playing .m-bar2 { height: 16px; animation-delay: -0.2s; }
.music-btn.playing .m-bar3 { height: 12px; animation-delay: -0.6s; }
.music-btn.playing .m-bar4 { height: 8px;  animation-delay: -0.8s; }

@keyframes equalize {
  0% { height: 4px; }
  100% { height: 18px; }
}

/* ─── LOADER (THEATRICAL REVEAL) ─── */
#loader {
  position: fixed; inset: 0; z-index: 9998;
  background: var(--bg);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  clip-path: inset(0% 0% 0% 0%);
  transition: clip-path 1.5s cubic-bezier(0.77, 0, 0.17, 1);
  will-change: clip-path;
}
[data-theme="light"] #loader {
  background: var(--bg);
}
#loader .loader-content {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  transition: opacity 0.4s ease;
}
#loader.hidden .loader-content {
  opacity: 0;
}
#loader.hidden { 
  clip-path: inset(0% 50% 0% 50%); /* Tirai membelah ke tengah */
  pointer-events: none; 
}

/* ── Bunga Jepun ── */
.jepun {
  position: relative;
  width: 90px;
  height: 90px;
  margin: 0 auto 16px;
}
.petal {
  position: absolute;
  width: 22px;
  height: 44px;
  left: calc(50% - 11px);
  top: calc(50% - 44px);
  border-radius: 50% 50% 30% 30% / 60% 60% 40% 40%;
  background: linear-gradient(to top, var(--accent2), var(--accent-h));
  transform-origin: 50% 100%;
  transition: background 0.6s ease;
}
.petal:nth-child(1) { transform: rotate(0deg);   animation: jepunGlow 2s 0.0s ease-in-out infinite; }
.petal:nth-child(2) { transform: rotate(72deg);  animation: jepunGlow 2s 0.2s ease-in-out infinite; }
.petal:nth-child(3) { transform: rotate(144deg); animation: jepunGlow 2s 0.4s ease-in-out infinite; }
.petal:nth-child(4) { transform: rotate(216deg); animation: jepunGlow 2s 0.6s ease-in-out infinite; }
.petal:nth-child(5) { transform: rotate(288deg); animation: jepunGlow 2s 0.8s ease-in-out infinite; }
.jepun-heart {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 16px; height: 16px;
  border-radius: 50%;
  background: radial-gradient(var(--bg), var(--accent));
  box-shadow: 0 0 10px var(--accent);
}
@keyframes jepunGlow {
  0%, 100% { opacity: 0.6; filter: brightness(0.9); }
  50% { opacity: 1; filter: brightness(1.3) drop-shadow(0 0 8px rgba(200,169,110,0.45)); }
}

/* ── Loader letters ── */
.loader-letters {
  font-family: var(--serif);
  font-size: 30px;
  color: var(--accent);
  letter-spacing: 0.2em;
  font-style: italic;
  margin-bottom: 8px;
}
.loader-amp { font-style: normal; font-size: 18px; margin: 0 4px; }

/* ── Loader text ── */
.l-text {
  font-family: var(--sans); font-size: 10px;
  letter-spacing: 5px; color: var(--muted); text-transform: uppercase;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 1; }
}

/* ─── COVER — POSTCARD FLIP ─── */
#cover {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); perspective: 1500px;
  transition: opacity .8s .8s;
}
#cover.done { display: none; visibility: hidden; pointer-events: none; }
#cover.open { opacity: 0; pointer-events: none; visibility: hidden; }

.postcard {
  width: min(88vw, 460px);
  height: min(88vh, 660px);
  position: relative; transform-style: preserve-3d;
  transition: transform 1.4s cubic-bezier(.5,0,.2,1);
  z-index: 110;
  animation: postcardFloat 4s ease-in-out infinite;
}
@keyframes postcardFloat {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}
#cover.open .postcard {
  transform: scale(1.2) translateY(-20px) !important;
  opacity: 0;
  pointer-events: none;
  transition: transform 1.2s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.8s ease 0.2s;
  animation: none;
}

.pc-front, .pc-back {
  position: absolute; inset: 0; backface-visibility: hidden;
  background: var(--card);
  border: 1px solid var(--bd2);
  display: flex; flex-direction: column; padding: clamp(20px,5vw,36px);
}
.pc-front {
  transform: translateZ(1px);
  justify-content: space-between; align-items: center; text-align: center;
  padding: clamp(28px,6vw,48px) clamp(20px,5vw,36px);
}
.pc-back { transform: rotateY(180deg) translateZ(1px); opacity: 0; }

/* 4-corner gold ornaments via pseudo on pc-front */
.pc-front::before {
  content: ''; position: absolute;
  top: 14px; left: 14px;
  width: 22px; height: 22px;
  border-top: 1px solid var(--accent);
  border-left: 1px solid var(--accent);
  opacity: .55;
}
.pc-front::after {
  content: ''; position: absolute;
  bottom: 14px; right: 14px;
  width: 22px; height: 22px;
  border-bottom: 1px solid var(--accent);
  border-right: 1px solid var(--accent);
  opacity: .55;
}

.post-stamp {
  position: absolute; top: clamp(14px,4vw,24px); right: clamp(14px,4vw,24px);
  width: 68px; height: 86px;
  border: 1px dashed var(--bd2);
  display: flex; align-items: center; justify-content: center;
  opacity: .5; font-size: 9px; color: var(--accent);
  text-align: center; transform: rotate(4deg);
  font-family: var(--display); letter-spacing: 2px;
}

/* Bird Seal (Merpati Terbang) */
.bird-seal {
  width: clamp(110px, 28vw, 150px); /* Diperbesar kembali sesuai permintaan */
  height: clamp(110px, 28vw, 150px);
  color: var(--accent);
  margin: 15px auto 0;
  position: relative;
  z-index: 10;
  pointer-events: none; /* Let clicks pass to the cover */
  /* Animasi nafas/melayang dibuat lebih rileks dan anggun */
  animation: birdHover 4.5s ease-in-out infinite;
}

/* Animasi melayang ringan (Hovering) saat diam */
@keyframes birdHover {
  0%, 100% { transform: translateY(0) rotate(0deg) scale(1); }
  50% { transform: translateY(-12px) rotate(-2deg) scale(1.02); }
}

/* Image Tag Merpati Custom User */
.bird-seal img {
  width: 100%; height: 100%;
  transform: scaleX(-1);
  transform-origin: center center;
  /* Filter drop shadow agar menyatu elegan dengan background */
  filter: drop-shadow(2px 6px 6px rgba(0,0,0,0.15));
}

/* --- STATE: TERBANG (Fly Away / Gliding) --- */
.bird-seal.fly-away {
  /* Kurva timing fungsi ini memberi kesan hentakan natural: 
     lambat sedikit di awal, lalu melesat mulus ke angkasa */
  animation: swoopingDove 1.5s cubic-bezier(0.34, 1.3, 0.45, 1) forwards;
}

/* Rute terbang yang jauh lebih sinematik dan hidup */
@keyframes swoopingDove {
  0% { 
    transform: translate(0, 0) rotate(0deg) scale(1); 
    opacity: 1; 
  }
  15% { 
    /* Antisipasi gerak: merpati turun dan mundur ditarik perlahan */
    transform: translate(-10%, 15%) rotate(-5deg) scale(0.9); 
    opacity: 1;
  }
  40% { 
    /* Terbang menukik ke atas lebih tegap */
    transform: translate(70%, -120%) rotate(22deg) scale(1.1); 
    opacity: 1;
  }
  70% { 
    /* Melayang mulus ke kejauhan */
    transform: translate(180%, -300%) rotate(38deg) scale(0.6); 
    opacity: 0.8;
  }
  100% { 
    /* Hilang ke ufuk angkasa luar layar */
    transform: translate(320%, -550%) rotate(45deg) scale(0.2); 
    opacity: 0; 
  }
}
.pc-hint {
  font-size: 9px; margin-top: 14px;
  opacity: .35; letter-spacing: 4px;
  font-family: var(--sans); text-transform: uppercase; color: var(--fg);
}

/* ─── COVER TEXT (V7 Typography) ─── */
/* "The Wedding Of" header label */
.lux-header {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.45em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
  animation: cvFadeUp 0.8s 0.1s both ease-out;
}

/* Couple names — large italic serif */
.cover-names {
  font-family: var(--serif);
  font-size: clamp(36px, 9vw, 54px);
  font-style: italic;
  color: var(--fg);
  line-height: 1.15;
  margin-bottom: 10px;
  animation: cvFadeUp 0.9s 0.25s both ease-out;
}
.cover-amp {
  color: var(--accent);
  font-family: var(--sans);
  font-style: normal;
  opacity: 0.7;
}

/* Date under couple names */
.cover-date {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.28em;
  color: var(--muted);
  margin-bottom: 0;
  animation: cvFadeUp 0.9s 0.4s both ease-out;
}

/* Guest divider block */
.lux-guest-section {
  padding: 20px 0;
  border-top: 1px solid var(--bd2);
  border-bottom: 1px solid var(--bd2);
  animation: cvFadeUp 0.9s 0.55s both ease-out;
  /* Reservasi tinggi tetap agar border tidak ikut bergerak saat typewriter berjalan */
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
}
.cover-to {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.cover-guest {
  font-family: var(--serif);
  /* B3: font lebih kecil agar nama panjang + gelar tidak overflow kartu */
  font-size: clamp(17px, 5.5vw, 42px);
  color: var(--fg);
  min-height: 1.15em;
  font-style: italic;
  line-height: 1.3;
  /* Pecah kata panjang / gelar akademik agar tidak meluber keluar kartu */
  word-break: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  max-width: 100%;
}

/* Kursor berkedip typewriter */
.typewriter-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--accent);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: cursorBlink 0.75s step-end infinite;
}
@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}




/* Entrance animation for cover text elements */
@keyframes cvFadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── MAIN VISIBILITY ─── */
#main {
  opacity: 0; transition: opacity 0.8s ease;
  position: relative; z-index: 10;
}
#main.visible { opacity: 1; display: block !important; }

/* ─── SECTIONS ─── */
section {
  padding: clamp(56px,8vh,100px) clamp(24px,5vw,48px);
  max-width: min(900px, 94vw);
  margin: 0 auto;
  position: relative; z-index: 2;
  width: 100%;
  scroll-margin-top: 40px;
}

/* Full-bleed sections override */
#hero { max-width: 100%; padding-inline: 0; }

/* ─── HERO ENTRANCE ANIMATIONS ─── */
.hero-polaroid,
.hero-right,
.h-label, .h-names, .h-date {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .9s cubic-bezier(.2,.8,.2,1), transform .9s cubic-bezier(.2,.8,.2,1);
}
/* On desktop, animate the whole right block as one unit */
@media (min-width: 1024px) {
  .h-label, .h-names, .h-date { opacity: 1; transform: none; transition: none; }
  #main.visible .hero-right { opacity: 1; transform: none; transition-delay: .45s;
    transition: opacity .9s cubic-bezier(.2,.8,.2,1), transform .9s cubic-bezier(.2,.8,.2,1); }
}
#main.visible .hero-polaroid { opacity: 1; transform: rotate(1.5deg); transition-delay: .2s; }
#main.visible .h-label       { opacity: 1; transform: none;           transition-delay: .4s; }
#main.visible .h-names       { opacity: 1; transform: none;           transition-delay: .6s; }
#main.visible .h-date        { opacity: 1; transform: none;           transition-delay: .8s; }
#main.visible .hero-right    { opacity: 1; transform: none;           transition-delay: .4s; }

/* ─── GOLD DIVIDER ─── */
.divider {
  display: flex; align-items: center; gap: 20px;
  max-width: min(900px, 94vw); margin: 0 auto;
  padding: clamp(32px,5vh,52px) clamp(24px,5vw,48px);
  position: relative; z-index: 2;
  width: 100%;
  /* GSAP scaleX dari tengah */
  transform-origin: center center;
}
.divider::before, .divider::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(to right, transparent, var(--bd2), transparent);
}
.divider span { color: var(--accent); font-size: 15px; flex-shrink: 0; opacity: .8; }

/* ─── VINTAGE PAPER CARD ─── */
.vintage-paper {
  background: var(--card);
  border: 1px solid var(--bd2);
  padding: clamp(28px,6vw,52px);
  position: relative;
}
[data-theme="light"] .vintage-paper {
  box-shadow: 0 2px 20px rgba(0,0,0,0.06);
}
.vintage-paper::before, .vintage-paper::after {
  content: ''; position: absolute;
  width: 18px; height: 18px;
  border-color: var(--accent); border-style: solid; opacity: .4;
}
.vintage-paper::before { top: 12px; left: 12px; border-width: 1px 0 0 1px; }
.vintage-paper::after  { bottom: 12px; right: 12px; border-width: 0 1px 1px 0; }


/* ─── TAPE ─── */
.tape {
  position: absolute; width: 72px; height: 20px;
  background: rgba(200,169,110,.18);
  border: 1px solid rgba(200,169,110,.25);
  top: -9px; left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  z-index: 5; border-radius: 1px;
}
[data-theme="light"] .tape {
  background: rgba(110,80,20,.14);
  border-color: rgba(110,80,20,.22);
}

/* ─── POLAROIDS ─── */
.polaroid {
  background: var(--card);
  padding: 10px 10px 42px;
  border: 1px solid var(--bd2);
  transition: transform .45s ease, border-color .3s;
  transform: rotate(-2deg);
  position: relative; cursor: pointer;
}
.polaroid:nth-child(even) { transform: rotate(3deg); }
.polaroid:hover { transform: scale(1.05) rotate(0deg) !important; z-index: 10; border-color: rgba(200,169,110,.5); }
.polaroid img {
  width: 100%; display: block; object-fit: cover;
  filter: grayscale(20%) sepia(20%) contrast(105%);
  transition: filter .4s;
}
.polaroid:hover img { filter: grayscale(5%) sepia(8%); }
.polaroid-caption {
  font-family: var(--script); font-size: 23px;
  color: var(--accent); text-align: center;
  position: absolute; bottom: 9px; left: 0; right: 0; line-height: 1;
}

/* ─── HERO ─── */
#hero {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: clamp(48px,8vh,90px) clamp(24px,5vw,60px);
}

/* Desktop wide: hero becomes 2-column layout */
@media (min-width: 1024px) {
  #hero {
    flex-direction: row;
    gap: clamp(40px, 5vw, 80px);
    text-align: left;
    justify-content: center;
    max-width: 1200px;
    margin-inline: auto;
    padding: 0 clamp(40px, 5vw, 80px);
  }
  #hero .hero-right {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
  }
  #hero .h-label { text-align: left; }
  #hero .h-date  { text-align: left; }
  .hero-polaroid {
    flex-shrink: 0;
    width: clamp(320px, 38vw, 560px);
    margin-bottom: 0;
  }
}

/* Polaroid hero: scales fluidly on mobile/tablet */
.hero-polaroid {
  width: clamp(260px, 72vw, 500px);
  margin-bottom: clamp(28px,5vh,44px);
  /* Fix patah-patah/jagged pada rotasi CSS di laptop */
  outline: 1px solid transparent;
  box-shadow: 0 0 1px rgba(0,0,0,0.01);
  -webkit-backface-visibility: hidden;
  transform-style: preserve-3d;
}

/* Video inside hero polaroid: responsive height */
.hero-video {
  width: 100%;
  height: clamp(170px, 38vw, 380px);
  object-fit: cover;
  display: block;
  filter: grayscale(20%) sepia(18%);
  /* Anti-aliasing fixes for inside image/video edges */
  transform: translateZ(0);
  outline: 1px solid transparent;
}

.h-label {
  font-size: clamp(10px, 1vw, 12px);
  letter-spacing: clamp(3px, .5vw, 6px);
  text-transform: uppercase;
  color: var(--muted); margin-bottom: 14px; font-family: var(--sans);
}
.h-names {
  font-family: var(--serif);
  font-size: clamp(54px, 11vw, 108px);
  line-height: .85; color: var(--fg);
}
.h-names .amp {
  display: block; font-style: italic;
  color: var(--accent); font-size: .58em; line-height: 1.2;
}
.h-date {
  font-family: var(--display);
  font-size: clamp(11px, 1vw, 14px);
  letter-spacing: clamp(3px, .6vw, 6px);
  margin-top: 20px;
  color: var(--muted); text-transform: uppercase;
}
/* A13/B10: .scroll-hint, .scroll-mouse, scrollWheel, scrollPulse — dihapus (dead code, elemen tidak ada di HTML) */

/* ─── INTRO (Ayat Suci & Greeting) ─── */
.ayat-wrap {
  text-align: center;
  max-width: 680px;
  margin: 0 auto;
  position: relative;
  padding: 20px;
}
.ayat-ornament {
  color: var(--accent);
  font-size: 14px;
  line-height: 1;
  opacity: 0.6;
}
.ayat-quote {
  font-family: var(--serif);
  font-size: clamp(14px, 2.8vw, 17px);
  line-height: 2.1;
  font-style: italic;
  color: var(--fg);
  margin: 28px 0;
}
.ayat-source {
  font-family: var(--display);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 28px;
}

.intro-greeting {
  font-family: var(--serif); font-size: clamp(28px,6vw,36px);
  font-style: italic; margin-bottom: 28px;
  color: var(--accent); text-align: center; letter-spacing: .02em;
}
.intro-greeting.aksara-bali {
  font-family: var(--bali);
  font-style: normal;
  font-size: clamp(32px, 8vw, 42px);
  margin-bottom: 18px; /* Tadi 8px, diperlebar agar tidak terlalu mepet */
}
.intro-greeting-latin {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  margin-bottom: 32px;
}
.intro-text {
  line-height: 2; font-size: 14px; color: var(--gray);
  text-align: center; max-width: 560px; margin-inline: auto;
}

/* ─── COUPLE ─── */
.couple-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(24px,5vw,44px);
  margin-top: clamp(36px,6vh,60px);
  align-items: center;
}
.c-polaroid {
  background: var(--card); padding: 14px 14px 44px;
  border: 1px solid var(--bd2); text-align: center; position: relative;
  transition: border-color .3s, transform .3s;
  /* GPU anti-aliasing fix untuk border patah-patah saat rotate */
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0);
  outline: 1px solid transparent; /* memaksa sub-pixel rendering */
}
.c-polaroid:hover { border-color: rgba(200,169,110,.45); }
.c-polaroid:nth-child(1) { transform: rotate(-3.5deg) translateZ(0); }
.c-polaroid:nth-child(2) { transform: rotate(2.5deg) translateZ(0); }
.c-photo { width: 100%; aspect-ratio: 3/4; overflow: hidden; margin-bottom: 14px; }
.c-photo img {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(15%) sepia(22%) contrast(105%);
  transition: filter .5s;
}
.c-photo:hover img { filter: grayscale(5%) sepia(6%); }
.c-name { font-family: var(--serif); font-size: clamp(28px,6vw,38px); font-style: italic; color: var(--accent); line-height: 1.15; }
/* B10: .c-role — dihapus (dead code, elemen tidak ada di HTML) */
.c-parent { font-size: 13px; margin-top: 10px; color: var(--muted); line-height: 1.5; }

/* ─── COUNTDOWN ─── */
.cd-section {
  max-width: 800px;
  margin: 0 auto;
  border: 1px solid var(--bd2);
  background: var(--card);
  overflow: hidden;
}
[data-theme="light"] .cd-section {
  box-shadow: 0 4px 24px rgba(0,0,0,0.07);
}
.cd-banner {
  position: relative;
  padding: clamp(60px, 12vh, 100px) 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.cd-bg {
  position: absolute;
  inset: -20%; /* Mencegah border bocor saat parallax yPercent */
  background: url('https://res.cloudinary.com/drijzjqnq/image/upload/w_800,q_auto,f_auto/v1774488217/thumbnail_sipflj.jpg') center/cover no-repeat;
  filter: grayscale(20%) sepia(20%);
  will-change: transform;
  transform: translateZ(0);
}
.cd-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(13,11,8,0.3) 0%, rgba(13,11,8,0.7) 100%);
}
[data-theme="light"] .cd-bg::after {
  /* Dikurangi dari 0.85 → 0.65 agar foto mempelai tetap terlihat samar di light mode */
  background: linear-gradient(to bottom, rgba(250,247,242,0.2) 0%, rgba(250,247,242,0.65) 100%);
}
.cd-title {
  position: relative;
  z-index: 2;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  margin-bottom: clamp(32px, 5vh, 48px);
}
[data-theme="light"] .cd-title { color: var(--accent); text-shadow: 0 1px 2px rgba(255,255,255,0.8); }
.cd-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(8px, 2vw, 16px);
  width: 100%;
  max-width: 480px;
}
.cd-item {
  background: rgba(13,11,8,0.80);
  /* backdrop-filter blur dihapus karena membebani GPU saat di-scroll */
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: clamp(14px, 3vw, 20px) 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
[data-theme="light"] .cd-item {
  background: rgba(250, 247, 242, 0.7);
  border-color: rgba(138, 104, 32, 0.15);
}
.cd-num {
  font-family: var(--serif);
  font-size: clamp(28px, 6vw, 42px);
  line-height: 1;
  color: #fff;
}
[data-theme="light"] .cd-num { color: var(--accent); }
.cd-lbl {
  font-family: var(--sans);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: rgba(255,255,255,0.7);
}
[data-theme="light"] .cd-lbl { color: var(--muted); }
.cd-content {
  padding: clamp(32px, 6vh, 48px) clamp(24px, 5vw, 48px);
  text-align: center;
}
.cd-subtitle {
  font-family: var(--serif);
  font-size: clamp(24px, 6vw, 32px);
  color: var(--fg);
  margin-bottom: 16px;
}
.cd-desc {
  font-family: var(--sans);
  font-size: clamp(13px, 3vw, 15px);
  color: var(--muted);
  line-height: 1.8;
  max-width: 500px;
  margin: 0 auto;
}
.cd-grid .cd-item:nth-child(2) { transition-delay: 0.15s; }
.cd-grid .cd-item:nth-child(3) { transition-delay: 0.3s; }
.cd-grid .cd-item:nth-child(4) { transition-delay: 0.45s; }

/* ─── ACARA / EVENT ─── */
.event-sec { text-align: center; }
.sec-title {
  font-family: var(--script);
  font-size: clamp(44px,11vw,76px);
  line-height: 1; color: var(--accent); margin-bottom: clamp(28px,5vh,48px);
}
.ev-card {
  background: var(--card); border: 1px solid var(--bd2);
  padding: clamp(28px,5vw,48px); position: relative;
  max-width: 760px; margin: 0 auto; text-align: center;
}
[data-theme="light"] .ev-card {
  box-shadow: 0 4px 24px rgba(0,0,0,0.07);
}


/* ─── BUTTONS ─── */
.btn-gold {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--sans); font-size: 11px; letter-spacing: 4px;
  text-transform: uppercase; font-weight: 500;
  color: var(--bg); background: var(--accent);
  padding: 16px 32px; text-decoration: none;
  border: 1px solid var(--accent); cursor: pointer;
  transition: background .3s, color .3s, transform .2s; line-height: 1;
  position: relative; z-index: 5; pointer-events: auto !important;
  min-width: 160px;
}
.btn-gold:hover { background: transparent; color: var(--accent); transform: translateY(-2px); }
.btn-gold.outline { background: transparent; color: var(--accent); }
.btn-gold.outline:hover { background: var(--accent); color: var(--bg); transform: translateY(-2px); }

.stamp-border {
  border: 1px solid var(--bd2); position: relative;
  background: var(--card); overflow: hidden;
}
.stamp-border::before {
  content: ''; position: absolute; inset: 4px; border: 1px solid var(--bd2);
  pointer-events: none; opacity: 0.3;
}

.maps-img {
  width: 100%; max-width: 500px;
  border: 1px solid var(--bd2);
  margin-top: 32px;
  filter: grayscale(45%) sepia(8%);
  opacity: .85;
  transition: opacity .35s, filter .35s;
  display: block; margin-inline: auto;
}
.maps-img:hover { opacity: 1; filter: grayscale(15%) sepia(4%); }

/* ─── GALLERY ─── */
.theme-flower {
  margin: 0 auto 16px auto;
  width: clamp(60px, 10vw, 80px);
  height: clamp(60px, 10vw, 80px);
  background-color: var(--accent);
  -webkit-mask: url('../svg/flower1.svg') no-repeat center/contain;
  mask: url('../svg/flower1.svg') no-repeat center/contain;
}
.theme-flower-2 {
  margin: 0 auto 16px auto;
  width: clamp(60px, 10vw, 80px);
  height: clamp(60px, 10vw, 80px);
  background-color: var(--accent);
  -webkit-mask: url('../svg/flower2.svg') no-repeat center/contain;
  mask: url('../svg/flower2.svg') no-repeat center/contain;
}
.theme-flower-3 {
  margin: 0 auto 16px auto;
  width: clamp(60px, 10vw, 80px);
  height: clamp(60px, 10vw, 80px);
  background-color: var(--accent);
  -webkit-mask: url('../svg/flower3.svg') no-repeat center/contain;
  mask: url('../svg/flower3.svg') no-repeat center/contain;
}
.theme-flower-4 {
  margin: 0 auto 16px auto;
  width: clamp(60px, 10vw, 80px);
  height: clamp(60px, 10vw, 80px);
  background-color: var(--accent);
  -webkit-mask: url('../svg/flower4.svg') no-repeat center/contain;
  mask: url('../svg/flower4.svg') no-repeat center/contain;
}
.theme-flower-5 {
  margin: 0 auto 16px auto;
  width: clamp(60px, 10vw, 80px);
  height: clamp(60px, 10vw, 80px);
  background-color: var(--accent);
  -webkit-mask: url('../svg/flower5.svg') no-repeat center/contain;
  mask: url('../svg/flower5.svg') no-repeat center/contain;
}
.theme-flower-6 {
  margin: 0 auto 16px auto;
  width: clamp(60px, 10vw, 80px);
  height: clamp(60px, 10vw, 80px);
  background-color: var(--accent);
  -webkit-mask: url('../svg/flower6.svg') no-repeat center/contain;
  mask: url('../svg/flower6.svg') no-repeat center/contain;
}


/* ─── POLAROID (re-declared) ─── */
.polaroid {
  background: var(--card); padding: 8px 8px 32px;
  border: 1px solid var(--bd2); text-align: center; position: relative;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94), filter 0.5s, border-color 0.5s, opacity 0.8s;
  will-change: transform; cursor: pointer;
  /* Anti-aliasing fixes for jagged edges on transformed blocks */
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0);
  outline: 1px solid transparent;
}
.polaroid:hover {
  transform: translateY(-8px) rotate(-2deg) scale(1.05);
  z-index: 2; border-color: var(--accent);
}
.polaroid .tape { top: -10px; }
.polaroid img {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  filter: grayscale(30%) sepia(20%);
  transition: filter 0.5s ease;
}
.polaroid:hover img {
  filter: grayscale(0%) sepia(0%);
}
.polaroid-caption { font-family: var(--script); font-size: clamp(20px,4vw,24px); color: var(--accent); margin-top: 12px; line-height: 1; }
/* Font spesifik untuk Hashtag / Tag Line agar terbaca tegas & jelas, terpisah dari gaya font cursive */
.polaroid-caption.hero-hashtag {
  font-family: var(--sans);
  font-size: clamp(13px, 3.5vw, 16px);
  text-transform: none;
  letter-spacing: 1.5px;
  opacity: 0.95;
  font-weight: 500;
}

.gallery-grid .polaroid:nth-child(even) { transition-delay: 0.15s; }

/* ─── REKENING ─── */
.rek-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(16px,3vw,24px); }
.rek-card {
  background: var(--card); border: 1px solid var(--bd2);
  padding: clamp(24px,5vw,36px); text-align: center; position: relative;
}
[data-theme="light"] .rek-card {
  box-shadow: 0 2px 16px rgba(0,0,0,0.06);
}
.rek-card::before, .rek-card::after {
  content: ''; position: absolute;
  width: 12px; height: 12px;
  border-color: var(--accent); border-style: solid; opacity: .35;
}
.rek-card::before { top: 8px; left: 8px; border-width: 1px 0 0 1px; }
.rek-card::after  { bottom: 8px; right: 8px; border-width: 0 1px 1px 0; }
.rek-logo {
  width: auto; height: 20px; margin-bottom: 22px;
  filter: brightness(0) invert(1) sepia(1) saturate(.3) opacity(.7);
}
[data-theme="light"] .rek-logo {
  filter: brightness(0) sepia(1) saturate(.5) opacity(.75);
}
.rek-num { font-family: var(--serif); font-size: clamp(22px,5vw,28px); line-height: 1; letter-spacing: 3px; margin-bottom: 10px; color: var(--accent); }
.rek-name { font-size: 13px; color: var(--muted); margin-bottom: 24px; line-height: 1.6; }

/* ─── RSVP ─── */
.rsvp-form { display: flex; flex-direction: column; gap: 14px; }
.custom-input {
  width: 100%;
  background: var(--input); border: 1px solid var(--bd2);
  padding: 15px; font-family: var(--sans); font-size: 14px;
  color: var(--fg); outline: none; transition: border-color .3s, box-shadow .3s;
  appearance: none; -webkit-appearance: none;
}
.custom-input::placeholder { color: var(--muted); opacity: 1; }
.custom-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200, 169, 110, 0.12);
}
.custom-input option { background: var(--bg); color: var(--fg); }
textarea.custom-input { min-height: 120px; resize: vertical; line-height: 1.7; }
.rsvp-stats {
  display: flex; justify-content: center; gap: clamp(20px,6vw,44px);
  margin-bottom: clamp(28px,5vh,48px); text-align: center;
}
.r-n { font-family: var(--serif); font-size: clamp(40px,10vw,56px); line-height: 1; color: var(--accent); }
.r-l { font-size: 10px; letter-spacing: 3px; text-transform: uppercase; color: var(--muted); margin-top: 6px; }

/* ─── CHAT / WISH WALL ─── */
/* ─── WISH WALL (3D BOOK FLIP) ─── */
.book-outer { max-width: 900px; margin: 0 auto; position: relative; }
.book-wrap {
  display: grid; grid-template-columns: 1fr 1fr;
  border: 1px solid var(--bd2); background: var(--card);
  min-height: 400px; position: relative; overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
  cursor: pointer; perspective: 1800px;
}
[data-theme="light"] .book-wrap {
  box-shadow: 0 4px 32px rgba(0,0,0,0.09);
}
/* Book spine */
.book-wrap::before {
  content: ''; position: absolute; left: 50%; top: 0; bottom: 0; z-index: 3;
  width: 1px; background: linear-gradient(to bottom, transparent, var(--accent), transparent);
  transform: translateX(-50%); pointer-events: none; opacity: 0.5;
}

/* 3D Flipper */
.book-flipper {
  position: absolute; right: 0; top: 0; width: 50%; height: 100%;
  transform-style: preserve-3d; transform-origin: left center;
  z-index: 10; pointer-events: none; display: none;
}
.book-flipper.flipping {
  display: block;
  animation: bookFlip3D 0.65s cubic-bezier(0.45, 0.05, 0.25, 1) forwards;
}
.flipper-face {
  position: absolute; inset: 0; backface-visibility: hidden;
  background: var(--card); padding: clamp(24px,4vw,48px);
  display: flex; flex-direction: column; justify-content: center;
}
.flipper-face.back { transform: rotateY(180deg); border-right: 1px solid var(--bd2); }
.flipper-face.front::after, .book-page.right::after {
  content: ''; position: absolute; bottom: 0; right: 0;
  width: 26px; height: 26px;
  background: linear-gradient(135deg, var(--card2) 50%, transparent 50%);
  border-top: 1px solid var(--bd2); border-left: 1px solid var(--bd2);
}

/* Dynamic shadow during flip */
.book-flipper::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to right, transparent, rgba(0,0,0,0.25));
  opacity: 0; transition: opacity 0.3s;
}
.book-flipper.flipping::after { animation: flipShadow 0.65s ease-in-out forwards; }

@keyframes bookFlip3D {
  0%   { transform: rotateY(0deg); }
  100% { transform: rotateY(-180deg); }
}
@keyframes flipShadow { 0% { opacity: 0; } 50% { opacity: 1; } 100% { opacity: 0; } }

.book-page {
  padding: clamp(24px,4vw,48px); display: flex;
  flex-direction: column; justify-content: center; position: relative;
}
.book-page.left { border-right: 1px solid var(--bd2); }
.book-page-num {
  font-family: var(--display); font-size: 9px; letter-spacing: 3px;
  color: var(--muted); text-align: center; margin-bottom: 18px; opacity: 0.4;
}
.book-ornament {
  font-size: 12px; color: var(--accent); opacity: 0.2;
  margin-bottom: 18px; letter-spacing: 10px; text-align: center;
}
.book-msg {
  font-family: var(--serif); font-size: clamp(14px,2.4vw,18px);
  font-style: italic; line-height: 2; color: var(--fg); margin-bottom: 24px;
  text-align: center;
}
.book-name { font-family: var(--script); font-size: clamp(26px,4vw,34px); color: var(--accent); text-align: center; line-height: 1; }
.book-badge {
  font-family: var(--display); font-size: 8px; letter-spacing: 2px;
  color: var(--muted); text-align: center; margin-top: 10px; text-transform: uppercase;
  display: inline-block; padding: 4px 10px; border: 1px solid var(--bd2); border-radius: 20px;
  margin-left: auto; margin-right: auto;
}

/* Auto progress bar */
.book-progress-bar {
  height: 2px; background: var(--card2); margin-top: 0;
  position: relative; overflow: hidden; border-top: 1px solid var(--bd2);
}
.book-progress-fill {
  position: absolute; left: 0; top: 0; height: 100%;
  background: linear-gradient(to right, transparent, var(--accent)); width: 0;
}
.book-progress-fill.running { animation: bookProgress var(--book-speed, 4.5s) linear forwards; }
@keyframes bookProgress { 0% { width: 0; } 100% { width: 100%; } }

/* Controls */
.book-controls {
  display: flex; align-items: center; justify-content: center;
  gap: 16px; margin-top: 22px; flex-wrap: wrap;
}
.book-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--muted); cursor: pointer; transition: background .3s, transform .3s;
}
.book-dot.active { background: var(--accent); transform: scale(1.5); }
.book-pause-hint {
  font-family: var(--display); font-size: 9px; letter-spacing: 2px;
  color: var(--muted); text-transform: uppercase; text-align: center;
  margin-top: 10px; opacity: 0.5;
}
.book-wrap:hover::after {
  content: 'II PAUSE'; position: absolute; top: 12px; right: 14px;
  font-family: var(--display); font-size: 8px; letter-spacing: 3px;
  color: var(--accent); background: rgba(200,169,110,.08);
  border: 1px solid var(--bd2); padding: 4px 10px; z-index: 20;
}

@media (max-width: 600px) {
  /* Pertahankan gaya buku 2-halaman dan efek flip 3D di mobile */
  .book-wrap { min-height: 260px; }
  .book-page { padding: 24px 10px; }
  .book-msg { font-size: 11px; line-height: 1.6; margin-bottom: 14px; }
  .book-name { font-size: 16px; }
  .book-badge { font-size: 6px; padding: 3px 6px; margin-top: 6px; letter-spacing: 1px; }
  .book-ornament { font-size: 10px; margin-bottom: 12px; letter-spacing: 4px; }
  .book-page-num { font-size: 7px; margin-bottom: 12px; }
  .flipper-face { padding: 24px 10px; }
  .book-wrap:hover::after { display: none; }
  .book-pause-hint { display: none; } /* "Hover" tidak relevan di mobile */
}

/* ─── FOOTER ─── */
footer {
  padding: clamp(60px,10vh,100px) clamp(16px,5vw,32px) 60px; text-align: center;
  background: linear-gradient(to bottom, rgba(28,24,18,0.7) 0%, rgba(28,24,18,0.98) 100%),
              url('https://res.cloudinary.com/drijzjqnq/image/upload/w_1000,q_auto,f_auto/v1774488217/thumbnail_sipflj.jpg') center/cover no-repeat;
  border-top: 1px solid var(--bd2);
  position: relative; z-index: 2;
  color: #fff;
}
[data-theme="light"] footer {
  background: linear-gradient(to bottom, rgba(250,247,242,0.85) 0%, rgba(250,247,242,1) 100%),
              url('https://res.cloudinary.com/drijzjqnq/image/upload/w_1000,q_auto,f_auto/v1774488217/thumbnail_sipflj.jpg') center/cover no-repeat;
  color: var(--fg);
}
.footer-thankyou { font-family: var(--serif); font-size: clamp(28px,7vw,56px); font-style: italic; color: #fff; text-shadow: 0 2px 4px rgba(0,0,0,0.5); margin-bottom: 20px; line-height: 1.2; }
[data-theme="light"] .footer-thankyou { color: var(--accent); text-shadow: none; }
.footer-text { font-size: clamp(11px, 3vw, 14px); letter-spacing: 1px; max-width: 460px; margin: 0 auto 8px; color: rgba(255,255,255,0.85); text-shadow: 0 1px 2px rgba(0,0,0,0.5); }
[data-theme="light"] .footer-text { color: var(--gray); text-shadow: none; }
.footer-names {
  font-family: var(--script); font-size: clamp(32px,8.5vw,72px);
  margin: 0 auto 28px; line-height: 1.2; max-width: 95vw; color: var(--accent);
  letter-spacing: 1px; opacity: 0.95;
  text-shadow: 0 2px 6px rgba(0,0,0,0.6);
}
[data-theme="light"] .footer-names { text-shadow: none; }
.footer-amp { color: #fff; font-style: normal; opacity: 0.8; font-size: 0.8em; }
[data-theme="light"] .footer-amp { color: var(--fg); }
.footer-bali { font-family: var(--bali); font-size: clamp(18px,5vw,40px); color: var(--accent); margin-bottom: 12px; font-weight: normal; line-height: 1.8; padding: 0 10px; text-shadow: 0 2px 4px rgba(0,0,0,0.6); }
[data-theme="light"] .footer-bali { text-shadow: none; }
.footer-sanskrit { font-family: var(--sans); font-size: clamp(8px, 2.5vw, 11px); letter-spacing: 3px; text-transform: uppercase; color: var(--accent); margin-bottom: 40px; line-height: 1.6; text-shadow: 0 1px 2px rgba(0,0,0,0.5); }
[data-theme="light"] .footer-sanskrit { text-shadow: none; }
.footer-date { font-family: var(--display); font-size: 11px; letter-spacing: .4em; opacity: .7; margin-bottom: 60px; text-transform: uppercase; color: var(--muted); }
.footer-dot { color: var(--accent); margin: 0 6px; }
/* Watermark — AOS menghandle visibility, .visible tetap untuk backwards compat */
.watermark { font-family: var(--sans); font-size: 13px; letter-spacing: .15em; color: var(--muted); text-transform: none; opacity: .9; font-weight: 500; }
.watermark span { display: inline-block; color: var(--accent); font-size: 16px; margin: 0 4px; }
/* .visible class: dipakai saat AOS tidak aktif (fallback IntersectionObserver) */
.watermark.visible { opacity: 1; filter: drop-shadow(0 0 6px rgba(200,169,110,0.4)); }
.watermark.visible span,
[data-aos].aos-animate .watermark span { animation: starSpin 8s linear infinite; }
/* Setelah AOS animate-in, aktifkan animasi bintang berputar */
.watermark[data-aos].aos-animate span { animation: starSpin 8s linear infinite; }
@keyframes starSpin {
  100% { transform: rotate(360deg); }
}

/* Seal used in modals */
.f-seal {
  width: 62px; height: 62px; margin: 0 auto 28px;
  border: 1px solid var(--bd2); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 20px; font-style: italic;
  color: var(--accent);
  animation: sealPulse 4s ease-in-out infinite;
}
@keyframes sealPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(200,169,110,.3); }
  50%      { box-shadow: 0 0 0 16px rgba(200,169,110,0); }
}

/* ─── LIGHTBOX ─── */
.lightbox {
  display: none; position: fixed; inset: 0;
  background: rgba(5,3,2,.96); z-index: 9000;
  align-items: center; justify-content: center;
  flex-direction: column; gap: 14px;
}
.lightbox.open {
  display: flex;
  animation: lbFadeIn .3s ease forwards;
}
@keyframes lbFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.lightbox img {
  max-width: min(90vw, 820px); max-height: 80vh;
  border: 1px solid var(--bd2);
  transition: opacity 0.25s ease;
  box-shadow: 0 24px 64px rgba(0,0,0,0.7);
}
/* Foto counter: 1 / 6 */
.lightbox-counter {
  font-family: var(--display); font-size: 10px;
  letter-spacing: 4px; text-transform: uppercase;
  color: var(--muted); text-align: center;
  pointer-events: none;
}
/* Close button — ikon X */
.lightbox-close {
  position: absolute; top: 16px; right: 16px;
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 26px; line-height: 1;
  cursor: pointer; background: rgba(255,255,255,.05);
  border: 1px solid rgba(200,169,110,.25); border-radius: 50%;
  font-family: var(--sans); font-weight: 300;
  transition: color .3s, background .3s, border-color .3s, transform .2s;
}
.lightbox-close:hover {
  color: var(--accent);
  background: rgba(200,169,110,.12);
  border-color: var(--accent);
  transform: rotate(90deg);
}
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,.5); border: 1px solid var(--bd2);
  color: var(--accent); padding: 18px 15px;
  cursor: pointer; z-index: 9001;
  font-size: 20px; line-height: 1;
  transition: background .3s, border-color .3s, transform .2s;
  border-radius: 4px;
}
.lightbox-nav:hover { background: rgba(200,169,110,.18); border-color: var(--accent); }
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }

/* ─── MODALS ─── */
.calendar-modal, .ty-modal {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(5,3,2,.88);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .35s;
  backdrop-filter: blur(4px);
}
.calendar-modal.show, .ty-modal.show { opacity: 1; pointer-events: auto; }

/* Calendar modal content */
.cal-modal-content {
  width: 90%; max-width: 360px;
  background: var(--card); border: 1px solid var(--bd2);
  padding: clamp(24px,5vw,40px); text-align: center;
  transform: translateY(20px); transition: transform .4s; position: relative;
}
.calendar-modal.show .cal-modal-content { transform: translateY(0); }

/* ─── TY MODAL — Redesign ─── */
.ty-content {
  width: 90%; max-width: 400px;
  background: var(--card); border: 1px solid var(--bd2);
  padding: clamp(32px,6vw,52px) clamp(24px,5vw,40px);
  text-align: center; position: relative; overflow: hidden;
  transform: translateY(28px) scale(0.96);
  transition: transform .5s cubic-bezier(.2,.8,.2,1);
}
.ty-modal.show .ty-content { transform: translateY(0) scale(1); }

/* Floating corner ornaments */
.ty-star {
  position: absolute; color: var(--accent); opacity: 0;
  font-size: 14px; pointer-events: none;
}
.ty-modal.show .ty-star { animation: tyStarFloat 4s ease-in-out infinite; opacity: 1; }
.s1 { top: 14px; left: 18px;  animation-delay: 0s !important; }
.s2 { top: 20px; right: 16px; animation-delay: .8s !important; font-size: 22px; opacity: 0.3; color: var(--fg); }
.s3 { bottom: 18px; right: 20px; animation-delay: 1.6s !important; }
@keyframes tyStarFloat {
  0%, 100% { transform: translateY(0) rotate(0deg);   opacity: 0.5; }
  50%       { transform: translateY(-6px) rotate(20deg); opacity: 1; }
}

/* Thin decorative line */
.ty-line {
  width: 40px; height: 1px;
  background: linear-gradient(to right, transparent, var(--accent), transparent);
  margin: 18px auto;
}

/* Eyebrow label */
.ty-eyebrow {
  font-family: var(--display); font-size: 10px; letter-spacing: 4px;
  text-transform: uppercase; color: var(--muted); margin-bottom: 8px;
}

/* Main title */
.ty-title {
  font-family: var(--script); font-size: clamp(44px,10vw,62px);
  color: var(--accent); line-height: 1; margin-bottom: 20px;
  font-weight: 600;
}

/* Italic quote */
.ty-quote {
  font-family: var(--serif); font-size: clamp(13px,2.5vw,15px);
  font-style: italic; color: var(--gray); line-height: 1.9;
  margin-bottom: 18px; padding: 0 8px;
}

/* Handwritten couple name */
.ty-couple {
  font-family: var(--script); font-size: clamp(28px,6vw,36px);
  color: var(--fg); opacity: 0.7; margin-bottom: 18px; line-height: 1;
}

/* Closing note */
.ty-note {
  font-size: 12px; color: var(--muted); line-height: 1.9;
  margin-top: 16px; margin-bottom: 24px;
}
.ty-note .heart { color: #c87070; }

/* Close button */
.ty-close-btn {
  font-family: var(--display); font-size: 10px; letter-spacing: 4px;
  text-transform: uppercase; color: var(--muted);
  background: none; border: 1px solid var(--bd2);
  padding: 12px 28px; cursor: pointer;
  transition: border-color .3s, color .3s;
}
.ty-close-btn:hover { border-color: var(--accent); color: var(--accent); }
.modal-close {
  position: absolute; top: 12px; right: 16px;
  background: none; border: none; font-size: 18px;
  cursor: pointer; color: var(--muted); transition: color .3s;
}
.modal-close:hover { color: var(--accent); }
.modal-title { font-family: var(--serif); font-size: clamp(22px,5vw,28px); font-style: italic; margin-bottom: 8px; color: var(--accent); }
.modal-p { font-size: 13px; color: var(--gray); margin-bottom: 22px; line-height: 1.8; }
.modal-btn {
  width: 100%; border: 1px solid var(--bd2);
  background: var(--input); color: var(--fg);
  padding: 15px; font-family: var(--sans); font-size: 11px;
  letter-spacing: 3px; text-transform: uppercase;
  margin-top: 10px; cursor: pointer; transition: all .3s;
}
.modal-btn:hover { background: var(--accent); color: var(--bg); border-color: var(--accent); }

/* ─── SCROLL REVEAL ─── */
.reveal {
  opacity: 0; transform: translateY(28px);
  transition: opacity .85s cubic-bezier(.2,.8,.2,1), transform .85s cubic-bezier(.2,.8,.2,1);
  will-change: opacity, transform;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ─── TOAST ─── */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: var(--bg);
  padding: 13px 26px; font-family: var(--sans); font-size: 11px;
  letter-spacing: 3px; text-transform: uppercase;
  opacity: 0; transition: opacity .3s; z-index: 300;
  white-space: nowrap;
}
.toast.show { opacity: 1; }

/* ─── ANIMATIONS ─── */
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%,60% { transform: translateX(-7px); }
  40%,80% { transform: translateX(7px); }
}

/* ─── RESPONSIVE: TABLET (≤900px) ─── */
@media (max-width: 900px) {
  .couple-grid { grid-template-columns: 1fr; gap: 44px; }
  .couple-grid .c-polaroid:nth-child(1) { transform: none; max-width: 360px; margin-inline: auto; }
  .couple-grid .c-polaroid:nth-child(2) { transform: none; margin-top: 0 !important; max-width: 360px; margin-inline: auto; }
  .rek-grid { grid-template-columns: 1fr; }
}

/* ─── RESPONSIVE: TABLET SMALL (≤640px) ─── */
@media (max-width: 640px) {
  .ev-card { padding: 24px 18px; }
  .vintage-paper { padding: 24px 18px; }

  /* Hero: back to single column on small screens */
  #hero { flex-direction: column; text-align: center; padding: 48px 20px; }
  #hero .hero-right { align-items: center; }
  #hero .h-label, #hero .h-date { text-align: center; }
  /* B10: #hero .scroll-hint — dihapus (dead code) */
  .hero-polaroid { width: clamp(260px, 80vw, 420px); margin-bottom: 32px; }
}

/* ─── RESPONSIVE: MOBILE (≤480px) ─── */
@media (max-width: 480px) {
  section { padding: 48px 16px; }
  .divider { padding: 30px 16px; }
  .rsvp-stats { gap: 16px; }
  .r-n { font-size: 38px; }
  .cd-grid { gap: 4px; }
  .cd-num { font-size: 32px; }
  .cd-lbl { font-size: 9px; letter-spacing: 1px; }
  .btn-gold { padding: 13px 20px; font-size: 10px; letter-spacing: 2px; }
  .postcard { height: min(84vh, 580px); }
  .pc-guest { font-size: clamp(22px,6.5vw,32px); }

  .hero-polaroid { width: min(85vw, 340px); }
  .hero-video { height: clamp(160px, 50vw, 240px); }
}

/* ─── RESPONSIVE: LARGE DESKTOP (≥1400px) ─── */
@media (min-width: 1400px) {
  section { max-width: 960px; }
  .divider { max-width: 960px; }
  .sec-title { font-size: clamp(60px, 6vw, 80px); }
  .vintage-paper { padding: 56px 64px; }
  .ev-card { padding: 56px; }
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
  #hero { max-width: 1400px; }
}

/* ─── RESPONSIVE: ULTRA-WIDE (≥1800px) ─── */
@media (min-width: 1800px) {
  section { max-width: 1080px; }
  .divider { max-width: 1080px; }
  #hero { max-width: 1600px; }
  .hero-polaroid { width: min(40vw, 680px); }
  .hero-video { height: clamp(300px, 28vw, 480px); }
} /* B1: kurung tutup yang hilang — sekarang ditambahkan */

/* ─── UTILITY: SCREEN READER ONLY ─── */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* ─── RSVP CHARACTER COUNTER ─── */
.rsvp-char-counter {
  text-align: right;
  font-family: var(--display);
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--muted);
  margin-top: -6px;
  transition: color .3s;
}
.rsvp-char-counter.near-limit { color: var(--accent); }
.rsvp-char-counter.at-limit   { color: #e07070; }

/* ─── REDUCED MOTION ─── */
@media (prefers-reduced-motion: reduce) {
  .postcard              { animation: none !important; }
  .bird-seal             { animation: none !important; }
  .petal                 { animation: none !important; opacity: 0.8; }
  .m-bar                 { animation: none !important; height: 10px !important; }
  .l-text                { animation: none !important; opacity: 1; }
  .f-seal                { animation: none !important; }
  .ty-star               { animation: none !important; }
  .watermark.visible span { animation: none !important; }
  .watermark[data-aos].aos-animate span { animation: none !important; }
  /* AOS: disable semua animasi */
  [data-aos]             { opacity: 1 !important; transform: none !important; transition: none !important; }
  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .lightbox.open { animation: none !important; }
  #cover { transition: opacity .2s !important; }
  .book-flipper.flipping { animation: bookFlip3D 0.15s linear forwards !important; }
  *, *::before, *::after { transition-duration: 0.1s !important; }
}

/* ─── B4: THEME ICON — CSS-driven (no FOUC) ─── */
/* Default HTML menampilkan ikon bulan => dark mode icon */
.theme-btn .icon-moon { display: block; }
.theme-btn .icon-sun  { display: none; }
/* Saat [data-theme="light"], data-theme sudah di-set SEBELUM DOM render via inline script */
[data-theme="light"] .theme-btn .icon-moon { display: none; }
[data-theme="light"] .theme-btn .icon-sun  { display: block; }

/* ─── B9: RSVP STATS SKELETON SHIMMER ─── */
.r-n.loading {
  color: transparent;
  background: linear-gradient(90deg, var(--card2) 25%, var(--border) 50%, var(--card2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 4px;
  min-width: 40px;
  display: inline-block;
  user-select: none;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}


/* ─── AOS SAFETY NET ─── */
/* Elemen dengan data-aos sudah dihandle oleh AOS library setelah openInvitation() */
/* Safety: jika AOS gagal total (library tidak terload), tampilkan elemen */
body:not([data-aos-global]) #main.visible [data-aos] {
  /* Hanya berlaku jika AOS tidak menambahkan attribute ke body */
  /* AOS menambahkan kelas .aos-init saat berhasil init */
}
/* Elemen dalam main yang sudah dianimasikan AOS */
#main.visible [data-aos].aos-animate {
  opacity: 1 !important;
  transform: none !important;
}
/* Fallback hard: jika setelah 3 detik masih belum ada .aos-init, tampilkan paksa */
#main.visible.aos-fallback [data-aos] {
  opacity: 1 !important;
  transform: none !important;
  transition: opacity 0.5s ease !important;
}

/* ─── LENIS INERTIA SCROLLING ─── */
html.lenis, html.lenis body {
  height: auto;
}
.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}
.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}
.lenis.lenis-stopped {
  overflow: hidden;
}
.lenis.lenis-smooth iframe {
  pointer-events: none;
}

/* ─── CUSTOM MAGNETIC CURSOR ─── */
@media (pointer: fine) and (prefers-reduced-motion: no-preference) {
  body { cursor: none; }
  .custom-cursor {
    position: fixed; top: 0; left: 0;
    width: 14px; height: 14px;
    background: var(--accent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99999;
    mix-blend-mode: difference;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s, background 0.3s;
    will-change: transform, width, height;
  }
  .custom-cursor.hovering {
    width: 60px; height: 60px;
    background: #fff;
  }
}

/* ─── WEBGL BACKGROUND CANVAS ─── */
#bg-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: 0;
  pointer-events: none; /* Let clicks pass through */
  opacity: 0.15;
  mix-blend-mode: screen;
}
[data-theme="light"] #bg-canvas {
  opacity: 0.08;
  mix-blend-mode: multiply;
}

/* ─── V11 PRO GALLERY GRID ─── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(12px, 2vw, 20px);
  width: 100%;
}

/* Item foto galeri — rounded, clipped */
.gallery-grid .gal-item {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  aspect-ratio: 3/4;
  cursor: pointer;
  /* Perspektif untuk efek 3D hover */
  transform-style: preserve-3d;
  will-change: transform, opacity;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  transition: box-shadow 0.5s ease;
}

.gallery-grid .gal-item:hover {
  box-shadow: 0 16px 56px rgba(200, 169, 110, 0.22);
}

/* Foto di dalam item */
.gallery-grid .gal-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(15%) sepia(10%) contrast(105%);
  transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              filter 0.5s ease;
  will-change: transform;
}

.gallery-grid .gal-item:hover img {
  transform: scale(1.08);
  filter: grayscale(0%) sepia(0%);
}

/* Gold overlay shimmer saat hover */
.gallery-grid .gal-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(200, 169, 110, 0.25) 0%,
    transparent 50%
  );
  opacity: 0;
  transition: opacity 0.45s ease;
  border-radius: 12px;
  pointer-events: none;
}

.gallery-grid .gal-item:hover::after {
  opacity: 1;
}

/* Foto pertama & keempat (kolom kiri) sedikit lebih tinggi */
.gallery-grid .gal-item:nth-child(1),
.gallery-grid .gal-item:nth-child(4) {
  aspect-ratio: 3/4;
}

/* Foto ke-3 & ke-6 lebih landscape — variasi visual */
.gallery-grid .gal-item:nth-child(3),
.gallery-grid .gal-item:nth-child(6) {
  aspect-ratio: 3/4;
}

/* Mobile: 2 kolom */
@media (max-width: 640px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}
