
:root {
    --bg-color: #f4f1ea;
    --text-color: #222222;
    --text-muted: #555555;
    --border-color: #e2e8f0;
    --header-bg: rgba(244, 241, 234, 0.85);
    --card-bg: #ffffff;
    --card-border: #cbd5e1;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    --card-hover-shadow: 0 12px 24px rgba(99, 102, 241, 0.15);
    --card-hover-border: #818cf8;
    --accent-color: #6366f1;
    --btn-text: #ffffff;
    --tag-bg: #e0e7ff;
    --tag-text: #4338ca;
    
    --syntax-keyword: #db2777;
    --syntax-func: #2563eb;
    --syntax-string: #059669;
    --syntax-comment: #94a3b8;
    --syntax-number: #d97706;
    --syntax-operator: #0891b2;
    --syntax-variable: #dc2626;
    --syntax-accent: #4f46e5;
    
    --canvas-p1: 99, 102, 241;
    --canvas-p2: 219, 39, 119;
    --canvas-p3: 5, 150, 105;
    --canvas-line: 99, 102, 241;
}

[data-theme="dark"] {
    --bg-color: #080c12;
    --text-color: #c5c8c6;
    --text-muted: #5c6370;
    --border-color: #131820;
    --header-bg: rgba(8, 12, 18, 0.82);
    --card-bg: rgba(13, 17, 23, 0.92);
    --card-border: #151a23;
    --card-shadow: none;
    --card-hover-shadow: 0 0 40px rgba(0, 255, 156, 0.04);
    --card-hover-border: rgba(0, 255, 156, 0.18);
    --accent-color: #00ff9c;
    --btn-text: #080c12;
    --tag-bg: rgba(0, 255, 156, 0.1);
    --tag-text: #00ff9c;
    
    --syntax-keyword: #c678dd;
    --syntax-func: #61afef;
    --syntax-string: #98c379;
    --syntax-comment: #5c6370;
    --syntax-number: #d19a66;
    --syntax-operator: #56b6c2;
    --syntax-variable: #e06c75;
    --syntax-accent: #00ff9c;
    
    --canvas-p1: 0, 255, 156;
    --canvas-p2: 97, 175, 239;
    --canvas-p3: 198, 120, 221;
    --canvas-line: 0, 255, 156;
}

body {
    font-family: 'Agenda', sans-serif; ; font-weight: 400;
    background: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    line-height: 1.6;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Base font for code-like elements */
.sk, .sf, .ss, .sc, .sn, .so, .sv, .sg, .code-block, .btn-read, .archive-link, .nav-link, .logo, .hero-label, .section-label {
    font-family: 'JetBrains Mono', monospace;
}

@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,300;0,6..72,400;0,6..72,500;1,6..72,400;1,6..72,500&display=swap');

/* Variables and Resets */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}



/* Layout Utilities */
.container {
    max-width: 64rem;
    margin: 0 auto;
    width: 100%;
}

.content-wrapper {
    position: relative;
    z-index: 10;
}

.section-pad {
    padding: 3.5rem 1.5rem;
}

.section-bg {
    background: var(--bg-color);
}

.section-bg-alt {
    background: var(--bg-color);
}

.hidden {
    display: none !important;
}

/* Typography & Syntax Palette */
.sk { color: var(--syntax-keyword); } /* keyword */
.sf { color: var(--syntax-func); } /* function */
.ss { color: var(--syntax-string); } /* string */
.sc { color: var(--syntax-comment); font-style: italic; } /* comment */
.sn { color: var(--syntax-number); } /* number */
.so { color: var(--syntax-operator); } /* operator */
.sv { color: var(--syntax-variable); } /* variable */
.sg { color: var(--syntax-accent); } /* accent */

/* Header */
.site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 50;
    background: var(--header-bg);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-color);
}

.header-inner {
    height: 3.5rem;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--text-color);
}

.desktop-nav {
    display: none;
    align-items: center;
    gap: 1.75rem;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.mobile-toggle {
    font-size: 0.75rem;
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
}

.mobile-nav {
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.nav-link {
    color: var(--syntax-comment);
    text-decoration: none;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--syntax-accent);
}

/* Hero Section */
.hero-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 3.5rem;
}

.section-label {
    margin-bottom: 1.25rem;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.hero-title {
    font-size: 1.875rem;
    font-weight: 300;
    line-height: 1.2;
    margin-bottom: 2rem;
}

.hero-desc {
    font-size: 0.875rem;
    max-width: 36rem;
    margin-bottom: 0.75rem;
    line-height: 1.625;
}

.hero-hint {
    font-size: 0.7rem;
    margin-bottom: 3rem;
    opacity: 0.5;
}

.btn-read {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    text-decoration: none;
    transition: color 0.2s;
}
.btn-read:hover {
    color: var(--syntax-accent);
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.65rem;
    opacity: 0.4;
}

/* Articles Section */
.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.375rem;
}
.section-desc {
    font-size: 0.875rem;
    margin-bottom: 3rem;
}

.articles-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.article-title {
    font-size: 1.125rem;
    font-weight: 500;
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
}

.article-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}





.article-card:hover .line-num {
    color: rgba(0, 255, 156, 0.2);
}

.article-inner {
    padding: 1.25rem;
    display: flex;
    gap: 1rem;
}

.article-lines {
    display: flex;
    flex-direction: column;
    font-size: 0.75rem;
    padding-top: 0.125rem;
    line-height: 1.75;
}

.article-content {
    flex: 1;
    font-size: 0.875rem;
    min-width: 0;
    line-height: 1.75;
}

.spacer {
    margin-top: 0.375rem;
}

.article-

.article-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.75rem;
}

.read-link {
    margin-left: auto;
    text-decoration: none;
    transition: color 0.2s;
}
.read-link:hover { color: var(--syntax-accent); }

.view-archive {
    margin-top: 3rem;
    text-align: center;
}
.archive-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    text-decoration: none;
    transition: color 0.2s;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.archive-link:hover { color: var(--syntax-accent); }

/* About Section */
.code-block {
    max-width: 42rem;
    font-size: 0.875rem;
    line-height: 1.95;
}
.code-line {
    display: flex;
}
.code-text {
    white-space: pre-wrap;
}

/* Subscribe Section */
.subscribe-form-container {
    max-width: 32rem;
}

.subscribe-form {
    display: flex;
    gap: 0.75rem;
}

.sub-input {
    background: #0d1117;
    border: 1px solid #1a1f29;
    color: var(--text-color);
    font-family: 'JetBrains Mono', monospace;
    transition: border-color 0.3s;
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    border-radius: 0.5rem;
}

.sub-input::placeholder { color: #3a3f4b; }
.sub-input:focus { outline: none; border-color: rgba(0, 255, 156, 0.35); }

.sub-btn {
    background: var(--syntax-accent);
    color: var(--bg-color);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    transition: box-shadow 0.3s, transform 0.15s;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
}

.sub-btn:hover { box-shadow: 0 0 24px rgba(0, 255, 156, 0.2); }
.sub-btn:active { transform: scale(0.97); }

.subscribe-note {
    font-size: 0.7rem;
    margin-top: 1rem;
}

/* Footer */
.site-footer {
    padding: 2.5rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: rgba(8, 12, 18, 0.98);
}
.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
}
.footer-left {
    font-size: 0.75rem;
}
.copyright {
    display: block;
    margin-top: 0.25rem;
}
.footer-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-size: 0.75rem;
}

/* Components */


.line-num {
    color: #2a2f3a;
    user-select: none;
    min-width: 2.2ch;
    text-align: right;
    padding-right: 1.4em;
    border-right: 1px solid var(--card-border);
    margin-right: 1.4em;
    transition: color 0.4s;
}

#spacetime-canvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.hero-cursor {
    display: inline-block;
    width: 11px;
    height: 1.15em;
    background: var(--syntax-accent);
    margin-left: 3px;
    vertical-align: text-bottom;
    animation: blink 1s step-end infinite;
}

@keyframes scrollBounce {
    0%, 100% { transform: translateY(0) translateX(-50%); opacity: 0.5; }
    50% { transform: translateY(7px) translateX(-50%); opacity: 0.15; }
}

.scroll-anim {
    animation: scrollBounce 2.4s ease-in-out infinite;
    transform: translateX(-50%);
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg-color); }
::-webkit-scrollbar-thumb { background: #1a1f29; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #2a2f39; }
::selection { background: rgba(0, 255, 156, 0.14); color: var(--syntax-accent); }
a:focus-visible { outline: 1px solid var(--syntax-accent); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
    .hero-cursor, .scroll-anim { animation: none; }
    html { scroll-behavior: auto; }
}

/* ========================================= */
/* Article Layout & TOC                      */
/* ========================================= */
.article-layout {
    max-width: 1000px;
    margin: 0 auto;
    padding: 6rem 1.25rem 4rem; /* Reduced for mobile */
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: flex-start;
}

.article-content-wrapper {
    flex: 1;
    width: 100%;
    max-width: 700px;
}

.article-layout .article-content-wrapper {
    padding: 0;
    margin: 0;
}

/* TOC Styling */
.article-toc {
    position: sticky;
    top: 7rem;
    width: 200px;
    flex-shrink: 0;
}

.toc-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

.toc-nav {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
}

.toc-link {
    color: var(--syntax-comment);
    text-decoration: none;
    transition: color 0.2s;
    line-height: 1.5;
}

.toc-link:hover {
    color: var(--syntax-accent);
}

.lg-block {
    display: none;
}

@media (min-width: 1024px) {
    .lg-block { display: block; }
    .article-layout {
        padding: 8rem 1.5rem 6rem;
        flex-direction: row;
        gap: 4rem;
    }
}

/* ========================================= */
/* Article Prose (High Readability Styling)  */
/* ========================================= */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--syntax-comment);
    text-decoration: none;
    margin-bottom: 2.5rem;
    transition: color 0.2s;
    font-family: 'JetBrains Mono', monospace;
}
.back-link:hover {
    color: var(--syntax-accent);
}

.prose {
    font-family: 'Agenda', sans-serif; ; font-weight: 400;
    font-weight: 500;
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--text-color);
}

.prose h1, .prose h2, .prose h3 {
    scroll-margin-top: 6rem;
}

.prose h1 {
    font-family: 'Agenda', sans-serif; ; font-weight: 400;
    font-size: 2rem;
    margin-bottom: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.2;
}

.prose h2 {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.35rem;
    margin-top: 3rem;
    margin-bottom: 1rem;
    color: var(--syntax-func);
    font-weight: 500;
}

.prose h2::before {
    content: "## ";
    color: var(--syntax-comment);
}

.prose p {
    margin-bottom: 1.5rem;
}

.prose strong {
    color: var(--text-color);
    font-weight: 600;
}

.prose blockquote {
    border-left: 3px solid var(--syntax-keyword);
    padding-left: 1.25rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--text-color);
    background: rgba(198, 120, 221, 0.05);
    padding: 1rem 1.25rem;
    border-radius: 0 0.5rem 0.5rem 0;
    font-size: 1.05rem;
}

@media (min-width: 768px) {
    .prose {
        font-size: 1.25rem; /* 20px */
        line-height: 1.7;
    }
    .prose h1 {
        font-size: 2.5rem;
        margin-bottom: 1.5rem;
    }
    .prose h2 {
        font-size: 1.5rem;
        margin-top: 3.5rem;
        margin-bottom: 1.25rem;
    }
    .prose blockquote {
        padding-left: 1.5rem;
        padding: 1rem 1.5rem;
        margin: 2.5rem 0;
        font-size: inherit;
    }
}

/* ========================================= */
/* Index Responsive Breakpoints              */
/* ========================================= */
@media (min-width: 640px) {
    .section-pad { padding: 6rem 1.5rem; }
    .hero-title { font-size: 2.25rem; }
    .hero-desc { font-size: 1rem; }
    .desktop-nav { display: flex; }
    .mobile-toggle { display: none; }
    .mobile-nav { display: none !important; }
    .section-title { font-size: 1.875rem; }
    .article-inner { padding: 1.75rem; }
    .footer-inner { flex-direction: row; justify-content: space-between; align-items: center; }
}

@media (min-width: 768px) {
    .hero-title { font-size: 2.5rem; }
}

@media (min-width: 1024px) {
    .hero-title { font-size: 3.6rem; }
}

.theme-toggle-btn {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background 0.3s ease;
}
.theme-toggle-btn:hover {
    background: rgba(128, 128, 128, 0.1);
}
[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }
:root:not([data-theme="dark"]) .sun-icon { display: none; }
:root:not([data-theme="dark"]) .moon-icon { display: block; }

.article-card {
    border: 1px solid var(--card-border);
    border-radius: 12px;
    background: var(--card-bg);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: transform 300ms cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.3s, box-shadow 0.3s;
}

.article-card:hover {
    border-color: var(--card-hover-border);
    box-shadow: var(--card-hover-shadow);
    transform: translateY(-4px);
}

.tag {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    background: var(--tag-bg);
    color: var(--tag-text);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
}


/* ────────────────────────────────────────────── */
/* 2-COLUMN SIDEBAR LAYOUT */
/* ────────────────────────────────────────────── */

.layout-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
}


@media (min-width: 900px) {
    .layout-grid {
        grid-template-columns: 2fr 1fr;
        gap: 5rem;
    }
    
    .sidebar-column {
        position: sticky;
        top: 6rem;
        height: max-content;
    }
}


.category-heading {
    font-size: 0.875rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #ec4899; /* Bright pink */
    margin-bottom: 2rem;
    font-family: 'Agenda', sans-serif; ; font-weight: 400;
}

/* MAIN COLUMN (ARTICLES) */
.articles-list {
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

.flat-article {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.flat-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-color);
    margin: 0;
    font-family: 'Agenda', sans-serif; ;
    line-height: 1.2;
}

.flat-subtitle {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    margin: 0;
}

.flat-body {
    font-size: 1.125rem;
    color: var(--text-color);
    line-height: 1.7;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.flat-read-link {
    font-weight: 700;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.95rem;
}

.flat-read-link:hover {
    text-decoration: underline;
    text-decoration-color: var(--accent-color);
    text-decoration-thickness: 2px;
}

/* SIDEBAR */
.sidebar-column {
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

.category-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.category-pill {
    background: #dbeafe; /* Light blue */
    color: #1e3a8a; /* Dark blue text */
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.category-pill:hover {
    background: #bfdbfe;
}

[data-theme="dark"] .category-pill {
    background: rgba(97, 175, 239, 0.15);
    color: #61afef;
}
[data-theme="dark"] .category-pill:hover {
    background: rgba(97, 175, 239, 0.3);
}
[data-theme="dark"] .category-heading {
    color: #f472b6;
}

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

.popular-list li a {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1.4;
    transition: color 0.2s;
}

.popular-list li a:hover {
    color: var(--accent-color);
}

.arrow-icon {
    flex-shrink: 0;
    margin-top: 0.15rem;
    color: var(--text-color);
}

.category-pill.active {
    background: var(--accent-color);
    color: #ffffff;
}
