/* --- Variables & Theme Configuration --- */
:root {
    /* Modern Palette */
    --bg-color: #e3eff8;  
    --card-bg: #fdfeff;   
    
    /* Text Colors */
    --primary-text: #2d3436;
    --secondary-text: #636e72;

    /* Electric Ocean (Brighter, Tech/Crypto feel) */
    --accent-gradient: linear-gradient(135deg, #005bea, #00b0f0);
    --accent-solid: #005bea;
    
    /* Spacing & Borders */
    --radius-lg: 20px;
    --radius-sm: 8px;
    
    /* Shadows */
    --shadow-soft: 0 10px 30px -5px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 20px 40px -5px rgba(0, 0, 0, 0.12);
    
    /* Typography */
    --font-main: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-heading: 'Poppins', sans-serif;
    
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* --- Global Smooth Scrolling --- */
html {
    scroll-behavior: smooth;
    overscroll-behavior-y: none;
}

/* --- Base Styles --- */
body {
    font-family: var(--font-main);
    color: var(--primary-text);
    line-height: 1.7;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* --- Background Layer --- */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    
    background-color: var(--bg-color);
    background-image: 
        url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='5' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E"),
        radial-gradient(circle at 10% 20%, rgba(9, 132, 227, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(116, 185, 255, 0.05) 0%, transparent 40%);

    will-change: transform;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
}

/* --- Glassmorphism Navigation (UPDATED) --- */
nav {
    background: rgba(255, 255, 255, 0.85); 
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    
    /* Reduced padding here to lower the bar height */
    padding: 0.7rem 2rem; 
    
    border-bottom: 1px solid rgba(255,255,255,0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}

nav a {
    color: var(--primary-text);
    text-decoration: none;
    margin: 0 0.6rem;         /* Slight adjustment */
    
    /* Reduced padding here to make the blue box smaller */
    padding: 0.4rem 0.9rem;   
    
    font-weight: 600;
    font-size: 0.95rem;
    position: relative;
    transition: var(--transition);
    border-radius: var(--radius-sm);
}

/* Shared styles for Hover state AND Active class */
nav a:hover,
nav a.active {
    color: var(--accent-solid);
    background-color: rgba(0, 91, 234, 0.08); 
}

/* Animated Underline */
nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0px; 
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-gradient);
    transition: width 0.3s ease;
}

/* Trigger underline on Hover AND Active class */
nav a:hover::after,
nav a.active::after {
    width: 70%; /* Reduced width slightly so it doesn't touch edges of the smaller box */
}

/* --- Layout Container --- */
.container {
    display: flex;
    max-width: 1600px; 
    margin: 3rem auto;
    padding: 0 3rem;
    gap: 3rem;
    align-items: flex-start;
}

/* --- Sidebar --- */
.sidebar {
    flex: 1;
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    text-align: center;
    position: sticky;
    top: 6rem;
    border: 1px solid rgba(255,255,255,0.6);
}

.profile-pic {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1.5rem;
    border: 4px solid var(--card-bg);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    transition: var(--transition);
}

.profile-pic:hover {
    transform: scale(1.05);
}

/* --- Main Content --- */
.main-content {
    flex: 3;
    background: var(--card-bg);
    padding: 3rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(255,255,255,0.6);
}

.main-content p {
    max-width: 85ch;
}

/* --- Typography --- */
h1, h2, h3 {
    font-family: var(--font-heading);
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

h2 {
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1.5rem;
    color: var(--primary-text);
    border-bottom: none;
    position: relative;
    padding-left: 1rem;
}

h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10%;
    height: 80%;
    width: 4px;
    border-radius: 4px;
    background: var(--accent-gradient);
}

h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--secondary-text);
}

/* --- Skills Section --- */
.skill-row {
    display: flex;
    margin-bottom: 1.2rem;
    flex-direction: column;
}

.skill-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--secondary-text);
    font-weight: 700;
    margin-bottom: 0.5rem;
    width: 100%;
}

.skill-content {
    margin-left: 0;
    font-weight: 500;
    color: var(--primary-text);
}

.tag {
    display: inline-block;
    background: #eff0f6;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    margin-right: 8px;
    margin-bottom: 8px;
    transition: var(--transition);
}

.tag:hover {
    background: var(--accent-solid);
    color: white;
    transform: translateY(-2px);
}

/* --- Footer --- */
footer {
    text-align: center;
    padding: 3rem 0;
    color: var(--secondary-text);
    background: transparent;
    font-size: 0.9rem;
}

/* --- Animations --- */
.main-content section {
    animation: fadeIn 0.8s ease-in-out forwards;
    opacity: 0;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    nav {
        padding: 0.6rem 0.5rem; /* Adjusted for mobile */
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    nav a {
        margin: 0; 
        font-size: 0.85rem;
        padding: 0.4rem 0.6rem; 
    }

    .container {
        flex-direction: column;
        padding: 1rem;
        margin-top: 1rem;
        gap: 1.5rem;
    }
    
    .sidebar, .main-content {
        width: 100%;
        position: static;
        box-sizing: border-box;
        padding: 1.5rem;
    }

    h1 {
        font-size: 2rem;
    }
}