/* Welcome Overlay */
.welcome-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0; /* Fit di SEMUA ukuran (iOS & Android) */
    width: 100%;
    height: 100%;
    background-color: #0a0e1a;
    background-image: linear-gradient(rgba(10, 14, 26, 0.5), rgba(30, 40, 80, 0.3)), url('welcome-bg.png');
    background-size: cover;
    background-position: center center;
    /* background-attachment: fixed dihapus karena rusak di banyak browser Safari iOS */
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: flex-end; 
    padding-bottom: 40px; /* Jarak fix untuk batas bawah yang aman */
    transition: opacity 1.2s ease-in-out, visibility 1.2s ease-in-out;
}

.welcome-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.welcome-content {
    text-align: center;
    animation: floatingItems 4s ease-in-out infinite;
    background: rgba(10, 14, 26, 0.65);
    padding: 1.2rem 2.5rem; 
    border-radius: 12px;
    width: auto;
    max-width: 90%; /* Menghindari pecah di HP jadul/kecil */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px); /* Safari support */
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5), inset 0 0 10px rgba(123, 170, 247, 0.1);
    border: 1px solid rgba(123, 170, 247, 0.3);
}

.welcome-title {
    font-size: 2.2rem !important;
    color: #a8c8ff !important;
    margin-bottom: 5px !important;
}

.welcome-desc {
    color: #e8edf5;
    letter-spacing: 1px;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 0.85rem;
    font-weight: 300;
}

.open-btn {
    font-family: 'Outfit', sans-serif;
    background: rgba(123, 170, 247, 0.1);
    border: 1px solid rgba(123, 170, 247, 0.5);
    color: #a8c8ff;
    padding: 10px 30px; /* Ukuran tombol layaknya tombol biasa */
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 1px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.4s ease;
    box-shadow: 0 0 20px rgba(123, 170, 247, 0.2);
}

.open-btn:hover {
    background: rgba(123, 170, 247, 0.8);
    color: #0a0e1a;
    box-shadow: 0 0 30px rgba(123, 170, 247, 0.6);
    transform: scale(1.05);
}

@keyframes floatingItems {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

:root {
    --text-main: #2c3a5e;
    --text-muted: #4a5b80;
    --accent: #7baaf7;
    --accent-glow: rgba(123, 170, 247, 0.4);
    --gold: #c9b67e;
    --gold-glow: rgba(201, 182, 126, 0.4);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    padding: 0;
    background-image: url('bg.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-color: #0a0e1a;
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* Overlay gradient on top of bg image */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, rgba(10, 14, 30, 0.5) 0%, rgba(30, 40, 80, 0.3) 40%, rgba(100, 140, 220, 0.15) 100%);
    z-index: 0;
    pointer-events: none;
}

#particles-js {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: 0;
    pointer-events: none;
}

/* Xavier decorative image */
.xavier-decor {
    position: fixed;
    bottom: 0;
    left: -80px; /* Digeser mendalam lebih ke kiri */
    width: 380px;
    z-index: 1; /* Pastikan dia murni dekorasi latar di Desktop */
    pointer-events: none;
    opacity: 0.6;
    filter: drop-shadow(0 0 30px rgba(123, 170, 247, 0.3));
    animation: xavierFloat 6s ease-in-out infinite;
}

.xavier-decor img {
    width: 100%;
    height: auto;
    display: block;
}

@keyframes xavierFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.viewport-wrapper {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
}

/* Glassmorphism Card with Xavier-inspired tones */
.glass-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    max-width: 1050px;
    width: 100%;
    padding: 3rem;
    background: rgba(15, 20, 40, 0.55);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(123, 170, 247, 0.2);
    border-radius: 20px;
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.3),
        inset 0 0 30px rgba(123, 170, 247, 0.05);
}

.left-col {
    flex: 1 1 300px;
    display: flex;
    justify-content: center;
}

.right-col {
    flex: 2 1 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: left;
}

/* Typography */
.heading {
    font-family: 'Playfair Display', serif;
    font-weight: 500;
    margin: 0;
}

.text-main { color: #e8edf5; }
.accent { color: var(--accent); text-shadow: 0 0 15px var(--accent-glow); }

.right-col h1 { font-size: 2.8rem; margin-bottom: 0.2rem; text-shadow: 0 0 20px rgba(255,255,255,0.15); }
.right-col .body-text { font-size: 1.15rem; line-height: 1.4; margin-bottom: 0.5rem; color: #b0bdd4; }
.subtitle { font-family: 'Outfit', sans-serif; font-size: 0.9rem; letter-spacing: 2px; text-transform: uppercase; font-weight: 500; margin-top: 0.5rem; }

.divider {
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), var(--gold));
    border: none;
    border-radius: 5px;
    margin: 1.2rem 0;
    margin-left: 0;
    box-shadow: 0 0 10px var(--accent-glow);
}

.wishes p { font-size: 1.05rem; line-height: 1.4; margin: 0.2rem 0; color: #9aabc8; }
.closing-text { font-size: 2.3rem; line-height: 1.2; margin: 1.5rem 0; text-shadow: 0 0 20px rgba(255,255,255,0.1); }

/* Struktur Khusus Mobile/Desktop Layout Foto */
.mobile-photo {
    display: none;
    margin: 2rem 0;
    justify-content: center;
}
.desktop-photo {
    display: flex;
}

.mobile-scroll-guide {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin: 1rem auto 0;
    color: var(--accent);
    font-size: 0.6rem; /* Dibuat super imut */
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 400;
    opacity: 0.5; /* Transparan agar tidak lebay */
}
.mobile-scroll-guide .arrow {
    font-size: 0.85rem; /* Panah dimini-kan */
    animation: bounceBounce 2s infinite;
}

@keyframes bounceBounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(8px); }
    60% { transform: translateY(4px); }
}

/* Photocard */
.photocard {
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 15px 25px 15px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    transform: rotate(-3deg);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    width: 100%;
    max-width: 320px;
}

.photocard:hover {
    transform: rotate(0deg) scale(1.03);
    box-shadow: 0 15px 35px rgba(123, 170, 247, 0.3);
}

.photocard img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    aspect-ratio: 4/5;
    object-fit: cover;
}

.photocard .caption {
    margin-top: 15px;
    text-align: center;
}

.photocard .caption p {
    font-size: 0.95rem;
    margin: 3px 0;
    line-height: 1.3;
    color: #2c3a5e;
}
.photocard .caption .disclaimer {
    font-size: 0.8rem;
    color: #7b8dab;
    margin-top: 8px;
}

.handwriting {
    font-family: 'Caveat', cursive;
    font-size: 2.2rem !important;
    color: var(--accent) !important;
    margin-bottom: 5px !important;
}

/* Animations */
.fade-in { opacity: 0; transform: translateY(20px); transition: opacity 1.2s ease-out, transform 1.2s ease-out; }
.fade-in.visible { opacity: 1; transform: translateY(0); }
.delay-1 { transition-delay: 0.2s; }
.delay-2 { transition-delay: 0.5s; }
.delay-3 { transition-delay: 0.8s; }
.delay-4 { transition-delay: 1.1s; }
.delay-5 { transition-delay: 1.4s; }
.delay-6 { transition-delay: 1.7s; }
.delay-7 { transition-delay: 2.0s; }

.star {
    position: fixed; 
    border-radius: 50%;
}
@keyframes burstExplode {
    0% { transform: translate(0, 0) scale(0); opacity: 1; }
    100% { transform: translate(var(--tx), var(--ty)) scale(1.5); opacity: 0; }
}

@keyframes floatUp {
    0% { transform: translateY(0) scale(1) rotate(0deg); opacity: 1; }
    100% { transform: translateY(-120vh) scale(1.5) rotate(20deg); opacity: 0; }
}

/* Responsive */
@media (max-width: 768px) {
    .viewport-wrapper {
        padding-bottom: 350px; /* Menyediakan kotak super lega bebas teks khusus untuk Xavier */
    }
    .glass-container {
        padding: 2.5rem 1.5rem;
        gap: 2rem;
        flex-direction: column;
        margin: 40px 0;
        max-width: 100%;
        box-sizing: border-box;
    }
    .right-col {
        text-align: center;
        align-items: center;
    }
    /* Sembunyikan foto sisi kiri, tampilkan foto penengah & Panduan */
    .desktop-photo { display: none !important; }
    .mobile-photo { display: flex !important; }
    .mobile-scroll-guide { display: flex !important; }

    .divider { margin: 1rem auto; }
    .photocard { max-width: 280px; transform: rotate(0deg); }
    
    .right-col h1 { font-size: 2.2rem; }
    .closing-text { font-size: 2rem; }
    .wishes p { font-size: 1rem; }

    .xavier-decor { 
        position: absolute !important; /* Xavier tidak lagi ngikutin layar menimpa teks */
        width: 320px; /* Ukuran dibesarkan */
        opacity: 0.9 !important; /* Opacity jauh lebih terang */
        bottom: 0px;
        left: 50% !important; /* Terletak pas di tengah */
        transform: translateX(-50%); /* Titik peletakan di tengah rata bawah */
        z-index: 10;
        animation: xavierMobileFloat 6s ease-in-out infinite;
    }
}

@keyframes xavierMobileFloat {
    0%, 100% { transform: translate(-50%, 0); }
    50% { transform: translate(-50%, -10px); }
}

@media (max-width: 480px) {
    .right-col h1 { font-size: 1.8rem; }
    .closing-text { font-size: 1.6rem !important; }
    .welcome-content { 
        padding: 1.2rem 1rem; 
        width: 92%; 
    }
    .welcome-title { font-size: 1.6rem !important; }
    .welcome-desc { font-size: 0.75rem; margin-bottom: 12px; }
    .open-btn { padding: 8px 20px; font-size: 0.85rem; }
    .xavier-decor { 
        position: absolute !important;
        width: 320px; 
        opacity: 0.9 !important; 
        bottom: 0px;
        left: 50% !important; /* Di HP juga taruh proporsional di tengah bawah */
        transform: translateX(-50%);
    }
}
