:root { font-family: 'Inter', sans-serif; }
@supports (font-variation-settings: normal) {
    :root { font-family: 'Inter var', sans-serif; }
}

html {
    scroll-behavior: smooth;
}

body {

    max-width: 31em;
    margin: auto;
    padding: 1em;

    background-color: var(--main-background-color);
    color: var(--text-color);

    /* text*/
    font-size: 17px;
    letter-spacing: -0.013em;

    transition: background-color 0.3s;

}

p, li {
    line-height: 24px;
}

h1 {
    font-weight: 400;
}

h2, h3, h4, h5, h6 {
    font-weight: 600;
}

h1 {
    padding-bottom: 0.2em;
    border-bottom: 1px solid var(--header-border-color);
}

#post-title {
    border-bottom: none;
    font-weight: bold;
    font-size: 50px;
    letter-spacing: -0.049em;
    line-height: 52px;
    padding: 0;
    margin-bottom: 0;
}

table {
    border-collapse: collapse;
    margin: auto;
}

td, th {
    padding: 0.75em;
}

th {
    border-bottom: 1px solid var(--table-header-border-color);
}

.table-1st-col-border td:first-child,
.table-1st-col-border th:first-child {
    border-right: 1px solid var(--table-header-border-color);
}

tr:not(:last-child) td {
    border-bottom: 1px solid var(--table-cell-border-color);
}

.gist tr td {
    border-bottom: unset;
}

.section-link {
    opacity: 50%;
    font-weight: normal;
    visibility: hidden;
    cursor: pointer;
    text-decoration: none;
    color: initial;
}

h1:hover .section-link, h2:hover .section-link {
    visibility: visible;
}

img, .center, figure{
    display: block;
    max-width: 100%;
    margin: 1.5em auto;
}


figure img, figure video {
    width: 100%;
    margin: 0;
}

figcaption {
    font-size: 13px;
    margin: 1.0em 0;
}

footer {
    margin: auto;
}

footer p {
    font-size: 11pt;
    opacity: 75%;
    margin-top: 0;
}

.date {
    opacity: 50%;
    margin-top: 0.5em;
}

blockquote {
    border-left: 3px solid #ccc;
    opacity: 60%;
    padding: 0.1em 1.2em;
    margin: 1em 0;
}

a {
    text-decoration: underline;
    cursor: pointer;
}

a, a:visited { color: var(--link-color); }
a:hover { color: var(--link-hover-color); }

aside {
    border-radius: 5px;
    border: 1px solid var(--aside-border-color);
    background-color: var(--aside-background-color);
    padding: 0 1.0em;
    margin: 1.0em 0;
}

aside.warning {
    border: 1px solid var(--warning-border-color);
    background-color: var(--warning-background-color);
}

code {
    font-size: 14px;
}

button {
    cursor: pointer;
}

/* "conversation" tables */
.conversation {
    margin: auto;
    display: flex;
    flex-direction: column;
}

/* rows */
.conversation > div {
    display: flex;
    flex-direction: row;
}

/* float text */
.conversation-header div:last-child {
    text-align: right;
}

.conversation-header div {
    border-bottom: 1px solid var(--table-header-border-color);
    padding: 0.5em 0 !important;
}

.conversation div div {
    flex-grow: 1;
    padding: 1.0em 0;
}

.conversation div div:first-child { text-align: left; }
.conversation div div:last-child { text-align: right; }

.client-says, .server-says {
    flex-basis: 60%;
}

.client-says { color: #00bf00; }
.server-says { color: #ff0000; }

.conversation-center {
    flex-basis: 100%;
    text-align: center !important; /* too lazy to grok the priorities at play  here */
}

.limited-height-code pre {
    max-height: 30em;
    overflow: auto;
}

/* imgview stuff */
#img-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    object-fit: scale-down;
    background-color: rgba(0, 0, 0, 75%);
    margin: 0;
    z-index: 3;
}

.indented {
    padding: 0 1.0em;
}

img {cursor: pointer;}

kbd {
    background-color: #eee;
    border-radius: 3px;
    border: 1px solid #b4b4b4;
    box-shadow: 0 1px 1px rgba(0, 0, 0, .2), 0 2px 0 0 rgba(255, 255, 255, .7) inset;
    color: #333;
    display: inline-block;
    font-size: .85em;
    font-weight: 700;
    line-height: 1;
    padding: 2px 4px;
    white-space: nowrap;
}

audio {
    display: block;
    margin: auto;
}

canvas { max-width: 100%; }

.yt-video {
    aspect-ratio: 16 / 9;
    max-width: 560px;
    display: block;
    margin: 1em auto;
}

/* ----- COLOR SCHEMES ----- */
html {
    --main-background-color: #ffffff;
    --text-color: #000000;
    --header-border-color: #cccccc;
    --table-header-border-color: #000000;
    --table-cell-border-color: #cccccc;
    --link-color: #000000;
    --link-hover-color: #888888;
    --aside-border-color: #4287f5;
    --aside-background-color: rgba(66, 135, 245, 15%);
    --warning-border-color: #f54242;
    --warning-background-color: rgba(245, 66, 66, 15%);
    --toc-text-color: #ffffff;
    --toc-hover-color: #cacaca;
    --toc-bg-color: #000000;
    --header-bg-color: #222222;
    --header-color: #ffffff;
}

@media (prefers-color-scheme: dark) {
    html {
        color-scheme: dark;
        --main-background-color: #212121;
        --text-color: #ffffff;
        --header-border-color: #555555;
        --table-header-border-color: #ffffff;
        --table-cell-border-color: #555555;
        --link-color: #ffffff;
        --link-hover-color: #bbbbbb;
        --toc-bg-color: #333333;
        --header-bg-color: #282b33;
    }

    canvas {
        filter: invert(1);
    }
}

@media print {
    body {
        max-width: 100%;
    }
}

.gist {
    color-scheme: light;
}