:root {
    --bg-color: #040b14;
    --bg-secondary: #0a192f;
    --primary-color: #00d4ff;
    /* Neon Cyan */
    --secondary-color: #0077b6;
    /* Deep Blue */
    --text-color: #e6f1ff;
    --text-secondary: #8892b0;
    --glass-bg: rgba(17, 34, 64, 0.7);
    --glass-border: rgba(100, 255, 218, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 0;
    background: rgba(4, 11, 20, 0.85);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.logo .dot {
    color: var(--primary-color);
    font-weight: 700;
}

.nav-menu {
    display: flex;
    gap: 30px;
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    bottom: -5px;
    left: 0;
    transition: var(--transition);
}

.nav-link:hover::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    cursor: pointer;
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 80px;
    background: radial-gradient(circle at 50% 50%, #0a192f 0%, #040b14 100%);
    overflow: hidden;
}

/* Animated Background Elements */
.hero::before {
    content: '';
    position: absolute;
    top: -10%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    z-index: 1;
}

.hero-text {
    flex: 1;
    max-width: 600px;
}

.hero-text .subtitle {
    display: block;
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: 10px;
    font-family: monospace;
}

.hero-text h1 {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 10px;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-text h2 {
    font-size: 2rem;
    color: var(--text-secondary);
    margin-bottom: 25px;
    font-weight: 600;
}

.hero-text p {
    color: var(--text-secondary);
    margin-bottom: 40px;
    font-size: 1.1rem;
    max-width: 500px;
}

.cta-buttons {
    display: flex;
    gap: 20px;
}

.btn {
    padding: 12px 28px;
    border-radius: 4px;
    font-weight: 600;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
}

.btn-primary {
    background: transparent;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-primary:hover {
    background: rgba(0, 212, 255, 0.1);
    transform: translateY(-3px);
}

.btn-outline {
    background: transparent;
    border-color: var(--text-secondary);
    color: var(--text-secondary);
}

.btn-outline:hover {
    border-color: #fff;
    color: #fff;
    transform: translateY(-3px);
}

/* Abstract Shape Animation */
.hero-image {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.abstract-shape {
    width: 400px;
    height: 400px;
    background: linear-gradient(45deg, var(--secondary-color), var(--primary-color));
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    animation: morph 8s ease-in-out infinite;
    position: relative;
    opacity: 0.8;
    filter: blur(60px);
}

@keyframes morph {
    0% {
        border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    }

    25% {
        border-radius: 58% 42% 75% 25% / 76% 46% 54% 24%;
    }

    50% {
        border-radius: 50% 50% 33% 67% / 55% 27% 73% 45%;
    }

    75% {
        border-radius: 33% 67% 58% 42% / 63% 68% 32% 37%;
    }

    100% {
        border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    }
}

/* Section Components */
.section {
    padding: 100px 0;
}

.bg-darker {
    background: var(--bg-secondary);
}

.section-title {
    margin-bottom: 60px;
}

.section-title span {
    color: var(--primary-color);
    font-family: monospace;
    font-size: 1rem;
}

.section-title h2 {
    font-size: 2.5rem;
    color: var(--text-color);
    margin-top: 10px;
    position: relative;
    display: inline-block;
}

.section-title h2::before {
    content: '';
    position: absolute;
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    bottom: -10px;
    left: 0;
    border-radius: 2px;
}

/* About Grid */
.about-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 50px;
}

.about-content .lead {
    font-size: 1.3rem;
    color: #fff;
    margin-bottom: 20px;
}

.about-content p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 40px;
}

.stat-card {
    background: var(--glass-bg);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--glass-border);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
}

.stat-card h3 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.stat-card p {
    font-size: 0.9rem;
    margin: 0;
}

.education-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 30px;
    border-radius: 12px;
}

.education-card h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 25px;
    color: #fff;
    font-size: 1.5rem;
}

.edu-item {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.edu-item:last-child {
    border: none;
    margin: 0;
    padding: 0;
}

.edu-item h4 {
    color: #fff;
    margin-bottom: 5px;
}

/* Skills */
.skills-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.skill-category {
    background: var(--bg-color);
    padding: 30px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
}

.skill-category:hover {
    border-color: var(--primary-color);
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.1);
}

.skill-category h3 {
    margin-bottom: 20px;
    color: var(--text-color);
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skill-tag {
    font-family: monospace;
    color: var(--primary-color);
    background: rgba(0, 212, 255, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    border: 1px solid transparent;
    transition: var(--transition);
}

.skill-category:hover .skill-tag {
    border-color: var(--primary-color);
}

/* Timeline */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    /* Mobile adjustment */
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(255, 255, 255, 0.1);
}

.timeline-item {
    position: relative;
    margin-bottom: 50px;
    padding-left: 50px;
}

.timeline-dot {
    position: absolute;
    left: 11px;
    top: 5px;
    width: 20px;
    height: 20px;
    background: var(--bg-color);
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    z-index: 2;
    transition: var(--transition);
}

.timeline-item:hover .timeline-dot {
    background: var(--primary-color);
    box-shadow: 0 0 15px var(--primary-color);
}

.timeline-date {
    font-family: monospace;
    color: var(--primary-color);
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.timeline-content {
    background: var(--bg-secondary);
    padding: 25px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
}

.timeline-item:hover .timeline-content {
    border-color: var(--glass-border);
    transform: translateX(10px);
}

.timeline-content h3 {
    color: #fff;
    margin-bottom: 5px;
}

.timeline-content h4 {
    color: var(--text-secondary);
    font-weight: 400;
    font-size: 1rem;
    margin-bottom: 10px;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.project-card {
    background: var(--bg-color);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
    transition: var(--transition);
    position: relative;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.project-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.project-content h3 {
    color: #fff;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.project-content p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.project-tag {
    display: inline-block;
    padding: 5px 15px;
    background: rgba(0, 212, 255, 0.1);
    color: var(--primary-color);
    border-radius: 20px;
    font-size: 0.8rem;
    font-family: monospace;
}

/* Contact */
.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.contact-item i {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.contact-form {
    background: var(--glass-bg);
    padding: 40px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.form-group {
    margin-bottom: 20px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: #fff;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(4, 11, 20, 0.9);
}

.full-width {
    width: 100%;
    margin-top: 10px;
}

/* Footer */
footer {
    padding: 40px 0;
    text-align: center;
    color: var(--text-secondary);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.social-links {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.social-links a {
    color: var(--text-secondary);
    font-size: 1.5rem;
}

.social-links a:hover {
    color: var(--primary-color);
}

/* Certificates Grid */
.certificates-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 20px 0;
}

.cert-item {
    aspect-ratio: 4 / 3;
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    z-index: 1;
}

.cert-item:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 10px 20px rgba(0, 212, 255, 0.15);
}

.cert-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0.2));
}

.cert-placeholder i {
    font-size: 3rem;
    margin-bottom: 10px;
    color: var(--primary-color);
    opacity: 0.7;
}

/* Certificate Image Styles */
.cert-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: var(--transition);
}

.cert-placeholder {
    /* Hide placeholder by default if we expect images, 
       but js handles the fallback. 
       We ensure it takes full space if shown */
    width: 100%;
    height: 100%;
    display: none;
    /* Hidden by default, shown by JS onerror */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    left: 0;
    color: var(--text-secondary);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0.2));
}

/* Lightbox Overlay (Global) */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox-overlay.active {
    display: flex;
    opacity: 1;
}

.lightbox-img {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 0 50px rgba(0, 212, 255, 0.2);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.lightbox-overlay.active .lightbox-img {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 3rem;
    color: #fff;
    cursor: pointer;
    transition: var(--transition);
}

.lightbox-close:hover {
    color: var(--primary-color);
    transform: rotate(90deg);
}

/* Responsive Certificates */
@media (max-width: 768px) {
    .certificates-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .cert-item.active {
        width: 95vw;
        height: 60vh;
    }
}

@media (max-width: 480px) {
    .certificates-grid {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(3, 1fr)
            /* Ensure vertical stacking if needed, though repeat(auto-fit) or 1fr is standard. Code says 3 vertical. */
    }
}

/* Responsive */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
        z-index: 1002;
    }

    .bar {
        display: block;
        width: 25px;
        height: 3px;
        margin: 5px auto;
        background-color: var(--text-color);
        transition: var(--transition);
    }

    .menu-toggle.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .menu-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 0;
        height: 100vh;
        width: 70%;
        background-color: var(--bg-secondary);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: 0.5s;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    }

    .nav-menu.active {
        left: 0;
    }

    .hero-content {
        flex-direction: column-reverse;
        text-align: center;
    }

    .hero-text {
        margin-top: 40px;
    }

    .hero-text h1 {
        font-size: 2.5rem;
    }

    .cta-buttons {
        justify-content: center;
    }

    .abstract-shape {
        width: 280px;
        height: 280px;
    }

    .about-grid,
    .contact-container {
        grid-template-columns: 1fr;
    }

    .timeline::before {
        left: 20px;
    }

    .timeline-dot {
        left: 11px;
    }
}