:root {
    --background: #0a0c10;
    --foreground: #e6edf3;
    --card: rgba(22, 27, 34, 0.7); /* Glass effect */
    --card-hover: rgba(30, 35, 45, 0.9);
    --border: #30363d;
    --primary: #2f81f7; /* GitHub-like Blue */
    --primary-glow: #58a6ff;
    --secondary: #161b22;
    --accent: #d2a8ff; /* Purple accent */
    --muted-foreground: #8b949e;
    --radius: 12px;
}

/* Reset & Base Styles */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}
html { 
    scroll-behavior: smooth; 
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--background);
    color: var(--foreground);
    line-height: 1.6;
    background-image: 
        radial-gradient(at 0% 0%, rgba(47, 129, 247, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(210, 168, 255, 0.15) 0px, transparent 50%);
    background-attachment: fixed;
}

.container { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 0 1.5rem; 
}

/* Navbar with Glassmorphism */
#navbar {
    position: fixed; 
    top: 0; 
    left: 0; 
    right: 0; 
    z-index: 1000;
    background-color: rgba(10, 12, 16, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(48, 54, 61, 0.5);
    transition: all 0.3s ease;
}

#navbar .container { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    padding: 1rem 1.5rem; }

.logo {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    border: 2px solid var(--border);
    font-size: 1.25rem;
    font-weight: 800;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: 0.3s;
}

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

.nav-links a { 
    color: var(--muted-foreground); text-decoration: none; 
    font-weight: 500; 
    transition: 0.2s; 
    position: relative; 
}

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

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

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

/* Mobile Menu */
.mobile-menu-btn { 
    display: none; 
    flex-direction: column; 
    gap: 5px; 
    background: none; 
    border: none; 
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-btn span { 
    width: 25px; 
    height: 2px; 
    background: var(--foreground); 
    transition: 0.3s; 
}

.mobile-nav { 
    display: none; 
    flex-direction: column; 
    gap: 1rem; padding: 1.5rem; 
    background: var(--secondary); 
    border-top: 1px solid var(--border); 
    position: absolute; 
    width: 100%; 
    top: 100%; 
    left: 0; 
}

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

.mobile-nav a { 
    color: var(--muted-foreground); text-decoration: none; 
    font-size: 1.1rem; 
    font-weight: 500; 
    transition: 0.2s; 
}
@media (max-width: 768px) { .desktop-nav {  
    display: none; 
} 
.mobile-menu-btn { 
    display: flex; } 
}
    

/* Hero Section with Grid Background */
.hero {
    position: relative; 
    min-height: 100vh; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    padding: 6rem 1.5rem 4rem;
    background-image: 
    linear-gradient(rgba(48, 54, 61, 0.2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(48, 54, 61, 0.2) 1px, transparent 1px);
    background-size: 50px 50px;
}

.hero-content { 
    position: relative; 
    z-index: 2; 
    text-align: center; 
    max-width: 800px; 
}

.hero-greeting { 
    color: var(--primary); 
    font-weight: 600; 
    letter-spacing: 1px; 
    margin-bottom: 1rem; 
    text-transform: uppercase; 
    font-size: 0.9rem; 
}

.hero-name { 
    font-size: 4rem; 
    font-weight: 800; 
    margin-bottom: 1rem; 
    line-height: 1.1; 
}

.gradient-text {
    background: linear-gradient(to right, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-title { 
    font-size: 1.8rem; 
    color: var(--foreground); 
    margin-bottom: 1.5rem; 
}
.hero-description { 
    color: var(--muted-foreground); 
    font-size: 1.2rem; 
    max-width: 600px; 
    margin: 0 auto 2.5rem; 
    line-height: 1.6; 
}

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

.project-card {
    display: flex;
    flex-direction: column; /* Stacks content vertically */
    height: 100%;           /* Forces card to be as tall as its neighbor */
    justify-content: flex-start;
    position: relative;
}

/* Add gap between description and badges */
.project-card p {
    margin-bottom: 1rem; /* Increases space before the badges start */
    color: var(--muted-foreground);
    flex-grow: 1; /* Helps push content apart evenly */
}

/* Ensure badges have space before the buttons */
.project-card .skills-badges {
    margin-bottom: .2rem; /* Adds gap between badges and buttons */
}

/* Project Links Container */
.project-links {
    display: flex;
    gap: 1rem;
    justify-content: center; /* Centers the buttons in the card */
    /* margin-top: 1.5rem; */
    width: 100%;
    margin-top: auto;
    padding-top: 2rem;
}

/* The Button Styling Fix */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem; /* Perfect space between Icon and Text */
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    line-height: 1;
    min-width: 140px; /* Forces both buttons to have similar width */
    height: 45px; /* Fixed height for perfect alignment */
}

/* Fix SVG alignment inside buttons */
.btn svg {
    width: 18px;
    height: 18px;
    margin-top: -2px; /* Micro-adjustment to center icon with text */
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(47, 129, 247, 0.3);
}

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

.btn-outline:hover {
    border-color: var(--primary);
    background: rgba(47, 129, 247, 0.1);
}

@media (max-width: 480px) {
    .project-links {
        flex-direction: column; /* Stack buttons on very small phones */
    }
    .btn {
        width: 100%; /* Full width buttons */
    }
}

/* .btn {
    padding: 0.8rem 1.8rem; 
    border-radius: 50px; 
    font-weight: 600; 
    cursor: pointer; 
    text-decoration: none;
    transition: 0.3s; 
    display: inline-flex; 
    align-items: center; 
    gap: 0.5rem; border: none; 
    font-size: 1rem;
} */

/* .btn-primary { 
    background: var(--primary); 
    color: white; 
    box-shadow: 0 0 20px rgba(47, 129, 247, 0.3);
    margin-top: 13px;
} */

.btn-primary:hover { 
    transform: translateY(-3px); 
    box-shadow: 0 0 30px rgba(47, 129, 247, 0.5); 
}
/* .btn-outline { 
    background: transparent; 
    border: 1px solid var(--border); 
    color: var(--foreground); 
} */
/* .btn-outline:hover { 
    border-color: var(--foreground); 
    background: rgba(255,255,255,0.05); 
} */

.social-links { 
    display: flex; 
    gap: 1.5rem; 
    justify-content: center; 
    margin-top: 2rem; 
}
.social-links a { 
    color: var(--muted-foreground); 
    transition: 0.3s; 
    transform: scale(1); 
}
.social-links a:hover { 
    color: var(--primary); 
    transform: scale(1.2); 
}

/* Scroll Arrow */
.scroll-indicator { 
    position: absolute; 
    bottom: 3rem; 
    animation: bounce 2s infinite; 
    opacity: 0.6; 
}
.scroll-arrow { 
    width: 30px; 
    height: 50px; 
    border: 2px solid var(--muted-foreground); 
    border-radius: 20px; 
    position: relative; 
}
.scroll-arrow::before { 
    content: ''; 
    position: absolute; 
    top: 10px; 
    left: 50%; 
    transform: translateX(-50%); 
    width: 4px; 
    height: 8px; 
    background: var(--foreground); 
    border-radius: 2px; 
    animation: scroll 2s infinite; 
}

/* Sections */
.section { 
    padding: 6rem 1.5rem; 
    position: relative; 
}
.section-title { 
    font-size: 2.5rem; 
    text-align: center; 
    margin-bottom: 3rem; 
}
.section-title::after { 
    content: ''; 
    display: block; 
    width: 60px; 
    height: 4px; 
    background: var(--primary); 
    margin: 10px auto 0; 
    border-radius: 2px; 
}
/* Fix for the subtitle text */
.section-description {
    text-align: center;          /* Forces text to center */
    color: var(--muted-foreground);
    max-width: 600px;           /* Prevents it from getting too wide */
    margin: 0 auto 3rem auto;   /* Centers the block itself and adds bottom space */
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Glowing Cards */
.card {
    background: var(--card); 
    border: 1px solid var(--border); 
    padding: 2rem; 
    border-radius: var(--radius);
    transition: 0.3s; 
    position: relative; 
    overflow: hidden; 
    backdrop-filter: blur(10px);
}
.card:hover { 
    transform: translateY(-5px); 
    border-color: var(--primary); 
    box-shadow: 0 10px 40px -10px rgba(0,0,0,0.5); 
}

.card-icon { 
    color: var(--primary); 
    margin-bottom: 1rem; 
    font-size: 2rem; 
}
.card h3 { 
    margin-bottom: 0.8rem; 
    font-size: 1.4rem; 
}
.card p { 
    color: var(--muted-foreground); 
    font-size: 0.95rem; 
}

/* Grids */
.highlights-grid, .skills-grid, .projects-grid, .contact-grid {
    display: grid; 
    grid-template-columns: 
    repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 2rem;
}

/* About Me Grid - Perfectly Balanced */
.highlights-grid {
    display: grid;
    /* This creates a dynamic grid that fits as many as possible */
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

/* This simple trick makes the last card fill the empty space if it's alone on a row */
.highlights-grid .card:last-child:nth-child(odd) {
    grid-column: span 2; 
    /* Only spans 2 if the screen is wide enough for 2 columns but not 3 */
}

/* On very large screens (laptop), force 4 cards to be 2x2 or 4x1 depending on preference */
@media (min-width: 1024px) {
    .highlights-grid {
        /* Forces 4 columns on wide screens so they are all in one line */
        grid-template-columns: repeat(4, 1fr); 
    }
    
    /* Reset the span trick for wide screens */
    .highlights-grid .card:last-child:nth-child(odd) {
        grid-column: auto; 
    }
}

/* On Tablet (where it usually breaks to 3 and 1), force 2x2 */
@media (max-width: 1023px) and (min-width: 600px) {
    .highlights-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .highlights-grid .card:last-child:nth-child(odd) {
         grid-column: auto; /* No weird stretching needed in a 2x2 grid */
    }
}



/* Tech Stack - Uniform Cards */
.skills-grid {
    display: grid;
    /* This creates a dynamic grid */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 1.5rem;
}

/* Specific styles for Skill Cards */
.skill-card {
    display: flex;
    flex-direction: column;
    /* This forces all cards to be the same height */
    height: 100%; 
    min-height: 220px; 
    justify-content: flex-start;
}

.skill-category {
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    color: var(--accent);
}

.skills-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    justify-content: center; /* Centers badges inside the card */
}

/* Force a balanced 2x2 grid on Laptop/Desktop for better aesthetics */
@media (min-width: 1024px) {
    .skills-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columns x 2 rows */
    }
}

/* Skills */
.skill-category { 
    color: var(--accent); 
    margin-bottom: 1rem; 
    font-size: 1.1rem; 
    text-transform: uppercase; 
    letter-spacing: 1px; }

    /* Perfect Badge Alignment */
.skills-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem; /* Consistent spacing */
    justify-content: center; /* Keeps them perfectly centered */
    align-items: center;
    margin-top: auto; /* Pushes them to the bottom of the card content */
    width: 100%;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(47, 129, 247, 0.1);
    color: var(--primary-glow);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid rgba(47, 129, 247, 0.2);
    transition: all 0.2s ease;
    white-space: nowrap; /* Prevents text from breaking */
    line-height: 1; /* Fixes vertical text alignment */
}

.badge:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

/* Timeline/Experience - Redesigned for Alignment */
.timeline {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.timeline-item {
    position: relative;
    /* Create space inside the card for the line */
    padding-left: 3rem !important; 
    border-left: none !important; /* Remove the old outer border */
}

/* The Vertical Line (Now inside the card) */
.timeline-item::before {
    content: '';
    position: absolute;
    left: 1.5rem;      /* Positioned cleanly inside left padding */
    top: 2rem;         /* Starts below the top padding */
    bottom: 2rem;      /* Ends before the bottom padding */
    width: 2px;
    background: var(--border);
    border-radius: 2px;
}

/* The Ball (Now perfectly centered on the line) */
.timeline-item::after {
    content: '';
    position: absolute;
    left: 1.15rem;     /* Calculated to center over the 2px line */
    top: 2rem;         /* Aligns with the first line of text */
    width: 14px;
    height: 14px;
    background: var(--background);
    border: 3px solid var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(47, 129, 247, 0.2);
    z-index: 2;
    transition: all 0.3s ease;
}

/* Hover Effects */
.timeline-item:hover::after {
    background: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
    transform: scale(1.1);
}

.timeline-item:hover::before {
    background: var(--primary); /* Light up the line too */
}

.experience-header {
    display: flex;
    justify-content: space-between;
    align-items: center; /* Aligns date and title vertically */
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.company {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.95rem;
    display: block;
    margin-top: 0.25rem;
}

.period {
    font-family: 'Inter', monospace;
    color: var(--muted-foreground);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .timeline-item {
        padding-left: 2.5rem !important; /* Slightly less padding on mobile */
        padding-right: 1.5rem !important;
    }
    
    .timeline-item::before {
        left: 1rem;
    }
    
    .timeline-item::after {
        left: 0.65rem;
    }
    
    .experience-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .period {
        margin-top: 0.5rem;
        display: inline-block;
    }
}

/* Footer */
.footer { 
    padding: 3rem 1.5rem; 
    text-align: center; 
    border-top: 1px solid var(--border); background: var(--secondary); 
}

.footer-content { 
    display: flex; 
    flex-direction: column; 
    gap: 1.5rem; align-items: center; 
}

/* Animations */
@keyframes bounce { 
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);} 40% {transform: translateY(-10px);} 60% {transform: translateY(-5px);} 
}
@media (max-width: 768px) { .hero-name { font-size: 2.5rem; } .section-title { font-size: 2rem; } }

/* CTA Section - Fixed & Beautified */
.cta-section {
    text-align: center;
    max-width: 700px;
    margin: 4rem auto 0;
    padding: 3rem 2rem;
    
    /* Glassmorphism Card Style to match others */
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 40px -10px rgba(0,0,0,0.5);
    transition: transform 0.3s ease;
}

.cta-section:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}

.cta-section h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
    background: linear-gradient(to right, var(--foreground), var(--primary-glow));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.cta-section p {
    color: var(--muted-foreground);
    margin-bottom: 2.5rem;
    font-size: 1.1rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* Container for Button + Icons */
.cta-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

/* The Social Icons */
.social-links-inline {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    justify-content: center;
    margin-top: 0.5rem;
}

.social-links-inline a {
    color: var(--muted-foreground);
    transition: all 0.3s ease;
    display: flex; /* Ensures SVG centers in the link */
    padding: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
}

.social-links-inline a:hover {
    color: white;
    background: var(--primary);
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 0 15px var(--primary-glow);
}

/* Icon Size Fix */
.social-links-inline svg {
    width: 24px;
    height: 24px;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .cta-section {
        padding: 2rem 1.5rem;
        margin-top: 3rem;
        width: 100%;
    }
    
    .cta-section h3 {
        font-size: 1.5rem;
    }
    
    .social-links-inline {
        gap: 1rem;
    }
}