* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f0f8ff; /* Alice Blue (Biru sangat muda) */
    color: #334e68;
    overflow-x: hidden;
}

button {
    font-family: inherit;
}

h1, h2, h3 {
    font-family: 'Playfair Display', serif;
    color: #0077b6; /* Biru laut cerah */
}

/* --- KUNCI SCROLL --- */
body.locked {
    overflow: hidden !important;
}

body.content-locked main {
    display: none;
}

body.content-locked .music-toggle {
    opacity: 0.45;
}

/* --- HERO SECTION (FULL SCREEN) --- */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 34px;
    background: linear-gradient(to bottom, #87ceeb, #f0f8ff);
    padding: 38px 20px;
    position: relative;
    z-index: 100;
    text-align: center;
}

/* --- BENTUK AMPLOP --- */
.envelope-wrapper {
    position: relative;
    cursor: pointer; /* Kursor berubah jadi jari saat diarahkan */
    text-align: center;
}

.music-toggle {
    position: fixed;
    right: 18px;
    top: 18px;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 50%;
    background: #ffffff;
    color: #0077b6;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(0,119,182,0.18);
    z-index: 200;
    transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease;
}

.music-toggle:hover,
.music-toggle.is-playing {
    transform: translateY(-2px);
    background: #0077b6;
    color: #ffffff;
}

.gate-countdown {
    width: min(100%, 760px);
    padding: 28px;
    border: 1px solid rgba(255,255,255,0.75);
    border-radius: 24px;
    background: rgba(255,255,255,0.58);
    box-shadow: 0 18px 45px rgba(0,119,182,0.14);
    backdrop-filter: blur(14px);
}

.gate-countdown h2 {
    font-size: clamp(1.8rem, 5vw, 3rem);
    margin-bottom: 22px;
}

.envelope-wrapper.is-waiting {
    cursor: not-allowed;
    filter: grayscale(0.25);
}

.envelope-wrapper.is-waiting .envelope {
    opacity: 0.68;
    transform: scale(0.96);
}

.envelope {
    position: relative;
    width: 300px;
    height: 200px;
    background-color: #7bc0e3; /* Warna dasar amplop biru */
    border-radius: 0 0 10px 10px;
    margin: 0 auto;
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
}

/* Bagian Kantong Depan Amplop */
.pocket {
    position: absolute;
    bottom: 0;
    width: 0;
    height: 0;
    /* Teknik membuat segitiga di CSS */
    border-left: 150px solid #9cd2f0;
    border-right: 150px solid #9cd2f0;
    border-bottom: 100px solid #63b4e0;
    border-top: 100px solid transparent;
    border-radius: 0 0 10px 10px;
    z-index: 3;
}

/* Tutup Amplop Atas (Flap) */
.flap {
    position: absolute;
    top: 0;
    width: 0;
    height: 0;
    border-left: 150px solid transparent;
    border-right: 150px solid transparent;
    border-top: 100px solid #5aa9d4;
    transform-origin: top; /* Titik putar di atas */
    transition: transform 0.6s ease-in-out, z-index 0.2s;
    z-index: 4;
}

/* Kertas Surat di Dalam */
.letter {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 260px;
    height: 180px;
    background: white;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.8s ease-in-out;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.letter h1 {
    font-size: 1.5rem;
    color: #0077b6;
    margin-bottom: 10px;
}

.letter p {
    font-size: 0.8rem;
    color: #475569;
}

/* Teks Kedip-Kedip di bawah amplop */
.click-instruction {
    margin-top: 30px;
    color: #023e8a;
    font-weight: bold;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* --- ANIMASI KETIKA AMPLOP DIKLIK --- */
.envelope-wrapper.is-opened .flap {
    transform: rotateX(180deg); /* Tutup amplop terbuka ke atas */
    z-index: 1; /* Pindah ke belakang surat */
}

.envelope-wrapper.is-opened .letter {
    transform: translate(-50%, -100px); /* Surat naik ke atas secara estetik */
    z-index: 5; /* Pindah ke paling depan */
}

.envelope-wrapper.is-opened .click-instruction {
    opacity: 0; /* Teks panduan hilang */
}

.section-kicker {
    color: #0284c7;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.soft-button {
    margin-top: 34px;
    padding: 12px 26px;
    border: 0;
    border-radius: 30px;
    background: #0077b6;
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(0,119,182,0.2);
    transition: transform 0.25s ease, background 0.25s ease;
}

.soft-button:hover {
    background: #023e8a;
    transform: translateY(-3px);
}

/* COUNTDOWN */
.countdown-section {
    padding: 85px 20px;
    text-align: center;
    background: linear-gradient(180deg, #f0f8ff, #ffffff);
}

.countdown-section h2 {
    font-size: 2.4rem;
    margin-bottom: 30px;
}

.countdown-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(110px, 1fr));
    gap: 18px;
    max-width: 720px;
    margin: 0 auto;
}

.countdown-card {
    min-height: 120px;
    padding: 24px 14px;
    background: #ffffff;
    border: 1px solid #d7efff;
    border-radius: 20px;
    box-shadow: 0 16px 34px rgba(0,119,182,0.1);
}

.countdown-card strong {
    display: block;
    color: #023e8a;
    font-size: 2.4rem;
    line-height: 1;
}

.countdown-card span {
    display: block;
    margin-top: 12px;
    color: #5c677d;
    font-weight: 600;
}

.countdown-message {
    margin-top: 22px;
    color: #475569;
    font-weight: 600;
}

/* Gallery Section */
.gallery-section {
    padding: 60px 20px;
    text-align: center;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    max-width: 1000px;
    margin: 30px auto;
}

.photo-card {
    background: white;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transform: rotate(-2deg); /* Efek estetik miring */
}

.photo-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 5px;
}

/* --- GANTI BAGIAN TIMELINE DI CSS KAMU DENGAN INI --- */

.timeline-section {
    padding: 80px 20px;
    background: white;
    text-align: center;
    overflow: hidden; /* Mencegah ayunan keluar layar */
}

.timeline-section h2 {
    margin-bottom: 50px;
}

/* Tali Gantungan */
.clothesline-container {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding-top: 20px;
}

.clothesline {
    position: absolute;
    top: 25px;
    left: -50vw;
    right: -50vw;
    height: 3px;
    background-color: #b0c4de; /* Warna tali agak keabu-abuan */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 1;
}

/* Layout Polaroid */
.polaroid-wrapper {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 40px;
    position: relative;
    z-index: 2;
}

.polaroid-item {
    position: relative;
}

/* Gaya Polaroid Ala Instax */
.polaroid {
    border: 1px solid #f0f0f0;
    background: white;
    padding: 15px 15px 35px 15px; /* Bawah lebih lebar */
    border-radius: 2px;
    box-shadow: 0 15px 25px rgba(0,0,0,0.15);
    width: 280px;
    text-align: center;
    transform-origin: top center; /* Titik tumpu ayunan di bagian atas */
    cursor: pointer;
    appearance: none;
}

.polaroid img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 2px;
    border: 1px solid #eee;
}

.polaroid .caption {
    margin-top: 15px;
}

.polaroid .caption h3 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: #0077b6;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
}

.polaroid .caption p {
    font-size: 0.85rem;
    color: #5c677d;
    font-style: italic; /* Font miring agar estetik */
}

.polaroid.missing-photo::before {
    content: "Tambahkan foto di folder";
    display: grid;
    place-items: center;
    width: 100%;
    height: 250px;
    border: 1px dashed #87ceeb;
    border-radius: 2px;
    background: linear-gradient(135deg, #e0f2fe, #ffffff);
    color: #0077b6;
    font-weight: 700;
}

/* Penjepit Kayu */
.pin {
    width: 12px;
    height: 30px;
    background-color: #e6ccb2; /* Warna kayu */
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 3px;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
    z-index: 3;
}

.pin::before { /* Lubang paku/penjepit */
    content: '';
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: #8b5a2b;
    border-radius: 50%;
}

/* --- ANIMASI AYUNAN (SWING) --- */
@keyframes swing {
    0% { transform: rotate(3deg); }
    50% { transform: rotate(-3deg); }
    100% { transform: rotate(3deg); }
}

@keyframes swing-reverse {
    0% { transform: rotate(-3deg); }
    50% { transform: rotate(3deg); }
    100% { transform: rotate(-3deg); }
}

.swinging {
    animation: swing 4s ease-in-out infinite;
}

.swinging-reverse {
    animation: swing-reverse 5s ease-in-out infinite;
}

/* --- CURHAT SECTION (PESAN UNTUKMU) --- */
.curhat-section {
    padding: 80px 20px;
    text-align: center;
    background-color: #e0f2fe; /* Biru muda yang lebih soft */
    border-top: 2px dashed #bae6fd;
}

.curhat-section h2 {
    font-size: 2.2rem;
    margin-bottom: 10px;
    color: #0077b6;
}

.curhat-section p {
    color: #475569;
    margin-bottom: 30px;
    font-style: italic;
}

.curhat-box {
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* Kolom Teks Estetik */
textarea {
    width: 100%;
    padding: 20px;
    border-radius: 15px;
    border: 2px solid #bae6fd;
    background: #ffffff;
    box-shadow: 0 10px 25px rgba(0, 119, 182, 0.05);
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    color: #334e68;
    resize: none;
    outline: none;
    transition: border-color 0.3s ease;
}

textarea:focus {
    border-color: #0077b6; /* Efek menyala saat diklik */
}

/* Tombol Kirim Pesan */
.curhat-box button {
    padding: 12px 40px;
    background-color: #0077b6;
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    box-shadow: 0 5px 15px rgba(0, 119, 182, 0.3);
    transition: all 0.3s ease;
}

.curhat-box button:hover {
    background-color: #023e8a;
    transform: translateY(-3px); /* Efek tombol terangkat */
    box-shadow: 0 8px 20px rgba(0, 119, 182, 0.4);
}

/* --- DETAILED TIMELINE SECTION --- */
.detailed-timeline {
    padding: 80px 20px;
    background-color: #f0f8ff; /* Nyambung sama warna body */
    text-align: center;
}

.detailed-timeline h2 {
    font-size: 2.2rem;
    margin-bottom: 60px;
    color: #0077b6;
}

.timeline-container {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    text-align: left;
}

/* Garis vertikal di tengah */
.timeline-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 100%;
    background-color: #87ceeb; /* Biru awan */
    border-radius: 5px;
}

.timeline-block {
    position: relative;
    margin-bottom: 50px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Membuat kotak berselang-seling (kiri - kanan) */
.timeline-block:nth-child(even) {
    flex-direction: row-reverse;
}

/* Titik di tengah garis */
.timeline-dot {
    position: absolute;
    left: 50%;
    transform: translate(-50%, 0);
    width: 22px;
    height: 22px;
    background-color: #ffffff;
    border: 5px solid #0077b6;
    border-radius: 50%;
    z-index: 2;
    box-shadow: 0 0 10px rgba(0, 119, 182, 0.4);
}

/* Kotak Cerita */
.timeline-content {
    width: 45%;
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.06);
    position: relative;
    border-top: 5px solid #0077b6;
}

/* Panah kecil untuk kotak sebelah kiri */
.timeline-block:nth-child(odd) .timeline-content::before {
    content: '';
    position: absolute;
    top: 20px;
    right: -12px;
    border-width: 12px 0 12px 12px;
    border-style: solid;
    border-color: transparent transparent transparent white;
}

/* Panah kecil untuk kotak sebelah kanan */
.timeline-block:nth-child(even) .timeline-content::before {
    content: '';
    position: absolute;
    top: 20px;
    left: -12px;
    border-width: 12px 12px 12px 0;
    border-style: solid;
    border-color: transparent white transparent transparent;
}

.timeline-content h3 {
    font-size: 1.3rem;
    color: #023e8a;
    margin-bottom: 8px;
    font-family: 'Playfair Display', serif;
}

.timeline-content p {
    font-size: 0.95rem;
    color: #475569;
    line-height: 1.6;
}

.timeline-date {
    display: inline-block;
    margin-top: 15px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #87ceeb;
    background: #f0f8ff;
    padding: 5px 12px;
    border-radius: 20px;
}

/* LITTLE THINGS */
.little-things {
    padding: 80px 20px;
    text-align: center;
    background: #ffffff;
}

.little-things h2 {
    font-size: 2.3rem;
    margin-bottom: 32px;
}

.memory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    max-width: 950px;
    margin: 0 auto;
}

.memory-card {
    min-height: 150px;
    padding: 24px;
    border-radius: 20px;
    background: linear-gradient(180deg, #ffffff, #eef8ff);
    border: 1px solid #d7efff;
    box-shadow: 0 12px 30px rgba(0,119,182,0.08);
    text-align: left;
}

.memory-card span {
    display: block;
    color: #0284c7;
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.memory-card strong {
    display: block;
    color: #334e68;
    line-height: 1.55;
}

.last-message {
    width: 100%;
    margin-top: 0 !important;
    padding: 14px 18px;
    border-radius: 16px;
    background: rgba(255,255,255,0.75);
    color: #023e8a !important;
    font-style: normal !important;
    line-height: 1.5;
}

/* MODAL */
.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(2, 62, 138, 0.46);
    backdrop-filter: blur(7px);
    z-index: 300;
}

.modal.is-open {
    display: flex;
}

.modal-content {
    position: relative;
    width: min(92vw, 720px);
    max-height: 88vh;
    overflow: auto;
    background: #ffffff;
    border-radius: 22px;
    box-shadow: 0 24px 70px rgba(2,62,138,0.28);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: #ffffff;
    color: #023e8a;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    z-index: 2;
}

.photo-modal {
    padding: 18px 18px 26px;
    text-align: center;
}

.photo-modal img {
    width: 100%;
    max-height: 58vh;
    object-fit: contain;
    border-radius: 16px;
    background: #e0f2fe;
}

.photo-modal h3 {
    margin-top: 18px;
    font-size: 1.8rem;
}

.photo-modal p {
    margin-top: 8px;
    color: #475569;
    line-height: 1.7;
}

.photo-modal.missing-photo-large::before {
    content: "Foto belum ada. Simpan file sesuai nama yang dipakai di HTML.";
    display: grid;
    place-items: center;
    min-height: 260px;
    border-radius: 16px;
    background: linear-gradient(135deg, #e0f2fe, #ffffff);
    color: #0077b6;
    font-weight: 700;
    padding: 20px;
}

.long-letter {
    padding: 42px;
}

.long-letter h2 {
    margin-bottom: 18px;
    font-size: 2rem;
}

.long-letter p {
    color: #475569;
    line-height: 1.9;
    margin-top: 14px;
}

/* ========================================================
   RESPONSIVE DESIGN (UNTUK SEMUA UKURAN HP & TABLET)
   ======================================================== */
@media screen and (max-width: 768px) {
    
    /* 1. Hero Section (Sambutan) */
    .hero h1 {
        font-size: 2.2rem; /* Font dikecilin biar gak nabrak pinggir layar HP */
        padding: 0 15px;
    }
    .hero p {
        font-size: 0.95rem;
        padding: 0 20px;
    }

    .hero {
        gap: 26px;
        padding: 28px 14px;
    }

    .gate-countdown {
        padding: 22px 14px;
    }

    /* 2. Timeline Polaroid Gantung */
    .polaroid-wrapper {
        gap: 30px; 
        flex-direction: column; /* Bikin polaroidnya berjejer ke bawah, bukan ke samping */
        align-items: center;
    }
    .polaroid {
        width: 85%; /* Menyesuaikan lebar HP */
        max-width: 260px;
    }
    .clothesline {
        top: 20px; /* Nyesuain letak tali di HP */
    }

    /* 3. Detailed Timeline (Jejak Langkah) */
    .timeline-container::before {
        left: 20px; /* Garis vertikal pindah ke kiri */
    }
    .timeline-dot {
        left: 20px; /* Titik pindah ke kiri */
        width: 18px;
        height: 18px;
    }
    .timeline-block {
        margin-bottom: 40px;
    }
    .timeline-block, .timeline-block:nth-child(even) {
        flex-direction: column !important;
        align-items: flex-end; /* Semua kotak didorong ke kanan garis */
    }
    .timeline-content {
        width: calc(100% - 60px); /* Lebar kotak dimaksimalkan untuk HP */
        padding: 20px;
    }
    /* Mindahin semua panah kotak cerita ke sisi kiri */
    .timeline-block:nth-child(odd) .timeline-content::before,
    .timeline-block:nth-child(even) .timeline-content::before {
        left: -12px;
        right: auto;
        border-width: 10px 10px 10px 0;
        border-color: transparent white transparent transparent;
    }

    /* 4. Curhat Section (Pesan Untukmu) */
    .curhat-section h2 {
        font-size: 1.8rem;
    }
    .curhat-box {
        width: 100%;
        padding: 0 10px;
    }
    textarea {
        padding: 15px;
        font-size: 0.95rem;
    }

    .music-toggle {
        right: 14px;
        top: 14px;
        width: 42px;
        height: 42px;
    }

    .countdown-grid {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
        gap: 12px;
    }

    .countdown-card {
        min-height: 105px;
        padding: 20px 12px;
    }

    .countdown-card strong {
        font-size: 2rem;
    }

    .little-things h2,
    .countdown-section h2 {
        font-size: 1.9rem;
    }

    .long-letter {
        padding: 34px 22px;
    }
}

/* SKY BACKGROUND */
.sky-bg{
    position:fixed;
    top:0;
    left:0;
    width:100%;
    height:100%;
    z-index:-1;
    overflow:hidden;
}

.cloud{
    position:absolute;
    width:180px;
    height:60px;
    background:rgba(255,255,255,0.7);
    border-radius:50px;
    filter: blur(2px);
}

.cloud::before,
.cloud::after{
    content:'';
    position:absolute;
    background:inherit;
    border-radius:50%;
}

.cloud::before{
    width:70px;
    height:70px;
    top:-30px;
    left:20px;
}

.cloud::after{
    width:90px;
    height:90px;
    top:-40px;
    right:20px;
}

.c1{
    top:10%;
    left:-200px;
    animation:moveCloud 35s linear infinite;
}

.c2{
    top:30%;
    left:-250px;
    animation:moveCloud 45s linear infinite;
}

.c3{
    top:60%;
    left:-220px;
    animation:moveCloud 55s linear infinite;
}

@keyframes moveCloud{
    from{transform:translateX(0);}
    to{transform:translateX(140vw);}
}

/* HEARTS */
.heart{
    position:fixed;
    color:#4da6ff;
    font-size:20px;
    animation:floatUp 3s linear forwards;
    pointer-events:none;
}

@keyframes floatUp{
    from{
        opacity:1;
        transform:translateY(0) scale(1);
    }
    to{
        opacity:0;
        transform:translateY(-200px) scale(1.8);
    }
}

/* LOVE REASONS */
.love-reasons{
    padding:80px 20px;
    text-align:center;
    background:rgba(255,255,255,0.5);
    backdrop-filter: blur(10px);
}

.reason-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
    gap:20px;
    max-width:900px;
    margin:auto;
    margin-top:40px;
}

.reason-card{
    background:white;
    padding:25px;
    border-radius:20px;
    box-shadow:0 10px 30px rgba(0,119,182,0.1);
    transition:.3s;
}

.reason-card:hover{
    transform:translateY(-10px) scale(1.03);
}
