@import url('https://fonts.googleapis.com/css2?family=Space+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    width: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: "Space Mono", monospace;
    color: #f8fafc;
    line-height: 1.6;
    background: linear-gradient(300deg, #0f172a, #37306B, #0f172a, #66306D);
    background-size: 200% 200%;
    animation: gradient-animation 18s ease infinite;
}

/* Navbar Styles */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    z-index: 10000;
    background: transparent; /* Removed background */
    transition: all 0.3s ease;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #f8fafc;
    letter-spacing: 2px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5); /* Added text shadow for visibility */
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 20px; /* Reduced gap slightly */
}

.nav-links li a {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.95rem; /* Slightly smaller font */
    font-weight: bold;
    transition: all 0.3s ease;
    
    /* "Floating Pill" Style */
    background: rgba(15, 23, 42, 0.6);
    padding: 8px 16px;
    border-radius: 50px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.nav-links li a:hover {
    color: #fff;
    background: rgba(99, 102, 241, 0.6); /* Purple tint on hover */
    border-color: rgba(99, 102, 241, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(99, 102, 241, 0.2);
}

.hamburger {
    display: none;
    cursor: pointer;
    /* Add background to hamburger for visibility */
    background: rgba(15, 23, 42, 0.6);
    padding: 10px;
    border-radius: 8px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hamburger .bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: #f8fafc;
    transition: all 0.3s ease-in-out;
}

/* ... existing styles ... */

.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hero, #about, #skills, #projects, #astrophotography, #contact {
    background-color: transparent !important;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.hero-content p {
    font-size: 1.25rem;
    font-weight: 300;
    color: #94a3b8;
}

#starfield-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

section {
    padding: 80px 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
}

h2 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 60px;
    position: relative;
    display: inline-block;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

h2::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -10px;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: #6366f1;
    border-radius: 5px;
}

#about {
    display: flex;
    align-items: center;
    min-height: 100vh;
    background-color: #1a202c;
}

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

/* square pic */
/* .about-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
    border: 3px solid #6366f1;
} */

/* circular pic */
.about-image img {
    width: 300px;
    height: 300px;
    object-fit: cover;
    border-radius: 50%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
    border: 3px solid #6366f1;
}

.about-image img:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.about-text {
    flex: 2;
    min-width: 300px;
    margin-left: 50px;
}

.about-text h2 {
    text-align: left;
    margin-bottom: 25px;
    padding-top: 10px;
    font-size: 2.2rem;
}

.about-text h2::after {
    display: block;
    left: 0;
    transform: translateX(0);
    width: 80px;
    bottom: -8px;
    background-color: #6366f1;
}

.about-text p {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: #cbd5e1;
    line-height: 1.8;
}

.section-title {
    text-align: center;
}

.section-title::after {
    left: 50%;
    transform: translateX(-50%);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 30px;
    padding-top: 10px;
}

.skill-item {
    background-color: #2d3748;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    aspect-ratio: 1 / 1;
    position: relative;
    overflow: hidden;
    transition: background-color 0.3s ease;
}

.skill-item:hover {
    background-color: #6366f1;
    animation: drift 3s ease-in-out infinite;
}

.skill-item img, .skill-item p {
    position: absolute;
    transition: opacity 0.3s ease-in-out;
}

.skill-item img {
    opacity: 1;
    height: 60%;
}

.skill-item p {
    opacity: 0;
    font-size: 1rem;
    font-weight: bold;
    text-align: center;
}

.skill-item:hover img {
    opacity: 0;
}

.skill-item:hover p {
    opacity: 1;
}

.skill-item-special {
    grid-column: span 2;
    background-color: #1a202c;
    border: 2px solid #4a5568;
    aspect-ratio: auto;
}

.skill-item-special:hover {
    background-color: #1a202c;
}

.skill-item-special p {
    opacity: 1;
    font-size: 0.9rem;
    font-weight: normal;
    position: relative;
}

#projects {
    padding: 50px 0 20px 0;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); /* Restored original width */
    gap: 30px; /* Restored original gap */
    padding-top: 5px;
}

.project-card {
    background-color: #2d3748;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(99, 102, 241, 0.4);
}

.project-image img {
    width: 100%;
    height: 160px; /* Shortened image from 200px */
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease, filter 0.4s ease;
}

.project-content {
    padding: 15px 25px; /* Reduced vertical padding */
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.project-title {
    font-size: 1.5rem;
    margin-bottom: 5px; /* Reduced from 10px */
    color: #f8fafc;
}

.project-description {
    font-size: 0.95rem; /* Slightly smaller text to fit more */
    color: #cbd5e1;
    margin-bottom: 12px; /* Reduced from 20px */
}

.project-tech-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.project-tech-list span {
    background-color: #4a5568;
    color: #e2e8f0;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
}

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

.project-link {
    color: #f8fafc;
    background-color: #6366f1;
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.project-link:hover {
    background-color: #4f46e5;
}

#astrophotography .container {
    padding-bottom: 20px;
}

#astrophotography {
    padding: 120px 0 20px 0;
}

.astro-scroller {
    max-width: 100%;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to right, transparent, black 20%, black 80%, transparent);
    mask-image: linear-gradient(to right, transparent, black 20%, black 80%, transparent);
}

.scroller-row {
    display: flex;
    width: fit-content;
}

.scroller-row > div {
    display: flex;
    animation-timing-function: linear !important;
    animation-iteration-count: infinite !important;
}

.scroller-row img {
    height: 160px;
    width: auto;
    margin: 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.scroller-row img:hover {
    transform: scale(1.05);
}

#row1 > div, #row3 > div { animation-name: scrollRight; animation-duration: 250s; }
#row2 > div { animation-name: scrollLeft; animation-duration: 250s; }

@keyframes scrollLeft {
    from { transform: translateX(0%); }
    to { transform: translateX(-100%); }
}

@keyframes scrollRight {
    from { transform: translateX(-100%); }
    to { transform: translateX(0%); }
}

.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
}

.lightbox-content {
    max-width: 90%;
    max-height: 80%;
    border-radius: 10px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

#contact {
    text-align: center;
    padding: 100px 0;
    background-color: #0f172a;
}

#contact .section-subtitle {
    max-width: 600px;
    margin: 0 auto 30px auto;
    color: #cbd5e1;
}

.cta-button {
    display: inline-block;
    background-color: #6366f1;
    color: #f8fafc;
    padding: 15px 30px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.cta-button:hover {
    background-color: #4f46e5;
    transform: translateY(-3px);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-top: 40px;
}

.social-links a {
    display: inline-block;
    transition: transform 0.3s ease;
}

.social-links img {
    width: 32px;
    height: 32px;
}

.social-links a:hover {
    transform: scale(1.15);
}

.about-buttons {
    margin-top: 20px;
    display: flex;
    gap: 15px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: #1a202c;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: slideIn 0.3s ease;
}

.modal-close {
    color: #aaa;
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}
.modal-close:hover { color: #fff; }

.body-no-scroll {
    overflow: hidden;
}

.certs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}
.certs-grid img {
    width: 100%;
    border-radius: 5px;
}

.experience-date {
    font-size: 0.9rem;
    color: #94a3b8;
    font-style: italic;
    margin-bottom: 10px;
}

.experience-details1 {
    margin-bottom: 20px;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { transform: translateY(-30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes gradient-animation {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #0f172a;
}
::-webkit-scrollbar-thumb {
    background: #6366f1;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #4f46e5;
}

#stardust-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    pointer-events: none;
}

.cta-button.secondary {
    background-color: transparent;
    border: 2px solid #6366f1;
}
.cta-button.secondary:hover {
    background-color: #6366f1;
}

.about-image {
    position: relative;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    flex-shrink: 0;
    align-self: center;
    transition: transform 0.3s ease;
}

.about-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid #6366f1;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.about-image:hover {
    transform: scale(1.05);
}

.about-image .orbit {
    position: absolute;
    top: -15%;
    left: -15%;
    width: 130%;
    height: 130%;
    border: 2px dashed rgba(99, 102, 241, 0.3);
    border-radius: 50%;
    z-index: 1;
}

.about-image .moon {
    position: absolute;
    width: 12px;
    height: 12px;
    background-color: #f8fafc;
    border-radius: 50%;
    box-shadow: 0 0 10px 2px #f8fafc;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

#contact {
    padding-top: 120px;
    text-align: center;
    overflow: hidden;
    padding-bottom: 0;
}

.solar-system-arc-container {
    position: relative;
    width: 100%;
    max-width: 900px;
    height: 450px;
    margin: 40px auto 0 auto;
    overflow: hidden;
    background-image: url('../assets/images/orbits.svg');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center bottom;
}

.sun-bottom {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 120px;
    background-color: #6366f1;
    color: #f8fafc;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    font-weight: bold;
    z-index: 20;
    box-shadow: 0 0 25px 5px rgba(99, 102, 241, 0.4);
    transition: transform 0.3s ease;
}
.sun-bottom:hover {
    transform: translateX(-50%) scale(1.1);
}

.orbit-arc {
    position: absolute;
    left: 50%;
    bottom: 0;
    transform-origin: center bottom;
}

.planet-arc {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 36px;
}

.planet-arc a {
    display: block;
    position: relative;
    z-index: 15;
}

.planet-arc img {
    width: 100%;
}

.orbit-path-1 { width: 250px; height: 120px; z-index: 5; }
.orbit-path-2 { width: 450px; height: 185px; z-index: 4; }
.orbit-path-3 { width: 600px; height: 250px; z-index: 3; }
.orbit-path-4 { width: 750px; height: 320px; z-index: 2; }
.orbit-path-5 { width: 900px; height: 390px; z-index: 1; }

@keyframes drift {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-5px) rotate(3deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}

.donation-options {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}
.donation-button {
    font-family: "Space Mono", monospace;
    flex: 1;
    padding: 20px;
    font-size: 1.2rem;
    font-weight: bold;
    border: 2px solid #6366f1;
    background-color: transparent;
    color: #f8fafc;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background-color 0.3s ease, color 0.3s ease;
}
.donation-button:hover {
    background-color: #6366f1;
    color: #fff;
}
.upi-details {
    text-align: center;
}
.upi-details img {
    max-width: 250px;
    width: 100%;
    border-radius: 10px;
}
.upi-details p {
    margin-top: 20px;
    font-size: 1.1rem;
    color: #cbd5e1;
}

footer {
    padding: 20px 0;
    font-size: 0.9rem;
    color: #94a3b8;
    background-color: #0f172a;
    border-top: 1px solid #2d3748;
}
footer .container{
    position: relative;
    display: flex;
    align-items: center;
}
footer p {
    width: 100%;
    text-align: center;
    margin: 0;
}
footer a {
    color: #6366f1;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}
footer a:hover {
    color: #f8fafc;
}

.footer-spacer {
    flex-grow: 1;
}

footer .outlined-button {
    position: absolute;
    top: 50%;
    right: -100px;
    transform: translateY(-50%);
    padding: 8px 18px;
    font-size: 0.9rem;
    color: #f8fafc;
    background-color: transparent;
    border: 2px solid #6366f1;
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

footer .outlined-button:hover {
    background-color: #6366f1;
    color: #fff;
}

/* =========================================
   Mobile Responsiveness & Fixes
   ========================================= */

@media (max-width: 768px) {
    
    /* Global Adjustments */
    .container {
        padding: 0 20px;
    }
    
    section {
        padding: 60px 0;
    }

    h2 {
        font-size: 2rem;
    }
    
    .hero-content h1 {
        font-size: 2.2rem;
    }
    
    .hero-content p {
        font-size: 1rem;
        padding: 0 15px;
    }

    /* Navbar Mobile Styles */
    .hamburger {
        display: block;
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .nav-links {
        position: absolute;
        top: 100%;
        right: 20px;
        width: 180px; /* Compact width */
        flex-direction: column;
        background: rgba(15, 23, 42, 0.95);
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 15px;
        padding: 10px 0;
        gap: 0;
        text-align: left;
        
        /* Dropdown Animation Starts Hidden */
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    }

    .nav-links.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(10px);
    }

    .nav-links li {
        margin: 0;
        width: 100%;
    }

    .nav-links li a {
        background: transparent;
        border: none;
        border-radius: 0;
        display: block;
        padding: 12px 20px;
        width: 100%;
        font-size: 0.9rem;
        backdrop-filter: none;
        box-shadow: none;
    }

    .nav-links li a:hover {
        background: rgba(99, 102, 241, 0.2);
        transform: none;
    }

    .navbar {
        padding: 15px 20px;
    }

    /* About Section */
    .about-content {
        flex-direction: column;
        text-align: center;
        gap: 30px;
    }

    .about-image {
        width: 240px;
        height: 240px;
    }

    .about-text {
        margin-left: 0;
        min-width: 100%;
    }

    .about-text h2 {
        text-align: center;
        font-size: 1.8rem;
    }
    
    .about-text h2::after {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .about-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }

    /* Projects Section - Horizontal Scroll Snap */
    .projects-grid {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 20px;
        padding-bottom: 20px;
        -webkit-overflow-scrolling: touch;
        /* Center items vertically if needed, but 'stretch' is default flex behavior */
        align-items: flex-start; /* Prevents card stretching based on tallest content */
    }
    
    .projects-grid::-webkit-scrollbar {
        height: 4px; /* Thinner scrollbar */
    }
    
    .projects-grid::-webkit-scrollbar-thumb {
        background: #6366f1;
        border-radius: 4px;
    }

    .project-card {
        min-width: 85vw;
        max-width: 85vw; /* Fix width */
        scroll-snap-align: center;
        flex-shrink: 0;
        /* Fix Layout Strecthing */
        display: flex;
        flex-direction: column;
        height: auto; /* Allow natural height */
        background-color: #2d3748; /* Ensure bg is consistent */
    }
    
    .project-image {
        height: 180px; /* Fixed height for image container */
        width: 100%;
        flex-shrink: 0;
    }
    
    .project-image img {
        height: 100%;
        width: 100%;
        object-fit: cover; /* Shrink image into box without distortion */
    }
    
    .project-content {
        padding: 20px;
        flex-grow: 1; /* Content fills remaining space */
    }

    /* Contact Section (Solar System) - Fixed Mobile Layout */
    .solar-system-arc-container {
        /* Revert to Scale Strategy for perfect alignment */
        width: 900px;
        height: 450px;
        
        /* Center and Scale */
        margin-left: 50%;
        transform: translateX(-50%) scale(0.42);
        transform-origin: bottom center;
        
        /* 
           Compensate for Scale Ghost Space:
           Original height is 450. Scaled height is 450 * 0.42 = 189.
           Ghost space at top is 450 - 189 = 261px.
        */
        margin-top: -220px; /* Remove top gap */
        margin-bottom: 0;   /* Don't pull footer into the arcs */
        
        background-size: 100% 100%;
        overflow: visible;
    }
    
    /* Fix "Say Hello" Button Position - Lower it to clear orbits */
    .sun-bottom {
        bottom: -45px; /* Lowering it further (-50px -> -70px) */
        width: 120px;
        height: 120px;
        font-size: 1rem;
    }
    
    #contact {
        padding-top: 40px;
        padding-bottom: 0px; /* Reducing padding (80px -> 40px) to pull footer up */
        overflow: hidden;
    }

    /* Footer */
    footer .container {
        flex-direction: column;
        gap: 20px;
    }

    footer p {
        text-align: center;
        padding-bottom: 10px;
    }

    footer .outlined-button {
        position: static;
        transform: none;
        margin-top: 10px;
        display: inline-block;
    }
    
    /* Astrophotography */
    .scroller-row img {
        height: 120px;
    }
    
    /* Modal adjustments */
    .modal-content {
        width: 95%;
        padding: 20px;
    }
    
    .donation-options {
        flex-direction: column;
    }

    /* Performance: Disable heavy animations */
    body {
        animation: none;
        background: #0f172a; /* Fallback static color */
    }
}