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

:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --text: #1f2937;
    --text-light: #6b7280;
    --bg: #ffffff;
    --bg-alt: #f9fafb;
    --border: #e5e7eb;
}

[data-theme="dark"] {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --text: #f9fafb;
    --text-light: #d1d5db;
    --bg: #111827;
    --bg-alt: #1f2937;
    --border: #374151;
}

html {
    transition: background-color 0.3s ease, color 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}

nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--primary);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text);
}

.theme-toggle {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    margin-left: 1rem;
}

.theme-toggle:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: scale(1.1);
}

.theme-toggle:hover .theme-icon {
    transform: rotate(20deg);
}

.theme-icon {
    transition: transform 0.3s ease;
}

.cv-download {
    background: var(--primary);
    color: white !important;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: background 0.3s ease;
}

.cv-download:hover {
    background: var(--primary-dark);
}

main {
    margin-top: 70px;
}

.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 6rem 2rem;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

section {
    margin-bottom: 4rem;
}

h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--text);
    border-bottom: 3px solid var(--primary);
    display: inline-block;
    padding-bottom: 0.5rem;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
    align-items: start;
}

.profile-image {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 1rem;
    object-fit: cover;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.about-text p {
    margin-bottom: 1rem;
    color: var(--text-light);
    font-size: 1.1rem;
}

.cv-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary);
    color: white;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    margin: 1.5rem 0;
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
}

.cv-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(37, 99, 235, 0.3);
}

.cv-btn span {
    font-size: 1.3rem;
}

.skills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.skill-tag {
    background: var(--bg-alt);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.9rem;
    border: 1px solid var(--border);
}

.github-section {
    margin-top: 2rem;
}

.github-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.github-card {
    background: var(--bg-alt);
    padding: 2rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    text-align: center;
}

.github-card h3 {
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.github-card p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.contribution-graph {
    width: 100%;
    height: auto;
    border-radius: 0.5rem;
}

.github-stat-img {
    width: 100%;
    height: auto;
    border-radius: 0.5rem;
}

.github-link {
    text-align: center;
}

.github-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-alt);
    color: var(--text);
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    border: 2px solid var(--border);
}

.github-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(37, 99, 235, 0.3);
}

.github-btn span {
    font-size: 1.3rem;
}

[data-theme="dark"] .contribution-graph,
[data-theme="dark"] .github-stat-img {
    filter: brightness(0.9) contrast(1.1);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    background: var(--bg-alt);
    padding: 2rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    transition: transform 0.3s, box-shadow 0.3s;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.project-card h3 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.project-card p {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.project-link {
    display: inline-block;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    margin-top: 1rem;
}

.project-link:hover {
    text-decoration: underline;
}

.project-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--primary);
    color: white;
    border-radius: 1rem;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.tech-card {
    background: var(--bg-alt);
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
}

.tech-card h3 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.tech-card ul {
    list-style: none;
    color: var(--text-light);
}

.tech-card li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.tech-card li:last-child {
    border-bottom: none;
}

.tech-card li strong {
    color: var(--text);
}

.blog-posts {
    display: grid;
    gap: 2rem;
}

.blog-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    background: var(--bg-alt);
    border: 2px solid var(--border);
    border-radius: 2rem;
    color: var(--text);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
    font-size: 1.1rem;
}

.error, .no-posts {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
    background: var(--bg-alt);
    border-radius: 0.5rem;
    border: 1px solid var(--border);
}

.blog-posts {
    display: grid;
    gap: 2rem;
}

.blog-post {
    background: var(--bg-alt);
    padding: 2rem;
    border-radius: 0.5rem;
    border-left: 4px solid var(--primary);
}

.blog-post h3 {
    color: var(--text);
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.post-meta {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.post-type {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--primary);
    color: white;
    border-radius: 1rem;
    font-size: 0.8rem;
    margin-right: 0.5rem;
}

.read-more {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    display: inline-block;
    margin-top: 1rem;
}

.read-more:hover {
    text-decoration: underline;
}

.blog-post-full {
    max-width: 800px;
    margin: 0 auto;
}

.back-btn {
    background: var(--bg-alt);
    border: 2px solid var(--border);
    color: var(--text);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
    display: inline-block;
}

.back-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.post-header {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--border);
}

.post-header h1 {
    font-size: 2.5rem;
    margin: 1rem 0;
    color: var(--text);
}

.post-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text);
}

.post-content h2 {
    font-size: 1.8rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text);
    border-bottom: 2px solid var(--primary);
    padding-bottom: 0.5rem;
}

.post-content h3 {
    font-size: 1.4rem;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.post-content p {
    margin-bottom: 1.5rem;
    color: var(--text-light);
}

.post-content ul, .post-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
    color: var(--text-light);
}

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

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

.post-content em {
    font-style: italic;
}

.post-content pre {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1.5rem;
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.post-content code {
    background: var(--bg-alt);
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

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

.post-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border);
}

footer {
    background: var(--text);
    color: white;
    text-align: center;
    padding: 2rem;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
}

.social-links a {
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
    transition: opacity 0.3s;
}

.social-links a:hover {
    opacity: 0.7;
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg);
        flex-direction: column;
        padding: 1rem;
        border-bottom: 1px solid var(--border);
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }

    .nav-links.active {
        display: flex;
    }

    .mobile-menu-btn {
        display: block;
    }

    .theme-toggle {
        margin-left: auto;
        margin-right: 1rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .about-content {
        grid-template-columns: 1fr;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .cv-btn {
        width: 100%;
        justify-content: center;
    }
}