/* General Styling and Liquid Glass Theme */
:root {
    --primary-color: #818cf8;
    --secondary-color: #c084fc;
    --background-color: #111827;
    --text-color: #e5e7eb;
    --subtle-text-color: #9ca3af;
    --glass-bg: rgba(31, 41, 55, 0.4);
    --glass-border: rgba(255, 255, 255, 0.1);
    --card-bg: transparent;
}

body.light-mode {
    --primary-color: #4f46e5;
    --secondary-color: #9333ea;
    --background-color: #f9fafb;
    --text-color: #1f2937;
    --subtle-text-color: #6b7280;
    --glass-bg: rgba(255, 255, 255, 0.5);
    --glass-border: rgba(0, 0, 0, 0.05);
    --card-bg: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    overflow-x: hidden;
    transition: background-color 0.5s ease, color 0.5s ease;
}

.background-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    transition: opacity 0.5s ease;
}

body.light-mode .background-shapes {
    opacity: 0.5;
}

.background-shapes::before,
.background-shapes::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.5;
}

.background-shapes::before {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    top: -10%;
    left: -10%;
    animation: moveShape1 20s infinite alternate ease-in-out;
}

.background-shapes::after {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, var(--secondary-color), #f472b6);
    bottom: -15%;
    right: -15%;
    animation: moveShape2 25s infinite alternate ease-in-out;
}

@keyframes moveShape1 {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(100px, 200px) scale(1.2); }
}

@keyframes moveShape2 {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(-150px, -100px) scale(0.9); }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 1rem 0;
    transition: background 0.3s ease, box-shadow 0.3s ease;
    background: transparent;
}

.navbar.scrolled {
    background: rgba(17, 24, 39, 0.6);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--glass-border);
}

body.light-mode .navbar.scrolled {
    background: rgba(255, 255, 255, 0.6);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
}

.nav-menu {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--subtle-text-color);
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover, .nav-link.active {
    color: var(--text-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    margin: 3px 0;
    transition: 0.3s;
}

/* Theme Switcher */
.theme-switcher {
    cursor: pointer;
    width: 24px;
    height: 24px;
    position: relative;
}
.theme-switcher svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.theme-switcher .sun-icon {
    opacity: 0;
    transform: scale(0.8);
}
.theme-switcher .moon-icon {
    opacity: 1;
    transform: scale(1);
}
body.light-mode .theme-switcher .sun-icon {
    opacity: 1;
    transform: scale(1);
}
body.light-mode .theme-switcher .moon-icon {
    opacity: 0;
    transform: scale(0.8);
}


/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-container {
    z-index: 1;
    position: relative;
}

.hero-title {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--subtle-text-color);
    margin-bottom: 2rem;
    font-weight: 400;
    height: 1.6em; /* Set a fixed height to prevent vertical jiggle */
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Glass Card Base Style */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.5s ease;
}

.glass-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.3);
}

/* Buttons */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 15px rgba(129, 140, 248, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(129, 140, 248, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--text-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* Sections */
section {
    padding: 80px 0;
    position: relative;
    z-index: 2;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: var(--text-color);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

/* About Section */
.about-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
    align-items: center;
}

.profile-img {
    width: 100%;
    max-width: 300px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
    border: 2px solid var(--glass-border);
}

.profile-img:hover {
    transform: scale(1.05);
}

.about-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--subtle-text-color);
}

.about-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.fact {
    padding: 1rem;
    background: var(--glass-bg);
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
    color: var(--text-color);
}

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.skill-category {
    padding: 2rem;
    background: var(--card-bg);
}

.skill-category h3 {
    margin-bottom: 1.5rem;
    color: var(--text-color);
    font-size: 1.3rem;
}

.skill-item {
    margin-bottom: 1.5rem;
}

.skill-item span {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--subtle-text-color);
}

.skill-bar {
    height: 8px;
    background: rgba(0,0,0,0.1);
    border-radius: 4px;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
    width: 0;
    transition: width 1s ease-in-out;
}

/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.project-card {
    overflow: hidden;
    background: var(--card-bg);
}

.project-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.project-content {
    padding: 1.5rem;
}

.project-content h3 {
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-size: 1.2rem;
}

.project-content p {
    color: var(--subtle-text-color);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.project-tech span {
    background: rgba(129, 140, 248, 0.2);
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Experience Section */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
    width: 50%;
}

.timeline-item:nth-child(odd) {
    left: 0;
    padding-right: 2rem;
}

.timeline-item:nth-child(even) {
    left: 50%;
    padding-left: 2rem;
}

.timeline-content {
    padding: 1.5rem;
    position: relative;
    background: var(--card-bg);
}

.timeline-content::before {
    content: '';
    position: absolute;
    width: 15px;
    height: 15px;
    background: var(--primary-color);
    border-radius: 50%;
    top: 20px;
    border: 3px solid var(--background-color);
}

.timeline-item:nth-child(odd) .timeline-content::before {
    right: -2.5rem;
}

.timeline-item:nth-child(even) .timeline-content::before {
    left: -2.5rem;
}

.timeline-content h3 { color: var(--text-color); }
.timeline-content h4 { color: var(--primary-color); }

.timeline-date {
    color: var(--secondary-color);
    font-weight: 600;
    font-size: 0.9rem;
}

/* Education Section */
.education-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.education-card {
    padding: 2rem;
    text-align: center;
    border-top: 4px solid var(--primary-color);
    background: var(--card-bg);
}

.education-card h3 {
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.education-card h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.year {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    display: inline-block;
    margin-bottom: 1rem;
}

.marks-card-download {
    margin-top: 1rem;
    display: inline-block;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.marks-card-download:hover {
    color: var(--text-color);
}

.marks-card-download svg {
    width: 24px;
    height: 24px;
    vertical-align: middle;
    margin-right: 8px;
}

/* Contact Section */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.contact-info h3 {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.contact-item {
    margin-bottom: 1rem;
    color: var(--subtle-text-color);
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.social-link {
    background: var(--glass-bg);
    color: var(--text-color);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid var(--glass-border);
}

.social-link:hover {
    transform: translateY(-4px);
    background: var(--primary-color);
    color: white;
}

.social-link img { 
    filter: invert(0);
}
body:not(.light-mode) .social-link img {
    filter: invert(1);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-form input,
.contact-form textarea {
    padding: 1rem;
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    font-family: inherit;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: rgba(0,0,0,0.1);
    color: var(--text-color);
}

body.light-mode .contact-form input,
body.light-mode .contact-form textarea {
    background: rgba(0,0,0,0.05);
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: var(--subtle-text-color);
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.2);
}

/* Footer */
.footer {
    background: transparent;
    color: var(--subtle-text-color);
    text-align: center;
    padding: 2rem 0;
    border-top: 1px solid var(--glass-border);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    margin: 5% auto;
    padding: 2rem;
    width: 90%;
    max-width: 600px;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-content h2, .modal-content h3 { color: var(--text-color); }
.modal-content p, .modal-content li { color: var(--subtle-text-color); }
.modal-content .tech-span {
    background: rgba(129, 140, 248, 0.2);
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
}

.close {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 2rem;
    cursor: pointer;
    color: var(--subtle-text-color);
    transition: color 0.3s ease;
}

.close:hover {
    color: var(--text-color);
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s ease forwards;
}

.fade-in:nth-child(2) { animation-delay: 0.2s; }
.fade-in:nth-child(3) { animation-delay: 0.4s; }

@keyframes fadeInUp {
    to { opacity: 1; transform: translateY(0); }
}

.role-wrapper {
    position: relative;
    width: 140px; /* Fixed width for the longest word ("Explorer") */
    height: 1.6em; /* Match parent line-height */
    display: inline-block;
    text-align: left;
    vertical-align: middle;
}

#role-anim {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    color: #f472b6;
    font-weight: 600;
    animation-duration: 0.4s;
    animation-timing-function: ease-in-out;
    animation-fill-mode: forwards;
}

@keyframes fade-out-subtle {
    to {
        opacity: 0;
        transform: translateY(-5px);
    }
}

@keyframes fade-in-rise {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: rgba(17, 24, 39, 0.9);
        backdrop-filter: blur(10px);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.2);
        padding: 2rem 0;
    }
    
    body.light-mode .nav-menu {
        background: rgba(255, 255, 255, 0.9);
    }

    .nav-menu.active { left: 0; }
    .nav-toggle { display: flex; }
    .hero-title { font-size: 2.5rem; }
    .hero-subtitle { font-size: 1.2rem; flex-direction: column; height: auto; }
    .about-content, .contact-content { grid-template-columns: 1fr; text-align: center; }
    .about-image { margin: 0 auto; }
    .timeline::before { left: 20px; }
    .timeline-item { width: 100%; left: 0; padding-left: 3rem; padding-right: 0; }
    .timeline-item:nth-child(even) { padding-left: 3rem; }
    .timeline-content::before { left: -2.5rem !important; }
    .hero-buttons { flex-direction: column; align-items: center; }
    .skills-grid, .projects-grid, .education-grid { grid-template-columns: 1fr; }

    /* Aligns the vertical timeline bar to the left on mobile, ONLY in the Experience section */
    #experience .timeline::before {
        left: 20px;
        transform: translateX(0);
    }

    /* Resets ALL timeline items to be full-width and stack on the left, ONLY in the Experience section */
    #experience .timeline-item,
    #experience .timeline-item:nth-child(even) {
        width: 100%;
        left: 0;
        padding-left: 45px; /* Creates space for the line and dot */
        padding-right: 15px;
    }

    /* Correctly positions the timeline dot on the vertical bar for all items, ONLY in the Experience section */
    #experience .timeline-content::before {
        left: -27px;
        right: auto;
    }

}

.scroller {
    max-width: 2500px;
    overflow: hidden;
    /* Creates a fading effect at the edges */
    -webkit-mask: linear-gradient(90deg, transparent, white 20%, white 80%, transparent);
    mask: linear-gradient(90deg, transparent, white 20%, white 80%, transparent);
}

.scroller__inner {
    display: flex;
    gap: 2rem;
    width: max-content; /* Ensures the container is wide enough for all items */
    /* The animation that drives the scroll */
    animation: scroll 40s linear infinite;
}

.skill-logo {
    height: 60px;
    width: auto;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #9ca3af; /* Subtle text color */
    transition: color 0.3s ease;
}

.skill-logo:hover {
    color: #e5e7eb; /* Brighter text color on hover */
}

.skill-logo svg {
    height: 40px;
    width: 40px;
    fill: currentColor; /* SVG color will match the parent's text color */
}

.skill-logo span {
    font-size: 1.1rem;
    font-weight: 500;
}

/* The keyframes that define the scrolling motion */
@keyframes scroll {
    to {
        /* Moves the container to the left by half its width */
        transform: translateX(calc(-50% - 1rem)); /* 1rem is half the gap */
    }
}
