@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;700&display=swap');

/* ============================================
   ROOT VARIABLES & RESET
   ============================================ */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea, #764ba2);
    --secondary-gradient: linear-gradient(135deg, #f093fb, #f5576c);
    --tertiary-gradient: linear-gradient(135deg, #4facfe, #00f2fe);
    --dark-gradient: linear-gradient(135deg, #1a1a2e, #16213e);
    --text-primary: #e4e4e7;
    --text-secondary: #a1a1aa;
    --bg-dark: #0a0a0f;
    --bg-darker: #050507;
    --accent-purple: #a855f7;
    --accent-blue: #3b82f6;
    --accent-pink: #ec4899;
    --white-03: rgba(255, 255, 255, 0.03);
    --white-05: rgba(255, 255, 255, 0.05);
    --white-08: rgba(255, 255, 255, 0.08);
    --white-1: rgba(255, 255, 255, 0.1);
    --white-2: rgba(255, 255, 255, 0.2);
    --white-3: rgba(255, 255, 255, 0.3);
    --glow-purple: rgba(168, 85, 247, 0.4);
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    /* scroll-behavior: smooth;  Disabled for custom smooth scroll */
    overflow: hidden; /* Disable native scroll */
    height: 100vh;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.8;
    background: var(--bg-dark);
    color: var(--text-primary);
    overflow: hidden; /* Disable native scroll */
    height: 100vh;
}

.scroll-container {
    width: 100%;
    will-change: transform;
    position: fixed;
    top: 0;
    left: 0;
    overflow: hidden;
}

/* ============================================
   ANIMATED PARTICLE BACKGROUND
   ============================================ */
#particles-canvas {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, #0a0a0f, #1a1a2e 50%, #0a0a0f);
}

/* ============================================
   FLOATING GEOMETRIC SHAPES
   ============================================ */
.floating-shapes {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
    animation: float 20s ease-in-out infinite;
}

.shape-1 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
    top: 10%;
    left: 10%;
    filter: blur(80px);
}

.shape-2 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-pink));
    top: 60%;
    right: 10%;
    filter: blur(100px);
    animation-delay: -5s;
}

.shape-3 {
    width: 250px;
    height: 250px;
    background: linear-gradient(135deg, var(--accent-pink), var(--accent-purple));
    bottom: 20%;
    left: 50%;
    filter: blur(90px);
    animation-delay: -10s;
}

.shape-4 {
    width: 350px;
    height: 350px;
    background: var(--primary-gradient);
    top: 40%;
    left: 70%;
    filter: blur(95px);
    animation-delay: -15s;
}

.shape-5 {
    width: 280px;
    height: 280px;
    background: var(--tertiary-gradient);
    bottom: 10%;
    right: 30%;
    filter: blur(85px);
    animation-delay: -7s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(50px, -50px) scale(1.1); }
    50% { transform: translate(-30px, -80px) scale(0.9); }
    75% { transform: translate(70px, -30px) scale(1.05); }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.container {
    width: min(90%, 1200px);
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   GLASS CARD EFFECT
   ============================================ */
.glass-card {
    background: var(--white-03);
    backdrop-filter: blur(20px);
    border: 1px solid var(--white-1);
    border-radius: 24px;
    padding: 40px;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-smooth);
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--white-3), transparent);
}

.glass-card:hover {
    background: var(--white-05);
    border-color: var(--white-2);
    transform: translateY(-5px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.card-glow {
    position: absolute;
    inset: -50%;
    background: radial-gradient(circle, var(--glow-purple), transparent 70%);
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
}

.glass-card:hover .card-glow {
    opacity: 0.3;
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 20px 0;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--white-1);
    transition: all var(--transition-smooth);
}

header.scrolled {
    padding: 15px 0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    background: rgba(10, 10, 15, 0.95);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-bracket {
    color: var(--accent-purple);
    font-size: 28px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

header nav ul {
    display: flex;
    list-style: none;
    gap: 40px;
    align-items: center;
}

header nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-smooth);
    position: relative;
}

header nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-gradient);
    transition: width var(--transition-smooth);
}

header nav a:hover {
    color: var(--text-primary);
}

header nav a:hover::after {
    width: 100%;
}

.nav-icon {
    font-size: 18px;
}

/* ============================================
   HERO SECTION
   ============================================ */
main {
    padding-top: 80px;
}

#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

#matrix-canvas {
    position: absolute;
    inset: 0;
    z-index: 1;
    opacity: 0.3;
}

.hero-gradient {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.15), transparent 50%);
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
}

.hero-text h2 {
    font-size: clamp(36px, 6vw, 72px);
    font-weight: 900;
    background: linear-gradient(135deg, #fff 0%, var(--accent-purple) 50%, var(--accent-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
    line-height: 1.2;
    animation: fadeInUp 1s ease-out;
}

/* Glitch Effect */
.glitch {
    position: relative;
    display: inline-block;
}

.glitch:hover::before,
.glitch:hover::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
}

.glitch:hover::before {
    animation: glitch-1 0.3s infinite;
    color: #00f2fe;
    z-index: -1;
}

.glitch:hover::after {
    animation: glitch-2 0.3s infinite;
    color: #f5576c;
    z-index: -2;
}

@keyframes glitch-1 {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
}

@keyframes glitch-2 {
    0%, 100% { transform: translate(0); }
    20%, 60% { transform: translate(2px, -2px); }
    40%, 80% { transform: translate(-2px, 2px); }
}

.hero-subtitle {
    font-size: clamp(18px, 2.5vw, 24px);
    color: var(--text-secondary);
    max-width: 800px;
    margin: 0 auto 50px;
    animation: fadeInUp 1s ease-out 0.2s backwards;
    line-height: 1.6;
}

.code-bracket {
    color: var(--accent-blue);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
}

/* Hero CTA Buttons */
.hero-cta {
    display: flex;
    gap: 20px;
    justify-content: center;
    animation: fadeInUp 1s ease-out 0.4s backwards;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all var(--transition-smooth);
}

.btn-primary {
    background: var(--primary-gradient);
    color: #fff;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.5);
}

.btn-primary .btn-arrow {
    transition: transform var(--transition-smooth);
}

.btn-primary:hover .btn-arrow {
    transform: translateX(5px);
}

.btn-secondary {
    background: var(--white-05);
    color: #fff;
    border: 2px solid var(--white-2);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: var(--white-1);
    border-color: var(--white-3);
    transform: translateY(-2px);
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    animation: fadeInUp 1s ease-out 0.6s backwards;
}

.mouse {
    width: 24px;
    height: 40px;
    border: 2px solid var(--white-3);
    border-radius: 20px;
    position: relative;
}

.wheel {
    width: 4px;
    height: 8px;
    background: #fff;
    border-radius: 2px;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    animation: scroll 2s ease-in-out infinite;
}

@keyframes scroll {
    0%, 100% { opacity: 0; transform: translate(-50%, 0); }
    50% { opacity: 1; transform: translate(-50%, 10px); }
}

.arrow-down {
    width: 10px;
    height: 10px;
    border-right: 2px solid var(--white-3);
    border-bottom: 2px solid var(--white-3);
    transform: rotate(45deg);
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: rotate(45deg) translateY(0); }
    50% { transform: rotate(45deg) translateY(10px); }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   SECTIONS
   ============================================ */
section {
    padding: 120px 0;
    position: relative;
}

.section-title {
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 800;
    text-align: center;
    margin-bottom: 80px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    position: relative;
}

.title-decoration {
    color: var(--accent-purple);
    font-family: 'JetBrains Mono', monospace;
    font-size: 40px;
}

.title-line {
    flex: 1;
    max-width: 100px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-purple), transparent);
}

/* ============================================
   ABOUT SECTION
   ============================================ */
#about {
    background: radial-gradient(circle at 30% 50%, rgba(102, 126, 234, 0.05) 0%, transparent 50%);
}

.about-content {
    max-width: 900px;
    margin: 0 auto;
}

.profile-section {
    display: flex;
    gap: 40px;
    margin-bottom: 40px;
    align-items: center;
    flex-wrap: wrap;
}

.profile-avatar {
    position: relative;
    width: 150px;
    height: 150px;
    flex-shrink: 0;
}

.avatar-ring {
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    background: var(--primary-gradient);
    animation: rotate 8s linear infinite;
    opacity: 0.6;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.avatar-placeholder {
    position: relative;
    width: 150px;
    height: 150px;
    background: var(--white-05);
    border: 3px solid var(--white-1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-placeholder svg {
    color: var(--accent-purple);
}

.profile-info {
    flex: 1;
    min-width: 300px;
}

.bio-text {
    font-size: 18px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.info-item {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--white-05);
    border-radius: 16px;
    transition: all var(--transition-smooth);
}

.info-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--white-1);
    transform: translateX(5px);
}

.info-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.info-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-purple);
    font-weight: 600;
    margin-bottom: 5px;
}

.info-value {
    font-size: 16px;
    color: var(--text-primary);
    font-weight: 600;
}

.research-interests {
    margin-top: 40px;
}

.subsection-title {
    font-size: 24px;
    margin-bottom: 25px;
    color: var(--text-primary);
}

.code-comment {
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-secondary);
    font-weight: 400;
    font-size: 18px;
}

.interests-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.interest-tag {
    padding: 12px 24px;
    background: var(--white-05);
    border: 1px solid var(--white-1);
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    transition: all var(--transition-smooth);
    cursor: default;
}

.interest-tag:hover {
    background: rgba(168, 85, 247, 0.2);
    border-color: var(--accent-purple);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(168, 85, 247, 0.2);
}

/* ============================================
   COURSES SECTION
   ============================================ */
#taught-courses {
    background: radial-gradient(circle at 70% 50%, rgba(245, 87, 108, 0.05) 0%, transparent 50%);
}

.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.course-card {
    padding: 40px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.course-card:hover {
    transform: translateY(-8px);
}

.course-icon {
    width: 80px;
    height: 80px;
    background: var(--white-05);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
    transition: all var(--transition-smooth);
}

.course-card:hover .course-icon {
    transform: scale(1.1) rotate(5deg);
    background: var(--white-1);
}

.course-card h4 {
    font-size: 24px;
    margin-bottom: 15px;
    color: var(--text-primary);
    font-weight: 700;
}

.course-card p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 25px;
    font-size: 16px;
}

.course-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.meta-badge {
    padding: 8px 16px;
    background: rgba(102, 126, 234, 0.15);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-purple);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   CONTACT SECTION
   ============================================ */
#contact {
    background: radial-gradient(circle at 50% 50%, rgba(79, 172, 254, 0.05) 0%, transparent 50%);
}

.contact-wrapper {
    max-width: 800px;
    margin: 0 auto;
}

.contact-card {
    padding: 50px;
}

.contact-grid {
    display: grid;
    gap: 40px;
}

.contact-item {
    display: flex;
    gap: 25px;
    align-items: flex-start;
    padding: 30px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--white-05);
    border-radius: 20px;
    transition: all var(--transition-smooth);
}

.contact-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--white-1);
    transform: translateX(10px);
}

.contact-icon {
    width: 60px;
    height: 60px;
    background: var(--primary-gradient);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: white;
}

.contact-info {
    flex: 1;
}

.contact-label {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-purple);
    font-weight: 700;
    margin-bottom: 8px;
}

.contact-value {
    font-size: 18px;
    color: var(--text-primary);
    font-weight: 600;
    text-decoration: none;
    transition: color var(--transition-smooth);
}

.contact-value:hover {
    color: var(--accent-purple);
}

/* ============================================
   FOOTER
   ============================================ */
footer {
    padding: 60px 0 40px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid var(--white-1);
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-purple), transparent);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-text {
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-secondary);
    font-size: 14px;
}

.footer-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: color var(--transition-smooth);
}

.footer-link:hover {
    color: var(--accent-purple);
}

.separator {
    color: var(--white-2);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
    .hero-cta {
        flex-direction: column;
        width: 100%;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    header nav ul {
        gap: 20px;
    }
    
    .nav-icon {
        display: none;
    }
    
    .profile-section {
        flex-direction: column;
        text-align: center;
    }
    
    .card-container {
        grid-template-columns: 1fr;
    }
    
    .section-title {
        font-size: 32px;
        flex-wrap: wrap;
    }
    
    .title-line {
        display: none;
    }
    
    .contact-card {
        padding: 30px 20px;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .scroll-to-top {
        bottom: 20px;
        right: 20px;
        width: 48px;
        height: 48px;
    }
    
    .scroll-to-top svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .logo-text {
        font-size: 18px;
    }
    
    .glass-card {
        padding: 25px;
    }
    
    section {
        padding: 80px 0;
    }
}

/* ============================================
   SMOOTH REVEAL ANIMATIONS
   ============================================ */
.fade-in {
    animation: fadeIn 1s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in-element {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    transition-delay: var(--reveal-delay, 0s);
    will-change: opacity, transform;
}

.fade-in-element.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   SCROLL TO TOP BUTTON
   ============================================ */
.scroll-to-top {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 56px;
    height: 56px;
    background: var(--primary-gradient);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.8);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.scroll-to-top:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.6);
}

.scroll-to-top:active {
    transform: translateY(-2px) scale(1.05);
}

.scroll-to-top svg {
    width: 24px;
    height: 24px;
    color: #fff;
    transition: transform 0.3s ease;
}

.scroll-to-top:hover svg {
    transform: translateY(-3px);
}

/* ============================================
   CUSTOM SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-darker);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--accent-purple), var(--accent-blue));
    border: 2px solid var(--bg-darker);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--accent-blue), var(--accent-pink));
}

/* ============================================
   SELECTION STYLING
   ============================================ */
::selection,
::-moz-selection {
    background: var(--accent-purple);
    color: #fff;
}
