* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Comic Sans MS', 'Comic Sans', sans-serif;
}

body {
    background: #0a0a23;
    color: #ffffff;
    overflow-x: hidden;
    font-size: 16px; /* Base font size for rem units */
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    max-width: 100vw;
    background: rgba(10, 10, 35, 0.8);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    z-index: 1000;
    box-sizing: border-box;
}

.nav-links {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-links a {
    color: #ffffff;
    background: rgba(0, 255, 204, 0.15);
    text-decoration: none;
    font-size: 1.2rem;
    padding: 0.5rem 1rem;
    transition: color 0.3s, background 0.3s;
    border-radius: 5px;
}

.nav-links a:hover, .nav-links a.active {
    color: #ffffff;
    background: #1e90ff;
}


/* Main Content */
main {
    min-height: 100vh;
    padding: 6rem 1rem;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.home-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 90%; /* Fluid max-width */
    margin: 0 auto;
    width: 100%;
}

.home-content * {
    text-decoration: none;
}

.typing-effect {
    font-size: 2rem;
    border-right: 0.125rem solid #00ffcc; /* 2px relative to 16px base */
    white-space: nowrap;
    overflow: hidden;
    width: 0;
    animation: typing 3s steps(40, end) forwards, blink 0.5s step-end infinite;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink {
    from, to { border-color: transparent }
    50% { border-color: #00ffcc }
}

.section-content {
    max-width: 90%; /* Fluid max-width */
    width: 100%;
    text-align: center;
    margin: 0 auto;
}

.project-detail {
    text-align: left; /* Left alignment for project pages */
    padding-left: 32px;
}

h2 {
    font-size: 2rem;
    color: #ffffff;
    margin-bottom: 0.5rem;
}

p {
    font-size: 1rem;
    line-height: 1.4;
    color: #cccccc;
}

/* Static Horizontal Lists */
.project-list, .cat-list {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap; /* Allow wrapping on small screens */
}

.project-list .project-card, .cat-list .cat-card {
    width: 40vw; /* Fluid width, approximately 250px on 625px+ screens */
    min-width: 180px; /* Minimum width for small screens */
    max-width: 250px; /* Cap at original size */
}

.project-list a.project-card{
    text-decoration: none; /* Remove underline from links */
}
.project-list a .project-card > p { 
    text-decoration: none !important;
}

ul{
    padding-left:2rem;
}

/* Carousel Styles (for Home Page) */
.carousel-container {
    width: 90%; /* Fluid width */
    max-width: 1200px;
    margin: 0 auto;
    overflow: hidden;
    position: relative;
}

.carousel-track {
    display: flex;
    width: max-content;
    animation: scroll 20s linear infinite;
}

.carousel-container:hover .carousel-track {
    animation-play-state: paused;
}

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.carousel-item {
    flex: 0 0 auto;
    margin-right: 0.5rem;
}

.carousel-item .project-card, .carousel-item .cat-card {
    width: 40vw; /* Fluid width */
    min-width: 180px;
    max-width: 250px;
}
.carousel-item .project-card{
    height: 150px;
}

.project-card, .cat-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    transition: transform 0.3s, box-shadow 0.3s;
    padding: 1rem;
    padding-bottom: 1.5rem;
}

.project-card {
    width: calc(100%-2rem);
    height: auto; 
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.project-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.3rem;
    color: #ffffff;
    text-decoration: underline;
}

.project-card p {
    font-size: 0.9rem;
    margin: 0;
}


.cat-card {
    display: flex;
    flex-direction: column;
}

.cat-card img {
    width: calc(100%-2rem); 
    height: auto;
    padding-bottom: 10%;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 0.3rem;
}

.cat-card p {
    margin: 0;
}

.project-card:hover, .cat-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 0 20px rgba(0, 255, 204, 0.5);
}

/* Particle Background */
#particles-js {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
}

/* Modal Styles (from cats.html, kept unchanged) */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}
.modal-content {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
}
.close {
    position: absolute;
    top: 1.25rem; /* 20px relative to 16px base */
    right: 1.875rem; /* 30px relative to 16px base */
    color: #fff;
    font-size: 2.5rem; /* 40px relative to 16px base */
    font-weight: bold;
    cursor: pointer;
}
.close:hover,
.close:focus {
    color: #00ffcc;
    text-decoration: none;
    cursor: pointer;
}

/* Media Queries for Extreme Sizes */
@media (max-width: 400px) {
    .nav-links a {
        font-size: 1rem;
        padding: 0.4rem 0.8rem;
    }

    .typing-effect {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    p {
        font-size: 0.9rem;
    }

    .project-card h3 {
        font-size: 1rem;
    }

    .project-card p {
        font-size: 0.8rem;
    }

    .project-detail{
        padding-left: 1rem;
    }
}

@media (max-width: 768px) {
    .nav-links {
        justify-content: center; /* Center align on mobile */
    }
    .carousel-item .project-card h3 {
        font-size: 1rem; /* Reduced from 1.2rem */
        overflow-wrap: break-word; /* Allow text to wrap within padding */
    }
    .carousel-item .project-card p {
        font-size: 0.8rem; /* Reduced from 0.9rem */
        overflow-wrap: break-word; /* Allow text to wrap within padding */
    }
    main {
        padding-top: 96px !important; 
    }
}

@media (min-width: 1200px) {
    .home-content, .section-content {
        max-width: 1200px;
    }

    .carousel-container {
        max-width: 1200px;
    }
    .project-detail{
        padding-left: 80px;
    }
}
