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

html, body {
    height: 100%;
}

:root {
    --bg: #ffffff;
    --text: #1a1a1a;
    --accent: #059669;
    --border: #e5e7eb;
    --hover: #f3f4f6;
    --nav-bg: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] {
    --bg: #0f172a;
    --text: #e2e8f0;
    --accent: #10b981;
    --border: #334155;
    --hover: #1e293b;
    --nav-bg: rgba(15, 23, 42, 0.9);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    transition: background 0.3s, color 0.3s;
    display: flex;
    flex-direction: column;
}

nav {
    position: sticky;
    top: 0;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    z-index: 100;
}

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

nav h1 {
    font-size: 1.25rem;
    font-weight: 600;
}

nav h1 a {
    text-decoration: none;
    color: var(--text);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

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

nav a {
    text-decoration: none;
    color: var(--text);
    transition: color 0.2s;
}

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

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--text);
    font-size: 1.25rem;
    transition: transform 0.2s;
}

.theme-toggle:hover {
    transform: scale(1.1);
}

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

main {
    flex: 1
}

section {
    padding: 4rem 0;
}

.hero {
    min-height: 80vh;
    display: flex;
    align-items: center;
}

.hero-content h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero-content p {
    font-size: 1.25rem;
    color: #6b7280;
    margin-bottom: 2rem;
    max-width: 600px;
}

[data-theme="dark"] .hero-content p {
    color: #94a3b8;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--accent);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

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

.project-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .project-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.project-card h3 {
    margin-bottom: 0.5rem;
}

.project-card p {
    color: #6b7280;
    margin-bottom: 1rem;
}

[data-theme="dark"] .project-card p {
    color: #94a3b8;
}

.project-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.blog-list {
    margin-top: 2rem;
}

.blog-list-page {
    padding: 4rem 0;
    min-height: 80vh;
}

.blog-list-page h2 {
    margin-bottom: 2rem;
}

.blog-item {
    border-bottom: 1px solid var(--border);
    padding: 2rem 0;
    cursor: pointer;
    transition: background 0.2s;
}

.blog-item:hover {
    background: var(--hover);
    margin: 0 -1rem;
    padding: 2rem 1rem;
}

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

.blog-meta {
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

[data-theme="dark"] .blog-meta {
    color: #94a3b8;
}

.blog-excerpt {
    color: #6b7280;
}

[data-theme="dark"] .blog-excerpt {
    color: #94a3b8;
}

.blog-post {
    display: none;
    max-width: 800px;
    margin: 2rem auto;
}

.blog-post.active {
    display: block;
}

.blog-post h1 {
    margin-bottom: 1rem;
}

.blog-post-page {
    padding: 4rem 0;
    min-height: 80vh;
}

.post-header {
    margin-bottom: 3rem;
}

.post-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.blog-content {
    line-height: 1.8;
}

.blog-content h1,
.blog-content h2,
.blog-content h3 {
    margin: 2rem 0 1rem;
}

.blog-content h1 {
    font-size: 2rem;
}

.blog-content h2 {
    font-size: 1.5rem;
}

.blog-content h3 {
    font-size: 1.25rem;
}

.blog-content p {
    margin-bottom: 1rem;
}

.blog-content ul,
.blog-content ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

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

.blog-content a {
    color: var(--accent);
    text-decoration: none;
}

.blog-content a:hover {
    text-decoration: underline;
}

.blog-content img,
.blog-content video {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1.5rem 0;
}

.blog-content video {
    width: 700px;
}

.blog-content code {
    background: #f3f4f6;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em !important;
}

[data-theme="dark"] .blog-content code {
    background: #1e293b;
}

.blog-content pre {
    background: #f3f4f6;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 1rem;
}

[data-theme="dark"] .blog-content pre {
    background: #1e293b;
}

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

.back-btn {
    color: var(--accent);
    cursor: pointer;
    display: inline-block;
    margin-bottom: 2rem;
    text-decoration: none;
}

.back-btn:hover {
    text-decoration: underline;
}

.contact-content {
    max-width: 600px;
    margin: 2rem auto;
    text-align: center;
}

.contact-content h2 {
    margin-bottom: 1rem;
}

.contact-content p {
    color: #6b7280;
    margin-bottom: 2rem;
}

[data-theme="dark"] .contact-content p {
    color: #94a3b8;
}

.email-link {
    font-size: 1.5rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

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

footer {
    background: var(--hover);
    padding: 2rem 0;
    text-align: center;
    color: #6b7280;
    border-top: 1px solid var(--border);
}

[data-theme="dark"] footer {
    color: #94a3b8;
}

.hidden {
    display: none;
}

h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    nav .container {
        padding: 0 1rem;
    }

    nav h1 {
        font-size: 1rem;
        margin-right: 1rem;
    }

    nav ul {
        gap: 0.75rem;
        font-size: 0.875rem;
    }

    .nav-right {
        gap: 0.75rem;
    }

    .theme-toggle {
        font-size: 1rem;
        padding: 0.25rem;
    }

    .hero-content h2 {
        font-size: 2rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

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

    .post-header h1 {
        font-size: 1.75rem;
    }

    .blog-content h1 {
        font-size: 1.5rem;
    }

    .blog-content h2 {
        font-size: 1.25rem;
    }

    .blog-content h3 {
        font-size: 1.1rem;
    }

    .blog-content code {
        font-size: 0.8em !important;
    }

    .blog-content pre {
        font-size: 0.875rem;
        padding: 0.75rem;
    }

    .blog-content img {
        max-width: 100%;
        height: auto;
    }

    .container {
        padding: 0 1rem;
    }
}