* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Montserrat', sans-serif;
}

body {
  display: flex;
  justify-content: center;
  min-height: 100vh;
  align-items: center;
  background-color: black;
}

h1 {
  text-transform: uppercase;
  text-align: center;
  color: white;
  font-size: 40px;
  font-weight: 300;
  margin-top: 20px;
  margin-bottom: 10px;
  letter-spacing: 2px;
  word-spacing: 5px;
  font-family: 'Montserrat', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
}

#relative {
  position: relative;
  color: white;
  margin-left: -150px;
}

.heading {
  color: #fff;
  text-align: center;
  text-transform: uppercase;
  font-size: 2em;
  margin: 2em 0;
}

.images {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-gap: 1em;
  margin: 0 1em;
}

.images img {
  width: 100%;
  cursor: pointer;
  transition: 0.3s all ease;
}

.images img:hover {
  transform: scale(0.9);
}

.modal {
  position: fixed;
  height: 100%;
  width: 100%;
  top: 0;
  left: 0;
  background-color: rgba(0, 0, 0, 0.7);
  color: #fff;
  z-index: 1;
  overflow: auto;
  opacity: 0;
  pointer-events: none;
}

.modalContent {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.modalImg {
  width: 80%;
  max-width: 1000px;
}

.modalTxt {
  margin-top: 1em;
}

.modalNav {
  margin-top: 1em;
}

.modalNav button {
  padding: 10px 45px;
  border: 1px solid #fff;
  background: none;
  color: #fff;
  outline: none;
  cursor: pointer;
}

.nextBtn {
  margin-left: 1em;
}

.close {
  position: absolute;
  color: #fff;
  top: 1em;
  right: 1.5em;
  font-size: 1.5em;
  cursor: pointer;
}

.modal.appear {
  opacity: 1;
  pointer-events: all;
}

.modal.appear .modalImg,
.modal.appear .modalTxt {
  animation: zoom 0.3s linear;
}

@keyframes zoom {
  from {
    transform: scale(0);
  }

  to {
    transform: scale(1);
  }
}

@media screen and (max-width: 767px) {
  h1 {
    font-size: 40px;
  }

  #relative {
    position: relative;
    color: white;
    margin-left: -40px;
  }

  
  .images {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-gap: 1em;
    margin: 0 1em;
  }
}

@media screen and (max-width: 430px){
.images {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  grid-gap: 1em;
  margin: 0 1em;
}
}