.maincontainer
{
    width: 302px;
    height: 299px;
    margin-left: 90px;
    margin-bottom: 30px;
    float: left; /* stack each div horizontally */
}

.navbar a{
    font-size: 18px;
}

body{
    display: flex;
    flex-direction: column;
}
img
{
   border-radius: 10px;
}

.back h2
{
    text-align: center;
    padding: 10px;
    position: absolute;
}

.back p
{
    padding: 10px;
    position: absolute;
    top: 50px;
    font-size: 15px;
}

.back a
{
    padding: 10px;
    position: absolute;
    top: 200px;
    font-size: 15px;
}

.front h2
{
    position: absolute;
    padding: 10px;
    top: 200px;
    color: #000;
}

/* style the maincontainer class with all child div's of class .front */
.maincontainer > .front
{
    position: absolute;
    transform: perspective(600px) rotateY(0deg);
    
    width: 302px;
    height: 290px;
    
    backface-visibility: hidden; /* cant see the backside elements as theyre turning around */
    transition: transform .5s linear 0s;
}

/* style the maincontainer class with all child div's of class .back */
.maincontainer > .back
{
    position: absolute;
    transform: perspective(600px) rotateY(180deg);
    background: #dc3545;
    color: #fff;
    width: 302px;
    height: 290px;
    border-radius: 10px;
    padding: 5px;
    backface-visibility: hidden; /* cant see the backside elements as theyre turning around */
    transition: transform .5s linear 0s;
}

.maincontainer:hover > .front
{
    transform: perspective(600px) rotateY(-180deg);
}

.maincontainer:hover > .back
{
    transform: perspective(600px) rotateY(0deg);
}

.space{
    height: 100vh;
}

.image img{
    height: 290px;
    width: 300px;
}

.main-box{
  
    margin: 90px;
    
}

.btn:hover{
    border: 3px solid lightcoral;
    background:transparent;
    color: lightcoral;    
}