/* ============================================
   UNDANGAN KHITANAN — JAWA KLASIK (TEMA TERANG)
   Font & palet warna mengikuti referensi
   Mobile-first, single column
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
  --surface: #fdf8f7;            /* background utama, putih hangat */
  --surface-low: #f7f3f1;        /* background section sekunder */
  --surface-dim: #ede7e5;        /* sedikit lebih gelap, untuk kontras kartu */
  --on-surface: #1c1b1b;         /* teks utama, hampir hitam */
  --on-surface-variant: #494740; /* teks sekunder/redup */
  --secondary: #805533;          /* coklat utama, aksen & tombol */
  --secondary-dark: #5c3d20;     /* coklat lebih gelap, untuk hover */
  --secondary-fixed: #ffdcc5;    /* peach muda, background lembut */
  --secondary-fixed-dim: #f4bb92;/* peach lebih pekat */
  --tertiary: #765a26;           /* gold/emas redup, pengganti prada */
  --tertiary-light: #e6c184;     /* gold muda */
  --sogan: #9c4a2b;              /* merah bata, dipakai untuk nama tamu/aksen */
  --outline: #cbc6bd;            /* garis/border halus */
  --outline-soft: rgba(124, 90, 38, 0.16);

  --font-display: 'Playfair Display', serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  --font-formal: 'Playfair Display', serif;

  --radius: 18px;
  --max-w: 480px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--surface-dim);
  color: var(--on-surface);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

body {
  min-height: 100vh;
  width: 100%;
  display: flex;
  justify-content: center;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.app {
  width: 100%;
  max-width: var(--max-w);
  min-height: 100vh;
  position: relative;
  background: var(--surface);
  box-shadow: 0 0 60px rgba(0,0,0,0.12);
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

/* ---------- Tekstur kertas/kayu lembut (rustic touch, versi terang) ---------- */
.wood-texture {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  background-image:
    radial-gradient(ellipse at 20% 10%, rgba(128,85,51,0.05), transparent 60%),
    radial-gradient(ellipse at 80% 90%, rgba(118,90,38,0.06), transparent 60%);
}

/* ---------- Pattern batik kawung asli (background section, di-tile) ---------- */
.batik-pattern {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.06;
  background-image: url('../img/motif-kawung.png');
  background-repeat: repeat;
  background-size: 130px 130px;
  filter: invert(1); /* motif gambar gelap dibalik supaya kebaca di atas background terang */
}

.branch-corner { display: none; }

/* ============================================
   COVER / GATE SCREEN — GUNUNGAN WAYANG
   ============================================ */
#cover {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 44px 28px 40px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255,220,197,0.5), transparent 55%),
    linear-gradient(180deg, var(--surface) 0%, var(--secondary-fixed) 120%);
  text-align: center;
  transition: transform 0.9s cubic-bezier(0.65, 0, 0.35, 1), opacity 0.7s ease;
  overflow: hidden;
}

#cover.opened {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

.cover-frame {
  position: absolute;
  inset: 14px;
  border: 1px solid var(--outline-soft);
  pointer-events: none;
}
.cover-frame::before,
.cover-frame::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  border: 1.5px solid var(--tertiary);
}
.cover-frame::before { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.cover-frame::after { bottom: -1px; right: -1px; border-left: none; border-top: none; }

/* Gunungan wayang — dua sosok utuh, nempel di pinggir kiri & kanan,
   bergoyang halus seperti tertiup angin */
.gunungan-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.gunungan-half {
  position: absolute;
  top: 38%;
  width: 223px;
  height: 466px;
  margin-top: -233px;
  transition: transform 0.9s cubic-bezier(0.65, 0, 0.35, 1), opacity 0.9s ease;
  animation: gununganKibas 4.5s ease-in-out infinite;
  opacity: 0.85;
}
.gunungan-half img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 6px 16px rgba(118,90,38,0.25));
}

.gunungan-half.left {
  left: -110px;
  transform-origin: center;
  --tilt: 12deg;
  --kibas: -3deg;
  animation-delay: 0s;
}
.gunungan-half.right {
  right: -110px;
  transform-origin: center;
  --tilt: -12deg;
  --kibas: 3deg;
  animation-delay: 0.4s;
}
.gunungan-half.right img { transform: scaleX(-1); }

@keyframes gununganKibas {
  0%, 100% { transform: rotate(var(--tilt, 0deg)); }
  50%      { transform: rotate(calc(var(--tilt, 0deg) + var(--kibas, 2.5deg))); }
}

#cover.opening .gunungan-half.left { transform: translateX(-90px) rotate(-10deg); opacity: 0; animation: none; }
#cover.opening .gunungan-half.right { transform: translateX(90px) rotate(10deg); opacity: 0; animation: none; }

@media (prefers-reduced-motion: reduce) {
  .gunungan-half { animation: none; }
}

.cover-eyebrow {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--secondary);
  margin-top: 10px;
}

.cover-script {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 22px;
  color: var(--tertiary);
  margin: 12px 0 0;
  line-height: 1;
  letter-spacing: 0.5px;
}

.cover-names {
  font-family: var(--font-display);
  font-size: 46px;
  font-weight: 700;
  line-height: 1.1;
  margin: 16px 0 0;
  color: var(--on-surface);
}

.cover-divider {
  width: 70px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--tertiary), transparent);
  margin: 20px auto;
  position: relative;
}
.cover-divider::before {
  content: '◆';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 8px;
  color: var(--tertiary);
  background: var(--surface);
  padding: 0 6px;
}

.cover-guest-block {
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--on-surface-variant);
}
.cover-guest-block .label {
  display: block;
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--secondary);
  margin-bottom: 8px;
}
.cover-guest-name {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 22px;
  color: var(--sogan);
  margin-top: 4px;
}

.btn-open {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 30px;
  background: var(--secondary);
  border: 1px solid var(--secondary);
  color: #ffffff;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 999px;
  overflow: hidden;
  transition: background 0.4s ease, transform 0.15s ease;
  box-shadow: 0 8px 24px rgba(128,85,51,0.3);
}
.btn-open:hover { background: var(--secondary-dark); }
.btn-open:active { transform: scale(0.97); }
.btn-open .seal-icon { width: 16px; height: 16px; flex-shrink: 0; }

.cover-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.cover-hint {
  font-size: 10px;
  letter-spacing: 1.5px;
  color: rgba(28,27,27,0.4);
  text-transform: uppercase;
}

/* Falling petals/prada particles */
.leaf-particle {
  position: absolute;
  top: -20px;
  font-size: 13px;
  color: var(--tertiary);
  opacity: 0.7;
  pointer-events: none;
  animation: leafFall linear forwards;
  z-index: 2;
}
@keyframes leafFall {
  0% { transform: translateY(0) translateX(0) rotate(0deg); opacity: 0.85; }
  100% { transform: translateY(110vh) translateX(var(--drift, 30px)) rotate(360deg); opacity: 0; }
}

/* ============================================
   MAIN CONTENT (after opened)
   ============================================ */
#content {
  position: relative;
  z-index: 1;
  padding-bottom: 40px;
}

section {
  position: relative;
  padding: 64px 28px;
}

.section-inner { position: relative; z-index: 2; }

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.22,1,0.36,1);
}
.reveal.in-view { opacity: 1; transform: translateY(0); }

.eyebrow {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--secondary);
  text-align: center;
  margin: 0 0 10px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  text-align: center;
  margin: 0 0 8px;
  color: var(--on-surface);
}

.divider-leaf {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 18px auto 30px;
  width: 100%;
  max-width: 220px;
}
.divider-leaf .line { flex: 1; height: 1px; background: var(--outline); }
.divider-leaf svg { width: 16px; height: 16px; color: var(--tertiary); flex-shrink: 0; }

/* ---------- HERO ---------- */
#hero {
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: 80px;
  background: radial-gradient(ellipse at 50% 20%, rgba(255,220,197,0.35), transparent 60%);
}

.hero-photo-frame {
  width: 168px;
  height: 168px;
  border-radius: 50%;
  border: 3px solid var(--secondary-fixed-dim);
  padding: 6px;
  margin-bottom: 26px;
  position: relative;
  box-shadow: 0 10px 40px rgba(128,85,51,0.15);
}
.hero-photo-frame::after {
  content: '';
  position: absolute;
  inset: -10px;
  border: 1px solid var(--outline-soft);
  border-radius: 50%;
}
.hero-photo {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-low) center/cover;
}

.hero-eyebrow-script {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 24px;
  color: var(--tertiary);
  margin-bottom: 6px;
}

.hero-title {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.2px;
  line-height: 1.7;
  color: var(--on-surface-variant);
  margin: 0 0 4px;
  max-width: 320px;
}

.hero-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 50px;
  line-height: 1.05;
  color: var(--sogan);
  margin: 8px 0 2px;
}

.hero-subtitle {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--secondary);
  margin-top: 4px;
}

.hero-countdown { display: flex; gap: 12px; margin-top: 36px; }
.cd-box {
  width: 60px;
  background: var(--surface);
  border: 1px solid var(--outline-soft);
  border-radius: 14px;
  padding: 10px 4px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
.cd-num {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--secondary);
  display: block;
}
.cd-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--on-surface-variant);
}

.scroll-cue {
  margin-top: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: rgba(28,27,27,0.4);
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  animation: bob 2.2s ease-in-out infinite;
}
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(8px); } }

/* ---------- INTRO / VERSE ---------- */
#intro p {
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.85;
  text-align: center;
  color: var(--on-surface-variant);
  font-style: italic;
  max-width: 360px;
  margin: 0 auto;
}

/* ---------- PROFIL ANAK ---------- */
.profile-card {
  background: var(--surface);
  border: 1px solid var(--outline-soft);
  border-radius: 32px;
  padding: 30px 22px;
  text-align: center;
  position: relative;
  box-shadow: 0 8px 30px rgba(0,0,0,0.06);
}
.profile-card::before,
.profile-card::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1px solid var(--tertiary);
  opacity: 0.4;
}
.profile-card::before { top: 14px; left: 14px; border-right: none; border-bottom: none; }
.profile-card::after { bottom: 14px; right: 14px; border-left: none; border-top: none; }

.profile-card .nama-anak {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 30px;
  color: var(--on-surface);
  margin: 0 0 4px;
}
.profile-card .nama-panggilan {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--tertiary);
}
.profile-card .putra-ke { margin-top: 14px; font-size: 13px; color: var(--secondary); }

.ortu-row { display: flex; justify-content: center; gap: 36px; margin-top: 24px; }
.ortu-item .ortu-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--secondary);
  margin-bottom: 6px;
}
.ortu-item .ortu-name { font-family: var(--font-display); font-size: 17px; color: var(--on-surface); }

/* ---------- DETAIL ACARA ---------- */
.detail-list { display: flex; flex-direction: column; gap: 18px; }
.detail-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--secondary-fixed);
  border: 1px solid var(--outline-soft);
  border-radius: 24px;
  padding: 20px;
}
.detail-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  background: var(--surface);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--secondary);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.detail-icon svg { width: 18px; height: 18px; }
.detail-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--secondary);
  margin-bottom: 4px;
}
.detail-value { font-family: var(--font-display); font-size: 17px; color: var(--on-surface); line-height: 1.4; }
.detail-sub { font-size: 12px; color: var(--on-surface-variant); margin-top: 4px; line-height: 1.5; }

.btn-maps {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #ffffff;
  background: var(--secondary);
  border: 1px solid var(--secondary);
  padding: 10px 18px;
  border-radius: 999px;
  text-decoration: none;
  transition: background 0.3s ease;
}
.btn-maps:hover { background: var(--secondary-dark); }
.btn-maps svg { width: 13px; height: 13px; }

/* ---------- AMPLOP / REKENING ---------- */
.envelope-card {
  background: var(--on-surface);
  border: 1px solid var(--on-surface);
  border-radius: 32px;
  padding: 30px 24px;
  text-align: center;
  color: #ffffff;
}
.envelope-icon { width: 40px; height: 40px; margin: 0 auto 14px; color: var(--tertiary-light); }
.envelope-text { font-size: 13px; color: rgba(255,255,255,0.65); line-height: 1.7; margin-bottom: 18px; }
.bank-box {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px;
  padding: 18px 26px;
}
.bank-name { font-size: 11px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; color: rgba(255,255,255,0.5); }
.bank-number { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: 1px; color: #ffffff; margin: 4px 0; }
.bank-holder { font-size: 12px; color: rgba(255,255,255,0.7); text-transform: uppercase; letter-spacing: 0.5px; }
.btn-copy {
  margin-top: 14px;
  background: var(--tertiary-light);
  border: 1px solid var(--tertiary-light);
  color: var(--on-surface);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 10px 20px;
  border-radius: 999px;
  cursor: pointer;
  transition: opacity 0.3s ease;
}
.btn-copy:hover { opacity: 0.85; }
.btn-copy.copied { background: #6fae72; border-color: #6fae72; color: #ffffff; }

/* ---------- UCAPAN & DOA ---------- */
.form-ucapan { display: flex; flex-direction: column; gap: 14px; }
.field label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--secondary);
  margin-bottom: 8px;
}
.field input,
.field textarea {
  width: 100%;
  background: var(--surface-low);
  border: 1px solid var(--outline-soft);
  border-radius: 16px;
  color: var(--on-surface);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 13px 16px;
  outline: none;
  transition: border-color 0.3s ease;
}
.field input::placeholder,
.field textarea::placeholder { color: rgba(28,27,27,0.3); }
.field input:focus,
.field textarea:focus { border-color: var(--secondary); }
.field textarea { resize: vertical; min-height: 90px; }

.btn-submit {
  margin-top: 4px;
  background: var(--secondary);
  border: none;
  color: #ffffff;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 15px;
  border-radius: 16px;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.15s ease;
  box-shadow: 0 8px 20px rgba(128,85,51,0.25);
}
.btn-submit:hover { background: var(--secondary-dark); }
.btn-submit:active { transform: scale(0.98); }
.btn-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.form-msg { font-size: 12px; text-align: center; min-height: 16px; color: var(--secondary); }
.form-msg.error { color: var(--sogan); }

.ucapan-list {
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
}
.ucapan-item {
  background: var(--secondary-fixed);
  border-left: 3px solid var(--tertiary);
  border-radius: 16px;
  padding: 16px 18px;
}
.ucapan-nama { font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--sogan); margin-bottom: 4px; }
.ucapan-pesan { font-size: 13px; color: var(--on-surface-variant); line-height: 1.6; }
.ucapan-empty { text-align: center; font-size: 12px; color: rgba(28,27,27,0.35); padding: 20px 0; }

/* ---------- FOOTER ---------- */
#footer { text-align: center; padding: 50px 28px 70px; background: var(--surface-low); }
.footer-script { font-family: var(--font-display); font-style: italic; font-size: 26px; color: var(--tertiary); margin-bottom: 10px; }
.footer-text { font-size: 12px; color: var(--on-surface-variant); line-height: 1.8; max-width: 300px; margin: 0 auto; }
.footer-family { font-family: var(--font-display); font-weight: 700; font-size: 20px; margin-top: 16px; color: var(--on-surface); }

/* ---------- MUSIC TOGGLE (floating) ---------- */
#music-toggle {
  position: fixed;
  bottom: 22px;
  right: 22px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--outline-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 40;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  transition: transform 0.3s ease;
}
#music-toggle:active { transform: scale(0.92); }
#music-toggle svg { width: 18px; height: 18px; color: var(--secondary); }
#music-toggle.spinning svg { animation: spin 4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@supports (padding: max(0px)) {
  .app { padding-bottom: max(0px, env(safe-area-inset-bottom)); }
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--secondary); border-radius: 4px; }

/* ============================================
   RESPONSIVE — DESKTOP / LAYAR LEBAR
   ============================================ */
@media (min-width: 640px) {
  body {
    background: var(--surface-dim);
    padding: 40px 0;
    align-items: flex-start;
  }

  .app {
    min-height: 100vh;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 20px 80px rgba(0,0,0,0.18);
    /* overflow dihapus dari sini, dipindah ke #cover saja */
  }

  #cover {
    position: absolute !important;
    inset: 0;
    border-radius: 8px;
    overflow: hidden;
  }

  .gunungan-half {
    width: 190px;
    height: 396px;
    margin-top: -198px;
  }
}