/* --- Base Reset & Responsiveness --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --container-width: 80%;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --accent: #00d4ff;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #0a0a0c;
    color: #ffffff;
    line-height: 1.6;
    overflow-x: hidden; /* Prevents horizontal scroll on mobile */
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Ensures body is at least as tall as the screen */
}

h1 {
    font-size: 2.8rem;
    font-weight: 600;
    margin-bottom: 1.8rem;
    margin-left: -2px;
    background: linear-gradient(to right, #ffffff, #00d4ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent; /* Gradient text effect */
}

p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.8;
    margin-bottom: 1.5rem;
    max-width: 90%;
}

/* --- Particle Canvas --- */
#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* Keep it behind everything */
    background: radial-gradient(circle at center, #1a1a2e 0%, #0a0a0c 100%);
    pointer-events: none; /* Allows clicks to pass through to the buttons below */
}

/* 2. Ensure the main content stays in front */
main.container {
    position: relative; 
    z-index: 1; /* Higher than -1 */
    flex: 1 0 auto; /* This tells the main content to grow and fill available space */
    width: 95%;
    max-width: 1200px;
    margin: 60px auto 40px auto;
    padding: 0 10px;
}
/* --- Navigation --- */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 0.5rem 0;
    z-index: 100;
    background: rgba(10, 10, 12, 0.8);
    backdrop-filter: blur(5px); /* Glass effect */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-container {
    max-width: 900px; /* Slightly wider than content for balance */
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0.5rem;
}

.logo {
    font-weight: 600;
    font-size: 1.4rem;
    letter-spacing: 1px;
    color: #00d4ff; /* Accent color */
}

.nav-links a {
    color: #ccc;
    text-decoration: none;
    margin-left: 2rem;
    font-weight: 400;
    transition: color 0.3s ease;
}

.nav-links a:hover, .nav-links a.active {
    color: #ffffff;
    border-bottom: 2px solid #00d4ff;
}

/* --- Main Layout --- */
.container {
    max-width: 100%; /* Narrower for better readability */
    margin: 50px 5px 5px; 
    padding: 1 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center; /* Centers the card horizontally */
}

.content-section {
    transition: opacity 0.5s ease; /* Matches the JS fade */
    max-width: 90%; /* Narrower for better readability */
    margin: 50px 5% 20px 5%; 
    padding: 1 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center; /* Centers the card horizontally */
}

.project-list {
    list-style: none;
    width: 100%;
    margin-top: 2rem;
}

.project-list li {
    background: rgba(255, 255, 255, 0.02);
    margin-bottom: 1rem;
    padding: 1.2rem 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column; /* Ensure header and description stack vertically */
    transition: all 0.3s ease;
}

.project-list li:hover {
    background: rgba(0, 212, 255, 0.05);
    border-color: rgba(0, 212, 255, 0.3);
    /* Removed the padding-left slide to keep text stable */
}

/* --- Glass Card Style --- */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: clamp(1.5rem, 5vw, 1.5rem); /* Responsive padding: smaller on mobile, larger on desktop */
    width: 100%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    text-align: left; /* Keep text readable */
}

/* --- Hamburger Button --- */
.menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 101;
}

.bar {
    width: 100%;
    height: 3px;
    background-color: #00d4ff;
    border-radius: 10px;
    transition: all 0.3s ease;
}

/* --- Mobile Nav Links --- */
.nav-links {
    position: fixed;
    top: 0;
    right: -100%; /* Hidden by default */
    width: 30%;
    height: 100vh;
    background: rgba(10, 10, 12, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: right 0.4s cubic-bezier(0.77,0.2,0.05,1.0);
    z-index: 100;
}

.nav-links.active {
    right: 0; /* Slide in */
}

.nav-links a {
    margin: 1.5rem 0;
    font-size: 1.5rem;
}

/* --- Animation for the "X" when open --- */
.menu-toggle.open .bar:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}
.menu-toggle.open .bar:nth-child(2) {
    opacity: 0;
}
.menu-toggle.open .bar:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* --- Accordion Styling --- */
.project-item {
    background: rgba(255, 255, 255, 0.02);
    margin-bottom: 1rem;
    padding: 1.2rem 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.3s ease;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.project-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--accent);
}

.toggle-icon {
    transition: transform 0.3s ease;
    color: #00d4ff;
    font-size: 1.5rem;
}

/* --- The Secret: Smooth Height Transition --- */
.project-description {
    max-height: 0;
    opacity: 0;
    overflow: hidden; /* CRITICAL: Keeps text hidden */
    transition: all 0.4s cubic-bezier(0, 1, 0, 1);
}

.project-description p {
    margin: 0;
    text-align: left;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
}

/* When the item is active */
.project-item.active .project-description {
    max-height: 1000px; /* High enough for content */
    opacity: 1;
    margin-top: 1rem;
    transition: all 0.4s ease-in-out;
}

.project-item.active .toggle-icon {
    transform: rotate(45deg); /* Turns + into x */
    color: #ff4b2b; /* Change color when open */
}

/* --- Mobile Navigation Adjustments --- */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    .nav-container { padding: 0 1.5rem; }
}

/* --- Footer Styling --- */
footer {
    flex-shrink: 0; /* Prevents the footer from squishing */
    padding: 5px;
    text-align: left;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
    width: 100%;
    z-index: 10;
}