/* --- CSS Variables & Theming System (Nimbus Theme) --- */
:root {
    /* Color Palette */
    --clr-bg: #05050A;
    /* Deep Dark background */
    --clr-bg-alt: rgba(15, 15, 25, 0.4);
    /* background for cards */
    --clr-text: #f8fafc;
    /* Main text */
    --clr-text-muted: #94a3b8;
    /* Muted text */
    --clr-primary: #6366f1;
    /* Indigo accent */
    --clr-primary-hover: #4f46e5;
    --clr-secondary: #ec4899;
    /* Pink accent */
    --clr-border: rgba(255, 255, 255, 0.08);
    --clr-border-light: rgba(255, 255, 255, 0.15);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--clr-primary), var(--clr-secondary));
    --gradient-glow: linear-gradient(135deg, rgba(99, 102, 241, 0.5), rgba(236, 72, 153, 0.5));

    /* Typography */
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
    --fw-light: 300;
    --fw-regular: 400;
    --fw-medium: 500;
    --fw-semi: 600;
    --fw-bold: 700;

    /* Spacing & Layout */
    --max-width: 1200px;
    --section-pad-y: 3rem;
    --transition-fast: 0.2s ease;
    --transition-med: 0.3s ease-in-out;

    /* Radii & Shadows */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 16px;
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.2);
}

/* --- Resets & Base Styles --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    /* Native smooth scrolling */
}

body {
    font-family: var(--font-main);
    background-color: var(--clr-bg);
    color: var(--clr-text);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* --- Layout Utilities --- */
.container {
    width: 90%;
    max-width: var(--max-width);
    margin: 0 auto;
}

.section {
    padding: var(--section-pad-y) 0;
    scroll-margin-top: 30px;
}

.section-title {
    font-size: clamp(2rem, 5vw, 2.5rem);
    font-weight: var(--fw-bold);
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
    color: var(--clr-text);
}

.section-title::after {
    content: "";
    display: block;
    height: 1px;
    width: 300px;
    background-color: var(--clr-border);
    margin-left: 20px;
}

.dark-bg {
    background-color: var(--clr-bg);
    /* Nimbu has one dark bg, so we use main bg or transparent */
}

/* --- Theme Utilities --- */
.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glass-card {
    background: var(--clr-bg-alt);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    transition: transform var(--transition-med), border-color var(--transition-med), box-shadow var(--transition-med);
}

.glass-card:hover {
    border-color: var(--clr-border-light);
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2), 0 0 20px rgba(99, 102, 241, 0.1);
}

/* Ambient Background Animation */
.ambient-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: radial-gradient(circle at 50% 0%, #111122 0%, var(--clr-bg) 100%);
}

.glow {
    position: absolute;
    width: 600px;
    height: 600px;
    background: var(--gradient-glow);
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.4;
    animation: float 20s infinite alternate;
}

.glow-1 {
    top: -200px;
    left: -100px;
    animation-delay: 0s;
}

.glow-2 {
    bottom: -200px;
    right: -100px;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.4), rgba(99, 102, 241, 0.4));
    animation-duration: 25s;
    animation-delay: -5s;
}

.glow-3 {
    top: 40%;
    left: 40%;
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.3), rgba(236, 72, 153, 0.3));
    animation-duration: 18s;
    animation-delay: -10s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(50px, -50px) scale(1.1);
    }

    66% {
        transform: translate(-30px, 30px) scale(0.9);
    }

    100% {
        transform: translate(0, 0) scale(1);
    }
}

.highlight {
    color: var(--clr-primary);
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: var(--fw-semi);
    font-size: 1rem;
    cursor: pointer;
    text-align: center;
    transition: all var(--transition-fast);
    border: none;
    outline: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
    filter: brightness(1.1);
}

.btn-secondary,
.btn-outline {
    background: transparent;
    color: var(--clr-text);
    border: 1px solid var(--clr-border-light);
    backdrop-filter: blur(8px);
}

.btn-secondary:hover,
.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    color: var(--clr-text);
}

/* --- Navigation --- */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    height: 70px;
    background-color: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(10px);
    /* Glassmorphism effect */
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    transition: var(--transition-med);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 90%;
    max-width: var(--max-width);
    height: 100%;
    margin: 0 auto;
}

.logo {
    font-size: 1.5rem;
    font-weight: var(--fw-bold);
    letter-spacing: 1px;
}

.logo span {
    color: var(--clr-primary);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    font-size: 0.9rem;
    font-weight: var(--fw-medium);
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
}

.nav-link:hover {
    color: var(--clr-primary);
}

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

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

.menu-icon {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--clr-primary);
}

/* --- Hero Section --- */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 100px 5% 0;
    /* Added padding-top to account for fixed navbar */
    max-width: var(--max-width);
    margin: 0 auto;
}

.hero-content {
    flex: 1;
    max-width: 850px;
    animation: fadeUp 1s ease both;
}

.hero-greeting {
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    font-weight: inherit;
}

.hero-title {
    font-size: clamp(1.2rem, 3.5vw, 3.2rem);
    font-weight: var(--fw-bold);
    line-height: 1.1;
    margin-bottom: 1rem;
    white-space: nowrap;
}

.hero-subtitle {
    font-size: clamp(0.9rem, 2vw, 1.4rem);
    font-weight: var(--fw-semi);
    color: var(--clr-text-muted);
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .hero-subtitle {
        white-space: nowrap;
    }
}

.hero-desc {
    font-size: 1.1rem;
    color: var(--clr-text-muted);
    margin-bottom: 2.5rem;
    max-width: 500px;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-graphic {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    animation: pulseBlob 8s infinite alternate ease-in-out;
}

/* Abstract Blob placeholder */
.blob {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, var(--clr-primary), var(--clr-secondary));
    border-radius: 50%;
    box-shadow: 0 0 50px rgba(139, 92, 246, 0.4);
    overflow: hidden;
    position: relative;
    display: flex;
}

.blob img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* --- About Section --- */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* Changed to 1fr 1fr for better balance */
    gap: 4rem;
    align-items: center;
}



.about-text p {
    color: var(--clr-text-muted);
    margin-bottom: 1rem;
    font-size: 1.05rem;
}

.skills-title {
    margin: 1.5rem 0 1rem;
    font-size: 1.1rem;
    /* Slightly larger */
    color: var(--clr-text);
    font-weight: var(--fw-semi);
}

.skills-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(140px, 200px));
    gap: 0.5rem 1rem;
}

.skills-list li {
    color: var(--clr-text-muted);
    position: relative;
    padding-left: 1.5rem;
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

.skills-list li:hover {
    color: var(--clr-primary);
    transform: translateX(5px);
}

.skills-list li::before {
    content: "▹";
    position: absolute;
    left: 0;
    color: var(--clr-primary);
}

.about-image-container {
    position: relative;
    max-width: 350px;
    margin: 0 0 0 auto;
    width: 100%;
}

.about-image-placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: var(--clr-bg-alt);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--clr-text-muted);
    border: 1px solid var(--clr-border);
    position: relative;
    overflow: hidden;
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Ensures the image covers the box without stretching */
    display: block;
}

.about-image-placeholder::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 20px;
    width: 100%;
    height: 100%;
    border: 2px solid var(--clr-primary);
    border-radius: var(--radius-md);
    z-index: -1;
    transition: all 0.5s ease;
}

.about-image-container:hover .about-image-placeholder {
    transform: translate(-10px, -10px);
    background-color: rgba(56, 189, 248, 0.05);
    /* Slight fill on hover */
    box-shadow: 0 0 40px rgba(56, 189, 248, 0.2);
}

.about-image-container:hover .about-image-placeholder::after {
    transform: translate(10px, 10px);
}

/* --- Projects Section --- */
.projects-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 900px;
    margin: 0 auto;
}

.project-item {
    background-color: var(--clr-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.4s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
}

.project-item:hover {
    box-shadow: 0 10px 20px -10px rgba(0, 0, 0, 0.5);
    border-color: rgba(56, 189, 248, 0.3);
}

.project-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    cursor: pointer;
    background: linear-gradient(to right, #0f172a, #111122);
    user-select: none;
    transition: background 0.3s ease;
}

.project-item:hover .project-header {
    background: linear-gradient(to right, #1e293b, rgba(56, 189, 248, 0.05));
}

.project-title-area {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.project-icon {
    font-size: 1.8rem;
    color: var(--clr-primary);
    width: 40px;
    text-align: center;
}

.project-title {
    font-size: 1.2rem;
    color: var(--clr-text);
    transition: color 0.3s ease;
    margin: 0;
}

.project-item:hover .project-title {
    color: var(--clr-primary);
}

.toggle-icon {
    font-size: 1.2rem;
    color: var(--clr-text-muted);
    transition: transform 0.4s ease, color 0.3s ease;
}

.project-item.active .toggle-icon {
    transform: rotate(180deg);
    color: var(--clr-primary);
}

.project-details {
    padding: 0 2rem;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.4s ease;
}

.project-item.active .project-details {
    max-height: 500px;
    opacity: 1;
    padding: 0 2rem 2rem;
}

.project-desc {
    color: var(--clr-text-muted);
    font-size: 1rem;
    margin-top: 1rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

.project-tech span {
    font-size: 0.85rem;
    color: var(--clr-secondary);
    font-family: var(--font-main);
    background-color: rgba(139, 92, 246, 0.1);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
}

.project-links {
    display: flex;
    gap: 1.5rem;
}

.project-links a {
    color: var(--clr-text-muted);
    font-size: 1.3rem;
    transition: all 0.3s ease;
}

.project-links a:hover {
    color: var(--clr-primary);
    transform: translateY(-3px);
}

/* --- Contact Section --- */
.contact-section {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    padding: var(--section-pad-y) 5%;
}

.contact-section .section-title {
    justify-content: center;
    margin-bottom: 1rem;
}

.contact-section .section-title::after {
    display: none;
}

.contact-text {
    color: var(--clr-text-muted);
    margin-bottom: 2rem;
}

.contact-info {
    margin-top: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    font-size: 1.1rem;
}

.contact-info p {
    color: var(--clr-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    transition: var(--transition-fast);
}

.contact-info p:hover {
    color: var(--clr-text);
}

.contact-info i {
    color: var(--clr-primary);
    font-size: 1.2rem;
}

/* --- Footer --- */
footer {
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid var(--clr-border);
    background: rgba(5, 5, 10, 0.5);
    backdrop-filter: blur(20px);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.social-links a {
    font-size: 1.5rem;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.social-links a.github { color: #f8fafc; }
.social-links a.linkedin { color: #0a66c2; }
.social-links a.whatsapp { color: #25d366; }
.social-links a.fiverr { color: #1dbf73; }

.social-links a:hover {
    transform: translateY(-3px) scale(1.1);
    filter: brightness(1.2);
}

footer p {
    color: var(--clr-text-muted);
    font-size: 0.9rem;
}

/* --- Animations --- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Standard reveals for grid are handled by their parent container's .reveal class */


@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulseBlob {
    0% {
        transform: scale(1) translate(0, 0);
    }

    33% {
        transform: scale(1.05) translate(10px, -20px);
    }

    66% {
        transform: scale(0.95) translate(-10px, 20px);
    }

    100% {
        transform: scale(1) translate(0, 0);
    }
}

/* --- Media Queries --- */
@media (max-width: 768px) {
    .menu-icon {
        display: block;
    }

    .nav-links {
        position: absolute;
        top: 70px;
        right: -100%;
        /* Hidden by default */
        width: 100%;
        height: calc(100vh - 70px);
        background-color: var(--clr-bg);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        transition: right 0.4s ease-in-out;
    }

    .nav-links.active {
        right: 0;
    }

    .hero-section {
        flex-direction: column;
        justify-content: center;
        text-align: center;
        padding-top: 100px;
    }

    .hero-content {
        order: 2;
    }

    .hero-cta {
        justify-content: center;
    }

    .hero-graphic {
        order: 1;
        margin-top: 0;
        margin-bottom: 2.5rem;
        justify-content: center;
    }

    .blob {
        width: 250px;
        height: 250px;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }

    .about-image-container {
        grid-row: 1;
        /* Move image above text on mobile */
        margin: 0 auto 2rem;
    }

    .section-title::after {
        width: 100px;
        /* shorter line on mobile */
    }
}