:root {
    --primary: #00ff88;
    --secondary: #00d4ff;
    --dark: #0a192f;
    --light: #ccd6f6;
    --gradient: linear-gradient(45deg, var(--primary), var(--secondary));
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

html,
body {
    max-width: 100vw;
    overflow-x: hidden;
}

body {
    background: var(--dark);
    color: var(--light);
    overflow-x: hidden;
    line-height: 1.6;
}

/* Preloader */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--dark);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loader {
    width: 48px;
    height: 48px;
    border: 3px solid var(--light);
    border-radius: 50%;
    display: inline-block;
    position: relative;
    animation: rotation 1s linear infinite;
}

@keyframes rotation {
    0% {
        transform: rotate(0deg)
    }

    100% {
        transform: rotate(360deg)
    }
}

/* Navigation */
.nav-container {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    transition: 0.4s;
}

.nav-scrolled {
    background: rgba(10, 25, 47, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 8%;
}

.logo {
    font-size: 1.8rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
}

.nav-links a {
    color: var(--light);
    text-decoration: none;
    position: relative;
    padding: 0.5rem 0;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient);
    transition: 0.4s;
}

.nav-links a:hover::after {
    width: 100%;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 0 8%;
    position: relative;
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 600px;
}

.hero h1 {
    font-size: 4rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-image img {
    margin-left: -90px;
}

.cta-buttons {
    display: flex;
    gap: 1.5rem;
}

.btn {
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: 0.3s;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--gradient);
    color: var(--dark);
}

.btn-secondary {
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-secondary:hover {
    background: var(--primary);
    color: var(--dark);
}

/* Circle Animation */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 0 8%;
    position: relative;
    overflow: hidden;
}

.hero-image-wrapper {
    position: absolute;
    right: 8%;
    top: 50%;
    transform: translateY(-50%);
    width: 400px;
    height: 400px;
    z-index: 1;
}

.hero-border {
    width: 100%;
    height: 100%;
    border: 4px solid #00ff88;
    border-radius: 60% 40% 55% 45% / 55% 45% 60% 40%;
    animation: rotateShape 6s linear infinite, morph 4s ease-in-out infinite;
    position: absolute;
}

.hero-image {
    width: calc(100% - 20px);
    height: calc(100% - 20px);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    overflow: hidden;
    background-color: #0e1e36;
}


/* CSS Fix */
.hero-border:nth-child(1) {
    /* Pehla circle */
    border-color: #00ff88;
    animation:
        rotateShape 6s linear infinite,
        morph 4s ease-in-out infinite;
}

.hero-border:nth-child(2) {
    /* Dusra circle */
    /* width: 90%; 
    height: 90%; */
    border-color: #00d4ff;
    /* top: 5%;  */
    /* Position thoda niche */
    animation:
        rotateShape 8s linear infinite reverse,
        /* Ulti direction */
        morph 5s ease-in-out infinite;
    opacity: 0.8;
    /* Halka dikhe */
}




/* Animation for rotation */
@keyframes rotateShape {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Animation for border radius morphing */
@keyframes morph {
    0% {
        border-radius: 60% 40% 55% 45% / 55% 45% 60% 40%;
    }

    50% {
        border-radius: 40% 60% 45% 55% / 45% 55% 40% 60%;
    }

    100% {
        border-radius: 60% 40% 55% 45% / 55% 45% 60% 40%;
    }
}

/* Skills Section */
.skills {
    padding: 8rem 8%;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.skill-card {
    background: rgba(255, 255, 255, 0.05);
    padding: 2rem;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    transition: 0.4s;
}

.skill-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.1);
}

.skill-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.skill-icon {
    width: 50px;
    height: 50px;
    background: var(--gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Projects Section */
.projects {
    padding: 8rem 8%;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

/* Grid Layout Fix */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    /* Changed to auto-fit */
    gap: 2rem;
    width: 100%;
    max-width: 1200px;
    /* Limits grid width on large screens */
    margin: 4rem auto 0;
    /* Centers the grid */
}

/* Ensure project cards take full width of grid cell */
.project-card {
    width: 100%;
    /* Added to fill grid column */
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    transition: transform 0.4s ease-in-out;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

/* Rest of your existing CSS remains the same */
.project-image {
    height: 250px;
    position: relative;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.project-card:hover .project-image img {
    transform: scale(1.1);
}

.project-info {
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.project-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 1rem 0;
}

.project-info span {
    text-align: center;
    padding-top: 18px;
}

.tag {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    color: #fff;
}

.project-card:hover {
    transform: translateY(-10px);
}

.seeGithub {
    margin-top: 30px;
    cursor: pointer;
}



/* Contact Section */
.contact {
    padding: 8rem 8%;
    background: rgba(255, 255, 255, 0.03);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    margin-top: 3rem;
}

#Msg {
  height: 150px;
  resize: vertical;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 1rem;
    margin-bottom: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--light);
    transition: 0.3s;
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--primary);
    outline: none;
}

.social-links {
    display: flex;
    gap: 1.5rem;
    margin-top: 2rem;
}

.social-links a {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dark);
    text-decoration: none;
    transition: 0.3s;
}

.social-links a:hover {
    transform: translateY(-5px);
}

footer {
    background-color: #0a192f;
    color: #fff;
    text-align: center;
    padding: 2rem 0;
    height: 7%;
}

footer p {
    font-size: 1rem;
    font-weight: 400;
    margin: 0;
}

footer p:hover {
    color: #00ff88;
    transition: color 0.3s ease-in-out;
}


/* Media Queries */
@media (max-width: 1200px) {
    .hero h1 {
        font-size: 3rem;
    }

    .hero-image {
        position: absolute;
        left: 27.5%;
        transform: translateX(-50%);
        margin-top: 42%;
        width: 350px;
        height: 350px;
    }

    .hero {
        top: -225px;
        min-height: 105vh;
    }


    /* Animation Circle */
    .hero-image-wrapper {
        right: 3%;
    }

    .hero-border {
        margin-top: 115%;
        left: -91%;
        width: 114%;
        height: 114%;
        max-width: 320px;
        max-height: 320px;
    }

    .hero-border:nth-child(2) {
        margin-top: 115%;
        left: -91%;
        width: 114%;
        height: 114%;
        max-width: 320px;
        max-height: 320px;
    }

    .hero-image {
        position: absolute;
        left: -35.5%;
        transform: translateX(-50%);
        margin-top: 70%;
        width: 270px;
        height: 270px;
    }

    .hero-image img {
        margin-top: 15px;
        width: 300px;
        height: auto;
        border-style: none;
    }

    .hero-image-wrapper {
        width: 260px !important;
        height: 260px !important;
    }

    .skills {
        margin-top: -25%;
        padding: 8rem 8%;

    }
}

@media (min-width: 900px) and (max-width: 1200px) {

    .hero {
        margin-top: -215px;
        min-height: 125vh;
    }


    /* Animation Circle */
    .hero-image-wrapper {
        right: 3%;
    }

    .hero-border {
        margin-top: 115%;
        left: -140%;
        width: 165%;
        height: 165%;
        max-width: 350px;
        max-height: 350px;
    }

    .hero-border:nth-child(2) {
        margin-top: 115%;
        left: -140%;
        width: 165%;
        height: 165%;
        max-width: 350px;
        max-height: 350px;
    }

    .hero-image {
        position: absolute;
        left: -70.5%;
        transform: translateX(-50%);
        margin-top: 70%;
        width: 325px;
        height: 325px;
    }



    .hero-image img {
        margin-left: -15px;
        margin-top: 15px;
        width: 400px;
        height: auto;
        border-style: none;
    }

    .hero-image-wrapper {
        width: 260px !important;
        height: 260px !important;
    }

    .skills {
        margin-top: -50%;
        padding: 8rem 8%;

    }
}



@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .hero {
        top: 120px;
        flex-direction: column;
        text-align: center;
        padding-top: 8rem;
        min-height: 90vh;
    }

    .hero-image {
        position: static;
        transform: none;
        margin-top: 14rem;
    }

    .cta-buttons {
        justify-content: center;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        /* Forces single column */
    }

    .nav-container {
        position: fixed;
        top: 0;
        width: 100%;
        z-index: 1000;
        transition: 0.4s;
    }

    .nav-scrolled {
        background: rgba(10, 25, 47, 0.95);
        backdrop-filter: blur(10px);
        box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    }

    nav {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1.5rem 8%;
    }

    .logo {
        font-size: 1.8rem;
        background: var(--gradient);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        font-weight: 700;
    }

    .nav-links {
        display: flex;
        gap: 2.5rem;
    }

    .nav-links a {
        color: var(--light);
        text-decoration: none;
        position: relative;
        padding: 0.5rem 0;
    }

    .nav-links a::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 0;
        height: 2px;
        background: var(--gradient);
        transition: 0.4s;
    }

    .nav-links a:hover::after {
        width: 100%;
    }

    .hero-image-wrapper {
        right: 5%;
    }

    .hero-border {
        margin-top: -20px !important;
        left: 7% !important;
        width: 115% !important;
        height: 110% !important;
        max-width: 320px;
        max-height: 320px;
    }

    .hero-image {
        margin-left: 30px;
        margin-top: -4%;
        /* background-color: rebeccapurple; */
        background-color: #0e1e36;
        max-width: 270px;
        max-height: 270px;
    }


    .hero {
        flex-direction: column;
        text-align: center;
        padding-top: 120px;
        min-height: auto;
    }

    .hero-image-wrapper {
        position: relative;
        right: auto;
        top: auto;
        transform: none;
        width: 300px !important;
        height: 300px !important;
        margin: 40px auto 20px;
    }

    .hero-content {
        margin-top: 30px;
        order: -1;
    }

    .cta-buttons {
        justify-content: center;
    }

    .skills {
        margin-top: 15px;
        padding: 8rem 8%;
    }

    /* Animation Circle */
    .hero-image-wrapper {
        right: 3%;
    }

    .hero-border {
        margin-top: -12px;
        left: 12%;
        width: 92%;
        height: 92%;
        max-width: 320px;
        max-height: 320px;
    }

    .hero-image img {
        margin-top: 15px;
        width: 310px;
        height: auto;
    }


    .hero-image-wrapper {
        width: 260px !important;
        height: 260px !important;
    }

    .projects {
        padding: 6rem 4%;
    }

    .section-title {
        font-size: 2rem;
        padding-top: 40px;
    }

    .project-info {
        padding: 1rem;
    }

    footer {
        padding: 1.5rem 0;
    }

    footer p {
        font-size: 0.9rem;
    }
}

@media (max-width: 701px) {
    .hero-image {
        /* margin-top: 185px; */
        width: 280px;
        height: 280px;
    }

    .hero {
        margin-top: -20%;
        min-height: 80vh;
    }


    /* Animation Circle */
    .hero-image-wrapper {
        right: 3%;
    }

    .hero-border {
        margin-top: -12px;
        left: 12%;
        width: 92%;
        height: 92%;
        max-width: 320px;
        max-height: 320px;
    }

    .hero-image img {
        width: 300px;
        height: auto;
    }


    .hero-image-wrapper {
        width: 260px !important;
        height: 260px !important;
    }
}

@media (max-width: 480px) {

    .hero {
        margin-top: -20%;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .btn {
        padding: 0.8rem 1.5rem;
    }

    .hero-image {
        background-color: #0e1e36;
        overflow: hidden;
        margin-top: -5%;
        width: 275px;
        height: 275px;
        margin-left: 4%;
    }

    .nav-links {
        display: flex !important;
        position: static !important;
        transform: none !important;
        width: 100%;
    }

    nav {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem 8% !important;
    }

    .nav-links a {
        font-size: 1.1rem;
        padding: 0.5rem 0 !important;
    }

    /* Animation Circle */
    .hero-image-wrapper {
        right: 3%;
    }

    .hero-border {
        margin-top: -12px;
        left: 12%;
        width: 92%;
        height: 92%;
        max-width: 320px;
        max-height: 320px;
        margin-left: -7%;
    }

    .hero-image img {
        margin-left: -5%;
        width: 300px;
        height: auto;
    }

    .project-info span {
        text-align: center;
        padding-top: 8px;
    }

    #tag{
        padding-top: 14px;
    }
    
    .hero-image-wrapper {
        width: 260px !important;
        height: 260px !important;
    }

}

@media (min-width: 481px) and (max-width: 540px) {
    nav {
        padding: 1rem 3% !important;
    }

    .nav-links a {
        font-size: 1rem !important;
        gap: 1rem !important;
    }
}

@media (max-width: 360px) {
    .nav-links {
        position: static !important;
        transform: none !important;
        align-items: flex-start;
        padding-left: 0;
        width: 100% !important;
    }

    .logo {
        font-size: 1.5rem !important;
    }

    .hero {
        margin-top: -100px;
    }

    nav {
        margin-left: -15px;
        gap: 0.5rem !important;
    }


    /* Animation Circle */
    .hero-image-wrapper {
        right: 3%;
    }

    .hero-border {
        margin-top: -12px;
        left: 12%;
        width: 92%;
        height: 92%;
        max-width: 320px;
        max-height: 320px;
    }

    .hero-image img {
        width: 300px;
        height: auto;
    }


    .hero-image-wrapper {
        width: 260px !important;
        height: 260px !important;
    }
}


@media (max-width: 344px) {
    .logo {
        font-size: 1.3rem !important;
        /* Logo aur chota */
    }

    .nav-links a {
        font-size: 0.9rem !important;
        /* Links text size kam */
        padding: 0.3rem 0 !important;
        /* Compact padding */
    }

    nav {
        padding: 0.8rem 5% !important;
        /* Navbar height kam */
    }


    /* Animation Circle */
    .hero-image-wrapper {
        right: 3%;
    }

    .hero-image {
        margin-top: -10px;
        margin-left: 30px;
        width: 210px;
        height: 210px;
    }

    .hero-border {
        max-width: 230px;
        max-height: 230px;
        top: 15px;
        margin-left: 12px;
    }
    .hero-border:nth-child(2) {
        max-width: 230px;
        max-height: 230px;
        top: 15px;
        margin-left: 12px;
    }

    .hero-image img {
        width: 300px;
        height: auto;
    }


    .hero-image-wrapper {
        width: 260px !important;
        height: 260px !important;
    }
}
