.projects-grid {
    display: grid;
    grid-template-columns: 1fr;  
    max-width: 900px;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-md);
}

/* Project Card Styling */
article {
    background: var(--card-bg);
    padding: var(--spacing-md);
    border-radius: 0.75rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.4s ease;
    animation: slideUp 0.6s ease-out;
    
    &:hover {
        transform: translateY(-10px);
        /* COLOR-MIX */
        box-shadow: 0 15px 40px color-mix(in srgb, var(--primary-color), black 80%);
    }
    
    & h3 {
        /* COLOR-MIX */
        color: color-mix(in srgb, var(--primary-color), var(--secondary-color) 30%);
        margin-bottom: 1rem;
        font-size: 1.75rem;
    }
}

article img {
    width: 100%;
    max-width: 400px;
    height: auto;
    object-fit: contain;
    object-position: center;
    border-radius: 0.5rem;
    margin: 1rem auto;  
    /* margin: 1rem 0; */
    transition: transform 0.3s ease;
    display: block;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    
    &:hover {
        transform: scale(1.1);
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    }
}

.comparison-layout .image-comparison {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    align-items: stretch;        
    margin: 1.5rem 0;
    flex-wrap: wrap;
    
    & figure {
        flex: 1;
        min-width: 250px;
        max-width: 300px;
        margin: 0;
        display: flex;
        flex-direction: column;
        
        & img {
            width: 100%;
            height: 300px;           
            object-fit: cover;       
            object-position: center;
            margin: 0;
            border-radius: 0.5rem;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
            transition: transform 0.3s ease;
            
            &:hover {
                transform: scale(1.05);
                box-shadow: 0 4px 12px rgba(0,0,0,0.15);
            }
        }
        
        & figcaption {
            margin-top: 0.75rem;
            font-size: 1rem;
            color: var(--text-color);
            text-align: center;
            font-weight: 600;
        }
    }
}

@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    article img {
        height: 200px;
    }
}

@media (max-width: 480px) {
    article img {
        height: 150px;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

main > section > h2 {
    text-align: center;
}

/* Center the projects container */
section {
    display: flex;
    flex-direction: column;
    align-items: center;
}
 */

 main {
    max-width: 1200px;
    margin: var(--spacing-lg) auto;
    padding: var(--spacing-md);
    align-items: center; 
}

/* Data loading controls for HW5 Part 2 */
.data-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.data-button {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.data-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.data-button:active {
    transform: translateY(0);
}

/* Projects container */
.projects-container {
    display: grid;
    grid-template-columns: 1fr;
    max-width: 900px;
    margin: 0 auto;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-md);
}

/* Legacy projects grid (keep for backward compatibility) */
.projects-grid {
    display: grid;
    grid-template-columns: 1fr;  
    max-width: 900px;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-md);
}

/* Project Card Styling - for any remaining legacy cards */
article {
    background: var(--card-bg);
    padding: var(--spacing-md);
    border-radius: 0.75rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.4s ease;
    animation: slideUp 0.6s ease-out;
    
    &:hover {
        transform: translateY(-10px);
        /* COLOR-MIX */
        box-shadow: 0 15px 40px color-mix(in srgb, var(--primary-color), black 80%);
    }
    
    & h3 {
        /* COLOR-MIX */
        color: color-mix(in srgb, var(--primary-color), var(--secondary-color) 30%);
        margin-bottom: 1rem;
        font-size: 1.75rem;
    }
}

article img {
    width: 100%;
    max-width: 400px;
    height: auto;
    object-fit: contain;
    object-position: center;
    border-radius: 0.5rem;
    margin: 1rem auto;  
    /* margin: 1rem 0; */
    transition: transform 0.3s ease;
    display: block;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    
    &:hover {
        transform: scale(1.1);
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    }
}

.comparison-layout .image-comparison {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    align-items: stretch;        
    margin: 1.5rem 0;
    flex-wrap: wrap;
    
    & figure {
        flex: 1;
        min-width: 250px;
        max-width: 300px;
        margin: 0;
        display: flex;
        flex-direction: column;
        
        & img {
            width: 100%;
            height: 300px;           
            object-fit: cover;       
            object-position: center;
            margin: 0;
            border-radius: 0.5rem;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
            transition: transform 0.3s ease;
            
            &:hover {
                transform: scale(1.05);
                box-shadow: 0 4px 12px rgba(0,0,0,0.15);
            }
        }
        
        & figcaption {
            margin-top: 0.75rem;
            font-size: 1rem;
            color: var(--text-color);
            text-align: center;
            font-weight: 600;
        }
    }
}

/* Custom element styling integration */
project-card {
    /* Ensure custom elements integrate well with grid */
    width: 100%;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading .data-button {
    background: #ccc;
    cursor: not-allowed;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-color);
    background: var(--card-bg);
    border-radius: 0.75rem;
    border: 2px dashed #ddd;
}

.empty-state h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

@media (max-width: 768px) {
    .projects-grid, .projects-container {
        grid-template-columns: 1fr;
    }
    
    article img {
        height: 200px;
    }
    
    .data-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .data-button {
        width: 200px;
    }
}

@media (max-width: 480px) {
    article img {
        height: 150px;
    }
    
    main {
        padding: var(--spacing-sm);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

main > section > h2 {
    text-align: center;
}

/* Center the projects container */
section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Responsive grid for larger screens if we want multiple columns later */
@media (min-width: 1200px) {
    .projects-container {
        grid-template-columns: 1fr;  /* Keep single column for now */
        max-width: 1000px;
    }
}

/* Data loading controls */
.data-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.data-button {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.data-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.data-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-color);
    background: var(--card-bg);
    border-radius: 0.75rem;
    border: 2px dashed #ddd;
    margin: 2rem 0;
}

.empty-state h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}