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

:root {
    --primary-bg: #0a0a0a;
    --secondary-bg: #111111;
    --accent-color: #3b82f6;
    --text-primary: #ffffff;
    --text-secondary: #a3a3a3;
    --text-muted: #525252;
    --border-color: #262626;
    --gradient-1: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    --gradient-2: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
}

body {
    background: var(--primary-bg);
    color: var(--text-primary);
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', sans-serif;
    font-weight: 400;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
}

/* ---- Lightweight Starfield (2 layers, transform-only anims) ---- */
body,
body::before,
body::after { --animation-speed: 1; }

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-repeat: repeat;
  will-change: transform;
}

/* Near stars (brighter, slightly larger dots) */
body::before {
  background-image:
    radial-gradient(2px 2px at 10% 20%, rgba(255,255,255,0.9), transparent),
    radial-gradient(2px 2px at 30% 70%, rgba(255,255,255,0.8), transparent),
    radial-gradient(2px 2px at 70% 30%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1.5px 1.5px at 85% 60%, rgba(255,255,255,0.8), transparent),
    radial-gradient(1.5px 1.5px at 55% 40%, rgba(255,255,255,0.7), transparent);
  background-size: 700px 400px, 800px 420px, 750px 380px, 820px 420px, 760px 380px;
  opacity: 0.85;
  animation: stars-near calc(50s / var(--animation-speed,1)) linear infinite;
}

/* Far stars (dimmer, slower) */
body::after {
  z-index: -2;
  background-image:
    radial-gradient(1px 1px at 25% 25%, rgba(255,255,255,0.35), transparent),
    radial-gradient(1px 1px at 75% 20%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1px 1px at 40% 80%, rgba(255,255,255,0.25), transparent),
    radial-gradient(1px 1px at 70% 60%, rgba(255,255,255,0.3), transparent);
  background-size: 1500px 900px, 1600px 950px, 1700px 1000px, 1400px 850px;
  opacity: 0.55;
  animation: stars-far calc(110s / var(--animation-speed,1)) linear infinite;
}

/* Transform-only animations (cheap to composite) */
@keyframes stars-near {
  from { transform: translate3d(0, -8vh, 0); }
  to   { transform: translate3d(-12vw, 12vh, 0); }
}
@keyframes stars-far {
  from { transform: translate3d(0, -4vh, 0); }
  to   { transform: translate3d(-6vw, 6vh, 0); }
}

/* Respect user preference + mobile safeguards */
@media (prefers-reduced-motion: reduce) {
  body::before, body::after { animation: none !important; }
}
@media (max-width: 768px) {
  body::before { opacity: .45; }
  body::after  { opacity: .35; }
}


@keyframes starfield-middle {
    0% { 
        transform: translateY(-20vh) translateX(10vw) rotate(0deg);
        opacity: 0.2;
    }
    25% {
        opacity: 0.4;
    }
    75% {
        opacity: 0.4;
    }
    100% { 
        transform: translateY(120vh) translateX(-15vw) rotate(5deg);
        opacity: 0.2;
    }
}

/* Scroll-based starfield enhancement - transforms are now included in main declarations above */

/* Add subtle motion blur effect when scrolling fast */
@media (prefers-reduced-motion: no-preference) {
    body::before {
        transition: filter 0.3s ease;
    }
    
    /* Shooting star effect on fast scroll */
    body.scrolling-fast::before {
        filter: blur(1px) brightness(1.2);
    }
}

/* Navigation */
nav {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    backdrop-filter: blur(20px);
    background: rgba(17, 17, 17, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 8px;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 4px;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

nav a:hover, nav a.active {
    color: var(--text-primary);
    background: rgba(59, 130, 246, 0.1);
}

/* Hero Section */
.hero {
    min-height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 0 5%;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 20%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: var(--gradient-1);
    border-radius: 50%;
    opacity: 0.1;
    filter: blur(100px);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #10b981;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 24px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

h1 {
    font-size: clamp(48px, 8vw, 96px);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 24px;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(20px, 3vw, 28px);
    color: var(--text-secondary);
    margin-bottom: 32px;
    max-width: 600px;
    font-weight: 300;
}

.cta-buttons {
    display: flex;
    gap: 16px;
    margin-bottom: 48px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--gradient-1);
    color: white;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}

/* Social Links */
.social-links {
    display: flex;
    gap: 16px;
    margin-bottom: 32px;
    justify-content: flex-start;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.social-link:hover {
    background: var(--gradient-1);
    border-color: rgba(59, 130, 246, 0.5);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

.social-link svg {
    transition: transform 0.3s ease;
}

.social-link:hover svg {
    transform: scale(1.1);
}

/* Sections */
section {
    padding: 100px 5%;
    max-width: 1200px;
    margin: 0 auto;
}

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

.section-title {
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 700;
    margin-bottom: 16px;
    background: var(--gradient-2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-description {
    color: var(--text-secondary);
    font-size: 18px;
    font-weight: 300;
    max-width: 600px;
    margin: 0 auto;
}

/* About Section */
.about-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
    max-width: 1200px;
    margin: 0 auto;
}

.about-content {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center; /* centers vertically */
    height: 100%; /* make sure the container has height */
}


.about-text {
    font-size: 18px;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 32px;
    position: relative;
    z-index: 1;
    font-weight: 300;
}

.highlight {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
    position: relative;
}

.highlight::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-1);
    opacity: 0.3;
    border-radius: 2px;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.stat-item {
    text-align: center;
    padding: 20px;
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stat-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
    transition: left 0.5s ease;
}

.stat-item:hover::before {
    left: 100%;
}

.stat-item:hover {
    transform: translateY(-4px);
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.1);
}

.stat-number {
    font-size: 24px;
    font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.about-visual {
    position: relative;
    height: auto;
    min-height: 400px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.profile-card {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 400px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent 0deg, var(--accent-color) 90deg, transparent 180deg, var(--accent-color) 270deg, transparent 360deg);
    animation: rotate 6s linear infinite;
    opacity: 0.1;
}

.profile-card:hover {
    transform: translateY(-8px);
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 25px 50px rgba(59, 130, 246, 0.15);
}

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

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: 700;
    color: white;
    margin: 0 auto 24px;
    position: relative;
    z-index: 1;
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.3);
    overflow: hidden;
    border: 3px solid;
    border-image: var(--gradient-1) 1;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.profile-avatar:hover img {
    transform: scale(1.05);
}

/* Fallback styling when no image is provided */
.profile-avatar:not(:has(img)) {
    background: var(--gradient-1);
}

/* Enhanced gradient border effect */
.profile-avatar::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: var(--gradient-1);
    border-radius: 50%;
    z-index: -1;
}

.profile-name {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.profile-role {
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

.quick-facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.fact-item {
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.1);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
}

.fact-icon {
    font-size: 20px;
    margin-bottom: 4px;
}

.fact-text {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.floating-elements {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.floating-icon {
    position: absolute;
    font-size: 24px;
    opacity: 0.1;
    animation: float-icon 8s ease-in-out infinite;
}

.floating-icon:nth-child(1) {
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.floating-icon:nth-child(2) {
    top: 20%;
    right: 10%;
    animation-delay: 2s;
}

.floating-icon:nth-child(3) {
    bottom: 20%;
    left: 5%;
    animation-delay: 4s;
}

.floating-icon:nth-child(4) {
    bottom: 10%;
    right: 15%;
    animation-delay: 6s;
}

@keyframes float-icon {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg);
        opacity: 0.1;
    }
    50% { 
        transform: translateY(-20px) rotate(10deg);
        opacity: 0.3;
    }
}

.education-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
    color: #8b5cf6;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-top: 16px;
}

.graduation-icon {
    font-size: 16px;
}

/* Experience Timeline */
.experience-timeline {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    padding-top: 20px;
}

.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, transparent 0%, var(--accent-color) 10%, var(--accent-color) 90%, transparent 100%);
    transform: translateX(-50%);
}

.experience-item {
    display: flex;
    margin-bottom: 60px;
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    animation: slideInUp 0.6s ease forwards;
}

/* Dynamic animation delays for any number of items */
.experience-item:nth-child(1) { animation-delay: 0.1s; }
.experience-item:nth-child(2) { animation-delay: 0.2s; }
.experience-item:nth-child(3) { animation-delay: 0.3s; }
.experience-item:nth-child(4) { animation-delay: 0.4s; }
.experience-item:nth-child(5) { animation-delay: 0.5s; }
.experience-item:nth-child(6) { animation-delay: 0.6s; }
.experience-item:nth-child(7) { animation-delay: 0.7s; }
.experience-item:nth-child(8) { animation-delay: 0.8s; }
.experience-item:nth-child(9) { animation-delay: 0.9s; }
.experience-item:nth-child(10) { animation-delay: 1.0s; }

/* Alternating layout - works for unlimited items */
.experience-item:nth-child(even) {
    flex-direction: row-reverse;
}

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

.experience-item:nth-child(even) {
    flex-direction: row-reverse;
}

.experience-content {
    flex: 1;
    max-width: 450px;
    margin: 0 30px;
}

.experience-item:nth-child(even) .experience-content {
    margin-left: 30px;
    margin-right: 30px;
}

.experience-card {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 32px;
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.experience-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: var(--gradient-1);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.experience-card:hover::before {
    opacity: 0.05;
}

.experience-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 25px 50px rgba(59, 130, 246, 0.15);
}

@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.3); }
    50% { box-shadow: 0 0 0 8px rgba(59, 130, 246, 0.1); }
}

.company-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.company-logo {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 24px;
    color: white;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.company-logo::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.2) 50%, transparent 70%);
    transform: rotate(45deg);
    transition: all 0.6s ease;
    opacity: 0;
}

.experience-card:hover .company-logo::before {
    opacity: 1;
    animation: shine 0.6s ease;
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.geico-logo { 
    background: var(--gradient-1);
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.4);
}

.ti-logo { 
    background: var(--gradient-2);
    box-shadow: 0 8px 32px rgba(6, 182, 212, 0.4);
}

.role-info h3 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.company-name {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 16px;
}

.duration {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 20px;
    padding: 6px 12px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 20px;
    display: inline-block;
    position: relative;
    z-index: 1;
    font-weight: 500;
}

.achievements {
    list-style: none;
    position: relative;
    z-index: 1;
}

.achievements li {
    color: var(--text-secondary);
    margin-bottom: 12px;
    padding: 12px 0 12px 32px;
    position: relative;
    transition: all 0.3s ease;
    border-radius: 8px;
    line-height: 1.6;
    font-weight: 300;
}

.achievements li:hover {
    color: var(--text-primary);
    background: rgba(59, 130, 246, 0.05);
    padding-left: 36px;
}

.achievements li::before {
    content: '';
    position: absolute;
    left: 8px;
    top: calc(12px + 0.8em);
    width: 8px;
    height: 8px;
    background: var(--gradient-1);
    border-radius: 50%;
    transform: translateY(-50%);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.6);
}

.achievements li::after {
    content: '';
    position: absolute;
    left: 5px;
    top: calc(12px + 0.8em);
    width: 12px;
    height: 12px;
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: 50%;
    transform: translateY(-50%);
    transition: all 0.3s ease;
}

.achievements li:hover::after {
    transform: translateY(-50%) scale(1.5);
    border-color: rgba(59, 130, 246, 0.6);
}

.stats-overlay {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(59, 130, 246, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-color);
    z-index: 1;
}

/* Optimized Skills Section */
.skills-container {
    max-width: 1000px;
    margin: 0 auto;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

.skill-category {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.skill-category::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: var(--gradient-1);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.skill-category:hover::before {
    opacity: 0.03;
}

.skill-category:hover {
    border-color: rgba(59, 130, 246, 0.4);
    transform: translateY(-4px);
    box-shadow: 0 15px 30px rgba(59, 130, 246, 0.1);
}

.skill-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.skill-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: var(--gradient-1);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.skill-category h3 {
    font-size: 18px;
    font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.skill-tag {
    background: rgba(59, 130, 246, 0.08);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid rgba(59, 130, 246, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.skill-tag:hover {
    background: rgba(59, 130, 246, 0.15);
    color: var(--text-primary);
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
}



/* Projects Grid */
/* Project Carousel Container */
.projects-carousel {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 60px;
}

.projects-container {
    overflow: hidden;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 100%;
}

.projects-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
    width: 300%; /* 100% * 3 cards */
}

.projects-track .project-card {
    width: 33.333%; /* Each card is 1/3 of the track width */
    min-width: 33.333%;
    max-width: 33.333%;
    flex-shrink: 0;
    opacity: 0.7;
    transform: scale(0.95);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.projects-track .project-card.active {
    opacity: 1;
    transform: scale(1);
}

/* Carousel Navigation Buttons */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border: none;
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.carousel-btn:hover {
    background: var(--gradient-1);
    border-color: rgba(59, 130, 246, 0.5);
    color: white;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 12px 40px rgba(59, 130, 246, 0.3);
}

.carousel-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.carousel-btn-prev {
    left: 0;
}

.carousel-btn-next {
    right: 0;
}

.carousel-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: translateY(-50%) scale(0.9);
}

.carousel-btn:disabled:hover {
    background: var(--secondary-bg);
    border-color: var(--border-color);
    color: var(--text-secondary);
    transform: translateY(-50%) scale(0.9);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Carousel Dots */
.carousel-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 32px;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border: none;
    border-radius: 50%;
    background: var(--border-color);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.carousel-dot::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.carousel-dot:hover {
    background: var(--text-secondary);
    transform: scale(1.2);
}

.carousel-dot.active {
    background: var(--accent-color);
    transform: scale(1.3);
}

.carousel-dot.active::before {
    border-color: rgba(59, 130, 246, 0.3);
    animation: pulse-dot 2s infinite;
}

.project-card {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 32px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: var(--gradient-1);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.project-card:hover::before {
    opacity: 0.03;
}

.project-card:hover {
    transform: translateY(-8px);
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 25px 50px rgba(59, 130, 246, 0.15);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.project-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: var(--gradient-1);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

.project-type {
    color: var(--text-muted);
    font-size: 14px;
    padding: 6px 12px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 20px;
    font-weight: 500;
}

.project-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    z-index: 1;
    overflow-wrap: break-word;
    word-wrap: break-word;
    max-width: 100%;
}

.project-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
    font-weight: 300;
    position: relative;
    z-index: 1;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    max-width: 100%;
    white-space: normal;
}

.project-tech {
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
    overflow-wrap: break-word;
    word-wrap: break-word;
    max-width: 100%;
}

.project-tech strong {
    color: var(--text-primary);
    font-weight: 600;
    margin-right: 8px;
}

.project-tech span {
    color: var(--text-secondary);
    font-weight: 400;
}

.project-links {
    display: flex;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.project-link {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-color);
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid rgba(59, 130, 246, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-link:hover {
    background: var(--gradient-1);
    color: white;
    border-color: rgba(59, 130, 246, 0.5);
    transform: translateY(-2px);
}

/* Contact Section */
.contact {
    text-align: center;
    padding: 100px 5% 60px;
}

.contact-cta {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-weight: 300;
}

/* Footer */
footer {
    text-align: center;
    padding: 40px 5%;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-weight: 300;
}

/* Responsive */
@media (max-width: 968px) {
    .about-container {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }

    .about-stats {
        grid-template-columns: repeat(3, 1fr);
    }

    .about-visual {
        height: auto;
    }

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

@media (max-width: 768px) {
    nav {
        position: relative;
        top: auto;
        right: auto;
        width: 100%;
        margin: 20px;
        border-radius: 16px;
    }

    nav ul {
        justify-content: center;
        flex-wrap: wrap;
    }

    .hero {
        text-align: center;
        align-items: center;
        padding: 40px 5%;
    }

    .social-links {
        justify-content: center;
    }

    .cta-buttons {
        justify-content: center;
    }

    section {
        padding: 60px 5%;
    }

    .timeline-line {
        left: 30px;
    }

    .experience-item {
        flex-direction: row !important;
        margin-left: 60px;
    }

    .experience-item:nth-child(even) {
        flex-direction: row !important;
    }

    .experience-content {
        margin: 0;
        max-width: none;
    }

    .experience-card {
        padding: 24px;
    }

    .company-logo {
        width: 48px;
        height: 48px;
        font-size: 18px;
    }

    .experience-card, .skill-category, .project-card {
        padding: 20px;
    }
    
    .projects-carousel {
        padding: 0 40px;
        max-width: 90vw;
    }
    
    .carousel-btn {
        width: 40px;
        height: 40px;
    }
    
    .project-card {
        padding: 20px;
    }
}

@media (max-width: 640px) {
    .about-stats {
        grid-template-columns: 1fr;
    }

    .quick-facts {
        grid-template-columns: 1fr;
    }

    .profile-card {
        padding: 24px;
    }

    .profile-avatar {
        width: 100px;
        height: 100px;
        font-size: 40px;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }
    
    .projects-carousel {
        padding: 0 30px;
        max-width: 95vw;
    }
    
    .carousel-btn {
        width: 36px;
        height: 36px;
    }
    
    .carousel-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .carousel-dots {
        margin-top: 24px;
    }
    
    .carousel-dot {
        width: 10px;
        height: 10px;
    }
    
    .project-card {
        padding: 16px;
    }
    
    .project-title {
        font-size: 20px;
    }
    
    .project-description {
        font-size: 14px;
    }
}

:root { --scroll-progress: 0; }

#progress-bar{
  position: fixed; top: 0; left: 0; height: 3px; width: 100%;
  z-index: 9999; pointer-events: none;
  background: linear-gradient(90deg,#3b82f6 0%,#8b5cf6 100%);
  transform: scaleX(var(--scroll-progress));
  transform-origin: 0 0;
  box-shadow: 0 2px 12px rgba(59,130,246,.45);
}

.experience-timeline,
.projects-carousel,
.skills-container {
  content-visibility: auto;
  contain-intrinsic-size: 800px; /* reserve space to avoid CLS */
}

@media (hover:hover) {
    .project-card:hover, .experience-card:hover, .skill-category:hover {
      transform: translateY(-8px) rotate3d(1,1,0, 1.5deg);
    }
}

html { scroll-behavior: smooth; }

/***** WebKit *****/
*::-webkit-scrollbar{ height:10px; width:10px; }
*::-webkit-scrollbar-track{ background:#0b0f1a; }
*::-webkit-scrollbar-thumb{
  background: linear-gradient(180deg,#3b82f6,#8b5cf6);
  border-radius:10px;
}
/***** Firefox *****/
*{ scrollbar-width: thin; scrollbar-color: #3b82f6 #0b0f1a; }

@media (prefers-reduced-motion: reduce) {
    .project-card:hover, .experience-card:hover, .skill-category:hover { transform: none; }
    .status-dot { animation: none; }
}
  
a {
background:
    linear-gradient(currentColor, currentColor) left bottom/0 2px no-repeat;
transition: background-size .25s ease;
}
a:hover { background-size: 100% 2px; }
  