/* Define modern accent color: Electric Blue */
:root {
    --accent-color: #4dfffa; /* Electric Blue/Cyan */
    --text-color: #ffffff;
    --dark-bg: rgba(0, 0, 0, 0.85);
    --darker-bg: rgba(0, 0, 0, 0.95); 
}

/* ========== Global Styles & Setup ========== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;700;900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Poppins", sans-serif;
}

body {
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    
    /* NEW: For z-index context against fixed particle element */
    position: relative; 
    
    /* PARALLAX SETUP */
    background-attachment: fixed; 
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: background 0.5s ease-in-out;
}

/* NEW: Particle Container Styling */
#particles-js {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* Place it behind everything */
}

.accent-text {
    color: var(--accent-color);
}

/* ========== Header (Reduced Padding & Animation Setup) ========== */
header {
    background: var(--dark-bg);
    padding: 0.8rem 2rem; 
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000; /* Ensure header is above particles */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

header h1 {
    font-size: 1.5rem; 
    color: var(--text-color);
    display: flex; 
    align-items: center;
    gap: 8px;
    overflow: hidden; 
}

/* Header Title Animation Targets */
.header-stagger {
    display: inline-block;
    opacity: 0;
    transform: translateY(-20px); 
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.header-stagger.animated {
    opacity: 1;
    transform: translateY(0);
}

/* ========== Navigation ========== */
nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

nav a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    position: relative;
    padding: 0 2px 5px 2px;
    transition: color 0.3s, transform 0.3s;
}

nav a:hover,
nav a.active {
    color: var(--accent-color);
    border-bottom: 2px solid var(--accent-color);
}

/* Hamburger Menu Toggle (Crucial for visibility) */
.menu-toggle {
    display: none; /* Hidden by default on desktop */
    flex-direction: column;
    justify-content: space-around;
    height: 20px;
    width: 25px;
    cursor: pointer;
}

.menu-toggle span {
    height: 3px;
    width: 100%;
    background: var(--text-color); /* The lines need a color! */
    margin: 2px 0;
    border-radius: 3px;
    transition: 0.3s;
}

/* ========== Main Content Layout ========== */
main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem; 
    
    opacity: 0; 
    transform: translateY(20px); 
    transition: opacity 1.5s ease, transform 1.5s ease; 
    
    /* NEW: Ensure main content is above particles */
    position: relative;
    z-index: 1;
}

.content-box {
    text-align: center;
    max-width: 1000px; 
    padding: 1.5rem 2.5rem; 
    border-radius: 10px;
    
    background: var(--dark-bg); 
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 15px var(--accent-color);
}

main h2 {
    font-size: 2.2rem; 
    margin-bottom: 0.8rem; 
    color: var(--accent-color);
    font-weight: 900;
}

main p {
    text-align: justify;
    font-size: 1rem; 
    line-height: 1.6;
}

#typewriter-text {
    line-height: 1.5; 
    white-space: pre-wrap;
    overflow: hidden;
    text-align: justify;
}

.small-text {
    font-size: 1rem; 
    line-height: 1.5; 
    margin: 0;
}

/* Call to Action Button (CTA) Styling */
.cta-button {
    display: inline-block;
    padding: 10px 25px;
    background: var(--accent-color);
    color: var(--darker-bg); 
    text-decoration: none; 
    border-radius: 50px;
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: transform 0.3s, box-shadow 0.3s, background 0.3s, color 0.3s;
    margin-top: 1.5rem; 
    border: 2px solid var(--accent-color); 
}

.cta-button:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 0 25px var(--accent-color); 
    background: transparent; 
    color: var(--accent-color); 
}

/* Hyperlink Styling */
main p a, .skills-list dd a, .stagger-item a:not(.cta-button) {
    color: var(--accent-color);
    text-decoration: underline; 
    font-weight: 600;
    transition: color 0.3s;
}

main p a:hover, .skills-list dd a:hover, .stagger-item a:not(.cta-button):hover {
    color: #8affff; 
}


/* ========== STAGGERED ANIMATION DEFINITIONS ========== */

/* 1. Default/Contact Page Animation: Slide-in X */
.stagger-item {
    opacity: 0;
    transform: translateX(10px);
    margin-bottom: 1rem; 
    text-align: center;
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.stagger-item.animated {
    opacity: 1;
    transform: translateX(0);
}

/* 1b. SKILLS PAGE ANIMATION: Subtle Fade-Up (TARGET: #skills-page-new) */
#skills-page-new .stagger-item {
    opacity: 0;
    transform: translateY(15px); 
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
#skills-page-new .stagger-item.animated {
    opacity: 1;
    transform: translateY(0);
}


/* 2. PROJECTS PAGE ANIMATION: Scale-Up Pop-in */
#projects-page .stagger-item {
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}
#projects-page .stagger-item.animated {
    opacity: 1;
    transform: scale(1);
}

/* 3. CERTIFICATIONS PAGE ANIMATION: Top-Down Slide & Rotate */
#certs-page .stagger-item {
    opacity: 0;
    transform: translateY(-50px) rotateX(-90deg);
    transform-origin: top; 
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    perspective: 800px; 
}
#certs-page .stagger-item.animated {
    opacity: 1;
    transform: translateY(0) rotateX(0deg);
}


/* ========== Skills List Grid Alignment ========== */

.skills-list {
    display: grid;
    grid-template-columns: auto 1fr; 
    gap: 8px 20px; 
    margin: 1rem auto 1rem; 
    padding: 0 10px; 
    max-width: 800px; 
    text-align: left; 
}

.skills-list dt {
    font-weight: 700;
    color: var(--accent-color); 
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: right; 
    font-size: 1rem; 
    margin: 0; 
}

.skills-list dd {
    margin: 0;
    font-weight: 400;
    line-height: 1.5; 
    font-size: 1rem; 
}

/* Colon alignment for desktop views */
@media (min-width: 768px) {
    .skills-list dt {
        padding-right: 25px; 
        position: relative; 
    }
    
    .skills-list dt::after {
        content: ":";
        font-weight: 700;
        color: var(--accent-color);
        position: absolute;
        right: 10px; 
    }
}


/* ========== Footer ========== */
footer {
    text-align: center;
    padding: 0.7rem; 
    background: var(--darker-bg); 
    font-size: 0.85rem; 
    z-index: 50; /* Ensure footer is above particles */
    position: relative; /* Ensure z-index is respected */
}

footer a {
    color: var(--accent-color);
    text-decoration: none;
}

/* ========== Responsive (Mobile Styles) ========== */
@media (max-width: 768px) {
    /* Mobile Menu Display */
    .menu-toggle {
        display: flex; 
        z-index: 101;
    }
    
    nav ul {
        display: none;
        flex-direction: column;
        background: rgba(0, 0, 0, 0.95);
        position: absolute;
        top: 60px;
        right: 20px;
        width: 200px;
        padding: 1rem;
        border-radius: 10px;
        box-shadow: 0 4px 15px rgba(0, 189, 212, 0.4);
    }

    nav ul li {
        margin: 0.5rem 0;
    }

    nav a {
        display: block; 
    }

    nav ul.active {
        display: flex;
    }
}