:root {
    --bg-primary: #0f1117;
    --bg-secondary: #161922;
    --bg-card: #1c1f2e;
    --text-primary: #e4e4e7;
    --text-secondary: #a1a1aa;
    --accent: #2563eb;
    --accent-hover: #3b82f6;
    --border: #2e3345;
    --radius: 8px;
    --max-width: 1100px;
}

[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f4f4f5;
    --bg-card: #ffffff;
    --text-primary: #18181b;
    --text-secondary: #52525b;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --border: #e4e4e7;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    font-size: 16px;
}

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

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

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

/* Navigation */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(15, 17, 23, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

[data-theme="light"] .site-header {
    background: rgba(255, 255, 255, 0.9);
}

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

.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

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

.nav-links a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

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

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.4rem;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, border-color 0.2s;
}

.theme-toggle:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.icon-sun {
    display: none;
}

[data-theme="light"] .icon-sun {
    display: block;
}

[data-theme="light"] .icon-moon {
    display: none;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: 0.3s;
}

/* Hero */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8rem 2rem 4rem;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.highlight {
    color: var(--accent);
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2rem;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-social {
    display: flex;
    gap: 1.25rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.hero-social a {
    color: var(--text-secondary);
    transition: color 0.2s, transform 0.2s;
}

.hero-social a:hover {
    color: var(--accent);
    transform: translateY(-2px);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--accent);
    color: var(--bg-primary);
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: var(--bg-primary);
}

.btn-secondary {
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Sections */
.section {
    padding: 5rem 0;
}

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

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2.5rem;
}

/* About */
.about-content p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    max-width: 750px;
}

/* Badges */
.badges-section {
    padding: 4rem 0;
}

.about-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.about-badges a {
    display: block;
    transition: transform 0.2s;
}

.about-badges a:hover {
    transform: scale(1.1);
}

.about-badges img {
    width: 90px;
    height: 90px;
    border-radius: 6px;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 2rem;
    border-left: 2px solid var(--border);
}

.timeline-item {
    position: relative;
    margin-bottom: 2.5rem;
}

.timeline-marker {
    position: absolute;
    left: -2.6rem;
    top: 0.5rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    border: 3px solid var(--bg-secondary);
}

.timeline-content h3 {
    font-size: 1.2rem;
    margin-bottom: 0.1rem;
}

.timeline-company {
    display: block;
    font-size: 0.9rem;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 0.2rem;
}

.timeline-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.timeline-content p {
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

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

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: border-color 0.2s;
}

.project-card:hover {
    border-color: var(--accent);
}

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

.project-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

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

.tag {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: rgba(96, 165, 250, 0.1);
    color: var(--accent);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.project-link {
    font-size: 0.85rem;
    font-weight: 500;
}

/* Blog */
.posts-list {
    margin-bottom: 2rem;
}

.post-preview {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border);
}

.post-preview:last-child {
    border-bottom: none;
}

.post-preview time {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.post-preview h3 {
    font-size: 1.2rem;
    margin: 0.25rem 0 0.5rem;
}

.post-preview h3 a {
    color: var(--text-primary);
}

.post-preview h3 a:hover {
    color: var(--accent);
}

.post-preview p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.no-posts {
    color: var(--text-secondary);
    font-style: italic;
}

/* Knowledge Base */
.kb-intro {
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    font-size: 1.05rem;
}

.kb-category {
    margin-bottom: 3rem;
}

.kb-category-title {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    font-weight: 600;
}

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

.kb-card {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: border-color 0.2s;
    color: var(--text-primary);
}

.kb-card:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.kb-card h3 {
    font-size: 1rem;
    margin-bottom: 0.4rem;
}

.kb-card p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.kb-updated {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
}

.post-category {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
}

.article-meta {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Article */
.article-container {
    max-width: 750px;
}

.article-header {
    margin-bottom: 2.5rem;
    padding-top: 6rem;
}

.article-header time {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.article-header h1 {
    font-size: 2.2rem;
    margin: 0.5rem 0 0.75rem;
    line-height: 1.3;
}

.article-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.article-body {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.8;
}

.article-body h2 {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin: 2.5rem 0 1rem;
}

.article-body h3 {
    color: var(--text-primary);
    font-size: 1.2rem;
    margin: 2rem 0 0.75rem;
}

.article-body p {
    margin-bottom: 1.25rem;
}

.article-body code {
    background: var(--bg-card);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
}

.article-body pre {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.article-body pre code {
    background: none;
    padding: 0;
}

.article-body ul, .article-body ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.article-body li {
    margin-bottom: 0.5rem;
}

.article-body blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 1rem;
    margin: 1.5rem 0;
    color: var(--text-secondary);
    font-style: italic;
}

.article-body img {
    max-width: 100%;
    border-radius: var(--radius);
    margin: 1.5rem 0;
}

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

/* Footer */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    text-align: center;
}

.footer-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

.site-footer p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.footer-links {
    margin-top: 0.75rem;
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Mobile */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-primary);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 1rem 2rem;
        gap: 1rem;
    }

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

    .hero {
        min-height: 60vh;
        padding: 6rem 1.5rem 3rem;
    }

    .section {
        padding: 3rem 0;
    }

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

    .article-header {
        padding-top: 5rem;
    }
}
