
:root {
    /* Primary Brand Colors */
    --brand-blue: #4a90e2;
    --bg-dark-blue: #001a33;
    
    /* UI Element Colors */
    --card-bg: rgba(30, 30, 30, 0.75);
    --header-bg: rgba(30, 30, 30, 0.85);
    --text-main: #eaeaea;
    --text-muted: rgba(255, 255, 255, 0.6);
    
    /* Animation Speeds */
    --transition-fast: 0.2s ease;
    --transition-standard: 0.3s ease;
    
    /* Layout */
    --header-height: 80px;

    --container-max-width: 1100px; /* Adjust this to your preferred width */
    --container-padding: 0 40px;   /* Consistent side gutters */
}

html {
    scroll-behavior: smooth;
}

/* Offset for your sticky header so content doesn't hide behind it */
section {
    scroll-margin-top: 80px; 
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding: .5rem 2rem;
    color: #eaeaea;

    /* Pathing to your images folder */
    background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('images/blue-bg.jpg');
    
    /* Ensures the image covers the entire screen */
    background-size: cover;
    
    /* Keeps the background stationary during scroll for a parallax effect */
    background-attachment: fixed;
    
    /* Centers the image */
    background-position: center;
    
    /* Prevents tiling */
    background-repeat: no-repeat;
    
    /* Fallback color in case the image fails to load */
    background-color: #001a33; 
    
}

@media (max-width: 768px) {
    body {
        /* Force the image to stop trying to stay "fixed" */
        background-attachment: scroll !important; 
        
        /* Ensure it stays centered */
        background-position: center center !important;
        
        /* Cover the entire screen without stretching weirdly */
        background-size: cover !important;
        
        /* Fix for mobile Safari height issues */
        background-repeat: no-repeat;
        min-height: 100vh;
    }
}

h1 { 
    font-size: 3.75rem;
    color: #ffc;
}

h2 { 
    color: #ffc;
}

nav {
    margin-bottom: 4rem;
    text-align: center;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.project-card {
    position: relative;
    width: 100%;
    /* This creates a fixed aspect ratio (e.g., a 4:3 rectangle) */
    aspect-ratio: 4 / 3; 
    overflow: hidden;
    border-radius: 8px;
    background-color: #f0f0f0; /* Placeholder color while loading */
}

.project-card img {
    width: 100%;
    height: 100%;
    /* This is the magic line: it crops the image to fill the box without stretching */
    object-fit: cover; 
    /* Ensures the crop starts from the top—crucial for long email designs */
    object-position: top; 
    display: block;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.project-card:hover img {
    transform: scale(1.08);
}

.overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7); /* Dark semi-transparent wash */
    color: white;
    padding: 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* Lightbox Background */
.lightbox {
    display: none; 
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: #eaeaea; /* Minimalist white-out effect */
    overflow: auto;
}

/* Image Inside Lightbox */
.lightbox-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 800px;
    padding: 40px 0;
}

#lightbox-img {
    max-width: 100%;
    height: auto;
    border-radius: 12px; /* Softened edges for the project itself */
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Close Button */
.close {
    position: fixed;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
}

/* Caption Text */
#caption {
    color: #eaeaea;
    font-size: 1.5rem;
    margin-bottom: 20px;
    text-transform: capitalize;
    font-weight: bold;
}

.modal {
    display: none; 
    position: fixed;
    z-index: 3000; /* Higher than header and back-to-top */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    
    /* Darker tint to focus attention on the content */
    background-color: rgba(0, 10, 20, 0.7);
    
    /* Intense blur on the background site */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    
    overflow-y: auto; 
    transition: all 0.3s ease;
}

.modal-content-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    
    /* Modern Card Styling */
    max-width: 900px;
    margin: 40px auto;
    padding: 40px;
    background: rgba(255, 255, 255, 0.05); /* Very light glass tint */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px; /* Matches your About section */
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

@media (max-width: 600px) {
    .modal-content-wrapper {
        margin: 10px;
        padding: 20px;
        border-radius: 16px;
    }
}

.about-section {
    /* 1. MATCH THE PORTFOLIO WIDTH */
    max-width: var(--container-max-width); /* Locks to 1100px */
    margin: 60px auto; /* Centering the box */
    
    /* 2. MATCH THE PORTFOLIO GUTTERS */
    padding: 80px 40px; /* 40px matches your --container-padding */
    
    /* 3. ENSURE PADDING DOESN'T ADD TO WIDTH */
    box-sizing: border-box; 
    
    /* Remaining Glass Styles */
    background: rgba(0, 15, 30, 0.6); 
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

.bio {
    font-size: 1.2rem;
    line-height: 1.7;
    color: #eaeaea;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); /* Adds a "pop" against the background */
    margin-bottom: 40px;
}

.services-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

@media (max-width: 600px) {
    .services-grid { grid-template-columns: 1fr; }
}

.service h3 {
    color: var(--brand-blue); /* Highlights services with your brand color */
}

.service p {
    font-size: 0.95rem;
    color: #eaeaea;
}

.cta {
    margin-top: 50px;
    text-align: center;
}

header {
    text-align: center;
    padding: 60px 20px;
}

.header-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 25px;
    flex-wrap: wrap; /* Keeps it clean on mobile */
}

/* Unified Button Style (Filter-inspired) */
.btn {
    display: inline-block;
    /* Matches filter background and blur */
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
    color: var(--text-muted); /* Uses your variable for the soft white text */
    
    /* Slightly larger than filters */
    padding: 8px 20px;
    font-size: 0.85rem;
    border-radius: 20px; /* Pill shape like filters */
    
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
}

/* Unified Hover State for All Buttons */
.btn:hover, 
#backToTop:hover {
    background-color: var(--brand-blue) !important;
    border-color: var(--brand-blue) !important;
    color: #ffffff !important;
    
    /* Subtle lift and glow for a premium feel */
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(74, 144, 226, 0.3);
}

/* Active/Primary state (optional for specific buttons) */
.btn.primary {
    background: var(--brand-blue);
    color: #fff;
    border-color: var(--brand-blue);
}

/* Next & previous buttons */
.prev, .next {
    cursor: pointer;
    position: fixed; /* Ensures they stay on screen during scroll */
    top: 50%;
    transform: translateY(-50%); /* Perfectly centers them vertically */
    
    /* Perfect Circle Dimensions */
    width: 60px;
    height: 60px;
    display: flex !important; /* Forces the flex behavior */
    align-items: center;
    justify-content: center;
    border-radius: 50% !important; /* Forces circular shape */
    
    /* Glass Style */
    background-color: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    
    font-size: 30px;
    font-weight: bold;
    text-decoration: none;
    user-select: none;
    z-index: 4000; /* Higher than the modal content */
    transition: all 0.3s ease;
}

/* Specific Positioning */
.prev {
    left: 30px;
}

.next {
    right: 30px;
}

/* Hover State - Unified Blue Glow */
.prev:hover, .next:hover {
    background-color: var(--brand-blue);
    border-color: var(--brand-blue);
    transform: translateY(-50%) scale(1.1); /* Keeps vertical center while scaling */
    box-shadow: 0 0 20px rgba(74, 144, 226, 0.4);
}

/* Mobile Adjustment */
@media (max-width: 600px) {
    .prev, .next {
        width: 45px;
        height: 45px;
        font-size: 20px;
        background-color: rgba(0, 0, 0, 0.5); /* Higher visibility for mobile */
    }
    .prev { left: 10px; }
    .next { right: 10px; }
}

#bio {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
    line-height: 1.6;
}

.bio-image {
    width: 250px; /* Adjust size as needed */
    height: auto;
    float: left; /* This creates the text wrap */
    margin-right: 30px;
    margin-bottom: 20px;
    border-radius: 8px; /* Matches your project card style */
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.bio-container::after {
    content: "";
    display: table;
    clear: both; /* Prevents layout collapse */
}

/* Responsive adjustment for mobile */
@media (max-width: 600px) {
    .bio-image {
        float: none;
        display: block;
        margin: 0 auto 20px auto;
        width: 100%;
        max-width: 300px;
    }
    #bio {
        text-align: center;
    }
}

#services, #tech-stack, #portfolio-grid {
    max-width: var(--container-max-width);
    margin: 60px auto; /* Centering the container */
    padding: var(--container-padding);
}

.stack-grid, .portfolio-grid {
    display: grid;
    margin-top: 20px;
    /* Remove any unique padding here so it inherits from the section */
}

.stack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.stack-category {
    background: rgba(255, 255, 255, 0.07); 
    backdrop-filter: blur(8px);
    padding: 25px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 4px solid var(--brand-blue);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.stack-category:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-8px);
}

.stack-category h3 {
    margin: 0 0 15px 0;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #ffc;
}

.stack-category ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.stack-category li {
    padding: 10px 0;
    font-size: 0.95rem;
    color: #eaeaea;
    border-bottom: 1px solid #eee;
}

.stack-category li:last-child {
    border-bottom: none;
}

.main-header {
    width: 100%;
    top: 0;
    z-index: 2000;
    padding: 15px 0;
}

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

.brand {
    display: flex;
    align-items: center;
    gap: 15px;
}

.name {
    font-size: 1.4rem;
    margin: 0;
    white-space: nowrap;
}

.divider {
    color: rgba(255, 255, 255, 0.3);
    font-weight: 200;
}

.title {
    font-size: 0.9rem;
    margin: 0;
    color: var(--brand-blue);
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px; /* Consistent spacing between the new pills */
}

/* Specific button adjustment for the tighter header row */
.header-actions .btn {
    padding: 8px 16px;
    font-size: 0.85rem;
}

/* Responsive: Stacks on mobile if the screen is too narrow */
@media (max-width: 900px) {
    .header-container {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    .brand {
        flex-direction: column;
        gap: 5px;
    }
    .divider { display: none; }
}

#backToTop {
    display: none; 
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 99;
    
    /* Perfect Circle Dimensions */
    width: 50px;
    height: 50px;
    padding: 0; /* Remove padding to keep the arrow centered */
    border-radius: 50%; /* This creates the circle */
    
    /* Matching the Glass Filter Style */
    background-color: rgba(0, 26, 51, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    font-size: 1.2rem; /* Slightly smaller arrow for a cleaner look */
    backdrop-filter: blur(5px);
    
    /* Flexbox to perfectly center the arrow icon */
    display: flex;
    align-items: center;
    justify-content: center;
    
    transition: all 0.3s ease;
    animation: fadeInPulse 0.6s ease-out;
}

#backToTop:hover {
    background-color: var(--brand-blue); 
    transform: translateY(-5px);
    border-color: var(--brand-blue);
    box-shadow: 0 5px 15px rgba(74, 144, 226, 0.3);
}

@media (max-width: 600px) {
    #backToTop {
        bottom: 20px;
        right: 20px;
        width: 42px; /* Slightly smaller on mobile */
        height: 42px;
        font-size: 1rem;
    }
}

.filter-btn {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.6); /* Slightly more muted */
    border: 1px solid rgba(255, 255, 255, 0.1);
    
    /* Reduced padding and font size to prevent competition with Header Nav */
    padding: 5px 14px; 
    font-size: 0.75rem; 
    
    border-radius: 15px; /* Tighter radius for a smaller footprint */
    font-weight: 400; /* Lighter weight to recede visually */
    cursor: pointer;
    backdrop-filter: blur(5px);
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* Adding the Brand Blue hover to filters */
.filter-btn:hover {
    background-color: var(--brand-blue) !important;
    border-color: var(--brand-blue) !important;
    color: #ffffff !important;
    
    /* Matches the subtle lift and glow of your other buttons */
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(74, 144, 226, 0.3);
}

/* Ensure the 'active' state remains distinct but harmonious */
.filter-btn.active {
    background-color: var(--brand-blue);
    color: #ffffff;
    border-color: var(--brand-blue);
    /* Slightly stronger shadow for the active state */
    box-shadow: 0 0 12px rgba(74, 144, 226, 0.4);
}

/* Tighter spacing for the container */
.filter-nav {
    display: flex;
    justify-content: center;
    gap: 10px; 
    margin-bottom: 30px;
    margin-top: 10px;
}

@media (max-width: 600px) {
    .filter-nav {
        /* Forces buttons into a single row */
        display: flex;
        flex-wrap: nowrap;
        justify-content: flex-start; /* Aligns to the left for swiping */
        
        /* Enables horizontal scrolling */
        overflow-x: auto;
        -webkit-overflow-scrolling: touch; /* Smooth momentum scrolling on iOS */
        
        /* Layout adjustments */
        gap: 8px;
        padding: 5px 20px 15px 20px; /* Extra bottom padding for scrollbar space */
        margin-left: -20px; /* Pulls container to edges for a full-bleed feel */
        margin-right: -20px;
        
        /* Hides the scrollbar for a cleaner "app" look */
        scrollbar-width: none; /* Firefox */
    }

    .filter-nav::-webkit-scrollbar {
        display: none; /* Chrome, Safari, and Opera */
    }

    .filter-btn {
        flex: 0 0 auto; /* Prevents buttons from shrinking or stretching */
        white-space: nowrap; /* Keeps text on one line */
        font-size: 0.7rem;
        padding: 6px 12px;
    }
}

/* Animation for the images appearing */
.grid-fade-in {
    animation: portfolioFade 0.4s ease-out forwards;
}

@keyframes portfolioFade {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Ensure the grid container has a transition for a smooth height change */
#portfolio-grid {
    transition: all 0.3s ease-in-out;
}

@media (max-width: 600px) {
    /* 1. Remove all default spacing from text elements */
    .name, .title, .header-actions {
        margin: 0 !important;
        padding: 0 !important;
    }

    /* 2. Control the brand unit (Name + Title) */
    .brand {
        display: flex;
        flex-direction: column;
        gap: 0; /* Forces them to touch */
        margin-bottom: 5px; /* Tiny space before the buttons start */
    }

    /* 3. Tighten the overall container */
    .header-container {
        flex-direction: column;
        gap: 8px; /* Precise control over the space between text and buttons */
        padding-top: 10px;
        padding-bottom: 10px;
    }

    /* 4. Adjust the buttons */
    .header-actions {
        display: flex;
        justify-content: center;
        gap: 6px; /* Narrower space between LinkedIn/Email/Call */
    }

    .header-actions .btn {
        padding: 6px 14px;
        font-size: 0.75rem;
        /* Matches your tighter mobile header layout */
    }
}

.main-footer {
    width: 100%;
    padding: 40px 0 80px 0; /* Extra bottom padding to clear the screen edge */
}

.footer-container {
    /* 1. MATCH THE ABOUT SECTION DIMENSIONS */
    max-width: var(--container-max-width); /* Locks to 1100px */
    margin: 0 auto;
    padding: 60px 40px; /* Matches the About section internal spacing */
    
    /* 2. MATCH THE GLASS STYLE & ROUNDED CORNERS */
    background: rgba(0, 15, 30, 0.6); 
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    
    border-radius: 24px; /* Matches the About section radius */
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    
    /* Layout */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    box-sizing: border-box;
}

.footer-copyright {
    color: var(--text-muted);
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.footer-nav {
    display: flex;
    gap: 25px;
    margin-bottom: 0; /* Overriding your general nav margin */
}

.footer-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: var(--brand-blue);
}

@media (max-width: 600px) {
    .footer-nav {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
}
