@charset 'utf-8';
@import 'compass/reset';
@import url('https://fonts.googleapis.com/css?family=Bree+Serif');
@import url('https://fonts.googleapis.com/css?family=Open+Sans:300');

$white      : #ecf0f1;
$black      : #1f1f1f;
$lightGray  : #cfcfcf;
$red        : #e74c3c;
$blue       : #2c3e50;
$green      : #27ae60;

$baseDuration: .45s;
$fastDuration: $baseDuration / 2;
$slowDuration: $baseDuration * 2;

$lineHeight: 1.4rem;
$basePadding: $lineHeight;

html,
body,
main {
    height: 100%;
    width: 100%;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
}

body {
    font-size: 1em;
    line-height: $lineHeight;
    color: $white;
    background-color: $blue;
    font-family: 'Open Sans', sans-serif;
}

.accessible-hide {
    position: absolute;
    height: 0;
    width: 0;
    overflow: hidden;
}

.flexy-center {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.svg-icon {
    width: 1em;
    height: 1em;
    fill: $white;
    &amp;:nth-of-type(1) {
        transform: translate(-.55em);
    }
    &amp;:nth-of-type(2) {
        transform: translate(.55em);
    }
}

.button {
    padding: ($lineHeight / 2) $lineHeight;
    border-radius: .2em;
    background-color: $green;
    margin: 0 $lineHeight;
    transition: all $fastDuration ease-in-out;
    cursor: pointer;
    &amp;__container {
        display: flex;
    }
    &amp;--disabled {
        pointer-events: none;
        opacity: .2;
    }
}

$itemWidth: .7em;
$boxWidth : 3em;
$containerWidth: 5em;
$totalDuration: $slowDuration;
$queryDelay: ($totalDuration * 70) / 100;
$queryDuration: $totalDuration - $queryDelay;
$responseDelay: ($totalDuration * 95) / 100;

.container {
    font-size: 3em;

    height: .45em;

    width: $containerWidth;
    margin-top: ($lineHeight * 5);
    perspective: 1200px;

    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    background-image: radial-gradient($white .015em, transparent .02em);
    background-size: .25em .25em;
    background-repeat: repeat-x;
    background-position: 0 bottom;
    transition: all ($slowDuration * 3) ease-in-out;

    &amp;__title {
        margin-top: 1em;
        font-size: 2em;
        opacity: 0;
        transition: opacity $fastDuration ease-in-out;
        &amp;--anim {
            opacity: 1;
        }
    }
    &amp;__anim {
        background-position: 200% bottom;
    }
    &amp;:before {
        content: '';
        height: 1em;
        width: calc(100% + .15em);
        position: absolute;
        left: -.075em;
        bottom: -.48em;
        box-sizing: border-box;
        padding-bottom: .25em;
        border-radius: 0 0 .25em .25em;

        border: .05em solid white;
        border-bottom-color: transparent;
        border-top-color: transparent;

        transform-style: preserve-3d;
        transform-origin: 50% 0;
        transform: rotateX(63deg);
    }
    &amp;__jump {
        .response {
            animation: responseMove ($slowDuration * 1.25) ease-out forwards;
            .item {
                opacity: 1;
                animation: $slowDuration linear forwards;
                animation-delay: $fastDuration / 2;
                &amp;:nth-child(1) {
                    animation-name: jump4;
                }
                &amp;:nth-child(2) {
                    animation-name: jump0;
                }
                &amp;:nth-child(3) {
                    animation-name: jump3;
                }
            }
            .sparks {
                transform: scale(2);
                opacity: 0;
                background-color: $red;
            }
        }
        .server {
            fill: $red;
        }
        background-image: radial-gradient($red .015em, transparent .02em);
        &amp;:before {
            border-right-color: $red;
        }
    }
    .svg-icon {
        position: absolute;
        bottom: 100%;
        &amp;:nth-of-type(1) {
            left: 0;
        }
        &amp;:nth-of-type(2) {
            right: 0;
        }
    }
}


.response {
    position: absolute;
    right: -.5em;
    top: -1em;
    .item {
        opacity: 0;
        line-height: 1em;
        font-family: 'Bree Serif', serif;
    }
}

.sparks {
    width: 1em;
    height: 1em;
    border-radius: 1em;
    background-color: white;
    transform: scale(0);
    transition: all $fastDuration ease-out;
}

.item {
    top: 0;
    right: 0;
    position: absolute;
    width: $itemWidth;
    z-index: 2;
    text-align: center;
    transition: all $baseDuration ease-out;
    display: flex;
    align-items: center;
    line-height: .87em;
    justify-content: center;
}

@keyframes responseMove {
    100% {
        transform: translate(-2.5em, .7em) scale(1.5);
    }
}

@keyframes jump4 {
    0% {
        transform: translateY(0) translateX(0) rotate(0);
        animation-timing-function: ease-out;
    }
    50% {
        transform: translateY(-3em) translateX(-.35em) rotate(-340deg);
        animation-timing-function: ease-in;
    }
    70% {
        transform: translateY(0) translateX(-.45em) rotate(-360deg);
        animation-timing-function: ease-out;
    }
    80% {
        transform: translateY(-1em) translateX(-.55em) rotate(-360deg);
        animation-timing-function: ease-in;
    }
    90%,
    100% {
        transform: translateY(0) translateX(-.65em) rotate(-360deg);
        animation-timing-function: ease-out;
        color: $red
    }
}
@keyframes jump0 {
    0% {
        transform: translateY(0) translateX(0) rotate(0);
        animation-timing-function: ease-out;
    }
    50% {
        transform: translateY(-2em) translateX(-.1em) rotate(-700deg);
        animation-timing-function: ease-in;
    }
    70% {
        transform: translateY(0) translateX(-.1em) rotate(-720deg);
        animation-timing-function: ease-out;
    }
    80% {
        transform: translateY(-.5em) translateX(-.1em) rotate(-720deg);
        animation-timing-function: ease-in;
    }
    90%,
    100% {
        transform: translateY(0) translateX(-.1em) rotate(-720deg);
        animation-timing-function: ease-out;
        color: $red
    }
}
@keyframes jump3 {
    0% {
        transform: translateY(0) translateX(0) rotate(0);
        animation-timing-function: ease-out;
    }
    50% {
        transform: translateY(-3em) translateX(.1em) rotate(-340deg);
        animation-timing-function: ease-in;
    }
    70% {
        transform: translateY(0) translateX(.2em) rotate(-360deg);
        animation-timing-function: ease-out;
    }
    80% {
        transform: translateY(-1em) translateX(.3em) rotate(-360deg);
        animation-timing-function: ease-in;
    }
    90%,
    100% {
        transform: translateY(0) translateX(.4em) rotate(-360deg);
        animation-timing-function: ease-out;
        color: $red
    }
}