/* ── Variables ── */
:root {
    --bg:          #100d0d;
    --bg-subtle:   #1a1414;
    --bg-card:     #1e1717;
    --border:      #2e2020;
    --text:        #d4c8c6;
    --text-muted:  #7a6060;
    --text-dim:    #4a3535;
    --heading:     #f0e8e6;
    --accent:      #c47a85;
    --accent-dim:  #3d1e24;
    --accent-warm: #d4956a;
    --code-bg:     #170f0f;

    --font-sans:   'IBM Plex Sans', sans-serif;
    --font-mono:   'IBM Plex Mono', monospace;
    --font-serif:  'IBM Plex Serif', serif;

    --max-w:       1100px;
    --max-w-text:  680px;
    --nav-h:       60px;
    --sidebar-w:   280px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-weight: 300;
    font-size: 1rem;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
main { flex: 1; }
img  { max-width: 100%; display: block; }
a    { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Nav ── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--nav-h);
    background: rgba(16, 13, 13, 0.93);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.nav-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 2rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}
.site-logo {
    font-family: var(--font-mono);
    font-size: .92rem;
    font-weight: 500;
    color: var(--heading);
    letter-spacing: -.02em;
    text-decoration: none;
    flex-shrink: 0;
}
.site-logo:hover { color: var(--accent); text-decoration: none; }
.logo-mark { color: var(--accent); margin-right: .15em; }

.nav-links {
    display: flex;
    align-items: stretch;
    gap: 0;
    position: relative;
    height: 100%;
}
.nav-indicator {
    position: absolute;
    bottom: 0;
    height: 2px;
    width: 0;
    background: var(--accent);
    border-radius: 2px 2px 0 0;
    opacity: 0;
    pointer-events: none;
    transition: transform .25s cubic-bezier(.4,0,.2,1),
                width    .25s cubic-bezier(.4,0,.2,1),
                opacity  .18s;
}
.nav-link {
    font-family: var(--font-mono);
    font-size: .78rem;
    color: var(--text-muted);
    text-decoration: none;
    text-transform: lowercase;
    letter-spacing: .05em;
    padding: 0 .9rem;
    height: 100%;
    display: flex;
    align-items: center;
    transition: color .18s;
    white-space: nowrap;
}
.nav-link:hover  { color: var(--heading); text-decoration: none; }
.nav-link.active { color: var(--accent); }

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: .4rem;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}
.nav-toggle span {
    display: block;
    width: 20px;
    height: 1.5px;
    background: var(--text-muted);
    border-radius: 2px;
    transition: transform .22s ease, opacity .18s, width .18s;
    transform-origin: center;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; width: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ── Hero ── */
.blog-hero {
    padding: 5rem 2rem 4rem;
    border-bottom: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}
.blog-hero::before {
    content: '';
    position: absolute;
    top: -80px; right: -60px;
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(196,122,133,.08) 0%, transparent 70%);
    pointer-events: none;
}
.hero-inner {
    max-width: var(--max-w);
    margin: 0 auto;
}
.hero-eyebrow {
    font-family: var(--font-mono);
    font-size: .76rem;
    color: var(--accent);
    letter-spacing: .12em;
    text-transform: lowercase;
    margin-bottom: 1rem;
}
.blog-hero h1 {
    font-family: var(--font-serif);
    font-size: clamp(1.9rem, 4.5vw, 3rem);
    font-weight: 300;
    color: var(--heading);
    line-height: 1.22;
    letter-spacing: -.02em;
    margin-bottom: 1rem;
    font-style: italic;
}
.hero-sub {
    font-size: .98rem;
    color: var(--text-muted);
    max-width: 520px;
    line-height: 1.8;
}

/* ── Layout ── */
.blog-layout {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 3rem 2rem 5rem;
    display: grid;
    grid-template-columns: 1fr var(--sidebar-w);
    gap: 3.5rem;
    align-items: start;
}
.blog-layout--article {
    grid-template-columns: 1fr var(--sidebar-w);
}

/* ── Feed header (category/archive pages) ── */
.feed-header {
    margin-bottom: 2rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}
.feed-label {
    font-family: var(--font-mono);
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--text-dim);
    display: block;
    margin-bottom: .4rem;
}
.feed-title {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    font-weight: 300;
    color: var(--heading);
    letter-spacing: -.02em;
}

/* ── Post cards ── */
.post-card {
    padding: 2rem 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: .6rem;
}
.post-card:first-child { padding-top: 0; }
.post-card:last-of-type { border-bottom: none; }

.post-card-meta {
    font-family: var(--font-mono);
    font-size: .74rem;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-wrap: wrap;
}
.meta-sep { color: var(--border); }
.reading-time { color: var(--text-dim); }

.post-category {
    font-family: var(--font-mono);
    font-size: .7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--accent);
    background: var(--accent-dim);
    padding: .15em .55em;
    border-radius: 2px;
    text-decoration: none;
}
.post-category:hover { text-decoration: none; opacity: .85; }
.post-category--small { font-size: .65rem; }

.post-card-title {
    font-family: var(--font-serif);
    font-size: 1.35rem;
    font-weight: 300;
    line-height: 1.3;
    letter-spacing: -.01em;
}
.post-card-title a { color: var(--heading); text-decoration: none; }
.post-card-title a:hover { color: var(--accent); }

.post-card-summary {
    font-size: .9rem;
    color: var(--text-muted);
    line-height: 1.7;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}
.post-tag {
    font-family: var(--font-mono);
    font-size: .68rem;
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: .1em .55em;
    border-radius: 2px;
    text-decoration: none;
    transition: border-color .15s, color .15s;
}
.post-tag:hover {
    border-color: var(--accent);
    color: var(--accent);
    text-decoration: none;
}

.post-read-more {
    font-family: var(--font-mono);
    font-size: .78rem;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: .03em;
    margin-top: .25rem;
    align-self: flex-start;
}
.post-read-more:hover { text-decoration: underline; }

/* ── Pagination ── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 2rem;
    margin-top: 1rem;
    border-top: 1px solid var(--border);
}
.page-link {
    font-family: var(--font-mono);
    font-size: .8rem;
    color: var(--accent);
}
.page-info {
    font-family: var(--font-mono);
    font-size: .75rem;
    color: var(--text-dim);
}
.no-posts {
    font-family: var(--font-mono);
    font-size: .85rem;
    color: var(--text-dim);
    padding: 3rem 0;
}

/* ── Sidebar ── */
.blog-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: sticky;
    top: calc(var(--nav-h) + 2rem);
}

/* Author card */
.author-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: .5rem;
}
.author-avatar-wrap {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--border);
    margin-bottom: .5rem;
    flex-shrink: 0;
}
.author-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.author-avatar-fallback {
    width: 100%;
    height: 100%;
    background: var(--accent-dim);
    color: var(--accent);
    font-family: var(--font-serif);
    font-size: 1.8rem;
    font-weight: 300;
    align-items: center;
    justify-content: center;
}
.author-name {
    font-family: var(--font-serif);
    font-size: 1rem;
    font-weight: 400;
    color: var(--heading);
    letter-spacing: -.01em;
}
.author-handle {
    font-family: var(--font-mono);
    font-size: .72rem;
    color: var(--accent);
    letter-spacing: .04em;
}
.author-bio {
    font-size: .82rem;
    color: var(--text-muted);
    line-height: 1.65;
    margin-top: .4rem;
    text-align: left;
}
.author-links {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: .5rem;
}
.author-links a {
    font-family: var(--font-mono);
    font-size: .72rem;
    color: var(--text-muted);
    text-decoration: none;
    letter-spacing: .04em;
}
.author-links a:hover { color: var(--accent); }

/* Sidebar blocks */
.sidebar-block {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1.25rem;
}
.sidebar-title {
    font-family: var(--font-mono);
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--text-dim);
    display: block;
    margin-bottom: .9rem;
}
.category-list { list-style: none; }
.category-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .4rem 0;
    border-bottom: 1px solid var(--border);
    font-size: .875rem;
}
.category-list li:last-child { border-bottom: none; }
.category-list a { color: var(--text); }
.category-list a:hover { color: var(--accent); text-decoration: none; }
.category-list a.active { color: var(--accent); }
.cat-count {
    font-family: var(--font-mono);
    font-size: .7rem;
    color: var(--text-dim);
}
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

/* ── Full post ── */
.post-full { min-width: 0; }

.post-header {
    padding-bottom: 2rem;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--border);
}
.post-header-meta {
    font-family: var(--font-mono);
    font-size: .74rem;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.post-header h1 {
    font-family: var(--font-serif);
    font-size: clamp(1.7rem, 4vw, 2.4rem);
    font-weight: 300;
    color: var(--heading);
    line-height: 1.22;
    letter-spacing: -.02em;
    font-style: italic;
    margin-bottom: .75rem;
}
.post-subtitle {
    font-size: 1.05rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: .5rem;
}
.post-tags--header { margin-top: .9rem; }

/* ── Post body ── */
.post-body {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    line-height: 1.9;
    color: var(--text);
    max-width: var(--max-w-text);
}
.post-body h2 {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-weight: 400;
    color: var(--heading);
    margin: 2.5rem 0 .75rem;
    letter-spacing: -.01em;
    font-style: normal;
}
.post-body h3 {
    font-family: var(--font-sans);
    font-size: .82rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: .1em;
    margin: 2rem 0 .6rem;
    font-style: normal;
}
.post-body h4 {
    font-family: var(--font-sans);
    font-size: .95rem;
    font-weight: 600;
    color: var(--heading);
    margin: 1.5rem 0 .4rem;
}
.post-body p { margin-bottom: 1.3rem; }
.post-body a { color: var(--accent); }
.post-body strong { font-weight: 600; color: var(--heading); font-style: normal; }
.post-body em { font-style: italic; }

.post-body ul,
.post-body ol {
    padding-left: 1.5rem;
    margin-bottom: 1.3rem;
}
.post-body li { margin-bottom: .4rem; line-height: 1.75; }
.post-body li::marker { color: var(--accent); }

.post-body blockquote {
    border-left: 3px solid var(--accent);
    margin: 1.75rem 0;
    padding: .75rem 1.25rem;
    color: var(--text-muted);
    font-style: italic;
    background: var(--bg-subtle);
    border-radius: 0 3px 3px 0;
}
.post-body blockquote p { margin-bottom: 0; }

.post-body code {
    font-family: var(--font-mono);
    font-size: .84em;
    background: var(--code-bg);
    color: var(--accent-warm);
    padding: .15em .4em;
    border-radius: 2px;
    font-style: normal;
}
.post-body pre {
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 3px;
    padding: 1.25rem 1.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    line-height: 1.6;
}
.post-body pre code {
    background: none;
    padding: 0;
    color: var(--text);
    font-size: .875rem;
}
.post-body img {
    border-radius: 3px;
    margin: 1.75rem 0;
    border: 1px solid var(--border);
}
.post-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-family: var(--font-sans);
    font-size: .9rem;
}
.post-body th,
.post-body td {
    text-align: left;
    padding: .6rem 1rem;
    border-bottom: 1px solid var(--border);
}
.post-body th {
    font-family: var(--font-mono);
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-muted);
    background: var(--bg-card);
}

/* ── Post bottom author card ── */
.post-author-card {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1.5rem;
    margin: 3rem 0 2rem;
    max-width: var(--max-w-text);
}
.author-avatar-wrap--small {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
}
.author-avatar-fallback--small {
    font-size: 1.3rem;
}
.post-author-info { flex: 1; }
.post-author-info .author-bio { margin-top: .3rem; }

/* ── Post footer ── */
.post-footer {
    margin-top: 2rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--border);
    max-width: var(--max-w-text);
}
.post-nav {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    gap: 1rem;
}
.post-nav-link {
    font-family: var(--font-mono);
    font-size: .78rem;
    color: var(--text-muted);
    max-width: 45%;
    line-height: 1.4;
}
.post-nav-link:hover { color: var(--accent); text-decoration: none; }
.post-nav-link--right { text-align: right; margin-left: auto; }
.back-link {
    font-family: var(--font-mono);
    font-size: .76rem;
    color: var(--text-dim);
}
.back-link:hover { color: var(--accent); text-decoration: none; }

/* ── Archive list ── */
.archive-list { list-style: none; }
.archive-item {
    display: flex;
    align-items: baseline;
    gap: 1.25rem;
    padding: .75rem 0;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.archive-item:first-child { border-top: 1px solid var(--border); }
.archive-item time {
    font-family: var(--font-mono);
    font-size: .73rem;
    color: var(--text-dim);
    white-space: nowrap;
    min-width: 90px;
}
.archive-item a { color: var(--heading); font-size: .95rem; }
.archive-item a:hover { color: var(--accent); text-decoration: none; }

/* ── Site footer ── */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 3rem 2rem 2rem;
    background: var(--bg-subtle);
}
.footer-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}
.footer-title {
    font-family: var(--font-mono);
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--heading);
    display: block;
    margin-bottom: .6rem;
}
.footer-col p  { font-size: .88rem; color: var(--text-muted); line-height: 1.7; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: .35rem; }
.footer-col ul a { font-size: .88rem; color: var(--text-muted); }
.footer-col ul a:hover { color: var(--accent); }
.footer-bottom {
    max-width: var(--max-w);
    margin: 0 auto;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: .72rem;
    color: var(--text-dim);
}
.footer-bottom a { color: var(--text-dim); }
.footer-bottom a:hover { color: var(--accent); text-decoration: none; }

/* ── Responsive ── */
@media (max-width: 900px) {
    .blog-layout { grid-template-columns: 1fr; }
    .blog-sidebar { position: static; }
    .footer-inner { grid-template-columns: 1fr 1fr; }
    .post-author-card { flex-direction: column; }
}
@media (max-width: 640px) {
    .footer-inner { grid-template-columns: 1fr; }
    .archive-item { flex-direction: column; gap: .25rem; }
    .post-nav { flex-direction: column; }
    .post-nav-link--right { text-align: left; margin-left: 0; }

    /* Mobile nav */
    .nav-toggle { display: flex; }
    .nav-links {
        position: absolute;
        top: var(--nav-h);
        left: 0; right: 0;
        height: auto;
        flex-direction: column;
        background: rgba(16, 13, 13, 0.97);
        border-bottom: 1px solid var(--border);
        backdrop-filter: blur(12px);
        overflow: hidden;
        max-height: 0;
        opacity: 0;
        transition: max-height .32s cubic-bezier(.4,0,.2,1),
                    opacity    .24s ease;
        pointer-events: none;
    }
    .nav-links.open {
        max-height: 320px;
        opacity: 1;
        pointer-events: auto;
    }
    .nav-indicator { display: none; }
    .nav-link {
        height: auto;
        padding: .8rem 2rem;
        border-bottom: 1px solid var(--border);
        font-size: .85rem;
    }
    .nav-link:last-child { border-bottom: none; }
}
