/* lmilz.dev — Catppuccin Mocha */
:root {
    --bg: #1e1e2e;
    --bg-soft: #181825;
    --surface: #313244;
    --text: #cdd6f4;
    --text-dim: #a6adc8;
    --accent: #89b4fa;
    --accent2: #bac2de; /* neutral grey (Catppuccin subtext1) */
    --border: #45475a;
    --mono: "JetBrains Mono", "JetBrainsMono Nerd Font", ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
    --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --max-width: 46rem;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 1.0625rem;
    line-height: 1.7;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.25rem;
}

main.container { flex: 1; padding-top: 2.5rem; padding-bottom: 3rem; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
.site-header {
    border-bottom: 1px solid var(--border);
    background: var(--bg-soft);
}
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    padding-bottom: 1rem;
}
.site-title {
    font-family: var(--mono);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}
.site-title:hover { text-decoration: none; }
.site-title .accent { color: var(--text-dim); }
.nav-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
    font-family: var(--mono);
    font-size: 0.95rem;
}
.nav-links a { color: var(--text-dim); }
.nav-links a:hover, .nav-links a.active { color: var(--text); text-decoration: none; }

/* Hero */
.hero { margin-bottom: 3.5rem; }
.hero-greeting {
    font-family: var(--mono);
    color: var(--accent2);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}
.hero-title {
    font-size: 2.5rem;
    line-height: 1.2;
    margin: 0 0 1rem 0;
}
.hero-text { color: var(--text-dim); max-width: 38rem; }

/* Sections / post lists */
.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
}
.section-head h1, .section-head h2 { margin: 0 0 0.75rem 0; }
.all-posts-link {
    font-family: var(--mono);
    font-size: 0.85rem;
    white-space: nowrap;
}

.post-list { list-style: none; margin: 0; padding: 0; }
.post-item {
    display: flex;
    gap: 1.25rem;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--bg-soft);
    align-items: baseline;
}
.post-item time {
    font-family: var(--mono);
    font-size: 0.85rem;
    color: var(--text-dim);
    flex-shrink: 0;
}
.post-item-title { font-weight: 600; color: var(--text); }
.post-item-title:hover { color: var(--accent); }
.post-desc { margin: 0.25rem 0 0 0; font-size: 0.95rem; color: var(--text-dim); }

.tags { font-family: var(--mono); font-size: 0.8rem; margin-left: 0.5rem; }
.tag {
    color: var(--accent2);
    margin-right: 0.5rem;
    background: var(--surface);
    padding: 0.1rem 0.45rem;
    border-radius: 0.3rem;
}
.tag:hover { text-decoration: none; background: var(--border); }
.tag-cloud { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.75rem; }
.tag-cloud .tag-count { color: var(--text-dim); font-family: var(--mono); font-size: 0.8rem; }

.draft-badge {
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--bg);
    background: #f9e2af;
    padding: 0.1rem 0.45rem;
    border-radius: 0.3rem;
    margin-left: 0.5rem;
    vertical-align: middle;
}

/* Article */
.back-link {
    font-family: var(--mono);
    font-size: 0.85rem;
    color: var(--text-dim);
}
.post-header { margin-bottom: 2rem; }
.post-header h1 {
    font-size: 2rem;
    line-height: 1.3;
    margin: 0.5rem 0 0.5rem 0;
}
.post-meta { color: var(--text-dim); font-family: var(--mono); font-size: 0.85rem; }

.post-content h2, .post-content h3, .post-content h4 {
    margin-top: 2.25rem;
    line-height: 1.3;
}
/* anchor-links (insert_anchor_links) dezent halten */
.post-content h1 a, .post-content h2 a, .post-content h3 a, .post-content h4 a {
    color: inherit;
    text-decoration: none;
}
.post-content h1 a:hover, .post-content h2 a:hover,
.post-content h3 a:hover, .post-content h4 a:hover {
    color: var(--accent2);
    text-decoration: none;
}
.post-content img { max-width: 100%; height: auto; border-radius: 0.4rem; }
.post-content blockquote {
    margin: 1.5rem 0;
    padding: 0.25rem 1.25rem;
    border-left: 3px solid var(--accent2);
    color: var(--text-dim);
    background: var(--bg-soft);
    border-radius: 0 0.4rem 0.4rem 0;
}
.post-content code {
    font-family: var(--mono);
    font-size: 0.875em;
    background: var(--surface);
    padding: 0.15em 0.35em;
    border-radius: 0.3rem;
}
.post-content pre {
    padding: 1rem 1.25rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    font-size: 0.875rem;
    line-height: 1.6;
}
.post-content pre code { background: none; padding: 0; }
.post-content ul, .post-content ol { padding-left: 1.5rem; }
.post-content table { border-collapse: collapse; width: 100%; margin: 1.5rem 0; }
.post-content th, .post-content td { border: 1px solid var(--border); padding: 0.4rem 0.75rem; }
.post-content th { background: var(--bg-soft); }
.post-content hr { border: none; border-top: 1px solid var(--border); margin: 2.5rem 0; }

/* KaTeX */
.katex-display {
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.25rem 0;
}
.katex { font-size: 1.05em; }

/* About */
.about-hero {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    margin-bottom: 1.5rem;
}
.about-portrait {
    width: 9rem;
    height: 9rem;
    object-fit: cover;
    border-radius: 50%;
    flex-shrink: 0;
}
.about-hero .tagline {
    font-family: var(--mono);
    color: var(--accent2);
    font-size: 0.95rem;
    margin: 0 0 0.5rem 0;
}
.about-hero p { margin: 0; }
@media (max-width: 640px) {
    .about-hero { flex-direction: column; align-items: flex-start; }
}

/* Reading list */
.book-category {
    font-family: var(--mono);
    font-size: 0.7rem;
    background: var(--surface);
    color: var(--accent2);
    padding: 0.1rem 0.45rem;
    border-radius: 0.3rem;
    white-space: nowrap;
}

.post-nav {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    font-size: 0.95rem;
}
.post-nav a { max-width: 48%; }
.post-nav .next { margin-left: auto; text-align: right; }

.pagination {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    font-family: var(--mono);
    font-size: 0.9rem;
}

.not-found { text-align: center; padding: 4rem 0; }
.not-found h1 { font-size: 4rem; margin: 0; font-family: var(--mono); }

/* Footer */
.site-footer {
    border-top: 1px solid var(--border);
    background: var(--bg-soft);
    padding: 1.5rem 0;
    font-size: 0.9rem;
}
.site-footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.footer-links { display: flex; gap: 1.25rem; }
.footer-links a { color: var(--text-dim); font-family: var(--mono); font-size: 0.85rem; }
.footer-links a:hover { color: var(--text); }
.copyright { margin: 0; color: var(--text-dim); }

@media (max-width: 640px) {
    .hero-title { font-size: 1.9rem; }
    .post-item { flex-direction: column; gap: 0.15rem; }
    .site-footer .container { justify-content: center; text-align: center; }
}
