:root {
    --primary-color: #00bfff;
    --background-color: #020a18;
    --text-color: #e6f1ff;
    --light-text-color: #a8b2d1;
    --glass-bg: rgba(10, 25, 47, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --nav-height: 70px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color);
    background-image: radial-gradient(circle at center, #112240 0%, #020a18 70%);
    color: var(--text-color);
    cursor: none;
    overflow: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('dharmaraj_transparent.png');
    background-size: cover;
    background-position: center;
    opacity: 0.05;
    filter: blur(10px) grayscale(1);
    z-index: -2;
}

#loader-logo {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10rem;
    font-weight: 700;
    color: var(--primary-color);
    z-index: 10001;
    white-space: nowrap;
}

.cursor-dot,
.cursor-outline {
    pointer-events: none;
    position: fixed;
    top: 0;
    left: 0;
    border-radius: 50%;
    opacity: 0;
    z-index: 9999;
    transform: translate(-50%, -50%);
}

.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: var(--primary-color);
}

.cursor-outline {
    width: 40px;
    height: 40px;
    background-color: rgba(0, 191, 255, 0.2);
}

body:hover .cursor-dot,
body:hover .cursor-outline {
    opacity: 1;
}

main {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.page-section {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.page-section.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.section-content {
    width: 100%;
    max-width: 1100px;
    padding: 2rem;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 3rem;
    height: 70vh;
    max-height: 700px;
    overflow-y: auto;
}

.glass-panel::-webkit-scrollbar {
    width: 8px;
}

.glass-panel::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.glass-panel::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

#magic-image {
    position: fixed;
    z-index: 1;
    object-fit: contain;
    filter: drop-shadow(0 0 40px rgba(0, 191, 255, 0.7));
    pointer-events: none;
    opacity: 0;
}

.image-placeholder {
    visibility: hidden;
}

.navbar {
    position: fixed;
    width: 100%;
    top: 0;
    padding: 0 2rem;
    height: var(--nav-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    background: rgba(10, 25, 47, 0.7);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
}

#navbar-logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    opacity: 0;
}

.nav-links {
    list-style: none;
    display: flex;
    opacity: 0;
}

.nav-links li {
    margin: 0 1.5rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
}

.hamburger {
    display: none;
}

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

#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
}

h1,
h2,
p {
    position: relative;
}

h1 {
    font-size: 4.5rem;
}

h2 {
    font-size: 2.5rem;
    color: var(--primary-color);
}

p {
    color: var(--light-text-color);
}

.type-text {
    opacity: 0;
}

.typing::after {
    content: '|';
    animation: blink 0.7s infinite;
    color: var(--primary-color);
    margin-left: 2px;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

#hero .section-content {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    text-align: center;
}

#hero .image-placeholder {
    position: absolute;
    width: 500px;
    height: 500px;
    z-index: 1;
}

#hero .text-content {
    position: relative;
    z-index: 2;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
}

#hero h1 {
    font-size: 5.5rem;
    line-height: 1;
}

#hero p {
    font-size: 1.5rem;
    letter-spacing: 3px;
}

#about .section-content {
    display: grid;
    grid-template-columns: 400px auto;
    align-items: center;
    gap: 3rem;
    text-align: left;
}

#about .image-placeholder {
    width: 400px;
    height: 400px;
    border-radius: 15px;
}

/* --- 1. Education Timeline (Base Styles - DO NOT REMOVE) --- */
#education .section-content.glass-panel {
    display: block;
}

.timeline-container {
    position: relative;
    padding-left: 3rem;
    margin-top: 2rem;
}

.timeline {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 2;
    left: 12px;
    width: 10px;
    height: 85%;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 0 20px #00bfff, 0 0 40px #00bfff, 0 0 60px #00bfff;
}

.timeline-item {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 2rem;
    padding-left: 2.5rem;
}

.timeline-dot {
    position: absolute;
    left: 8px;
    top: 7px;
    width: 20px;
    height: 20px;
    background: #fff;
    border: 3px solid var(--primary-color);
    border-radius: 50%;
    z-index: 2;
    box-shadow: 0 0 10px #00bfff, 0 0 20px #00bfff, 0 0 30px #00bfff;
}

.timeline-date {
    font-weight: 700;
    color: var(--primary-color);
    min-width: 140px;
    text-shadow: 0 0 5px #00bfff;
}

.timeline-content {
    flex: 1;
}

.timeline-content h3 {
    font-size: 1.6rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    text-shadow: 0 0 4px #00bfff;
}

.timeline-content p,
.timeline-content ul {
    color: var(--light-text-color);
    margin: 0.3rem 0;
    text-shadow: 0 0 2px #00bfff;
}

.timeline-content ul {
    margin-left: 1.2rem;
    list-style: disc;
}

/* --- 2. Staggered Animation (Add this AFTER the base styles) --- */
.timeline-photo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 15px rgba(0, 191, 255, 0.6);
    object-fit: cover;
    object-position: top;
    float: right;
    margin: 0.5rem 0 0.5rem 1.5rem;
}

#education .timeline-item .timeline-date,
#education .timeline-item .timeline-content,
#education .timeline-item .timeline-photo {
    opacity: 0;
}

#education.page-section.active .timeline-item .timeline-date,
#education.page-section.active .timeline-item .timeline-content,
#education.page-section.active .timeline-item .timeline-photo {
    animation: appear 0.6s ease-in-out forwards;
}

@keyframes appear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

#education.page-section.active .timeline-item:nth-child(1) .timeline-date,
#education.page-section.active .timeline-item:nth-child(1) .timeline-content,
#education.page-section.active .timeline-item:nth-child(1) .timeline-photo {
    animation-delay: 0.2s;
}

#education.page-section.active .timeline-item:nth-child(2) .timeline-date,
#education.page-section.active .timeline-item:nth-child(2) .timeline-content,
#education.page-section.active .timeline-item:nth-child(2) .timeline-photo {
    animation-delay: 0.7s;
}

#education.page-section.active .timeline-item:nth-child(3) .timeline-date,
#education.page-section.active .timeline-item:nth-child(3) .timeline-content,
#education.page-section.active .timeline-item:nth-child(3) .timeline-photo {
    animation-delay: 1.2s;
}

#education.page-section.active .timeline-item:nth-child(4) .timeline-date,
#education.page-section.active .timeline-item:nth-child(4) .timeline-content,
#education.page-section.active .timeline-item:nth-child(4) .timeline-photo {
    animation-delay: 1.7s;
}


/* --- Experience Section - New Marquee Animation --- */
.skill-category {
    margin-bottom: 2.5rem;
    /* Adds space between each skill category */
}

.skill-category:last-child {
    margin-bottom: 0;
}

.skill-category h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    text-shadow: 0 0 4px var(--primary-color);
}

.skills-scroller {
    overflow: hidden;
    position: relative;
    -webkit-mask: linear-gradient(90deg, transparent, white 20%, white 80%, transparent);
    mask: linear-gradient(90deg, transparent, white 20%, white 80%, transparent);
}

.skills-track {
    display: flex;
    gap: 1.5rem;
    /* Space between items */
    width: max-content;
    /* Ensure the track is wide enough for all items */
    animation: scroll 40s linear infinite;
}

/* Pause animation on hover */
.skills-scroller:hover .skills-track {
    animation-play-state: paused;
}

/* Keyframe animation for the scroll */
@keyframes scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        /* Move the track to the left by half its width */
        transform: translateX(calc(-50% - 0.75rem));
        /* 50% for items + half the gap */
    }
}

/* Individual skill item styling (mostly unchanged) */
.skill-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1.2rem;
    background: rgba(0, 191, 255, 0.05);
    border-radius: 8px;
    white-space: nowrap;
    /* Prevent text from wrapping */
}

.skill-item:hover {
    background-color: rgba(0, 191, 255, 0.1);
}

.skill-item i,
.skill-icon {
    font-size: 2.2rem;
    color: var(--primary-color);
    width: 35px;
    height: 35px;
    object-fit: contain;
}

.skill-item p {
    font-weight: 500;
    font-size: 1.1rem;
    color: var(--text-color);
}

/* To remove the old grid styling if it exists */
#experience .skills-grid {
    display: none;
}

/* --- Projects Section - New Marquee Animation --- */
.projects-scroller {
    margin-top: 2rem;
    position: relative;
    overflow: hidden;
    -webkit-mask: linear-gradient(90deg, transparent, white 20%, white 80%, transparent);
    mask: linear-gradient(90deg, transparent, white 20%, white 80%, transparent);
}

.projects-track {
    display: flex;
    gap: 1.5rem;
    /* This was your original gap */
    width: max-content;
    animation: scroll-projects 40s linear infinite;
}

.projects-scroller:hover .projects-track {
    animation-play-state: paused;
}

@keyframes scroll-projects {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(calc(-50% - 0.75rem));
    }
}

/* Original project card styling with added size control */
.project-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
    overflow: hidden;

    /* --- KEY --- Size control for flex items */
    min-width: 300px;
    /* This matches your original grid size */
    flex-shrink: 0;
    /* Prevents the card from shrinking */
}

.project-card:hover {
    transform: translateY(-10px);
    border-color: rgba(0, 191, 255, 0.5);
}

.project-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.project-content {
    padding: 1.5rem;
}

/* To hide the old grid if it's still in the HTML */
#projects .projects-grid {
    display: none;
}

/* --- Contact Section --- */
#contact .section-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    align-items: center;
    gap: 3rem;
    text-align: left;
}

#contact .image-placeholder {
    width: 350px;
    height: 350px;
    border-radius: 50%;
}

.btn {
    display: inline-block;
    padding: 0.8rem 2.5rem;
    margin-top: 1.5rem;
    border: 1px solid var(--primary-color);
    border-radius: 5px;
    text-decoration: none;
    color: var(--primary-color);
    background: transparent;
    font-weight: 600;
    transition: all 0.3s ease;
    letter-spacing: 1px;
}

.btn:hover {
    background-color: rgba(0, 191, 255, 0.1);
    box-shadow: 0 0 15px rgba(0, 191, 255, 0.5);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    body {
        cursor: auto;
    }

    .cursor-dot,
    .cursor-outline {
        display: none;
    }

    #loader-logo {
        font-size: 4rem;
    }

    .glass-panel {
        height: calc(100vh - var(--nav-height) - 4rem);
        padding: 1.5rem;
    }

    .nav-links {
        position: fixed;
        left: -100%;
        top: var(--nav-height);
        flex-direction: column;
        background-color: #020a18;
        width: 100%;
        height: calc(100vh - var(--nav-height));
        text-align: center;
        transition: 0.3s;
        z-index: 999;
    }

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

    .nav-links li {
        margin: 2.5rem 0;
    }

    .hamburger {
        display: block;
        cursor: pointer;
        z-index: 1001;
    }

    .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);
    }

    #hero h1 {
        font-size: 3.5rem;
    }

    #hero p {
        font-size: 1.2rem;
    }

    #hero .image-placeholder {
        width: 400px;
        height: 400px;
    }

    #about .section-content,
    #contact .section-content {
        grid-template-columns: 1fr;
        text-align: center;
        align-items: flex-start;
    }

    #about .image-placeholder,
    #contact .image-placeholder {
        margin: 0 auto 2rem auto;
    }

    #about .image-placeholder {
        width: 280px;
        height: 280px;
    }

    #contact .image-placeholder {
        width: 250px;
        height: 250px;
    }
}

/* --- Styling for Project GitHub Buttons --- */
.project-content .github-btn {
    display: inline-flex;
    /* Use flex to align icon and text */
    align-items: center;
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.project-content .github-btn i {
    margin-right: 0.5rem;
    /* Adds space between the icon and text */
    font-size: 1.1rem;
}

/* --- Contact Section Social Links --- */
.social-links {
    margin-top: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    gap: 2rem;
}

.social-links a {
    color: var(--light-text-color);
    font-size: 2.2rem;
    transition: color 0.3s ease, transform 0.3s ease;
}

.social-links a:hover {
    color: var(--primary-color);
    transform: translateY(-5px);
}