.frame {


  width: 370px;
  height: 550px;
  border-radius: 2px;
  background-color: black;
  box-shadow:
    1px 2px 8px 0px rgba(0, 0, 0, 0.5),
    0 0 1px #999 inset;
  overflow: hidden;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 118px);
  gap: 4px;
  margin: 0;
  padding: 4px;
  list-style: none;
}

.picture {
  position: relative;
  width: 118px;
  height: 178px;
  cursor: pointer;
  background-color: #000;
  animation: small 0.5s ease-in-out both;
}

.picture.active {
  animation: big 0.5s ease-in-out both;
}

.picture__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.5s ease-in-out;
}

.picture.away .picture__image {
  opacity: 0;
}

@keyframes big {
  0%,
  1% {
    transform: scale(1);
    z-index: 2;
  }
  100% {
    z-index: 2;
    transform: scale(3.0625);
  }
}

@keyframes small {
  0% {
    transform: scale(3.0625);
    z-index: 2;
  }
  99% {
    z-index: 2;
    transform: scale(1);
  }
  100% {
    z-index: 1;
  }
}

.pic-1 {
  transform-origin: 0% 0%;
}

.pic-2 {
  transform-origin: 50% 0%;
}

.pic-3 {
  transform-origin: 100% 0%;
}

.pic-4 {
  transform-origin: 0% 50%;
}

.pic-5 {
  transform-origin: 50% 50%;
}

.pic-6 {
  transform-origin: 100% 50%;
}

.pic-7 {
  transform-origin: 0% 100%;
}

.pic-8 {
  transform-origin: 50% 100%;
}

.pic-9 {
  transform-origin: 100% 100%;
}

video {
    position: fixed; right: 0; bottom: 0;
    min-width: 100%; min-height: 100%;
    width: auto; height: 178; z-index: -100;

    background-size: cover;
}
