/*
    -----------------------------------------------------
    GLOBAL STYLES & FONT SETUP
    -----------------------------------------------------
*/
:root {
    /* HIGH-TECH PALETTE */
    --color-primary: #00eaff;     /* Electric Cyan - For CTAs and main links */
    --color-secondary: #ff006e;   /* Vibrant Magenta - For highlights, titles, and icons */
    --color-text-light: #f4f4f9;  /* Near-white for main text */
    --color-text-dark: #212a45;   /* Dark Blue/Gray for reverse contrast */
    --color-text-grayblue: rgba(180, 180, 255, 1.0);
    --color-card-bg: rgba(33, 42, 69, 0.9); /* Deep Navy Blue/Gray - Card background */
    --color-alt-bg: rgba(10, 15, 30, 0.7); /* Even darker transparent background for contrast sections */
    
    /* BACKGROUND GRADIENT (Deep Blue/Violet) */
    --color-bg-start: #1a1a2e;    /* Deep Blue/Black */
    --color-bg-end: #391a45;      /* Deep Violet */
    
    /* Utility for Narrative Highlights (BRIGHT for contrast) */
    --color-gradient-text: #ffc600; /* BRIGHT AMBER - Stands out clearly against the dark card */

    /* NEW ANIMATION VARIABLES */
    /* Define the colors for the scrolling accent gradient */
    --gradient-scroll-colors: #00eaff, #ff006e, #ffc600, #00eaff; 
    --gradient-width: 400%; /* Width of the gradient for scrolling */
    --animation-speed: 10s;
}

/* Base Body Style with Scrolling Gradient */
body {
    font-family: 'Poppins', sans-serif;
    color: var(--color-text-light);
    margin: 0;
    line-height: 1.6;
    background: linear-gradient(135deg, var(--color-bg-start), var(--color-bg-end));
    background-size: 400% 400%;
    animation: gradientShift 20s ease infinite; /* Slower animation for sophistication */
    min-height: 100vh;
}

/* Keyframe animation for the subtle background color shift */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}


/*
    -----------------------------------------------------
    ANIMATED ACCENT STYLES (The Scrolling Color Effect)
    -----------------------------------------------------
*/
.animated-accent {
    /* 1. Create the scrolling background gradient */
    background: linear-gradient(
        90deg, 
        var(--gradient-scroll-colors)
    );
    background-size: var(--gradient-width) 100%; /* Still 400% width */
    
    -webkit-background-clip: text;
    background-clip: text;
    
    color: transparent;
    
    animation: gradientScroll var(--animation-speed) linear infinite;
    
    display: inline-block;
}

/* Keyframe animation to scroll the background gradient horizontally */
@keyframes gradientScroll {
    0% {
        background-position: 0% 100%; 
    }
    100% {
        /* FINAL FIX ATTEMPT: Shift by -25%. This means shifting the 400% wide 
           background by one quarter of the element's width, which should 
           align the start and end colors for a smooth loop. */
        background-position: 400% 0%; 
    }
}
/*
    -----------------------------------------------------
    END: ANIMATED ACCENT STYLES
    -----------------------------------------------------
*/


.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

@media (max-width: 600px) {
    .container {
        /* Set a generous horizontal padding (e.g., 20px on the left and right) */
        padding-left: 20px;
        padding-right: 20px;
        
        /* Ensure no horizontal scroll is caused by any children */
        box-sizing: border-box; 
        
        /* If you already have a width set on .container, make sure it doesn't exceed 100% 
           If it's already set to something like 90%, you can skip this.
        */
        width: 100%; 
    }
}

h1, h2, h3 {
    color: var(--color-text-light);
    font-weight: 700;
}

h2 {
    font-size: 2.5em;
    margin-bottom: 0.5em;
    text-align: center;
}

p {
    margin-bottom: 1em;
}

/* Utility to make the key narrative text BRIGHT for high contrast */
.highlight-text {
    color: var(--color-gradient-text) !important; /* Forces the text color to be bright amber */
    font-weight: bold;
}

/* Utility to make the key narrative text BRIGHT for high contrast */
.highlight-project-text {
    color: var(--color-secondary) !important; /* Forces the text color to be bright amber */
    font-weight: bold;
}

/* Utility to make the key narrative text BRIGHT for high contrast */
.highlight-link-text {
    color: var(--color-text-grayblue) !important; /* Forces the text color to be bright amber */
    font-weight: bold;
}

/*
    -----------------------------------------------------
    HEADER & NAVIGATION
    -----------------------------------------------------
*/
header {
    background: var(--color-card-bg); /* Use dark card color for header */
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5); /* Stronger shadow */
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    margin: 0;
    font-size: 1.8em;
}

header nav ul {
    list-style: none;
    align-items: flex-start;
    padding: 0;
    margin: 0;
    display: flex;
}

header nav ul li {
    margin-left: 20px;
}

header nav ul li a {
    color: var(--color-text-light);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

header nav ul li a:hover {
    color: var(--color-primary); /* Cyan hover effect */
}

.img-cycle { 
    position: relative; 
    width: 100%; 
    height: 180px; 
    border-radius: 6px; 
    overflow: hidden;
    
} 

/*
    -----------------------------------------------------
    IMAGE CYCLE
    -----------------------------------------------------
*/

.img-cycle {
    position: relative;
    width: 100%;
    height: 180px;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 15px; /* ← add this */
}

.img-cycle img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 180px;
    object-fit: cover;
    filter: brightness(0.8);
    opacity: 0;
    animation: crossfade 6s infinite;
}

.img-cycle .img1 {
    animation-delay: 0s;
}

.img-cycle .img2 {
    animation-delay: 3s; /* half of total duration */
} 

@keyframes crossfade {
    0% { opacity: 1; }
    40% { opacity: 1; }
    50% { opacity: 0; }
    90% { opacity: 0; }
    100% { opacity: 1; }
}

/*
    -----------------------------------------------------
    HERO SECTION
    -----------------------------------------------------
*/
.hero {
    padding: 100px 0;
    text-align: center;
    background: rgba(0, 0, 0, 0.4); /* Stronger overlay on background */
    margin-bottom: 50px;
}

.hero p.tagline {
    font-size: 1.2em;
    color: var(--color-text-light);
    margin: 0;
}

.hero h2 {
    font-size: 4em;
    margin: 0;
    line-height: 1;
}

.hero h3.highlight {
    font-size: 1.5em;
    color: var(--color-secondary); /* Magenta secondary highlight */
    margin-top: 5px;
    margin-bottom: 30px;
}

.cta-group {
    margin-top: 40px;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    text-decoration: none;
    font-weight: 600;
    border-radius: 5px;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
    margin: 0 10px;
    letter-spacing: 1px;
}

.btn.primary {
    background-color: var(--color-primary);
    color: var(--color-text-dark); /* Dark text on bright button */
    border: 2px solid var(--color-primary);
}

.btn.primary:hover {
    background-color: transparent;
    border-color: var(--color-secondary); /* Magenta border on hover */
    color: var(--color-secondary);
}

.btn.secondary {
    background-color: transparent;
    color: var(--color-text-light);
    border: 2px solid var(--color-primary); /* Primary accent border */
}

.btn.secondary:hover {
    background-color: var(--color-secondary);
    border-color: var(--color-secondary);
    color: var(--color-text-dark);
}


/*
    -----------------------------------------------------
    GENERAL SECTION STYLES
    -----------------------------------------------------
*/
.section {
    padding: 60px 0;
}

.section.alt-bg {
    background: var(--color-alt-bg);
}

.section-description {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 40px;
    color: var(--color-text-light);
}

/*
    -----------------------------------------------------
    NARRATIVE ABOUT SECTION
    -----------------------------------------------------
*/
#narrative-about h2 {
    margin-bottom: 30px;
}

.narrative-content {
    max-width: 850px;
    margin: 0 auto;
    background: var(--color-card-bg);
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

.narrative-content p {
    font-size: 1.1em;
    text-align: justify;
    padding-bottom: 15px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.15);
}

.narrative-content p:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/*
    -----------------------------------------------------
    PERSONAL BACKGROUND (Old About)
    -----------------------------------------------------
*/
.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}



.detail-card {
    background: var(--color-card-bg);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s, box-shadow 0.3s;
    
    /* 1. CRITICAL GRID CONTAINMENT FIX */
    min-width: 0; 
    overflow: hidden; 
    
    /* 2. FLEXBOX CONTAINMENT */
    display: flex;
    flex-direction: column;
}

.detail-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 15px;
    filter: brightness(0.8);
}

/* 1. HIDE AND SHRINK THE NEW IMAGE BY DEFAULT */
.hover-only-img {
    /* Flow Collapse */
    max-height: 0; 
    margin: 0;
    overflow: hidden; 

    /* Visual Shrink */
    opacity: 0;
    transform: scale(0.1); 
    transform-origin: center center;
    
    /* Animation Control */
    transition: 
        max-height 0.5s ease-in-out, 
        opacity 0.5s ease-in-out,
        transform 0.5s ease-in-out;
    
    /* Final size and styling */
    width: 100%; 
    height: 180px; 
    object-fit: cover;
    border-radius: 12px; 
    display: block; /* Important for max-height to work */
}

/* 2. MAKE IT VISIBLE AND FULL SIZE ON HOVER */
.trigger-container:hover .hover-only-img {
    /* Flow Expansion */
    max-height: 200px; /* Needs to be larger than the height (180px) */

    /* Visual Expansion */
    opacity: 1;
    transform: scale(1);
    
    /* Restore margins for spacing */
    margin-top: 15px;
    margin-bottom: 15px; 
}

.detail-card h3 {
    color: var(--color-secondary);
    margin-top: 0;
}

.detail-card ul {
    list-style: disc;
    padding-left: 20px;
}


/*
    -----------------------------------------------------
    EXPERTISE
    -----------------------------------------------------
*/
.expertise-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.expertise-item {
    background: var(--color-card-bg);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.expertise-item h3 {
    margin-top: 0;
    display: flex;
    align-items: center;
    color: var(--color-text-light);
}

.highlight-icon {
    font-size: 1.5em;
    margin-right: 10px;
    color: var(--color-primary); /* Cyan primary highlight */
}

.expertise-item ul {
    list-style: none;
    padding: 0;
}

.expertise-item li {
    padding: 8px 0;
    border-bottom: 1px dotted rgba(255, 255, 255, 0.15);
}

.expertise-item li:last-child {
    border-bottom: none;
}


/*
    -----------------------------------------------------
    PROJECT CARDS (WORK & PERSONAL)
    -----------------------------------------------------
*/
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.project-card {
    background: var(--color-card-bg);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    border-bottom: 4px solid var(--color-secondary); /* Magenta line to define card */
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
    border-bottom-color: var(--color-primary); /* Cyan hover switch */
}

.project-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 15px;
    filter: brightness(0.8);
}

.project-card h3 {
    margin-top: 0;
    font-size: 1.4em;
    color: var(--color-primary); /* Cyan main project title */
}

.project-card .role-company {
    font-weight: 600;
    color: var(--color-secondary); /* Magenta role highlight */
    margin: 5px 0;
    font-size: 0.95em;
}

.project-card p {
    font-size: 0.9em;
    margin-bottom: 10px;
    flex-grow: 0;
}

.project-card .project-date {
    display: block;
    font-size: 0.8em;
    color: var(--color-secondary);
    font-weight: 700;
    margin-bottom: 10px;
    margin-top: auto; /* pushes date + link to the bottom */
}

.project-card .project-link {
    display: inline-block;
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
    margin-top: 10px;
}

.project-card .project-link:hover {
    text-decoration: underline;
    color: var(--color-secondary);
}

/*
    -----------------------------------------------------
    CONTACT SECTION
    -----------------------------------------------------
*/
.contact-form {
    max-width: 600px;
    margin: 40px auto 0;
    background: var(--color-card-bg);
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    width: 100%;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid var(--color-primary); /* Cyan border on input */
    border-radius: 5px;
    background-color: rgba(0, 0, 0, 0.3);
    color: var(--color-text-light);
    font-size: 1em;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--color-secondary); /* Magenta focus */
    outline: none;
}

.contact-form textarea {
    resize: vertical;
}

.contact-form .btn.primary {
    width: 100%;
    margin: 0;
}


/*
    -----------------------------------------------------
    FOOTER
    -----------------------------------------------------
*/
footer {
    background: var(--color-card-bg);
    text-align: center;
    padding: 20px 0;
    font-size: 0.9em;
    border-top: 1px solid var(--color-primary);
}

/*
    -----------------------------------------------------
    RESPONSIVENESS
    -----------------------------------------------------
*/
@media (max-width: 768px) {
    .hero h2 {
        font-size: 3em;
    }

    header .container {
        flex-direction: column;
    }

    header nav ul {
        margin-top: 10px;
    }

    header nav ul li {
        margin: 0 10px;
    }

    .cta-group {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .btn {
        margin: 0;
    }

    .about-grid, .expertise-grid, .project-grid {
        grid-template-columns: 1fr;
    }
}