/* =========================================================
   人物
========================================================= */

.person {
    position: absolute;
    bottom: 19%;
    left: 0;
    width: 150px;
    height: 270px;
    z-index: 10;

    /*
     * 使用 transform 控制人物移動
     * 比單純改 left 更適合 RWD
     */
    transform: translateX(-220px);

    transition:
        transform 4s cubic-bezier(.25,.8,.25,1);

    will-change: transform;
}

.upper-body {

    position: absolute;

    top: 0;
    left: 0;

    width: 150px;
    height: 180px;

    transform-origin: 50% 95%;

    transition:
        transform 1.1s ease;

}
/* =========================================================
   頭
========================================================= */

.head {

    position: absolute;

    top: 0;
    left: 35px;

    width: 72px;
    height: 78px;

    border-radius: 50%;

    background:
        radial-gradient(
            circle at 65% 35%,
            #ffe0bd,
            #eab187
        );

    border: 3px solid #222;

    z-index: 3;

    transform-origin: 50% 85%;

    transition:
        transform 1.1s ease;
}

.eye {

    position: absolute;

    top: 31px;

    width: 13px;
    height: 9px;

    background: #fff;

    border: 2px solid #222;

    border-radius: 50%;

    z-index: 6;

    overflow: hidden;
}

.eye-left {
    left: 15px;
}

.eye-right {
    right: 15px;
}

.pupil {

    position: absolute;

    width: 5px;
    height: 5px;

    left: 50%;
    top: 50%;

    transform:
        translate(-50%, -50%);

    background: #111;

    border-radius: 50%;
}

.pupil::after {

    content: "";

    position: absolute;

    width: 2px;
    height: 2px;

    top: 1px;
    left: 1px;

    background: white;

    border-radius: 50%;
}

.eyebrow {

    position: absolute;

    top: 24px;

    width: 17px;
    height: 4px;

    background: #222;

    border-radius: 5px;

    z-index: 7;
}

.eyebrow-left {
    left: 13px;

    transform:
        rotate(8deg);
}

.eyebrow-right {
    right: 13px;

    transform:
        rotate(-8deg);
}

.nose {

    position: absolute;

    top: 41px;
    left: 50%;

    width: 6px;
    height: 9px;

    transform:
        translateX(-50%);

    border-right:
        2px solid #c18c67;

    border-bottom:
        2px solid #c18c67;

    border-radius:
        0 0 4px 0;

    z-index: 6;
}

.mouth {

    position: absolute;

    top: 57px;
    left: 50%;

    width: 22px;
    height: 10px;

    transform:
        translateX(-50%);

    border-bottom:
        3px solid #8b3d3d;

    border-radius:
        0 0 50% 50%;

    z-index: 6;
}

.bowing .mouth {

    top: 58px;

    border-bottom: none;

    border-top:
        3px solid #8b3d3d;

    border-radius:
        50% 50% 0 0;
}

.bowing .eyebrow-left {
    transform:
        rotate(-12deg);
}

.bowing .eyebrow-right {
    transform:
        rotate(12deg);
}

@keyframes blink {

    0%,
    92%,
    100% {
        transform: scaleY(1);
    }

    95% {
        transform: scaleY(0.08);
    }
}

.eye {
    animation:
        blink 5s infinite;
}

/* =========================================================
   頭髮
========================================================= */

.hair {

    position: absolute;

    top: -8px;
    left: 25px;

    width: 82px;
    height: 42px;

    background: #171717;

    border-radius:
        55% 55%
        35% 30%;

    transform: rotate(-8deg);

    z-index: 4;

    transform-origin: 50% 90%;

    transition:
        transform 1.1s ease;
}


/* =========================================================
   身體
========================================================= */

.body {

    position: absolute;

    top: 72px;
    left: 39px;

    width: 68px;
    height: 110px;

    border-radius:
        22px 22px
        10px 10px;

    background:
        linear-gradient(
            105deg,
            #292929 0%,
            #171717 45%,
            #080808 100%
        );

    border: 3px solid #111;

    transform-origin: 50% 8%;

    transition:
        transform 1.1s ease;

    overflow: hidden;

    z-index: 2;
}

.body::after {

    content: "";

    position: absolute;

    left: 0;
    bottom: 0;

    width: 100%;
    height: 18px;

    background: #111;

    border-top:
        2px solid #303030;

    z-index: 4;
}

.shirt-center {

    position: absolute;

    top: 0;
    left: 24px;

    width: 20px;
    height: 65px;

    background:
        linear-gradient(
            to right,
            #f4f4f4,
            #ffffff,
            #dcdcdc
        );

    clip-path:
        polygon(
            20% 0%,
            80% 0%,
            100% 100%,
            0% 100%
        );

    z-index: 2;
}

.shirt-collar {

    position: absolute;

    top: 0;
    left: 22px;

    width: 24px;
    height: 20px;

    background: #f5f5f5;

    clip-path:
        polygon(
            0 0,
            50% 100%,
            100% 0
        );

    z-index: 3;
}

.shirt-button {

    position: absolute;

    left: 31px;

    width: 5px;
    height: 5px;

    border-radius: 50%;

    background: #bcbcbc;

    box-shadow:
        0 1px 2px rgba(0,0,0,.8);

    z-index: 5;
}

.button-1 {
    top: 34px;
}

.button-2 {
    top: 50px;
}


/* =========================================================
   手臂
========================================================= */

.arm {

    position: absolute;

    width: 24px;
    height: 105px;

    top: 80px;

    background:
        linear-gradient(
            90deg,
            #252525,
            #111,
            #070707
        );

    border-radius: 20px;

    transform-origin: 50% 8%;

    z-index: 1;

    transition:
        transform 1.1s ease;
}

.arm-left {

    left: 24px;

    transform:
        rotate(18deg);
}

.arm-right {

    left: 89px;

    transform:
        rotate(-18deg);
}

.cuff {

    position: absolute;

    bottom: 3px;
    left: 3px;

    width: 18px;
    height: 12px;

    background: #303030;

    border-radius: 8px;

    border-top:
        2px solid #444;
}

/* =========================================================
   腿
========================================================= */

.leg {

    position: absolute;

    top: 170px;

    width: 28px;
    height: 90px;

    background:
        linear-gradient(
            90deg,
            #1c1c1c,
            #090909,
            #151515
        );

    border-radius:
        5px 5px 10px 10px;
}

.leg-left {
    left: 44px;
}

.leg-right {
    left: 76px;
}


/* =========================================================
   鞋
========================================================= */

.shoe {

    position: absolute;

    width: 45px;
    height: 18px;

    background: #050505;

    border-radius: 15px;

    bottom: -5px;
}

.shoe-left {
    left: -13px;
}

.shoe-right {
    left: -1px;
}


/* =========================================================
   行走動畫
========================================================= */

.walking .leg-left {

    animation:
        walkLeft
        .35s
        infinite
        alternate;
}

.walking .leg-right {

    animation:
        walkRight
        .35s
        infinite
        alternate;
}

.walking .arm-left {

    animation:
        armLeft
        .35s
        infinite
        alternate;
}

.walking .arm-right {

    animation:
        armRight
        .35s
        infinite
        alternate;
}


@keyframes walkLeft {

    from {
        transform: rotate(12deg);
    }

    to {
        transform: rotate(-12deg);
    }

}

@keyframes walkRight {

    from {
        transform: rotate(-12deg);
    }

    to {
        transform: rotate(12deg);
    }

}

@keyframes armLeft {

    from {
        transform: rotate(15deg);
    }

    to {
        transform: rotate(32deg);
    }

}

@keyframes armRight {

    from {
        transform: rotate(-15deg);
    }

    to {
        transform: rotate(-32deg);
    }

}


/* =========================================================
   人物位置
========================================================= */

.person-center {
    transform:
        translateX(calc(50vw - 75px));
}

.person-farewell {
    transform:
        translateX(calc(35vw - 75px));
}

.person-right {
    transform:
        translateX(calc(100vw + 180px));
}


/* =========================================================
   鞠躬
========================================================= */

.bowing .upper-body {

    transform:
        rotate(15deg)
        translateY(5px);

}

/* =========================================================
   手持 NAS
========================================================= */

@media (max-width: 600px) {

    .person {
        transform:
            translateX(-220px)
            scale(.72);

        transform-origin: bottom center;
    }

    .person-center {
        transform:
            translateX(calc(50vw - 75px))
            scale(.72);
    }

    .person-farewell {
        transform:
            translateX(calc(12vw - 75px))
            scale(.72);
    }

    .person-right {
        transform:
            translateX(calc(100vw + 180px))
            scale(.72);
    }

}