.grid {
    margin-top: 80px;
    width: 100%;
    display: table;
}

.grid figure {
    width: 33%;
}

.grid figure img {
    position: relative;
    display: block;
    margin: 0 auto;
}

.grid figure figcaption:before, .grid figure figcaption:after, .grid figure .border:before, .grid figure .border:after {
    pointer-events: none;
}

figure.border-animation {
    height: auto;
    min-height: 200px;
    padding: 10px;
    position: relative;
    float: left;
}

figure.border-animation {
    height: 255px;
    padding: 0;
}

figure.border-animation svg {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 0;
    right: 0;
    width: 80%;
}

figure.border-animation svg {
    width: 100%;
}

figure.border-animation:hover {
    z-index: 2;
}

figure.border-animation:nth-child(1), figure.border-animation:nth-child(4) {
    left: 0;
}

figure.border-animation:nth-child(1), figure.border-animation:nth-child(4) {
    left: 23px;
}

figure.border-animation:nth-child(3), figure.border-animation:nth-child(6) {
    left: 0;
}

figure.border-animation:nth-child(3), figure.border-animation:nth-child(6) {
    left: -23px;
}

figure.border-animation:nth-last-child(-n+3) {
    top: 0;
}

figure.border-animation:nth-last-child(-n+3) {
    top: -23px;
}

figure.border-animation figcaption:before, figure.border-animation .border:before {
    top: 10px;
    right: -5px;
    bottom: 10px;
    left: -5px;
    border-top: 0 none;
    border-bottom: 0 none;
}

figure.border-animation figcaption:before, figure.border-animation .border:before {
    border-top: 3px solid #ECECEC;
    border-bottom: 3px solid #ECECEC;
}

figure.border-animation figcaption:after, figure.border-animation .border:after {
    top: 0px;
    right: 10px;
    bottom: 0px;
    left: 10px;
}

figure.border-animation figcaption:after, figure.border-animation figcaption:before, figure.border-animation .border:after, figure.border-animation .border:before {
    position: absolute;
    content: '';
}

figure.border-animation figcaption:before {
    border-top: 0 none;
    border-bottom: 0 none;
}

figure.border-animation figcaption:before {
    border-top: 3px solid #fff;
    border-bottom: 3px solid #fff;
}

figure.border-animation figcaption:after {
    border-right: 0 none;
    border-left: 0 none;
}

figure.border-animation figcaption:after {
    border-right: 3px solid #fff;
    border-left: 3px solid #fff;
}

figure.border-animation figcaption:before, figure.border-animation figcaption:after {
    opacity: 1;
    transform: scale(1);
}

figure.border-animation .border:before {
    border-top: 3px solid #0A9037;
    border-bottom: 3px solid #0A9037;
    transform: scale(0, 1);
    transform-origin: 0 0;
    display: none;
}

figure.border-animation .border:before {
    display: block;
}

figure.border-animation .border:after {
    border-right: 3px solid #0A9037;
    border-left: 3px solid #0A9037;
    transform: scale(1, 0);
    transform-origin: 100% 0;
    display: none;
}

figure.border-animation .border:after {
    display: block;
}

figure.border-animation .border:after, figure.border-animation .border:before {
    position: absolute;
    content: '';
    opacity: 0;
}

.border::before, .border::after {
    transition: opacity 0.35s ease, transform 0.35s ease-in-out;
}

figure.border-animation:hover .border::after, figure.border-animation:hover .border::before {
    opacity: 1;
    transform: scale(1);
}

figure svg {
    transition: fill 0.225s ease;
}

figure:hover svg {
    fill: #0A9037;
}

.image-brand {
    position: absolute;
    left: 0;
    top: 50%;
    right: 0;
    margin: 0 auto;
    width: 80%;
    bottom: 50%;
    -webkit-transform: translateY(-50%);
    -moz-transform: translateY(-50%);
    -ms-transform: translateY(-50%);
    -o-transform: translateY(-50%);
    transform: translateY(-50%);
    display: block;
    text-align: center;
    height: 40px;
    overflow: hidden;
    animation: brandIn 0.5s;
    -moz-animation: brandIn 0.5s;
    -webkit-animation: brandIn 0.5s;
    -o-animation: brandIn 0.5s;
}

.image-brand img {
    max-width: 100%;
}

.image-brand p {
    font-size: 16px;
    color: #555;
    margin-top: 15px;
    height: 45px;
    overflow: hidden;
}

.image-brand button {
    background: #0A9037;
    color: #fff;
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 2px 20px;
}

.image-brand button:hover {
    color: #fff;
}

figure.border-animation:hover .image-brand {
    height: 130px;
    animation: brandOut 0.5s;
    -moz-animation: brandOut 0.5s;
    -webkit-animation: brandOut 0.5s;
    -o-animation: brandOut 0.5s;
}

@media (max-width: 768px) {
    .grid figure {
        width: 100%;
    }

    figure.border-animation:nth-child(1), figure.border-animation:nth-child(4), figure.border-animation:nth-child(3), figure.border-animation:nth-child(6) {
        left: 0;
    }
}

@keyframes brandIn {
    0% {
        height: 130px;
    }

    100% {
        height: 40px;
    }
}

@-moz-keyframes brandIn {
    0% {
        height: 130px;
    }

    100% {
        height: 40px;
    }
}

@-webkit-keyframes brandIn {
    0% {
        height: 130px;
    }

    100% {
        height: 40px;
    }
}

@-o-keyframes brandIn {
    0% {
        height: 130px;
    }

    100% {
        height: 40px;
    }
}

@keyframes brandOut {
    0% {
        height: 40px;
    }

    100% {
        height: 130px;
    }
}

@-moz-keyframes brandOut {
    0% {
        height: 40px;
    }

    100% {
        height: 130px;
    }
}

@-webkit-keyframes brandOut {
    0% {
        height: 40px;
    }

    100% {
        height: 130px;
    }
}

@-o-keyframes brandOut {
    0% {
        height: 40px;
    }

    100% {
        height: 130px;
    }
}

