:root {
    --bg-color: #05050a;
    --text-color: #ffffff;
    --text-secondary: #a1a1aa;
    --primary-color: #7c3aed;
    --primary-hover: #6d28d9;
    --accent-color: #c084fc;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --font-main: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Background Gradient Mesh */
.background-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background: 
        radial-gradient(circle at 15% 50%, rgba(76, 29, 149, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(124, 58, 237, 0.15) 0%, transparent 50%);
    pointer-events: none;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    position: fixed;
    width: 90%;

    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    backdrop-filter: blur(16px); /* Increased blur */
    -webkit-backdrop-filter: blur(16px);
    background: rgba(5, 5, 10, 0.7); /* Slightly darker */
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 1px solid rgba(255, 255, 255, 0.15); /* Highlight top border */
    border-radius: 24px; /* More rounded */
    box-shadow: 
        0 4px 30px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(0, 0, 0, 0.2); /* Inner stroke */
    transition: all 0.3s ease;
}

.navbar:hover {
    background: rgba(10, 10, 20, 0.8);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
}

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

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

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

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

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

.btn-lang {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    transition: all 0.3s;
}

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

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

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

/* Hero Section - Radical Redesign */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 0 5%;
    position: relative;
    overflow: hidden;
}

.hero-content {
    flex: 1;
    z-index: 10;
    max-width: 100%;
    /* Will be animated in JS */
}

.hero-title {
    font-size: 8vw; /* Massive responsive font */
    line-height: 0.9;
    font-weight: 800;
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: -0.02em;
}

.hero-title .line {
    display: block;
    background: linear-gradient(to right, #fff, #a1a1aa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transform-origin: left;
    animation: slideIn 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(50px);
}

.hero-title .line:nth-child(2) {
    animation-delay: 0.2s;
    color: var(--primary-color); /* Fallback */
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-sub {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 500px;
    margin-left: 0.5rem;
    opacity: 0;
    animation: fadeIn 1s ease 0.5s forwards;
}

.hero p {
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin-bottom: 0;
    line-height: 1.5;
}

.highlight {
    color: var(--text-color);
    font-weight: 600;
}

.hero-stats {
    display: flex;
    gap: 3rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-num {
    font-size: 2rem;
    font-weight: 700;
    font-family: var(--font-mono);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

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

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* Hero Canvas Background */
#interactiveCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0; /* Behind content */
    opacity: 0.4; /* Slightly darker for text readability */
    pointer-events: none; /* Let clicks pass through */
}

.hero-content {
    position: relative;
    z-index: 10; /* Ensure content is above canvas */
    /* Will be animated in JS */
}

/* Sections */
.section {
    padding: 6rem 10%;
    position: relative;
    z-index: 10;
}

/* Projects Section - Reverted to Grid */
#projects {
    min-height: 100vh; /* Ensure enough scroll space for animation */
    padding-top: 6rem;
    position: relative;
    /* Background handled by curtains */
    background: transparent; 
}

#projects .container {
    position: relative;
    z-index: 20;
}

.curtain-left, .curtain-right {
    position: fixed;
    top: 0;
    bottom: 0;
    width: 51%; /* Fixed width, we animate scale */
    background: #000;
    z-index: 5; /* Behind project content but above global bg */
    pointer-events: none;
    will-change: transform; /* Optimize for transform */
    transform: scaleX(0); /* Start hidden */
}

.curtain-left { 
    left: 0; 
    transform-origin: left;
}
.curtain-right { 
    right: 0; 
    transform-origin: right;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    /* Initial state controlled by JS now for scroll sync */
    opacity: 0;
    transform: scale(0.5); 
    will-change: transform, opacity;
}

/* Removed .projects-grid.visible as we will control manually */

.project-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 2rem;
    transition: transform 0.3s, border-color 0.3s;
}

.project-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
}

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

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

.card-tags {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.card-tags span {
    font-size: 0.8rem;
    color: var(--accent-color);
    font-family: var(--font-mono);
}

.link-arrow {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    transition: transform 0.2s;
}

.link-arrow:hover {
    transform: translateX(5px);
    color: var(--primary-color);
}

/* Process Section - New "Idea to Reality" Flow */
.process-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #000; /* Deep black background */
    position: relative;
    z-index: 20;
}

.process-title {
    text-align: center;
    font-size: 3rem;
    margin-bottom: 5rem;
    background: linear-gradient(to right, #fff, #a1a1aa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.process-steps {
    display: flex;
    flex-direction: column;
    gap: 4rem;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.process-step {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    opacity: 0.2;
    transition: opacity 0.5s ease, transform 0.5s ease;
    transform: scale(0.95);
}

.process-step.active {
    opacity: 1;
    transform: scale(1);
}

.step-number {
    font-size: 4rem;
    font-weight: 800;
    color: transparent;
    -webkit-text-stroke: 1px var(--primary-color);
    font-family: var(--font-mono);
    line-height: 1;
}

.process-step.active .step-number {
    color: var(--primary-color);
    -webkit-text-stroke: 0;
}

.step-content h3 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #fff;
}

.step-content p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Dark Mode Transition Class - Removed as we handle it per section now */
body.dark-mode-active {
    background-color: var(--bg-color); /* Reset to default */
}

body.dark-mode-active .background-gradient {
    opacity: 1; /* Reset */
}

/* Responsive Timeline */
@media (max-width: 768px) {
    .project-card-large {
        flex-direction: column;
    }
    
    .timeline-line {
        left: 20px;
    }
    
    .step-marker {
        left: 20px;
        top: -2rem;
    }
    
    .project-step {
        padding-left: 40px;
    }
}

/* Contact Section */
#contact {
    background: var(--bg-color); /* Solid background for contact */
    z-index: 20;
}

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

h2 {
    font-size: 2.5rem;
    margin-bottom: 3rem;
}

/* About Section - Bento Grid Redesign */
.about-wrapper {
    max-width: 1000px;
    margin: 0 auto;
}

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

.about-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-top: 0.5rem;
}

.bento-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    /* Auto rows */
}

.bento-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.bento-item:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
}

.bio-card {
    grid-column: 1;
    grid-row: 1;
}

.stack-card {
    grid-column: 2;
    grid-row: 1;
}

.quote-card {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(5, 5, 10, 0.5));
    border-color: rgba(124, 58, 237, 0.2);
}

.quote-text {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    background: linear-gradient(to right, #fff, #a1a1aa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-style: italic;
}

.stats-card {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.bento-title {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    font-weight: 600;
}

.stack-card .skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.stack-card .skill-tags span {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.stack-card .skill-tags span:hover {
    background: rgba(124, 58, 237, 0.2);
    color: var(--text-color);
    border-color: var(--primary-color);
}

.mini-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.mini-stat .num {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.mini-stat .label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

@media (max-width: 768px) {
    .bento-grid {
        grid-template-columns: 1fr;
    }
    
    .bio-card, .stack-card, .quote-card, .stats-card {
        grid-column: auto;
        grid-row: auto;
    }
}

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

.project-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 2rem;
    transition: transform 0.3s, border-color 0.3s;
}

.project-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
}

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

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

.card-tags {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.card-tags span {
    font-size: 0.8rem;
    color: var(--accent-color);
    font-family: var(--font-mono);
}

.link-arrow {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    transition: transform 0.2s;
}

.link-arrow:hover {
    transform: translateX(5px);
    color: var(--primary-color);
}

/* Footer */
footer {
    padding: 4rem 10%;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 0; /* Remove margin as it follows black section */
    background-color: #000; /* Match process section background */
    position: relative;
    z-index: 100; /* Ensure it's above everything, including curtains */
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.curtain-left, .curtain-right {
    position: fixed;
    top: 0;
    bottom: 0;
    width: 0%;
    background: #000;
    z-index: 5; /* Behind project content but above global bg */
    pointer-events: none;
    will-change: width;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    /* Initial state controlled by JS now for scroll sync */
    opacity: 0;
    transform: scale(0.5); 
    will-change: transform, opacity;
    position: relative;
    z-index: 10; /* Above curtains */
}

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

.social-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
}

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

.copyright {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        width: 95%;
        padding: 0.8rem 1rem;
        top: 10px;
        border-radius: 12px;
    }

    .logo {
        font-size: 1.2rem;
    }

    .btn-primary {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }

    .btn-lang {
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
    }

    .hero {
        flex-direction: column;
        justify-content: center;
        padding-top: 6rem; /* Reduced from 8rem to bring content up slightly */
        text-align: center;
        min-height: 100vh; /* Ensure full height */
    }

    .hero-content {
        margin-bottom: 2rem;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .hero-title {
        font-size: 12vw; /* Larger on mobile */
        margin-bottom: 1.5rem;
    }

    .hero-sub {
        margin-left: 0;
        align-items: center;
    }

    .hero p {
        font-size: 1rem;
        max-width: 90%;
    }

    .hero-stats {
        justify-content: center;
        width: 100%;
        gap: 2rem;
        margin-top: 1rem;
    }

    .stat-num {
        font-size: 1.5rem;
    }

    .nav-links {
        display: none; 
    }
    
    /* Adjust section padding for mobile */
    .section {
        padding: 4rem 5%;
    }
}
