:root {
    /* Light Theme (Default) */
    --primary: #2563eb;
    --secondary: #1e40af;
    --dark: #1f2937;
    --light: #f9fafb;
    --gray: #6b7280;
    --accent: #f59e0b;
    --card-bg: #ffffff;
    --text-color: #1f2937;
    --bg-color: #f9fafb;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

/* Dark Neon Theme */
body.dark-theme {
    --primary: #6366f1;
    /* Electric Indigo */
    --secondary: #a855f7;
    /* Purple */
    --dark: #f8fafc;
    /* Off-white for text */
    --light: #0f172a;
    /* Deep Slate Blue Bg */
    --gray: #94a3b8;
    /* Slate gray */
    --accent: #10b981;
    /* Emerald */
    --card-bg: rgba(30, 41, 59, 0.7);
    /* Glassmorphism card */
    --text-color: #f1f5f9;
    --bg-color: #020617;
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --glass-border: 1px solid rgba(255, 255, 255, 0.08);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header & Navigation */
header {
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

header.scrolled {
    background-color: rgba(255, 255, 255, 0.98);
    padding: 5px 0;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

nav {
    display: flex;
    /* justify-content: space-between; Removed to fix alignment */
    align-items: center;
    padding: 20px 0;
    transition: all 0.3s ease;
}

header.scrolled nav {
    padding: 10px 0;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    color: var(--accent);
    animation: pulse 2s infinite;
}

.nav-links {
    display: flex;
    list-style: none;
    margin-left: auto;
    /* Push links to the right */
}

.nav-links li {
    margin-left: 30px;
    position: relative;
}

.nav-links a {
    text-decoration: none;
    color: var(--dark);
    font-weight: 500;
    transition: color 0.3s;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background: var(--primary);
    bottom: -5px;
    left: 0;
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-links .nav-icon {
    display: none;
}

.hamburger {
    display: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-color);
    margin-left: 20px;
}

.theme-toggle {
    cursor: pointer;
    font-size: 1.2rem;
    padding: 10px;
    border-radius: 50%;
    margin-left: 20px;
    transition: all 0.3s ease;
    color: var(--dark);
}

.theme-toggle:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--primary);
}

body.dark-theme header {
    background-color: rgba(15, 23, 42, 0.8);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    border-bottom: var(--glass-border);
}

body.dark-theme header.scrolled {
    background-color: rgba(15, 23, 42, 0.95);
}

body.dark-theme .project-card,
body.dark-theme .contact-form {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: var(--glass-border);
}

body.dark-theme header.scrolled {
    background-color: rgba(10, 10, 10, 0.95);
}

body.dark-theme .theme-toggle {
    color: #e0e0e0;
}

body.dark-theme .theme-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--accent);
}


/* Hero Section */
.hero {
    padding: 180px 0 120px;
    background: linear-gradient(135deg, var(--bg-color) 0%, var(--light) 100%);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.1);
    top: -150px;
    right: -150px;
}

.hero::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(245, 158, 11, 0.1);
    bottom: -100px;
    left: -100px;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    color: var(--text-color);
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 1s ease forwards;
}

.hero p {
    font-size: 1.3rem;
    margin: 0 auto 30px;
    color: var(--gray);
    max-width: 600px;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 1s ease 0.3s forwards;
}

.btn {
    display: inline-block;
    padding: 14px 35px;
    background-color: var(--primary);
    color: white;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 1s ease 0.6s forwards;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    background-color: var(--secondary);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.btn::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: -100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.btn:hover::after {
    left: 100%;
}

body.dark-theme .btn {
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
    border: none;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

body.dark-theme .btn:hover {
    box-shadow: 0 15px 35px rgba(99, 102, 241, 0.6);
    transform: translateY(-5px);
}

/* About Section */
.section {
    padding: 120px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 70px;
}

.section-title h2 {
    font-size: 2.8rem;
    color: var(--text-color);
    position: relative;
    display: inline-block;
}

.section-title h2::after {
    content: '';
    position: absolute;
    width: 80px;
    height: 4px;
    background-color: var(--primary);
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
}

body.dark-theme .section-title h2 {
    text-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
}

body.dark-theme .section-title h2::after {
    box-shadow: 0 0 15px var(--primary);
}

.about-content {
    display: flex;
    align-items: center;
    gap: 60px;
}

.about-text {
    flex: 1;
}

.about-text h3 {
    font-size: 2rem;
    margin-bottom: 25px;
    color: var(--dark);
}

.about-text p {
    margin-bottom: 25px;
    color: var(--gray);
    font-size: 1.1rem;
}

.skills {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 30px;
}

.skill {
    background: var(--primary);
    color: white;
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.9rem;
    transition: transform 0.3s;
}

.skill:hover {
    transform: translateY(-5px);
}

.about-image {
    flex: 1;
    text-align: center;
    position: relative;
}

.profile-img-container {
    position: relative;
    display: inline-block;
}

.profile-img {
    width: 350px;
    height: 350px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border: 8px solid white;
    animation: float 6s ease-in-out infinite;
}

body.dark-theme .profile-img {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border: 4px solid rgba(255, 255, 255, 0.1);
}

body.dark-theme .profile-img-container::before {
    border: 2px dashed var(--gray);
    box-shadow: none;
}

.profile-img-container::before {
    content: '';
    position: absolute;
    width: 370px;
    height: 370px;
    border-radius: 50%;
    border: 2px dashed var(--primary);
    top: -20px;
    left: -20px;
    animation: rotate 20s linear infinite;
}

/* Projects Section */
.projects {
    background-color: var(--bg-color);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 40px;
}

.project-card {
    background-color: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    transition: all 0.4s ease;
    opacity: 0;
    transform: translateY(50px);
}

.project-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.project-card:hover {
    transform: translateY(-15px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.project-img-container {
    position: relative;
    overflow: hidden;
    height: 220px;
}

.project-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-card:hover .project-img {
    transform: scale(1.1);
}

.project-info {
    padding: 25px;
}

.project-info h3 {
    margin-bottom: 15px;
    color: var(--primary);
    font-size: 1.4rem;
}

.project-info p {
    color: var(--gray);
    margin-bottom: 20px;
}

.project-links {
    display: flex;
    gap: 15px;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
}

.project-link:hover {
    color: var(--secondary);
    transform: translateX(5px);
}

/* Contact Section */
.contact-content {
    display: flex;
    gap: 60px;
}

.contact-info {
    flex: 1;
}

.contact-info h3 {
    margin-bottom: 25px;
    color: var(--dark);
    font-size: 1.8rem;
}

.contact-info p {
    margin-bottom: 35px;
    color: var(--gray);
    font-size: 1.1rem;
}

.contact-details {
    margin-bottom: 40px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.contact-icon {
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background-color: var(--primary);
    color: white;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s;
    font-size: 1.2rem;
}

.social-link:hover {
    background-color: var(--secondary);
    transform: translateY(-5px);
}

.contact-form {
    flex: 1;
    background: var(--card-bg);
    padding: 40px;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.form-control {
    width: 100%;
    padding: 15px 20px;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s;
    background-color: var(--bg-color);
    color: var(--text-color);
}

body.dark-theme .form-control {
    border-color: #333;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

body.dark-theme .form-control:focus {
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
    border-color: var(--primary);
}

textarea.form-control {
    min-height: 150px;
    resize: vertical;
}

/* Footer */
footer {
    background-color: transparent;
    padding: 30px 0;
}

.copyright {
    text-align: center;
}

.copyright p {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #111827 0%, #1e1b4b 100%);
    color: rgba(255, 255, 255, 0.95);
    padding: 10px 24px;
    border-radius: 50px;
    font-size: 0.88rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    border: 1px solid rgba(99, 102, 241, 0.25);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
}

.copyright p:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.35);
    border-color: rgba(99, 102, 241, 0.6);
}

@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

/* Animations */
@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes float {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }

    100% {
        transform: translateY(0);
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
/* Responsive Design */
@media (max-width: 992px) {
    .container {
        width: 95%;
    }

    .about-content,
    .contact-content {
        flex-direction: column;
    }

    .about-image {
        order: -1;
        margin-bottom: 40px;
    }

    .profile-img {
        width: 280px;
        height: 280px;
    }

    .profile-img-container::before {
        width: 300px;
        height: 300px;
    }

    .section-title h2 {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    body {
        padding-bottom: 75px; /* Prevent bottom navbar from overlapping footer/content */
    }

    .hamburger {
        display: none !important; /* Hide hamburger menu on mobile */
    }

    /* Lock header dimensions on mobile to prevent shifts on scroll */
    header,
    header.scrolled {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 999;
        padding: 0 !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        transition: none !important;
        background-color: rgba(255, 255, 255, 0.98) !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05) !important;
    }

    body.dark-theme header,
    body.dark-theme header.scrolled {
        background-color: rgba(15, 23, 42, 0.98) !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2) !important;
    }
    
    /* Lock nav padding on mobile to eliminate scrolling jitters */
    header nav,
    header.scrolled nav {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 0 !important;
    }

    .theme-toggle {
        margin-left: auto; /* Push theme toggle to the right */
    }

    .nav-links {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        width: 100%;
        height: 65px;
        background-color: rgba(255, 255, 255, 0.85);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        border-top: 1px solid rgba(0, 0, 0, 0.08);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
        display: flex !important;
        flex-direction: row !important;
        align-items: center;
        justify-content: space-around;
        padding: 6px 15px calc(6px + env(safe-area-inset-bottom));
        z-index: 10000;
        margin: 0;
        transition: none !important;
        transform: none !important;
        right: 0 !important;
    }

    /* Dark theme bottom navbar */
    body.dark-theme .nav-links {
        background-color: rgba(15, 23, 42, 0.9);
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    }

    .nav-links li {
        margin: 0 !important;
        padding: 0;
        list-style: none;
        flex: 1;
        display: flex;
        justify-content: center;
    }

    .nav-links a {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        font-size: 0.72rem;
        font-weight: 500;
        color: var(--gray);
        gap: 4px;
        text-decoration: none;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        width: 100%;
        padding: 6px 0;
        position: relative;
    }

    .nav-links a::after {
        display: none !important;
    }

    .nav-links .nav-icon {
        display: block !important;
        font-size: 1.3rem;
        transition: transform 0.3s ease, color 0.3s ease;
    }

    .nav-links a:hover,
    .nav-links a.active {
        color: var(--primary);
    }

    .nav-links a.active .nav-icon {
        transform: translateY(-2px) scale(1.1);
        color: var(--primary);
    }

    body.dark-theme .nav-links a.active {
        color: var(--primary);
        text-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
    }
    
    body.dark-theme .nav-links a.active .nav-icon {
        color: var(--primary);
        filter: drop-shadow(0 0 5px var(--primary));
    }

    .hero {
        padding: 150px 0 80px;
    }

    .hero h1 {
        font-size: 2.8rem;
    }

    .hero p {
        font-size: 1.1rem;
        padding: 0 15px;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    footer {
        padding-top: 10px !important;    /* Micro top padding on mobile */
        padding-bottom: 70px !important; /* Ultra-tight bottom padding to fit snugly above the bottom navbar */
    }

    .copyright p {
        font-size: 0.76rem !important;   /* Delicate, ultra-compact copyright font size on mobile */
        padding: 6px 14px !important;    /* Sleek, snug padding for the black pill on mobile */
        gap: 6px !important;             /* Cozy spacing for mobile */
    }

    .copyright p:hover {
        transform: translateY(-1.5px) !important; /* Smooth touch hover reaction */
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 15px;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    /* Beautiful stacked hero buttons on mobile */
    .hero-content [data-aos="fade-right"] {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .hero-content .btn {
        width: 100%;
        max-width: 280px;
        margin: 0 !important;
        text-align: center;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* snug hero visual offsets on mobile */
    .hero-visual::before {
        top: 12px;
        right: -12px;
        border-radius: 20px;
    }
    
    .hero-img {
        border-radius: 20px;
    }

    .section {
        padding: 80px 0;
    }

    .section-title {
        margin-bottom: 50px;
    }

    .section-title h2 {
        font-size: 2rem;
    }

    .about-text h3 {
        font-size: 1.8rem;
    }

    .profile-img {
        width: 220px;
        height: 220px;
    }

    .profile-img-container::before {
        width: 240px;
        height: 240px;
    }

    .skills {
        justify-content: center;
    }

    .contact-form {
        padding: 25px;
    }

    .contact-item {
        flex-direction: column;
        text-align: center;
    }

    .btn {
        padding: 12px 30px;
    }
}

/* Small Devices (iPhone SE, Foldable) */
@media (max-width: 375px) {
    .hero h1 {
        font-size: 1.8rem;
    }

    .logo {
        font-size: 1.5rem;
    }

    .profile-img {
        width: 180px;
        height: 180px;
    }

    .profile-img-container::before {
        width: 200px;
        height: 200px;
    }

    .project-img-container {
        height: 180px;
    }

    /* Snug bottom navbar on extra small screens */
    .nav-links {
        height: 60px;
        padding: 4px 8px calc(4px + env(safe-area-inset-bottom));
    }
    
    .nav-links a {
        font-size: 0.65rem;
        gap: 2px;
    }
    
    .nav-links .nav-icon {
        font-size: 1.15rem;
    }
}