.page-doodle {
    overflow: hidden;

    &[data-color-scheme="light"] {
        background: $bg-offwhite;

        .doodle-frame {
            background: $bg-offwhite;
        }

        .preloader-dots {

            .dot {
                background: $cd-black;
            }
        }

        .doodle-instructions,
        .doodle-instructions a {
            color: $cd-black;
        }

        .nav-arrow .nav-arrow__inner,
        .nav-arrow:after,
        .nav-arrow:before {
            background: $cd-black;
        }

        .doodle-control {

            &:after,
            &:before {
                background: $cd-black;
            }

            svg {
                fill: $cd-black
            }
        }
    }

    &[data-color-scheme="dark"] {
        background: $cd-black;

        .doodle-frame {
            background: $cd-black;
        }

        .preloader-dots {

            .dot {
                background: #fff;
            }
        }

        .doodle-instructions,
        .doodle-instructions a {
            color: #fff;
        }

        .nav-arrow .nav-arrow__inner,
        .nav-arrow:after,
        .nav-arrow:before {
            background: #fff;
        }

        .doodle-control {

            &:after,
            &:before {
                background: #fff;
            }

            svg {
                fill: #fff;
            }
        }
    }

    .doodle-frame {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 1;
        visibility: hidden;
        opacity: 0;
        transition: all .3s $easeInOutExpo;

        &.show {
            visibility: visible;
            opacity: 1;
        }
    }

    .preloader-dots {
        z-index: 0;

        @include respond-to(small) {
            top: 55%;
        }
    }

    .doodle-instructions {
        z-index: 2;
    }

    .doodle-instructions {
        pointer-events: none;
        position: absolute;
        top: 47%;
        left: 50%;
        transform: translate(-50%, -50%);
        @include font-size(1.2);
        font-family: $ff-monosten-a;
        text-align: center;

        [data-codetext-char] {
            border-bottom: none !important;
        }

        @include respond-to(medium) {
            max-width: 70%;
        }

        &.show-fallback {
            pointer-events: auto;
            width: 65%;
            max-width: 320px;
            top: 50%;

            &:after {
                content: '';
                position: absolute;
                top: 50%;
                left: 50%;
                transform: translate(-50%, -50%);
                width: 200px;
                height: 200px;
                border-radius: 50%;
                background: $cd-red;
                z-index: -1;
            }
        }

        a {
            text-decoration: none;
            padding-bottom: 1px;
            border-bottom: 2px solid $cd-blue;
        }
    }

    .footer-nav {

        .arrow,
        .arrow:after,
        .arrow:before {
            transition: all .3s $easeInOutExpo;
        }

        .arrow {
            position: fixed;
            z-index: 2;
            bottom: 12px;
            display: none;
            cursor: pointer;

            .no-touch & {

                &:hover {
                    width: 40px;

                    &:after,
                    &:before {
                        width: 10px;
                    }
                }
            }

            &.show {
                display: block;
            }

            &.arrow-left {
                left: $site-padding-desktop;
                transform: rotate(180deg);
            }

            &.arrow-right {
                right: $site-padding-desktop;
            }
        }
    }

    .doodle-control {
        position: fixed;
        bottom: 10px;
        width: 30px;
        height: 34px;
        z-index: 2;
        cursor: pointer;
        transition: all .3s $easeInOutExpo;

        &:after,
        &:before {
            content: '';
            position: absolute;
            transition: all .3s $easeInOutExpo;
            height: 2px;
            width: 0;
        }

        &:after {
            bottom: 0;
            left: 0;
        }

        &:before {
            top: 0;
            right: 0;
        }

        &.doodle-control-refresh {
            right: 50%;
            margin-right: 10px;
        }

        &.doodle-control-random {
            left: 50%;
            margin-left: 10px;

            svg {
                transform: scale(2);
            }
        }

        .no-touch & {

            &:hover {

                &:after,
                &:before {
                    width: 100%;
                }
            }
        }

        svg {
            position: relative;
            width: 100%;
            height: 100%;
        }
    }

    .interaction-indicators {
        display: inline-block;
        position: fixed;
        bottom: $site-padding-desktop;
        left: 50%;
        transform: translate(-50%, 0);
        z-index: 3;
        pointer-events: none;

        .indicator {
            position: relative;
            margin-right: 20px;

            &:after {
                content: '';
                display: none;
                position: absolute;
                width: 40px;
                height: 2px;
                transform: rotate(45deg);
                background: $cd-blue;
            }

            &[disabled] {

                &:after {
                    display: block;
                }
            }

            svg {
                fill: $cd-red;
            }

            &:last-child {
                margin-right: 0;
            }
        }

        .indicator-mouse {
            top: 8px;

            &:after {
                top: -7px;
                left: 6px;
            }

            svg {
                width: 50px;
            }
        }

        .indicator-keyboard {

            &:after {
                top: 0;
                left: -7px;
            }

            svg {
                width: 27px;
            }
        }

        .indicator-touch {
            top: 7px;

            &:after {
                top: -7px;
                left: 7px;
            }

            svg {
                width: 50px;
            }
        }
    }

    &.show-info {

        .footer-nav {

            .arrow {
                opacity: 0;
                visibility: hidden;

                &.arrow-left {
                    transform: translate(-5px, 0) rotate(180deg);
                }

                &.arrow-right {
                    transform: translate(-5px, 0);
                }
            }
        }

        .doodle-control {
            opacity: 0;
            visibility: hidden;
            transform: translate(-5px, 0);
        }

        .subpage-info,
        .subpage-info-pane {
            transform: none;
        }

        .subpage-info {
            transition-delay: 0.03s;
        }

        .subpage-info-pane {
            transition-delay: 0s;
        }
    }

    .subpage-info,
    .subpage-info-pane {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        transform: translate(100%, 0);
        transform: translate3d(100%, 0, 0);
        transition: all .5s $easeInOutExpo;
    }

    .subpage-info {
        background: $bg-offwhite;
        color: $cd-blue;
        z-index: 2;

        @include respond-to(small) {
            padding: 220px 65px 20px 70px;
            overflow: auto;
            -webkit-overflow-scrolling: touch;

            .interaction-indicators {
                display: none;
            }
        }

        a {
            color: $cd-blue;
            border-color: $cd-red;

            .no-touch & {

                &:hover {
                    border-width: 0;
                    animation: info-link-blink 0.1s 1;
                    animation-timing-function: steps(1, end);
                    animation-fill-mode: forwards;
                    color: $bg-offwhite;
                }
            }
        }

        .col-2 {
            font-family: $ff-monosten-f;
        }

        .subpage-content {
            padding: $site-padding-desktop 0;
            position: relative;
            top: 55%;

            &:after,
            &:before {
                content: '';
                position: absolute;
                left: 0;
                width: 100%;
                height: 2px;
                background: $cd-blue;
                z-index: 2;
            }

            &:after {
                top: 0;
            }

            &:before {
                bottom: 0;
            }

            &.enable-overflow {
                padding: 0;
                transform: translate(-50%, 0);

                &:before,
                &:after {
                    height: 25px;
                }

                &:after {
                    border-top: 2px solid $cd-blue;
                    /* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#f1f1f3+0,f1f1f3+100&1+0,0.85+50,0+100 */
                    background: -webkit-linear-gradient(top, rgba(241,241,243,1) 0%,rgba(241,241,243,0.85) 50%,rgba(241,241,243,0) 100%); /* Chrome10+,Safari5.1+ */
                    background: -o-linear-gradient(top, rgba(241,241,243,1) 0%,rgba(241,241,243,0.85) 50%,rgba(241,241,243,0) 100%); /* Opera 11.10+ */
                    background: -ms-linear-gradient(top, rgba(241,241,243,1) 0%,rgba(241,241,243,0.85) 50%,rgba(241,241,243,0) 100%); /* IE10+ */
                    background: linear-gradient(to bottom, rgba(241,241,243,1) 0%,rgba(241,241,243,0.85) 50%,rgba(241,241,243,0) 100%); /* W3C */
                }

                &:before {
                    border-bottom: 2px solid $cd-blue;
                    /* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#f1f1f3+0,f1f1f3+100&0+0,0.85+50,1+100 */
                    background: -webkit-linear-gradient(top, rgba(241,241,243,0) 0%,rgba(241,241,243,0.85) 50%,rgba(241,241,243,1) 100%); /* Chrome10+,Safari5.1+ */
                    background: -o-linear-gradient(top, rgba(241,241,243,0) 0%,rgba(241,241,243,0.85) 50%,rgba(241,241,243,1) 100%); /* Opera 11.10+ */
                    background: -ms-linear-gradient(top, rgba(241,241,243,0) 0%,rgba(241,241,243,0.85) 50%,rgba(241,241,243,1) 100%); /* IE10+ */
                    background: linear-gradient(to bottom, rgba(241,241,243,0) 0%,rgba(241,241,243,0.85) 50%,rgba(241,241,243,1) 100%); /* W3C */
                }

                .doodle-info-inner {
                    // overflow: auto;
                    // -webkit-over-scrolling: touch;
                    // padding: $site-padding-desktop 0 0;

                    overflow: hidden;
                    padding: 0;

                    .touch & {
                        overflow: auto;
                        -webkit-over-scrolling: touch;
                    }

                    .doodle-info-scroller {
                        padding: $site-padding-desktop 0;
                    }

                    .row:last-child {
                        // margin-bottom: $site-padding-desktop;
                    }
                }
            }

            @include respond-to(small) {
                top: auto;
                transform: translate(-50%, 0);
                overflow: visible;
                max-height: none;
            }
        }
    }

    .subpage-info-pane {
        background: $cd-red;
        z-index: 1;
        transition-delay: 0.03s;
    }

    .doodle-preview {
        position: absolute;
        top: -#{($home-grid-item-width*0.95)};
        z-index: 0;
        transform: translate(150px, 0);
        transform: translate3d(150px, 0, 0);
        transition: all 0.7s $easeInOutQuad;
    }

    .doodle-preview-thumb-holder {
        position: absolute;
        width: $home-grid-item-width;
        height: $home-grid-item-width;
        top: $home-grid-item-width/2;
        left: $home-grid-item-width/2;
        display: block;
        background: $cd-red;
        transform: rotate(45deg) translate(-50%, -50%);
        transform-origin: 0 0;
        transition: all .5s $easeInOutQuad;
        border-radius: 50%;
        overflow: hidden;
    }

    .doodle-preview-thumb-cover,
    .doodle-preview-thumb {
        display: block;
        position: absolute;
        top: 50%;
        left: 50%;
        width: $home-grid-item-width*1.5;
        height: $home-grid-item-width*1.5;
        transform: rotate(-45deg) translate(-50%, -50%);
        transform-origin: 0 0;
        transition: all .5s $easeInOutQuad;
        opacity: 0;
        visibility: hidden;
    }

    .doodle-preview-thumb-cover {
        z-index: 1;
        background: $cd-blue;
    }

    .doodle-preview-thumb {
        filter: brightness(0.8) contrast(2.5);
        background-size: cover;
        z-index: 0;

        .is-firefox & {
            filter: none;
        }
    }

    .doodle-preview-line {
        position: absolute;
        z-index: 1;
        top: $home-grid-item-width*0.88;
        height: 2px;
        background: $cd-blue;
        width: 0;
        transition: all 0.5s $easeOutExpo;
    }

    .doodle-preview-number {
        position: absolute;
        top: -15px;
        left: 0;
        @include font-size(7);
        line-height: 1;
        z-index: 3;
        color: $cd-blue;

        .index-char-nonzero {
            font-family: $ff-monosten-a;
        }

        .index-char-zero {
            font-family: $ff-monosten-b;
        }
    }

    &.show-info {

        .doodle-preview {
            transform: translateZ(0);
            z-index: 10;
        }

        .doodle-preview-thumb-holder,
        .doodle-preview-thumb-cover,
        .doodle-preview-thumb,
        .doodle-preview-line {
            transition-delay: 0.7s;
            transition-timing-function: $easeInOutExpo;
        }

        .doodle-preview-thumb-holder {
            border-radius: 6px;
            transform: scale(0.75) rotate(45deg) translate(-50%, -50%);
        }

        .doodle-preview-thumb-cover {
            opacity: 0.5;
            visibility: visible;
        }

        .doodle-preview-thumb {
            opacity: 1;
            visibility: visible;
        }

        .doodle-preview-line {
            width: $home-grid-item-width;
        }
    }
}

@keyframes info-link-blink {
    0%, 100% {
        background: $cd-red;
        color: $bg-offwhite;
    }
    50% {
        background: $bg-offwhite;
        color: $cd-red;
    }
}
