
/* =========================
   GLOBAL
========================= */

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

body{

    font-family:Georgia, serif;
    background:#F7F1E8;
    overflow-x:hidden;
    color:#6b6158;

}

/* =========================
   BACKGROUND
========================= */

.background{

    position:absolute;

    inset:0;

    width:100%;
    height:100%;

    overflow:hidden;

    z-index:0;

    pointer-events:none;

}
/* =========================
   CARDS
========================= */

.card{

    width:380px;

    background:#FFFDF9;

    padding:45px;

    border-radius:28px;

    box-shadow:0 20px 50px rgba(0,0,0,.08);

    text-align:center;

    position:absolute;

    top:50%;
    left:50%;

    transform:translate(-50%,-50%);

    animation:cardAppear .8s ease;

}

.hidden{

    display:none;

}

.tag{

    color:#C9A66B;

    font-size:13px;

    letter-spacing:4px;

    margin-bottom:15px;

}

h1{

    color:#8B1E3F;

    font-size:38px;

    margin-bottom:20px;

}

.subtitle{

    line-height:1.8;

    color:#6b6158;

}

button{

    margin-top:28px;

    background:#8B1E3F;

    color:white;

    border:none;

    padding:14px 34px;

    border-radius:40px;

    cursor:pointer;

    font-size:16px;

    transition:.3s;

}

button:hover{

    transform:translateY(-4px);

    box-shadow:0 12px 25px rgba(0,0,0,.12);

}
.button-box{

    position:relative;

    width:280px;

    height:120px;

    margin:30px auto;

}

#yesBtn{

    position:absolute;

    left:20px;

    top:20px;

}

#noBtn{

    position:absolute;

    right:20px;

    top:20px;

}
.fade-out{

    animation:fadeOut .7s forwards;

}

.fade-in{

    animation:fadeIn .7s forwards;

}

@keyframes fadeOut{

from{

opacity:1;
transform:translate(-50%,-50%);

}

to{

opacity:0;
transform:translate(-50%,-60%);

}

}

@keyframes fadeIn{

from{

opacity:0;
transform:translate(-50%,-40%);

}

to{

opacity:1;
transform:translate(-50%,-50%);

}

}

@keyframes cardAppear{

from{

opacity:0;

transform:translate(-50%,-40%);

}

to{

opacity:1;

transform:translate(-50%,-50%);

}

}
#envelope.open .flap{

transform:rotateX(180deg);

}

#envelope.open .paper{

transform:translateY(-80px);

}
.heart{

    position:absolute;

    width:20px;
    height:20px;

    background:#d48a9a;

    transform:rotate(45deg);

    opacity:.35;

    animation:float 6s ease-in-out infinite;

}

.heart::before,
.heart::after{

content:"";

position:absolute;

width:20px;
height:20px;

background:#d48a9a;

border-radius:50%;

}

.heart::before{

left:-10px;

}

.heart::after{

top:-10px;

}

.heart1{left:8%;top:80%;}
.heart2{left:80%;top:85%;animation-delay:2s;}
.heart3{left:55%;top:90%;animation-delay:4s;}
.heart4{left:25%;top:15%;animation-delay:1s;}
.heart5{left:70%;top:25%;animation-delay:3s;}
.heart6{left:90%;top:60%;animation-delay:5s;}
.heart7{left:10%;top:35%;animation-delay:2s;}
.heart8{left:45%;top:10%;animation-delay:6s;}

@keyframes float{

0%,100%{

transform:translateY(0) rotate(45deg);

}

50%{

transform:translateY(-30px) rotate(45deg);

}

}
.open .lid{

transform:rotateX(-130deg);

}


/* =========================
   SPARKLES
========================= */

.sparkle{
    position:absolute;
    color:#d4b06a;
    font-size:28px;
    animation:twinkle 2.5s ease-in-out infinite;
}

.sparkle1{top:10%;left:15%;}
.sparkle2{top:20%;right:18%;}
.sparkle3{top:60%;left:10%;}
.sparkle4{top:75%;right:15%;}
.sparkle5{top:40%;left:45%;}
.sparkle6{top:85%;left:70%;}

@keyframes twinkle{

0%,100%{
opacity:.3;
transform:scale(.8);
}

50%{
opacity:1;
transform:scale(1.4);
}

}


/* =========================
   DREAMY GLOWS
========================= */

.glow{

position:absolute;
border-radius:50%;
filter:blur(70px);
opacity:.25;
animation:glowFloat 8s ease-in-out infinite;

}

.glow1{

width:220px;
height:220px;
background:#f4d7d9;

top:-40px;
left:-60px;

}

.glow2{

width:180px;
height:180px;
background:#f7e4c9;

right:-40px;
bottom:20px;

animation-delay:2s;

}

.glow3{

width:150px;
height:150px;
background:#efd0da;

left:45%;
bottom:-40px;

animation-delay:4s;

}

@keyframes glowFloat{

0%,100%{
transform:translateY(0);
}

50%{
transform:translateY(-25px);
}

}


/* =========================
   PETALS
========================= */

.petal{

position:absolute;

width:14px;
height:10px;

background:#f6c9d7;

border-radius:70% 30% 70% 30%;

opacity:.8;

pointer-events:none;

animation:fall linear infinite;

}

@keyframes fall{

0%{

transform:translateY(-60px) rotate(0deg);

}

100%{

transform:translateY(110vh) rotate(360deg);

}

}


/* =========================
   MEMORY PAGE
========================= */

.memoryPage{

display:none;

width:100%;

min-height:100vh;

padding:100px 0;

background:#f9f2ea;

text-align:center;

position:relative;
 overflow:hidden;



}


/* =========================
   MUSIC TAG
========================= */

.musicTag{

position:fixed;

top:20px;
right:20px;

background:white;

padding:14px 22px;

border-radius:40px;

box-shadow:0 10px 25px rgba(0,0,0,.12);

color:#8B1E3F;

font-size:15px;

z-index:500;

animation:musicFloat 3s ease-in-out infinite;

}

.musicTag span{

display:block;

margin-top:4px;

font-size:12px;

opacity:.7;

}

@keyframes musicFloat{

0%,100%{
transform:translateY(0);
}

50%{
transform:translateY(-8px);
}

}


/* =========================
   POLAROIDS
========================= */

.photo{

width:350px;

margin:120px auto;

opacity:0;

transform:translateY(80px);

transition:1s;

}

.photo.show{

opacity:1;

transform:translateY(0);

}

.photo img{

width:100%;

padding:15px 15px 60px;

background:white;

border-radius:8px;

box-shadow:0 18px 35px rgba(0,0,0,.15);

}

.firstPhoto{

transform:rotate(-4deg);

}

.secondPhoto{

transform:rotate(4deg);

}

.caption{

margin-top:18px;

font-size:20px;

font-style:italic;

color:#7a3845;

}
/* =========================
   SCRAPBOOK GALLERY
========================= */

.gallery{

width:90%;

max-width:1100px;

margin:120px auto;

display:flex;

flex-wrap:wrap;

justify-content:center;

gap:35px;

padding-bottom:100px

}

.gallery img{

width:220px;

background:white;

padding:12px 12px 50px;

border-radius:8px;

box-shadow:0 15px 30px rgba(0,0,0,.15);

transition:.4s;

cursor:pointer;

object-fit:cover;
 
}

.gallery img:hover{

transform:scale(1.08) rotate(0deg);

z-index:10;

}
.gallery img:nth-child(1){

transform:rotate(-8deg);

}

.gallery img:nth-child(2){

transform:rotate(6deg);

width:260px;

}

.gallery img:nth-child(3){

transform:rotate(-4deg);

}

.gallery img:nth-child(4){

transform:rotate(9deg);

}

.gallery img:nth-child(5){

transform:rotate(-10deg);

width:250px;

}

.gallery img:nth-child(6){

transform:rotate(5deg);

}

.gallery img:nth-child(7){

transform:rotate(-6deg);

}

.gallery img:nth-child(8){

transform:rotate(8deg);

}

.gallery img:nth-child(9){

transform:rotate(-5deg);

}

.gallery img:nth-child(10){

transform:rotate(10deg);

}

.gallery img:nth-child(11){

transform:rotate(-7deg);

}

.gallery img:nth-child(12){

transform:rotate(4deg);

}

.gallery img:nth-child(13){

transform:rotate(-9deg);

}
.memoryTitle{

text-align:center;

font-size:40px;

color:#8B1E3F;

margin-top:120px;

margin-bottom:50px;

font-family:Georgia,serif;

}
/* =========================
   MEMORY BOX
========================= */

.memoryBox{

margin:140px auto;

text-align:center;

}

.memoryText{

font-size:28px;

color:#8B1E3F;

margin-bottom:30px;

font-style:italic;

}

/* =========================
   MEMORY CHEST
========================= */

#giftBox{

width:180px;

height:120px;

margin:auto;

position:relative;

cursor:pointer;

transition:.4s;

}

.boxBase{

position:absolute;

bottom:0;

width:180px;

height:80px;

background:#8b5e3c;

border-radius:0 0 15px 15px;

box-shadow:0 10px 25px rgba(0,0,0,.2);

}

.boxBase::before{

content:"";

position:absolute;

left:50%;

top:0;

transform:translateX(-50%);

width:12px;

height:80px;

background:#d8b46a;

}

.lid{

position:absolute;

top:0;

left:0;

width:180px;

height:45px;

background:#9d6a42;

border-radius:12px 12px 0 0;

transform-origin:bottom;

transition:.8s;

box-shadow:0 5px 12px rgba(0,0,0,.2);

}

.lid::before{

content:"";

position:absolute;

left:50%;

transform:translateX(-50%);

width:12px;

height:45px;

background:#d8b46a;

}

#giftBox:hover{

transform:scale(1.05);

}
.burst{

position:absolute;

color:#d4b06a;

font-size:24px;

pointer-events:none;

animation:explode 1s forwards;

}

@keyframes explode{

0%{

opacity:1;

transform:translate(0,0) scale(.5);

}

100%{

opacity:0;

transform:translate(var(--x),var(--y)) scale(2);

}

}
/* =========================
   FLYING MEMORIES
========================= */

.memoryFly{

position:absolute;

width:70px;
height:90px;

background:white;

padding:5px 5px 18px;

border-radius:6px;

box-shadow:0 8px 18px rgba(0,0,0,.18);

overflow:hidden;

pointer-events:none;

animation:flyMemory 1.4s ease-out forwards;

z-index:999;

}

.memoryFly img{

width:100%;
height:100%;

object-fit:cover;

border-radius:3px;

}

@keyframes flyMemory{

0%{

opacity:0;
transform:translate(0,0) scale(.3) rotate(0deg);

}

20%{

opacity:1;

}

100%{

opacity:0;

transform:
translate(var(--x),var(--y))
scale(1)
rotate(var(--r));

}
}
/* =========================
   LETTER SECTION
========================= */

.letterSection{

    min-height:100vh;

    display:flex;

    flex-direction:column;

    justify-content:center;

    align-items:center;

    background:#f8f1e9;

    margin-top:300px;

}


/* ENVELOPE */

#envelope{

    position:relative;

    width:340px;

    height:220px;

    cursor:pointer;

    overflow:visible;

}


/* LETTER */

.letter{

    position:absolute;

    left:20px;

    bottom:20px;

    width:300px;

    height:190px;   /* smaller because it's folded */

    padding:25px;

    background:#fffdf8;

    border-radius:8px;

    box-shadow:0 15px 30px rgba(0,0,0,.15);

    transition:1.2s;

    z-index:1;

    overflow:hidden;

}


/* FRONT */

.envelopeFront{

    position:absolute;

    bottom:0;

    left:0;

    width:100%;

    height:180px;

    background:#e8d5c6;

    border-radius:8px;

    z-index:3;

}


/* FLAP */

.flap{

    position:absolute;

    top:40px;

    left:0;

    width:100%;

    height:120px;

    background:#dcbba6;

    clip-path:polygon(0 0,100% 0,50% 100%);

    transform-origin:top;

    transition:1s;

    z-index:5;

}


/* OPEN FLAP */

#envelope.open .flap{

    transform:rotateX(180deg);

}


/* OPEN LETTER */

#envelope.open .letter{

    transform:translateY(-250px);

    height:500px;

}

}