/* Hexagons */

#hexGrid {
    overflow: hidden;
    max-width: 540px;
    margin: 0 auto;
    padding: 0.866% 0;
    font-family: 'Raleway', sans-serif;
    font-size: 15px;
}

#hexGrid:after {
    content: "";
    display: block;
    clear: both;
}

.hex {
    position: relative;
    list-style-type: none;
    float: left;
    overflow: hidden;
    visibility: hidden;
    outline: 1px solid transparent;
    /* fix for jagged edges in FF on hover transition */
    transform: rotate(-60deg) skewY(30deg) translatez(-1px);
}

.hex * {
    position: absolute;
    visibility: visible;
    outline: 1px solid transparent;
    /* fix for jagged edges in FF on hover transition */
}

.hexIn {
    display: block;
    width: 100%;
    height: 100%;
    text-align: center;
    color: #fff;
    overflow: hidden;
    transform: skewY(-30deg) rotate(60deg);
}


/*** HEX CONTENT **********************************************************************/

.hex img {
    left: -100%;
    right: -100%;
    width: auto;
    height: 100%;
    margin: 0 auto;
}

.hex h1,
.hex p {
    margin: 0;
    width: 102%;
    left: -1%;
    /* prevent line on the right where background doesn't cover image */
    padding: 5%;
    box-sizing: border-box;
    background-color: rgba(0, 128, 128, 0.8);
    font-weight: 300;
    transition: transform .2s ease-out, opacity .3s ease-out;
}

.hex h1 {
    bottom: 50%;
    padding-top: 50%;
    font-size: 1.5em;
    z-index: 1;
    transform: translateY(-100%) translatez(-1px);
}

.hex h1:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 45%;
    width: 10%;
    text-align: center;
    border-bottom: 1px solid #fff;
}

.hex p {
    top: 50%;
    padding-bottom: 50%;
    transform: translateY(100%) translatez(-1px);
}

.hexFront {
    z-index: 12;
    width: 100%;
    height: 100%;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background: #fff;
}

.hexFront i {
    font-size: 2rem;
    line-height: 1em;
    display: block;
    position: absolute;
    top: 50px;
    /* margin-bottom: 50px; */
    color: black;
}

h3.hexTitle {
    font-size: 1.1rem!important;
    font-weight: bolder!important;
    position: absolute;
    top: 95px;
    padding: 0px 1rem;
    line-height: 1.2em!important;
    color: black!important;
}

.hexBack {
    z-index: 13;
    width: 100%;
    height: 100%;
    display: flex;
    text-align: center;
    justify-content: center;
    align-items: center;
    background: #fff;
    transition: opacity .5s;
}

.hex p.hexDesc {
    top: initial;
    padding: initial;
    transform: initial;
    background: transparent;
    color: #f27900;
    padding: 25px 15px;
    line-height: 1.5;
    margin: 0px;
    font-weight: 400;
}



.hexBack {
    opacity: 0;
    -webkit-animation: scale-up-center 0.4s cubic-bezier(0.390, 0.575, 0.565, 1.000) both;
	animation: scale-up-center 0.4s cubic-bezier(0.390, 0.575, 0.565, 1.000) both;
}

.hexIn:hover>.hexBack {
    opacity: 1;
    -webkit-animation: scale-up-center 0.4s cubic-bezier(0.390, 0.575, 0.565, 1.000) both;
	animation: scale-up-center 0.4s cubic-bezier(0.390, 0.575, 0.565, 1.000) both;
}



.hexIn:hover>.scale-up-center {
	-webkit-animation: scale-up-center 0.4s cubic-bezier(0.390, 0.575, 0.565, 1.000) both;
	        animation: scale-up-center 0.4s cubic-bezier(0.390, 0.575, 0.565, 1.000) both;
}

@-webkit-keyframes scale-up-center {
  0% {
    -webkit-transform: scale(0.5);
            transform: scale(0.5);
  }
  100% {
    -webkit-transform: scale(1);
            transform: scale(1);
  }
}
@keyframes scale-up-center {
  0% {
    -webkit-transform: scale(0.5);
            transform: scale(0.5);
  }
  100% {
    -webkit-transform: scale(1);
            transform: scale(1);
  }
}





/*** HOVER EFFECT  **********************************************************************/

.hexIn:hover h1,
.hexIn:focus h1,
.hexIn:hover p,
.hexIn:focus p {
    transform: translateY(0%) translatez(-1px);
}


/*** SPACING AND SIZING *****************************************************************/

@media (min-width:601px) {
    /* <- 2-3  hexagons per row */
    .hex {
        width: 32.666%;
        /* = (100-2) / 3 */
        padding-bottom: 37.720%;
        /* =  width / sin(60) */
    }
    .hex:nth-child(5n+1),
    .hex:nth-child(5n+2) {
        transform: translateX(50%) rotate(-60deg) skewY(30deg);
    }
    .hex:nth-child(5n+3),
    .hex:nth-child(5n+4),
    .hex:nth-child(5n+5) {
        margin-top: -8.564%;
        margin-bottom: -8.564%;
    }
    .hex:nth-child(5n+2),
    .hex:nth-child(5n+4) {
        margin-right: 1%;
        margin-left: 1%;
    }
    .hex:nth-child(5n+1) {
        margin-left: 0.5%;
    }
    .hex:nth-child(5n+3),
    .hex:nth-child(5n+6) {
        clear: left;
    }
}

@media (max-width: 600px) {
    /* <- 1-2  hexagons per row */
    .hex {
        width: 49.5%;
        /* = (100-1) / 2 */
        padding-bottom: 57.158%;
        /* =  width / sin(60) */
    }
    .hex:nth-child(3n+1) {
        transform: translateX(50%) rotate(-60deg) skewY(30deg);
    }
    .hex:nth-child(3n+2),
    .hex:nth-child(3n+3) {
        margin-top: -13.423%;
        margin-bottom: -13.423%;
    }
    .hex:nth-child(3n+1) {
        margin-left: 0.5%
    }
    .hex:nth-child(3n+3) {
        margin-left: 1%;
    }
    .hex:nth-child(3n+2),
    .hex:nth-child(3n+4) {
        clear: left;
    }


    .hexFront {
        z-index: 12;
        width: 100%;
        height: 100%;
        text-align: center;
        display: flex;
        justify-content: center;
        align-items: flex-start;
    }

    .hexFront i {
        font-size: 40px;
        line-height: 1em;
        display: block;
        position: absolute;
        top: 35px;
        /* margin-bottom: 50px; */
        color: black;
    }

    h3.hexTitle {
        font-size: 32px;
        font-weight: bolder!important;
        position: absolute;
        top: 86px;
        padding: 0px 1rem;
        line-height: 1.1em!important;
        color: black!important;
    }


}

@media (max-width: 400px) {
    #hexGrid {
        font-size: 13px;
    }
}


/* End Hexagons */


/* fork on github button */

#fork {
    font-family: 'Raleway', sans-serif;
    position: fixed;
    top: 0;
    left: 0;
    color: #000;
    text-decoration: none;
    border: 1px solid #000;
    padding: .5em .7em;
    margin: 1%;
    transition: color .5s;
    overflow: hidden;
}

#fork:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 130%;
    height: 100%;
    background: #000;
    z-index: -1;
    transform-origin: 0 0;
    transform: translateX(-100%) skewX(-45deg);
    transition: transform .5s;
}

#fork:hover {
    color: #fff;
}

#fork:hover:before {
    transform: translateX(0) skewX(-45deg);
}