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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #ffffff;
    overflow-x: hidden;
    position: relative;
}

/* Particle Background Animation */
#particleContainer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    pointer-events: none;
}

/* Main Content */
main {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    /* Changed top padding from 4rem to 140px to clear the fixed navbar */
    padding: 140px 2rem 4rem 2rem;
}

/* Header Section */
.header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 0 1rem;
    animation: fadeInDown 0.8s ease-out;
}

.header h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #ffffff 0%, #a5a5a5 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header p {
    color: rgba(255, 255, 255, 0.7);
    max-width: 600px;
    margin: 0 auto;
    font-size: 1.1rem;
    line-height: 1.6;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    padding: 0 1rem;
    animation: fadeIn 1s ease-out;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
    background: #ffffff;
    color: #000000;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.1);
}

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

/* Project Card */
.project-card {
    background: rgba(30, 30, 30, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    animation: fadeInUp 0.6s ease forwards;
    backdrop-filter: blur(10px);
    position: relative;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
    z-index: 1;
}

.project-card:hover::before {
    left: 100%;
}

.project-card:hover {
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(255, 255, 255, 0.1);
    transform: translateY(-10px);
}

.code-preview {
    background: linear-gradient(135deg, #1a1a1a 0%, #0f0f0f 100%);
    padding: 1.5rem;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: #00ff88;
    overflow: hidden;
    position: relative;
    height: 200px;
    display: flex;
    align-items: center;
}

.code-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 136, 0.3), transparent);
}

.code-text {
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.6;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 8;
    line-clamp: 8;
    -webkit-box-orient: vertical;
}

.project-info {
    padding: 2rem;
    position: relative;
    z-index: 2;
}

.project-category {
    display: inline-block;
    padding: 0.4rem 0.9rem;
    background: rgba(0, 255, 136, 0.1);
    color: #00ff88;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    letter-spacing: 0.5px;
}

.project-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
    letter-spacing: -0.5px;
}

.project-description {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.tag {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.tag:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

/* CTA Button */
.cta-button {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.2) 0%, rgba(0, 200, 200, 0.2) 100%);
    border: 2px solid rgba(0, 255, 136, 0.5);
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 1rem;
    margin-top: 2rem;
    text-align: center;
}

.cta-button:hover {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.3) 0%, rgba(0, 200, 200, 0.3) 100%);
    border-color: rgba(0, 255, 136, 0.8);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
    transform: translateY(-2px);
}

/* Loading State */
.loading {
    text-align: center;
    padding: 3rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

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

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2.5rem;
    }

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

    nav {
        padding: 1rem 1.5rem;
    }

    .nav-links {
        gap: 1.5rem;
        font-size: 0.9rem;
    }
}

/* Ensure tags have a margin bottom to separate from button */
.project-tags {
    margin-bottom: 1.5rem;
    margin-top: auto;
}

/* Container for the two buttons */
.card-actions {
    display: flex;
    gap: 10px;
    /* Space between buttons */
    width: 100%;
}

.game-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    /* Makes buttons share equal width */
    padding: 0.8rem 0;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

/* --- PRIMARY BUTTON (Play Demo) --- */
.game-btn.primary {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.game-btn.primary:hover {
    background: linear-gradient(135deg, #00ff88, #00cc6a);
    border-color: transparent;
    color: #000000;
    box-shadow: 0 5px 15px rgba(0, 255, 136, 0.3);
    transform: translateY(-2px);
}

/* --- SECONDARY BUTTON (View Code/GitHub) --- */
.game-btn.secondary {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #cccccc;
}

.game-btn.secondary:hover {
    background: #ffffff;
    border-color: #ffffff;
    color: #000000;
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.game-btn:active {
    transform: translateY(-1px);
}