@import url('https://fonts.googleapis.com/css2?family=Satisfy&display=swap');
*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body{
    height: 100vh;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #1d3557;
}
.mainpage{
    position: relative;
    height: 400px;
    width: 400px;
    transform: translate(-50%, -50);
}
.card{
    position: absolute;
    height: 400px;
    width: 400px;
    transform-style: preserve-3d;
    transition: all 1s ease; 
}
.card:hover{
    transform: rotateY(180deg);
    transition: all 3s ease;
}
.front{
    position: absolute;
    height: 100%;
    width: 100%;
    backface-visibility: hidden;
    background:  #ffbf69;
    color: #1d3557;
    text-align: center;
    border-radius: 5px;
    box-shadow: 2px 2px 4px #001219;
}
.back{
    height: 400px;
    width: 400px;
    background-color: #ffbf69;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 0;
    position: relative;
    box-shadow: 2px 2px 4px #001219;
    backface-visibility: hidden;
    transform: rotateY(180deg);
   
}
.front p{
    text-align: center;
    
    font-size: 30px;
    font-family: 'Satisfy', cursive;
    margin: 100px 50px;
    text-shadow: 2px 2px 4px #f1faee ;
    /* border-top: 50px solid transparent ;
    border-right: 50px solid #f1faee;
    border-bottom: 50px solid transparent;
    border-left: 50px solid #f1faee;*/
} 
#inner p{
    position: absolute;
    font-size: 20px;
    font-family: 'Satisfy', cursive;
    border: none;
    border-color: #f1faee;
    padding: 20px 115px 300px;
   
}
#Button1{
    position: relative;
    font-size: 15px;
    font-family: 'Satisfy', cursive; 
    border: none;
    background-color: #d00000;
    margin-top: 50%;
    z-index: 5;

   
}


.flipCard{
    transform: rotateY(180deg);
}
#inner {
    height: 300px;
    width: 300px;
    background-color: #f1faee;
    top: 0;
    position: absolute;
    border-radius: 4px;
    z-index: 2;
    transition: 0.5s;
}
/* pop up making */
#popper{
    display: none;
    height: 400px;
    width: 600px;
    background-color: #f1faee;
    /* top: 0; */
    margin-bottom: 30%;
    position: absolute;
    border-radius: 5px;
    z-index: 4;
   
    
}
#popper p{
    position: absolute;
    font-size: 20px;
    font-family: 'Satisfy', cursive;
    border: none;
    border-color: #f1faee;
    padding: 20px 90px 300px;
   

}


/* envelope making */
.outer{
    position: absolute;
    height: 100%;
    width: 100%;
    top: 0;
    left: 0;
    border-top: 200px solid transparent;
    border-right: 200px solid #dc2f02;
    border-bottom: 200px solid #d00000;
    border-left: 200px solid #dc2f02; 
    z-index: 3;
}
.cover{
    position: absolute;
    height: 100%;
    width: 100%;
    top: 0;
    left: 0;
    border-right: 200px solid transparent;
    border-bottom: 200px solid transparent;
    border-left: 200px solid transparent;
    z-index: 3;
    transform-origin: top;
    transition: transform 0.25s linear;
}
.cover.one{
    border-top: 200px solid #e5383b;
    transform: rotateX(0deg) ;
    z-index: 3;
    transition-delay: 0.75s;
   
}
.cover.two{
    border-top: 200px solid #e5383b ;
    transform: rotateX(90deg) ;
    z-index: 1;
    transition-delay: 0.5s;
    
}
.back:hover .cover.one{
    transform: rotateX(90deg);
    transition-delay: 0s;
    
}
.back:hover .cover.two{
    transform: rotateX(180deg);
    transition-delay: 0.25s;
   
}
.back:hover #inner{
    transform: translateY(-50px);
    transition-delay: 0.5s;
    box-shadow: 2px 2px 6px #1d3557;
}