@import url("https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap");

:root {
  --bg-color: rgba(0, 0, 0, 0.3);
  --btn-hover-color: rgba(0, 0, 0, 0.6);
  --hover-width: calc(75% + 100px);
  --non-hover-width: calc(25% + 100px);
  --speed: 0.3s;
}

* {
  box-sizing: border-box;
}

body {
  font-family: "Montserrat", sans-serif;
  height: 100vh;
  overflow: hidden;
  margin: 0;
}

h1 {
  font-size: 4rem;
  color: #fff;
  position: absolute;
  left: 50%;
  top: 20%;
  transform: translateX(-50%);
  white-space: nowrap;
}

.btn {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  left: 50%;
  top: 40%;
  transform: translateX(-50%);
  text-decoration: none;
  color: #fff;
  border: #fff solid;
  font-size: 1rem;
  font-weight: bold;
  text-transform: uppercase;
  width: 10rem;
  padding: 1.5rem;
}

.split .btn:hover {
  background-color: var(--btn-hover-color);
}

.container {
  position: relative;
  width: 100%;
  height: 100%;
  background: #333;
}

.split {
  position: absolute;
  width: calc(50% + 100px);
  height: 100%;
  overflow: hidden;
  color: #fff;
  transition: width var(--speed) ease-in-out;
}

.split.left {
  background: url("https://images.unsplash.com/photo-1542193810-9007c21cd37e?q=80&w=2940&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: 50% 50%;
  clip-path: polygon(0 0, 100% 0, calc(100% - 200px) 100%, 0 100%);
}

.split.right {
  right: 0;
  background: url("https://images.unsplash.com/photo-1542291026-7eec264c27ff?q=80&w=2940&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: 50% 50%;
  clip-path: polygon(200px 0, 100% 0, 100% 100%, 0 100%);
}

.split::before {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  background-color: var(--bg-color);
}

.hover-left .left {
  width: var(--hover-width);
}

.hover-left .right {
  width: var(--non-hover-width);
}

.hover-right .right {
  width: var(--hover-width);
}

.hover-right .left {
  width: var(--non-hover-width);
}

.attribution {
  color: #fff;
  position: absolute;
  bottom: 30px;
  font-weight: 300;
}
.left .attribution {
  left: 30px;
  margin-right: 30px;
}
.right .attribution {
  right: 30px;
  margin-left: 30px;
}

.attribution a {
  color: lightblue;
}

@media (max-width: 800px) {
  h1 {
    font-size: 2rem;
    top: 30%;
  }
  .btn {
    width: 8rem;
    padding: 1rem;
  }
}
