* {
  box-sizing: border-box;
}

body {
  width: 100%;
  height: 100%;
  overflow: hidden;;
  font-family: "Georgia", serif;
  font-size: 16px;
  line-height: 1.4;
  background-color: black;
}

main {
  display: flex;
  flex-direction: column;
  width: 160%;
  transform: translate3d(0, 0, 0);
}
@media (min-width: 630px) {
  main {
    flex-direction: row;
    width: 160%;
    margin-left: -30%;
  }
}
main section:not(:first-child):not(:last-child):hover {
  flex: 3;
}
main section:not(:first-child):not(:last-child):hover img{ width: 110%; margin-left: -10%; margin-top: -10%;}
main section:not(:first-child):not(:last-child):hover:after {
  /*opacity: 0.3;*/
}
main section:not(:first-child):not(:last-child):hover article {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.2s 0.2s, transform 0.2s 0.2s;
  /*background-attachment: fixed; background: url(../images/test2.jpg) no-repeat center center; background-size: 100%;*/
}
@media (min-width: 630px) {
  main section:not(:first-child):not(:last-child):hover article {
    transform: translateY(0) skewX(45deg);
  }
}

section {
  flex: 1;
  position: relative;
  width: 100%;
  min-height: 20vh;
  overflow: hidden;
  z-index: 1;
  transition: flex-grow 0.2s, opacity 0.2s;
}
section img{ transform: skewX(45deg); width: 200%; margin-left: -55%; margin-top: -20%;}
section:before {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  background-position: center;
  background-size: cover;
  transition: transform 0.2s, width 0.2s;
}
section:after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: black;
  opacity: 0;
  transition: opacity 0.2s;
}
@media (min-width: 630px) {
  section {
    width: 33.3%;
    height: 100vh;
    margin-right: -1px;
    transform: skewX(-45deg) translateZ(0);
  }
  section:before {
    left: -100%;
    width: 400%;
    transform: skewX(45deg);
  }
}
section:nth-child(1):before {
  background-color: #e60000;
  background-image: url(../images/test1.jpg);
}
.hide-images section:nth-child(1):before {
  background-image: none;
}
section:first-child:before, section:last-child:before {
  background-color: #660000;
}
section:first-child:after, section:last-child:after {
  opacity: 0.5;
}
section:first-child article, section:last-child article {
  display: none;
}
section:nth-child(2):before {
  /*background-color: #cc0000;*/
  /*background-attachment: fixed; background: url(../images/test2.jpg) no-repeat center center; background-size: 100%; background-position-x: 0;*/
}
.hide-images section:nth-child(2):before {
  background-image: none;
}
section:first-child:before, section:last-child:before {
  background-color: #660000;
}
section:first-child:after, section:last-child:after {
  opacity: 0.5;
}
section:first-child article, section:last-child article {
  display: none;
}
section:nth-child(3):before {
  background-color: #b30000;

}
.hide-images section:nth-child(3):before {
  background-image: none;
}
section:first-child:before, section:last-child:before {
  background-color: #660000;
}
section:first-child:after, section:last-child:after {
  opacity: 0.5;
}
section:first-child article, section:last-child article {
  display: none;
}
section:nth-child(4):before {
  background-color: #990000;
  background-image: url(../images/bg-section--4.jpg);
}
.hide-images section:nth-child(4):before {
  background-image: none;
}
section:first-child:before, section:last-child:before {
  background-color: #660000;
}
section:first-child:after, section:last-child:after {
  opacity: 0.5;
}
section:first-child article, section:last-child article {
  display: none;
}
section:nth-child(5):before {
  background-color: maroon;
  background-image: url(../images/bg-section--5.jpg);
}
.hide-images section:nth-child(5):before {
  background-image: none;
}
section:first-child:before, section:last-child:before {
  background-color: #660000;
}
section:first-child:after, section:last-child:after {
  opacity: 0.5;
}
section:first-child article, section:last-child article {
  display: none;
}

article {
  position: relative;
  padding: 24px;
  width: 100%;
  height: 100%;
  text-align: center;
  color: white;
  z-index: 1;
  transition: opacity 0.2s, transform 0.2s;
}
@media (min-width: 630px) {
  article {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    margin: auto;
    opacity: 0;
    transform: translateY(45px) skewX(45deg);
  }
}

h2 {
  font-size: 32px;
  margin-bottom: 12px;
}

button {
  position: fixed;
  top: 12px;
  left: 12px;
  padding: 8px 12px;
  font-size: 10px;
  text-transform: uppercase;
  color: white;
  background-color: black;
  border: none;
  outline: none;
  cursor: pointer;
}



@keyframes myfirst
{
  0%   {left: 0}
  100% {left: 20%}
}

@-webkit-keyframes myfirst2 /* Safari and Chrome */
{
  0%   {left: 0}
  100% {left: 20%}
}



@keyframes myfirst2
{
  0%   {left: 0}
  100% {left: -20%}
}

@-webkit-keyframes myfirst /* Safari and Chrome */
{
  0%   {left: 0}
  100% {left: -20%}
}