:root {
    --bg: #f1efe7;
    --fg: #1a1a1a;
    --muted: #6b675c;
    --rule: #b8b3a4;
    --link: #0000cc;
    --visited: #551a8b;
    --code-bg: #faf9f5;
    --code-border: #ccc7b8;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
    font-size: 15px;
    line-height: 1.6;
}

main {
    max-width: 96ch;
    padding: 1.25rem 1.5rem 0;
}

a {
    color: var(--link);
}

a:visited {
    color: var(--visited);
}

h1 {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0.5rem 0;
    overflow-wrap: break-word;
}

h2 {
    font-size: 1.1rem;
    margin: 2rem 0 0.75rem;
}

h3,
h4 {
    font-size: 1rem;
    margin: 1.5rem 0 0.5rem;
}

hr {
    border: 0;
    border-top: 1px solid var(--rule);
    margin: 0.75rem 0;
}

/* directory listing */

table.ls {
    border-collapse: collapse;
    width: 100%;
}

table.ls th,
table.ls td {
    text-align: left;
    padding: 0.1rem 2ch 0.1rem 0;
    white-space: nowrap;
}

table.ls th {
    font-weight: 700;
}

table.ls td.s,
table.ls th.s {
    text-align: right;
}

table.ls td.n {
    max-width: 42ch;
    overflow: hidden;
    text-overflow: ellipsis;
}

table.ls td.d {
    max-width: 48ch;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--muted);
}

table.ls td.m {
    color: var(--muted);
}

.readme {
    margin-top: 1.5rem;
}

/* single page */

.crumb {
    margin: 0.5rem 0;
    overflow-wrap: break-word;
}

.crumb span {
    font-weight: 700;
}

.meta {
    color: var(--muted);
}

.meta a {
    color: var(--muted);
}

article {
    max-width: 80ch;
}

article img,
article video {
    max-width: 100%;
    height: auto;
}

figure {
    margin: 1.25rem 0;
}

figcaption {
    color: var(--muted);
    font-size: 0.85rem;
}

blockquote {
    margin: 1rem 0;
    padding: 0 1rem;
    border-left: 3px solid var(--rule);
    color: var(--muted);
}

article table {
    border-collapse: collapse;
    display: block;
    overflow-x: auto;
}

article table th,
article table td {
    border: 1px solid var(--rule);
    padding: 0.25rem 0.75rem;
    text-align: left;
}

code {
    background: rgba(0, 0, 0, 0.055);
    padding: 0.05rem 0.3rem;
    border-radius: 2px;
    font-size: 0.92em;
}

pre {
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    padding: 0.75rem 1rem;
    overflow-x: auto;
    line-height: 1.45;
}

pre code {
    background: none;
    padding: 0;
    font-size: 0.92rem;
}

/* chroma highlight wrapper: its inline background wins, keep the frame */
.highlight pre {
    border: 1px solid var(--code-border);
}

address {
    margin: 0.75rem 1.5rem 1.5rem;
    max-width: 96ch;
    padding: 0;
    font-style: italic;
    font-size: 0.85rem;
    color: var(--muted);
}

address a,
address a:visited {
    color: var(--muted);
}

@media (max-width: 700px) {
    main {
        padding: 1rem 1rem 0;
    }

    table.ls td.d,
    table.ls th.d,
    table.ls td.s,
    table.ls th.s {
        display: none;
    }

    table.ls td.n {
        max-width: 34ch;
    }
}

@media (max-width: 480px) {
    table.ls td.m,
    table.ls th.m {
        display: none;
    }

    table.ls {
        table-layout: fixed;
    }

    table.ls td.n {
        max-width: none;
    }
}
