:root {
	--page_background: #fff;
	--accent: #447bba;
	--text_primary: #000;
	--text_subhead: #626d7a;
	--quote_background: #f0f2f5;
	--quote_border: rgba(0, 20, 51, 0.12);
	--code_background: rgba(75, 179, 75, 0.16);
	--code_border: #4bb34b;
	--separator: #dce1e6;
	--table_header: #f5f7f8;
	--table_border: #e7e8ec;
}

@media (prefers-color-scheme: dark) {
	:root {
		--page_background: #222222;
		--accent: #447bba;
		--text_primary: #fff;
		--text_subhead: #939393;
		--quote_background: #333;
		--quote_border: rgba(255, 255, 255, 0.24);
		--code_background: rgba(75, 179, 75, 0.16);
		--code_border: #4bb34b;
		--separator: #424242;
		--table_header: transparent;
		--table_border: #424242;
	}
}

body {
	background: var(--page_background);
	color: var(--text_primary);
	font-family: system-ui, sans-serif;
	margin: 0;
}

a {
	color: var(--accent);
}

main {
	padding: 25px 30px 30px;
	max-width: 780px;
	margin: 0 auto;
	display: flex; /* f**k margin collapse! */
	flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

header, h1 {
    margin: 0;
    padding: 0;
    font-size: 2em;
    font-weight: 600;
}

.postmeta {
	font-size: 13px;
    line-height: 15px;
    margin-top: 6px;
}

.postmeta, .postmeta a {
	color: var(--text_subhead);
}

content {
	margin-top: 20px;
	font-size: 16px;
    line-height: 24px;
    word-wrap: break-word;
}

content > *:not(h1, h2), blockquote > *:not(h1, h2) {
	margin: 0px;
	margin-top: 20px;
}

blockquote > blockquote {
    margin-top: 12px;
}

#index > *:not(h1, h2) {
    margin-top: 10px;
}

#index > .summary {
    margin-top: 0px;
    font-size: 14px;
    line-height: 18px;
    color: var(--text_subhead);
}

#index a {
    color: var(--text_primary);
}

#index a ~ span {
    color: var(--text_subhead);
    font-size: 11px;
}

content h1, content h2, content h3, content h4, content h5, content h6 {
    margin-top: 24px;
    margin-bottom: 16px;
    font-weight: 600;
    line-height: 1.25;
}

content p, content li {
    line-height: 1.5em;
}

content#index > p {
	margin-bottom: 0px;
}

content h1 {
    font-size: 2em;
    padding-bottom: 0.3em;
}

content h2 {
    font-size: 1.5em;
    padding-bottom: 0.3em;
}

content h3 {
    font-size: 1.25em;
}

content h4 {
    font-size: 1em;
}

content h5 {
    font-size: 0.875em
}

content h6 {
    font-size: 0.85em
}

content ol, content ul {
    padding-left: 19px;
}

content ul ul, content ul ol, content ol ol, content ol ul {
    margin-top: 0;
    margin-bottom: 0
}

content li {
    word-wrap: break-all
}

content li>p {
    margin-top: 16px
}

content li+li {
    margin-top: .25em
}

content p, content ul, content ol, content blockquote, content pre, content table {
    margin-top: 0;
    margin-bottom: 16px
}

blockquote, pre {
	padding: 12px;
	border-left: 4px solid;
}

blockquote {
	background-color: var(--quote_background);
    border-left-color: var(--quote_border);
}

pre {
	background-color: var(--code_background);
    border-left-color: var(--code_border);
    overflow: auto;
    font-size: 14px;
    line-height: 18px;
}

img {
    display: block;
	max-width: 640px;
    min-width: 260px;
    margin: 0 auto;
}

hr {
	background: var(--separator);
	height: 1px;
    border: 0;
}

table {
	border: 1px solid var(--table_border);
    border-right: 0;
    border-top: 0;
    padding: 0px;
    margin: 0 auto;
    width: 100%;
}

th, td {
    margin: 0;
    padding: 6px 8px;
    border-top: 1px solid var(--table_border);
    border-right: 1px solid var(--table_border);
}

th {
	background-color: var(--table_header);
    border-bottom: 0;
    border-left: 0;
    text-align: left;
}

td {
    vertical-align: top;
}

footer {
	border-top: 1px solid var(--separator);
	margin-top: 20px;
	padding-top: 16px;
	font-size: 13px;
	line-height: 15px;
	text-align: right;
}

footer > hr:first-child {
	margin-bottom: 20px;
}

@media all and (max-width: 640px) {
    img {
        width: 100%;
    }
}