/* ==========================================================================
   Wedding Invitation — Faishal & Jasmine
   Theme: Enchanted Fairytale Garden (watercolor, vintage)
   ========================================================================== */

:root {
  --color-forest: #2F3B2C;
  --color-forest-soft: #3A4A35;
  --color-cream: #EFEBDD;
  --color-cream-light: #F7F4EA;
  --color-gold: #8B6F47;
  --color-gold-light: #B39A6E;
  --color-white: #FFFFFF;

  --font-script: 'Pinyon Script', cursive;
  --font-serif: 'Libre Baskerville', serif;

  --section-padding-y: 72px;
  --section-padding-x: 24px;
  --max-width: 560px;

  --video-gradient: linear-gradient(160deg, var(--color-forest) 0%, var(--color-gold-light) 100%);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-serif);
  background: var(--color-cream);
  color: var(--color-forest);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.lock-scroll { height: 100%; overflow: hidden; position: fixed; width: 100%; }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

.invitation-wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  position: relative;
  background: var(--color-cream);
  min-height: 100vh;
}

/* ==========================================================================
   SHARED: full-bleed video that preserves aspect ratio, gradient in the gaps
   ========================================================================== */

.bg-video {
  width: 100%;
  height: 100%;
  object-fit: cover;   /* crop to fill — swap back to "contain" later if you want letterboxing instead */
  background: var(--video-gradient);
}

/* ==========================================================================
   COVER / GATE
   ========================================================================== */

#cover {
  position: fixed;
  inset: 0;
  z-index: 200;
  overflow: hidden;
  background: var(--color-forest);
  transition: opacity 0.7s ease;
}

#cover.closing { opacity: 0; pointer-events: none; }

#cover .bg-video { position: absolute; inset: 0; }

/* Positioned over the video's own baked-in layout — adjust "top" to taste */
.cover-content {
  position: absolute;
  left: 50%;
  top: 55%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-width);
  padding: 0 var(--section-padding-x);
  text-align: center;
  color: var(--color-forest);
  opacity: 0;
  transition: opacity 0.9s ease;
}

#cover.video-ready .cover-content { opacity: 1; }

.cover-guest { background: none; padding: 0; transform: scale(0.8); transform-origin: top center; }

.cover-guest-label { font-size: 13px; letter-spacing: 0.5px; }
.cover-guest-name { font-size: 20px; font-weight: 700; margin-top: 4px; }

.btn-open {
  margin-top: 20px;
  background: var(--color-white);
  color: var(--color-forest);
  font-size: 16px;
  padding: 16px 48px;
  border-radius: 999px;
  box-shadow: 0 4px 18px rgba(47, 59, 44, 0.25);
  transition: transform 0.2s ease;
}
.btn-open:active { transform: scale(0.96); }
.btn-open { position: relative; overflow: hidden; min-width: 200px; }
.btn-open .btn-label { position: relative; z-index: 1; }
.btn-open .btn-fill { position: absolute; inset: 0; transform-origin: left; transform: scaleX(0); background: rgba(139, 111, 71, 0.22); transition: transform 0.3s ease; }
.btn-open:disabled { cursor: progress; }
.btn-open:disabled:active { transform: none; }
.btn-open.is-ready .btn-fill { transform: scaleX(0) !important; }

/* Indikator memuat di bawah cover */
.cover-loader {
  position: absolute; left: 50%; bottom: calc(28px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  width: min(240px, 70%); text-align: center; color: var(--color-forest);
  font-size: 12px; letter-spacing: 0.4px; transition: opacity 0.6s ease; pointer-events: none;
}
.cover-loader.done, #cover.video-ready .cover-loader { opacity: 0; }
.loader-text { display: block; margin-bottom: 8px; text-shadow: 0 0 8px rgba(239, 235, 221, 0.9); }
.loader-bar { display: block; height: 3px; border-radius: 3px; background: rgba(47, 59, 44, 0.18); overflow: hidden; }
.loader-bar i { display: block; height: 100%; width: 0; background: var(--color-forest); border-radius: 3px; transition: width 0.3s ease; }
.cover-loader.indeterminate .loader-bar i { width: 40%; animation: loader-slide 1.2s ease-in-out infinite; }
@keyframes loader-slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }
@media (prefers-reduced-motion: reduce) { .cover-loader.indeterminate .loader-bar i { animation: none; width: 100%; } }

/* ==========================================================================
   TRANSITION VIDEO — a normal section in the scroll flow
   ========================================================================== */

#video-transition {
  position: relative;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--color-forest);
}

/* ==========================================================================
   SCROLL REVEAL
   ========================================================================== */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ==========================================================================
   SHARED SECTION STYLES
   ========================================================================== */

.section { padding: var(--section-padding-y) var(--section-padding-x); position: relative; text-align: center; }
.section--alt { background: var(--color-cream-light); }
.section-title { font-family: var(--font-script); font-weight: 400; font-size: 38px; color: var(--color-gold); margin-bottom: 8px; }
.section-kicker { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--color-gold-light); margin-bottom: 8px; }
.divider { width: 48px; height: 1px; background: var(--color-gold); margin: 24px auto; }

/* RSVP heading uses body serif, not script, per request */
#rsvp .section-title {
  font-family: var(--font-serif);
  font-style: normal;
  font-weight: 400;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-size: 22px;
  color: var(--color-forest);
}

/* ==========================================================================
   QURAN / QUOTE
   ========================================================================== */

#quote { background: linear-gradient(180deg, #DCE3D2 0%, #E9E3CE 100%); padding-top: 96px; padding-bottom: 96px; }
.quote-arabic { font-size: 15px; line-height: 2.1; margin-bottom: 20px; direction: rtl; }
.quote-translation { font-style: italic; font-size: 14px; max-width: 420px; margin: 0 auto 16px; }
.quote-source { font-weight: 700; color: var(--color-gold); }

/* Add to Calendar button */
.btn-add-calendar {
  display: inline-block;
  margin-top: 8px;
  margin-bottom: 40px;
  border: 1px solid var(--color-forest);
  background: var(--color-white);
  padding: 12px 28px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--color-forest);
}

/* ==========================================================================
   COUPLE / MEMPELAI
   ========================================================================== */

.couple-card { margin-bottom: 56px; }
.couple-card:last-child { margin-bottom: 0; }
.couple-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; }
.couple-photo { width: 100%; aspect-ratio: 3/4; overflow: hidden; border-radius: 4px; background: linear-gradient(160deg, #D8D2BC, #B8C4AA); margin-bottom: 20px; }
.couple-name { font-family: var(--font-script); font-size: 32px; color: var(--color-gold); }
.couple-fullname { font-size: 16px; font-weight: 700; margin-top: 4px; }
.couple-parents { font-size: 13px; margin-top: 8px; color: var(--color-forest-soft); }
.couple-social { 
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--color-forest);
    color: var(--color-cream);
    margin-top: 16px;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }

.couple-social:hover, .couple-social:active {
    transform: scale(0.95);
    opacity: 0.9;
  }

.couple-social svg {
    width: 20px;
    height: 20px;
  }

/* ==========================================================================
   COUNTDOWN
   ========================================================================== */

.countdown { display: flex; justify-content: center; gap: 16px; margin: 32px 0; }
.countdown-unit { background: var(--color-forest); color: var(--color-cream); border-radius: 8px; padding: 14px 10px; min-width: 64px; }
.countdown-number { font-size: 24px; font-weight: 700; display: block; }
.countdown-label { font-size: 10px; letter-spacing: 1px; text-transform: uppercase; opacity: 0.8; }

/* ==========================================================================
   EVENT / ACARA
   ========================================================================== */

.event-card { background: var(--color-white); border: 1px solid rgba(139, 111, 71, 0.25); border-radius: 12px; padding: 32px 20px; margin-bottom: 20px; }
.event-date { font-size: 16px; font-weight: 700; color: var(--color-forest); margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid rgba(139, 111, 71, 0.15); }

.event-sessions { display: flex; justify-content: center; align-items: center; gap: 12px; margin-bottom: 24px; }
.event-session { flex: 1; }
.session-divider { width: 1px; height: 50px; background: var(--color-gold); opacity: 0.3; }

.event-name { font-family: var(--font-script); font-size: 26px; color: var(--color-gold); margin-bottom: 4px; line-height: 1.2; }
.event-detail { font-size: 14px; margin-bottom: 4px; }
.event-venue { font-weight: 700; margin-top: 0; }
.btn-maps { display: inline-block; margin-top: 16px; border: 1px solid var(--color-forest); padding: 10px 24px; border-radius: 999px; font-size: 13px; transition: background 0.2s ease, color 0.2s ease; }

.btn-maps:hover { background: var(--color-forest); color: var(--color-cream); }

/* ==========================================================================
   GALLERY
   ========================================================================== */

.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.gallery-grid img, .gallery-grid .ph { aspect-ratio: 1/1; background: linear-gradient(160deg, #D8D2BC, #B8C4AA); border-radius: 2px; }

/* ==========================================================================
   LOVE STORY
   ========================================================================== */

.timeline { text-align: left; border-left: 2px solid var(--color-gold-light); margin-left: 12px; padding-left: 24px; }
.timeline-item { margin-bottom: 32px; position: relative; }
.timeline-item::before { content: ''; position: absolute; left: -30px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--color-gold); }
.timeline-date { font-size: 12px; color: var(--color-gold); letter-spacing: 0.5px; margin-bottom: 4px; }
.timeline-title { font-weight: 700; margin-bottom: 4px; }
.timeline-desc { font-size: 14px; }

/* ==========================================================================
   GIFT
   ========================================================================== */

.gift-card { background: var(--color-white); border-radius: 12px; padding: 24px; margin-bottom: 12px; }
.gift-bank { font-size: 13px; color: var(--color-gold-light); }
.gift-number { font-size: 20px; font-weight: 700; margin: 6px 0; letter-spacing: 1px; }
.gift-name { font-size: 13px; }
.btn-copy { margin-top: 12px; border: 1px solid var(--color-forest); padding: 8px 20px; border-radius: 999px; font-size: 12px; }

/* ==========================================================================
   RSVP FORM
   ========================================================================== */

.form-group { margin-bottom: 18px; text-align: left; }
.form-label { display: block; font-size: 13px; margin-bottom: 6px; color: var(--color-forest-soft); }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 12px 14px; border: 1px solid rgba(47, 59, 44, 0.3); border-radius: 8px;
  font-family: var(--font-serif); font-size: 14px; background: var(--color-white); color: var(--color-forest);
}
.form-textarea { min-height: 90px; resize: vertical; }
.btn-submit { width: 100%; background: var(--color-forest); color: var(--color-cream); padding: 15px; border-radius: 999px; font-size: 15px; margin-top: 8px; }
.btn-submit:disabled { opacity: 0.6; }
.form-status { margin-top: 12px; font-size: 13px; text-align: center; }

/* Wishes list (stats removed per request) */
/* Wishes — continuous crawling scroll list (auto-scroll + user can scroll too) */
.wishes-scroll {
  text-align: left;
  height: 340px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--color-gold-light) transparent;
  border-radius: 12px;
  background: var(--color-white);
  padding: 4px 16px;
  mask-image: linear-gradient(to bottom, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
}
.wishes-scroll::-webkit-scrollbar { width: 4px; }
.wishes-scroll::-webkit-scrollbar-thumb { background: var(--color-gold-light); border-radius: 4px; }

.wish-item { border-bottom: 1px solid rgba(47, 59, 44, 0.12); padding: 14px 0; }
.wish-name { font-weight: 700; font-size: 14px; }
.wish-status { display: inline-block; font-size: 10px; padding: 2px 8px; border-radius: 999px; margin-left: 6px; background: rgba(139, 111, 71, 0.15); color: var(--color-gold); }
.wish-text { font-size: 13px; margin-top: 4px; }
.wish-time { font-size: 11px; color: var(--color-gold-light); margin-top: 6px; }

/* ==========================================================================
   CLOSING
   ========================================================================== */

#closing { background: var(--color-forest); color: var(--color-cream); padding: 80px 24px 40px; }
#closing .section-title { color: var(--color-cream); font-family: var(--font-script); font-weight: 400; letter-spacing: normal; text-transform: none; }
#closing .divider { background: var(--color-cream); opacity: 0.4; }
.closing-text { font-size: 14px; max-width: 400px; margin: 0 auto 24px; opacity: 0.9; }
.closing-names { font-family: var(--font-script); font-size: 34px; margin-top: 12px; }
.credit { margin-top: 48px; font-size: 11px; opacity: 0.5; letter-spacing: 0.5px; }

/* ==========================================================================
   MUSIC TOGGLE
   ========================================================================== */

.music-toggle {
  position: fixed; bottom: env(safe-area-inset-bottom, 20px); right: 20px; z-index: 50; margin-bottom: 15px;
  width: 48px; height: 48px; border-radius: 50%; background: var(--color-forest); color: var(--color-cream);
  display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: opacity 0.3s ease;
}
.music-toggle.hidden { opacity: 0; pointer-events: none; }
.music-toggle svg { width: 20px; height: 20px; }

:root { color-scheme: light; }

@media (min-width: 640px) {
  :root { --max-width: 480px; }

  html, body { min-height: 100vh; }

  body {
    display: flex;
    /* Ubah dari center menjadi flex-start agar rendering dimulai dari atas */
    align-items: flex-start; 
    justify-content: center;
    
    /* Biarkan properti background dan padding tetap ada */
    background:
      radial-gradient(ellipse at top, rgba(179, 154, 110, 0.25) 0%, transparent 60%),
      radial-gradient(ellipse at bottom, rgba(47, 59, 44, 0.4) 0%, transparent 60%),
      var(--color-forest-soft);
    padding: 40px 0;
  }

  .invitation-wrapper {
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45), 0 0 0 8px rgba(255, 255, 255, 0.06);
  }

  #cover {
    /* keep the gate itself inside the same rounded frame on desktop */
    left: 50%;
    right: auto;
    width: var(--max-width);
    transform: translateX(-50%);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  }

  .music-toggle { right: calc(50% - var(--max-width) / 2 + 20px); }
}
