@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@300&display=swap');

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

a, a:visited, a:active{
  color: inherit;
}

body{
  background-color: #bfbfbf;
  font-family: 'Open Sans', sans-serif;
  margin: 0px;
}

header{
  width:100%;
  display: flex;
  background-color: rgba(255,255,255,0.7);
}

#About, #Projects, #Contact{
  height:100%;
  animation: 1s ease-out 0s 1 dimOut;
}

@keyframes dimOut {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/**** Loader styles ****/
#loader {
    border: 12px solid #f3f3f3;
    border-radius: 50%;
    border-top: 12px solid #827b7b;
    width: 70px;
    height: 70px;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    margin: auto;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

#main-menu-toggle{
  display: none;
}

#main-menu-close{
  display:none;
}

header h1 {
  width: 60%;
  font-size: 2.5em;
  padding: 0 0 0 2%;
}

header>h1>a{
  text-decoration: none;
}

#main-menu{
  width: 40%;
}

#main-menu>ul {
  width: 100%;
  height: 75%;
  list-style-type: none;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

#main-menu>ul>li {
  font-size: 2em;
  padding: 1.5%;
}

#main-menu>ul>li>a {
  text-decoration: none;
}

/*****************About page************************/
.about-details{
  width: 100%;
  margin: 0px;
  padding: 0px;
  display: flex;
  flex-wrap: wrap;
}

.about-details li {
  cursor: pointer;
}

.about-grid{
  width:25%;
  position: relative;
  list-style-type: none;
}

.about-img{
  width:100%;
}

.img-caption-heading{
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  color: #fff;
  text-shadow: 2px 2px 6px #000;
  font-size: 2em;
  text-align:center;
}

.img-caption-details{
  opacity: 0;
  position: absolute;
  color: #fff;
  width: 100%;
  top: 65%;
  left: 0;
  text-align: center;
  font-size: 1em;
}

.about-grid:hover .about-img{
  opacity: 0.7;
}

.about-grid:hover .img-caption-details{
  transition: .5s ease;
  -webkit-transform: translate(0%, 50%);
  -ms-transform: translate(0%, 50%);
  transform: translate(0%, 50%);
  opacity: 1;
}

.show{
  display: block;
}

.hide{
  display: none !important;
}

/*****************Projects page************************/
#Projects{
  width:100%;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}

.Project-grid-3{
  width: 27%;
}

.Project-grid-2{
  width: 45%;
}

.Project-grid-3, .Project-grid-2{
  cursor: pointer;
  background: rgba(255,255,255,0.8);
  margin: 1%;
  padding: 1%;
}

.Project-grid-3 h2, .Project-grid-2 h2{
  font-size: 1.6em;
}

.Project-grid-3 p, .Project-grid-2 p{
  font-size: 1em;
}

.Project-grid-3 a, .Project-grid-2 a{
  text-decoration: none;
}

/************ Contact page *****************/
#Contact{
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.contact-form{
  width:70%;
  margin: 5%;
  background-color: rgba(255,255,255,0.8);
  padding: 2%;
}

.contact-form p, .contact-form a{
  width: 100%;
  margin: 1%;
  height: 4em;
  font-size: 1.3em;
  text-decoration: none;
}

.contact-form div{
  padding: 2%;
  margin: 2%;
  border: 1px solid #000;
  text-decoration: none;
  cursor: pointer;
}

.contact-form div:active, .contact-form div:hover{
  background-color: #eae8e8;
}

.contact-form img{
  max-width: 100%;
}

/****Footer******/
footer{
  display: flex;
  justify-content: center;
  align-items: center;
}

footer a{
  width: 3em;
  margin: 1%;
}

footer img{
  width:100%;
}


/*****Media queries *******/
/*Tablet*/
@media only screen and (min-width:511px) and (max-width:1080px){
  .about-grid{
    width:50%;
  }

  .Project-grid-3, .Project-grid-2{
    width: 40%;
    height: 100%;
    margin: 1%;
    padding: 3%;
  }

  #main-menu {
    width: 45%;
  }

  #main-menu>ul>li{
    font-size: 1.5em;
  }

}

@media only screen and (max-width:510px){
  header h1 {
    width: 80%;
  }

  #main-menu{
    width: 20%;
    padding: 5%;
    font-size: 0.8em;
  }
}

/*Mobile + bigger width*/
@media only screen and (max-width:850px){
  header h1 {
    font-size: 1.9em;
  }

  .about-grid{
    width:100%;
  }

  .Project-grid-3, .Project-grid-2{
    width: 80%;
    height: 100%;
    margin: 3%;
    padding: 3%;
  }

  .Project-grid-2{
    width: 80%;
    height: 100%;
  }

  #main-menu-toggle{
    display: block;
    position: absolute;
    right: 2%;
    top: 2.5%;
  }

  @keyframes slideFromTop{
    0%{
      transform: scaleY(0);
    }
    100%{
      transform: scaleY(1);
    }
  }

  #main-menu{
    z-index:1;
    position: absolute;
    display: none;
    top: 6%;
    right: 4%;
    background: rgba(255,255,255,0.7);
    animation: 0.5s ease-out 0s 1 slideFromTop;
  }

  #main-menu>ul{
    padding: 5%;
    margin: 5%;
    text-align: center;
  }

  #main-menu>ul>li{
    width: 100%;
  }

  #main-menu-close{
    position: absolute;
    right: 5%;
    top: 5%;
  }

  #main-menu:target{ /* apply target pseudo cls on the elt to target*/
    display: block;
  }

  #main-menu:target #main-menu-close{
    display:block;
  }

  #main-menu>ul>li{
    font-size: 1.5em;
  }

}
