/*:root{
  --background: rgba (0, 214, 170, .85);
}*/

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #222;

}

/* Navigation Styles Starts from here */

header{
  background-color: rgba(0, 214, 170, 0.83);
  text-align: center;
  position:fixed;
  z-index: 999;
  width: 100%;
}

.nav-toggle{
  display: none;
}

.nav-toggle-label{
  position: absolute;
  top: 0;
  right: 0;
  margin-right: 1rem;
  height: 100%;
  display: flex;
  align-items: center;
  
}
/* This lines of codes helps to create the three bars */

.nav-toggle-label span,
.nav-toggle-label span::before,
.nav-toggle-label span::after {
  display: block;
  background-color: white;
  height: 2px;
  width: 2em;
  position: relative;
}

.nav-toggle-label span::before,
.nav-toggle-label span::after{
  content: '';
  position: absolute;
}

.nav-toggle-label span::before{
  bottom: 7px;
}

.nav-toggle-label span::after{
  top: 7px;
}


nav{
  position: absolute;
  text-align: right;
  top: 100%;
  right: 0;
  background-color: rgba(0, 214, 170, 0.83);
  width: 100%;
  /*display: none;*/ /* it helps to hid the nav menu */
  transform: scale(1, 0);
  transform-origin: top; /* it will start from the top not the center*/
  transition: transform 400ms ease-in-out; /* it display the animation */
}
 nav ul{
  margin: 0;
  padding: 0;
  list-style: none;
 }

 nav li{
  margin-bottom: 1rem;
  margin-right: 1rem;
 }

 nav a{
  color: white;
  text-decoration: none;
  font-size: 1.2rem;
  opacity: 0; /* to disappear the menu bar */
  transition: opacity 150ms ease-in-out; /* The last 250ms is used to show delay in the transition  when present*/
 } 

 nav a:hover{
  color: #000;
 }

 /* the ~ helps to look for the preceding, after nav-toggle which is nav. */

.nav-toggle:checked ~ nav{
 transform: scale(1, 1); /* adding animation to the nav bar*/
}

.nav-toggle:checked ~ nav a {
  opacity: 1;
  transition: opacity 250ms ease-in-out 250ms; /* This transition happens immediately after clicking the the menu bar then the second click effect the first*/
}

/* Making a media query for bigger screen sizes */

@media screen and (min-width: 600px) {
  .nav-toggle-label{
    display: none;
    
  }

  header{
    display: grid;
    grid-template-columns: 1fr auto minmax(400px, 3fr) 1 fr;
  }
  .logo{
    grid-column: 1 / 2;
  }

  nav{
    all: unset;
    grid-column: 3 / 4;
    display: flex;
    justify-content: flex-end;
    align-items: center;
  }

 nav ul{
    display: flex;
    justify-content: flex-end;

  }
  nav li{
    margin-left: 3rem;
    margin-bottom: 0;
  }

  nav a{
    opacity: 1;
    position: relative;
  }
  nav a::before {
    content: '';
    display: block;
    height: 5px;
    background: black;
    position: absolute;
    top: -1em;
    left: 0;
    right: 0;
   /* transform-origin: left; /* This allows a transition bar to come from the left or right side of the web site*/
    transform: scale(0, 1);
    transition: transform ease-in-out 250ms;
  }
  nav a:hover::before {
    transform: scale(1,1);
  }
}