:root {
    --bg: #f8f8f8;
    --bg-alt: #f0f0f0;
    --text: #0b0b0b;
    --text-muted: #666;
    --border: #e6e6e6;
    --border-light: #e0e0e0;
    --border-table: #ddd;
    --border-quote: #ccc;
    --hl-kw: #d73a49;
    --hl-str: #032f62;
    --hl-num: #005cc5;
    --hl-cm: #6a737d;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    scrollbar-width: none;
}

*::-webkit-scrollbar {
    display: none;
}

html,
body {
    height: 100%;
}

body {
    font-family: "CarbonMono", monospace;
    background: var(--bg);
    color: var(--text);
    line-height: 1.45;
    padding: 40px 20px 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.wrap {
    max-width: 940px;
    margin: 0 auto;
    width: 100%;
    flex: 1;
    padding-bottom: 30px;
}

header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 28px;
}

.brand {
    font-size: 20px;
}

.brand .title {
    font-family: "UnifrakturCook", serif;
    font-weight: 700;
    font-size: 34px;
    letter-spacing: 0.5px;
}

.brand .subtitle {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

nav {
    display: flex;
    gap: 18px;
}

nav a {
    text-decoration: none;
    font-size: 14px;
    color: var(--text);
}

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

section {
    margin-bottom: 28px;
}

h1 {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 30px;
    margin-bottom: 12px;
}

h2 {
    font-size: 20px;
    margin: 14px 0 8px;
}

p.lead {
    color: var(--text);
    margin-bottom: 12px;
}

::selection {
    background: var(--text);
    color: var(--bg);
}

::-moz-selection {
    background: var(--text);
    color: var(--bg);
}

.about {
    background: transparent;
}

#about a {
    display: block;
    font-size: 14px;
    text-decoration: none;
    color: var(--text);
    margin-bottom: 8px;
}

#about a:hover {
    text-decoration: underline;
}

.banners {
    margin-top: 34px;
    border-top: 1px dashed var(--border);
    padding-top: 20px;
}

.gallery-subsection {
    margin-top: 14px;
}

.gallery-subsection h2,
.gallery-subsection h3 {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin: 0 0 6px;
}

.fav-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fill, 88px);
    gap: 8px;
    margin-top: 8px;
    max-width: 700px;
}

.fav-buttons img {
    width: 88px;
    height: 31px;
    display: block;
}

#gear ul,
#gear li {
    user-select: text;
    -webkit-user-select: text;
}

#gear li::before {
    content: "- ";
}

/* ===== blog ===== */
#blog {
    user-select: text;
    -webkit-user-select: text;
}

#blog a {
    color: var(--text);
    text-decoration: underline;
}

#blog a:hover {
    background: var(--text);
    color: var(--bg);
}

.blog-post-list {
    list-style: none;
    padding: 0;
    margin-top: 8px;
}

.blog-post-list li {
    padding: 10px 0;
    border-bottom: 1px dashed var(--border);
}

.blog-post-list li:first-child {
    border-top: 1px dashed var(--border);
}

.blog-post-list a {
    text-decoration: none;
    font-size: 16px;
}

.blog-post-list .post-date {
    font-size: 12px;
    color: var(--text-muted);
    display: block;
    margin-top: 2px;
}

.blog-back-link {
    display: inline-block;
    margin-bottom: 14px;
    font-size: 14px;
    cursor: pointer;
}

.blog-back-link:hover {
    text-decoration: underline;
}

#blog-content h1 {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 26px;
    margin-bottom: 6px;
}

#blog-content h2 {
    font-size: 20px;
    margin: 22px 0 8px;
}

#blog-content h3 {
    font-size: 16px;
    margin: 18px 0 6px;
}

#blog-content p {
    margin-bottom: 12px;
    line-height: 1.55;
}

#blog-content ul,
#blog-content ol {
    margin: 8px 0 12px 24px;
}

#blog-content li {
    margin-bottom: 4px;
}

#blog-content blockquote {
    border-left: 3px solid var(--border-quote);
    padding-left: 14px;
    margin: 12px 0;
    color: var(--text-muted);
}

#blog-content blockquote p {
    margin-bottom: 4px;
}

#blog-content pre {
    background: var(--bg-alt);
    border: 1px solid var(--border-light);
    padding: 12px 14px;
    margin: 12px 0;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.4;
}

#blog-content pre code {
    background: none;
    padding: 0;
    font-family: "CarbonMono", "SF Mono", Monaco, "Cascadia Code", monospace;
    user-select: text;
    -webkit-user-select: text;
}

#blog-content code {
    background: var(--bg-alt);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 13px;
}

#blog-content img {
    max-width: 100%;
    margin: 12px 0;
}

#blog-content hr {
    border: none;
    border-top: 1px dashed var(--border);
    margin: 20px 0;
}

#blog-content table {
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 14px;
}

#blog-content th,
#blog-content td {
    border: 1px solid var(--border-table);
    padding: 6px 10px;
    text-align: left;
}

#blog-content th {
    background: var(--bg-alt);
}

#blog-content .hl-kw { color: var(--hl-kw); }
#blog-content .hl-str { color: var(--hl-str); }
#blog-content .hl-num { color: var(--hl-num); }
#blog-content .hl-cm { color: var(--hl-cm); font-style: italic; }

footer {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    background: var(--bg);
    border-top: 1px dashed var(--border);
    padding: 12px 20px;
    font-size: 13px;
    color: var(--text-muted);
}

footer .mono {
    max-width: 940px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
}

footer a {
    color: var(--text);
    text-decoration: none;
}

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

.mono {
    font-family: monospace;
}

@media (max-width: 600px) {
    header {
        flex-direction: column;
        align-items: flex-start;
    }

    nav {
        margin-top: 12px;
    }

    .brand .title {
        font-size: 26px;
    }

    footer .mono {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .wrap {
        padding-bottom: 55px;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #111;
        --bg-alt: #1a1a1a;
        --text: #fff;
        --text-muted: #aaa;
        --border: #333;
        --border-light: #2a2a2a;
        --border-table: #444;
        --border-quote: #555;
        --hl-kw: #f97583;
        --hl-str: #9ecbff;
        --hl-num: #79c0ff;
        --hl-cm: #8b949e;
    }
}
