/* Light Theme */
[data-theme="light"] {
    --bg-primary: #f5f5f5;
    --bg-secondary: #e5e5e5;
    --bg-tertiary: #d4d4d4;
    --bg-card: #ffffff;
    --border-primary: #d4d4d4;
    --border-hover: #a3a3a3;
    --text-primary: #171717;
    --text-secondary: #525252;
    --text-tertiary: #737373;
}

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

/* Page Transitions */
body { animation: pageEnter 0.4s ease-out; }
body.page-exit { animation: pageExit 0.25s ease-in forwards; }
@keyframes pageEnter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pageExit { from { opacity: 1; } to { opacity: 0; transform: translateY(-8px); } }

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0a0a0a;
    color: #ffffff;
    min-height: 100vh;
    padding: 20px;
    line-height: 1.4;
}

[data-theme="light"] body {
    background: var(--bg-primary);
    color: var(--text-primary);
}

[data-theme="light"] .site-nav {
    background: rgba(245, 245, 245, 0.85);
    border-bottom-color: #d4d4d4;
}

[data-theme="light"] .page-title { color: #171717; }
[data-theme="light"] .page-subtitle { color: #525252; }

[data-theme="light"] .project-card {
    background: #ffffff;
    border-color: #d4d4d4;
}
[data-theme="light"] .project-card:hover {
    background: #f9f9f9;
    border-color: #a3a3a3;
}

[data-theme="light"] .project-title { color: #171717; }
[data-theme="light"] .project-description { color: #525252; }
[data-theme="light"] .project-type { color: #737373; }

[data-theme="light"] .tech-tag {
    background: #e8e8e8;
    color: #525252;
    border-color: #d4d4d4;
}

[data-theme="light"] .project-link {
    background: #e8e8e8;
    color: #171717;
}
[data-theme="light"] .project-link:hover { background: #d4d4d4; }
[data-theme="light"] .project-link.primary { background: #3b82f6; color: white; }

[data-theme="light"] .stat-value { color: #171717; }
[data-theme="light"] .stat-label { color: #737373; }
[data-theme="light"] .project-stats { border-top-color: #d4d4d4; }

[data-theme="light"] .featured-project {
    background: linear-gradient(135deg, #ffffff 0%, #f0e8f0 100%);
}

[data-theme="light"] .footer {
    color: #737373;
    border-top-color: #d4d4d4;
}

[data-theme="light"] .nav-home { color: #525252; }
[data-theme="light"] .nav-link { color: #737373; }
[data-theme="light"] .nav-link:hover { color: #171717; background: #e5e5e5; }
[data-theme="light"] .nav-link.active { color: #171717; background: #ffffff; border-color: #d4d4d4; }
[data-theme="light"] .hamburger-line { background: #171717; }

/* Skip to content link */
.skip-to-content {
    position: absolute;
    top: -100%;
    left: 16px;
    background: #3b82f6;
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    z-index: 2000;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: top 0.2s ease;
}
.skip-to-content:focus {
    top: 8px;
}

/* Hamburger menu button */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 1001;
    flex-direction: column;
    gap: 5px;
    width: 28px;
}
.hamburger-line {
    display: block;
    width: 100%;
    height: 2px;
    background: #ffffff;
    border-radius: 2px;
    transition: all 0.3s ease;
}
.hamburger.open .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.hamburger.open .hamburger-line:nth-child(2) {
    opacity: 0;
}
.hamburger.open .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.9);
    color: white;
    border: none;
    font-size: 18px;
    cursor: pointer;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 99;
    backdrop-filter: blur(8px);
}
.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}
.back-to-top:hover {
    background: rgba(37, 99, 235, 1);
    transform: translateY(-2px);
}

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


/* Footer */
.footer {
    text-align: center;
    padding: 40px 0 28px;
    color: #888;
    font-size: 13px;
    border-top: 1px solid #333;
    margin-top: 48px;
}

.footer a {
    color: #3b82f6;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer a:hover {
    color: #60a5fa;
}

.header {
    margin-bottom: 30px;
    text-align: center;
    padding-top: 56px;
}

.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid #252525;
    z-index: 100;
    font-size: 14px;
}

.nav-home {
    color: #a3a3a3;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-home:hover {
    color: #ffffff;
    transform: translateX(-2px);
}

.nav-links {
    display: flex;
    gap: 8px;
}

.nav-link {
    color: #737373;
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.nav-link:hover {
    color: #ffffff;
    background: #1a1a1a;
}

.nav-link.active {
    color: #ffffff;
    background: #161616;
    border: 1px solid #252525;
}

/* nav hover states defined in site-nav above */

.page-title {
    font-size: 36px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.page-subtitle {
    font-size: 16px;
    color: #888;
    max-width: 600px;
    margin: 0 auto;
}

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

.project-card {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.project-card:hover {
    border-color: #555;
    transform: translateY(-2px);
    background: #222;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #ef4444, #f59e0b, #3b82f6);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card:hover::before {
    opacity: 1;
}

.project-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.project-title {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.project-type {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.project-description {
    color: #ccc;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.tech-tag {
    background: #333;
    color: #ccc;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    border: 1px solid #444;
}

.project-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.project-link {
    background: #333;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 12px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.project-link:hover {
    background: #444;
}

.project-link.primary {
    background: #3b82f6;
}

.project-link.primary:hover {
    background: #2563eb;
}

.project-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #333;
}

.stat {
    text-align: center;
}

.stat-value {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    display: block;
}

.stat-label {
    font-size: 10px;
    color: #888;
    text-transform: uppercase;
}

.featured-project {
    grid-column: span 2;
    background: linear-gradient(135deg, #1a1a1a 0%, #2a1a2a 100%);
}

.featured-project .project-icon {
    font-size: 28px;
}

.featured-project .project-title {
    font-size: 22px;
}

.featured-project .project-description {
    font-size: 15px;
}


@media (max-width: 768px) {
    body {
        padding: 15px;
    }

    .hamburger {
        display: flex;
    }

    .site-nav {
        padding: 10px 16px;
        flex-wrap: wrap;
    }

    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        padding-top: 8px;
        border-top: 1px solid #252525;
        margin-top: 8px;
        gap: 4px;
    }

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

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

    .featured-project {
        grid-column: span 1;
    }

    .page-title {
        font-size: 28px;
    }

    .project-card {
        padding: 16px;
    }
}

/* Theme Toggle */
.theme-toggle {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    cursor: pointer;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    color: #a3a3a3;
    font-size: 13px;
    transition: all 0.3s ease;
}
.theme-toggle:hover { background: #222; color: #fff; }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="light"] .theme-toggle { background: #e5e5e5; border-color: #d4d4d4; color: #525252; }
[data-theme="light"] .theme-toggle:hover { background: #d4d4d4; color: #171717; }
[data-theme="light"] .theme-toggle .icon-sun { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }

.card {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}

.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }
.card:nth-child(5) { animation-delay: 0.5s; }
.card:nth-child(6) { animation-delay: 0.6s; }


.fade-in {
    animation: fadeIn 0.6s ease forwards;
    opacity: 0;
    transform: translateY(15px);
}


@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scroll Reveal */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.6s cubic-bezier(0.4,0,0.2,1), transform 0.6s cubic-bezier(0.4,0,0.2,1); }
.reveal.revealed { opacity: 1; transform: translateY(0); }
.reveal-scale { opacity: 0; transform: scale(0.95); transition: opacity 0.6s cubic-bezier(0.4,0,0.2,1), transform 0.6s cubic-bezier(0.4,0,0.2,1); }
.reveal-scale.revealed { opacity: 1; transform: scale(1); }