/* Custom CSS for Nitin Kumar Gond's Developer Portfolio */

/* --- Global Body Reset --- */
body {
    font-family: 'Inter', sans-serif;
    background: #000000; /* Pure Black Background */
    color: #e0e6f0;
    overflow-x: hidden;
    margin: 0; /* Remove default browser gaps */
}

/* --- Enable Smooth Scrolling for the whole page --- */
html {
    scroll-behavior: smooth;
}

/* --- Header & Navigation --- */
.header-bg {
    /* --- Layout & Positioning --- */
    position: sticky; /* Makes the navbar stick to the top */
    top: 1.5rem;      /* Adds some space from the top edge */
    z-index: 1000;
    max-width: 1200px;
    margin: 1.5rem auto; /* Centers the navbar */
    padding: 1rem 2rem;
    /* --- UPDATE TRANSITION --- */
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    overflow: hidden; /* Important for containing the pseudo-element */

    /* --- 3D Effect & Glassmorphism --- */
    transform: perspective(1200px) rotateX(10deg); /* Initial 3D tilt */
    background: rgba(24, 24, 36, 0.75); /* Dark, semi-transparent base */
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    border-radius: 2.5rem;
    border: 1px solid rgba(163, 101, 247, 0.18);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.35); /* Enhanced shadow for depth */
}

.header-bg:hover {
    transform: perspective(1200px) rotateX(0deg) translateY(-5px); /* Flatten and lift on hover */
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5); /* Deeper shadow on hover */
}

/* --- Animated Shiny Background --- */
.header-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, #6a40e8, #a365f7, #c471ed, #8c8cff, #6a40e8);
    background-size: 400% 400%;
    opacity: 0.4; /* Increased opacity for better visibility */
    z-index: -1;   /* Place it behind the nav content */
    animation: slideGradient 5s ease infinite; /* Faster animation */
}

/* Hide header on scroll down, show on scroll up */
.header-hidden {
    top: -120px; /* Hides the header by moving it off-screen */
}

/* --- Navbar Brand/Logo Styling --- */
.nav-brand {
    gap: 0.75rem; /* Space between photo and name */
    transition: transform 0.3s ease;
}

.nav-brand:hover {
    transform: scale(1.05); /* Slight zoom on hover */
}

.nav-photo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(163, 101, 247, 0.5);
    box-shadow: 0 0 10px rgba(163, 101, 247, 0.3);
}

.nav-name {
    font-weight: 700;
    font-size: 1.2rem;
    color: #e0e6f0;
    letter-spacing: 0.5px;
}

/* --- Hero Section Layout --- */
/* This will be the container for your main hero content */
.hero-container {
    min-height: calc(100vh - 120px); /* Fill viewport minus header space */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 1rem;
    overflow: hidden; /* Prevent content from showing before animation */
}

/* --- Hero Content Entrance Animation --- */
/* Define the animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- FIX: More explicit animation rules for reliability --- */

/* Set initial state for all hero elements to be animated */
.hero-intro, .hero-name, .hero-dynamic-text, .hero-socials, .hero-buttons {
    opacity: 0;
}

/* Apply the full animation property to each element individually */
.hero-intro {
    animation: fadeInUp 0.8s ease-out 0.2s forwards;
}
.hero-name {
    animation:
        fadeInUp 0.8s ease-out 0.4s forwards,
        slideGradient 3s linear 0.4s infinite;
}
.hero-dynamic-text {
    animation: fadeInUp 0.8s ease-out 0.6s forwards;
}
.hero-socials {
    animation: fadeInUp 0.8s ease-out 0.8s forwards;
}
.hero-buttons {
    animation: fadeInUp 0.8s ease-out 1.0s forwards;
}

/* --- Themed Typed.js Effect --- */
/* Apply a sliding gradient and glow to the typed text */
.hero-dynamic-text #typed-element {
    /* 1. Sliding Gradient Background (like your name) */
    background: linear-gradient(90deg, #c471ed, #a365f7, #8c8cff, #c471ed); /* Looping gradient */
    background-size: 200% auto; /* Make gradient larger than text */

    /* 2. Clip the background to the text shape */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    
    /* 3. Glow Effect (like the buttons) */
    text-shadow: 0 0 12px rgba(163, 101, 247, 0.6);

    /* 4. Apply the sliding animation */
    animation: slideGradient 4s linear infinite;
}

/* Style the Typed.js cursor */
#typed-element + .typed-cursor {
    color: #a365f7;
    font-weight: bold;
    text-shadow: 0 0 8px rgba(163, 101, 247, 0.5); /* Add a matching glow */
}


/* --- Subtitle Highlight Effect --- */
.hero-statement .highlight-word {
    color: #c471ed; /* A bright purple from the theme */
    font-weight: 500;
    animation: pulseGlow 2.5s infinite ease-in-out;
}

/* Stagger the animation for each word */
.hero-statement .highlight-word:nth-of-type(2) {
    animation-delay: 0.3s;
}
.hero-statement .highlight-word:nth-of-type(3) {
    animation-delay: 0.6s;
}

@keyframes pulseGlow {
    0%, 100% {
        color: #c471ed;
        text-shadow: 0 0 5px rgba(196, 113, 237, 0.4);
    }
    50% {
        color: #e6c8fa; /* A lighter, brighter purple for the pulse */
        text-shadow: 0 0 16px rgba(196, 113, 237, 1);
    }
}


/* --- Social Icon Hover Effects --- */
.hero-socials a {
    transition: transform 0.3s ease, color 0.3s ease, text-shadow 0.3s ease;
    position: relative; /* Required for the shine pseudo-element */
    overflow: hidden;   /* This will contain the shine effect */
}

/* The shine element */
.hero-socials a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -110%;
    width: 75%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: skewX(-25deg);
    transition: left 0.7s ease;
}

.hero-socials a:hover {
    transform: translateY(-4px) scale(1.1);
    color: #a365f7; /* Brighter purple for the icon */
    text-shadow: 0 0 15px rgba(163, 101, 247, 0.7); /* Add a glow */
}

/* Animate the shine to sweep across on hover */
.hero-socials a:hover::before {
    left: 110%;
}


/* --- Consistent Section Spacing --- */
/* Use this class on #about, #skills, #projects, etc. */
.content-section {
    padding: 6rem 1rem; /* Consistent 6rem top/bottom padding */
}

/* Navigation Item Hover Effect */
.nav-item {
    position: relative;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: color 0.3s ease, background-color 0.3s ease;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none; /* No underline by default */
}

.nav-item::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0.2em;
    height: 2px;
    background: linear-gradient(90deg, #a365f7, #c471ed);
    border-radius: 2px;
    opacity: 0;
    transform: scaleX(0);
    transition: opacity 0.2s, transform 0.2s;
}

.nav-item:hover::after,
.nav-item:focus::after {
    opacity: 1;
    transform: scaleX(1);
}

/* Prevent default underline on navbar links, keep only the animated one */
.nav-item:hover, .nav-item:focus {
    text-decoration: none !important;
}

/* --- FIX: More Robust Rules for Icon/Text Switching --- */

/* By default (horizontal nav), show ONLY the text */
.header-bg:not(.vertical-nav) .nav-text {
    display: block;
}
.header-bg:not(.vertical-nav) .nav-icon {
    display: none;
}

/* When the nav is vertical, show ONLY the icon */
.header-bg.vertical-nav .nav-text {
    display: none;
}
.header-bg.vertical-nav .nav-icon {
    display: block;
    font-size: 1.5rem;
    line-height: 1;
}

/* Glow Button Styling */
.glow-button {
    background: linear-gradient(90deg, #a365f7, #8c8cff, #6a40e8);
    color: #fff;
    border: none;
    border-radius: 2rem;
    padding: 0.75rem 2rem;
    font-weight: 600;
    box-shadow: 0 0 16px 0 #a365f7;
    transition: box-shadow 0.3s, transform 0.3s;
    position: relative;
    overflow: hidden;
}

.glow-button:hover {
    box-shadow: 0 0 32px 4px #c471ed, 0 0 16px 0 #a365f7;
    transform: translateY(-2px) scale(1.04);
}

/* Remove underline from Resume button */
.glow-button, .glow-button:link, .glow-button:visited, .glow-button:hover, .glow-button:active {
    text-decoration: none !important;
}

.text-left {
    margin-left: 100px;
    text-align: left;
}
/* Matrix Effect Container (for JavaScript controlled canvas) */
.matrix-container {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 50%; /* Adjust as needed */
    overflow: hidden;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

/* Matrix Text Animation (if using pure CSS text animation) */
/* The current solution uses a canvas for better performance and customization */

.matrix-text {
    white-space: pre;
    font-family: 'monospace';
    font-size: 0.8rem;
    color: #0f0;
    opacity: 0.2;
    line-height: 1;
    animation: matrix-fall 10s linear infinite;
    position: absolute;
    top: 0;
    right: 0;
    transform: translateY(-100%);
}

@keyframes matrix-fall {
    0% { transform: translateY(-100%); opacity: 0.2; }
    5% { opacity: 0.5; }
    100% { transform: translateY(100%); opacity: 0.2; }
}
 

/* Gradient Text Effect */
.gradient-text {
    background: linear-gradient(90deg, #a365f7, #8c8cff, #6a40e8, #c471ed, #a365f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% auto;
    /* Animation removed to prevent conflict with hero entrance animation */
}

/* Section Header Styling */
.section-header {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    letter-spacing: 1px;
    text-align: center;
    position: relative;
    padding-bottom: 10px;
}

.section-header::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    width: 250px; /* Made wider */
    height: 5px;  /* Made thicker */
    border-radius: 2px;
    background: linear-gradient(90deg, #a365f7, #c471ed);
    opacity: 0.8;
    box-shadow: 0 3px 12px rgba(163, 101, 247, 0.4); /* Added glow */
}

/* --- Shiny Divider --- */
.shiny-divider {
    height: 3px; /* The thickness of the line */
    width: 80%; /* Don't let it touch the edges */
    max-width: 1200px; /* Consistent max width */
    margin: 5rem auto; /* Spacing above and below the divider */
    background: linear-gradient(90deg, transparent, #a365f7 25%, #c471ed 75%, transparent); /* Sharper gradient */
    border-radius: 3px;
    opacity: 0.8; /* Increased opacity */
    box-shadow: 0 0 20px 3px rgba(163, 101, 247, 0.6); /* Stronger glow */
}

/* Card Styling for sections like About, Skills, Projects, Education */
.card {
    background: rgba(44, 20, 70, 0.7);
    border-radius: 1.5rem;
    box-shadow: 0 4px 24px 0 rgba(140, 100, 255, 0.10);
    backdrop-filter: blur(8px);
    border: 1.5px solid #a365f7;
    transition: transform 0.3s, box-shadow 0.3s;
    padding: 1.5rem; /* Ensure consistent internal padding */
}
.card:hover {
    transform: translateY(-6px) scale(1.03);
    box-shadow: 0 8px 32px 0 #a365f7;
}

/* --- Preloader Styles --- */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 9999;
    display: flex;
    flex-direction: column; /* Stack photo and text vertically */
    justify-content: center;
    align-items: center;
    gap: 2rem; /* Space between photo and text */
    transition: opacity 0.8s ease-out, visibility 0.8s ease-out;
    visibility: visible;
    opacity: 1;
}

#preloader.loaded {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.preloader-photo {
    width: 320px;
    height: 320px;
    border-radius: 50%; /* Makes the image circular */
    object-fit: cover; /* Prevents image distortion */
    border: 4px solid #a365f7; /* Matching purple border */
    box-shadow: 0 0 20px rgba(163, 101, 247, 0.5); /* Adds a nice glow */
    opacity: 0;
    transform: scale(0.5);
    animation: logo-pop-in 1s ease-out 0.2s forwards;
}

.preloader-text {
    font-family: 'monospace', 'Courier New', Courier;
    /* Use clamp() for a fluid font size that adapts to any screen */
    font-size: clamp(1.2rem, 4vw, 2.5rem);
    font-weight: bold;
    color: #a365f7;
    text-shadow: 0 0 10px #a365f7;
    white-space: nowrap;
    overflow: hidden;
    border-right: .15em solid #8c8cff;
    max-width: 95vw; /* Allow a bit more width to ensure visibility */
    opacity: 0;
    animation:
        text-fade-in 0.5s ease-out 1.2s forwards;
}

/* Keyframes for Photo */
@keyframes logo-pop-in {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Keyframes for Text Container Fade-in */
@keyframes text-fade-in {
    to {
        opacity: 1;
    }
}

/* Typing Animation */
@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

/* Cursor Blinking Animation */
@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: #8c8cff; }
}

/* Main Content Visibility */
#main-content.hidden {
    opacity: 0;
}

#main-content.visible {
    opacity: 1;
    transition: opacity 0.8s ease-in;
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    /* General Layout & Spacing */
    .header-bg {
        margin: 1rem auto; /* Reduced margin for mobile */
        max-width: 95vw;
        top: 1rem;
    }
    .content-section {
        padding: 4rem 1rem; /* Reduced padding for mobile sections */
    }
    .text-left {
        margin-left: 0; /* Remove the large left margin on mobile */
        text-align: center;
    }

    /* Typography */
    .hero-name {
        font-size: 3rem; /* Reduce hero name size */
    }
    .section-header {
        font-size: 2rem; /* Reduce section header size */
    }
    .project-title, .experience-header h3, .timeline-content h3 {
        font-size: 1.25rem; /* Reduce card title sizes */
    }

    /* Hero Section */
    .hero-container {
        min-height: auto; /* Let content define height on mobile */
        padding: 4rem 1rem;
    }
    .hero-container .text-left {
        text-align: center; /* Ensure hero text is centered */
    }

    /* About Section */
    .about-text-container {
        padding: 1.5rem; /* Reduce padding on about card */
    }

    /* Skills Section */
    .skill-category {
        padding: 1.5rem; /* Reduce padding on skill cards */
    }

    /* Projects Section */
    .project-card {
        padding: 1.5rem; /* Reduce padding on project cards */
    }

    /* --- Responsive Timeline Adjustments (Experience & Education) --- */
    .experience-timeline::before,
    .timeline::before {
        left: 20px; /* Move the line to the left */
        transform: translateX(0);
    }

    .experience-item,
    .timeline-entry {
        width: 100%;
        padding-left: 50px; /* Add space for the line and dot */
        padding-right: 1rem;
    }

    /* Reset the horizontal positioning for all items */
    .experience-item:nth-child(odd),
    .experience-item:nth-child(even),
    .timeline-entry:nth-child(odd),
    .timeline-entry:nth-child(even) {
        left: 0;
        justify-content: flex-start; /* Align all content to the start */
    }

    /* Reposition the dots to the left */
    .experience-item::after,
    .timeline-icon {
        left: 20px; /* Align with the timeline line */
        transform: translateX(-50%);
    }

    /* Adjust the content box width for education timeline */
    .timeline-content {
        width: 100%;
    }
}

/* --- Contact Panel --- */
.contact-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 320px;
    height: 100%;
    z-index: 10001;
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    background: rgba(26, 16, 38, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-right: 1px solid rgba(163, 101, 247, 0.2);
    box-shadow: 10px 0 30px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; /* Vertically center the content */
    padding: 2rem;
    color: #e0e6f0;
    border-top-right-radius: 2rem; /* Curved top right corner */
    border-bottom-right-radius: 2rem; /* Curved bottom right corner */
}

.contact-panel.open {
    transform: translateX(0);
}

/* --- Animate Panel Content --- */
/* Set initial state for all animated elements */
.panel-photo, .panel-name, .panel-title, .contact-link {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

/* Define the final state when the panel is open, with staggered delays */
.contact-panel.open .panel-photo {
    transform: translateY(0) scale(1);
    opacity: 1;
    transition-delay: 0.2s;
}

.contact-panel.open .panel-name {
    transform: translateY(0);
    opacity: 1;
    transition-delay: 0.3s;
}

.contact-panel.open .panel-title {
    transform: translateY(0);
    opacity: 1;
    transition-delay: 0.4s;
}

/* Stagger the links */
.contact-panel.open .contact-link:nth-child(1) { transform: translateY(0); opacity: 1; transition-delay: 0.5s; }
.contact-panel.open .contact-link:nth-child(2) { transform: translateY(0); opacity: 1; transition-delay: 0.6s; }
.contact-panel.open .contact-link:nth-child(3) { transform: translateY(0); opacity: 1; transition-delay: 0.7s; }
.contact-panel.open .contact-link:nth-child(4) { transform: translateY(0); opacity: 1; transition-delay: 0.8s; }


.panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease;
}

.panel-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: #e0e6f0;
    font-size: 2.5rem;
    cursor: pointer;
    transition: transform 0.3s, color 0.3s;
}

.close-btn:hover {
    color: #c471ed;
    transform: rotate(90deg);
}

.panel-content {
    text-align: center;
    /* The margin-top is removed to allow for perfect vertical centering */
}

.panel-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #a365f7;
    box-shadow: 0 0 25px rgba(163, 101, 247, 0.6);
    margin-bottom: 1.5rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
    transform: translateY(20px) scale(0.9); /* Add initial scale for a pop effect */
}

.panel-name {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.panel-title {
    font-size: 1rem;
    color: #c471ed;
    margin-bottom: 2.5rem;
}

.panel-contact-links {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    width: 100%;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    font-size: 1.1rem;
    text-decoration: none;
    color: #e0e6f0;
    /* --- FIX & ENHANCEMENT --- */
    /* Combine all transitions to enable slide-in and all hover effects */
    transition: 
        opacity 0.1s ease-out, 
        transform 0.3s ease, 
        background 0.3s ease, 
        color 0.3s ease,
        box-shadow 0.3s ease;
}

.contact-link:hover {
    /* --- ENHANCED HOVER EFFECT --- */
    background: #a365f7;
    color: #fff;
    transform: translateY(-3px) scale(1.05); /* Lift and scale the link */
    box-shadow: 0 4px 20px rgba(163, 101, 247, 0.4); /* Add a glow effect */
    transition-delay: 0s; /* FIX: Override entrance delay for instant hover */
}

.contact-link .fa-fw {
    /* --- Glassy Icon Effect --- */
    height: 40px;
    width: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08); /* Glassy background */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); /* Smoky shadow */
    transition: transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease; /* Add transition for the icon */
}

/* Animate the icon when the link is hovered */
.contact-link:hover .fa-fw {
    background: rgba(255, 255, 255, 0.2); /* Brighter glass on hover */
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3); /* White glow */
    transform: scale(1.2) rotate(-5deg);
}

/* --- Sequential Animated Page Border --- */
/* This creates a single line that travels around the entire page border. */

/* Top Border Line */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 0; /* Starts with no width */
    height: 3px; /* Made thicker */
    background: linear-gradient(90deg, #c471ed, #8c8cff);
    box-shadow: 0 0 10px #a365f7;
    z-index: 10002;
    pointer-events: none;
    animation: travel-top 6s linear infinite; /* Made faster */
}

/* Right Border Line */
html::after {
    content: '';
    position: fixed;
    top: 0;
    right: 0;
    width: 3px; /* Made thicker */
    height: 0; /* Starts with no height */
    background: linear-gradient(180deg, #c471ed, #8c8cff);
    box-shadow: 0 0 10px #a365f7;
    z-index: 10002;
    pointer-events: none;
    animation: travel-right 6s linear infinite; /* Made faster */
}

/* Bottom Border Line */
body::after {
    content: '';
    position: fixed;
    bottom: 0;
    right: 0;
    width: 0; /* Starts with no width */
    height: 3px; /* Made thicker */
    background: linear-gradient(-90deg, #c471ed, #8c8cff);
    box-shadow: 0 0 10px #a365f7;
    z-index: 10002;
    pointer-events: none;
    animation: travel-bottom 6s linear infinite; /* Made faster */
}

/* Left Border Line */
html::before {
    content: '';
    position: fixed;
    bottom: 0;
    left: 0;
    width: 3px; /* Made thicker */
    height: 0; /* Starts with no height */
    background: linear-gradient(0deg, #c471ed, #8c8cff);
    box-shadow: 0 0 10px #a365f7;
    z-index: 10002;
    pointer-events: none;
    animation: travel-left 6s linear infinite; /* Made faster */
}

/* Keyframe Animations for each border to run sequentially */
@keyframes travel-top {
    0%      { width: 0; opacity: 1; }
    25%     { width: 100%; opacity: 1; }
    25.01%  { opacity: 0; }
    100%    { opacity: 0; }
}

@keyframes travel-right {
    0%      { height: 0; opacity: 0; }
    25%     { height: 0; opacity: 1; }
    50%     { height: 100%; opacity: 1; }
    50.01%  { opacity: 0; }
    100%    { opacity: 0; }
}

@keyframes travel-bottom {
    0%      { width: 0; opacity: 0; }
    50%     { width: 0; opacity: 1; }
    75%     { width: 100%; opacity: 1; }
    75.01%  { opacity: 0; }
    100%    { opacity: 0; }
}

@keyframes travel-left {
    0%      { height: 0; opacity: 0; }
    75%     { height: 0; opacity: 1; }
    100%    { height: 100%; opacity: 1; }
}

/* --- NEW: About Section UI Design --- */
.about-image-container {
    position: relative;
    padding: 8px; /* Creates space for the gradient border */
    border-radius: 50%; /* Make it a circle */
    background: linear-gradient(135deg, rgba(163, 101, 247, 0.5), rgba(140, 140, 255, 0.5));
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    /* Make it smaller and center it */
    max-width: 280px;
    margin: 0 auto;
    aspect-ratio: 1 / 1; /* Ensure it's a perfect circle */
}

.about-image-container:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: 0 16px 40px rgba(163, 101, 247, 0.3);
}

.about-image {
    width: 100%;
    height: 100%; /* Make it fill the container */
    display: block;
    border-radius: 50%; /* Make it a circle */
    object-fit: cover;
}

.about-highlight-card {
    background: rgba(44, 20, 70, 0.6); /* Matches .card but slightly different */
    border: 1px solid rgba(163, 101, 247, 0.2);
    border-radius: 1rem;
    padding: 1.25rem 1rem;
    backdrop-filter: blur(5px);
    transition: background 0.3s ease, transform 0.3s ease;
}

.about-highlight-card:hover {
    background: rgba(60, 30, 90, 0.8);
    transform: translateY(-5px);
}

.about-highlight-card i {
    color: #c471ed;
    text-shadow: 0 0 8px rgba(196, 113, 237, 0.5);
}

/* --- Keyframes for Sliding Gradient (used in multiple places) --- */
@keyframes slideGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* --- NEW: About Section Text Background --- */
.about-text-container {
    background: rgba(44, 20, 70, 0.7); /* Deeper purple glass effect */
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    border-radius: 1.5rem;
    border: 1.5px solid #a365f7;
    padding: 2.5rem 2rem;
    box-shadow: 0 8px 32px 0 rgba(163, 101, 247, 0.18);
    margin-top: 1.5rem;
    position: relative;
    overflow: hidden;
    color: #e0e6f0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    z-index: 1;
}

.about-text-container h3 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(90deg, #a365f7, #c471ed, #8c8cff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 1px;
    text-shadow: 0 2px 16px rgba(163, 101, 247, 0.25);
}

.about-text-container p {
    font-size: 1.08rem;
    line-height: 1.7;
    color: #e0e6f0;
    margin-bottom: 0.5rem;
}

.about-text-container p:last-child {
    margin-bottom: 0;
}

.about-text-container strong,
.about-text-container b {
    color: #c471ed;
    font-weight: 600;
}

.about-text-container:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 35px rgba(163, 101, 247, 0.25);
    border-color: rgba(163, 101, 247, 0.4);
}

/* Add the shine pseudo-element */
.about-text-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: -150%; /* Start off-screen to the left */
    width: 75%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transform: skewX(-25deg); /* Angle the shine */
    transition: left 0.8s cubic-bezier(0.23, 1, 0.32, 1); /* Smooth transition for the sweep */
    z-index: 1; /* Place it above the background but below the text */
}

/* Trigger the shine animation on hover */
.about-text-container:hover::after {
    left: 150%; /* Move it across and off-screen to the right */
}

.about-text-container::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 1.5rem;
    background: linear-gradient(120deg, rgba(163,101,247,0.13), rgba(196,113,237,0.09), rgba(140,140,255,0.13));
    background-size: 300% 300%;
    animation: slideGradient 8s ease infinite;
    z-index: 0;
    pointer-events: none;
}
.about-text-container > * {
    position: relative;
    z-index: 1;
}

/* --- Skills Section --- */
#skills {
    position: relative;
}

.skills-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 900px; /* Controls the max width of the skill cards */
    margin: 0 auto;
}

.skill-category {
    background: rgba(36, 20, 58, 0.5);
    border: 1px solid rgba(163, 101, 247, 0.2);
    border-radius: 1.5rem;
    padding: 2rem;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease; /* Add transition for hover */
}

/* New hover effect for the entire category card */
.skill-category:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 35px rgba(163, 101, 247, 0.2);
    border-color: rgba(163, 101, 247, 0.4);
}

.skills-subtitle {
    font-size: 1.75rem;
    font-weight: 600;
    color: #e0e6f0;
    text-align: center;
    margin-bottom: 1.5rem;
}

.tech-stack-slider-outer {
    position: relative;
    width: 100%;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

/* New rule to pause the slider animation on hover */
.tech-stack-slider-outer:hover .tech-stack-slider {
    animation-play-state: paused;
}

.tech-stack-slider {
    display: flex;
    width: fit-content;
    will-change: transform;
}

@keyframes tech-slide {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.languages-slider { animation: tech-slide 25s linear infinite; }
.frameworks-slider { animation: tech-slide 22s linear infinite; }
.soft-skills-slider { animation: tech-slide 20s linear infinite; }


.tech-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(44, 20, 70, 0.7);
    padding: 0.75rem 1.5rem;
    margin: 0 0.75rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(163, 101, 247, 0.2);
    white-space: nowrap;
    /* Update transition to include border-color */
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.tech-item:hover {
    /* Enhanced glowing effect */
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 0 25px rgba(196, 113, 237, 0.6);
    border-color: rgba(196, 113, 237, 0.7);
}

.tech-item i {
    font-size: 1.8rem;
    color: #c471ed;
}

.tech-item span {
    font-size: 1rem;
    font-weight: 500;
    color: #e0e6f0;
}

/* --- Experience Section --- */
#experience {
    position: relative;
    padding: 4rem 0;
}

.experience-timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}

.experience-timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 4px;
    background: linear-gradient(to bottom, rgba(163, 101, 247, 0), #a365f7, rgba(163, 101, 247, 0));
    transform: translateX(-50%);
    z-index: 0;
}

.experience-item {
    padding: 1rem 3rem;
    position: relative;
    width: 50%;
    box-sizing: border-box;
}

.experience-item:nth-child(odd) {
    left: 0;
}

.experience-item:nth-child(even) {
    left: 50%;
}

.experience-item::after {
    content: '';
    position: absolute;
    width: 25px;
    height: 25px;
    top: 32px;
    background: #100124;
    border: 4px solid #a365f7;
    border-radius: 50%;
    z-index: 1;
}

.experience-item:nth-child(odd)::after {
    right: -12.5px;
}

.experience-item:nth-child(even)::after {
    left: -12.5px;
}

.experience-content {
    padding: 2rem;
    background: linear-gradient(120deg, #24143aee 60%, #1a1a2eec 100%);
    border: 1.5px solid #a365f733;
    border-radius: 1.5rem;
    position: relative;
    box-shadow: 0 4px 32px 0 rgba(163, 101, 247, 0.10);
    transition: transform 0.3s, box-shadow 0.3s;
}

.experience-content:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 40px 0 rgba(163, 101, 247, 0.2);
}

.experience-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.experience-company {
    background: #a365f7;
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.experience-date {
    font-size: 0.9rem;
    color: #9ca3af;
    margin-bottom: 1rem;
}

.experience-details {
    list-style-type: none;
    padding-left: 0;
    color: #b0b6c3;
}

.experience-details li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.experience-details li::before {
    content: '\f0da'; /* Font Awesome chevron-right icon */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    left: 0;
    top: 4px;
    color: #a365f7;
}

/* --- Education Section --- */
#education {
    position: relative;
    overflow: hidden;
    padding: 4rem 0;
}

.timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 4px;
    background: linear-gradient(to bottom, rgba(163, 101, 247, 0), #a365f7, rgba(163, 101, 247, 0));
    transform: translateX(-50%);
    z-index: 0;
}

.timeline-entry {
    position: relative;
    margin-bottom: 3rem;
    width: 100%;
    display: flex;
}

.timeline-entry:nth-child(odd) {
    justify-content: flex-start;
}
.timeline-entry:nth-child(even) {
    justify-content: flex-end;
}

.timeline-icon {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: rgba(44, 20, 70, 0.8);
    border: 3px solid #a365f7;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c471ed;
    font-size: 1.6rem;
    z-index: 2;
    box-shadow: 0 0 12px #a365f7;
}

.timeline-content {
    position: relative;
    width: calc(50% - 4rem);
    background: linear-gradient(120deg, #24143aee 60%, #1a1a2eec 100%);
    border: 1.5px solid #a365f733;
    border-radius: 1.5rem;
    padding: 1.5rem 2rem;
    box-shadow: 0 4px 32px 0 rgba(163, 101, 247, 0.10);
    transition: transform 0.3s, box-shadow 0.3s;
}

.timeline-content:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 40px 0 rgba(163, 101, 247, 0.2);
}

/* --- Projects Section --- */
.project-slider-container {
    position: relative;
    width: 100%;
    height: 500px; /* Adjust height as needed */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.project-slider {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
}

.project-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.5s ease, opacity 0.5s ease, z-index 0.5s ease;
}

.project-card {
    background: linear-gradient(145deg, rgba(36, 20, 58, 0.7), rgba(26, 26, 46, 0.7));
    backdrop-filter: blur(8px);
    border-radius: 1rem;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    border: 1px solid #a365f733;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
    max-width: 450px;
    min-height: 350px;
}

/* Styles for the slides based on position */
.project-slide.center .project-card {
    /* The center card is fully interactive and visible */
    opacity: 1;
    pointer-events: all;
}
.project-slide.left .project-card,
.project-slide.right .project-card {
    /* Side cards are faded and non-interactive */
    opacity: 0.4;
    pointer-events: none;
}

/* Position the slides - Adjusted for better spacing */
.project-slide.left { transform: translateX(-70%) scale(0.7); z-index: 1; }
.project-slide.center { transform: translateX(0) scale(1); z-index: 2; }
.project-slide.right { transform: translateX(70%) scale(0.7); z-index: 1; }
.project-slide.hidden { transform: scale(0.5); opacity: 0; z-index: 0; }


/* Slider Navigation */
.slider-nav {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 1rem;
    z-index: 3;
}

.nav-button {
    background: rgba(44, 20, 70, 0.7);
    border: 1px solid rgba(163, 101, 247, 0.3);
    color: #e0e6f0;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.3s, transform 0.3s, box-shadow 0.3s;
}

.nav-button:hover {
    background: #a365f7;
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(163, 101, 247, 0.5);
}

.project-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.project-folder-icon { font-size: 2.5rem; color: #a365f7; }
.project-links a { color: #9ca3af; font-size: 1.5rem; margin-left: 1rem; transition: color 0.3s ease; }
.project-links a:hover { color: #c471ed; }
.project-title { font-size: 1.5rem; font-weight: 700; color: #e0e6f0; margin-bottom: 1rem; line-height: 1.3; }
.project-description { color: #b0b6c3; font-size: 1rem; line-height: 1.6; flex-grow: 1; margin-bottom: 1.5rem; }
.project-tech-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; }
.project-tech-list li { color: #c471ed; font-family: 'Inter', sans-serif; font-weight: 500; font-size: 0.85rem; background-color: rgba(163, 101, 247, 0.1); padding: 0.3rem 0.75rem; border-radius: 999px; border: 1px solid rgba(163, 101, 247, 0.2); }
