:root{
    --footer-color:#f7f4ee;
}

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

html{
    scroll-behavior:smooth;
}

body{
    overflow:hidden;
    background:#f7f4ee;
    font-family:'Montserrat',sans-serif;
}

/* =========================
   INTRO SOBRE 3D
========================= */

.intro{
    position:fixed;
    inset:0;
    background:
    radial-gradient(circle at top,#243a66 0%,#081120 70%);
    display:flex;
    justify-content:center;
    align-items:center;
    perspective:2200px;
    z-index:999;
    overflow:hidden;
    transition:1.5s ease;
}

/* PARTICULAS */

.intro::before{
    content:'';
    position:absolute;
    inset:0;

    background-image:
    radial-gradient(rgba(255,255,255,.15) 1px, transparent 1px);

    background-size:45px 45px;

    opacity:.18;

    animation:particles 18s linear infinite;
}

@keyframes particles{
    from{
        transform:translateY(0);
    }
    to{
        transform:translateY(-80px);
    }
}

/* WRAPPER */

.envelope-wrapper{
    width:420px;
    height:290px;
    position:relative;
    transform-style:preserve-3d;

    animation:float 4s ease-in-out infinite;
}

@keyframes float{

    0%,100%{
        transform:
        rotateX(8deg)
        rotateY(-8deg)
        translateY(0);
    }

    50%{
        transform:
        rotateX(10deg)
        rotateY(8deg)
        translateY(-12px);
    }

}

/* SOMBRA */

.shadow{
    position:absolute;
    width:320px;
    height:40px;
    background:rgba(0,0,0,.4);
    border-radius:50%;
    filter:blur(18px);

    bottom:-55px;
    left:50%;
    transform:translateX(-50%);
}

/* SOBRE */

.envelope{
    position:relative;
    width:100%;
    height:100%;
    cursor:pointer;
    transform-style:preserve-3d;
}

/* CARTA */

.letter{
    position:absolute;
    width:92%;
    height:88%;
    left:4%;
    top:6%;

    background:white;

    border-radius:18px;

    z-index:1;

    transition:1.8s cubic-bezier(.22,1,.36,1);

    overflow:hidden;

    box-shadow: 
    0 15px 35px rgba(0,0,0,.25);
}

/* CARTA DECORACION */

.letter::before{
    content:'';
    position:absolute;
    inset:0;

    background:
    linear-gradient(135deg,
    rgba(0,0,0,.03),
    transparent);
}

/* CONTENIDO CARTA */

.letter-content{
    padding:60px 35px;
    text-align:center;
}

.letter-content h1{
    font-family:'Cormorant Garamond',serif;
    font-size:42px;
    color:#243a66;
    margin-bottom:15px;
}

.letter-content p{
    color:#666;
    line-height:1.7;
}

/* SOBRE CUERPO */

.envelope-body{
    position:absolute;
    inset:0;

    border-radius:24px;

    overflow:hidden;

    background:
    linear-gradient(145deg,#223963,#12203d);

    box-shadow:
    inset 0 0 25px rgba(255,255,255,.05),
    inset 0 -15px 25px rgba(0,0,0,.35),
    0 30px 60px rgba(0,0,0,.4);

    z-index:3;
}

/* TEXTURA */

.envelope-body::before{
    content:'';
    position:absolute;
    inset:0;

    background:
    radial-gradient(rgba(255,255,255,.05) 1px, transparent 1px);

    background-size:8px 8px;

    opacity:.3;
}

/* DOBLECES */

.fold-left,
.fold-right,
.fold-bottom{
    position:absolute;
    inset:0;
}

.fold-left{
    clip-path:polygon(0 0,50% 50%,0 100%);
    background:rgba(255,255,255,.05);
}

.fold-right{
    clip-path:polygon(100% 0,50% 50%,100% 100%);
    background:rgba(0,0,0,.18);
}

.fold-bottom{
    clip-path:polygon(0 100%,100% 100%,50% 50%);
    background:rgba(0,0,0,.22);
}

/* TAPA */

.top-flap{
    position:absolute;
    inset:0;

    clip-path:polygon(0 0,100% 0,50% 55%);

    background:
    linear-gradient(145deg,#29477c,#1a2e54);

    transform-origin:top center;

    transition:1.5s cubic-bezier(.22,1,.36,1);

    z-index:6;

    box-shadow:
    inset 0 0 20px rgba(255,255,255,.05);
}

/* SELLO flor blanca*/
/*
.seal{
    position:absolute;
    top:50%;
    left:50%;

    transform:translate(-50%,-50%);

    width:95px;
    height:95px;

    border-radius:50%;

    background:
    radial-gradient(circle at top left,
    #4b72b3,
    #142342);

    display:flex;
    justify-content:center;
    align-items:center;

    color:white;
    font-size:42px;

    z-index:10;

    box-shadow:
    inset -10px -10px 15px rgba(0,0,0,.35),
    inset 6px 6px 12px rgba(255,255,255,.08),
    0 15px 30px rgba(0,0,0,.45);

    transition:1s ease;
}
*/

/* =========================
   SELLO DE CERA DORADO
========================= */

.seal{
    position:absolute;
    top:50%;
    left:50%;

    transform:translate(-50%,-50%);

    width:100px;
    height:100px;

    border-radius:50%;

    background:
    radial-gradient(circle at top left,
    #f8e7b5 0%,
    #d4af37 38%,
    #8c6918 100%);

    display:flex;
    justify-content:center;
    align-items:center;

    z-index:10;

    box-shadow:
    inset -10px -10px 18px rgba(0,0,0,.28),
    inset 8px 8px 15px rgba(255,255,255,.25),
    0 18px 35px rgba(0,0,0,.45);

    transition:1s ease;

    border:4px solid rgba(255,255,255,.12);
}

/* BORDE INTERNO */

.seal::before{
    content:'';

    position:absolute;

    width:82px;
    height:82px;

    border-radius:50%;

    border:2px solid rgba(255,255,255,.16);

    box-shadow:
    inset 0 0 12px rgba(255,255,255,.08);
}

/* LETRA CENTRAL */

.seal::after{

    content:'M&J';

    /*
    font-family:'Cormorant Garamond',serif;
    */
    font-family:'Great Vibes',cursive;

    font-size:20px;
    font-weight:700;

    color:#fff8dc;

    text-shadow:
    0 2px 4px rgba(0,0,0,.35);

    letter-spacing:2px;
}

/* ANIMACION AL ABRIR */

.envelope.open .seal{
    opacity:0;

    transform:
    translate(-50%,-50%)
    scale(.3)
    rotate(180deg);
}

/* TEXTO */

.tap{
    position:absolute;
    bottom:-55px;
    width:100%;
    text-align:center;
    color:#dce5ff;
    letter-spacing:5px;
    font-size:12px;
}

/* ABRIR */

.envelope.open .top-flap{
    transform:rotateX(180deg);
}

.envelope.open .seal{
    opacity:0;
    transform:translate(-50%,-50%) scale(.3);
}

.envelope.open .letter{
    transform:
    translateY(-420px)
    scale(1.05);
}

/* ESCONDER INTRO */

.hideIntro{
    opacity:0;
    pointer-events:none;
}

/* =========================
   INVITACION
========================= */

.invitation{
    opacity:0;
    transform:translateY(80px);
    transition:2s ease;
}

/* MOSTRAR */

.showInvitation{
    opacity:1;
    transform:translateY(0);
}

/* HERO */

.hero{
    height:100vh;
    position:relative;
    overflow:hidden;
}

.hero::before{
    content:'';
    position:absolute;
    inset:0;

    background:
    linear-gradient(rgba(0,0,0,.45),rgba(0,0,0,.45)),
    url('img/header.webp');

    background-size:cover;
    background-position:center;

    animation:zoomHero 14s ease-in-out infinite alternate;
}

@keyframes zoomHero{
    from{
        transform:scale(1.1);
    }
    to{
        transform:scale(1.22);
    }
}

/* MUSIC */

#soundToggle {
    position: fixed;
    bottom: 24px;
    left: 24px;
  
    width: 48px;
    height: 48px;
  
    border-radius: 50%;
    border: none;
  
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
  
    color: #fff;
    font-size: 18px;
  
    cursor: pointer;
  
    z-index: 9999;
  
    display: flex;
    align-items: center;
    justify-content: center;
  
    transition: transform 0.2s ease, background 0.2s ease;
  }
  
  /* Music boton Hover desktop */
  #soundToggle:hover {
    transform: scale(1.05);
    background: rgba(0, 0, 0, 0.7);
  }
  
  /* Music boton Ajuste para iPhone con barra inferior */
  @supports (padding: env(safe-area-inset-bottom)) {
    #soundToggle {
      bottom: calc(24px + env(safe-area-inset-bottom));
    }
  }


/* HERO CONTENT */

.hero-content{
    position:relative;
    z-index:2;

    height:100%;

    display:flex;
    justify-content:center;
    align-items:center;
    flex-direction:column;

    text-align:center;
    color:white;
    padding:20px;
}

.hero-content h2{
    font-family:'Cormorant Garamond',serif;
    font-size:30px;
    letter-spacing:5px;
}

.hero-content h1{
    font-family:'Great Vibes',cursive;
    font-size:92px;
    margin:12px 0;
}

.hero-content p{
    letter-spacing:4px;
}

/* SCROLL */

.scroll{
    position:absolute;
    bottom:35px;
    left:50%;
    transform:translateX(-50%);
    color:white;
    letter-spacing:4px;
    font-size:11px;

    animation:bounce 2s infinite;
}

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

/* WRAPPER */

.wrapper{
    max-width:460px;
    margin:auto;
    margin-top:-80px;
    position:relative;
    z-index:5;
}

/* CARD */

.card{
    background:white;
    border-radius:30px;
    overflow:hidden;

    box-shadow:
    0 25px 60px rgba(0,0,0,.12);
}

/* COVER */

.cover{
    height:420px;
    position:relative;
    overflow:hidden;
}

.cover img{
    width:100%;
    height:100%;
    object-fit:cover;

    transition:8s ease;
}

.cover:hover img{
    transform:scale(1.12);
}

.cover-overlay{
    position:absolute;
    inset:0;

    background:
    linear-gradient(to top,
    rgba(0,0,0,.65),
    rgba(0,0,0,.08));
}

.cover-text{
    position:absolute;
    bottom:45px;
    width:100%;
    text-align:center;
    color:white;
}

.cover-text h1{
    font-family:'Cormorant Garamond',serif;
    font-size:58px;
}

.cover-text p{
    letter-spacing:3px;
}

/* COUNTDOWN */

.countdown{
    padding:55px 25px;
    background:#59663d;
    color:white;
    text-align:center;
}

.countdown h2{
    font-family:'Cormorant Garamond',serif;
    font-size:42px;
    margin-bottom:35px;
}

.timer{
    display:flex;
    justify-content:center;
    gap:15px;
}

.time-box{
    background:rgba(255,255,255,.12);
    padding:20px;
    border-radius:20px;
    width:80px;
}

.time-box h3{
    font-size:28px;
}

.time-box span{
    font-size:11px;
    letter-spacing:2px;
}

/* SECTIONS */

.section{
    padding:70px 35px;
    text-align:center;
}

.section-title{
    font-family:'Cormorant Garamond',serif;
    font-size:48px;
    color:#59663d;
    margin-bottom:20px;
}

.script{
    font-family:'Great Vibes',cursive;
    font-size:38px;
    color:#8f8f8f;
    margin-bottom:18px;
}

.section p{
    line-height:1.9;
    color:#666;
}

.section-img {
    margin: 4% 0;
    padding: 0;
    width: 100%;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,.25);

}

/* BUTTON */

.btn{
    display:inline-block;
    margin-top:30px;
    padding:16px 34px;
    border-radius:50px;
    background:#59663d;
    color:white;
    text-decoration:none;
    transition:.3s ease;
}

.btn:hover{
    transform:translateY(-5px);
}

/* GALLERY */

.gallery{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:12px;
    margin-top:35px;
}

.gallery img{
    width:100%;
    height:180px;
    object-fit:cover;
    border-radius:18px;

    transition:.5s ease;
}

.gallery img:hover{
    transform:scale(1.05);
}

/* CONFIRMACION */

.confirmacion-cont{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}


.confirmacion-cajatexto{
    width: 80%;
    height: 10%;
    padding: 10px;
    margin: 10px;
    font-size: 1.5rem;
    box-sizing: border-box;
  }

/* FOOTER */

.footer{
    padding:60px 30px;
    background:#59663d;
    text-align:center;
    color:white;
}

.footer h2{
    font-family:'Great Vibes',cursive;
    font-size:48px;
    margin-bottom:15px;
}

.footer a{
    text-decoration: none;
    color: var(--footer-color);
}

/* MUSIC */

.music-btn{
    position:fixed;
    right:25px;
    bottom:25px;

    width:65px;
    height:65px;

    border-radius:50%;

    background:#59663d;

    display:flex;
    justify-content:center;
    align-items:center;

    color:white;
    font-size:24px;

    cursor:pointer;

    box-shadow:
    0 10px 25px rgba(0,0,0,.25);

    z-index:500;

    animation:rotateMusic 6s linear infinite;
}

@keyframes rotateMusic{
    from{
        transform:rotate(0deg);
    }
    to{
        transform:rotate(360deg);
    }
}

/* RESPONSIVE */

@media(max-width:500px){

    .envelope-wrapper{
        width:340px;
        height:240px;
    }

    .hero-content h1{
        font-size:72px;
    }

    .cover-text h1{
        font-size:46px;
    }

}
