:root {
    /* Color Palette */
    --bg-color: #050505;
    --bg-surface: rgba(255, 255, 255, 0.03);
    --bg-surface-hover: rgba(255, 255, 255, 0.08);
    
    --text-primary: #f8f9fa;
    --text-secondary: #adb5bd;
    --text-muted: #6c757d;
    
    --primary-color: #6366f1;
    --primary-light: #818cf8;
    --secondary-color: #10b981;
    --accent-color: #ec4899;
    
    /* Typography */
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-heading: 'Outfit', var(--font-sans);
    
    /* Spacing & Layout */
    --container-width: 1200px;
    --section-padding: 7rem 0;
    
    /* Effects */
    --glass-border: 1px solid rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    --blur-strength: blur(12px);
    
    /* Animations */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* OPTIMIZATION: Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Reset & Base Styles */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* OPTIMIZATION: Removed heavy SVG noise - now simple subtle gradient instead */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(99, 102, 241, 0.02) 0%, transparent 100%);
    pointer-events: none;
    z-index: -2;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.4);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
}

.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: var(--section-padding);
    position: relative;
}

/* Typography Utilities */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    line-height: 1.2;
    color: var(--text-primary);
    font-weight: 600;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary-light), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Background Glowing Orbs - OPTIMIZATION: Reduced animation complexity */
.glow-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    opacity: 0.25; /* OPTIMIZATION: Reduced opacity */
    animation: float 35s infinite ease-in-out alternate; /* OPTIMIZATION: Slower animation */
    will-change: transform;
    pointer-events: none;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: var(--primary-color);
    top: -150px;
    left: -150px;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: var(--accent-color);
    bottom: 15%;
    right: -100px;
    animation-delay: -7s;
}

.orb-3 {
    width: 450px;
    height: 450px;
    background: var(--secondary-color);
    top: 45%;
    left: 25%;
    opacity: 0.1; /* OPTIMIZATION: Reduced opacity */
    animation-delay: -13s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(40px, -30px) scale(1.05); }
    66% { transform: translate(-20px, 40px) scale(0.95); }
    100% { transform: translate(-30px, -50px) scale(1.02); }
}

/* ─────────── NAVIGATION ─────────── */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 1.25rem 0;
    transition: var(--transition-normal);
    will-change: padding, background, box-shadow;
}

.navbar.scrolled {
    padding: 0.8rem 0;
    background: rgba(5, 5, 5, 0.9);
    border-bottom: var(--glass-border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

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

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.5px;
    position: relative;
}

.logo::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 2px;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.logo:hover::after {
    transform: scaleX(1);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2.5rem;
}

.nav-item {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition-fast);
    position: relative;
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-light);
    transition: width 0.3s ease;
}

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

.nav-item:hover, .nav-item.active {
    color: var(--text-primary);
}

.menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

/* ─────────── BUTTONS ─────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.75rem;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    font-size: 0.95rem;
    position: relative;
    overflow: hidden;
}

.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: left 0.5s;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: #fff !important;
    border: none;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid rgba(255,255,255,0.2);
}

.btn-outline:hover {
    background: var(--bg-surface-hover);
    border-color: var(--primary-light);
    transform: translateY(-3px);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.15);
}

/* ─────────── HERO SECTION ─────────── */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 100px;
    position: relative;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 120px;
    background: linear-gradient(to top, var(--bg-color), transparent);
    pointer-events: none;
}

.hero-content {
    max-width: 800px;
}

.badge {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    background: rgba(16, 185, 129, 0.08);
    color: var(--secondary-color);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 2rem;
    letter-spacing: 0.5px;
    animation: pulse-badge 3s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.2); }
    50% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
}

.hero-title {
    font-size: clamp(2.5rem, 4vw, 5rem);
    letter-spacing: -2px;
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    max-width: 650px;
    line-height: 1.8;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ─────────── ANIMATIONS ─────────── */
.fade-in-up {
    animation: fadeInUp 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

/* Scroll Animation Classes - OPTIMIZATION: Use will-change sparingly */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
    will-change: auto;
}

/* ─────────── GLASS CARD EFFECT ─────────── */
.glass-card {
    background: var(--bg-surface);
    border: var(--glass-border);
    border-radius: 20px;
    backdrop-filter: var(--blur-strength);
    padding: 2.5rem;
    transition: all var(--transition-normal);
}

.glass-card:hover {
    background: var(--bg-surface-hover);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: var(--glass-shadow);
}

/* ─────────── SERVICES SECTION ─────────── */
.services-section {
    background: linear-gradient(to bottom, rgba(99, 102, 241, 0.02), transparent);
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    text-align: center;
    margin-bottom: 4rem;
    letter-spacing: -1px;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.service-card {
    text-align: center;
    animation: slideIn 0.6s ease forwards;
    opacity: 0;
}

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

.service-icon {
    font-size: 3.5rem;
    margin-bottom: 1.25rem;
}

.service-title {
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.service-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* ─────────── SKILLS SECTION ─────────── */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.skill-category {
    display: flex;
    flex-direction: column;
}

.skill-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.skill-header i {
    font-size: 2rem;
}

.skill-header h3 {
    font-size: 1.2rem;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.skill-tag {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-light);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.skill-tag:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary-light);
}

/* ─────────── PROJECTS SECTION ─────────── */
.projects-section {
    background: linear-gradient(to bottom, transparent, rgba(99, 102, 241, 0.02));
}

.projects-list {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.project-card {
    display: flex;
    flex-direction: column;
}

.project-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

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

.project-title {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.project-links {
    display: flex;
    gap: 0.75rem;
}

.project-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 8px;
    color: var(--primary-light);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.project-link:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary-light);
    transform: translateY(-3px);
}

.project-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 1rem;
    line-height: 1.8;
}

.impact-text {
    font-weight: 500;
}

.project-details {
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.detail-heading {
    font-size: 1.1rem;
    color: var(--primary-light);
    margin-bottom: 1rem;
}

.project-bullets {
    list-style: none;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.project-bullets li {
    position: relative;
    padding-left: 1.75rem;
    margin-bottom: 0.85rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.project-bullets li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--secondary-color);
    font-weight: bold;
    font-size: 1.1rem;
}

.project-bullets li strong {
    color: var(--text-primary);
}

.project-card .skill-tags {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* ─────────── EXPERIENCE / TIMELINE SECTION ─────────── */
.experience-section {
    background: linear-gradient(to bottom, transparent, rgba(99, 102, 241, 0.03), transparent);
}

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

.timeline::after {
    content: "";
    position: absolute;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color), transparent);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -1px;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    background-color: inherit;
    width: 50%;
}

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

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

.timeline-dot {
    position: absolute;
    width: 18px;
    height: 18px;
    right: -9px;
    background-color: var(--bg-color);
    border: 3px solid var(--primary-light);
    top: 32px;
    border-radius: 50%;
    z-index: 1;
    box-shadow: 0 0 0 5px rgba(99, 102, 241, 0.15), 0 0 15px rgba(99, 102, 241, 0.3);
    transition: all 0.3s ease;
}

.timeline-item:hover .timeline-dot {
    box-shadow: 0 0 0 5px rgba(99, 102, 241, 0.3), 0 0 25px rgba(99, 102, 241, 0.5);
    background-color: var(--primary-light);
}

.timeline-item:nth-child(even) .timeline-dot {
    left: -9px;
}

.timeline-content {
    padding: 2rem;
    border-radius: 16px;
    position: relative;
}

.timeline-date {
    display: inline-block;
    padding: 0.4rem 1.1rem;
    background: rgba(16, 185, 129, 0.08);
    color: var(--secondary-color);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.timeline-title {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.timeline-subtitle {
    font-size: 1rem;
    color: var(--primary-light);
    font-weight: 500;
    margin-bottom: 1rem;
}

.timeline-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* ─────────── CONTACT SECTION ─────────── */
.contact-box {
    max-width: 700px;
    margin: 0 auto;
    padding: 3.5rem;
    position: relative;
    overflow: hidden;
}

.contact-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color), var(--secondary-color));
}

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

.contact-title {
    font-size: clamp(2rem, 3vw, 2.5rem);
    margin-bottom: 1rem;
}

.contact-subtitle {
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.contact-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.1rem;
    transition: var(--transition-fast);
}

a.contact-link:hover {
    color: var(--primary-light);
    transform: translateX(5px);
}

.contact-link i {
    font-size: 1.5rem;
    color: var(--accent-color);
}

/* ─────────── FOOTER ─────────── */
.footer {
    border-top: var(--glass-border);
    padding: 2.5rem 0;
    margin-top: 4rem;
    background: rgba(5, 5, 5, 0.9);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer-logo {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.25rem;
    background: linear-gradient(135deg, var(--text-primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-socials {
    display: flex;
    gap: 1.25rem;
}

.footer-socials a {
    color: var(--text-secondary);
    font-size: 1.5rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.08);
}

.footer-socials a:hover {
    color: var(--text-primary);
    transform: translateY(-3px);
    border-color: var(--primary-light);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.2);
}

.footer-text {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ─────────── RESPONSIVE ─────────── */
@media (max-width: 768px) {
    :root {
        --section-padding: 4rem 0;
    }

    .nav-links {
        display: none;
    }
    .menu-btn {
        display: block;
    }

    .hero-title {
        letter-spacing: -1px;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

    .project-card {
        padding: 2rem;
    }

    .project-header {
        flex-direction: column;
        gap: 1rem;
    }

    .contact-box {
        padding: 2rem;
    }
}

@media screen and (max-width: 900px) {
    .timeline::after {
        left: 31px;
    }
    
    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
    }
    
    .timeline-item:nth-child(even) {
        left: 0%;
    }
    
    .timeline-item:nth-child(odd) .timeline-dot,
    .timeline-item:nth-child(even) .timeline-dot {
        left: 22px;
    }
}

/* ─────────── PARTICLE CANVAS ─────────── */
#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* ─────────── TYPING CURSOR ─────────── */
.cursor-blink {
    display: inline-block;
    font-weight: 300;
    animation: blink 1s step-end infinite;
    color: var(--primary-light);
    margin-left: 2px;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ─────────── STATS GRID ─────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 3rem 0;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-number {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    line-height: 1;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}