:root {
    --bg-dark: #1a1a1d;
    --bg-light: #f5f5f7;
    --primary: #0a84ff; /* A vibrant, modern blue */
    --primary-glow: rgba(10, 132, 255, 0.5);
    --secondary: #2c2c2e;
    --text-dark: #1d1d1f;
    --text-light: #f5f5f7;
    --text-muted: #86868b;
    --border-color: #3a3a3c;
    --font-primary: 'Space Grotesk', sans-serif;
    --font-secondary: 'Inter', sans-serif;
}

body {
    font-family: var(--font-secondary);
    background-color: var(--bg-dark);
    color: var(--text-light);
    line-height: 1.7;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    font-weight: 700;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 60px;
    position: relative;
    color: var(--primary);
}

.section-title::after {
    content: '';
    width: 60px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
}

/* --- Navbar --- */
#navbar {
    background-color: rgba(26, 26, 29, 0.8);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    border-bottom: 1px solid var(--border-color);
}
.navbar-brand {
    font-family: var(--font-primary);
    font-weight: 500;
    color: var(--text-light) !important;
}
.nav-link {
    color: var(--text-muted) !important;
    transition: color 0.3s ease;
    padding: 0.5rem 1rem;
}
.nav-link.active, .nav-link:hover {
    color: var(--primary) !important;
}
.navbar-toggler {
    border-color: var(--border-color);
}
.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(245, 245, 247, 0.8)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* --- Hero Section --- */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    overflow: hidden;
}
#particles-js {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
}
.hero-content {
    position: relative;
    z-index: 2;
}
.profile-img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border: 4px solid var(--primary);
    box-shadow: 0 0 25px var(--primary-glow);
}
.hero .lead {
    font-size: 1.5rem;
    font-family: var(--font-secondary);
    color: var(--text-muted);
}
.btn-cta-primary {
    padding: 12px 30px;
    font-family: var(--font-primary);
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: var(--primary);
    color: white;
    border: 2px solid var(--primary);
}
.btn-cta-primary:hover {
    background-color: transparent;
    color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}


/* --- About Section --- */
.about {
    padding: 100px 0;
    background-color: var(--bg-dark);
}
.about-subtitle {
    color: var(--primary);
    margin-bottom: 20px;
}
.skill-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 20px;
}
.skill-item {
    background-color: var(--secondary);
    border: 1px solid var(--border-color);
    padding: 15px;
    text-align: center;
    border-radius: 8px;
    font-family: var(--font-secondary);
    transition: all 0.3s ease;
}
.skill-item:hover {
    transform: translateY(-5px);
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}
.skill-item i {
    margin-right: 8px;
    color: var(--primary);
}
.skill-item:hover i {
    color: white;
}

/* --- Experience Timeline --- */
.experience {
    padding: 100px 0;
    background-color: var(--secondary);
}
.timeline-container {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}
.timeline-container::after {
    content: '';
    position: absolute;
    width: 3px;
    background-color: var(--border-color);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -1.5px;
}
.timeline-item {
    padding: 10px 40px;
    position: relative;
    background-color: inherit;
    width: 50%;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.timeline-item.is-visible {
    opacity: 1;
    transform: translateY(0);
}
.timeline-item::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    right: -10px;
    background-color: var(--bg-dark);
    border: 4px solid var(--primary);
    top: 20px;
    border-radius: 50%;
    z-index: 1;
}
.timeline-item:nth-child(odd) {
    left: 0;
    text-align: right;
}
.timeline-item:nth-child(even) {
    left: 50%;
}
.timeline-item:nth-child(odd)::before {
    content: " ";
    height: 0;
    position: absolute;
    top: 25px;
    width: 0;
    z-index: 1;
    right: 30px;
    border: medium solid var(--border-color);
    border-width: 10px 0 10px 10px;
    border-color: transparent transparent transparent var(--border-color);
}
.timeline-item:nth-child(even)::before {
    content: " ";
    height: 0;
    position: absolute;
    top: 25px;
    width: 0;
    z-index: 1;
    left: 30px;
    border: medium solid var(--border-color);
    border-width: 10px 10px 10px 0;
    border-color: transparent var(--border-color) transparent transparent;
}
.timeline-item:nth-child(even)::after {
    left: -10px;
}
.timeline-content {
    padding: 20px 30px;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    position: relative;
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.timeline-content:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
}
.timeline-content h4 {
    color: var(--primary);
    font-size: 1.2rem;
}
.timeline-content .company {
    font-family: var(--font-secondary);
    color: var(--text-light);
    font-weight: 500;
    margin-bottom: 10px;
}
.timeline-content .date, .timeline-content .location {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0;
}


/* --- Projects & Certificates --- */
#projects, #certificates {
    padding: 100px 0;
}
#projects { background-color: var(--bg-dark); }
#certificates { background-color: var(--secondary); }
.project-card, .certificate-card {
    background-color: var(--bg-dark);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
}
#certificates .certificate-card { background-color: var(--bg-dark); }
#projects .project-card { background-color: var(--secondary); }

.project-card:hover, .certificate-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.4), 0 0 20px var(--primary-glow);
}
.project-img, .certificate-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}
.certificate-img-wrapper {
    position: relative;
    cursor: pointer;
}
.overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(10, 132, 255, 0.7);
    color: white;
    opacity: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    transition: opacity 0.3s ease;
}
.certificate-card:hover .overlay { opacity: 1; }
.project-body, .certificate-body { padding: 25px; }
.project-title { color: var(--primary); }
.project-tech { margin: 15px 0; }
.tech-tag {
    background: var(--bg-dark);
    color: var(--text-muted);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    margin-right: 5px;
}
.project-links a {
    color: var(--text-light);
    text-decoration: none;
    margin-right: 15px;
    transition: color 0.3s ease;
}
.project-links a:hover { color: var(--primary); }

/* --- Contact Section --- */
.contact {
    padding: 100px 0;
    background-color: var(--bg-dark);
}
.contact .section-title { color: white; }
.contact .lead { color: var(--text-muted); max-width: 800px; margin-left: auto; margin-right: auto;}
.social-links {
    margin-top: 40px;
}
.social-icon {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 60px;
    height: 60px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 1.5rem;
    margin: 0 15px;
    transition: all 0.3s ease;
}
.social-icon:hover {
    color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 20px var(--primary-glow);
    transform: translateY(-5px);
}

/* --- Footer --- */
footer {
    background-color: var(--secondary);
    padding: 30px 0;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}
footer i { color: var(--primary); }

/* Modal */
.modal-content { background-color: var(--secondary); }
.modal-header { border-bottom-color: var(--border-color); }
.modal-img {
    max-width: 100%;
    max-height: 80vh; /* Limits height to 80% of the viewport's height */
    height: auto; /* Maintains aspect ratio */
}
.btn-close { filter: invert(1); }

/* --- Responsive Design --- */
@media screen and (max-width: 768px) {
    .timeline-container::after {
        left: 31px;
    }
    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
    }
    .timeline-item:nth-child(odd) {
        left: 0%;
        text-align: left;
    }
    .timeline-item:nth-child(even) {
        left: 0%;
    }
    .timeline-item::before {
        left: 60px;
        border: medium solid var(--border-color);
        border-width: 10px 10px 10px 0;
        border-color: transparent var(--border-color) transparent transparent;
    }
    .timeline-item:nth-child(odd)::after, .timeline-item:nth-child(even)::after {
        left: 21px;
    }
}
