/* Root Variables */
:root {
    /* Light theme (default) */
    --primary-color: #6c63ff;
    --secondary-color: #f50057;
    --background-color: #f9f9f9;
    --surface-color: #ffffff;
    --dark-color: #333333;
    --text-color: #333333;
    --gray-color: #777777;
    --light-gray: #eeeeee;
    --light-color: #ffffff;
    --card-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    
    --font-primary: 'Poppins', sans-serif;
    --transition: all 0.3s ease;
}

[data-theme="dark"] {
    /* Dark theme */
    --background-color: #121212;
    --surface-color: #1e1e1e;
    --text-color: #f5f5f5;
    --dark-color: #f5f5f5;
    --gray-color: #aaaaaa;
    --light-gray: #2d2d2d;
    --light-color: #ffffff;
    --card-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

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

/* Smooth scrolling for better user experience */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}

/* Improve font rendering */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-display: swap;
}

/* Optimize images */
img {
    max-width: 100%;
    height: auto;
    display: block;
    image-rendering: auto;
}

/* Optimize animations */
* {
    will-change: auto;
}

.hero-content,
.skill-card,
.project-card,
.experience-summary-card,
.exp-content {
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html {
        scroll-behavior: auto; /* Respect reduced motion for scrolling */
    }
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
}

/* Accessibility: Skip link (robust visually-hidden pattern) */
.skip-link {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}
.skip-link:focus,
.skip-link:focus-visible {
    position: fixed !important;
    left: 20px; top: 20px;
    width: auto; height: auto;
    clip: auto; clip-path: none;
    overflow: visible;
    background: var(--primary-color);
    color: #fff;
    padding: 10px 14px;
    border-radius: 6px;
    z-index: 2000;
    box-shadow: 0 8px 18px rgba(108, 99, 255, 0.35);
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

section {
    padding: 80px 0;
}

/* Offset anchor jumps for fixed navbar */
section { scroll-margin-top: 100px; }

h1, h2, h3, h4, h5, h6 {
    margin-bottom: 15px;
    line-height: 1.3;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.primary-btn {
    background-color: var(--primary-color);
    color: var(--light-color);
    border: 2px solid var(--primary-color);
}

.primary-btn:hover {
    background-color: transparent;
    color: var(--primary-color);
}

.secondary-btn {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.secondary-btn:hover {
    background-color: var(--primary-color);
    color: var(--light-color);
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header h2 {
    font-size: 36px;
    font-weight: 600;
   
    display: inline-block;
}

.underline {
    width: 80px;
    height: 4px;
    background-color: var(--primary-color);
    margin: 15px auto 0;
    border-radius: 5px;
}

.highlight {
    color: var(--primary-color);
}

/* Badge chips (e.g., CodeChef 4★) */
.badge-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    margin-left: 10px;
    border-radius: 999px;
    font-size: 0.55em; /* relative to heading size */
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.4px;
    vertical-align: middle;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.badge-chip:hover { transform: translateY(-1px); }
.badge-chip:focus-visible { outline: 2px solid var(--primary-color); outline-offset: 2px; }
.badge-chip.codechef {
    background: linear-gradient(135deg, #6c63ff, #a267ff);
    color: #fff;
    box-shadow: 0 6px 16px rgba(108, 99, 255, 0.25);
}
.badge-chip .star { font-size: 1.05em; }

@media (max-width: 768px) {
    .badge-chip { font-size: 0.65em; padding: 4px 8px; margin-left: 8px; }
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: transparent;
    z-index: 1000;
    transition: var(--transition);
    padding: 20px 0;
}

.navbar.scrolled {
    background-color: var(--surface-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    list-style: none;
}

.nav-link {
    margin: 0 15px;
    font-weight: 500;
    position: relative;
    transition: var(--transition);
}

.nav-link:after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: var(--transition);
}

.nav-link:hover:after,
.nav-link.active:after {
    width: 100%;
}

.menu-toggle {
    display: none;
    cursor: pointer;
}

.menu-toggle .bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: var(--dark-color);
    transition: var(--transition);
}

.menu-toggle[aria-expanded="true"] .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.menu-toggle[aria-expanded="true"] .bar:nth-child(2) {
    opacity: 0;
}
.menu-toggle[aria-expanded="true"] .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 80px;
    background-color: var(--surface-color);
}

.hero .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hero-content {
    flex: 1;
}

.hero-content h1 {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 10px;
}

.hero-content h2 {
    font-size: 28px;
    font-weight: 500;
    margin-bottom: 20px;
}

.hero-content p {
    font-size: 18px;
    margin-bottom: 30px;
    color: var(--gray-color);
}

.cta-buttons {
    margin-bottom: 30px;
}

.cta-buttons .btn {
    margin-right: 15px;
}

.social-icons {
    display: flex;
}

.social-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--light-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    transition: var(--transition);
}

.social-icon:hover {
    background-color: var(--primary-color);
    color: var(--light-color);
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.image-placeholder {
    width: 350px;
    height: 350px;
    background-color: var(--light-gray);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-color);
    font-weight: 500;
}

/* About Section */
.about {
    background-color: var(--surface-color);
}

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

.about-image {
    flex: 1;
}

.about-text {
    flex: 1;
}

.about-text h3 {
    font-size: 24px;
    margin-bottom: 20px;
}

.about-text p {
    margin-bottom: 20px;
    color: var(--gray-color);
}

.personal-info {
    margin: 30px 0;
}

.info-item {
    margin-bottom: 15px;
}

.info-title {
    font-weight: 600;
    margin-right: 10px;
}

/* Skills Section */
.skills-content {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
}

.skill-category {
    flex: 1;
    min-width: 300px;
}

.skill-category h3 {
    margin-bottom: 20px;
    font-size: 24px;
}

.skill-item {
    margin-bottom: 20px;
}

.skill-name {
    margin-bottom: 5px;
    font-weight: 500;
}

.skill-bar {
    height: 10px;
    background-color: var(--light-gray);
    border-radius: 5px;
    overflow: hidden;
}

.skill-level {
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 5px;
}

.skill-percent {
    text-align: right;
    font-size: 14px;
    margin-top: 5px;
}

/* Projects Section */
.project-filters {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-btn {
    background: var(--surface-color);
    border: 2px solid var(--light-gray);
    padding: 12px 24px;
    margin: 0 5px 10px;
    cursor: pointer;
    font-weight: 500;
    border-radius: 25px;
    transition: var(--transition);
    color: var(--text-color);
    font-size: 14px;
    letter-spacing: 0.5px;
    outline: none;
    position: relative;
    overflow: hidden;
    transform: translateY(0);
    font-family: var(--font-primary);
}

.filter-btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: var(--transition);
}

.filter-btn:hover:before {
    left: 100%;
}

.filter-btn.active,
.filter-btn:hover {
    background-color: var(--primary-color);
    color: var(--light-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 99, 255, 0.3);
}

.filter-btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.filter-btn:active {
    transform: translateY(0);
    transition: all 0.1s ease;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 40px;
    justify-items: center;
    scroll-behavior: smooth;
}

.project-card {
    background-color: var(--surface-color);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: 1px solid var(--light-gray);
    width: 100%;
    max-width: 400px;
    height: 100%;
    min-height: 480px;
    display: flex;
    flex-direction: column;
    will-change: transform, box-shadow;
    contain: layout style;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.project-card:hover .project-image::after {
    background: rgba(108, 99, 255, 0.1);
}

.project-card:hover .project-image img {
    transform: scale(1.05);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.project-card.hide {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
    pointer-events: none;
}

.project-card.show {
    opacity: 1;
    transform: scale(1);
    transition: all 0.3s ease;
    pointer-events: auto;
}

.project-image {
    height: 220px;
    overflow: hidden;
    position: relative;
    background: var(--light-gray);
}

.project-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(108, 99, 255, 0);
    transition: all 0.3s ease;
    pointer-events: none;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: block;
    will-change: transform;
}

.project-info {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    height: auto;
    min-height: 0;
}

.project-info h3 {
    font-size: 20px;
    margin-bottom: 12px;
    color: var(--text-color);
    font-weight: 600;
    line-height: 1.3;
    flex-shrink: 0;
}

.project-info p {
    font-size: 14px;
    color: var(--gray-color);
    margin-bottom: 20px;
    line-height: 1.6;
    flex-grow: 1;
    min-height: 60px;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

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

.project-tech span {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--light-color);
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.project-tech span:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(108, 99, 255, 0.3);
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
}

.project-tech span::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.3s ease;
}

.project-tech span:hover::before {
    left: 100%;
}

.project-links {
    display: flex;
    gap: 15px;
    flex-shrink: 0;
}

.project-link {
    display: inline-flex;
    align-items: center;
    font-size: 14px;
    font-weight: 500;
    color: var(--primary-color);
    padding: 8px 16px;
    border: 2px solid var(--primary-color);
    border-radius: 25px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.project-link:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background-color: var(--primary-color);
    transition: left 0.3s ease;
    z-index: -1;
}

.project-link:hover:before {
    left: 0;
}

.project-link:hover {
    color: var(--light-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 99, 255, 0.3);
}

.project-link i {
    margin-right: 6px;
    font-size: 16px;
    transition: transform 0.3s ease;
}

.project-link:hover i {
    transform: scale(1.1);
}

/* Contact Section */
.contact {
    background-color: var(--surface-color);
}

.contact-content {
    display: flex;
    gap: 50px;
}

.contact-info {
    flex: 1;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 30px;
}

.contact-item i {
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: var(--light-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    font-size: 20px;
}

.contact-details h3 {
    font-size: 18px;
    margin-bottom: 5px;
}

.contact-details p {
    color: var(--gray-color);
}

.contact-form {
    flex: 1;
}

.form-group {
    margin-bottom: 20px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--light-gray);
    border-radius: 5px;
    background-color: var(--background-color);
    font-family: var(--font-primary);
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group textarea {
    height: 150px;
    resize: none;
}

/* Footer */
.footer {
    background-color: #2c3e50;
    color: #ffffff;
    padding: 40px 0;
    border-top: 1px solid var(--light-gray);
    margin-top: 60px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-content p {
    color: #ffffff;
    margin: 0;
    font-weight: 500;
    font-size: 16px;
}

.footer .social-icons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.footer .social-icon {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 18px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    text-decoration: none;
}

.footer .social-icon:hover {
    background-color: var(--primary-color);
    color: #ffffff;
    transform: translateY(-3px);
    border-color: var(--primary-color);
    box-shadow: 0 8px 15px rgba(108, 99, 255, 0.3);
}

/* Dark theme footer improvements */
[data-theme="dark"] .footer {
    background-color: #0d1117;
    border-top: 1px solid #30363d;
}

[data-theme="dark"] .footer-content p {
    color: #f0f6fc;
}

[data-theme="dark"] .footer .social-icon {
    background-color: rgba(240, 246, 252, 0.1);
    color: #f0f6fc;
    border: 2px solid rgba(240, 246, 252, 0.2);
}

[data-theme="dark"] .footer .social-icon:hover {
    background-color: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
    box-shadow: 0 8px 15px rgba(108, 99, 255, 0.4);
}

/* Experience Page Styles */
.experience-page {
    background-color: var(--background-color);
    padding: 80px 0;
}

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

.experience-timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
    transform: translateX(-50%);
    border-radius: 2px;
}

.experience-item {
    position: relative;
    margin: 60px 0;
    width: 100%;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.experience-item.aos-animate {
    opacity: 1;
    transform: translateY(0);
}

.experience-item:nth-child(odd) .exp-content {
    margin-left: 0;
    margin-right: 55%;
    text-align: right;
}

.experience-item:nth-child(even) .exp-content {
    margin-left: 55%;
    margin-right: 0;
    text-align: left;
}

.exp-content {
    background-color: var(--surface-color);
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--card-shadow);
    position: relative;
    transition: var(--transition);
    border: 1px solid var(--light-gray);
}

.exp-content:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.exp-content::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    top: 30px;
}

.experience-item:nth-child(odd) .exp-content::before {
    right: -15px;
    border: 15px solid transparent;
    border-left-color: var(--surface-color);
}

.experience-item:nth-child(even) .exp-content::before {
    left: -15px;
    border: 15px solid transparent;
    border-right-color: var(--surface-color);
}

.exp-date {
    position: absolute;
    left: 50%;
    top: 20px;
    transform: translateX(-50%);
    background-color: var(--primary-color);
    color: white;
    padding: 8px 20px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(108, 99, 255, 0.3);
}

.exp-role {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 8px;
    line-height: 1.2;
}

.exp-company {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.exp-company i {
    font-size: 16px;
}

.exp-location {
    font-size: 14px;
    color: var(--gray-color);
    margin-bottom: 20px;
    font-style: italic;
}

.exp-description {
    color: var(--text-color);
    line-height: 1.6;
    margin-bottom: 20px;
}

.exp-achievements {
    list-style: none;
    padding: 0;
    margin: 0;
}

.exp-achievements li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 12px;
    color: var(--text-color);
    line-height: 1.5;
}

.exp-achievements li::before {
    content: '→';
    position: absolute;
    left: 0;
    top: 0;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 16px;
}

.exp-achievements li strong {
    color: var(--dark-color);
    font-weight: 600;
}

.exp-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

.skill-tag {
    background-color: var(--light-gray);
    color: var(--dark-color);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    transition: var(--transition);
}

.skill-tag:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* Timeline dots */
.timeline-dot {
    position: absolute;
    left: 50%;
    top: 50px;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    background-color: var(--primary-color);
    border: 4px solid var(--surface-color);
    border-radius: 50%;
    z-index: 10;
    box-shadow: 0 0 0 4px var(--primary-color);
    transition: var(--transition);
}

.timeline-dot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background-color: white;
    border-radius: 50%;
}

.experience-item:hover .timeline-dot {
    transform: translateX(-50%) scale(1.2);
    box-shadow: 0 0 0 8px rgba(108, 99, 255, 0.2);
}

/* Experiences Section Styles */
.experiences {
    background-color: var(--surface-color);
}

.featured-experiences-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.experience-summary-card {
    background-color: var(--background-color);
    border-radius: 15px;
    padding: 25px;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    border-left: 4px solid var(--primary-color);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.experience-summary-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-left-color: var(--secondary-color);
}

.exp-header {
    margin-bottom: 20px;
}

.exp-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 8px;
    line-height: 1.2;
}

.exp-company {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.exp-duration {
    font-size: 14px;
    color: var(--gray-color);
    font-weight: 500;
    background-color: var(--light-gray);
    padding: 4px 8px;
    border-radius: 15px;
    display: inline-block;
}

.exp-highlights {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
    flex-grow: 1;
}

.exp-highlights li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 10px;
    color: var(--text-color);
    line-height: 1.4;
    font-size: 14px;
}

.exp-highlights li::before {
    content: '▸';
    position: absolute;
    left: 0;
    top: 0;
    color: var(--primary-color);
    font-weight: bold;
}

.exp-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
}

.exp-tags .tag {
    background-color: var(--light-gray);
    color: var(--dark-color);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    transition: var(--transition);
}

.exp-tags .tag:hover {
    background-color: var(--primary-color);
    color: var(--surface-color);
}

/* Responsive Design */
@media screen and (max-width: 992px) {
    .hero .container,
    .about-content,
    .contact-content {
        flex-direction: column;
    }
    
    .hero-content,
    .hero-image,
    .about-image,
    .about-text,
    .contact-info,
    .contact-form {
        flex: none;
        width: 100%;
    }
    
    .hero-image,
    .about-image {
        margin-bottom: 50px;
        order: -1;
    }
    
    .contact-info {
        margin-bottom: 50px;
    }
}

@media screen and (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    .nav-menu {
        position: fixed;
        top: 80px;
        left: -100%;
        background-color: var(--surface-color);
        width: 100%;
        flex-direction: column;
        align-items: center;
        padding: 30px 0;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
        transition: var(--transition);
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-link {
        margin: 15px 0;
    }
    
    .hero-content h1 {
        font-size: 36px;
    }
    
    .hero-content h2 {
        font-size: 24px;
    }
    
    .section-header h2 {
        font-size: 28px;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 25px;
        margin-top: 30px;
    }

    .project-filters {
        flex-direction: column;
        align-items: center;
        gap: 10px;
        margin-bottom: 30px;
    }

    .filter-btn {
        width: 90%;
        max-width: 250px;
        text-align: center;
        margin: 5px 0;
        padding: 14px 20px;
        font-size: 15px;
    }

    .project-card {
        margin: 0 auto;
        max-width: 100%;
    }

    .project-image {
        height: 200px;
    }

    .project-info {
        padding: 20px;
    }

    .project-info h3 {
        font-size: 18px;
        margin-bottom: 10px;
    }

    .project-info p {
        font-size: 14px;
        min-height: 50px;
        margin-bottom: 15px;
    }

    .project-tech {
        justify-content: center;
        gap: 6px;
        margin-bottom: 15px;
    }

    .project-tech span {
        font-size: 10px;
        padding: 5px 10px;
    }

    .project-links {
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
    }

    .project-link {
        padding: 10px 14px;
        font-size: 13px;
        min-width: 100px;
        justify-content: center;
    }

    .hero-content {
        text-align: center;
    }
    
    .hero-image img {
        max-width: 80%;
        margin: 0 auto;
    }

    .experience-timeline::before {
        left: 30px;
    }
    
    .experience-item:nth-child(odd) .exp-content,
    .experience-item:nth-child(even) .exp-content {
        margin-left: 60px;
        margin-right: 0;
        text-align: left;
    }
    
    .experience-item:nth-child(odd) .exp-content::before {
        left: -15px;
        right: auto;
        border: 15px solid transparent;
        border-right-color: var(--surface-color);
        border-left-color: transparent;
    }
    
    .exp-date {
        left: 30px;
        transform: translateX(-50%);
    }
    
    .timeline-dot {
        left: 30px;
        transform: translateX(-50%);
    }
    
    .exp-role {
        font-size: 20px;
    }
    
    .exp-company {
        font-size: 16px;
    }

    .featured-experiences-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .experience-summary-card {
        padding: 20px;
    }
    
    .exp-title {
        font-size: 18px;
    }
    
    .exp-company {
        font-size: 14px;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 25px;
        text-align: center;
    }
    
    .footer .social-icons {
        justify-content: center;
        flex-wrap: wrap;
        gap: 20px;
    }
    
    .footer .social-icon {
        margin: 0;
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}

/* Tablet responsive styles */
@media screen and (max-width: 992px) and (min-width: 769px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
    
    .project-filters {
        justify-content: center;
        gap: 8px;
    }
    
    .filter-btn {
        padding: 10px 20px;
        font-size: 13px;
    }
}

/* Add theme toggle styles */
.theme-toggle {
    margin-left: auto;
    margin-right: 20px;
}

.theme-switch {
    opacity: 0;
    position: absolute;
}

.toggle-label {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px;
    width: 60px;
    height: 30px;
    border-radius: 50px;
    background: var(--light-gray);
    cursor: pointer;
}

.toggle-ball {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background-color: var(--surface-color);
    transition: transform 0.3s linear;
    z-index: 1;
}

.fa-moon {
    color: #f1c40f;
    margin-right: 5px;
}

.fa-sun {
    color: #f39c12;
    margin-left: 5px;
}

.theme-switch:checked + .toggle-label .toggle-ball {
    transform: translateX(30px);
}
/* Preloader */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--surface-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loader {
    width: 50px;
    height: 50px;
    border: 5px solid var(--light-gray);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

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

/* Page Header for separate pages */
.page-header {
    background-color: var(--primary-color);
    color: var(--light-color);
    padding: 120px 0 50px;
    text-align: center;
}

.page-header h1 {
    font-size: 40px;
    margin-bottom: 15px;
}

.page-header .underline {
    background-color: var(--light-color);
}

/* Skills Page Styles */
.skills-page {
    padding: 80px 0;
}

.skills-page .skills-category {
    margin-bottom: 60px;
}

.skills-page .skills-category h2 {
    font-size: 28px;
    margin-bottom: 30px;
    position: relative;
    padding-left: 15px;
    border-left: 4px solid var(--primary-color);
}

/* Projects Page Styles */
.projects-page {
    padding: 80px 0;
    contain: layout style;
}

.projects-page .projects-grid {
    margin-top: 40px;
    scroll-behavior: smooth;
}

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

.mt-40 {
    margin-top: 40px;
}

/* Featured Skills Section */
.featured-skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.featured-column { display: contents; }

.skill-card {
    background-color: var(--surface-color);
    border-radius: 10px;
    padding: 25px;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    text-align: center;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.skill-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.skill-card i {
    font-size: 36px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.skill-card h4 {
    font-size: 18px;
    font-weight: 600;
}

/* Enhanced animations for projects */
.project-card.hide {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
    pointer-events: none;
}

.project-card.show {
    opacity: 1;
    transform: scale(1);
    transition: all 0.3s ease;
    pointer-events: auto;
}

/* Loading state for project filtering */
.projects-grid.loading {
    opacity: 0.6;
    pointer-events: none;
}

.projects-grid.loading::after {
    content: 'Filtering projects...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--surface-color);
    padding: 10px 20px;
    border-radius: 5px;
    box-shadow: var(--card-shadow);
}

/* Optimized Project Page Performance */
.projects-page {
    contain: layout style;
}

.project-card {
    contain: layout style paint;
    transform: translateZ(0); /* Force GPU acceleration */
}

.project-image img {
    will-change: transform;
}

.project-card:not(:hover) .project-image img {
    will-change: auto;
}

/* Improved focus management */
.filter-btn:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 6px rgba(108, 99, 255, 0.2);
}

/* Ensure focus styles visible for keyboard users on interactive elements only */
:where(a, button, input, textarea, select, summary, details, [role="button"], [tabindex]):focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Enhanced loading states */
.project-card[data-aos]:not(.aos-animate) {
    opacity: 0;
    transform: translateY(20px);
}

.project-card[data-aos].aos-animate {
    opacity: 1;
    transform: translateY(0);
}

/* Smooth scrolling optimization */
.projects-grid {
    scroll-behavior: smooth;
}

/* Better text rendering */
.project-info h3,
.project-info p {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

/* === UI polish overrides (non-breaking) === */
.navbar.scrolled {
    background: rgba(255, 255, 255, 0.6);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
}
[data-theme="dark"] .navbar.scrolled {
    background: rgba(18, 18, 18, 0.6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

.hero {
    position: relative;
    overflow: hidden;
    background: radial-gradient(1200px 600px at -10% -10%, rgba(108, 99, 255, 0.15), transparent 60%),
                            radial-gradient(1000px 500px at 110% 10%, rgba(245, 0, 87, 0.12), transparent 60%),
                            var(--surface-color);
}
.hero::before,
.hero::after {
    content: '';
    position: absolute;
    width: 540px;
    height: 540px;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.45;
    z-index: 0;
}
.hero::before {
    top: -120px;
    left: -120px;
    background: radial-gradient(circle at 30% 30%, rgba(108, 99, 255, 0.35), transparent 60%);
}
.hero::after {
    bottom: -160px;
    right: -160px;
    background: radial-gradient(circle at 70% 70%, rgba(245, 0, 87, 0.28), transparent 60%);
}
.hero-content,
.hero-image { position: relative; z-index: 1; }

.btn { box-shadow: 0 6px 18px rgba(108, 99, 255, 0.12); transform: translateY(0); }
.primary-btn:hover,
.secondary-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(108, 99, 255, 0.22); }

/* Highlights Section */
.highlights { background: linear-gradient(180deg, transparent, rgba(108, 99, 255, 0.04)); }
.highlights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}
.highlight-card {
    background: rgba(255, 255, 255, 0.6);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 14px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.highlight-card i { font-size: 22px; color: var(--primary-color); }
.highlight-card h4 { font-size: 16px; margin: 0; }
.highlight-card p { margin: 0; font-size: 13px; color: var(--gray-color); }
.highlight-card:hover { transform: translateY(-4px); box-shadow: 0 16px 35px rgba(108, 99, 255, 0.18); }
[data-theme="dark"] .highlight-card { background: rgba(30, 30, 30, 0.6); border-color: rgba(255, 255, 255, 0.08); }

/* Back to Top button */
.back-to-top {
    position: fixed;
    right: 20px;
    bottom: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--primary-color);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(108, 99, 255, 0.35);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    z-index: 1100;
}
.back-to-top:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
}
.back-to-top:hover { transform: translateY(8px); }
.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
[data-theme="dark"] .back-to-top {
    box-shadow: 0 10px 25px rgba(0,0,0,0.45);
}

@media (max-width: 480px) {
    .back-to-top {
        right: 16px;
        bottom: 16px;
        width: 40px;
        height: 40px;
    }
}