body { position: absolute; }

@keyframes fade-out-in-1 {
  0% {opacity: 1;}
  10% {opacity: 0;}
  90% {opacity: 0;}
  100% {opacity: 1;}
}

@keyframes fade-out-in-2 {
  0% {opacity: 1;}
  10% {opacity: 0;}
  90% {opacity: 0;}
  100% {opacity: 1;}
}

.animate.light .wrapper::after {
    animation: fade-out-in-1 800ms;
    animation-fill-mode: forwards;
}
.animate.dark .wrapper::after {
    animation: fade-out-in-2 800ms;
    animation-fill-mode: forwards;
}

.animate.light .content {
    animation: fade-out-in-1 800ms;
    animation-fill-mode: forwards;
}
.animate.dark .content {
    animation: fade-out-in-2 800ms;
    animation-fill-mode: forwards;
}

@media screen {
    body {
        color: #000;
        font-size: 20px;
        line-height: 1.7em;
        background: #DDD;
        width: 100%;

        transition: background 400ms linear 150ms, color 0ms linear 200ms;
        will-change: background;
    }
    .wrapper {
        position: relative;
        padding: 3em;
        margin: 6em auto 2em auto;
        line-height: 1.7em;
        min-width: 20em;
        min-height: 120em;
        max-width: 45em;
        border-radius: 0.5em;
        box-shadow: #888 0 0.1em 0.5em 0;

        background: #FAF8F8;
        transition: background 400ms linear 150ms;
        will-change: background;
    }
    /*
    .wrapper::after {
        content: "";
        background: #888;
        position: absolute;
        width: 100%;
        height: 100%;
        z-index: -1;
        top: 0;
        left: 0;
        filter: drop-shadow(0 0 10px #888);
        opacity: 0.5;
    }
    */

    code {
        margin: 0 0.2em;
        padding: 0.1em 0.2em 0.15em 0.2em;
    }

    .table-wrap, .codehilite {
        overflow-x: auto;
        padding-bottom: 0.6em;
    }
}

@media only screen and (max-width: 75em) {
    html {
        overflow-x: hidden;
    }
    body {background: #FFF;}
    body.dark { background: #000; }

    .wrapper {
        margin: 0;
        padding: 0 1.5em;
    }
    body.dark .wrapper {
        margin: 0;
        padding: 0 0.2em;
    }

    .wrapper, body.dark .wrapper {
        border-radius: 0;
        box-shadow: none;
    }
    ul, ol {
        padding: 0 0.5em 0 1.5em;
    }
}

@media only screen and (max-width: 50.0em) {.wrapper {padding: 3em 2em;}}

@media only screen and (max-width: 47.5em) {.wrapper {padding: 3em 1em;}}

div.codehilite pre {
    font-size: 18px;
    line-height: 1.4em;
}

@media only screen and (max-width: 45.0em) {
    body {font-size: 18px;}
}
@media only screen and (max-width: 42.5em) {
    body {font-size: 17px;}
    div.codehilite pre {font-size: 17px;}
}
@media only screen and (max-width: 40.0em) {
    body {font-size: 16px;}
    div.codehilite pre {font-size: 16px;}
}
@media only screen and (max-width: 38.0em) {
    body {font-size: 15px;}
    div.codehilite pre {font-size: 15px;}
}
@media only screen and (max-width: 35.5em) {
    body {font-size: 14px;}
    div.codehilite pre {font-size: 14px;}
}


@media screen {
    #below-the-fold {
        /*
        Depending on your device, this allows the
        first paint happen 50-300ms earlier.
        */
        display: none;
    }
}

.dark {
    background: #222;
    color: #FFF;
}
.dark h1 > a, .dark a, .dark a:visited {
    color: #FFF;
}
.dark .wrapper {
    background: #000;
}

.dark img {
    filter: invert(1);
}
