/* ═══════════════════════════════════════════════════════════
   DESIGN SYSTEM — CSS Variables & Reset
   ═══════════════════════════════════════════════════════════ */

:root {
    /* Colors */
    --bg-primary: #0a0a0f;
    --bg-secondary: #111118;
    --bg-card: #16161e;
    --bg-card-hover: #1c1c28;
    --bg-glass: rgba(22, 22, 30, 0.7);

    --text-primary: #e8e8ef;
    --text-secondary: #9595a8;
    --text-muted: #5f5f75;

    --accent-start: #8b5cf6;
    /* Purple */
    --accent-mid: #6366f1;
    /* Indigo */
    --accent-end: #06b6d4;
    /* Cyan */

    --gradient: linear-gradient(135deg, var(--accent-start), var(--accent-mid), var(--accent-end));
    --gradient-text: linear-gradient(135deg, var(--accent-start), var(--accent-end));

    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(139, 92, 246, 0.3);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 64px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(139, 92, 246, 0.15);

    /* Typography */
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: 'Space Grotesk', 'Inter', sans-serif;

    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    --text-5xl: 3rem;
    --text-6xl: 3.75rem;

    /* Spacing */
    --section-padding: 6rem 0;
    --container-max: 1200px;
    --container-padding: 0 1.5rem;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

ul,
ol {
    list-style: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.2;
}

/* Utility */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: var(--container-padding);
}

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

.section {
    padding: var(--section-padding);
    position: relative;
}

.section-title {
    font-size: var(--text-4xl);
    text-align: center;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: var(--text-lg);
    margin-bottom: 3.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ═══════════════════════════════════════════════════════════
   NAVBAR
   ═══════════════════════════════════════════════════════════ */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1rem 0;
    transition: var(--transition-base);
    backdrop-filter: blur(0px);
}

.navbar.scrolled {
    padding: 0.65rem 0;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.nav-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: var(--container-padding);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    transition: var(--transition-base);
}

.logo-bracket {
    color: var(--accent-start);
    font-weight: 400;
}

.nav-logo:hover {
    color: var(--accent-start);
}

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

.nav-link {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition-base);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient);
    transition: var(--transition-base);
    border-radius: var(--radius-full);
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.hamburger {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    position: relative;
    transition: var(--transition-base);
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    left: 0;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition-base);
}

.hamburger::before {
    top: -7px;
}

.hamburger::after {
    top: 7px;
}

.nav-toggle.active .hamburger {
    background: transparent;
}

.nav-toggle.active .hamburger::before {
    transform: rotate(45deg);
    top: 0;
}

.nav-toggle.active .hamburger::after {
    transform: rotate(-45deg);
    top: 0;
}

/* ═══════════════════════════════════════════════════════════
   HERO SECTION
   ═══════════════════════════════════════════════════════════ */

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

#particleCanvas {
    width: 100%;
    height: 100%;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 1;
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 2;
    padding: 2rem 1.5rem;
}

.hero-greeting {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
}

.hero-name {
    font-size: clamp(2.5rem, 8vw, var(--text-6xl));
    font-weight: 700;
    margin-bottom: 0.75rem;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-start) 50%, var(--accent-end) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-title-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    margin-bottom: 1.25rem;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
    font-weight: 500;
    color: var(--accent-start);
}

.hero-cursor {
    font-weight: 300;
    color: var(--accent-start);
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

.hero-tagline {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2.5rem;
    line-height: 1.8;
}

.hero-ctas {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2.5rem;
}

.hero-socials {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    transition: var(--transition-base);
}

.social-link:hover {
    color: var(--accent-start);
    border-color: var(--accent-start);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.2);
}

/* Scroll indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    z-index: 2;
    animation: float 2s ease-in-out infinite;
}

.scroll-indicator span {
    font-size: var(--text-xs);
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.mouse {
    width: 24px;
    height: 38px;
    border: 2px solid var(--text-muted);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    padding-top: 6px;
}

.mouse-wheel {
    width: 3px;
    height: 8px;
    background: var(--text-muted);
    border-radius: var(--radius-full);
    animation: scroll-wheel 1.5s ease-in-out infinite;
}

@keyframes scroll-wheel {
    0% {
        transform: translateY(0);
        opacity: 1;
    }

    100% {
        transform: translateY(12px);
        opacity: 0;
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    50% {
        transform: translateX(-50%) translateY(-8px);
    }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.75rem;
    border-radius: var(--radius-full);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
    border: none;
    text-decoration: none;
}

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

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

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

.btn-outline:hover {
    border-color: var(--accent-start);
    color: var(--accent-start);
    transform: translateY(-2px);
}

.btn-full {
    width: 100%;
    justify-content: center;
}

/* ═══════════════════════════════════════════════════════════
   ABOUT SECTION
   ═══════════════════════════════════════════════════════════ */

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.about-text p {
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    font-size: var(--text-base);
    line-height: 1.8;
}

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

.about-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.75rem;
    text-align: center;
    transition: var(--transition-base);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient);
    opacity: 0;
    transition: var(--transition-base);
}

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

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

.stat-number {
    font-family: var(--font-heading);
    font-size: var(--text-3xl);
    font-weight: 700;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-suffix {
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
    font-weight: 700;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    display: block;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* ═══════════════════════════════════════════════════════════
   SKILLS SECTION
   ═══════════════════════════════════════════════════════════ */

.skills {
    background: var(--bg-secondary);
}

.skills-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.skill-category {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: var(--transition-base);
}

.skill-category:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-glow);
}

.skill-category-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.skill-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(6, 182, 212, 0.1));
    color: var(--accent-start);
    flex-shrink: 0;
}

.skill-category h3 {
    font-size: var(--text-lg);
    font-weight: 600;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-tag {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    transition: var(--transition-base);
    cursor: default;
}

.skill-tag:hover {
    background: rgba(139, 92, 246, 0.15);
    border-color: var(--accent-start);
    color: var(--text-primary);
    transform: translateY(-1px);
}

/* ═══════════════════════════════════════════════════════════
   CAPABILITIES SECTION (What I Build)
   ═══════════════════════════════════════════════════════════ */

.capabilities-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.capability-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: var(--transition-slow);
    position: relative;
    overflow: hidden;
}

.capability-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient);
    opacity: 0;
    transition: var(--transition-base);
}

.capability-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-6px);
    box-shadow: var(--shadow-glow);
}

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

.capability-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.12), rgba(6, 182, 212, 0.08));
    color: var(--accent-start);
    margin-bottom: 1.25rem;
}

.capability-card h3 {
    font-size: var(--text-lg);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.capability-card p {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    line-height: 1.7;
    margin-bottom: 1.25rem;
}

.capability-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.capability-tech span {
    font-size: var(--text-xs);
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.impact-badge {
    display: inline-block;
    font-size: var(--text-xs);
    font-weight: 600;
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(6, 182, 212, 0.12));
    border: 1px solid rgba(139, 92, 246, 0.25);
    color: var(--accent-end);
    letter-spacing: 0.02em;
}

/* ═══════════════════════════════════════════════════════════
   EXPERIENCE TIMELINE
   ═══════════════════════════════════════════════════════════ */

.experience {
    background: var(--bg-secondary);
}

.timeline {
    position: relative;
    max-width: 700px;
    margin: 3rem auto 0;
    padding-left: 3rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent-start), var(--accent-end), transparent);
}

.timeline-item {
    position: relative;
    margin-bottom: 2.5rem;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -3rem;
    top: 0.25rem;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: 3px solid var(--accent-start);
    transform: translateX(-6px);
    z-index: 1;
    transition: var(--transition-base);
}

.timeline-item:hover .timeline-marker {
    background: var(--accent-start);
    box-shadow: 0 0 16px rgba(139, 92, 246, 0.4);
}

.timeline-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem 1.75rem;
    transition: var(--transition-base);
}

.timeline-content:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-glow);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.25rem;
    flex-wrap: wrap;
}

.timeline-header h3 {
    font-size: var(--text-lg);
    font-weight: 600;
}

.timeline-company {
    font-size: var(--text-sm);
    font-weight: 600;
    padding: 0.2rem 0.75rem;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.12), rgba(6, 182, 212, 0.08));
    color: var(--accent-start);
    white-space: nowrap;
}

.timeline-date {
    font-size: var(--text-sm);
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.75rem;
}

.timeline-content p {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    line-height: 1.7;
}

/* ═══════════════════════════════════════════════════════════
   BLOG SECTION
   ═══════════════════════════════════════════════════════════ */

.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.blog-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition-slow);
    display: flex;
    flex-direction: column;
}

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

.blog-card-thumb {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(6, 182, 212, 0.1));
}

.blog-card-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.blog-card-date {
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.blog-card-title {
    font-size: var(--text-lg);
    font-weight: 600;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-excerpt {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.6;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 1rem;
}

.blog-card-link {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--accent-start);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: var(--transition-base);
}

.blog-card-link:hover {
    color: var(--accent-end);
    gap: 0.6rem;
}

.blog-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.loading-spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--accent-start);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

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

.blog-empty {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
}

.blog-empty svg {
    color: var(--text-muted);
    margin: 0 auto 1.25rem;
}

.blog-empty h3 {
    font-size: var(--text-xl);
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.blog-empty p {
    margin-bottom: 1.5rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.blog-cta {
    text-align: center;
    margin-top: 2.5rem;
}

/* ═══════════════════════════════════════════════════════════
   CONTACT SECTION
   ═══════════════════════════════════════════════════════════ */

.contact {
    background: var(--bg-secondary);
}

.contact-cards-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    max-width: 900px;
    margin: 0 auto;
}

.contact-card-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
    padding: 2rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: var(--transition-slow);
    text-decoration: none;
}

.contact-card-link:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}

.contact-card-link svg {
    color: var(--accent-start);
}

.contact-card-link h4 {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
}

.contact-card-link span {
    font-size: var(--text-xs);
    color: var(--text-muted);
    word-break: break-all;
}

/* ═══════════════════════════════════════════════════════════
   FLOATING CHATBOT WIDGET
   ═══════════════════════════════════════════════════════════ */

.chat-widget {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
}

/* FAB Button */
.chat-fab {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gradient);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 25px rgba(139, 92, 246, 0.35);
    transition: var(--transition-base);
    position: relative;
    z-index: 10;
}

.chat-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.5);
}

.chat-fab-close {
    display: none;
}

.chat-widget.open .chat-fab-icon {
    display: none;
}

.chat-widget.open .chat-fab-close {
    display: block;
}

/* Chat Popup */
.chat-popup {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 400px;
    height: 520px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: none;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    animation: chatPopupIn 0.3s ease forwards;
}

.chat-widget.open .chat-popup {
    display: flex;
}

@keyframes chatPopupIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Chat Popup Header */
.chat-popup-header {
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(6, 182, 212, 0.05));
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.chat-popup-header-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chat-popup-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(6, 182, 212, 0.2));
    color: var(--accent-start);
    border: 1px solid rgba(139, 92, 246, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-popup-header h4 {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
}

.chat-popup-header span {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

/* Chat Messages */
.chat-box {
    flex: 1;
    padding: 1.25rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-box::-webkit-scrollbar {
    width: 5px;
}

.chat-box::-webkit-scrollbar-track {
    background: transparent;
}

.chat-box::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

.chat-message {
    display: flex;
    gap: 0.75rem;
    max-width: 85%;
    animation: fadeInMsg 0.3s ease forwards;
}

@keyframes fadeInMsg {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

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

.bot-message {
    align-self: flex-start;
}

.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bot-message .message-avatar {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(6, 182, 212, 0.2));
    color: var(--accent-start);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.user-message .message-avatar {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.message-content {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    line-height: 1.6;
}

.bot-message .message-content {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-top-left-radius: 4px;
}

.user-message .message-content {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(6, 182, 212, 0.1));
    color: var(--text-primary);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-top-right-radius: 4px;
}

.chat-message .message-content p {
    margin-bottom: 0.4rem;
}

.chat-message .message-content p:last-child {
    margin-bottom: 0;
}

/* Chat Input */
.chat-input-wrapper {
    display: flex;
    padding: 0.75rem;
    gap: 0.5rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

#chatInput {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 0.65rem 1rem;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    outline: none;
    transition: var(--transition-base);
}

#chatInput:focus {
    border-color: var(--accent-start);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.15);
}

.chat-send-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--gradient);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-base);
    flex-shrink: 0;
}

.chat-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 0.75rem;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* ═══════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════ */

.footer {
    padding: 2rem 0;
    border-top: 1px solid var(--border);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-content p {
    color: var(--text-muted);
    font-size: var(--text-sm);
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text-muted);
    font-size: var(--text-sm);
    transition: var(--transition-base);
}

.footer-links a:hover {
    color: var(--accent-start);
}

/* ═══════════════════════════════════════════════════════════
   SCROLL REVEAL ANIMATION
   ═══════════════════════════════════════════════════════════ */

.reveal-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-up.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE DESIGN
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
    .capabilities-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    :root {
        --section-padding: 4rem 0;
    }

    .section-title {
        font-size: var(--text-3xl);
    }

    .section-subtitle {
        font-size: var(--text-base);
        margin-bottom: 2.5rem;
    }

    /* Navbar mobile */
    .nav-toggle {
        display: block;
    }

    .nav-links {
        display: none;
        position: fixed;
        top: 0;
        right: 0;
        width: 280px;
        height: 100vh;
        background: var(--bg-secondary);
        flex-direction: column;
        padding: 5rem 2rem 2rem;
        gap: 0.5rem;
        border-left: 1px solid var(--border);
        box-shadow: var(--shadow-lg);
    }

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

    .nav-link {
        font-size: var(--text-base);
        padding: 0.75rem 0;
    }

    /* About */
    .about-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

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

    /* Capabilities */
    .capabilities-grid {
        grid-template-columns: 1fr;
    }

    /* Blog */
    .blog-grid {
        grid-template-columns: 1fr;
    }

    /* Contact */
    .contact-cards-row {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Floating Chat */
    .chat-popup {
        width: calc(100vw - 2rem);
        right: -1rem;
        height: 480px;
    }

    /* Footer */
    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    /* Timeline */
    .timeline {
        padding-left: 2rem;
    }

    .timeline-marker {
        left: -2rem;
    }

    .timeline-header {
        flex-direction: column;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .hero-ctas {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .about-stats {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .stat-card {
        padding: 1.25rem;
    }
}