/* --- Base Styles --- */
:root {
    /* Color Palette */
    --clr-nav-light: #fefefe;
    --clr-nav-dark: #121926;
    --clr-text-main: #333;
    --clr-text-light: #fff;
    --clr-text-muted-dark: #666;
    --clr-text-muted-light: #aaa;
    --clr-primary-blue: #3498db; 
    --clr-primary-light: #9ad4f8; 
    --clr-accent-secondary: #0087e0; 
    --clr-dark-bg: #121926; 
    --clr-card-bg: #1e283b; 
    --clr-border-light: rgba(0, 0, 0, 0.1);
    --clr-border-dark: rgba(255, 255, 255, 0.1);

    /* Fonts */
    --ff-body: 'Inter', sans-serif;
    --ff-mono: 'Roboto Mono', monospace;
    
    /* Layout */
    --container-width: 1200px;
    --header-height: 80px;
    --transition-speed: 0.3s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--ff-body);
}

html {
    scroll-behavior: smooth;
    color: var(--clr-text-main);
    background-color: #fff;
    font-size: 16px;
}

body {
    line-height: 1.6;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
}

.text-center { text-align: center; }
.text-light { color: var(--clr-text-light); }
.text-muted-light { color: var(--clr-text-muted-light); }
.text-primary-light { color: var(--clr-primary-light); }

/* --- Header / Navigation --- */
header {
    background-color: var(--clr-nav-light);
    height: var(--header-height);
    width: 100%;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: fixed;
    top: 0;
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header .logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--clr-accent-secondary);
    text-decoration: none;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

nav ul li a {
    color: var(--clr-accent-secondary);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    padding-bottom: 5px;
    transition: color var(--transition-speed);
}

nav ul li a:hover {
    color: var(--clr-primary-blue);
}

/* Nav Link Hover Underline Animation */
nav ul li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--clr-primary-blue);
    transition: width 0.3s ease;
}

nav ul li a:hover::after {
    width: 100%;
}

main { margin-top: var(--header-height); }

/* --- Section Stylings & Animated Backgrounds --- */

/* Breathing Gradient Background for Dark Sections */
.dark-section {
    background: linear-gradient(-45deg, #121926, #1a2536, #0d121c, #162032);
    background-size: 400% 400%;
    animation: shiftGradient 15s ease infinite;
    padding: 10rem 0; 
}

@keyframes shiftGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.light-section {
    background-color: #fff;
    padding: 8rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 5rem;
}

.section-title {
    font-size: 3rem;
    font-weight: 700;
    color: var(--clr-accent-secondary);
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.25rem;
    color: var(--clr-text-muted-dark);
    max-width: 600px;
    margin: 0 auto;
}

/* --- Hero Section & Interactive Node Background --- */
.hero {
    height: calc(100vh - var(--header-height));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    
    /* Subtle Blueprint Grid Base Background */
    background-color: #fafafa;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.9)),
        linear-gradient(to right, rgba(52, 152, 219, 0.05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(52, 152, 219, 0.05) 1px, transparent 1px);
    background-size: 100% 100%, 50px 50px, 50px 50px;
}

.hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none; /* Allows mouse clicks to pass through to the buttons */
}

.hero-container {
    text-align: center;
    position: relative;
    z-index: 1; /* Keeps the text and buttons ABOVE the canvas network */
}

/* Name Gradient Setup and Animation */
.hero-name-grandent {
    font-size: 5.5rem; 
    font-weight: 700;
    background: linear-gradient(90deg, #9ad4f8 0%, #3498db 50%, #0087e0 100%, #3498db 150%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
    transition: text-shadow 0.3s ease;
    animation: flowGradient 4s linear infinite;
}

.hero-name-grandent:hover {
    text-shadow: 0 0 20px rgba(52, 152, 219, 0.4);
}

@keyframes flowGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.hero-tagline {
    font-family: var(--ff-mono);
    font-weight: 400;
    font-size: 1.75rem;
    color: #4a4a4a; 
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 1.5rem;
}

.hero-sub-text {
    font-size: 1.25rem;
    color: #7a7a7a;
    max-width: 800px;
    margin: 0 auto 3rem auto;
}

.hero-btns-container {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.btn {
    padding: 15px 30px;
    border-radius: 5px;
    font-weight: 600;
    text-decoration: none;
    font-size: 1rem;
    transition: all var(--transition-speed);
}

.btn-primary {
    background-color: var(--clr-primary-blue);
    color: var(--clr-text-light);
    border: none;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.btn-primary:hover {
    background-color: var(--clr-accent-secondary);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.5);
}

.btn-secondary {
    background-color: transparent;
    color: var(--clr-primary-blue);
    border: 1px solid var(--clr-primary-blue);
}

.btn-secondary:hover {
    background-color: rgba(52, 152, 219, 0.05);
    transform: translateY(-3px);
}


/* --- Projects Section --- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
}

.project-card {
    background-color: var(--clr-card-bg);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    position: relative;
    cursor: pointer; /* Makes the whole card look clickable */
    height: 300px; /* Fixed height so all cards are identical */
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(52, 152, 219, 0.4);
}

.project-card .card-img {
    width: 100%;
    height: 100%; /* Makes image fill the whole card */
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-card:hover .card-img {
    transform: scale(1.08); /* Zoom effect on hover */
}

/* New overlay for the title */
.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 4rem 1.5rem 1.5rem;
    /* Creates a smooth fade from dark at the bottom to transparent at the top */
    background: linear-gradient(to top, rgba(18, 25, 38, 0.95) 0%, rgba(18, 25, 38, 0.5) 50%, transparent 100%);
    color: var(--clr-text-light);
    text-align: center;
    pointer-events: none; /* Ensures the click registers on the card itself */
}

.card-overlay h3 {
    font-size: 1.5rem;
    margin: 0;
    text-shadow: 0 2px 5px rgba(0,0,0,0.8);
}.card-content {
    padding: 2rem;
    color: var(--clr-text-light);
    position: relative;
    background-color: var(--clr-card-bg); /* Prevents image from showing under text when zoomed */
}

.card-content h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.card-content p {
    color: var(--clr-text-muted-light);
    margin-bottom: 1.5rem;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 2rem;
}

.tech-tags span {
    font-size: 0.8rem;
    color: var(--clr-primary-light);
    background-color: rgba(154, 212, 248, 0.1);
    padding: 5px 10px;
    border-radius: 50px;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--clr-border-dark);
    padding-top: 1.5rem;
}

.view-details {
    color: var(--clr-primary-blue);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.card-actions {
    display: flex;
    gap: 1.5rem;
}

.card-actions a {
    color: var(--clr-text-muted-light);
    font-size: 1.1rem;
    transition: color var(--transition-speed), transform var(--transition-speed);
}

.card-actions a:hover {
    color: var(--clr-text-light);
    transform: scale(1.2);
}

/* --- Skills Section --- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.skill-category {
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.skill-category:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.skill-category h3 {
    font-size: 1.4rem;
    color: var(--clr-accent-secondary);
    border-bottom: 2px solid var(--clr-border-light);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.skill-icons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Individual Skill Slide Hover */
.skill-icons span {
    font-size: 1.1rem;
    color: var(--clr-text-main);
    display: flex;
    align-items: center;
    transition: transform 0.3s ease, color 0.3s ease;
}

.skill-icons span:hover {
    transform: translateX(10px);
    color: var(--clr-primary-blue);
}

.skill-icons i {
    color: var(--clr-primary-blue);
    margin-right: 10px;
    width: 25px;
    text-align: center;
}

/* --- Professional Experience Section --- */
.experience-list {
    display: grid;
    gap: 3rem;
}

.experience-item {
    background-color: var(--clr-card-bg);
    padding: 3rem;
    border-radius: 10px;
    border: 1px solid transparent;
    transition: transform 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

/* Experience Card Hover */
.experience-item:hover {
    transform: translateX(15px);
    border-color: rgba(52, 152, 219, 0.5);
    box-shadow: -10px 10px 25px rgba(0,0,0,0.2);
}

.exp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--clr-border-dark);
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}

.exp-header h3 {
    font-size: 1.6rem;
    color: var(--clr-primary-light);
}

.exp-header .company {
    color: var(--clr-text-light);
    font-weight: 600;
}

.exp-header .duration {
    color: var(--clr-text-muted-light);
    font-size: 0.9rem;
}

.exp-details {
    list-style: none;
    color: var(--clr-text-muted-light);
}

.exp-details li {
    margin-bottom: 10px;
    position: relative;
    padding-left: 25px;
}

.exp-details li::before {
    content: '•';
    color: var(--clr-primary-blue);
    position: absolute;
    left: 0;
}

/* --- Education Section --- */
.timeline {
    position: relative;
    padding: 20px 0;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 2px;
    background-color: rgba(52, 152, 219, 0.3);
    top: 0;
    bottom: 0;
    left: 20px;
}

.timeline-item {
    position: relative;
    margin-bottom: 40px;
    padding-left: 50px;
}

.timeline-dot {
    position: absolute;
    left: 11px;
    top: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: var(--clr-primary-blue);
    border: 4px solid #fff;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
    z-index: 2;
}

.timeline-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Timeline Hover Animation */
.timeline-item:hover .timeline-dot {
    transform: scale(1.4);
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.6);
    background-color: var(--clr-accent-secondary);
}

.timeline-item:hover .timeline-content {
    transform: translateX(10px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.timeline-content h3 {
    color: var(--clr-accent-secondary);
    font-size: 1.3rem;
    margin-bottom: 5px;
}

.timeline-content .institution {
    font-size: 0.95rem;
    color: var(--clr-text-muted-dark);
    font-weight: 500;
    margin-bottom: 10px;
}

.timeline-content .details {
    font-size: 1rem;
    color: var(--clr-text-main);
}

/* --- Footer --- */
footer {
    background-color: var(--clr-dark-bg);
    color: var(--clr-text-muted-light);
    padding: 3rem 0;
    font-size: 0.9rem;
}

footer a {
    transition: color 0.3s ease;
}

footer a:hover {
    color: var(--clr-primary-light) !important;
}

/* -----------------------------------------------------------
   Entrance & Scroll Animations (Managed by JS & CSS)
   ----------------------------------------------------------- */

/* Dramatic Load Entrance */
@keyframes textReveal {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
        letter-spacing: 0.25em; 
        filter: blur(5px);
    }
    50% {
        opacity: 1;
        transform: translateY(-5px) scale(1.02);
        filter: blur(2px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        letter-spacing: 0.15em;
        filter: blur(0);
    }
}

.dynamic-text-reveal {
    opacity: 0; 
    animation: textReveal 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    animation-delay: 0.5s; 
}


/* Scroll-Triggered Animations */
.scroll-animate-in, .scroll-animate-card, .scroll-animate-line, .scroll-animate-slide, .scroll-animate-scale {
    opacity: 0;
    transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.8s;
}

.scroll-animate-in { transform: translateY(30px); }
.scroll-animate-card { transform: translateY(50px); }
.scroll-animate-line { transform: translateX(-30px); }
.scroll-animate-slide { transform: translateX(30px); }
.scroll-animate-scale { transform: scale(0.9); }

.scroll-animate-in.show, .scroll-animate-card.show, .scroll-animate-line.show, .scroll-animate-slide.show, .scroll-animate-scale.show {
    opacity: 1;
    transform: none;
}

.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }

/* -----------------------------------------------------------
   Mobile Responsiveness (Media Queries)
   ----------------------------------------------------------- */

/* Base Hamburger styling (hidden on desktop) - MUST BE ABOVE MEDIA QUERIES */
.hamburger {
    display: none;
}

/* Tablets and Smaller Screens (Max width: 992px) */
@media screen and (max-width: 992px) {
    /* Make grids 2 columns instead of 3 */
    .projects-grid, .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Shrink the massive hero text slightly */
    .hero-name-grandent {
        font-size: 4rem;
    }
    .hero-tagline {
        font-size: 1.4rem;
    }
}

/* Mobile Phones (Max width: 768px) */
@media screen and (max-width: 768px) {
    /* Stack grid items into a single column */
    .projects-grid, .skills-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* Adjust padding for smaller screens */
    .dark-section, .light-section {
        padding: 5rem 0;
    }
    
    .section-header {
        margin-bottom: 3rem;
    }

    .section-title {
        font-size: 2.5rem;
    }

    /* Make hero text fit mobile */
    .hero-name-grandent {
        font-size: 3rem;
    }
    .hero-tagline {
        font-size: 1.1rem;
        letter-spacing: 0.1em;
    }

    /* Stack the buttons */
    .hero-btns-container {
        flex-direction: column;
        gap: 1rem;
        padding: 0 20px;
    }

    /* Adjust Timeline and Experience cards for mobile */
    .experience-item {
        padding: 1.5rem;
    }
    
    .exp-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    /* Stack logos on top of titles in experience/education */
    .exp-header > div, .timeline-content > div {
        flex-direction: column;
        align-items: flex-start !important;
    }
    
    /* Move timeline dot over */
    .timeline-item {
        padding-left: 30px;
    }
    .timeline::after {
        left: 10px;
    }
    .timeline-dot {
        left: 1px;
    }

    /* --- Mobile Navigation (Hamburger Menu) --- */
    .hamburger {
        display: block; /* Show hamburger icon */
        font-size: 1.8rem;
        color: var(--clr-accent-secondary);
        cursor: pointer;
        z-index: 1001;
    }

    #nav-menu {
        position: fixed;
        top: 0;
        right: -100%; /* Hide menu off-screen by default */
        width: 70%;
        height: 100vh;
        background-color: var(--clr-nav-light);
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
        display: flex;
        flex-direction: column;
        justify-content: center;
        transition: right 0.4s ease;
        z-index: 1000;
    }

    #nav-menu.active {
        right: 0; /* Slide menu in */
    }

    nav ul {
        flex-direction: column;
        align-items: center;
        gap: 2.5rem;
    }

    nav ul li a {
        font-size: 1.2rem;
    }
}

/* --- Contact Modal Popup --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: var(--clr-card-bg);
    color: var(--clr-text-light);
    padding: 2.5rem;
    border-radius: 12px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    position: relative;
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 15px 40px rgba(0,0,0,0.5);
    border: 1px solid var(--clr-border-dark);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-content h3 {
    color: var(--clr-primary-light);
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.modal-content p {
    color: var(--clr-text-muted-light);
    margin-bottom: 2rem;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: var(--clr-text-muted-light);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal:hover {
    color: var(--clr-text-light);
}

.modal-btns {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-btns .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 10px; /* This adds the perfect amount of space between the icon and text */
}

/* --- Project Specific Modal Styles --- */
.project-modal-content {
    max-width: 650px; /* Wider for reading project details */
    text-align: left;
    max-height: 85vh; /* Prevents it from going off screen */
    overflow-y: auto; /* Adds scrollbar if content is too long */
}

/* Custom sleek scrollbar for the modal */
.project-modal-content::-webkit-scrollbar {
    width: 8px;
}
.project-modal-content::-webkit-scrollbar-track {
    background: var(--clr-dark-bg);
    border-radius: 10px;
}
.project-modal-content::-webkit-scrollbar-thumb {
    background: var(--clr-primary-blue);
    border-radius: 10px;
}

/* Gallery Styles */
.project-gallery {
    margin-top: 10px;
    margin-bottom: 20px;
}

.main-gallery-img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    margin-bottom: 10px;
    transition: opacity 0.3s ease;
}

.gallery-thumbnails {
    display: flex;
    gap: 10px;
    overflow-x: auto; /* Allows scrolling if you add many thumbnails */
    padding-bottom: 5px;
}

/* Custom scrollbar for the thumbnail row */
.gallery-thumbnails::-webkit-scrollbar {
    height: 6px;
}
.gallery-thumbnails::-webkit-scrollbar-thumb {
    background: var(--clr-primary-blue);
    border-radius: 3px;
}


.gallery-thumbnails .thumb {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.3s, transform 0.3s;
    border: 2px solid transparent;
}

.gallery-thumbnails .thumb:hover {
    opacity: 0.8;
}

.gallery-thumbnails .thumb.active {
    opacity: 1;
    border-color: var(--clr-primary-light);
    transform: scale(1.05);
}
.project-modal-content h3 {
    margin-bottom: 15px;
    font-size: 2rem;
}

.project-modal-content p {
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 15px;
}

.project-modal-content .tech-tags {
    margin-top: 20px;
}
/* Add this class to any image you want to fit entirely inside the box */
.fit-img {
    object-fit: contain !important;
    background-color: var(--clr-card-bg); /* Adds a subtle background behind the image */
}