﻿
.box {
  display: inline-block;
  float: left;
  width: 160px;
  position: relative;
  height: 160px;
  border: 1px solid #000;
  z-index: 0;
  transition: all .3s ease;
  opacity: 1;
  margin-right: -1px; }
  .box:hover {
    z-index: 10; }
  .box:before, .box:after {
    content: "";
    display: block;
    position: absolute;
    background: pink;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-iteration-count: 1;
    transform-origin: 50% 50%;
    opacity: 1; }
  .box:before {
    width: calc(100% + 2px);
    height: 100%;
    z-index: 1;
    transition: height 1s ease, opacity .8s ease; }
  .box:after {
    height: calc(100% + 2px);
    width: 100%;
    z-index: 1;
    transition: width 1s ease, opacity .8s ease; }
  .box:hover:before, .box:focus:before {
    transition: height .2s ease, opacity .3s ease;
    height: 85%;
    opacity: .7; }
  .box:hover:after, .box:focus:after {
    transition: width .2s ease, opacity .3s ease;
    width: 85%;
    opacity: .8; }
  .box__image {
    fill: #000;
    width: 60%;
    will-change: width;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    transition: all .5s ease;
    z-index: 2; }
