html, body {
    max-width: 100%;
    overflow-x: hidden !important; /* Memaksa agar tidak bisa scroll ke samping */
    position: relative;
}
:root {
    --primary-pink: #ff85a2;
    --soft-pink: #ffe5ec;
    --deep-pink: #fb6f92;
    --text-dark: #4a4a4a;
    --bg-cream: #fff5f6;
}

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

body { 
    font-family: 'Poppins', sans-serif; 
    background: var(--bg-cream); 
    color: var(--text-dark); 
    overflow-x: hidden; 
}

#overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg-cream); z-index: 9999;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    transition: 1s ease-in-out;
}

nav {
    position: fixed; top: 25px; left: 50%; transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.7); backdrop-filter: blur(15px);
    padding: 12px 35px; border-radius: 50px; display: flex; gap: 25px; z-index: 1000;
    box-shadow: 0 10px 30px rgba(251, 111, 146, 0.15); border: 1px solid rgba(255, 255, 255, 0.5);
}

nav a { text-decoration: none; color: var(--text-dark); font-weight: 500; font-size: 0.85rem; text-transform: uppercase; }

/* Sticky Music Player Widget */
#music-player {
    position: fixed; bottom: 20px; right: 20px;
    background: white; padding: 10px 20px; border-radius: 50px;
    display: flex; align-items: center; gap: 15px; z-index: 2000;
    box-shadow: 0 10px 25px rgba(251, 111, 146, 0.2);
    border: 1px solid var(--soft-pink);
    animation: fadeInUp 1s ease;
}

.music-info { display: flex; flex-direction: column; text-align: right; }
.song-title { font-size: 0.8rem; font-weight: 600; color: var(--deep-pink); max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status { font-size: 0.6rem; text-transform: uppercase; opacity: 0.6; }

#music-btn {
    width: 35px; height: 35px; border-radius: 50%; border: none;
    background: var(--deep-pink); color: white; cursor: pointer;
    display: flex; justify-content: center; align-items: center; transition: 0.3s;
}

section { min-height: 100vh; padding: 100px 10vw; display: flex; flex-direction: column; align-items: center; justify-content: center; }

#home { 
    background: linear-gradient(rgba(255,255,255,0.4), rgba(255,255,255,0.4)), url('https://images.unsplash.com/photo-1494972308255-028c889a2440?q=80&w=2070');
    background-size: cover; background-position: center; background-attachment: fixed;
}

.hero-title { font-family: 'Dancing Script', cursive; font-size: 4rem; color: var(--deep-pink); }
.dancing-font { font-family: 'Dancing Script', cursive; }
.pink-text { color: var(--deep-pink); font-size: 2.5rem; }

#story { background: var(--soft-pink); }
.timeline { border-left: 3px solid var(--primary-pink); padding-left: 40px; width: 100%; max-width: 700px; }
.timeline-content { background: white; padding: 20px; border-radius: 15px; margin-bottom: 30px; box-shadow: 5px 5px 0px var(--primary-pink); }

.message-card { background: white; padding: 50px; border-radius: 30px; box-shadow: 0 20px 40px rgba(0,0,0,0.05); }
.btn-main { padding: 15px 35px; background: var(--deep-pink); color: white; border: none; border-radius: 50px; cursor: pointer; font-weight: 600; transition: 0.3s; }
.btn-main:hover { transform: scale(1.05); background: var(--primary-pink); }

/* --- POLAROID GALLERY STYLES --- */

/* Update Grid Container */
.grid-container {
    columns: 3 220px; /* Sedikit diperkecil agar muat dengan frame */
    column-gap: 25px; /* Jarak antar kolom diperlebar untuk rotasi */
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

/* Frame Polaroid */
.polaroid-item {
    background: #ffffff;
    /* Padding khas polaroid: atas/kiri/kanan tipis, bawah tebal */
    padding: 12px 12px 40px 12px; 
    box-shadow: 3px 5px 15px rgba(0,0,0,0.15); /* Bayangan agar terlihat menempel */
    border-radius: 4px;
    margin-bottom: 35px; /* Jarak vertikal antar polaroid */
    break-inside: avoid; /* Mencegah polaroid terpotong antar kolom */
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    cursor: pointer;
}

/* Gambar di dalam Polaroid */
.polaroid-item img {
    width: 100%;
    height: auto;
    border-radius: 2px; /* Sedikit rounded di ujung gambar */
    filter: sepia(15%) contrast(110%); /* Efek filter sedikit vintage */
    display: block;
}

/* --- Efek "Ditempel Acak" di Dinding --- */

/* Miring ke kiri untuk item ganjil */
.polaroid-item:nth-child(odd) {
    transform: rotate(2.5deg);
}

/* Miring ke kanan untuk item genap */
.polaroid-item:nth-child(even) {
    transform: rotate(-3deg);
    margin-top: 15px; /* Sedikit offset agar tidak terlalu rata */
}

/* Item kelipatan 3 agak lurus */
.polaroid-item:nth-child(3n) {
    transform: rotate(0.5deg);
}

/* --- Efek Hover (Saat Kursor Diarahkan) --- */
.polaroid-item:hover {
    /* Saat di-hover, polaroid jadi lurus, membesar sedikit, dan bayangan makin jelas */
    transform: scale(1.05) rotate(0deg) !important; 
    box-shadow: 8px 15px 30px rgba(0,0,0,0.25);
    z-index: 10; /* Agar polaroid yang di-hover muncul di paling depan */
}

/* =========================================
   RESPONSIVE FIX (Agar Tidak Zoom Out di HP)
   ========================================= */

/* 1. Kunci Layar Utama */
html, body {
    width: 100%;
    overflow-x: hidden !important; /* Wajib! Potong apapun yang melebar */
    position: relative;
}

/* 2. Khusus Tampilan HP */
@media screen and (max-width: 768px) {
    
    /* Reset Section agar tidak melebar */
    section {
        padding: 60px 20px;
        width: 100%;
        overflow: hidden; /* Potong konten section yang bandel */
        box-sizing: border-box;
    }

    /* --- PERBAIKAN TIMELINE (STORY) --- */
    .timeline {
        width: 100%;
        max-width: 100%;
        margin-left: 10px; /* Geser dikit ke kanan biar dot gak kepotong */
        padding-right: 10px;
        box-sizing: border-box;
    }
    
    /* Mencegah titik timeline keluar layar */
    .timeline-item::before {
        left: -40px; 
    }

    /* --- PERBAIKAN POLAROID (GALLERY) --- */
    .grid-container {
        /* Ubah jadi 1 kolom lurus ke bawah */
        columns: 1 auto !important; 
        column-gap: 0;
        width: 100%;
        padding: 0 10px; /* Beri jarak aman kiri-kanan */
        box-sizing: border-box;
    }

    .polaroid-item {
        width: 100%; /* Pastikan lebar foto mengikuti layar */
        margin-bottom: 30px;
        
        /* MATIKAN EFEK MIRING (Penyebab utama zoom out) */
        transform: rotate(0deg) !important; 
        margin-top: 0 !important;
    }
    
    /* Reset efek ganjil/genap agar lurus semua */
    .polaroid-item:nth-child(odd),
    .polaroid-item:nth-child(even),
    .polaroid-item:nth-child(3n) {
        transform: rotate(0deg) !important;
    }

    /* --- PERBAIKAN LAINNYA --- */
    .hero-title {
        font-size: 3rem; /* Kecilkan judul */
        word-wrap: break-word; /* Pecah kata jika terlalu panjang */
    }

    /* Music Player & Navigasi */
    #music-player, nav {
        width: auto;
        max-width: 90%; /* Batasi lebar */
    }
}
