/* --- Theme & Color Variables --- */
:root {
    /* Light Mode */
    --bg-color-light: #f8f9fa;
    --section-bg-light: #ffffff;
    --text-color-light: #212529;
    --subtle-text-color-light: #6c757d;
    --primary-color-light: #4a6cf7;
    --primary-hover-light: #3a5ce1;
    --border-color-light: #dee2e6;
    --shadow-color-light: rgba(0, 0, 0, 0.08);
    --header-bg-light: rgba(255, 255, 255, 0.8);

    /* Dark Mode */
    --bg-color-dark: #121212;
    --section-bg-dark: #1e1e1e;
    --text-color-dark: #e9ecef;
    --subtle-text-color-dark: #adb5bd;
    --primary-color-dark: #89a1ff;
    --primary-hover-dark: #a9bfff;
    --border-color-dark: #343a40;
    --shadow-color-dark: rgba(0, 0, 0, 0.2);
    --header-bg-dark: rgba(30, 30, 30, 0.8);
}

[data-theme="light"] {
    --bg-color: var(--bg-color-light);
    --section-bg: var(--section-bg-light);
    --text-color: var(--text-color-light);
    --subtle-text-color: var(--subtle-text-color-light);
    --primary-color: var(--primary-color-light);
    --primary-hover: var(--primary-hover-light);
    --border-color: var(--border-color-light);
    --shadow-color: var(--shadow-color-light);
    --header-bg: var(--header-bg-light);
}

[data-theme="dark"] {
    --bg-color: var(--bg-color-dark);
    --section-bg: var(--section-bg-dark);
    --text-color: var(--text-color-dark);
    --subtle-text-color: var(--subtle-text-color-dark);
    --primary-color: var(--primary-color-dark);
    --primary-hover: var(--primary-hover-dark);
    --border-color: var(--border-color-dark);
    --shadow-color: var(--shadow-color-dark);
    --header-bg: var(--header-bg-dark);
}

/* --- General Styles & Reset --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* --- Animations --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Header --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: transparent;
    z-index: 1000;
    transition: background-color 0.3s ease, border-bottom 0.3s ease, backdrop-filter 0.3s ease;
}

.header.scrolled {
    background-color: var(--header-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-color);
    text-decoration: none;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    position: relative;
    transition: color 0.3s ease;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-links a:hover::after {
    width: 100%;
}

.theme-toggle-button {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.theme-toggle-button:hover {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.theme-icon {
    width: 20px;
    height: 20px;
}

.menu-toggle-button {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001;
}

.menu-icon {
    width: 28px;
    height: 28px;
    color: var(--text-color);
}

#theme-icon-light {
    display: none;
}

[data-theme="dark"] #theme-icon-dark {
    display: none;
}

[data-theme="dark"] #theme-icon-light {
    display: block;
}

[data-theme="dark"] .logo,
[data-theme="dark"] .menu-icon {
    color: var(--text-color-dark);
}


/* --- Section Styling --- */
.section {
    padding: 6rem 0;
    overflow: hidden;
    background-color: var(--section-bg);
    transition: background-color 0.3s ease;
}

.section:nth-child(even) {
    background-color: var(--bg-color);
    /* Alternate background for visual separation */
}

/* Scroll Reveal Animation */
.section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out, background-color 0.3s ease;
}

.section.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    text-align: center;
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    width: 80px;
    height: 4px;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--primary-color);
    border-radius: 2px;
}

/* --- Hero Section --- */
#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-image: radial-gradient(circle at 15% 50%, var(--primary-color), transparent 35%), radial-gradient(circle at 85% 30%, var(--subtle-text-color), transparent 35%);
    background-size: 100% 100%;
    animation: pulse 15s infinite alternate;
    padding-top: 70px;
    /* Offset for fixed header */
}

@keyframes pulse {
    from {
        background-position: 0% 50%;
    }

    to {
        background-position: 100% 50%;
    }
}

.hero-text {
    animation: fadeInUp 1s ease-out forwards;
}

.hero-title {
    font-size: 4.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-tagline {
    font-size: 1.5rem;
    color: var(--subtle-text-color);
    margin-bottom: 2.5rem;
    font-weight: 400;
}

.cta-button {
    background-color: var(--primary-color);
    color: #fff;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
    border: none;
    cursor: pointer;
}

.cta-button:hover {
    background-color: var(--primary-hover);
    transform: translateY(-5px);
    box-shadow: 0 10px 20px var(--shadow-color);
}

/* --- About Section --- */
.about-content {
    display: flex;
    align-items: center;
    gap: 4rem;
}

.about-image {
    width: 300px;
    height: 300px;
    object-fit: cover;
    border-radius: 50%;
    border: 5px solid var(--section-bg);
    box-shadow: 0 10px 30px var(--shadow-color);
    flex-shrink: 0;
}

.about-text .section-title {
    text-align: left;
}

.about-text .section-title::after {
    left: 0;
    transform: translateX(0);
}

.about-text p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--subtle-text-color);
    margin-bottom: 2rem;
}

.about-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.cta-button-secondary {
    background-color: transparent;
    color: var(--primary-color);
    padding: 0.8rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
    border: 2px solid var(--primary-color);
}

.cta-button-secondary:hover {
    background-color: var(--primary-color);
    color: #fff;
}

/* --- Skills Section --- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 2rem;
}

.skill-card {
    background-color: var(--bg-color);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
}

.skill-card:hover {
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 15px 30px var(--shadow-color);
    z-index: 1;
}

.skill-icon {
    height: 60px;
    width: 60px;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.skill-name {
    font-weight: 600;
    color: var(--text-color);
}

/* --- Projects Section --- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.project-card {
    background-color: var(--bg-color);
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 5px 15px var(--shadow-color);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: scale(1.02);
    box-shadow: 0 20px 40px var(--shadow-color);
}

.project-image {
    width: 100%;
    object-fit: cover;
}

.project-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.project-description {
    color: var(--subtle-text-color);
    margin-bottom: 1.5rem;
    line-height: 1.6;
    flex-grow: 1;
}

.project-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
    align-self: flex-start;
}

.project-link:hover {
    color: var(--primary-hover);
}

/* --- Contact Section --- */
.contact-container {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}

.contact-subtitle {
    font-size: 1.1rem;
    color: var(--subtle-text-color);
    margin-bottom: 3rem;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.contact-info {
    margin-top: 3rem;
    color: var(--subtle-text-color);
}

.contact-info p {
    margin-bottom: 0.5rem;
}

/* --- Footer --- */
.footer {
    background-color: #1e1e1e;
    color: #adb5bd;
    padding: 2rem 0;
    text-align: center;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.social-links {
    display: flex;
    gap: 1.5rem;
}

.social-links a {
    color: #adb5bd;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: #89a1ff;
}

.social-links svg {
    width: 24px;
    height: 24px;
}

@media only screen and (max-width: 200px) {
     .navbar .logo {
    font-size: 1rem;
}
}

/* --- Responsive Design --- */

@media (max-width: 992px) {
    .about-content {
        flex-direction: column;
        text-align: center;
    }

    .about-text .section-title {
        text-align: center;
    }

    .about-text .section-title::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .about-buttons {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background-color: var(--section-bg);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 3rem;
        transition: right 0.5s ease-in-out;
        box-shadow: -5px 0 15px var(--shadow-color);
    }

    .nav-links.active {
        right: 0;
    }

    .menu-toggle-button {
        display: block;
    }

    .hero-title {
        font-size: 3rem;
    }

    .hero-tagline {
        font-size: 1.2rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}