/*
 * Made by Erik Terwan
 * 24th of November 2015
 * MIT license
 *
 *
 * If you are thinking of using this in
 * production code, beware of the browser
 * prefixes.
 */

nav {
  z-index:900;
  position: fixed;
  top:0;
  right:0;
}

#menuToggle
{
  display: block;
  position: absolute;
  top: 30px;
  right: 30px;
  
  z-index: 1;
  
  -webkit-user-select: none;
  user-select: none;
}

#menuToggle input
{
  display: block;
  width: 58px;
  height: 52px;
  position: absolute;
  top: -10px;
  left: -10px;
  
  cursor: pointer;
  
  opacity: 0; /* hide this */
  z-index: 999; /* and place it over the hamburger */
  
  -webkit-touch-callout: none;
}

/*
 * Just a quick hamburger
 */
#menuToggle span
{
  display: block;
  width: 52px;
  height: 7px;
  margin-bottom: 11px;
  position: relative;
  
  background: #001b40;
  border-radius: 0px;
  
  z-index: 1;
  
  transform-origin: 1px 0px;
  
  transition: transform 0.5s cubic-bezier(0.77,0.2,0.05,1.0),
              background 0.5s cubic-bezier(0.77,0.2,0.05,1.0),
              opacity 0.55s ease;
}

#menuToggle span:first-child
{
  transform-origin: 0% 0%;
}

#menuToggle span:nth-last-child(2)
{
  transform-origin: 0% 100%;
}


/* 
 * Transform all the slices of hamburger
 * into a crossmark.
 */
#menuToggle input:checked ~ span
{
  opacity: 1;
  transform: rotate(45deg) translate(0px, -1px);
  background: #33c6f4;
}

#menuToggle input:checked ~ span:nth-last-child(3)
{
  opacity: 0;
  transform: rotate(0deg) scale(0.2, 0.2);
}

#menuToggle input:checked ~ span:nth-last-child(2)
{
  opacity: 1;
  transform: rotate(-45deg) translate(3px, -1px);
}



/*
 * Make this absolute positioned
 * at the top left of the screen
 */
#menu
{
  position: absolute;
  width: 210px;
  margin: -130px 0 0 0;
  padding: 70px;
  padding-top: 160px;
  padding-bottom:210px;
  right: -50px;
  
  background: #020f21;
  /*border:1px solid red;*/
  list-style-type: none;
  -webkit-font-smoothing: antialiased;
  /* to stop flickering of text in safari */
  
  transform-origin: 0% 0%;
  transform: translate(100%, 0);
  
  transition: transform 0.5s cubic-bezier(0.77,0.2,0.05,1.0);

  /*
  font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
  */
  font-family: 'Lato', sans-serif;
  font-weight:200;
  letter-spacing: 0.1em;
}

#menu li
{
  padding: 0 0 15px 0;
  font-size: 1.5em;
  transition: all 0.5s;
}

#menu .fa {
  border:1px solid white;
  color:#fff;
  font-size:1.1em;
  text-align: center;
  width:.9em;
  height:.9em;
  padding:.5em;
  margin:1em .8em 0 0;
  transition: color 0.3s ease;
}

#menu a:hover .fa,
#menu a:focus .fa
{
  color:#33c6f4;
  border-color:#33c6f4;
  transition: color 0.3s ease;
}

#menu a li
{
  color:#fff;
  transition: color 0.3s ease;
}

#menu a:hover li,
#menu a:focus li
{
  color:#33c6f4;
  transition: color 0.3s ease;
}

/*
 * And let's fade it in from the left
 */
#menuToggle input:checked ~ ul
{
  transform: scale(1.0, 1.0);
  opacity: 1;
}




/* Large devices (desktops, 992px and up)*/
@media (min-width: 992px) and (max-width: 1199px) {  
  #menuToggle
  {
    top: 30px;
    right: 30px;
  }

  #menuToggle input
  {
    width: 58px;
    height: 52px;
    top: -7px;
    left: -5px;
  }

  #menuToggle span
  {
    width: 52px;
    height: 7px;
    margin-bottom: 11px;
  }
  #menuToggle input:checked ~ span
    {
      transform: rotate(45deg) translate(1px, -1px);
    }

    #menuToggle input:checked ~ span:nth-last-child(2)
    {
      transform: rotate(-45deg) translate(3px, -1px);
    }
}

/* Medium devices (tablets, 768px and up)*/
@media (min-width: 768px) and (max-width: 991px) {  
  #menuToggle
  {
    top: 25px;
    right: 25px;
  }

  #menuToggle input
  {
    width: 58px;
    height: 52px;
    top: -7px;
    left: -5px;
  }

  #menuToggle span
  {
    width: 46px;
    height: 6px;
    margin-bottom: 10px;
  }

  #menuToggle input:checked ~ span
  {
    transform: rotate(45deg) translate(1px, -1px);
  }

  #menuToggle input:checked ~ span:nth-last-child(2)
  {
    transform: rotate(-45deg) translate(3px, -1px);
  }

}

/* Small devices (landscape phones, 576px and up)*/
@media (min-width: 576px) and (max-width: 767px) {  
  #menuToggle
  {
    top: 25px;
    right: 25px;
  }

  #menuToggle input
  {
    width: 60px;
    height: 60px;
    top: -17px;
    left: -5px;
  }

#menuToggle input:checked ~ span
  {
    transform: rotate(45deg) translate(1px, -1px);
  }

  #menuToggle input:checked ~ span:nth-last-child(2)
  {
    transform: rotate(-45deg) translate(3px, -1px);
  }


  #menuToggle span
  {
    width: 33px;
    height: 4px;
    margin-bottom: 8px;
  }
  #menu
  {
    width: 210px;
    margin: -130px 0 0 0;
    padding: 60px;
    padding-top: 160px;
    padding-bottom:190px;
    transition: all 0.5s;
  }
  #menu li
  {
    padding: 0 0 10px 0;
    font-size: 1.3em;
    line-height: 1.5em;
    transition: all 0.5s;
  }
}

/* Extra small devices (portrait phones, less than 576px) */
@media (max-width: 575px) {  
  #menuToggle
  {
    top: 20px;
    right: 20px;
  }

  #menuToggle input
  {
    width: 54px;
    height: 54px;
    top: 0px;
    left: 0px;
  }

  #menuToggle input:checked ~ span
  {
    transform: rotate(45deg) translate(1px, -1px);
  }

  #menuToggle input:checked ~ span:nth-last-child(2)
  {
    transform: rotate(-45deg) translate(3px, -1px);
  }


  #menuToggle span
  {
    width: 33px;
    height: 4px;
    margin-bottom: 8px;
  }
  #menu
  {
    width: 210px;
    margin: -130px 0 0 0;
    padding: 50px;
    padding-top: 160px;
    padding-bottom:180px;
    transition: all 0.5s;
    height:100vh;
  }
  #menu li
  {
    padding: 0 0 10px 0;
    font-size: 1.2em;
    line-height: 1.6em;
    transition: all 0.5s;
  }




}



