/* ==========================================================================
   Animated Room Styles
   Scoped to prevent global keyframe and layout conflicts
   ========================================================================== */

@import url('https://fonts.googleapis.com/css?family=Indie+Flower');

/* ==========================================================================
   Room Wrapper and Alignment
   ========================================================================== */

.about-img-holder {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 0;
    margin: 0 auto 30px;
    box-sizing: border-box;
}

.room-scaler {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    box-sizing: border-box;
}

.room {
    position: relative;
    display: block;
    width: 100%;
    max-width: 500px;
    height: 430px;
    overflow: hidden;
    margin: 0 auto;
    box-sizing: border-box;
    background-color: #73627d;
    background-image:
        repeating-linear-gradient(
            120deg,
            rgba(255,255,255,.1),
            rgba(255,255,255,.1) 1px,
            transparent 1px,
            transparent 60px
        ),
        repeating-linear-gradient(
            60deg,
            rgba(255,255,255,.1),
            rgba(255,255,255,.1) 1px,
            transparent 1px,
            transparent 60px
        ),
        linear-gradient(
            60deg,
            rgba(0,0,0,.1) 25%,
            transparent 25%,
            transparent 75%,
            rgba(0,0,0,.1) 75%,
            rgba(0,0,0,.1)
        ),
        linear-gradient(
            120deg,
            rgba(0,0,0,.1) 25%,
            transparent 25%,
            transparent 75%,
            rgba(0,0,0,.1) 75%,
            rgba(0,0,0,.1)
        );
    background-size: 20px 25px;
    border-radius: 7px;
}

.room:before {
    content: '';
    display: block;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 280px;
    background: #333;
}

/* ==========================================================================
   Common Room Elements
   ========================================================================== */

.room * {
    border-radius: 7px;
    background: #000;
    position: absolute;
    box-sizing: content-box;
}

/* ==========================================================================
   Window and Outside Light
   ========================================================================== */

.room .window {
    overflow: hidden;
    height: 100px;
    width: 100px;
    right: 100px;
    top: 80px;
    background: #76c2ff;
    animation: room_outsidelight 12s linear infinite;
    border: 1vmin solid #000;
    border-radius: 0;
}

@keyframes room_outsidelight {
    0% {
        background: #3F51B5;
    }

    45% {
        background: #3F51B5;
    }

    50% {
        background: #76c2ff;
    }

    95% {
        background: #76c2ff;
    }

    100% {
        background: #3F51B5;
    }
}

.room .outside {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: transparent;
    animation: room_sunmoon 12s linear infinite;
    position: absolute;
}

@keyframes room_sunmoon {
    0% {
        left: -30px;
        top: -30px;
        box-shadow: inset -1vmin -1vmin #fff;
    }

    50% {
        left: 120px;
        top: 120px;
        box-shadow: inset 0vmin -1vmin #fff;
    }

    50.001% {
        left: -30px;
        top: -30px;
        box-shadow:
            inset 0vmin 0vmin 0vmin 5vmin #fff,
            0vmin 0vmin 3vmin #fff;
    }

    100% {
        left: 120px;
        top: 120px;
        box-shadow:
            inset 0vmin 0vmin 0vmin 5vmin #fff,
            0vmin 0vmin 3vmin #fff;
    }
}

.room .window:after {
    z-index: 1;
    content: '';
    position: absolute;
    width: 5px;
    height: 105px;
    background: #000;
    left: 48px;
    top: 0;
}

.room .window:before {
    z-index: 1;
    content: '';
    position: absolute;
    width: 100px;
    height: 5px;
    background: #000;
    left: 0;
    top: 50px;
}

/* ==========================================================================
   Programmer Character
   ========================================================================== */

.room .hand {
    height: 42px;
    width: 15.5px;
    left: 121px;
    top: 189px;
    border-radius: 10.5px;
    transform: rotate(30deg);
}

.room .hand:after,
.room .hand:before {
    content: '';
    display: block;
    position: absolute;
    background: #000;
    border-radius: 5px;
    top: 34px;
    right: 0;
    width: 13px;
    height: 37px;
    transform: rotate(60deg);
    animation: room_typing 0.1s linear infinite;
    transform-origin: top;
}

.room .hand:before {
    animation: room_typing 0.5s linear infinite 0.25s;
}

@keyframes room_typing {
    50% {
        transform: rotate(80deg);
    }
}

.room .body {
    height: 79px;
    width: 26px;
    left: 139px;
    top: 181px;
    border-radius: 18px;
    transform: rotate(-19deg);
}

.room .leg {
    height: 52px;
    width: 18px;
    left: 137px;
    top: 226px;
    border-radius: 10px;
    transform: rotate(67deg);
}

.room .leg:after,
.room .leg:before {
    content: '';
    display: block;
    position: absolute;
    background: #000;
    border-radius: 5px;
    top: 34px;
    right: -10px;
    width: 15px;
    height: 55px;
    transform: rotate(-35deg);
}

.room .head {
    height: 30px;
    width: 30px;
    left: 115px;
    top: 155px;
    border-radius: 50%;
}

.room .head:after,
.room .head:before {
    z-index: 1;
    content: '';
    display: block;
    border-radius: 15px;
    background: #fff;
    width: 2.5px;
    height: 2.5px;
    position: absolute;
    top: 12.5px;
    left: 5px;
    animation: room_blink 1s linear infinite;
}

@keyframes room_blink {
    100% {
        height: 1px;
    }
}

.room .head:before {
    left: 10px;
}

/* ==========================================================================
   Bed
   ========================================================================== */

.room .bed:before {
    content: '';
    display: block;
    position: absolute;
    background: #c3bdbd;
    top: -21px;
    right: 25px;
    width: 35px;
    height: 20px;
    border-radius: 40px 10px;
}

.room .bed:after {
    content: '';
    display: block;
    position: absolute;
    background: #2d2320;
    border-radius: 5px;
    top: -25px;
    right: 0;
    width: 25px;
    height: 50px;
}

.room .bed {
    width: 265px;
    height: 50px;
    right: 22px;
    top: 255px;
    background: #2d2320;
    box-shadow: inset 50px 105px 0 -85px #e0e0e0;
}

/* ==========================================================================
   Table and Computer
   ========================================================================== */

.room .table {
    width: 90px;
    height: 85px;
    left: 23px;
    top: 227px;
    background: #2d2320;
    box-shadow: inset 89px 57px 0 -68px #7b5d52;
}

.room .desktop:before {
    position: absolute;
    content: '';
    display: block;
    height: 4px;
    width: 25px;
    left: 54px;
    top: 15px;
    transform: rotate(-80deg);
    background: #000;
    border-radius: 5px;
}

.room .desktop:after {
    position: absolute;
    content: '';
    display: block;
    height: 3px;
    width: 20px;
    left: 47px;
    top: 10px;
    transform: rotate(35deg);
    background: #000;
    border-radius: 10px;
}

/* ==========================================================================
   Chair
   ========================================================================== */

.room .chair {
    height: 15px;
    width: 50px;
    left: 129px;
    top: 247px;
    border-radius: 10px;
}

.room .chair:before {
    position: absolute;
    content: '';
    display: block;
    height: 6px;
    width: 49px;
    left: 10px;
    top: 33px;
    transform: rotate(80deg);
    background: #000;
    border-radius: 10px;
}

.room .chair:after {
    position: absolute;
    content: '';
    display: block;
    height: 10px;
    width: 60px;
    left: 20px;
    top: -35px;
    transform: rotate(-70deg);
    background: #000;
    border-radius: 10px;
    box-shadow: -75px -20px 0 -2px #000;
}

/* ==========================================================================
   Clock
   ========================================================================== */

.room .clock {
    background: #fff;
    left: 50px;
    top: 50px;
    border-radius: 50%;
    border: 4px solid #000;
    width: 35px;
    height: 35px;
    position: relative;
}

.room .clock:after {
    position: absolute;
    width: 2px;
    height: 16px;
    display: block;
    background: #000;
    content: '';
    animation-duration: 0.3s;
}

.room .clock:before {
    position: absolute;
    width: 2px;
    height: 16px;
    display: block;
    background: #000;
    content: '';
    animation-duration: 6s;
    animation-delay: 2s;
}

.room .clock:before,
.room .clock:after {
    transform-origin: bottom center;
    animation-name: room_dial;
    left: 16px;
    top: 2px;
    border-radius: 10px;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
}

@keyframes room_dial {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   Computer Screen
   ========================================================================== */

.room .desktop {
    display: block;
    height: 7px;
    width: 62px;
    left: 23px;
    top: 183px;
    transform: rotate(80deg);
    background: #000;
    border-radius: 0 0 53px 53px;
    border-bottom-left-radius: 53px 17px;
    border-bottom-right-radius: 53px 17px;
    animation: room_screen 0.1s linear infinite;
}

@keyframes room_screen {
    0% {
        box-shadow: 0 0 10px 1px rgba(255, 255, 255, 0.4);
    }

    100% {
        box-shadow: 0 0 15px 2px rgba(255, 255, 255, 0.6);
    }
}

/* ==========================================================================
   Room Description
   ========================================================================== */

.room .description {
    background: transparent;
    text-align: center;
    width: 100%;
    bottom: 10px;
    font-size: 19px;
    color: #aaa;
    font-family: 'Indie Flower', cursive;
}

/* ==========================================================================
   Responsive Layout
   ========================================================================== */

@media (max-width: 576px) {
    .about-img-holder {
        padding: 0 12px;
        margin-bottom: 24px;
    }

    .room-scaler {
        width: 100%;
        max-width: 500px;
    }

    .room {
        width: 100%;
        height: 350px;
    }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
    .room *,
    .room .window,
    .room .outside,
    .room .hand:after,
    .room .hand:before,
    .room .head:after,
    .room .head:before,
    .room .clock:before,
    .room .clock:after,
    .room .desktop {
        animation: none !important;
    }
}


/* Add spacing between the animated room and About content */
.about-img-holder {
    margin-bottom: 45px;
}

.about-caption {
    margin-top: 20px;
}

/* Adjust spacing on smaller screens */
@media (max-width: 576px) {
    .about-img-holder {
        margin-bottom: 30px;
    }

    .about-caption {
        margin-top: 10px;
    }
}


@media (min-width: 768px) {
    .about-img-holder {
        padding-right: 25px;
    }

    .about-caption {
        padding-left: 25px;
    }
}