@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ============================================================
   akarshiev.blog — stylesheet
   ============================================================ */

:root {
    --bg:           #0d0d0f;
    --surface:      #16161a;
    --surface-hover:#1c1c21;
    --border:       #26262c;
    --text:         #ecebe8;
    --text-muted:   #8d8d93;
    --accent:       #e0a458;
    --accent-hover: #eab676;
    --accent-soft:  rgba(224, 164, 88, 0.12);
    --red:          #f87171;
    --green:        #4ade80;
    --radius:       12px;
    --t:            0.2s ease;
    --nav-h:        108px;
    --content-w:    680px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: inherit; }
.icon { width: 17px; height: 17px; flex-shrink: 0; }

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    max-width: 760px;
    margin: 0 auto;
    padding: 18px 20px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.navbar.nav-hidden { transform: translateY(-110%); opacity: 0; }

.nav-pill {
    display: flex;
    align-items: center;
    gap: 2px;
    background: rgba(22, 22, 26, 0.88);
    backdrop-filter: blur(14px);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px;
    overflow-x: auto;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    transition: color var(--t), background var(--t);
}
.nav-item:hover { color: var(--text); background: var(--surface-hover); }
.nav-item.active { color: var(--accent); background: var(--accent-soft); }

/* ── Container ──────────────────────────────────────────────── */
.container {
    max-width: 720px;
    margin: 0 auto;
    padding: var(--nav-h) 24px 80px;
    flex: 1;
    width: 100%;
}

/* ── Home intro ─────────────────────────────────────────────── */
.intro { display: flex; flex-direction: column; gap: 14px; margin-bottom: 28px; }

.avatar {
    width: 72px; height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
    margin-bottom: 6px;
}

.intro p {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    color: var(--text-muted);
    max-width: 540px;
}
.intro p.greeting { color: var(--text); font-size: 1.05rem; }

.intro-links { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 4px; }
.intro-links a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
    text-decoration: none;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    transition: opacity var(--t);
}
.intro-links a:hover { opacity: 0.75; }
.intro-links a svg { width: 18px; height: 18px; }

.divider { border: none; border-top: 1px solid var(--border); margin: 28px 0; }

.find-me .label { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 14px; }
.social-row { display: flex; flex-wrap: wrap; gap: 20px; }
.social-link {
    display: flex; align-items: center; gap: 6px;
    color: var(--text-muted); text-decoration: none; font-size: 0.85rem;
    transition: color var(--t);
}
.social-link:hover { color: var(--accent); }
.social-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 15px; height: 15px; border-radius: 3px;
    background: var(--text-muted); color: var(--bg);
    font-size: 0.6rem; font-weight: 800;
}
.social-link:hover .social-badge { background: var(--accent); }

/* ── Page headings ──────────────────────────────────────────── */
.page-title         { font-size: 1.6rem; font-weight: 700; margin-bottom: 8px; }
.page-title-centered{ text-align: center; font-size: 1.3rem; font-weight: 600; color: var(--text-muted); margin-bottom: 36px; }
.page-subtitle      { font-size: 0.95rem; color: var(--text-muted); margin-bottom: 28px; max-width: 520px; }

/* ── Post list ──────────────────────────────────────────────── */
.post-list { display: flex; flex-direction: column; }
.post-row {
    display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
    padding: 15px 0; border-bottom: 1px solid var(--border);
    text-decoration: none; color: inherit; transition: opacity var(--t);
}
.post-row:hover { opacity: 0.72; }
.post-row:hover .post-row-title { color: var(--accent); }
.post-row-title { font-size: 0.97rem; font-weight: 600; transition: color var(--t); }
.post-row-date  { font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }

/* ── Article page ───────────────────────────────────────────── */
.breadcrumb {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.85rem; margin-bottom: 24px;
}
.breadcrumb a { color: var(--text-muted); text-decoration: none; transition: color var(--t); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb-sep  { color: var(--border); }
.breadcrumb-slug { color: var(--text-muted); font-family: 'JetBrains Mono', monospace; font-size: 0.78rem; }

.article-header h1 {
    font-size: 1.85rem; font-weight: 800; letter-spacing: -0.5px;
    line-height: 1.25; margin-bottom: 14px;
}
.article-meta {
    display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
    color: var(--text-muted); font-size: 0.85rem; margin-bottom: 32px;
}
.article-image {
    width: 100%; max-height: 420px; object-fit: cover;
    border-radius: var(--radius); border: 1px solid var(--border);
    margin-bottom: 32px; display: block;
}
.tag {
    background: var(--surface); border: 1px solid var(--border);
    padding: 3px 10px; border-radius: 20px; font-size: 0.75rem; color: var(--text-muted);
}

/* ── Blog content typography ─────────────────────────────────── */
.blog-content {
    font-size: 1.03rem;
    line-height: 1.85;
    color: var(--text);
    /* slightly wider characters for readability */
    letter-spacing: 0.01em;
}

.blog-content h1,
.blog-content h2,
.blog-content h3,
.blog-content h4 {
    font-weight: 700;
    line-height: 1.3;
    scroll-margin-top: 100px;
    color: var(--text);
}
.blog-content h1 { font-size: 1.7rem;  margin-top: 40px; margin-bottom: 16px; }
.blog-content h2 {
    font-size: 1.35rem;
    margin-top: 40px; margin-bottom: 14px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}
.blog-content h3 { font-size: 1.15rem; margin-top: 32px; margin-bottom: 12px; }
.blog-content h4 { font-size: 1.0rem;  margin-top: 24px; margin-bottom: 10px; }

.blog-content p { margin-bottom: 18px; }

/* Centered images */
.blog-content img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 24px auto;       /* ← center */
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

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

.blog-content ul,
.blog-content ol {
    margin-bottom: 18px;
    padding-left: 28px;
}
.blog-content li { margin-bottom: 8px; }

.blog-content blockquote {
    border-left: 3px solid var(--accent);
    padding: 4px 0 4px 20px;
    margin: 24px 0;
    color: var(--text-muted);
    font-style: italic;
}
.blog-content blockquote p { margin-bottom: 0; }

.blog-content hr { border: none; border-top: 1px solid var(--border); margin: 32px 0; }

/* Inline code */
.blog-content :not(pre) > code {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 2px 7px;
    border-radius: 5px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.84em;
    color: var(--accent);
}

/* Code blocks */
.blog-content pre {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 20px 20px 20px;
    overflow-x: auto;
    margin-bottom: 24px;
}
.blog-content pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.875rem;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text);
    line-height: 1.65;
}

/* Copy button */
.code-copy-btn {
    position: absolute;
    top: 10px; right: 10px;
    padding: 4px 10px;
    background: var(--surface-hover);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    cursor: pointer;
    opacity: 0;
    transition: opacity var(--t), color var(--t), border-color var(--t);
    user-select: none;
}
.blog-content pre:hover .code-copy-btn { opacity: 1; }
.code-copy-btn:hover  { color: var(--text); border-color: var(--text-muted); }
.code-copy-btn.copied { color: var(--green); border-color: var(--green); opacity: 1; }

/* Tables */
.blog-content table {
    width: 100%; border-collapse: collapse;
    margin: 24px 0; font-size: 0.9rem;
}
.blog-content th,
.blog-content td { padding: 10px 16px; border: 1px solid var(--border); text-align: left; }
.blog-content th { background: var(--surface); font-weight: 600; }
.blog-content tr:nth-child(even) td { background: rgba(22,22,26,0.4); }

/* Reading progress */
.reading-progress {
    position: fixed; top: 0; left: 0;
    height: 2px; background: var(--accent);
    z-index: 200; transition: width 0.1s linear;
}

/* Post footer */
.post-footer {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--border);
}
.post-footer-back,
.post-footer-share {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--text-muted); text-decoration: none; font-size: 0.9rem;
    background: none; border: none; cursor: pointer; transition: color var(--t);
}
.post-footer-back:hover,
.post-footer-share:hover { color: var(--accent); }

/* ── Bookmarks ───────────────────────────────────────────────── */
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.filter-btn {
    padding: 6px 14px; border-radius: 20px;
    font-size: 0.8rem; font-weight: 500;
    color: var(--text-muted); background: var(--surface);
    border: 1px solid var(--border); cursor: pointer;
    transition: all var(--t);
}
.filter-btn:hover,
.filter-btn.active { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

.bookmark-list { display: flex; flex-direction: column; }
.bookmark-row {
    display: flex;
    justify-content: space-between; align-items: center; gap: 16px;
    padding: 13px 0; text-decoration: none; color: inherit;
    border-bottom: 1px solid var(--border); transition: opacity var(--t);
}
.bookmark-row:hover { opacity: 0.72; }
.bookmark-row:hover .bookmark-row-title { color: var(--accent); }
.bookmark-row-title  { font-size: 0.92rem; transition: color var(--t); }
.bookmark-row-domain { font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }

/* Filter fix: hide with class, not inline style — avoids display type conflicts */
.bm-hidden { display: none !important; }

/* ── Building ────────────────────────────────────────────────── */
.project-grid { display: grid; gap: 12px; }
.project-card {
    display: block; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 20px; text-decoration: none; color: inherit;
    transition: border-color var(--t), transform var(--t);
}
.project-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.project-name { font-size: 1rem; font-weight: 600; color: var(--accent); }
.project-desc { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 12px; margin-top: 6px; }
.project-lang {
    font-size: 0.75rem; color: var(--text-muted);
    background: var(--bg); padding: 3px 10px;
    border-radius: 20px; display: inline-block;
}

/* ── Empty / Error ───────────────────────────────────────────── */
.empty-state { text-align: center; padding: 60px 0; color: var(--text-muted); }

.error-page { text-align: center; padding: 80px 0; }
.error-page h1 { font-size: 5rem; font-weight: 800; color: var(--accent); margin-bottom: 16px; }
.error-page p  { color: var(--text-muted); margin-bottom: 24px; }
.error-page a  { color: var(--accent); text-decoration: none; }

/* ── Footer ──────────────────────────────────────────────────── */
.footer {
    text-align: center; padding: 24px;
    color: var(--text-muted); font-size: 0.82rem;
    border-top: 1px solid var(--border); margin-top: auto;
}

/* ── Scroll-to-top ───────────────────────────────────────────── */
.scroll-top {
    position: fixed; bottom: 28px; right: 28px;
    width: 42px; height: 42px; border-radius: 50%;
    background: var(--surface); border: 1px solid var(--border);
    color: var(--text-muted); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transform: translateY(10px);
    transition: all var(--t); z-index: 90;
}
.scroll-top.visible { opacity: 1; transform: translateY(0); }
.scroll-top:hover   { color: var(--accent); border-color: var(--accent); }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 640px) {
    :root { --nav-h: 96px; }
    .navbar { padding: 12px 16px 0; }
    .nav-item span { display: none; }
    .nav-item { padding: 10px; }
    .article-header h1 { font-size: 1.5rem; }
    .post-row { flex-direction: column; align-items: flex-start; gap: 4px; }
    .scroll-top { bottom: 16px; right: 16px; }
}

/* ── Pygments (github-dark) ──────────────────────────────────── */
.highlight { background: var(--surface); }
.highlight .c,.highlight .cm,.highlight .c1,.highlight .cs { color: #8b949e; font-style: italic }
.highlight .k,.highlight .kd,.highlight .kn,.highlight .kr { color: #ff7b72 }
.highlight .o,.highlight .kc,.highlight .kp,.highlight .ow { color: #79c0ff }
.highlight .s,.highlight .sb,.highlight .sc,.highlight .sd,
.highlight .s2,.highlight .s1,.highlight .si,.highlight .sx  { color: #a5d6ff }
.highlight .nb,.highlight .nc,.highlight .no,.highlight .nf,
.highlight .nn,.highlight .nt,.highlight .nv,.highlight .bp,
.highlight .fm,.highlight .vc,.highlight .vg,.highlight .vi  { color: #e3b341 }
.highlight .nd,.highlight .nf { color: #d2a8ff }
.highlight .m,.highlight .mb,.highlight .mf,.highlight .mi,
.highlight .mo,.highlight .il { color: #79c0ff }
.highlight .gd { color: #ffa198 }
.highlight .gi { color: #56d364 }
