/* ==========================================================================
   Undangan Pernikahan — Tema Tropical Botanical & Merak
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400&family=Marck+Script&family=Jost:wght@300;400;500;600&display=swap');

:root{
  --cream:        #f8f2e6;
  --cream-deep:   #efe6d3;
  --ink:          #2b2a25;
  --ink-soft:     #5c5648;
  --leaf-deep:    #2f4a34;
  --leaf-mid:     #4c7457;
  --leaf-light:   #7fa07d;
  --peacock-teal: #0f6e63;
  --peacock-blue: #1c5c78;
  --peacock-gold: #c99a3e;
  --flower-pink:  #c9557a;
  --flower-pink-soft: #e6a2b8;

  --font-display: 'Cormorant Garamond', serif;
  --font-script:  'Marck Script', cursive;
  --font-body:    'Jost', sans-serif;
}

*, *::before, *::after{ box-sizing: border-box; }

html{ scroll-behavior: smooth; }

body{
  margin: 0;
  background: var(--ink);
  color: var(--ink);
  font-family: var(--font-body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img{ max-width: 100%; display: block; }

a{ color: inherit; }

button{ font-family: inherit; cursor: pointer; }

.visually-hidden{
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- shared page frame ---------- */
.page{
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--cream);
  overflow: hidden;
  box-shadow: 0 0 60px rgba(0,0,0,.4);
}

.corner-art{
  position: absolute;
  z-index: 1;
  /* pointer-events: none; */
  /* opacity: .95; */
}
.corner-art.tl{ top: -40px;
    left: -52px;
    width: 50%;
 }
.corner-art.tr{ top: -20px; right: -35px; width: 40%; transform: scaleX(-1); }
.corner-art.br{ bottom: -6px; right: -10px; width: 58%; }
.corner-art.bl{ bottom: -30px; right: -40px; width: 42%; }

.section-inner{
  position: relative;
  z-index: 2;
}

/* ---------- COVER ---------- */
#cover{
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  transition: transform .8s cubic-bezier(.65,0,.35,1), opacity .8s ease;
}
/* #cover.is-closed{
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
} */
.cover-frame{
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
  /* background: var(--cream); */
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  padding: 48px 28px 40px;
  overflow: hidden;
}
.cover-eyebrow{
  font-size: .78rem;
  letter-spacing: .12em;
  color: var(--ink-soft);
  margin: 0 0 6px;
  position: relative; z-index: 2;
}
.cover-names{
  font-family: var(--font-script);
  font-size: 2.6rem;
  line-height: 1.15;
  color: var(--leaf-deep);
  margin: 0;
  position: relative; z-index: 2;
}
.cover-amp{
  display: block;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.3rem;
  color: var(--flower-pink);
  margin: 2px 0;
}
.cover-date{
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: .06em;
  color: var(--peacock-teal);
  margin-top: 10px;
  position: relative; z-index: 2;
}
.cover-guest{
  position: relative; z-index: 2;
  margin-top: 34px;
  font-size: .85rem;
  color: var(--ink-soft);
}
.cover-guest strong{
  display: block;
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--ink);
}
.cover-open{
  position: relative; z-index: 2;
  margin-top: 30px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 30px;
  border: 1px solid var(--leaf-deep);
  border-radius: 999px;
  background: transparent;
  color: var(--leaf-deep);
  font-size: .82rem;
  letter-spacing: .08em;
  transition: background .25s ease, color .25s ease;
}
.cover-open:hover{ background: var(--leaf-deep); color: var(--cream); }
.cover-open svg{ width: 16px; height: 16px; }

/* ---------- generic section spacing ---------- */
.section{
  position: relative;
  padding: 64px 30px;
  text-align: center;
}
.section--tight{ padding-top: 40px; padding-bottom: 40px; }

/* beranda: full viewport height including Safari address bar */
#beranda{
  min-height: 100vh;
  min-height: 100dvh; /* Safari dynamic viewport height - accounts for address bar */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Background image beranda (opacity terpisah agar konten tetap jelas) */
#beranda::before{
  content: '';
  position: absolute;
  inset: 0;
  background: url('assets/bg2.jpg') center / cover no-repeat;
  opacity: 0.1;
  z-index: 0;
  pointer-events: none;
}

.eyebrow{
  font-size: .72rem;
  letter-spacing: .14em;
  color: var(--peacock-teal);
  margin: 0 0 10px;
}

/* ---------- hero greeting ---------- */
.hero-label{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0 0 14px;
  color: #b58a63;
  font-family: var(--font-body);
  font-size: clamp(.62rem, 2.2vw, .78rem);
  font-weight: 400;
  letter-spacing: .14em;
  line-height: 1.2;
  text-transform: uppercase;
  white-space: nowrap;
}
.hero-label::before,
.hero-label::after{
  content: '';
  width: clamp(28px, 9vw, 42px);
  height: 1px;
  background: #b58a63;
  position: relative;
}
.hero-label::before::after,
.hero-label::after::after{
  content: '';
}

.hero-script{
  width: 100%;
  max-width: 100%;
  margin: 0 auto 20px;
  color: var(--peacock-teal);
  font-family: var(--font-script);
  /* Ukuran dibatasi agar selalu muat di mobile maupun desktop. */
  font-size: clamp(1.35rem, 7.5vw, 2.8rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -.02em;
  white-space: nowrap;
}
.section-title{
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 8px;
}
.section-script{
  font-family: var(--font-script);
  font-size: 1.6rem;
  color: var(--flower-pink);
  margin: 0 0 18px;
}
.divider{
  width: 46px;
  height: 2px;
  background: var(--peacock-gold);
  margin: 18px auto;
  border: none;
}
.body-text{
  font-size: .96rem;
  line-height: 1.85;
  color: var(--ink-soft);
  max-width: 34ch;
  margin: 0 auto;
}

/* ---------- opening quote ---------- */
#pembuka{
  background: var(--cream-deep);
  padding: 64px 0 0;
}
#pembuka .section-inner{
  padding-left: 30px;
  padding-right: 30px;
}
.opening-image{
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  margin: 32px 0 0;
}
.quote-mark{
  font-family: var(--font-display);
  font-size: 3.4rem;
  color: var(--peacock-gold);
  line-height: 1;
  margin-bottom: 6px;
}
.quote-text{
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.12rem;
  line-height: 1.75;
  color: var(--ink);
  max-width: 32ch;
  margin: 0 auto 14px;
}
.quote-source{
  font-size: .82rem;
  letter-spacing: .05em;
  color: var(--ink-soft);
}

/* ---------- couple section ---------- */
.couple-wrap{
  display: flex;
  flex-direction: column;
  gap: 30px;
  margin-top: 26px;
}
.couple-card{
  display: flex;
  flex-direction: column;
  align-items: center;
}
.couple-photo{
  width: 168px;
  height: 168px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--peacock-gold);
  padding: 5px;
  background: var(--cream);
  margin-bottom: 16px;
}
.couple-photo img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.couple-name{
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--leaf-deep);
  margin: 0 0 6px;
}
.couple-role{
  font-size: .78rem;
  letter-spacing: .06em;
  color: var(--flower-pink);
  margin: 0 0 8px;
}
.couple-parents{
  font-size: .88rem;
  color: var(--ink-soft);
  line-height: 1.6;
  max-width: 28ch;
}
.couple-divider{
  font-family: var(--font-script);
  font-size: 2rem;
  color: var(--peacock-gold);
}

/* ---------- event / countdown ---------- */
#acara{
  background: var(--leaf-deep);
  color: var(--cream);
  padding: 64px 0 0;
}
#acara .section-inner{
  padding-left: 30px;
  padding-right: 30px;
}
.event-map{
  display: block;
  width: 100%;
  height: 320px;
  margin: 32px 0 0;
  border: 0;
}
#acara .eyebrow{ color: var(--peacock-gold); }
#acara .section-title{ color: var(--cream); }
#acara .body-text{ color: rgba(248,242,230,.8); }

.countdown{
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 28px 0 32px;
  flex-wrap: wrap;
}
.countdown-unit{
  background: rgba(248,242,230,.08);
  border: 1px solid rgba(248,242,230,.25);
  border-radius: 10px;
  padding: 12px 6px;
  width: 70px;
}
.countdown-num{
  font-family: var(--font-display);
  font-size: 1.7rem;
  display: block;
  color: var(--cream);
}
.countdown-label{
  font-size: .64rem;
  letter-spacing: .08em;
  color: rgba(248,242,230,.7);
}

.event-card{
  background: rgba(248,242,230,.06);
  border: 1px solid rgba(248,242,230,.2);
  border-radius: 16px;
  padding: 26px 22px;
  max-width: 320px;
  margin: 0 auto;
}
.event-day{
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin: 0 0 2px;
}
.event-date{
  font-size: .85rem;
  color: rgba(248,242,230,.75);
  margin: 0 0 14px;
}
.event-row{
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  font-size: .86rem;
  line-height: 1.55;
  margin-bottom: 10px;
  color: rgba(248,242,230,.9);
}
.event-row svg{ flex: none; width: 17px; height: 17px; margin-top: 2px; color: var(--peacock-gold); }

.map-btn{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 22px;
  border-radius: 999px;
  background: var(--peacock-gold);
  color: var(--leaf-deep);
  font-size: .8rem;
  letter-spacing: .05em;
  text-decoration: none;
  font-weight: 500;
}

/* ---------- gallery carousel ---------- */
.carousel-wrap{
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  margin-top: 24px;
}
.carousel-track{
  display: flex;
  transition: transform .45s cubic-bezier(.4,0,.2,1);
}
.carousel-track .gallery-item{
  flex: 0 0 33.3333%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 8px;
  background: var(--leaf-light);
  margin: 0 4px;
}
.carousel-track .gallery-item img{ width: 100%; height: 100%; object-fit: cover; }
.carousel-arrow{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.85);
  color: var(--ink);
  font-size: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
  cursor: pointer;
  transition: background .2s;
  opacity: 0.7;
}
.carousel-arrow:hover{ background: #fff; }
.carousel-arrow--left{ left: 8px; }
.carousel-arrow--right{ right: 8px; }

/* ---------- RSVP ---------- */
#rsvp{ background: var(--cream-deep); }

.rsvp-flower{
  position: absolute;
  top: -45px;
  width: 30%;
  height: auto;
  opacity: 0.7;
  z-index: 1;
  pointer-events: none;
}
.rsvp-flower--left{
  left: 0;
}
.rsvp-flower--right{
  right: 0;
}
#rsvp .section-inner{
  position: relative;
  z-index: 2;
}

.rsvp-form{
  margin-top: 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}
.field label{
  display: block;
  font-size: .76rem;
  letter-spacing: .04em;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.field input,
.field select,
.field textarea{
  width: 100%;
  border: 1px solid rgba(43,42,37,.2);
  background: var(--cream);
  border-radius: 8px;
  padding: 11px 13px;
  font-family: var(--font-body);
  font-size: .9rem;
  color: var(--ink);
}
.field textarea{ resize: vertical; min-height: 78px; }
.field input:focus,
.field select:focus,
.field textarea:focus{
  outline: 2px solid var(--peacock-teal);
  outline-offset: 1px;
}
.rsvp-submit{
  margin-top: 4px;
  padding: 13px;
  border: none;
  border-radius: 8px;
  background: var(--leaf-deep);
  color: var(--cream);
  font-size: .88rem;
  letter-spacing: .05em;
}
.rsvp-submit:hover{ background: var(--peacock-teal); }
.rsvp-note{
  font-size: .74rem;
  color: var(--ink-soft);
  margin-top: 8px;
}

.wishes-list{
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
  max-height: 340px;
  overflow-y: auto;
  padding-right: 4px;
}
.wish-item{
  background: var(--cream);
  border: 1px solid rgba(43,42,37,.12);
  border-radius: 10px;
  padding: 14px 16px;
}
.wish-name{
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--leaf-deep);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.wish-tag{
  font-size: .66rem;
  letter-spacing: .04em;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(15,110,99,.12);
  color: var(--peacock-teal);
  white-space: nowrap;
}
.wish-tag.tidak{ background: rgba(201,85,122,.12); color: var(--flower-pink); }
.wish-text{
  font-size: .86rem;
  color: var(--ink-soft);
  margin-top: 6px;
  line-height: 1.6;
}
.wishes-empty{
  font-size: .85rem;
  color: var(--ink-soft);
  text-align: center;
  padding: 20px 0;
}

/* ---------- closing ---------- */
#penutup{
  background: var(--cream);
  padding-bottom: 90px;
}

#penutup::before{
  content: '';
  position: absolute;
  inset: 0;
  background: url('assets/bg.png') center / cover no-repeat;
  opacity: 1;
  z-index: 0;
  pointer-events: none;
}
#penutup .section-inner{
  position: relative;
  z-index: 2;
}

.penutup-bg3{
  position: absolute;
  left: 0;
  bottom: 0;
  width: 70%;
  height: auto;
  opacity: 1;
  z-index: 1;
  pointer-events: none;
}

.closing-names{
  font-family: var(--font-script);
  font-size: 2.1rem;
  color: var(--leaf-deep);
  margin: 14px 0 0;
}
.footer-credit{
  margin-top: 40px;
  font-size: .68rem;
  color: var(--ink-soft);
  opacity: .7;
}

/* ---------- music toggle ---------- */
.music-toggle{
  position: fixed;
  z-index: 400;
  bottom: 22px;
  right: calc(50% - 240px + 22px);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--leaf-deep);
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(0,0,0,.15);
}
.music-toggle svg{ width: 20px; height: 20px; color: var(--leaf-deep); }
.music-toggle .icon-pause{ display: none; }
.music-toggle.is-playing .icon-play{ display: none; }
.music-toggle.is-playing .icon-pause{ display: block; }
.music-toggle.is-playing{ animation: spin 6s linear infinite; }
@keyframes spin{ to{ transform: rotate(360deg); } }

@media (max-width: 520px){
  .music-toggle{ right: 22px; }
}

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  #cover{ transition: none; }
  .music-toggle.is-playing{ animation: none; }
}


.corner-art.bot {
    bottom: 0;
    left: 0;
    transition: transform 1.2s ease-in-out;
}

.corner-art.border{
    border: #b1b1b1 1px solid;
}

/* ---------- Frames in Mempelai section ---------- */
.mempelai-frame {
    position: absolute;
    z-index: 1;
    pointer-events: none;
    width: 50%;
    will-change: transform, opacity;
}
.mempelai-frame--atas {
    top: 0;
    right: 0;
    transform: translateY(-60px);
    opacity: 0;
}
.mempelai-frame--bawah {
    bottom: -70px;
    left: 0;
    transform: translateY(60px);
    opacity: 0;
}
.mempelai-frame--bawah-kanan {
    bottom: -50px;
    right: 0;
    transform: translateY(60px);
    opacity: 1;
    width: 20%;
}

/* Peacock tetap menempel di bawah #beranda, lalu zoom dan fade saat scroll */
#beranda .corner-art.bot {
    transform-origin: bottom right;
    will-change: transform, opacity;
    transition: none;
}
.corner-art.top {
    top: -13%;
    left: -8%;
    max-width: 116%;

    /* titik lipatan di bagian bawah */
    /* transform-origin: 50% 100%; */

    /* kondisi awal */
    transform: perspective(1000px) rotateX(0deg);

    transform-style: preserve-3d;
    backface-visibility: hidden;

    transition: transform 1.2s cubic-bezier(.65, 0, .35, 1);
}

#undangan {
    transition: transform 1.2s ease-in-out;
}

#pengantin-top {
    margin-top: 50px;
    transition: transform 1.2s ease-in-out;
    z-index: 2;
}


/* LIFT sedikit */
.corner-art.top.lift {
    transform:
        perspective(1000px)
        rotateX(25deg);
}

#pengantin-top.lift {
    transform:
        perspective(1000px)
        rotateX(25deg);
}


/* LIPAT DARI BAWAH KE ATAS */
.corner-art.top.open {
    transform: translateY(-100%);
}
.corner-art.bot.open {
    transform: translateY(100%);
}
#undangan.open {
    transform: translateY(calc(100vh + 100%));
}
#pengantin-top.open {
    transform: translateY(calc(-100vh + 100% + 40px));
}

#click-hint {
    position: absolute;
    /* Nilai top dihitung dari tinggi #myImage oleh JavaScript. */
    left: 70%;
    transform: translateX(-50%);

    display: flex;
    flex-direction: row;
    align-items: flex-end;

    opacity: 0;
    z-index: 20;
    pointer-events: none;

    animation: clickHint 4s ease-in-out infinite;
    animation-delay: 3s;
}

#click-hint img {
    width: clamp(52px, 16vw, 70px);
    height: auto;
    display: block;
}

#clickHere {
    margin-top: 5px;
    font-size: clamp(11px, 3.2vw, 14px);
    letter-spacing: 2px;
    white-space: nowrap;
}

#click-hint.hide {
    animation: clickHintHide 0.7s ease-in-out forwards;
}

@keyframes clickHintHide {
    from {
        opacity: 0.6;
    }

    to {
        opacity: 0;
    }
}

@keyframes clickHint {
    /* Muncul */
    0% {
        opacity: 0;
    }

    10% {
        opacity: 0.6;
    }

    /* Tetap muncul ±3 detik */
    60% {
        opacity: 0.6;
    }

    /* Hilang */
    70% {
        opacity: 0;
    }

    /* Hilang ±2 detik */
    100% {
        opacity: 0;
    }
}