:root {
    --block-width: 14px;
}

@keyframes in-move {
    from {
        transform: translateX(1024px);
    }
    to {
        transform: none;
    }
}

@keyframes in-fade {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes out-move {
    from {
        transform: none;
    }
    to {
        transform: translateX(-1024px);
    }
}

@keyframes out-fade {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.row {
    display: grid;
}

.block {
    grid-row: 1;
    grid-column: 1;
    position: relative;
    max-width: fit-content;
    margin-left: auto;
    margin-right: auto;
    margin-top: 30px;
    margin-bottom: 30px;
    display: grid;
    grid-template-columns: var(--block-width) max-content;
    grid-template-rows: var(--block-width) 0px max-content 0px;
}

.front:empty::before {
    content: "\200b";
}

.anim1 {
    animation: 2s linear 0s 1 normal forwards running in-move,
               0.5s linear 0s 1 normal forwards running in-fade,
               2s linear 5s 1 normal forwards running out-move,
               0.5s linear 6.5s 1 normal forwards running out-fade;
}

.anim2 {
    animation: 2s linear 5s 1 normal forwards running in-move,
               0.5s linear 5s 1 normal forwards running in-fade,
               2s linear 8s 1 normal forwards running out-move,
               0.5s linear 9.5s 1 normal forwards running out-fade;
}

.front {
    color: white;
    grid-column: 2;
    grid-row: 3;
    background-color: #ffe000; 
    padding-right: 20px;
    padding-bottom: 4px;
    padding-left: 20px;
    text-shadow: -2px 2px 2px rgba(0, 0, 0, 0.5);
}

.side {
    grid-column: 1;
    grid-row: 3;
    background-color: #e8a000;
    transform: skew(0, 45deg) translateY(calc(-1 * var(--block-width) / 2));
}

.edge {
    grid-column: 2;
    grid-row: 2;
    height: 1px;
    transform: translateY(-0.5px);
    background-color: #fff880;
}

.top {
    grid-column: 2;
    grid-row: 1;
    background-color: #ffe880;
    transform: skew(45deg) translateX(calc(-1 * var(--block-width) / 2));
}

.shadow1 {
    grid-column-start: 1;
    grid-column-end: 3;
    grid-row: 4;
    background-color: #a6a6a6;
    height: calc(2 * var(--block-width));
    transform: translateY(calc(-1 * var(--block-width))) translateX(calc(-1 * var(--block-width))) skew(-45deg);
    z-index: -1;
}

.shadow2 {
    grid-column: 2;
    grid-row: 4;
    background-color: #a6a6a6;
    height: calc(1 * var(--block-width));
    transform: translateX(calc(-0.5 * var(--block-width))) skew(-45deg);
    z-index: -1;
}

body {
    overflow: hidden;
    font-size: 40px;
}
