:root {
    color-scheme: dark;
    --bg: #0d1117;
    --surface: #161b22;
    --surface-hover: #21262d;
    --border: #30363d;
    --text: #e6edf3;
    --muted: #8b949e;
    --accent: #39d353;
    --link: #58a6ff;
    --font-mono:
        ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
        "Liberation Mono", monospace;
    --font-sans:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial,
        sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 1rem 1rem 3rem 1rem;
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    line-height: 1.6;
    word-wrap: break-word;
}

header {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-bottom: 1.25rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.logo a {
    font-family: var(--font-mono);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    display: inline-block;
    padding: 0.25rem 0;
}

nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.4rem 0.9rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.15s ease;
}

nav a:active,
nav a:hover {
    background: var(--surface-hover);
    border-color: var(--link);
    color: var(--link);
}

.crumb-bar {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 0.25rem 0.65rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    max-width: 100%;
}

.crumb-link {
    color: var(--muted);
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
}

.crumb-link:hover {
    color: var(--accent);
    text-decoration: none;
}

.crumb-sep {
    color: var(--border);
}

.crumb-current {
    color: var(--accent);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.entry-header,
.podcast-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
}

.entry-title,
.podcast-title {
    font-size: 1.75rem;
    line-height: 1.2;
    margin: 0 0 0.75rem 0;
    color: var(--text);
}

.entry-meta,
.podcast-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.85rem;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--muted);
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.meta-item svg {
    color: var(--accent);
}

.home-intro {
    margin-bottom: 2rem;
}

.home-divider {
    border: 0;
    border-top: 1px dashed var(--border);
    margin: 2.5rem 0;
}

.home-section {
    margin-bottom: 2.5rem;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 1rem;
}

.section-head h2 {
    font-family: var(--font-mono);
    font-size: 1.15rem;
    margin: 0;
    color: var(--text);
}

.view-all {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent);
    text-decoration: none;
}

.view-all:hover {
    text-decoration: underline;
}

.item-main {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.item-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--muted);
}

.duration,
.reading-time {
    color: var(--muted);
}

.empty-notice {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--muted);
    font-style: italic;
}

h1,
h2,
h3,
h4 {
    line-height: 1.25;
    color: var(--text);
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
}

h1 {
    font-size: 1.65rem;
}
h2 {
    font-size: 1.35rem;
}
h3 {
    font-size: 1.15rem;
}

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

a:hover {
    text-decoration: underline;
}

p {
    margin: 1rem 0;
}

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

.post-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.post-list li {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 1rem;
    border-radius: 8px;
}

.post-list li a {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
}

.post-list li a:hover {
    color: var(--link);
}

.post-list time {
    font-family: var(--font-mono);
    color: var(--muted);
    font-size: 0.85rem;
}

.tag {
    align-self: flex-start;
    background: var(--surface-hover);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.player-box {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 1rem;
    border-radius: 8px;
    margin: 1.5rem 0;
}

audio {
    width: 100%;
    height: 48px;
    margin-bottom: 0.85rem;
    outline: none;
}

.player-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.downloads-label {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--muted);
    margin-right: 0.25rem;
}

.btn-audio {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0.2rem 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--surface-hover);
    color: var(--text);
    text-decoration: none;
    transition: all 0.15s ease;
}

.btn-audio:hover {
    border-color: var(--accent);
    color: var(--accent);
    text-decoration: none;
}

.btn-audio.rss-btn {
    border-color: #d97706;
    color: #fbbf24;
}

.btn-audio.rss-btn:hover {
    background: rgba(245, 158, 11, 0.15);
}

.post-nav {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.nav-item {
    display: flex;
}

.nav-item a {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.15s ease;
}

.nav-item a:hover {
    background: var(--surface-hover);
    border-color: var(--accent);
    text-decoration: none;
}

.nav-dir {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-item a:hover .nav-dir {
    color: var(--accent);
}

.nav-title {
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.3;
}

.nav-next {
    text-align: right;
}

.nav-next a {
    align-items: flex-end;
}

pre {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.88rem;
    line-height: 1.45;
}

code {
    font-family: var(--font-mono);
    background: var(--surface);
    padding: 0.15rem 0.35rem;
    border-radius: 4px;
    font-size: 0.9em;
}

pre code {
    padding: 0;
    background: transparent;
}

footer {
    margin-top: 3.5rem;
    padding-top: 1.75rem;
    color: var(--muted);
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    text-align: center;
}

.footer-feeds {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.78rem;
}

.feed-label {
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.feed-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--text);
    text-decoration: none;
    padding: 0.2rem 0.45rem;
    border-radius: 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    transition: all 0.15s ease;
}

.feed-link svg {
    color: #fbbf24;
}

.feed-link:hover {
    border-color: #fbbf24;
    color: #fbbf24;
    text-decoration: none;
}

.feed-sep {
    color: var(--border);
}

.footer-copy {
    margin: 0;
    color: var(--muted);
    font-size: 0.8rem;
}

@media (prefers-color-scheme: light) {
    :root {
        color-scheme: light;
        --bg: #f6f8fa;
        --surface: #ffffff;
        --surface-hover: #eaeef2;
        --border: #d0d7de;
        --text: #1f2328;
        --muted: #656d76;
        --accent: #1a7f37;
        --link: #0969da;
    }

    .crumb-bar {
        background: #ffffff;
        border-color: #d0d7de;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    }

    .crumb-link {
        color: #656d76;
    }

    .crumb-sep {
        color: #afb8c1;
    }

    .btn-audio.rss-btn {
        border-color: #d97706;
        color: #b45309;
        background: #fffbeb;
    }

    .btn-audio.rss-btn:hover {
        background: #fef3c7;
    }
}

@media (min-width: 640px) {
    body {
        max-width: 740px;
        margin: 0 auto;
        padding: 2.5rem 1.5rem 4rem 1.5rem;
    }

    header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    nav a {
        min-height: auto;
        background: transparent;
        border: none;
        padding: 0.25rem 0.5rem;
    }

    nav a:hover {
        background: transparent;
    }

    .entry-title,
    .podcast-title {
        font-size: 2rem;
    }

    .item-main {
        flex-direction: row;
        align-items: baseline;
        gap: 0.75rem;
    }

    .post-list li {
        flex-direction: row;
        align-items: baseline;
        justify-content: space-between;
        background: transparent;
        border: none;
        border-bottom: 1px solid rgba(48, 54, 61, 0.4);
        border-radius: 0;
        padding: 0.65rem 0;
    }

    .post-nav {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .btn-audio {
        min-height: auto;
        padding: 0.25rem 0.6rem;
    }
}
