<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Wedding Invitation</title>

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

body{
    font-family:Arial, sans-serif;
    background:linear-gradient(135deg,#0b1b33,#1e2f5c);
    display:flex;
    justify-content:center;
}

/* CENTERED MOBILE STYLE */
.wrapper{
    width:100%;
    max-width:430px;
    background:#000;
    min-height:100vh;
    overflow:hidden;
}

/* SLIDES */
.slide{
    width:100%;
    min-height:100vh;
    display:flex;
    justify-content:center;
    align-items:center;
}

/* SLIDE 1 VIDEO – SAFE METHOD */
.slide-1 video{
    width:100%;
    height:100vh;
    object-fit:cover;
    display:block;
}

/* SLIDE 2 */
.slide-2{
    background:url("assets/images/slide-bg.jpg") center/cover no-repeat;
    padding:30px 18px;
    text-align:center;
    font-family:'Cinzel', serif;
    color:#222;
}

.info-card{
    background:rgba(255,255,255,0.95);
    border-radius:22px;
    padding:28px 22px;
    max-width:420px;
}

/* TEXT */
.info-title{
    font-size:18px;
    font-weight:600;
    color:#a67c00;
    margin-bottom:6px;
}
.info-text{
    font-size:15px;
    margin-bottom:18px;
}

/* MUTE BUTTON */
.mute-btn{
    position:fixed;
    top:20px;
    right:20px;
    width:50px;
    height:50px;
    border-radius:50%;
    border:none;
    background:rgba(255,255,255,0.95);
    font-size:20px;
    cursor:pointer;
    z-index:50;
}

/* SWIPE OVERLAY */
.swipe-overlay{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,0.55);
    backdrop-filter:blur(4px);
    display:flex;
    justify-content:center;
    align-items:center;
    z-index:100;
}

.swipe-box{
    text-align:center;
    color:#fff;
}

.swipe-icon{
    font-size:48px;
    animation:swipeUp 1.6s infinite;
    margin-bottom:14px;
}

@keyframes swipeUp{
    0%{transform:translateY(0);opacity:.5}
    50%{transform:translateY(-16px);opacity:1}
    100%{transform:translateY(0);opacity:.5}
}

.swipe-btn{
    background:#7c3aed;
    border:none;
    color:#fff;
    padding:10px 26px;
    border-radius:30px;
    font-size:14px;
    cursor:pointer;
}

/* DESKTOP BEAUTY */
@media(min-width:768px){
    .wrapper{
        margin:40px 0;
        border-radius:24px;
        box-shadow:0 0 80px rgba(0,0,0,.7);
    }
}
</style>
</head>

<body>

<div class="wrapper">

<!-- SWIPE OVERLAY -->
<div class="swipe-overlay" id="swipeOverlay">
    <div class="swipe-box">
        <div class="swipe-icon">☝️⬆️</div>
        <div>Swipe Up For More Content</div><br>
        <button class="swipe-btn" onclick="hideSwipe()">OKAY</button>
    </div>
</div>

<!-- SLIDE 1 (VIDEO WORKS HERE) -->
<section class="slide slide-1">
    <video autoplay muted playsinline loop>
        <source src="assets/video/invite.mp4" type="video/mp4">
    </video>
</section>

<!-- SLIDE 2 -->
<section class="slide slide-2">
    <div class="info-card">
        <div class="info-title">Date</div>
        <div class="info-text">Saturday, 14 March 2026</div>

        <div class="info-title">Time</div>
        <div class="info-text">7:30 PM – 11:00 PM</div>

        <div class="info-title">Venue</div>
        <div class="info-text">
            Bukit Kemuning Convention Centre (BKCC)<br>
            Shah Alam, Selangor
        </div>
    </div>
</section>

</div>

<!-- YOUTUBE PLAYER (AUDIO ONLY) -->
<div id="ytPlayer" style="position:absolute;width:1px;height:1px;opacity:0;"></div>

<button class="mute-btn" id="muteBtn" onclick="toggleSound()">🔊</button>

<script>
/* Swipe overlay */
function hideSwipe(){
    document.getElementById("swipeOverlay").style.display="none";
}
window.addEventListener("scroll",()=>{
    if(window.scrollY > 30) hideSwipe();
});

/* YouTube audio */
let player, muted=false;

function onYouTubeIframeAPIReady(){
    player=new YT.Player('ytPlayer',{
        videoId:'La-k_umFtrA',
        playerVars:{autoplay:1,controls:0,rel:0,start:30},
        events:{onReady:e=>{
            e.target.setVolume(80);
            e.target.playVideo();
            e.target.unMute();
        }}
    });
}

function toggleSound(){
    if(!player) return;
    muted ? (player.unMute(),muteBtn.textContent="🔊")
          : (player.mute(),muteBtn.textContent="🔇");
    muted=!muted;
}

let tag=document.createElement("script");
tag.src="https://www.youtube.com/iframe_api";
document.body.appendChild(tag);
</script>

</body>
</html>