@import url("https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Space Mono", monospace;
  height: 100vh;
  background-color: #030b0d;
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
}

img {
  width: 100%;
  height: 100%;
  display: block;
}

.grid {
  width: min-content;
  display: grid;
  grid-template-columns: repeat(3, 300px);
  grid-auto-rows: 300px;
  gap: 1rem;
}

.card {
  aspect-ratio: 1;
  background-size: cover;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 0.5rem;
  padding: 0.5rem;
  position: relative;
  cursor: pointer;
  overflow: hidden;
}

.card-img {
  position: absolute;
  z-index: -1;
  object-fit: cover;
  transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.card:hover .card-img {
  scale: 0.85;
  filter: brightness(0.65);
}

.card-box {
  padding: 0.8rem;
  background-color: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(5px);
  transition: 0.5s cubic-bezier(0.19, 1, 0.22, 1);
  position: relative;
  z-index: 2;
  opacity: 0;
  display: flex;
  flex-direction: column;
}

/* Positioning the Boxes inside the card */
.box-1 {
  grid-column: 1 / 2;
  grid-row: 1 / 2;
  justify-content: flex-end;
}
.box-2 {
  grid-column: 2 / 2;
  grid-row: 1 / 2;
  align-items: flex-end;
}
.box-3 {
  grid-column: 1 / 2;
  grid-row: 2 / 2;
  justify-content: flex-end;
}
.box-4 {
  grid-column: 2 / 3;
  grid-row: 2 / 3;
  justify-content: flex-end;
  align-items: flex-end;
}

/* Offsetting the Boxes */
.top-left {
  transform: translate(-105%, -105%);
}
.top-right {
  transform: translate(105%, -105%);
}
.bottom-right {
  transform: translate(105%, 105%);
}
.bottom-left {
  transform: translate(-105%, 105%);
}

.card:hover .card-box {
  opacity: 1;
  transform: translate(0, 0);
}

/* Styling the Content inside box */
.card-box > p {
  font-size: 10px;
  text-transform: uppercase;
  font-weight: bold;
  opacity: 0.85;
}
