/* ===========================
   Design Tokens
   =========================== */
:root {
    --bg-main: #060918;
    --bg-section: #0b0f24;
    --bg-card: rgba(15, 20, 50, 0.6);
    --bg-card-hover: rgba(20, 28, 70, 0.7);
    --text-primary: #e8eaf6;
    --text-secondary: #8892b0;
    --accent-1: #6c63ff;
    --accent-2: #00d9ff;
    --accent-3: #ff6b9d;
    --gradient-primary: linear-gradient(135deg, #6c63ff, #00d9ff);
    --gradient-warm: linear-gradient(135deg, #ff6b9d, #ffb86c);
    --gradient-hero: linear-gradient(135deg, #6c63ff 0%, #00d9ff 50%, #ff6b9d 100%);
    --success: #00e676;
    --border: rgba(108, 99, 255, 0.15);
    --border-hover: rgba(108, 99, 255, 0.4);
    --glass: rgba(15, 20, 50, 0.5);
    --glass-border: rgba(108, 99, 255, 0.12);
    --font-main: 'Outfit', sans-serif;
    --transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-glow: 0 0 30px rgba(108, 99, 255, 0.15);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ===========================
   Animated Background Canvas
   =========================== */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ===========================
   Utility Classes
   =========================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 1;
}

.section {
    padding: 7rem 0;
    position: relative;
}

.section-alt {
    background: var(--bg-section);
}

.section-title {
    font-size: 2.2rem;
    margin-bottom: 3.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    position: relative;
    display: inline-block;
}

.title-accent {
    color: var(--accent-1);
    margin-right: 0.5rem;
    font-weight: 800;
}

.gradient-text {
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Glass Card */
.glass-card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--shadow-card);
    transition: var(--transition);
}

.glass-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-glow), var(--shadow-card);
    transform: translateY(-4px);
}

/* Scroll Reveal */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===========================
   Navbar
   =========================== */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(6, 9, 24, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 100;
    border-bottom: 1px solid var(--glass-border);
    transition: var(--transition);
}

nav.scrolled {
    background: rgba(6, 9, 24, 0.95);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.logo span {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    padding: 0.3rem 0;
}

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

.nav-links a:hover {
    color: var(--text-primary);
}

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

/* Mobile Toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition);
}

/* ===========================
   Hero Section
   =========================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 80px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -200px;
    right: -200px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(108, 99, 255, 0.12) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: heroGlow 8s ease-in-out infinite alternate;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -150px;
    left: -150px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(0, 217, 255, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: heroGlow 10s ease-in-out infinite alternate-reverse;
}

@keyframes heroGlow {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.2) translate(30px, -20px); }
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-text {
    z-index: 2;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(0, 230, 118, 0.08);
    color: var(--success);
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(0, 230, 118, 0.2);
    backdrop-filter: blur(8px);
}

.pulse-dot {
    font-size: 0.5rem;
    animation: pulse 2s ease-in-out infinite;
}

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

.hero h1 {
    font-size: 4.5rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.05;
    margin-bottom: 0.8rem;
}

.hero h2 {
    font-size: 1.5rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 1.5rem;
    letter-spacing: 0.02em;
}

.hero .bio {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 550px;
    margin-bottom: 2rem;
    line-height: 1.8;
}

.hero-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 3rem;
}

/* Hero Stats */
.hero-stats {
    display: flex;
    gap: 2.5rem;
}

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

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* Hero Image */
.hero-image {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
}

.image-wrapper {
    position: relative;
    width: 340px;
    height: 340px;
    border-radius: 50%;
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;
    position: relative;
    z-index: 2;
    border: 3px solid rgba(108, 99, 255, 0.3);
}

.image-glow {
    position: absolute;
    inset: -20px;
    border-radius: 50%;
    background: var(--gradient-hero);
    opacity: 0.25;
    filter: blur(40px);
    z-index: 0;
    animation: imageGlowPulse 4s ease-in-out infinite alternate;
}

@keyframes imageGlowPulse {
    0% { opacity: 0.2; transform: scale(1); }
    100% { opacity: 0.35; transform: scale(1.05); }
}

.image-ring {
    position: absolute;
    inset: -15px;
    border-radius: 50%;
    border: 1px solid rgba(108, 99, 255, 0.2);
    z-index: 1;
    animation: ringRotate 20s linear infinite;
}

.image-ring::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    width: 8px;
    height: 8px;
    background: var(--accent-1);
    border-radius: 50%;
    box-shadow: 0 0 12px var(--accent-1);
}

.ring-2 {
    inset: -30px;
    border-color: rgba(0, 217, 255, 0.12);
    animation-direction: reverse;
    animation-duration: 30s;
}

.ring-2::before {
    background: var(--accent-2);
    box-shadow: 0 0 12px var(--accent-2);
}

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

/* Floating Badges */
.floating-badge {
    position: absolute;
    padding: 0.5rem 1rem;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    z-index: 3;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.floating-badge i {
    color: var(--accent-1);
}

.badge-1 {
    top: 10%;
    right: -10%;
    animation: floatBadge 6s ease-in-out infinite;
}

.badge-2 {
    bottom: 15%;
    left: -5%;
    animation: floatBadge 7s ease-in-out infinite 1s;
}

.badge-3 {
    bottom: 5%;
    right: 0%;
    animation: floatBadge 5s ease-in-out infinite 2s;
}

@keyframes floatBadge {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-12px); }
}

/* ===========================
   Buttons
   =========================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.6rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    font-family: var(--font-main);
}

.btn-primary {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: 0 4px 20px rgba(108, 99, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(108, 99, 255, 0.45);
}

.btn-glass {
    background: var(--glass);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}

.btn-glass:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}

/* ===========================
   About Section
   =========================== */
.about-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.about-card {
    padding: 2rem;
    text-align: center;
}

.about-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #fff;
    margin: 0 auto 1.2rem;
}

.about-card h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
}

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

/* ===========================
   Skills Section
   =========================== */
.skills-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.skill-group {
    padding: 2rem;
}

.skill-group h3 {
    margin-bottom: 1.8rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.skill-group h3 i {
    color: var(--accent-1);
}

.skill-item {
    margin-bottom: 1.5rem;
}

.skill-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    font-weight: 500;
}

.skill-percent {
    color: var(--accent-2);
    font-weight: 600;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(108, 99, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.4rem;
}

.progress {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 4px;
    position: relative;
}

.progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.skill-meta {
    font-size: 0.78rem;
    color: var(--text-secondary);
    opacity: 0.8;
}

/* ===========================
   Projects Section
   =========================== */
.project-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.project-card {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.project-header {
    margin-bottom: 1rem;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
}

.tag-success {
    background: rgba(0, 230, 118, 0.1);
    color: var(--success);
    border: 1px solid rgba(0, 230, 118, 0.15);
}

.tag-primary {
    background: rgba(108, 99, 255, 0.1);
    color: var(--accent-1);
    border: 1px solid rgba(108, 99, 255, 0.15);
}

.project-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.project-card p {
    color: var(--text-secondary);
    font-size: 0.92rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
    line-height: 1.7;
}

.project-metrics {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.5rem;
    padding: 1rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.metric {
    display: flex;
    flex-direction: column;
}

.metric-value {
    font-size: 1.3rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.metric-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tech-stack span {
    background: rgba(108, 99, 255, 0.08);
    border: 1px solid rgba(108, 99, 255, 0.15);
    padding: 0.3rem 0.7rem;
    border-radius: 8px;
    font-size: 0.78rem;
    color: var(--accent-2);
    font-weight: 500;
    transition: var(--transition);
}

.tech-stack span:hover {
    background: rgba(108, 99, 255, 0.18);
    border-color: var(--accent-1);
}

/* ===========================
   Publications Section
   =========================== */
.publications-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.pub-card {
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.pub-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(108, 99, 255, 0.1);
    color: var(--accent-1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.pub-content {
    flex: 1;
}

.pub-content h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    line-height: 1.5;
}

.pub-venue {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.pub-venue i {
    color: var(--accent-3);
    font-size: 0.75rem;
}

.pub-doi {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--accent-2);
    text-decoration: none;
    margin-top: 0.4rem;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    background: rgba(0, 217, 255, 0.06);
    border: 1px solid rgba(0, 217, 255, 0.12);
    transition: var(--transition);
    font-weight: 500;
}

.pub-doi:hover {
    background: rgba(0, 217, 255, 0.14);
    border-color: var(--accent-2);
    color: #fff;
    transform: translateX(4px);
}

.pub-doi i {
    font-size: 0.7rem;
}

.pub-badge {
    background: var(--gradient-primary);
    color: #fff;
    padding: 0.3rem 0.8rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

/* ===========================
   Certificates Section
   =========================== */
.cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
}

.cert-card {
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1.2rem;
}

.cert-icon {
    background: rgba(108, 99, 255, 0.1);
    color: var(--accent-1);
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.cert-content h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.cert-issuer {
    font-size: 0.85rem;
    color: var(--accent-2);
    font-weight: 500;
    margin-bottom: 0.2rem;
}

.cert-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

/* ===========================
   Footer
   =========================== */
footer {
    border-top: 1px solid var(--border);
    padding: 5rem 0 2rem;
    background: var(--bg-main);
    position: relative;
}

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

.footer-top {
    margin-bottom: 4rem;
}

.footer-top h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -0.03em;
}

.footer-top p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 2rem;
}

.footer-links {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.copyright {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ===========================
   Responsive Design
   =========================== */
@media (max-width: 1024px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3rem;
    }

    .hero-text {
        order: 2;
    }

    .hero-image {
        order: 1;
    }

    .hero .bio {
        margin: 0 auto 2rem;
    }

    .hero-actions {
        justify-content: center;
    }

    .hero-stats {
        justify-content: center;
    }

    .image-wrapper {
        width: 280px;
        height: 280px;
    }

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

@media (max-width: 768px) {
    .hero h1 {
        font-size: 3rem;
    }

    .hero h2 {
        font-size: 1.2rem;
    }

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

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

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

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(6, 9, 24, 0.97);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 1.5rem 2rem;
        gap: 1rem;
        border-bottom: 1px solid var(--glass-border);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-toggle {
        display: flex;
    }

    .pub-card {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
    }

    .floating-badge {
        display: none;
    }

    .image-wrapper {
        width: 220px;
        height: 220px;
    }

    .section {
        padding: 4rem 0;
    }

    .hero-stats {
        gap: 1.5rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2.2rem;
    }

    .hero-actions {
        flex-wrap: wrap;
        justify-content: center;
    }

    .footer-links {
        flex-direction: column;
        align-items: center;
    }
}

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

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

::-webkit-scrollbar-thumb {
    background: rgba(108, 99, 255, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(108, 99, 255, 0.5);
}

/* ===========================
   Selection Color
   =========================== */
::selection {
    background: rgba(108, 99, 255, 0.3);
    color: #fff;
}