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

:root{
    /* Solarized-ish dark theme */
    --bg:#002b36; /* base03 */
    --surface:#073642; /* base02 */
    --muted:#586e75; /* base0 */
    --text:#93a1a1; /* base1 */
    --accent-1:#b58900; /* yellow */
    --accent-2:#859900; /* green */
    --accent-3:#2aa198; /* cyan */
    --accent-4:#268bd2; /* blue */
    --accent-5:#d33682; /* magenta */
    --card:#0b3b3c;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
}

/* Navigation Styles */
.navbar {
    background-color: var(--surface);
    padding: 1rem 2rem;
    position: fixed;
    width: 100%;
    top: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    z-index: 1000;
    min-height: 58px; /* Prevent layout shift while nav loads */
}

.nav-brand {
    font-size: 1.4rem;
    font-weight: 700;
    float: left;
}

.nav-brand a {
    color: var(--accent-5);
    text-decoration: none;
    transition: color 0.18s ease;
}

.nav-brand a:hover {
    color: var(--accent-3);
}

.nav-links {
    float: right;
    list-style: none;
}

.nav-links li {
    display: inline-block;
    margin-left: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    transition: color 0.18s ease, background-color 0.18s ease;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
}

.nav-links a:hover {
    color: var(--accent-4);
    background: rgba(38,139,210,0.06);
}

.nav-links a.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(38,139,210,0.16), rgba(42,161,152,0.06));
}

/* Dropdown styles (generic for Projects and Personal) */
.projects-dropdown,
.personal-dropdown {
    position: relative;
    display: inline-block;
}

.projects-dropdown .dropdown-toggle,
.personal-dropdown .dropdown-toggle {
    cursor: pointer;
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    background-color: var(--card);
    min-width: 260px; /* widened for longer titles */
    max-width: 360px;
    box-shadow: 0 12px 30px rgba(2,6,23,0.6);
    padding: 0.5rem 0;
    list-style: none;
    z-index: 1500;
    border-radius: 8px;
}

.dropdown-menu li a {
    display: block;
    padding: 0.6rem 1rem;
    color: var(--text);
    text-decoration: none;
    line-height: 1.25;
    white-space: normal; /* allow wrapping */
}

.dropdown-menu li a:hover {
    background-color: rgba(255,255,255,0.02);
    color: var(--accent-4);
}

.projects-dropdown.open .dropdown-menu,
.personal-dropdown.open .dropdown-menu {
    display: block;
}

/* Main Content Styles */
main {
    padding-top: 88px; /* Account for fixed navbar */
    background: linear-gradient(180deg, rgba(255,255,255,0.01), transparent 120px);
    min-height: 100vh;
}

.section {
    min-height: 100vh;
    padding: 3.25rem 2rem;
    display: none;
}

.section.active {
    display: block;
}

h1, h2 {
    color: #eee8d5; /* light text */
    margin-bottom: 1.25rem;
}

h1 {
    font-size: 2.25rem;
    color: var(--accent-3);
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

h2 {
    font-size: 1.6rem;
    color: var(--text);
}

.content {
    max-width: 800px;
    margin: 0 auto;
}

/* Home page specific styles */
.home-content {
    text-align: center;
    padding: 2rem 1rem;
}

.home-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: linear-gradient(135deg, 
        rgba(38,139,210,0.03), 
        rgba(42,161,152,0.02));
    border-radius: 1rem;
}

.header-text {
    text-align: left;
    max-width: 500px;
}

.header-text h1 {
    margin-bottom: 0.75rem;
}

.intro {
    font-size: 1.2rem;
    line-height: 1.5;
    color: var(--text);
    margin-bottom: 0;
}

.bio {
    font-size: 1.1rem;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
    color: var(--muted);
}

/* Avatar styles */
.avatar {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.08);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    background: linear-gradient(135deg, 
        rgba(38,139,210,0.08), 
        rgba(42,161,152,0.04));
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
}

/* Responsive design for home page */
@media (max-width: 768px) {
    .home-header {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }

    .header-text {
        text-align: center;
    }

    .avatar {
        width: 150px;
        height: 150px;
    }

    .intro {
        font-size: 1.1rem;
    }

    .bio {
        font-size: 1rem;
        padding: 0 1rem;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-brand {
        float: none;
        text-align: center;
        margin-bottom: 1rem;
    }

    .nav-links {
        float: none;
        text-align: center;
    }

    .nav-links li {
        margin: 0 1rem;
    }

    .section {
        padding: 2rem 1rem;
    }
}

/* Blog listing styles */
.blog-month {
    color: var(--accent-3);
    font-size: 1.3rem;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--surface);
    padding-bottom: 0.5rem;
}

.blog-month:first-child {
    margin-top: 0;
}

.blog-list {
    list-style: none;
    padding: 0;
}

.blog-item {
    margin-bottom: 0.5rem;
}

.blog-item a {
    display: flex;
    gap: 1rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text);
    border-radius: 6px;
    transition: background-color 0.18s ease;
}

.blog-item a:hover {
    background-color: rgba(38, 139, 210, 0.06);
}

.blog-date {
    color: var(--muted);
    min-width: 60px;
    flex-shrink: 0;
}

.blog-title {
    color: var(--text);
}

.blog-item a:hover .blog-title {
    color: var(--accent-4);
}

/* Post page styles */
.post-date {
    color: var(--muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.post-nav {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--surface);
}

.post-nav a {
    color: var(--accent-4);
    text-decoration: none;
}

.post-nav a:hover {
    text-decoration: underline;
}

/* Markdown content styles */
#post-content h1 {
    margin-bottom: 0.5rem;
}

#post-content h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--accent-3);
}

#post-content p {
    margin-bottom: 1rem;
}

#post-content ul,
#post-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

#post-content li {
    margin-bottom: 0.5rem;
}

#post-content code {
    background-color: var(--surface);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
}

#post-content pre {
    background-color: var(--surface);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1rem;
}

#post-content pre code {
    background: none;
    padding: 0;
}

#post-content blockquote {
    border-left: 3px solid var(--accent-3);
    padding-left: 1rem;
    margin-left: 0;
    color: var(--muted);
    font-style: italic;
}

.loading {
    color: var(--muted);
}
