@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@300;400;500;600&family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

/* CSS Variables for theming */
:root {
    --primary: #3b82f6;
    --secondary: #64748b;
    --accent: #06b6d4;
    --background: #000000;
    --surface: rgba(255, 255, 255, 0.05);
    --surface-hover: rgba(255, 255, 255, 0.1);
    --text: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: #334155;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.2);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --gradient-primary: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-secondary: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    --gradient-accent: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--background);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Typography with gradient text effects */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    font-family: 'Space Grotesk', sans-serif;
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 3s ease-in-out infinite alternate;
}

h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 600;
    background: var(--gradient-secondary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

p {
    margin-bottom: 1rem;
}

/* Gradient text animation */
@keyframes gradientShift {
    0% {
        background: linear-gradient(135deg, #10b981 0%, #059669 100%);
        -webkit-background-clip: text;
        background-clip: text;
    }
    100% {
        background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
        -webkit-background-clip: text;
        background-clip: text;
    }
}

/* Icons with hover effects */
.icon {
    width: 1rem;
    height: 1rem;
    display: inline-block;
    transition: var(--transition);
}

.icon:hover {
    transform: scale(1.2) rotate(5deg);
    filter: drop-shadow(0 0 8px var(--primary));
}

/* Navbar with glassmorphism */
.navbar {
    position: sticky;
    top: 0;
    z-index: 50;
    width: 100%;
    border-bottom: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: var(--transition);
}

.navbar-container {
    max-width: 72rem;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--text);
    font-family: 'Space Grotesk', sans-serif;
    transition: var(--transition);
}

.navbar-brand:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 10px var(--primary));
}

.navbar-nav {
    display: none;
    gap: 1.5rem;
}

.navbar-nav a {
    font-size: 0.875rem;
    text-decoration: none;
    color: var(--text-secondary);
    transition: var(--transition);
    position: relative;
    padding: 0.5rem 0;
}

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

.navbar-nav a:hover {
    color: var(--text);
    transform: translateY(-2px);
}

.navbar-nav a:hover::after {
    width: 100%;
}

.navbar-toggle {
    display: block;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: var(--transition);
}

.navbar-toggle:hover {
    background: var(--surface-hover);
    transform: scale(1.05);
    box-shadow: var(--shadow);
}

.navbar-mobile {
    display: none;
    border-top: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
}

.navbar-mobile.active {
    display: block;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.navbar-mobile-content {
    max-width: 72rem;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    padding: 0.5rem 1rem;
}

.mobile-nav-link {
    padding: 0.5rem 0;
    font-size: 0.875rem;
    text-decoration: none;
    color: var(--text-secondary);
    text-transform: capitalize;
    transition: var(--transition);
}

.mobile-nav-link:hover {
    color: var(--text);
    padding-left: 1rem;
}

/* Main content */
.main-content {
    max-width: 72rem;
    margin: 0 auto;
    padding: 3rem 1rem 6rem;
}

/* Hero section with floating animations */
.hero {
    margin-bottom: 3rem;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 70%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 70% 30%, rgba(6, 182, 212, 0.1) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    33% {
        transform: translate(30px, -30px) rotate(120deg);
    }
    66% {
        transform: translate(-20px, 20px) rotate(240deg);
    }
}

.hero-content {
    display: grid;
    gap: 2rem;
    align-items: center;
}

.hero-text {
    animation: fadeInUp 0.8s ease-out;
}

.hero-title {
    margin-bottom: 0.5rem;
    animation: titleGlow 2s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    0% {
        filter: drop-shadow(0 0 5px rgba(59, 130, 246, 0.3));
    }
    100% {
        filter: drop-shadow(0 0 20px rgba(59, 130, 246, 0.6));
    }
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero-description {
    max-width: 42rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

.chip {
    display: inline-flex;
    align-items: center;
    border-radius: 9999px;
    border: 1px solid var(--border);
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--surface);
    color: var(--text-secondary);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

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

.chip:hover {
    color: var(--text);
    border-color: var(--primary);
    transform: translateY(-2px) scale(1.05);
    box-shadow: var(--shadow);
}

.chip:hover::before {
    left: 0;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
    animation: fadeInUp 0.8s ease-out 0.8s both;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 0.75rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

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

.btn-outline {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.btn-outline:hover::before {
    left: 0;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: var(--shadow-lg);
    filter: brightness(1.1);
}

.hero-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    animation: fadeInUp 0.8s ease-out 1s both;
}

.hero-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    text-decoration: none;
    color: var(--text-muted);
    transition: var(--transition);
}

.hero-link:hover {
    color: var(--primary);
    transform: translateY(-2px);
}

.hero-image {
    display: flex;
    justify-content: center;
    animation: fadeInUp 0.8s ease-out 1.2s both;
}

/* Cards with 3D transforms and micro-interactions */
.card {
    border-radius: 1rem;
    border: 1px solid var(--border);
    padding: 1.5rem;
    background: var(--surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform 0.5s ease;
}

.card:hover {
    transform: translateY(-8px) rotateX(5deg);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary);
}

.card:hover::before {
    transform: scaleX(1);
}

.card:active {
    transform: translateY(-4px) rotateX(2deg) scale(0.98);
    transition: var(--transition-fast);
}

.profile-image {
    aspect-ratio: 1;
    width: 100%;
    border-radius: 0.75rem;
    overflow: hidden;
    position: relative;
}

.profile-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.profile-image:hover::after {
    opacity: 0.1;
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0.75rem;
    transition: var(--transition);
}

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

/* Sections with scroll animations */
.section {
    margin-bottom: 3rem;
    scroll-margin-top: 6rem;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.section.animate {
    opacity: 1;
    transform: translateY(0);
}

.section-title {
    margin-bottom: 1.5rem;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 600;
    line-height: 1.2;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 2px;
    animation: expandLine 1s ease-out 0.5s both;
}

@keyframes expandLine {
    from {
        width: 0;
    }
    to {
        width: 60px;
    }
}

/* Prose */
.prose {
    max-width: none;
}

.prose p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.prose strong {
    font-weight: 600;
    color: var(--text);
}

.prose em {
    font-style: italic;
    color: var(--primary);
}

/* Projects with staggered animations */
.projects-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.projects-grid .card {
    animation: fadeInUp 0.6s ease-out both;
}

.projects-grid .card:nth-child(1) { animation-delay: 0.1s; }
.projects-grid .card:nth-child(2) { animation-delay: 0.2s; }
.projects-grid .card:nth-child(3) { animation-delay: 0.3s; }
.projects-grid .card:nth-child(4) { animation-delay: 0.4s; }

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
    transition: var(--transition);
}

.card:hover .card-title {
    color: var(--primary);
    transform: translateX(5px);
}

.card-description {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.card-highlights {
    list-style: none;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.card-highlights li {
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
    transition: var(--transition);
}

.card-highlights li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: bold;
    transition: var(--transition);
}

.card-highlights li:hover {
    color: var(--text);
    transform: translateX(5px);
}

.card-highlights li:hover::before {
    transform: translateX(-5px);
}

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

.card-link {
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--primary);
    position: relative;
    transition: var(--transition);
}

.card-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width 0.3s ease;
}

.card-link:hover {
    transform: translateY(-2px);
}

.card-link:hover::after {
    width: 100%;
}

/* Experience with timeline effect */
.experience-list {
    display: grid;
    gap: 1.5rem;
}

.experience-list .card {
    position: relative;
    padding-left: 2rem;
}

.experience-list .card::before {
    content: '';
    position: absolute;
    left: 0.75rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--gradient-primary);
    border-radius: 1px;
}

.experience-list .card::after {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 1.5rem;
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 0 4px var(--background), 0 0 0 6px var(--primary);
}

.experience-list .card .card-links {
    margin-top: 0.75rem;
}

.experience-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.experience-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
}

.experience-location {
    font-size: 0.875rem;
    color: var(--text-muted);
    background: var(--surface);
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
}

.experience-date {
    font-size: 0.875rem;
    color: var(--primary);
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.experience-bullets {
    list-style: none;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.experience-bullets li {
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
    transition: var(--transition);
}

.experience-bullets li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: bold;
}

.experience-bullets li:hover {
    color: var(--text);
    transform: translateX(5px);
}

/* Education & Skills */
.education-skills-grid {
    display: grid;
    gap: 1.5rem;
}

.education-list {
    list-style: none;
}

.education-item {
    margin-bottom: 0.75rem;
    padding: 1rem;
    background: var(--surface);
    border-radius: 0.5rem;
    border-left: 3px solid var(--primary);
    transition: var(--transition);
}

.education-item:hover {
    background: var(--surface-hover);
    transform: translateX(5px);
}

.education-school {
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: var(--text);
}

.education-detail {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.skills-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    list-style: none;
}

.skills-list li {
    font-size: 0.875rem;
    color: var(--text-secondary);
    padding: 0.5rem 0.75rem;
    background: var(--surface);
    border-radius: 0.375rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.skills-list li::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    opacity: 0.1;
    transition: left 0.5s ease;
}

.skills-list li:hover {
    color: var(--text);
    transform: translateX(5px);
}

.skills-list li:hover::before {
    left: 0;
}

/* Contact */
.contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    text-decoration: none;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    background: var(--surface);
    border-radius: 0.5rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

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

.contact-link:hover {
    color: var(--text);
    transform: translateY(-2px) scale(1.05);
    box-shadow: var(--shadow);
}

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

.contact-note {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Footer */
.footer {
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    background: var(--surface);
}

.footer-content {
    max-width: 72rem;
    margin: 0 auto;
    padding: 0 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
}

/* Loading states and animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Loading skeleton */
.loading {
    background: linear-gradient(90deg, var(--surface) 25%, var(--surface-hover) 50%, var(--surface) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Scroll animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Smooth scrolling offset for fixed navbar */
html {
    scroll-padding-top: 80px;
}

/* Focus states for accessibility */
button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--background);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Responsive design */
@media (min-width: 768px) {
    .navbar-nav {
        display: flex;
    }
    
    .navbar-toggle {
        display: none;
    }
    
    .hero-content {
        grid-template-columns: 2fr 1fr;
    }
    
    .projects-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 1fr 1fr;
    }
    
    .education-skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .skills-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .main-content {
        padding: 4rem 1rem 6rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 1fr 1fr;
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --border: #ffffff;
        --text-muted: #ffffff;
    }
}
