/* Reset */
* {margin:0; padding:0; box-sizing:border-box;}
html, body {
    font-family: 'Segoe UI', sans-serif;
    color: #fff;
    overflow-x: hidden;
    scroll-behavior: smooth;
    height: 100%;
    /* REMOVED background property to make particles visible */
}

/* === Custom Scrollbar Styling === */
::-webkit-scrollbar {
    width: 10px; /* Width of the entire scrollbar */
}

::-webkit-scrollbar-track {
    background: #1a1a1a; /* Color of the tracking area */
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #7b2ff7, #f107a3); /* Gradient for the scrollbar handle */
    border-radius: 10px; /* Rounded corners on the handle */
    border: 2px solid #1a1a1a; /* Creates a padding effect */
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #8c42f7, #f735b3); /* Brighter gradient on hover */
}

a {color: inherit; text-decoration: none;}

/* Navbar - Sticky */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 3rem;
    background: rgba(15,15,15,0.9);
    backdrop-filter: blur(10px);
}
nav a {
    margin-left: 2rem;
    font-weight: 500;
    position: relative;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}
nav a:hover {
    transform: translateY(-2px);
}
nav a::after {
    content: "";
    position: absolute;
    width: 0%; height: 2px;
    bottom: -4px; left: 0;
    background: linear-gradient(90deg,#7b2ff7,#f107a3);
    transition: width .3s;
}
nav a:hover::after { width: 100%; }

.hamburger {
    display: none;
    cursor: pointer;
}
.hamburger div {
    width: 25px;
    height: 3px;
    background-color: white;
    margin: 5px;
    transition: all 0.3s ease;
}

/* Background gradient waves */
.background {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(120deg,#0d0d0d,#1a1a1a,#0d0d0d);
    background-size: 400% 400%;
    animation: gradientMove 15s ease infinite;
    z-index: -2;
}
@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Floating particles */
.particles {
    position: fixed; inset: 0;
    z-index: -1;
    overflow: hidden;
}
.particle {
    position: absolute;
    width: 6px; height: 6px;
    background: rgba(255,255,255,0.5);
    border-radius: 50%;
    animation: float 20s linear infinite;
}
@keyframes float {
    from { transform: translateY(100vh) scale(0.5); opacity:0; }
    to { transform: translateY(-10vh) scale(1); opacity:1; }
}

/* Hero */
section.hero {
    min-height: 100vh;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    text-align: center;
    padding: 4rem 2rem;
}
.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.hero h1.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Typing effect */
.typing-container {
    font-size: 1.5rem;
    color: #ccc;
    white-space: nowrap;
    overflow: hidden;
    border-right: 2px solid #7b2ff7;
    animation: blink 0.75s step-end infinite;
    min-height: 1.8rem;
}
.typing-container.typing-paused {
    animation: none;
    border-right-color: transparent;
}
@keyframes blink {
    from, to { border-color: transparent; }
    50% { border-color: #7b2ff7; }
}

/* Sections */
section {
    padding: 14rem 2rem;
    max-width: 1000px;
    margin: auto;
}
section h2 {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 3.5rem;
    position: relative;
}
section h2::after {
    content: "";
    width: 60px; height: 3px;
    background: linear-gradient(90deg,#7b2ff7,#f107a3);
    position: absolute;
    left: 50%; transform: translateX(-50%);
    bottom: -10px;
}

/* Animated text */
.animated-text {
    font-size: 1.5rem;
    font-weight: bold;
    background: linear-gradient(90deg, #7b2ff7, #f107a3, #7b2ff7);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 300% 300%;
    animation: gradientFlow 6s ease infinite;
}
@keyframes gradientFlow {
    0% {background-position: 0% 50%;}
    50% {background-position: 100% 50%;}
    100% {background-position: 0% 50%;}
}

/* Read More Link */
.read-more {
    display: inline-block;
    margin-top: 1.5rem;
    color: #7b2ff7;
    font-weight: bold;
    font-size: 0.9rem; /* Smaller font size */
    transition: transform 0.3s ease;
}
.read-more:hover {
    transform: translateX(5px);
}


/* Projects */
.projects-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fit,minmax(300px,1fr));
}
.project-card {
    background: rgba(255,255,255,0.05);
    border-radius: 15px;
    padding: 2rem;
    transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}
.project-card::before {
    content: "";
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle at center, rgba(123,47,247,0.2), transparent 70%);
    animation: rotateGlow 15s linear infinite;
    z-index: 0;
    opacity: 0.5;
    transition: opacity 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}
@keyframes rotateGlow {
    from {transform: rotate(0deg);} to {transform: rotate(360deg);}
}
.project-card:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: 0 0 35px rgba(123,47,247,0.6);
}
.project-card:hover::before {
    opacity: 1;
}
.project-card h3 {margin-bottom: 1rem; position: relative; z-index:1;}
.project-card p {position: relative; z-index:1;}
.project-card a {display:inline-block; margin-top:1rem; color:#7b2ff7; position: relative; z-index:1;}

/* Contact */
.contact p {text-align:center; font-size:1.1rem;}

/* Footer */
footer {
    text-align:center;
    padding: 3rem;
    font-size: 0.9rem;
    color: #aaa;
}

/* Scroll reveal animation */
.reveal {
    opacity: 0;
    transform: translateY(80px);
    transition: opacity 1s ease-out, transform 1.2s cubic-bezier(0.165, 0.84, 0.44, 1);
    transition-delay: var(--delay, 0s); /* Use custom delay if provided */
}
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* === ABOUT PAGE STYLES === */
.about-header {
    justify-content: flex-start;
}
.back-button {
    font-weight: bold;
    transition: transform 0.3s ease;
}
.back-button:hover {
    transform: translateX(-5px);
}
.about-header .logo {
    margin: 0 auto; /* Center the logo */
    transform: translateX(-50%); /* Adjust for the back button space */
}
.about-nav {
    display: flex;
    justify-content: center;
    padding: 1rem;
    background: rgba(20,20,20,0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 70px; /* Stick below the main header */
    z-index: 99;
}
.about-nav a {
    margin: 0 1.5rem;
    font-weight: 500;
    position: relative;
}
.about-nav a::after {
    content: "";
    position: absolute;
    width: 0%; height: 2px;
    bottom: -4px; left: 0;
    background: linear-gradient(90deg,#7b2ff7,#f107a3);
    transition: width .3s;
}
.about-nav a:hover::after {
    width: 100%;
}
section.about-section {
    padding-top: 8rem;
    padding-bottom: 8rem;
}
.about-content p {
    line-height: 1.8;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    text-align: justify;
}
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    text-align: center;
}
.skill-card {
    background: rgba(255,255,255,0.05);
    padding: 1.5rem;
    border-radius: 10px;
}


/* === RESPONSIVE DESIGN FOR SMALLER SCREENS === */
@media (max-width: 768px) {
    header {
        padding: 1rem 1.5rem;
    }
    nav {
        position: fixed;
        right: -100%;
        top: 0;
        height: 100vh;
        width: 60%;
        background: rgba(15,15,15,0.98);
        backdrop-filter: blur(20px);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: space-evenly;
        transition: right 0.5s ease-in-out;
    }
    nav.nav-active {
        right: 0;
    }
    nav a {
        margin-left: 0;
        font-size: 1.2rem;
    }
    .hamburger {
        display: block;
    }
    .toggle .line1 {
        transform: rotate(-45deg) translate(-5px, 6px);
    }
    .toggle .line2 {
        opacity: 0;
    }
    .toggle .line3 {
        transform: rotate(45deg) translate(-5px, -6px);
    }

    section {
        padding: 8rem 1.5rem;
    }
    .hero h1 {
        font-size: 2.5rem;
    }
    .typing-container, .animated-text {
        font-size: 1.2rem;
    }
    section h2 {
        font-size: 1.8rem;
    }

    .about-header .logo {
        transform: translateX(0);
        margin-left: auto;
        margin-right: 2rem;
    }
    .about-nav {
        flex-direction: column;
        align-items: center;
        padding: 1rem 0;
        top: 60px;
    }
    .about-nav a {
        margin: 0.5rem 0;
    }
    section.about-section {
        padding-top: 6rem;
        padding-bottom: 6rem;
    }
}
@media (max-width: 480px) {
    .project-card {
        padding: 1.5rem;
    }
    .project-card h3 {
        font-size: 1.2rem;
    }
    .project-card p {
        font-size: 0.9rem;
    }
    .skill-card {
        padding: 1rem;
    }
}
