:root {
    /* Common variables */
    --primary: #3a86ff;
    --secondary: #8338ec;
    --success: #06d6a0;
    --warning: #ffd166;
    --danger: #ef476f;
    
    /* Dark theme (default) */
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --text-primary: #f8f9fa;
    --text-secondary: #e2e2e2;
    --card-bg: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.1);
    
    /* For backward compatibility */
    --dark: #1a1a2e;
    --light: #f8f9fa;
    
    /* Transition for theme switching */
    --transition-theme: all 0.4s ease;
}

/* Light theme */
[data-theme="light"] {
    --primary: #3a86ff;
    --secondary: #8338ec;
    
    --bg-primary: #f8f9fa;
    --bg-secondary: #e9ecef;
    --text-primary: #222;
    --text-secondary: #444;
    --card-bg: rgba(0, 0, 0, 0.03);
    --border-color: rgba(0, 0, 0, 0.1);
    
    /* For backward compatibility */
    --dark: #f8f9fa;
    --light: #222;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    transition: var(--transition-theme);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Theme Switch */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
    margin-right: 20px;
    z-index: 100;
}

.theme-switch {
    display: inline-block;
    position: relative;
    width: 60px;
    height: 30px;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    transition: .4s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 6px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    z-index: 2;
}

input:checked + .slider {
    background: linear-gradient(45deg, var(--secondary), var(--primary));
}

input:checked + .slider:before {
    transform: translateX(30px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

.slider .fa-moon {
    color: var(--text-primary);
    font-size: 14px;
    margin-right: 4px;
}

.slider .fa-sun {
    color: var(--warning);
    font-size: 14px;
    margin-left: 4px;
}

input:checked + .slider .fa-moon {
    color: var(--text-primary);
}

input:checked + .slider .fa-sun {
    color: var(--warning);
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    backdrop-filter: blur(10px);
    background-color: rgba(26, 26, 46, 0.8);
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition-theme);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
}

.logo span {
    color: var(--light);
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--light);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem 0;
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.4s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.nav-links a.active {
    color: var(--primary);
    font-weight: 600;
}

/* Special active indicator */
.nav-links a.active::before {
    content: '';
    position: absolute;
    left: -15px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--primary);
    opacity: 0;
    animation: fadeIn 0.5s forwards;
}

/* Animated Hamburger Menu */
.menu-toggle {
    display: none;
    cursor: pointer;
    z-index: 101;
    width: 40px;
    height: 40px;
}

.menu-toggle .ham {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 400ms;
    user-select: none;
    width: 30px;
    height: 30px;
}

.ham .line {
    fill: none;
    transition: stroke-dasharray 400ms, stroke-dashoffset 400ms;
    stroke: var(--text-primary);
    stroke-width: 5.5;
    stroke-linecap: round;
}

.hamRotate.open {
    transform: rotate(45deg);
}

.ham .top {
    stroke-dasharray: 40 139;
}
.ham .middle {
    stroke-dasharray: 40 121;
}
.ham .bottom {
    stroke-dasharray: 40 85;
}

.ham.open .top {
    stroke-dashoffset: -98px;
    stroke: var(--primary);
}
.ham.open .middle {
    stroke-dashoffset: -105px;
    stroke: var(--primary);
}
.ham.open .bottom {
    stroke-dashoffset: -98px;
    stroke: var(--primary);
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

/* Parallax Effects */
.parallax-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.parallax {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    will-change: transform;
}

/* Floating Tech Icons */
.floating-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.floating-icon {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--text-primary);
    opacity: 0.2;
    transition: all 0.3s ease;
    animation: float 8s infinite alternate;
}

.floating-icon:nth-child(odd) {
    color: var(--primary);
}

.floating-icon:nth-child(even) {
    color: var(--secondary);
}

.icon-1 {
    top: 15%;
    left: 10%;
    animation-delay: 0s;
    font-size: 3rem;
}

.icon-2 {
    top: 20%;
    right: 20%;
    animation-delay: 1s;
    font-size: 2.5rem;
}

.icon-3 {
    bottom: 30%;
    left: 15%;
    animation-delay: 2s;
    font-size: 2.8rem;
}

.icon-4 {
    bottom: 20%;
    right: 30%;
    animation-delay: 3s;
    font-size: 3.2rem;
}

.icon-5 {
    top: 50%;
    left: 30%;
    animation-delay: 4s;
    font-size: 2.4rem;
}

.hero-content {
    max-width: 700px;
    z-index: 1;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero h1 span {
    color: var(--primary);
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    line-height: 1.7;
    opacity: 0.9;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
}

.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    color: var(--light);
    box-shadow: 0 10px 20px rgba(58, 134, 255, 0.2);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 25px rgba(58, 134, 255, 0.3);
}

.btn-outline {
    background: transparent;
    color: var(--light);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background-color: var(--primary);
    color: var(--light);
    transform: translateY(-3px);
}

.hero-graphics {
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    opacity: 0.8;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
}

.blob-1 {
    width: 400px;
    height: 400px;
    background-color: var(--primary);
    top: 20%;
    right: 10%;
    animation: float 8s ease-in-out infinite;
}

.blob-2 {
    width: 300px;
    height: 300px;
    background-color: var(--secondary);
    bottom: 10%;
    right: 30%;
    animation: float 10s ease-in-out infinite;
    animation-delay: 1s;
}

@keyframes float {
    0% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-20px) scale(1.05);
    }
    100% {
        transform: translateY(0) scale(1);
    }
}

/* About Section */
.section {
    padding: 8rem 0;
    position: relative; /* Added for gradient mesh */
}

.section-header {
    text-align: center;
    margin-bottom: 5rem;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 4px;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    border-radius: 2px;
}

.section-subtitle {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
    opacity: 0.8;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-image {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.about-image img {
    width: 100%;
    height: auto;
    transform: scale(1.05);
    transition: transform 0.5s ease;
    display: block; /* Fix for potential bottom margin */
}

.about-image:hover img {
    transform: scale(1);
}

.about-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(58, 134, 255, 0.2), rgba(131, 56, 236, 0.2));
    z-index: 1;
}

.about-content h3 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

.about-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.skills {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
}

.skill-tag {
    background-color: rgba(58, 134, 255, 0.1);
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.skill-tag:hover {
    background-color: var(--primary);
    color: var(--light);
    transform: translateY(-3px);
}

/* Custom cursor styles */
.cursor-dot,
.cursor-dot-outline {
    pointer-events: none;
    position: fixed;
    top: 0;
    left: 0;
    border-radius: 50%;
    opacity: 0;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
    z-index: 9999;
}

.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: var(--primary);
    box-shadow: 0 0 10px var(--primary), 0 0 5px var(--primary);
}

.cursor-dot-outline {
    width: 40px;
    height: 40px;
    background-color: transparent;
    border: 2px solid var(--primary);
    transition: transform 0.3s ease, width 0.3s ease, height 0.3s ease, border-color 0.3s ease;
}

/* Add cursor state classes */
.cursor-hover {
    transform: translate(-50%, -50%) scale(1.5);
    background-color: transparent;
    border-color: var(--secondary);
}

.cursor-click {
    transform: translate(-50%, -50%) scale(0.8);
    background-color: var(--secondary);
    border-color: var(--secondary);
}

/* Hide default cursor when custom cursor is active */
body.custom-cursor {
    cursor: none;
}

body.custom-cursor a,
body.custom-cursor button,
body.custom-cursor input,
body.custom-cursor textarea,
body.custom-cursor .btn,
body.custom-cursor .nav-links a,
body.custom-cursor .theme-switch,
body.custom-cursor .project-card,
body.custom-cursor .blog-card,
body.custom-cursor .social-link,
body.custom-cursor .menu-toggle,
body.custom-cursor .slider {
    cursor: none;
}

/* Gradient Mesh Background */
.gradient-mesh-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1; /* Set to -1 to be behind content */
    opacity: 0.6;
    pointer-events: none;
}

.gradient-mesh {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 10% 10%, transparent 0%, transparent 30%, var(--primary) 70%);
    filter: blur(60px);
    mix-blend-mode: screen;
    opacity: 0.2;
    transform-origin: center center;
    animation: rotateGradient 20s infinite alternate ease-in-out;
}

.gradient-mesh:nth-child(2) {
    background: radial-gradient(circle at 80% 30%, transparent 0%, transparent 30%, var(--secondary) 70%);
    animation: rotateGradient 25s infinite alternate-reverse ease-in-out;
    opacity: 0.3;
}

.gradient-mesh:nth-child(3) {
    background: radial-gradient(circle at 50% 80%, transparent 0%, transparent 30%, var(--success) 70%);
    animation: rotateGradient 30s infinite alternate ease-in-out;
    opacity: 0.2;
}

.gradient-mesh:nth-child(4) {
    background: radial-gradient(circle at 20% 60%, transparent 0%, transparent 30%, var(--warning) 70%);
    animation: rotateGradient 35s infinite alternate-reverse ease-in-out;
    opacity: 0.15;
}

@keyframes rotateGradient {
    0% {
        transform: scale(1) rotate(0deg);
    }
    50% {
        transform: scale(1.5) rotate(180deg);
    }
    100% {
        transform: scale(1) rotate(360deg);
    }
}

/* Apply different gradient styles for light theme */
[data-theme="light"] .gradient-mesh {
    mix-blend-mode: multiply;
    opacity: 0.2;
}


/* NEW PROJECT SECTION STYLES 
  (Replaced all the old .project-showcase, .project-carousel, etc. styles)
*/
.project-grid {
    display: grid;
    /* This is the same responsive grid as your blog */
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 4rem;
}

.project-card {
    /* Copied from .blog-card for a consistent, cool look */
    background-color: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    cursor: pointer;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.project-card-image {
    height: 220px;
    overflow: hidden;
}

.project-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-card:hover .project-card-image img {
    transform: scale(1.1);
}

.project-card-content {
    padding: 1.5rem;
}

.project-card-title {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    /* Clamp title to 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 2.6em; /* 1.3em * 2 lines */
}

.project-card-description {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    opacity: 0.8;
    /* Clamp description to 3 lines */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 4.2em; /* 1.4em * 3 lines (approx) */
}

.project-card-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tech-tag {
    /* This style is now used by the project cards */
    background-color: rgba(58, 134, 255, 0.1);
    color: var(--primary);
    padding: 0.3rem 0.7rem;
    border-radius: 4px;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}
/* END OF NEW PROJECT STYLES */


/* Project details modal (Kept all these styles) */
.project-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.project-modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: var(--bg-secondary);
    width: 80%;
    max-width: 1000px;
    max-height: 80vh;
    overflow-y: auto;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    position: relative;
    transform: translateY(50px);
    opacity: 0;
    transition: all 0.5s ease;
}

.project-modal.active .modal-content {
    transform: translateY(0);
    opacity: 1;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.modal-close:hover {
    background-color: var(--danger);
    color: white;
    transform: rotate(90deg);
}

.modal-image {
    width: 100%;
    height: 400px;
    overflow: hidden;
    border-radius: 20px 20px 0 0;
}

.modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-body {
    padding: 2rem;
}

.modal-title {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.modal-description {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 2rem;
    color: var(--text-secondary);
}

.modal-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 2rem;
}

.modal-tech .tech-tag {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.modal-links {
    display: flex;
    gap: 1.5rem;
    margin-top: 2rem;
}

.modal-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    background-color: var(--primary);
    color: white;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(58, 134, 255, 0.3);
}

.modal-link:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(58, 134, 255, 0.4);
}

.modal-link i {
    font-size: 1.2rem;
}

/* Interactive Timeline */
.timeline-section {
    padding: 6rem 0;
    background-color: rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.timeline-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    position: relative;
}

.timeline-title {
    text-align: center;
    margin-bottom: 4rem;
    position: relative;
}

.timeline-title h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.timeline-title h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 4px;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    border-radius: 2px;
}

.timeline-title p {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
    opacity: 0.8;
}

.timeline {
    position: relative;
    display: flex;
    flex-direction: column;
    margin: 2rem 0;
}

/* Timeline center line */
.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary), var(--secondary));
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    display: flex;
    width: 100%;
    margin-bottom: 3rem;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

/* Left and right positioning */
.timeline-item:nth-child(even) {
    justify-content: flex-end;
}

.timeline-content {
    position: relative;
    width: calc(50% - 40px);
    max-width: 500px;
    background: var(--card-bg);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    z-index: 1;
    transition: all 0.4s ease;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.timeline-content::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: linear-gradient(135deg, rgba(58, 134, 255, 0.1) 0%, rgba(131, 56, 236, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    border-radius: 15px;
    z-index: -1;
}

.timeline-content:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.timeline-content:hover::before {
    opacity: 1;
}

/* Timeline dots */
.timeline-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 0 15px rgba(58, 134, 255, 0.5);
    z-index: 2;
    transition: all 0.4s ease;
}

.timeline-item:hover .timeline-icon {
    transform: translate(-50%, -50%) scale(1.2);
    box-shadow: 0 0 20px rgba(58, 134, 255, 0.7);
}

/* Timeline content elements */
.timeline-date {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.timeline-title-item {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.timeline-location {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.timeline-location i {
    margin-right: 0.5rem;
    color: var(--primary);
}

.timeline-description {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.timeline-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.timeline-skill {
    background-color: rgba(58, 134, 255, 0.1);
    color: var(--primary);
    padding: 0.3rem 0.8rem;
    border-radius: 30px;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.timeline-skill:hover {
    background-color: var(--primary);
    color: white;
    transform: translateY(-3px);
}

/* Timeline item types - different colors for education vs experience */
.timeline-item.education .timeline-icon {
    background: linear-gradient(45deg, var(--primary), var(--warning));
}

.timeline-item.experience .timeline-icon {
    background: linear-gradient(45deg, var(--secondary), var(--success));
}

/* Animation states */
.timeline-item {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease;
}

.timeline-item.animate {
    opacity: 1;
    transform: translateY(0);
}

.timeline-item:nth-child(even) .timeline-content {
    transform: translateX(50px);
}

.timeline-item:nth-child(odd) .timeline-content {
    transform: translateX(-50px);
}

.timeline-item.animate:nth-child(even) .timeline-content,
.timeline-item.animate:nth-child(odd) .timeline-content {
    transform: translateX(0);
}

/* Timeline controls */
.timeline-controls {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
    gap: 1rem;
}

.timeline-control {
    padding: 0.5rem 1.5rem;
    background-color: rgba(58, 134, 255, 0.1);
    color: var(--primary);
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.timeline-control:hover {
    background-color: var(--primary);
    color: white;
    transform: translateY(-3px);
}

.timeline-control.active {
    background-color: var(--primary);
    color: white;
}

/* Live Code Editor */
.code-editor-section {
    padding: 6rem 0;
    background-color: var(--bg-secondary);
    position: relative;
    overflow: hidden;
}

.code-editor-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.code-editor-title {
    text-align: center;
    margin-bottom: 3rem;
}

.code-editor-title h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.code-editor-title h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 4px;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    border-radius: 2px;
}

.code-editor-title p {
    font-size: 1.1rem;
    max-width: 700px;
    margin: 0 auto;
    opacity: 0.8;
}

.code-editor-wrapper {
    position: relative;
    background-color: var(--bg-primary);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.code-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--border-color);
}

.code-editor-tabs {
    display: flex;
    gap: 0.5rem;
}

.code-editor-tab {
    background-color: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.code-editor-tab.active {
    background-color: var(--primary);
    color: white;
}

.code-editor-tab:hover:not(.active) {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.code-editor-actions {
    display: flex;
    gap: 0.5rem;
}

.code-editor-action {
    background-color: transparent;
    border: none;
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.code-editor-action:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.code-editor-action.run {
    background-color: var(--success);
    color: white;
}

.code-editor-action.run:hover {
    background-color: var(--success);
    opacity: 0.9;
    transform: translateY(-2px);
}

.code-editor-main {
    display: flex;
    height: 500px;
}

.editor-panel {
    flex: 1;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.editor-code {
    width: 100%;
    height: 100%;
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    line-height: 1.5;
    padding: 1rem;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border: none;
    resize: none;
    outline: none;
    tab-size: 4;
}

.editor-preview {
    width: 100%;
    height: 100%;
    background-color: white;
    border: none;
}

.editor-output {
    padding: 1rem;
    background-color: rgba(0, 0, 0, 0.3);
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    overflow-y: auto;
    max-height: 200px;
    border-top: 1px solid var(--border-color);
}

.editor-output-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.error-message {
    color: var(--danger);
}

.success-message {
    color: var(--success);
}

/* Code snippets */
.code-snippets {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

.code-snippet {
    background-color: var(--card-bg);
    border-radius: 10px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.code-snippet:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.code-snippet h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.code-snippet p {
    font-size: 0.9rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    opacity: 0.8;
}

.code-snippet-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.code-snippet-tag {
    background-color: rgba(58, 134, 255, 0.1);
    color: var(--primary);
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    font-size: 0.8rem;
}

/* Line numbers */
.code-editor-lines {
    position: absolute;
    top: 0;
    left: 0;
    padding: 1rem 0.5rem;
    background-color: rgba(0, 0, 0, 0.2);
    color: var(--text-secondary);
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    line-height: 1.5;
    user-select: none;
    text-align: right;
    border-right: 1px solid var(--border-color);
    opacity: 0.7;
    height: 100%;
    overflow: hidden;
}

.code-editor-code-with-lines {
    padding-left: 50px; /* Increased padding */
}

/* Split view */
.editor-panel.split-view {
    display: flex;
}

.editor-panel.split-view .code-editor-code-with-lines {
    width: 50%;
    resize: horizontal;
}

.editor-panel.split-view .editor-preview {
    width: 50%;
    height: 100%;
}

/* Blog Section */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.blog-card {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.blog-image {
    height: 200px;
    overflow: hidden;
}

.blog-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.blog-card:hover .blog-image img {
    transform: scale(1.1);
}

.blog-content {
    padding: 1.5rem;
}

.blog-date {
    font-size: 0.9rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
    display: block;
}

.blog-title {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--light);
}

.blog-excerpt {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    opacity: 0.8;
}

.read-more {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: gap 0.3s ease;
}

.read-more:hover {
    gap: 0.5rem;
}

/* Contact Section */
.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.contact-info h3 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

.contact-info p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--light);
    text-decoration: none;
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.contact-link:hover {
    color: var(--primary);
}

.contact-link i {
    color: var(--primary);
    font-size: 1.2rem;
}

.contact-form {
    background-color: rgba(255, 255, 255, 0.05);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.form-group {
    margin-bottom: 1.5rem;
    position: relative; /* Added for label animation */
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.form-group::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.4s ease;
    z-index: 0;
}

.form-group:focus-within::after {
    width: 100%;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(58, 134, 255, 0.1);
}

.form-group:focus-within label {
    color: var(--primary);
    transform: translateY(-2px);
}

textarea.form-control {
    min-height: 150px;
    resize: vertical;
}

/* Footer */
footer {
    padding: 4rem 0;
    background-color: rgba(0, 0, 0, 0.3);
    margin-top: 5rem;
}

.footer-container {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 4rem;
}

.footer-col h4 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-col h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background-color: var(--primary);
}

.footer-about p {
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    opacity: 0.8;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--light);
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-link:hover {
    background-color: var(--primary);
    transform: translateY(-3px);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: var(--light);
    text-decoration: none;
    font-size: 1rem;
    opacity: 0.8;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.footer-links a:hover {
    opacity: 1;
    color: var(--primary);
    transform: translateX(5px);
}

.copyright {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Observer-based animations */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.slide-in {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.active,
.slide-in.active {
    opacity: 1;
    transform: translateY(0) translateX(0);
}


/* Particle animation */
#particles-js {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0;
}

/* Three.js canvas */
.hero-3d-element {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.7;
}

/* Typing animation */
.typing {
    position: relative;
}

.typing::after {
    content: "|";
    position: absolute;
    right: -8px;
    width: 8px;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

/* Glow effect */
.glow {
    text-shadow: 0 0 10px rgba(58, 134, 255, 0.5), 
                 0 0 20px rgba(58, 134, 255, 0.3), 
                 0 0 30px rgba(58, 134, 255, 0.2);
}

/* Utility Classes */
.text-center {
    text-align: center;
}

/* Responsive adjustments */
@media screen and (max-width: 1024px) {
    .hero h1 {
        font-size: 3rem;
    }
    
    .about-grid,
    .contact-container {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .footer-container {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }
    
    .blob-1 {
        width: 300px;
        height: 300px;
    }
    
    .blob-2 {
        width: 200px;
        height: 200px;
    }
}

@media screen and (max-width: 768px) {
    body {
        overflow-x: hidden;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 300px;
        height: 100vh;
        background: rgba(26, 26, 46, 0.95);
        backdrop-filter: blur(10px);
        flex-direction: column;
        padding: 6rem 2rem 2rem;
        transition: all 0.5s cubic-bezier(0.77, 0.2, 0.05, 1.0);
        z-index: 100;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.3);
        border-left: 1px solid rgba(255, 255, 255, 0.05);
    }
    
    .nav-links.active {
        right: 0;
    }
    
    .nav-links li {
        opacity: 0;
        transform: translateX(50px);
        transition: all 0.4s ease;
        margin-bottom: 1.5rem;
    }
    
    .nav-links.active li {
        opacity: 1;
        transform: translateX(0);
    }
    
    /* Staggered animation for menu items */
    .nav-links.active li:nth-child(1) { transition-delay: 0.1s; }
    .nav-links.active li:nth-child(2) { transition-delay: 0.2s; }
    .nav-links.active li:nth-child(3) { transition-delay: 0.3s; }
    .nav-links.active li:nth-child(4) { transition-delay: 0.4s; }
    .nav-links.active li:nth-child(5) { transition-delay: 0.5s; }
    .nav-links.active li:nth-child(6) { transition-delay: 0.6s; }
    .nav-links.active li:nth-child(7) { transition-delay: 0.7s; }
    .nav-links.active li:nth-child(8) { transition-delay: 0.8s; } /* Added for new link */
    
    .nav-links a {
        font-size: 1.2rem;
        display: block;
        padding: 0.5rem 0;
    }
    
    .nav-links a::after {
        height: 3px;
    }
    
    /* Overlay */
    .menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 99;
        visibility: hidden;
        opacity: 0;
        transition: all 0.3s ease;
    }
    
    .menu-overlay.active {
        visibility: visible;
        opacity: 1;
    }
    
    /* Other mobile styles */
    .hero {
        padding-top: 70px;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero p {
        font-size: 1.1rem;
    }
    
    .section {
        padding: 6rem 0;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .cta-buttons {
        flex-direction: column;
    }
    
    /* Timeline responsive */
    .timeline::before {
        left: 20px; /* Adjusted */
    }
    
    .timeline-item {
        flex-direction: column;
        width: 100%;
    }
    
    .timeline-item:nth-child(even) {
        justify-content: flex-start;
    }

    .timeline-content {
        width: 100%;
        max-width: none;
        margin-left: 40px; /* Pushed content to the right of the line */
    }

    .timeline-item:nth-child(even) .timeline-content,
    .timeline-item:nth-child(odd) .timeline-content {
        width: calc(100% - 40px); /* Adjusted width */
        transform: translateX(0);
    }
    
    .timeline-icon {
        left: 20px; /* Adjusted */
        transform: translate(-50%, -50%);
    }
    
    .timeline-item.animate:nth-child(even) .timeline-content,
    .timeline-item.animate:nth-child(odd) .timeline-content {
        transform: translateY(0);
    }
    
    /* Project showcase responsive (DELETED) */
    
    .modal-content {
        width: 95%;
    }
    
    .modal-image {
        height: 250px;
    }
    
    /* Code editor responsive */
    .code-editor-main {
        flex-direction: column;
        height: auto;
    }
    
    .editor-panel {
        height: 300px;
    }
    
    .editor-panel.split-view {
        flex-direction: column;
    }
    
    .editor-panel.split-view .editor-code,
    .editor-panel.split-view .editor-preview {
        width: 100%;
        height: 250px;
    }
    
    .code-editor-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .code-editor-tabs {
        width: 100%;
        justify-content: center;
    }
    
    .code-editor-actions {
        width: 100%;
        justify-content: center;
    }
    
    /* Disable custom cursor on mobile */
    .cursor-dot,
    .cursor-dot-outline {
        display: none !important;
    }
    
    body.custom-cursor {
        cursor: auto;
    }
    
    body.custom-cursor a,
    body.custom-cursor button,
    body.custom-cursor input,
    body.custom-cursor textarea,
    body.custom-cursor .btn,
    body.custom-cursor .nav-links a,
    body.custom-cursor .theme-switch,
    body.custom-cursor .project-card,
    body.custom-cursor .blog-card,
    body.custom-cursor .social-link,
    body.custom-cursor .menu-toggle,
    body.custom-cursor .slider {
        cursor: auto;
    }
}
/* Scroll to Top Button */
.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    text-decoration: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 100;
    opacity: 0; /* Hidden by default */
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s ease;
}

/* This class will be added by JavaScript when you scroll */
.scroll-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

@media screen and (max-width: 576px) {
    /* .projects-grid is already covered by .blog-grid */
    .blog-grid,
    .code-snippets,
    .project-grid {
        grid-template-columns: 1fr;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .btn {
        width: 100%;
        text-align: center;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .section-subtitle {
        font-size: 1rem;
    }
    
    .footer-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .about-content {
        text-align: center;
    }

    .skills {
        justify-content: center;
    }
}