/* General Body Styles */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.8;
    margin: 0;
    padding: 0;
    background: #232526; /* Fallback background color */
    color: #f0f0f0;
    -webkit-user-select: none; /* Safari */
    -ms-user-select: none; /* IE 10+ */
    user-select: none; /* Standard syntax */
}

#tsparticles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* Header Styles */
header {
    background: transparent;
    color: #fff;
    padding: 4rem 0;
    text-align: center;
}

header h1 {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 3.5rem;
    letter-spacing: 2px;
    font-weight: 700;
    display: inline-block; /* Shrink hover area to text */
    cursor: pointer;       /* Add pointer cursor on hover */
}

header p {
    margin: 10px 0 0;
    font-size: 1.3rem;
    font-weight: 400;
}

/* Main Content Styles */
main {
    padding: 20px;
    max-width: 1240px;
    margin: 0 auto;
}

#projects {
    text-align: center;
    padding: 40px 0;
}

#projects h2 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 2.5rem;
    margin-bottom: 50px;
    color: #fff;
}

.project-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
}

.project-tile {
    flex-basis: 340px; /* Set a base width for flex items */
    background: rgba(255, 255, 255, 0.001);
    backdrop-filter: blur(5px);
    border-radius: 15px;
    padding: 25px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    cursor: pointer;
}

.project-tile:hover {
    transform: translateY(-10px); 
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.5);
}

.project-image-container {
    width: 100%;
    height: 180px;
    background-color: #333;
    border-radius: 10px;
    margin-bottom: 20px;
    overflow: hidden;
}

.project-image {
    width: 100%;
    height: 180px; /* Set a fixed height */
    object-fit: cover; /* Crop image to fit, maintaining aspect ratio */
    border-radius: 10px; /* Match the container's border-radius */
    margin-bottom: 20px; /* Add some space below the image */
    transition: transform 0.3s ease;
}

.project-tile:hover .project-image {
    transform: scale(1.05);
}

.project-tile h3 {
    margin: 0 0 10px 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.project-tile p {
    margin: 0;
    color: #ccc;
    font-weight: 400;
}

/* Image Zoom Styles */
.image-zoom-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.image-zoom-backdrop.visible {
    opacity: 1;
}

.image-zoom-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.image-zoom-container.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.zoomed-image {
    max-width: 80vw;
    max-height: 70vh;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.visit-project-button {
    display: inline-block;
    padding: 12px 25px;
    background: #007bff;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.visit-project-button:hover {
    background: #0056b3;
    transform: translateY(-2px);
}

/* Page Navigation Animation */
body.navigating-out > header,
body.navigating-out > footer,
body.navigating-out .project-tile:not(.navigating-focus) {
    opacity: 0;
}

.project-tile.navigating-focus {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s ease-out 0.1s;
    transform: scale(5);
    opacity: 0;
    z-index: 100;
}

body.navigating-out .image-zoom-backdrop {
    opacity: 0;
}

.image-zoom-container.navigating-zoom {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s ease-out 0.1s;
    transform: translate(-50%, -50%) scale(5);
    opacity: 0;
}

/* Footer Styles */
footer {
    text-align: center;
    padding: 40px 20px;
    background: transparent;
    color: #aaa;
}

footer p span {
    display: inline-block; /* Allows transforms */
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

footer p {
    margin-bottom: 15px;
    display: inline-block; /* Shrink hover area to text */
    cursor: pointer;       /* Add pointer cursor on hover */
}

.social-links a {
    color: #aaa;
    text-decoration: none;
    margin: 0 15px;
    font-size: 1.5rem;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: #00aaff;
}

#interactive-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* Responsive Design */
@media (max-width: 992px) {
    #projects {
        padding: 20px 0;
        grid-template-columns: 1fr;
    }
}

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

    header p {
        font-size: 1.1rem;
    }

    #projects h2 {
        font-size: 2rem;
    }
    #interactive-background{
        display: none !important; /* Hide background on mobile */
    }
}
