/* Dark theme (default) */
:root {
    --bg-gradient: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    --container-bg: #2d3748;
    --text-color: #e2e8f0;
    --text-secondary: #cbd5e0;
    --text-muted: #a0aec0;
    --border-color: #4a5568;
    --border-focus: #63b3ed;
    --button-secondary-bg: #4a5568;
    --button-secondary-hover: #718096;
    --info-bg: #2d3748;
    --success-bg: #22543d;
    --success-border: #38a169;
    --error-bg: #742a2a;
    --error-border: #e53e3e;
    --error-text: #feb2b2;
    --accent-color: #63b3ed;
    --hover-bg: #374151;
    --warning-bg: #44337a;
    --warning-border: #9f7aea;
    --secondary-text: #cbd5e0;
    --modal-bg: #1f2937;
    --code-bg: #1a202c;
}


/* Light theme */
[data-theme="light"] {
    --bg-gradient: linear-gradient(135deg, #f7fafc 0%, #e2e8f0 100%);
    --container-bg: #ffffff;
    --text-color: #2d3748;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --border-color: #e2e8f0;
    --border-focus: #4299e1;
    --button-secondary-bg: #e2e8f0;
    --button-secondary-hover: #cbd5e0;
    --info-bg: #f7fafc;
    --success-bg: #c6f6d5;
    --success-border: #48bb78;
    --error-bg: #fed7d7;
    --error-border: #fc8181;
    --error-text: #c53030;
    --accent-color: #4299e1;
    --hover-bg: #edf2f7;
    --warning-bg: #faf5ff;
    --warning-border: #b794f4;
    --secondary-text: #4a5568;
    --modal-bg: #f7fafc;
    --code-bg: #edf2f7;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--bg-gradient);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

/* Header & Navigation */
header {
    background: var(--container-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
}

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

.logo a {
    font-size: 1.75rem;
    font-weight: 700;
    color: #f7931a;
    text-decoration: none;
    letter-spacing: -0.02em;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2.5rem;
    align-items: center;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--text-color);
    margin: 2px 0;
    border-radius: 2px;
}

.nav-menu a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
}

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

@media (min-width: 769px) {
    .nav-menu a.active {
        color: var(--text-color);
    }
}

@media (min-width: 769px) {
    .nav-menu a.active::after {
        content: '';
        position: absolute;
        bottom: -0.5rem;
        left: 0;
        right: 0;
        height: 2px;
        background: var(--accent-color);
    }
}

/* Theme Toggle Button */
.theme-toggle-container {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 100;
}

.theme-toggle {
    background: var(--container-bg);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 14px;
    padding: 0;
}

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

/* Main Content */
main {
    padding: 0;
    margin: 0;
    flex: 1;
}

/* Hero Fullscreen Section */
.hero-fullscreen {
    position: relative;
    width: 100vw;
    height: 100vh;
    margin-left: calc(-50vw + 50%);
    overflow: hidden;
}

.hero-fullscreen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Page Headers */
.page-header {
    background: var(--container-bg);
    padding: 4rem 0;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.page-header h1 {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
}

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

.bio h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    text-align: center;
    color: var(--text-color);
    letter-spacing: -0.02em;
}

.bio-content {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.2rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.bio-content p {
    margin-bottom: 2rem;
}

.bio-content a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
}

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

/* Recent Work Section */
.recent-work {
    background: var(--container-bg);
    padding: 5rem 0;
    border-top: 1px solid var(--border-color);
}

.recent-work h2 {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 4rem;
    color: var(--text-color);
    letter-spacing: -0.02em;
}

.work-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.work-item {
    background: var(--info-bg);
    padding: 2.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.work-item h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-color);
    letter-spacing: -0.01em;
}

.work-item p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.work-link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

.work-link::after {
    content: '→';
}

/* Primary Buttons */
.primary-btn {
    background: #4299e1;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

/* Light theme button overrides */
[data-theme="light"] .primary-btn {
    background: #cbd5e0;
    color: #475569;
}

[data-theme="light"] .primary-btn:hover {
    background: #a0aec0;
}

/* Dark theme button hover */
.primary-btn:hover {
    background: #3182ce;
}

/* Blog & Talks */
.blog-posts,
.talks {
    padding: 4rem 0;
}

.blog-post,
.talk {
    background: var(--container-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2.5rem;
    margin-bottom: 2rem;
}

.post-meta,
.talk-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    align-items: center;
}

.post-category,
.talk-venue {
    background: var(--accent-color);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.blog-post h2,
.talk h2 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.blog-post h2 a,
.talk h2 {
    color: var(--text-color);
    text-decoration: none;
}

.blog-post h2 a:hover {
    color: var(--accent-color);
}

.post-excerpt,
.talk-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.7;
    font-size: 1.05rem;
}

.read-more,
.talk-link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
}

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

.talk-links {
    display: flex;
    gap: 1.5rem;
}

/* Placeholders */
.blog-placeholder,
.talks-placeholder,
.compiler-placeholder {
    background: var(--info-bg);
    padding: 4rem 0;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin: 2rem 0;
}

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

.placeholder-content h2 {
    margin-bottom: 1.5rem;
    color: var(--text-color);
    font-weight: 600;
}

.placeholder-content p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.placeholder-content ul {
    text-align: left;
    max-width: 500px;
    margin: 2rem auto;
    color: var(--text-secondary);
}

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

/* Coming Soon */
.coming-soon {
    padding: 5rem 0;
    background: var(--container-bg);
    text-align: center;
}

.coming-soon h1 {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-color);
    letter-spacing: -0.02em;
}

/* Tools Content */
.tools-content {
    padding: 4rem 0;
    min-height: 60vh;
}

.tools-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 3rem;
    letter-spacing: -0.02em;
}

.tools-list {
    max-width: 800px;
}

.tool-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--container-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    margin-bottom: 1rem;
    transition: background 0.2s;
}

.tool-item:hover {
    background: var(--hover-bg);
}

.tool-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--info-bg);
    border-radius: 8px;
}

.tool-details {
    flex: 1;
}

.tool-details h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

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

.tool-arrow {
    font-size: 1.5rem;
    color: var(--text-muted);
}

/* About Content */
.about-content {
    padding: 5rem 0;
    background: var(--container-bg);
}

.about-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 3rem;
    text-align: center;
    letter-spacing: -0.02em;
}

.about-text {
    max-width: 800px;
    margin: 0 auto;
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.7;
}

.about-text p {
    margin-bottom: 2rem;
}

/* Footer */
footer {
    background: var(--container-bg);
    color: var(--text-secondary);
    text-align: center;
    padding: 0.75rem 0;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
}

footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    max-width: none;
    width: 100%;
    padding: 0 20px;
}

footer a {
    color: var(--text-secondary);
    text-decoration: none;
}

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

/* Editable fields brightness in light theme */
[data-theme="light"] textarea,
[data-theme="light"] input[type="text"],
[data-theme="light"] .editable-field {
    filter: brightness(1.3);
}

/* Focus effects */
textarea:focus,
input:focus {
    outline: none;
    border-color: var(--border-focus);
    border-width: 2px;
}

/* Mobile-only footer with icons */
@media (max-width: 768px) {
    .mobile-icons {
        display: flex !important;
        height: 20px;
        align-items: center;
        justify-content: center;
        margin-top: 5px;
        border-top: 1px solid var(--border-color);
    }

    .mobile-icons a {
        display: inline-block;
        margin: 0 6px;
        padding: 2px 6px;
        background: var(--container-bg);
        border: none;
        border-radius: 3px;
        color: var(--text-color);
        text-decoration: none;
        font-size: 12px;
        line-height: 1;
        transition: all 0.2s;
    }

    .mobile-icons a:hover {
        background: var(--hover-bg);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    }

    /* Remove bottom padding on mobile */
    .main-content {
        padding-bottom: 0 !important;
    }

    .container {
        margin-bottom: 2px !important;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        position: relative;
        padding: 1rem 1.5rem;
    }
    
    .hamburger {
        display: flex;
    }
    
    .nav-menu {
        position: absolute;
        top: 100%;
        right: 0;
        width: 200px;
        background: var(--container-bg);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        flex-direction: column;
        gap: 0;
        padding: 0.5rem 0;
        display: none;
        z-index: 1000;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-menu li {
        width: 100%;
    }
    
    .nav-menu a {
        display: block;
        padding: 0.75rem 1rem;
        text-align: left;
        border-bottom: 1px solid var(--border-color);
        color: var(--text-secondary);
    }
    
    .nav-menu a.active {
        color: var(--text-secondary);
    }
    
    .nav-menu a.active::after {
        display: none;
    }
    
    .nav-menu a:hover {
        color: var(--text-primary);
        background: var(--hover-bg);
    }
    
    .nav-menu li:last-child a {
        border-bottom: none;
    }
    
    .theme-toggle {
        display: none;
    }
    
    .hero-fullscreen {
        height: calc(100vh - 80px);
    }
    
    .work-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .work-item {
        padding: 2rem;
    }
    
    .talk-links {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .post-meta,
    .talk-meta {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .bio,
    .recent-work {
        padding: 3rem 0;
    }
}