::selection {
    background: var(--accent);
    color: #ffffff;
}

/* =========================================
   1. RESET & VARIABLES
   ========================================= */
:root {
    --bg-color: #0d1117;
    --card-bg: #161b22;
    --text-main: #e6edf3;
    --text-muted: #8b949e;
    --accent: #58a6ff;
    --accent-hover: #79c0ff;
    --border: #30363d;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px; /* FIX: Prevents titles from hiding behind navbar */
}

/* Custom Scrollbar - Desktop */
::-webkit-scrollbar {
    width: 10px;
    height: 10px; /* For horizontal scrolling */
}
::-webkit-scrollbar-track {
    background: var(--bg-color); 
}
::-webkit-scrollbar-thumb {
    background: #30363d; 
    border-radius: 5px;
    border: 2px solid var(--bg-color); /* Creates padding effect */
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent); 
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4 { 
    color: #fff; 
    font-weight: 700; 
    letter-spacing: -0.5px; 
}

a { text-decoration: none; transition: 0.3s; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 25px; }

/* =========================================
   2. HERO SECTION & ANIMATIONS
   ========================================= */
.hero {
    position: relative;
    min-height: 90svh; 
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 50% 30%, #1c2333 0%, #0d1117 70%);
    overflow: hidden;
}

.wave-background {
    position: absolute;
    bottom: -10px; left: 0; width: 100%; line-height: 0; z-index: 1; opacity: 0.7;
}
.wave-background img { width: 100%; display: block; }

.hero-content {
    position: relative; z-index: 10; text-align: center; padding-bottom: 0px !important;
}

/* --- Profile Picture with Floating Animation --- */
.profile-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 20px;
    animation: float 6s ease-in-out infinite; /* Floating Effect */
}
.profile-pic {
    width: 280px; height: 280px;
    border-radius: 50%;
    border: 6px solid var(--accent);
    box-shadow: 0 0 60px rgba(88, 166, 255, 0.3);
    object-fit: cover;
    background: #000;
}

/* Floating Keyframes */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-12px); }
    100% { transform: translateY(0px); }
}

/* --- Gradient Name Text --- */
.hero-text h1 { 
    font-size: 3.5rem; 
    margin-bottom: 10px; 
    letter-spacing: -1px; 
}
.gradient-text {
    background: linear-gradient(135deg, #ffffff 0%, var(--accent) 100%);
    background-clip: text; 
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.hero-text .tagline { font-size: 1.4rem; font-weight: 500; color: #fff; margin-bottom: 15px; }
.hero-text .sub-text { color: var(--text-muted); font-size: 1.1rem; margin: 0 auto 30px; line-height: 1.5; }
.hero-text .sub-text strong { color: var(--accent); }

/* --- Typewriter Cursor --- */
.typewriter-wrapper {
    min-height: 1.6em; /* Prevents layout shift */
}
.typewriter {
    color: var(--accent);
    border-right: 3px solid var(--accent);
    padding-right: 5px;
    animation: blink 0.75s step-end infinite;
}
@keyframes blink {
    from, to { border-color: transparent }
    50% { border-color: var(--accent) }
}

/* --- Contact Bar --- */
.contact-bar {
    display: flex; justify-content: center; gap: 15px; flex-wrap: wrap;
}
.social-btn {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 25px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}
.social-btn:hover { 
    background: var(--accent); 
    border-color: var(--accent); 
    transform: translateY(-3px); 
    box-shadow: 0 0 20px rgba(88, 166, 255, 0.4);
}
.social-btn i { font-size: 1.2rem; }

/* =========================================
   3. SECTIONS & CARDS
   ========================================= */
.section { 
    padding-top: 20px;    
    padding-bottom: 60px; 
    border-bottom: 1px solid var(--border); 
}
.section-title { font-size: 2rem; margin-top: 0; margin-bottom: 40px; text-align: center; }

/* --- About Grid --- */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.about-text p { color: var(--text-muted); margin-bottom: 25px; font-size: 1.1rem; }
.about-text strong { color: #fff; }

.hiring-note {
    background: rgba(88, 166, 255, 0.1);
    border-left: 4px solid var(--accent);
    padding: 15px;
    border-radius: 4px;
    color: var(--accent);
    font-weight: 500;
    margin-top: 20px;
    font-size: 1rem;
    display: flex; align-items: center; gap: 15px;
}
.hiring-note i { font-size: 1.5rem; }

.core-areas { display: flex; flex-direction: column; gap: 20px; }
.area-card {
    background: var(--card-bg); padding: 25px; border-radius: 12px; border: 1px solid var(--border);
    display: flex; gap: 20px; align-items: flex-start;
    transition: 0.3s;
}
.area-card:hover {
    box-shadow: 0 0 25px rgba(88, 166, 255, 0.15); /* GLOW EFFECT */
    border-color: var(--accent);
    transform: translateX(5px);
}
.area-card i { font-size: 2rem; color: var(--accent); margin-top: 5px; }
.area-card h4 { font-size: 1.2rem; margin-bottom: 5px; }
.area-card p { font-size: 0.95rem; color: var(--text-muted); margin: 0; }

/* --- Tech Stack Badges --- */
/* Add this specific rule to separate the rows */
.badge-row {
    margin-bottom: 40px; /* Pushes the next section down */
}

.badge-row h3 { 
    font-size: 1.2rem; color: var(--text-muted); margin-bottom: 15px; 
    border-bottom: 1px solid var(--border); padding-bottom: 10px; display: inline-block;
}
.badge-group { display: flex; flex-wrap: wrap; gap: 15px; }
.badge-group img { height: 35px; transition: transform 0.2s; }
.badge-group img:hover { transform: scale(1.15); } /* Pop effect */

/* =========================================
   4. TIMELINE (Experience)
   ========================================= */
.timeline { position: relative; max-width: 900px; margin: 0 auto; padding-left: 40px; }
.timeline::before {
    content: ''; position: absolute; left: 30px; top: 0; bottom: 0; width: 3px; background: var(--border);
}
.timeline-item { position: relative; margin-bottom: 50px; padding-left: 70px; }
.timeline-logo-wrapper {
    position: absolute; left: 0; top: 0;
    width: 60px; height: 60px; border-radius: 50%;
    background: #fff; border: 3px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    z-index: 2; overflow: hidden; padding: 5px;
}
.timeline-logo-wrapper img { width: 100%; height: auto; object-fit: contain; }

.timeline-content .date { 
    font-family: 'JetBrains Mono', monospace; font-size: 0.9rem; color: var(--accent); 
    display: block; margin-bottom: 5px; font-weight: 600; 
}
.timeline-content h3 { font-size: 1.4rem; margin-bottom: 5px; }
.timeline-content h4 { color: var(--text-muted); font-weight: 500; margin-bottom: 15px; font-size: 1.1rem; }
.timeline-content ul { padding-left: 18px; color: var(--text-main); }
.timeline-content li { margin-bottom: 10px; }
.tags { display: flex; gap: 10px; margin-bottom: 15px; }
.tags span { font-size: 0.8rem; background: var(--border); padding: 4px 10px; border-radius: 4px; }

/* =========================================
   5. PROJECTS & COMMUNITY CARDS
   ========================================= */
.projects-grid, .community-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 30px; }
.project-card, .comm-card {
    background: var(--card-bg); padding: 30px; border-radius: 12px; border: 1px solid var(--border);
    display: flex; flex-direction: column; transition: 0.3s;
}
.project-card:hover, .comm-card:hover { 
    transform: translateY(-5px); 
    border-color: var(--accent); 
    box-shadow: 0 0 25px rgba(88, 166, 255, 0.15); 
}

.card-head { display: flex; justify-content: space-between; margin-bottom: 15px; }
.card-head .icon { font-size: 2rem; color: var(--text-muted); }

/* --- FIX: Link Box Wrapping (No Overlap) --- */
.links {
    display: flex;
    flex-wrap: wrap;       /* WRAP: Allows dropping to new line */
    gap: 10px;             /* GAP: Vertical & Horizontal space */
    justify-content: flex-end; 
    max-width: 70%;        
}
.links a { 
    font-size: 0.9rem; color: var(--accent); font-weight: 600; 
    border: 1px solid var(--accent); padding: 5px 12px; border-radius: 4px;
    white-space: nowrap; margin-left: 0;
}
.links a:hover { background: var(--accent); color: #fff; text-decoration: none; }

.project-card h3, .comm-card h3 { margin-bottom: 10px; font-size: 1.3rem; }
.project-card p { color: var(--text-muted); flex-grow: 1; margin-bottom: 20px; font-size: 1rem; }
.tech-tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; }
.tech-tags img { height: 20px; }
.private-tag { font-size: 0.9rem; color: var(--text-muted); font-style: italic; }

.comm-card { flex-direction: row; gap: 20px; align-items: flex-start; }
.comm-card i { font-size: 2.5rem; margin-top: 5px; flex-shrink: 0; }
.gold i { color: #ffd700; } .blue i { color: #58a6ff; } .green i { color: #4caf50; } .purple i { color: #bb86fc; }
.comm-card p { color: var(--text-muted); margin: 0; }
.vol-tag {
    font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; font-weight: 700;
    color: var(--accent); display: block; margin-bottom: 5px; opacity: 0.8;
}

footer { text-align: center; padding: 50px 0; color: var(--text-muted); font-size: 0.9rem; }

/* =========================================
   6. NAVIGATION & UI CONTROLS
   ========================================= */
/* Navbar - Desktop */
.navbar {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: rgba(22, 27, 34, 0.85);
    backdrop-filter: blur(12px);
    padding: 10px 30px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    transition: 0.3s;
}
.nav-links {
    display: flex; gap: 30px; list-style: none; align-items: center;
}
.nav-links a {
    color: var(--text-muted); font-weight: 500; font-size: 0.95rem; position: relative;
}
.nav-links a:hover, .nav-links a.active-link {
    color: var(--accent);
}
.nav-btn {
    background: var(--accent); color: #fff !important; padding: 6px 16px; 
    border-radius: 20px; font-weight: 600 !important;
}
.nav-btn:hover { background: var(--accent-hover); transform: translateY(-2px); }
.cv-btn {
    background: transparent !important; border: 1px solid var(--accent); 
    color: var(--accent) !important; margin-right: -15px;
}
.cv-btn:hover { background: rgba(88, 166, 255, 0.1) !important; }

/* Back to Top Button */
.back-to-top {
    position: fixed; bottom: 30px; right: 30px;
    background: var(--accent); color: #fff;
    width: 45px; height: 45px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 10px rgba(88, 166, 255, 0.4);
    opacity: 0; pointer-events: none; transition: 0.3s;
    z-index: 999;
}
.back-to-top.visible { opacity: 1; pointer-events: auto; }
.back-to-top:hover { transform: translateY(-5px); background: var(--accent-hover); }

/* =========================================
   7. MOBILE RESPONSIVENESS
   ========================================= */
@media (max-width: 768px) {
    .about-grid { grid-template-columns: 1fr; }
    .hero-text h1 { font-size: 2.8rem; }
    .profile-pic { width: 220px; height: 220px; }
    
    .timeline { padding-left: 0; }
    .timeline::before { left: 29px; }
    .comm-card { flex-direction: column; text-align: center; align-items: center; }
    
    /* Mobile Navbar - Swipeable */
    .navbar {
        width: 95%; 
        padding: 10px 15px;
        bottom: 20px; /* Move to bottom for touch access */
        top: auto;    /* Disable top */
    }
    
    .nav-links {
        display: flex;
        gap: 20px;
        justify-content: flex-start; /* Left align for scroll */
        overflow-x: auto; /* Enable Horizontal Scroll */
        white-space: nowrap; /* Prevent Wrap */
        padding-bottom: 5px; 
        
        /* Hide scrollbars */
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
    .nav-links::-webkit-scrollbar { display: none; }
    
    .nav-links a { font-size: 0.9rem; padding: 5px 10px; }
}