:root {
  --background-color: rgb(255, 255, 255);
  --background-color-transperent: rgba(255, 255, 255, 0.5);
  --font-color: #000000;
  --hover-color: rgb(126, 0, 199);
  --design-color: rgb(11, 24, 200);
}

#hexGrid {
    display: flex;
    flex-wrap: wrap;
    width: 90%;
    margin: 0 auto;
    overflow: hidden;
    list-style-type: none;
    margin-top: 30px;
    margin-bottom: 30px;
  }
  .hex {
    position: relative;
    visibility:hidden;
    outline:1px solid transparent; /* fix for jagged edges in FF on hover transition */
    transition: all 0.5s;
    backface-visibility: hidden;
    will-change: transform;
    transition: all 0.5s;
  }
  .hex::after{
    content:'';
    display:block;
    padding-bottom: 86.602%;  /* =  100 / tan(60) * 1.5 */
  }
  .hexIn{
    position: absolute;
    width:96%;
    padding-bottom: 110.851%; /* =  width / sin(60) */
    margin: 2%;
    overflow: hidden;
    visibility: hidden;
    outline:1px solid transparent; /* fix for jagged edges in FF on hover transition */
    -webkit-transform: rotate3d(0,0,1,-60deg) skewY(30deg);
        -ms-transform: rotate3d(0,0,1,-60deg) skewY(30deg);
            transform: rotate3d(0,0,1,-60deg) skewY(30deg);
      transition: all 0.5s;
  }
  .hexIn * {
    position: absolute;
    visibility: visible;
    outline:1px solid transparent; /* fix for jagged edges in FF on hover transition */
  }
  .hexInner {
      display:block;
      width: 100%;
      height: 100%;
      text-align: center;
      color: #fff;
      overflow: hidden;
      -webkit-transform: skewY(-30deg) rotate3d(0,0,1,60deg);
          -ms-transform: skewY(-30deg) rotate3d(0,0,1,60deg);
              transform: skewY(-30deg) rotate3d(0,0,1,60deg);
  }
  
  
  /*** HEX CONTENT **********************************************************************/
  .hex img {
    left: -100%;
    right: -100%;
    width: auto;
    height: 100%;
    margin: 0 auto;
  }
  
  .hex video {
  position: absolute;
  left: -100%;
  right: -100%;
  width: auto;
  height: 100%;
  margin: 0 auto;
  }
  
  .hex h1 {
    width: 100%;
    padding: 5%;
    box-sizing: border-box;
    font-weight: 200;
    opacity: 0;
    font-family: "Lobster", sans-serif;
  }
  
  #demo1 {
    color: white;
    text-align: center;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    font-size: 2rem;
    z-index: 1;
  }
  
  .img {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    -webkit-clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  }

  .img img,
  .img video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
  
  .img:before, .img:after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    content: '';
    opacity: 0;
    transition: opacity 0.5s;
  }
  .img:before {
    background: rgba(22, 103, 137, 0.3)
  }
  .img:after {
    background: linear-gradient(to top, transparent, rgba(0, 0, 0, 0.5), transparent);
  }
  /*** HOVER EFFECT  **********************************************************************/
  
  
  
  .hexInner:hover h1, .hexInner:focus h1,
  .hexInner:hover p, .hexInner:focus p{
  opacity:1;
  transition: 0.8s;
  }
  
  
  .hexIn:hover .img:before,
  .hexIn:hover .img:after,
  .hexIn:hover .hexInner {
    opacity: 1;
    cursor: pointer;
  }

  .hexIn:hover img{
    transform: scale(1.2);
    transition: 1s;
  }

/*design the modal*/
  .modal {
    background-color: rgba(0, 0, 0, 0.8);
    position: fixed;
    top: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    transition: 0.5s;
    z-index: 5;
  }
  .modal.open{
    opacity: 1;
    pointer-events: all;
  }
  .full-img{
    position: absolute;
    max-height: 80%;
    max-width: 80%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -60%) scale(1);
    transition: all 0.25s ease-out;
  }
  .full-img.open{
    transform: translate(-50%, -60%) scale(1);
  }
  .modal p{
    color: white;
    font-size: 2.5rem;
    font-family: "Lobster", sans-serif;
    position: absolute;
    bottom: 5%;
    left: 50%;
    transform: translate(-50%, -10%);
    text-align: center;
  }


  /*** HEXAGON SIZING AND EVEN ROW INDENTATION *****************************************************************/
  @media (min-width:1201px) { /* <- 5-4  hexagons per row */
    #hexGrid{
      padding-bottom: 6%
    }
    .hex {
      width: 20%; /* = 100 / 5 */
    }
    .hex:nth-child(9n+1){ /* first hexagon of even rows */
      margin-left:10%;  /* = width of .hex / 2  to indent even rows */
    }
  }
  
  @media (max-width: 1200px) and (min-width:901px) { /* <- 4-3  hexagons per row */
    #hexGrid{
      padding-bottom: 7%;
    }
    #demo1 {
      font-size: 1.5rem;
    }
    .hex {
      width: 25%; /* = 100 / 4 */
    }
    .hex:nth-child(7n+5){ /* first hexagon of even rows */
      margin-left:12.5%;  /* = width of .hex / 2  to indent even rows */
    }
  }
  
  @media (max-width: 900px) and (min-width:601px) { /* <- 3-2  hexagons per row */
    #hexGrid{
      padding-bottom: 9%;
    }
    #demo1 {
      font-size: 1.3rem;
    }
    .hex {
      width: 33.333%; /* = 100 / 3 */
    }
    .hex:nth-child(5n+4){ /* first hexagon of even rows */
      margin-left:16.666%;  /* = width of .hex / 2  to indent even rows */
    }
  }
  
  @media (max-width: 600px) { /* <- 2-1  hexagons per row */
    #hexGrid{
      padding-bottom: 14%;
    }
    #demo1 {
      font-size: 1.2rem;
    }
    .hex {
      width: 50%; /* = 100 / 3 */
    }
    .hex:nth-child(3n+1){ /* first hexagon of even rows */
      margin-left:25%;  /* = width of .hex / 2  to indent even rows */
    }
    .modal p {
      font-size: 1.5rem;
      bottom: 15%;
    }
  }
  
  