/* ─────────────────────────────────────────────
   Harsha Hemanth - Blog
   Dark, modern, readable. Standalone (no matrix).
   ───────────────────────────────────────────── */

:root {
    --bg:        #0c0d10;
    --bg-soft:   #14161b;
    --border:    #232730;
    --text:      #e6e8ee;
    --text-dim:  #9aa3b2;
    --text-faint:#646c7a;
    --accent:    #4ade80;
    --accent-dim:#2f9e5c;
    --radius:    14px;
    --maxw:      860px;
    --wide:      1100px;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto,
                 Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

::selection { background: rgba(74, 222, 128, 0.25); }

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

.wrap {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 24px;
}

/* ── Top bar ─────────────────────────────────── */
.site-header {
    border-bottom: 1px solid var(--border);
    background: rgba(12, 13, 16, 0.85);
    backdrop-filter: saturate(140%) blur(10px);
    position: sticky;
    top: 0;
    z-index: 20;
}
.site-header .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}
.brand {
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text);
    font-size: 16px;
}
.brand .dot { color: var(--accent); }
.nav a {
    color: var(--text-dim);
    margin-left: 22px;
    font-size: 14px;
}
.nav a:hover { color: var(--text); text-decoration: none; }

/* ── Blog index / hero ───────────────────────── */
.page-head {
    padding: 64px 0 28px;
}
.page-head h1 {
    font-size: 34px;
    letter-spacing: -0.02em;
    line-height: 1.2;
}
.page-head p {
    color: var(--text-dim);
    margin-top: 12px;
    font-size: 17px;
}

/* ── Post list ───────────────────────────────── */
.post-list { list-style: none; padding-bottom: 80px; }
.post-list li { border-top: 1px solid var(--border); }
.post-list li:last-child { border-bottom: 1px solid var(--border); }
.post-link {
    display: block;
    padding: 24px 0;
    color: inherit;
}
.post-link:hover { text-decoration: none; }
.post-link:hover .post-title { color: var(--accent); }
.post-meta {
    font-size: 13px;
    color: var(--text-faint);
    letter-spacing: 0.02em;
    margin-bottom: 6px;
}
.post-title {
    font-size: 21px;
    font-weight: 650;
    letter-spacing: -0.01em;
    transition: color 0.15s ease;
}
.post-excerpt {
    color: var(--text-dim);
    margin-top: 8px;
    font-size: 16px;
}

/* ── Article ─────────────────────────────────── */
.article { padding: 56px 0 96px; }
.article .back {
    font-size: 14px;
    color: var(--text-dim);
    display: inline-block;
    margin-bottom: 36px;
}
.article header { margin-bottom: 40px; }
.article h1 {
    font-size: 36px;
    line-height: 1.18;
    letter-spacing: -0.025em;
}
.article .post-meta {
    margin: 16px 0 0;
    font-size: 14px;
}

.article-body { font-size: 18px; }
.article-body > * + * { margin-top: 24px; }
.article-body h2 {
    font-size: 25px;
    letter-spacing: -0.02em;
    margin-top: 48px;
    line-height: 1.3;
}
.article-body h3 {
    font-size: 20px;
    margin-top: 36px;
}
.article-body p { color: #d4d8e0; }
.article-body ul, .article-body ol { padding-left: 24px; }
.article-body li { margin-top: 8px; color: #d4d8e0; }
.article-body blockquote {
    border-left: 3px solid var(--accent-dim);
    padding: 4px 0 4px 20px;
    color: var(--text-dim);
    font-style: italic;
}
.article-body code {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1px 6px;
    font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
    font-size: 0.88em;
    color: var(--accent);
}
.article-body pre {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    overflow-x: auto;
}
.article-body pre code {
    background: none;
    border: none;
    padding: 0;
    color: var(--text);
}
.article-body img {
    max-width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.article-body hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 40px 0;
}
.article-body table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}
.article-body th, .article-body td {
    border: 1px solid var(--border);
    padding: 8px 12px;
    text-align: left;
    vertical-align: top;
}
.article-body th { background: var(--bg-soft); color: var(--text); }
.article-body td:first-child { color: var(--text-dim); white-space: nowrap; }

/* ── Embedded explainer (iframe) ─────────────── */
/* Breaks out of the text column so the diagram gets full width. */
.embed {
    margin-top: 32px;
    width: var(--wide);
    max-width: calc(100vw - 48px);
    position: relative;
    left: 50%;
    transform: translateX(-50%);
}
.embed iframe {
    width: 100%;
    height: 780px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #0b0e14;
}
.embed .embed-cap {
    font-size: 13px;
    color: var(--text-faint);
    text-align: center;
    margin-top: 10px;
}
@media (max-width: 640px) {
    .embed iframe { height: 860px; }
}
.embed.tall iframe { height: 1020px; }
@media (max-width: 640px) {
    .embed.tall iframe { height: 1160px; }
}

/* ── Article footer / share ──────────────────── */
.article-foot {
    margin-top: 64px;
    padding-top: 28px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    color: var(--text-dim);
    font-size: 14px;
}
.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-dim);
    font-size: 13px;
    cursor: pointer;
    background: var(--bg-soft);
    transition: border-color 0.15s ease, color 0.15s ease;
}
.share-btn:hover { border-color: var(--accent-dim); color: var(--text); text-decoration: none; }

/* ── Footer ──────────────────────────────────── */
.site-footer {
    border-top: 1px solid var(--border);
    color: var(--text-faint);
    font-size: 13px;
    padding: 28px 0;
    text-align: center;
}
.site-footer a { color: var(--text-dim); }

@media (max-width: 640px) {
    .page-head h1 { font-size: 28px; }
    .article h1 { font-size: 28px; }
    .article-body { font-size: 17px; }
}
