/* ============================================================
   Portfolio – Global Styles  v3
   Exact clone of the screenshots (spacing, fonts, elements)
   ============================================================ */

/* Sans-serif for UI, Serif for reading */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Lora:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
    /* Dark Theme (Default as per Home screenshot) */
    --bg:              #0a0a0a;
    --surface:         #0a0a0a;
    --border:          #333;
    --border-subtle:   #222;
    --text-primary:    #ededed;
    --text-secondary:  #a1a1aa;
    --text-muted:      #71717a;
    --link:            #ededed;
    --link-hover:      #ffffff;
    
    --font-sans:       'Inter', system-ui, -apple-system, sans-serif;
    --font-serif:      'Lora', Georgia, serif;
    --transition:      0.15s ease;
}

[data-theme="light"] {
    /* Light Theme (As per Blog/Projects screenshots) */
    --bg:              #fafafa;
    --surface:         #ffffff;
    --border:          #eaeaea;
    --border-subtle:   #f0f0f0;
    --text-primary:    #111111;
    --text-secondary:  #444444;
    --text-muted:      #888888;
    --link:            #111111;
    --link-hover:      #000000;
}

/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background var(--transition), color var(--transition);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--link);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover { color: var(--link-hover); text-decoration: underline; text-underline-offset: 4px; }

strong, b { font-weight: 600; color: var(--text-primary); }

/* ── Layout & Container ─────────────────────────────────────── */
.site-container {
    max-width: 720px; /* 672px content + 48px padding */
    margin: 0 auto;
    padding: 64px 24px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* The Theme Toggle (Top Right) */
.theme-toggle {
    position: fixed;
    top: 24px;
    right: 24px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    z-index: 100;
    padding: 8px;
    border-radius: 50%;
}
.theme-toggle:hover { color: var(--text-primary); }
.theme-toggle svg { width: 20px; height: 20px; fill: currentColor; }

/* ── Global Top Navbar (Like Blog/Projects screenshot) ──────── */
.top-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 40px;
    font-size: 0.9rem;
}
.top-navbar .brand {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-primary);
    text-decoration: none;
}
.top-navbar .brand.sans {
    font-family: var(--font-sans);
    font-weight: 400;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.top-navbar-links {
    display: flex;
    gap: 20px;
}
.top-navbar-links a {
    color: var(--text-muted);
    text-decoration: none;
}
.top-navbar-links a:hover { color: var(--text-primary); text-decoration: none; }
.top-navbar-links a.active { color: var(--text-primary); text-decoration: underline; text-underline-offset: 6px; text-decoration-color: #a4c9a4; text-decoration-thickness: 2px;}

/* ── Home Page Specifically ─────────────────────────────────── */
.home-layout {
    max-width: 720px; /* 672px content + 48px padding */
    margin: 0 auto;
    padding: 64px 24px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 30px;
    display: block;
}

.home-name {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.home-bio {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 40px;
}
.home-bio p { margin-bottom: 16px; }

.home-links { list-style: none; }
.home-links li {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 14px;
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.home-links li::before {
    content: '-';
    color: var(--text-secondary);
}
.home-links a {
    color: var(--text-primary);
    text-decoration: none;
}
.home-links a.external::after {
    content: ' →';
    font-family: var(--font-mono);
    font-size: 0.9em;
}

.home-footer {
    margin-top: auto;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ── Blog List Page ─────────────────────────────────────────── */
.blog-intro {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 40px;
}
.blog-intro a { color: #a4c9a4; text-decoration: none; } /* Greenish accent like in the screenshot */
.blog-intro a:hover { text-decoration: underline; }

.section-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 40px 0;
}

.section-heading {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 30px;
    color: var(--text-primary);
}

.post-list { list-style: none; }
.post-item {
    margin-bottom: 48px;
}
.post-item h3 {
    font-family: var(--font-serif);
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 6px;
}
.post-item h3 a { color: var(--text-primary); text-decoration: none; }
.post-item h3 a:hover { text-decoration: underline; }

.post-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.post-excerpt {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.view-all-link {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-decoration: none;
}
.view-all-link::after { content: ' →'; }

/* ── Blog Post Single ───────────────────────────────────────── */
.post-single {
    font-family: var(--font-serif);
}
.post-single-title {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 12px;
    color: var(--text-primary);
}
.post-single-date {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 40px;
}
.post-content {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--text-primary);
}
.post-content p { margin-bottom: 24px; }
.post-content h2 { font-size: 1.6rem; margin: 40px 0 20px; font-weight: 700; }
.post-content h3 { font-size: 1.3rem; margin: 30px 0 16px; font-weight: 700; }
.post-content ul, .post-content ol { padding-left: 20px; margin-bottom: 24px; }
.post-content li { margin-bottom: 8px; }
.post-content blockquote {
    border-left: 3px solid var(--border);
    padding-left: 20px;
    margin: 30px 0;
    font-style: italic;
    color: var(--text-secondary);
}
.post-content a { color: var(--text-primary); text-decoration: underline; text-underline-offset: 3px; }
.post-content pre {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 20px;
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 24px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
}
.post-content code {
    font-family: var(--font-mono);
    background: var(--surface);
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 0.9em;
}
.post-content pre code { padding: 0; background: none; }

/* ── Projects Page ──────────────────────────────────────────── */
.projects-header { margin-bottom: 40px; }
.projects-header h1 {
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 12px;
}
.projects-header p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.project-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.project-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.project-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
    flex: 1;
}

.project-card .gh-link {
    font-size: 0.85rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}
.project-card .gh-link::after { content: ' →'; margin-left: 4px; }

/* Dynamic colors for the "View on GitHub ->" link based on nth-child to match the screenshot vibe */
.project-card:nth-child(4n+1) .gh-link { color: #8b5cf6; } /* purple */
.project-card:nth-child(4n+2) .gh-link { color: #f97316; } /* orange */
.project-card:nth-child(4n+3) .gh-link { color: #10b981; } /* green */
.project-card:nth-child(4n+4) .gh-link { color: #3b82f6; } /* blue */

.project-card:nth-child(4n+1) .gh-link:hover { text-decoration: underline; text-decoration-color: #8b5cf6; }
.project-card:nth-child(4n+2) .gh-link:hover { text-decoration: underline; text-decoration-color: #f97316; }
.project-card:nth-child(4n+3) .gh-link:hover { text-decoration: underline; text-decoration-color: #10b981; }
.project-card:nth-child(4n+4) .gh-link:hover { text-decoration: underline; text-decoration-color: #3b82f6; }

@media (max-width: 650px) {
    .projects-grid { grid-template-columns: 1fr; }
    .top-navbar { flex-direction: column; align-items: flex-start; gap: 16px; }
}

/* Empty State */
.empty-state {
    padding: 60px 0;
    text-align: left;
    color: var(--text-muted);
}