html,
body {
    margin: 0;
    padding: 0;
    box-sizing: border-box;

    --font-sans: 'IBM Plex Sans', system-ui,sans-serif;
    --font-mono: 'IBM Plex Mono', 'Menlo', monospace;

    /* default light-mode colors */
    --foreground-default: #222;
    --foreground-light: #555;
    --foreground-fill: #ddd;
    --foreground-fill-hover: #ccc;
    --background-default: #f8f8f8;
    --background-block: #eee;
    --background-hero: #222;
}

.inverted,
.type-page header {
    --foreground-default: #f8f8f8;
    --foreground-light: #d8d8d8;
    --foreground-fill: #666;
    --foreground-fill-hover: #777;
    --background-default: #222;
    --background-block: #555;
    --background-hero: #eee;
}

html {
    /* rem for the page */
    font-size: 18px;
}

body {
    font-family: var(--font-sans);
    color: var(--foreground-default);
    background: var(--background-default);

    border-bottom: 8px solid var(--foreground-default);

    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header,
footer {
    flex-grow: 0;
    flex-shrink: 0;
}

main {
    flex-grow: 1;
    flex-shrink: 0;
}

/* bit of a hack for this special case */
body.type-page {
    background: #222;
}
header,
main,
footer {
    background: var(--background-default);
}

a {
    color: var(--foreground-default)
}

.overlay {
    max-width: unset;
    width: calc(100% - 32px);
    margin-left: auto;
    margin-right: auto;
}

/* TYPOGRAPHY */

h1,
h2,
h3 {
    line-height: 1.2em;
    color: var(--foreground-default);
    margin-top: 1.8em;
    margin-bottom: 1em;
    font-weight: normal;
}

h1 {
    font-size: 2em;
}

h2 {
    font-size: 1.5em;
}

h3 {
    font-size: 1.2em;
}

hr {
    margin: 2em 0;
}

p, li {
    line-height: 1.5em;
    margin: 1em 0;
}

p img.blend-multiply {
    mix-blend-mode: multiply;
}

/* HEADER */

header a {
    text-decoration: none;
    font-size: 1.125em;
}

header a:hover {
    text-decoration: underline;
}

header .overlay,
nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    height: 100%;
}

header {
    background: var(--background-default);
    height: 100px;
}

.home {
    font-weight: bold;
    margin-right: 24px;
}

nav a {
    margin-right: 12px;
    font-weight: normal;
}

/* FOOTER */

.prevInSection {
    text-align: left;
}

.nextInSection {
    text-align: right;
}

footer .overlay {
    height: 80px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 32px;
}

footer .left {
    font-style: italic;
}

footer .right {
    height: 1em;
}

footer .right .square {
    display: inline-block;
    height: 1em;
    width: 1em;
    background: var(--foreground-default);
}

/* SINGLETON */

main {
    overflow: hidden;
}

.hero {
    background: var(--background-default);
    padding-top: 32px;
    padding-bottom: 32px;
    margin-bottom: 36px;
}

.hero h1 {
    margin-top: 0;
}

.meta {
    color: var(--foreground-light);
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

.meta-item {
    flex-grow: 1;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

p img {
    margin: 1.5em 0;
    width: 100%;
}

pre, code {
    font-family: var(--font-mono);
}

pre {
    display: block;
    margin: 1.5em 0;
    background: var(--background-block);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    display: flex;
    flex-direction: row;
}

pre > code {
    flex-shrinK: 0;
    display: block;
    padding: 1em;
}

code {
    background: var(--background-block);
}

p code {
    padding: 3px 5px;
}

blockquote {
    font-style: italic;
}

/* SECTION */

.type-section a.summaryLink {
    margin-bottom: 2em;
    text-decoration: none;
    display: block;
    transition: opacity .2s, transform .2s;
}

.type-section a.summaryLink:hover {
    opacity: .7;
}

.type-section a.summaryLink .summaryTitle {
    font-size: 1.25em;
    font-weight: bold;
}

.type-section a.summaryLink:hover .summaryTitle::after {
    content: '→';
    width: 0;
    display: inline-block;
    margin-left: 8px;
}

.button {
    display: inline-block;
    background: var(--foreground-fill);
    box-sizing: border-box;
    text-decoration: none;
    padding: .6em 1em;
    margin: .5em .6em .5em 0;
}

.button:hover {
    background: var(--foreground-fill-hover);
}

/* LOGO IMAGE */

.logo-img {
    width: 100px;
    height: auto;
    margin-top: 0;
    margin-bottom: -2em;
}

/* TABLE OF CONTENTS */

.toc {
    box-sizing: border-box;
    border-left: 6px solid var(--foreground-light);
    background: var(--background-block);
    margin: 1.5em 0;
}

.toc summary {
    padding-left: 1em;
    cursor: pointer;
}

.toc .toc-title {
    display: inline-block;
    font-size: 1.4em;
    margin: 1em 0;
}

.toc[open] .toc-title {
    margin-bottom: 0;
}

.toc ul {
    padding-left: 1.6em;
}

.toc li {
    list-style: none;
    margin: .75em 0;
}

.toc summary::-webkit-details-marker {
    transform: translateY(-.2em);
}

/* MAVERICK PLAYGROUND */

.maverick {
    width: 100%;
    min-height: 520px;
    box-sizing: border-box;
    border: 2px solid var(--foreground-fill);
    border-radius: 6px;
}

@media only screen and (min-width: 600px) {
    .overlay {
        max-width: 740px;
    }

    h1,
    h2,
    h3 {
        margin-top: 1.2em;
        margin-bottom: .5em;
    }

    h1 {
        font-size: 3em;
    }

    h2 {
        font-size: 2.2em;
    }

    h3 {
        font-size: 1.5em;
    }

    p, li {
        margin: 1em 0;
    }
}

@media only screen and (max-width: 600px) {
    p img {
        width: 100vw;
        position: relative;
        top: 0;
        left: -16px;
    }
    pre > code {
        font-size: .8em;
    }
}
