* {
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  width: 100%;
  background-color: black;
}

body {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
}

h2 {
  color: white;
  margin: 0;
}

main {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: repeat(3, calc(100% / 3));
  grid-template-columns: repeat(4, 1fr);
  grid-template-areas: 
  "a a f b" 
  "a a f c" "d e f c";
}

@media (max-width: 30rem) {
  main {
    display: inline-block;
  }
  section {
    min-height: 40%;
  }
}

@media (min-width: 30.1rem) and (max-width: 40rem) {
  main {
    grid-template-rows: repeat(4, 1fr);
    grid-template-areas: 
    "e e c c"
    "a a a a"
    "d d f f"
    "d d b b";
  }
}

@media (min-width: 40.1rem) and (max-width: 60rem) {
  main {
    grid-template-rows: repeat(4, 1fr);
    grid-template-areas:
     "e e b b"
     "f a a c" 
     "d a a c"  
     "d a a c"
  }
}

@media (min-width: 60.1rem) and (max-width: 70rem) {
  main {
    grid-template-rows: repeat(4, 1fr);
    grid-template-areas:
     "c a a b" 
     "c a a d" 
     "c e e d"
     "f e e d";
  }
}

section {
  background-color: red;
}

img {
  width: 100%;
  max-height: 100%;
  height: 100%;
  object-fit: cover;
}

section:nth-child(1) {
  background-image: var(--bg-image);
  background-size: cover;
  grid-area: a;
}

section:nth-child(2) {
  grid-area: b;
  background-image: var(--bg-image);
  background-size: cover;
}

section:nth-child(3) {
  grid-area: c;
  background-image: var(--bg-image);
  background-size: cover;
}

section:nth-child(4) {
  grid-area: d;
  background-image: var(--bg-image);
  background-size: cover;
}

section:nth-child(5) {
  grid-area: e;
  background-image: var(--bg-image);
  background-size: cover;
}

section:nth-child(6) {
  grid-area: f;
  background-image: var(--bg-image);
  background-size: cover;
}

.center {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

h2 {
  text-align: center;
  padding: 1rem;
  background-color: #00000069;
  margin: 1rem;
}
section{
  transition: all .3s ease;
}
section:hover{
  filter: grayscale(40%);
  background-position:50% 50%;
}