/* =========================================
   1. SETUP & VARIABLES
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400&family=Great+Vibes&family=Lato:wght@300;400;700&display=swap');

:root {
    --smooth-ease: cubic-bezier(0.19, 1, 0.22, 1);
    --gold: #D4AF37;
    --gold-dim: rgba(197, 160, 89, 0.4);
    --silver: #C0C0C0;
    --dark-bg: #0f172a;
    --outer-bg: #050505;
    --text-lite: #f1f1f1;
    --glow: rgba(212, 175, 55, 0.5);
    --font-main: 'Lato', sans-serif;
    --font-title: 'Playfair Display', serif;
    --font-script: 'Great Vibes', cursive;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

/* =========================================
   2. MOBILE LAYOUT (FRAME HP)
   ========================================= */
body {
    font-family: var(--font-main);
    background-color: var(--outer-bg);
    color: var(--text-lite);
    line-height: 1.6;
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

.mobile-layout {
    width: 100%;
    max-width: 480px; /* Kunci lebar HP */
    background-color: var(--dark-bg);
    position: relative;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
    overflow-x: hidden;
    min-height: 100vh;
}

body.no-scroll { overflow: hidden; height: 100vh; }

/* Typography */
h1, h2, h3 { font-family: var(--font-title); }
.cursive { font-family: var(--font-script); }
a { text-decoration: none; transition: 0.3s; }

/* =========================================
   FIX SPACING (KOMPRES JARAK ANTAR SECTION)
   ========================================= */

/* 1. Kurangi Padding Atas-Bawah semua Section */
section {
    /* Sebelumnya 80px, kita pangkas jadi 40px */
    padding: 40px 20px !important;
}

/* 2. Kecualikan Hero Section (Top) agar tetap Full Screen */
#top {
    padding: 0 !important;
    height: 100vh;
}

/* 3. Kecualikan Footer agar tidak ketutup Navigasi */
footer {
    padding-top: 40px !important;
    padding-bottom: 150px !important; /* Jarak aman untuk Navigasi Bawah */
}

/* 4. Kurangi Jarak Judul Section (misal: "Mempelai", "Events") ke Konten */
section h2.reveal-bottom {
    margin-bottom: 25px !important; /* Sebelumnya 50px */
}

/* 5. Khusus Section Mempelai (Jarak Pria - Simbol & - Wanita) */
#mempelai .reveal-scale {
    margin: 15px 0 !important; /* Jarak simbol "&" diperkecil */
}

#mempelai .reveal-left,
#mempelai .reveal-right {
    margin-bottom: 20px;
}

/* 6. Khusus Section Event (Jarak antar Kartu) */
#event .reveal-left {
    margin-bottom: 15px !important; /* Jarak Akad ke Resepsi dirapatkan */
}

/* 7. Khusus Section Gallery & Gift (Jarak Teks Deskripsi) */
#gift p.reveal-bottom,
#rsvp p.reveal-bottom {
    margin-bottom: 25px !important; /* Jarak teks deskripsi ke kartu diperkecil */
}

/* =========================================
   3. CINEMATIC COVER
   ========================================= */
#cover {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: 100%;

    /* Fallback color & Image */
    background-color: var(--dark-bg);
    background-image: linear-gradient(to bottom, rgba(15, 23, 42, 0.6), rgba(15, 23, 42, 0.95)),
                      url('/img/basic-img/silverclass/aura-silver/bg-hero.jpg');
    background-size: cover;
    background-position: center;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 20px;
    text-align: center;

    transition: opacity 1.5s ease-in-out, transform 1.5s ease-in-out, visibility 1.5s;
    will-change: opacity, transform;
}

#cover.hide {
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) scale(1.15);
    pointer-events: none;
    filter: blur(10px);
}

#cover.hide > * { transform: translateY(-40px); opacity: 0; transition: all 0.8s ease; }

.btn-open {
    padding: 14px 40px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--gold);
    border: 1px solid var(--gold);
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 35px;
    transition: all 0.5s var(--smooth-ease);
    animation: glowPulse 3s infinite;
}
.btn-open:hover { background: var(--gold); color: var(--dark-bg); transform: scale(1.05); }

/* =========================================
   4. ANIMATIONS & SECTIONS
   ========================================= */
.reveal { opacity: 0; transform: translateY(60px); transition: all 1.4s var(--smooth-ease); will-change: transform, opacity; }
.reveal-left { transform: translateX(-60px); }
.reveal-right { transform: translateX(60px); }
.reveal.active { opacity: 1; transform: translate(0, 0); }
@media (max-width: 480px) { .reveal-left, .reveal-right { transform: translateY(50px); } }

/* Hero Section */
#top {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, #1e293b 0%, #0f172a 100%);
    text-align: center;
}

/* Timer */
.timer-grid { display: flex; gap: 15px; justify-content: center; margin-top: 30px; }
.timer-item { background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(212, 175, 55, 0.2); padding: 10px; border-radius: 8px; min-width: 65px; }
.timer-item span { display: block; font-size: 1.3rem; font-weight: bold; color: var(--gold); }
.timer-item small { font-size: 0.6rem; opacity: 0.7; text-transform: uppercase; }

/* Photo & Masonry */
.photo-stellar { width: 150px; height: 150px; border-radius: 50%; overflow: hidden; margin: 0 auto 20px; border: 3px solid var(--gold); }
.photo-stellar img { width: 100%; height: 100%; object-fit: cover; transition: 5s; }
.photo-stellar:hover img { transform: scale(1.1); }

.masonry-grid { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.masonry-item { width: 48%; border-radius: 8px; overflow: hidden; }
.masonry-item img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Form & Gift */
.gift-box, .rsvp-form { background: rgba(255,255,255,0.03); padding: 25px; border-radius: 12px; border: 1px solid var(--gold-dim); margin: 0 auto 20px; max-width: 90%; }
.rsvp-form input, .rsvp-form select, .rsvp-form textarea { width: 100%; padding: 10px; margin-bottom: 15px; background: rgba(0,0,0,0.3); border: 1px solid #444; color: white; border-radius: 5px; }
.btn-submit { width: 100%; padding: 12px; background: var(--gold); color: var(--dark-bg); border: none; border-radius: 5px; font-weight: bold; cursor: pointer; }

/* Footer */
footer { background: var(--outer-bg); padding: 50px 20px 150px; text-align: center; } /* Padding bawah besar */

/* =========================================
   5. FIXED CONTROLS (NAV & MUSIC)
   ========================================= */
.music-control, .stellar-nav {
    transform: translateY(150%);
    opacity: 0;
    transition: transform 1s var(--smooth-ease), opacity 1s ease;
}

/* --- Music Button --- */
.music-control {
    position: fixed; bottom: 115px; left: 20px; z-index: 10001;
    visibility: hidden;
}
.music-control.controls-visible { transform: translateY(0); opacity: 1; visibility: visible; }

.music-btn {
    width: 45px; height: 45px; border-radius: 50%;
    background: rgba(15, 23, 42, 0.9); border: 1px solid var(--gold); color: var(--gold);
    display: flex; justify-content: center; align-items: center;
    cursor: pointer; box-shadow: 0 0 10px rgba(0,0,0,0.5);
    animation: spin 4s linear infinite paused;
}
.music-btn.playing { animation-play-state: running; box-shadow: 0 0 15px var(--glow); background: #0f172a; }

/* --- Navbar --- */
.stellar-nav {
    position: fixed; bottom: 30px; left: 50%;
    transform: translateX(-50%) translateY(150%);
    width: 90%; max-width: 400px;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(212, 175, 55, 0.5); border-radius: 50px;
    padding: 12px 25px;
    display: flex; justify-content: space-between; align-items: center;
    z-index: 10000;
}
.stellar-nav.controls-visible { transform: translateX(-50%) translateY(0); opacity: 1; }

.stellar-nav-item { color: var(--silver); display: flex; flex-direction: column; align-items: center; font-size: 0.7rem; opacity: 0.6; }
.stellar-nav-item i { font-size: 1.2rem; margin-bottom: 3px; }
.stellar-nav-item:hover { opacity: 1; color: var(--gold); transform: translateY(-3px); }

/* Desktop Adjustment for Music Button */
@media (min-width: 481px) {
    .music-control { left: 50%; margin-left: -220px; transform: translateY(100px); }
    .music-control.controls-visible { transform: translateY(0); }
}

/* Animations */
@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes glowPulse { 0%, 100% { box-shadow: 0 0 5px var(--glow); } 50% { box-shadow: 0 0 20px var(--gold); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes widthGrow { from { width: 0; } to { width: 50px; } }
