/* =========================================
   1. GLOBAL VARIABLES & RESETS
   ========================================= */
:root {
    --bg-color: #050505;
    --text-main: #ffffff;
    --text-muted: #a0a0a0;
    --accent-color: #be1f10; /* Red/Coral accent */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
    /* This prevents the sticky header from covering up the section titles when it scrolls down! */
    scroll-padding-top: 100px; 
}

/* =========================================
   2. NAVIGATION BAR
   ========================================= */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 10%;
    
    /* Make it stick to the top */
    position: sticky;
    top: 0;
    z-index: 1000;
    
    /* Frosted glass effect */
    background-color: rgba(5, 5, 5, 0.85); /* Slightly transparent background */
    backdrop-filter: blur(10px); /* Blurs whatever is behind it */
    -webkit-backdrop-filter: blur(10px); /* For Safari support */
    
    /* Subtle border separating it from the content */
    border-bottom: 1px solid rgba(255, 255, 255, 0.05); 
}

.logo {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent-color);
    text-decoration: none;
    letter-spacing: 1px;
}

nav a {
    color: var(--text-main);
    text-decoration: none;
    margin-left: 35px;
    font-size: 16px;
    font-weight: 400;
    transition: color 0.3s ease;
}

nav a:hover {
    color: var(--accent-color);
}

/* =========================================
   3. HERO SECTION
   ========================================= */
.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 50px 10%;
    min-height: 80vh;
}

.hero-img-container {
    flex-basis: 40%;
    display: flex;
    justify-content: center;
}

.hero-img {
    width: 450px;
    height: 450px;
    border-radius: 50%;
    box-shadow: 0 0 80px 10px rgba(209, 93, 83, 0.3);
    object-fit: cover;
    background: linear-gradient(145deg, #1a0b0a, #331513); 
}

.hero-content {
    flex-basis: 50%;
}

.hero-content h3 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 10px;
}

.hero-content h3 span {
    color: var(--accent-color);
}

.hero-content h1 {
    font-size: 55px;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.dynamic-text {
    color: var(--accent-color);
    margin-left: 15px;
}

.cursor {
    color: var(--text-main);
    font-weight: 300;
    animation: blink 0.8s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.hero-content p {
    color: var(--text-muted);
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 30px;
    max-width: 600px;
}

.social-icons {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
}

.social-icons a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 45px;
    height: 45px;
    background: transparent;
    border: 2px solid var(--accent-color);
    border-radius: 50%;
    color: var(--accent-color);
    font-size: 20px;
    text-decoration: none;
    transition: 0.3s ease;
}

.social-icons a:hover {
    background: var(--accent-color);
    color: var(--bg-color);
    box-shadow: 0 0 15px var(--accent-color);
}

.btn {
    display: inline-block;
    padding: 12px 40px;
    background-color: var(--accent-color);
    color: var(--text-main);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 18px;
    border: 2px solid var(--accent-color);
    transition: 0.3s ease;
    cursor: pointer;
}

.btn:hover {
    background-color: transparent;
    color: var(--accent-color);
    box-shadow: 0 0 20px rgba(209, 93, 83, 0.4);
}

/* =========================================
   4. ABOUT SECTION (Side-by-Side Resume)
   ========================================= */
.about {
    padding: 100px 10%; 
    background-color: #080808; /* Slight contrast from hero background */
}

.section-title {
    text-align: center;
    font-size: 40px;
    margin-bottom: 60px;
}

.section-title span {
    color: var(--accent-color);
}

.about-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 60px;
}

/* Left Side: Embedded PDF */
.resume-wrapper {
    flex-basis: 48%; /* Takes up roughly half the width */
    height: 750px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid #333;
    background-color: #111;
}

/* Right Side: Text & Details Box */
.about-right-side {
    flex-basis: 48%; /* Takes up the other half */
    display: flex;
    flex-direction: column;
}

.about-text p {
    color: var(--text-muted);
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 20px;
}

.about-details {
    background-color: #111;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #222;
    margin-top: 20px;
    text-align: center;
}

.detail-item {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.detail-item:last-of-type {
    margin-bottom: 30px;
}

.detail-title {
    color: var(--accent-color);
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.detail-info {
    color: var(--text-main);
    font-size: 16px;
}

.resume-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
}

/* =========================================
   5. PROJECTS SECTION - UNIFORM CARD HEIGHT
   ========================================= */
.projects {
    padding: 100px 10%;
    background-color: var(--bg-color); 
}

/* New Category Headings */
.project-category {
    margin-bottom: 80px; /* Space between categories */
}

.project-category:last-of-type {
    margin-bottom: 0;
}

.category-title {
    color: var(--text-main);
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 30px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(199, 18, 1, 0.3);
    display: inline-block;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 40px;
}

.project-card {
    background-color: #111;
    border-radius: 15px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #222;

    /* Turn the card itself into a vertical Flexbox container */
    display: flex;
    flex-direction: column;

    /* Define a minimum height so all cards are at least this tall */
    min-height: 520px; 
    height: 100%; 
}
/* ---------------------------------- */

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(209, 93, 83, 0.2);
    border-color: var(--accent-color);
}

.project-img {
    height: 250px;
    background-color: #1a1a1a; /* Dark grey placeholder box */
    border-bottom: 1px solid #222;
    flex-shrink: 0;
}

.project-img img {
    width: 100%;
    height: 100%; /* Tells the image to fill the strict 250px container */
    object-fit: cover;
    display: block;
}

.project-info {
    padding: 25px;
    /* Make the info container grow to occupy empty space */
    flex-grow: 1; 
    display: flex;
    flex-direction: column;
}

.project-info h4 {
    font-size: 22px;
    margin-bottom: 15px;
    color: var(--text-main);
}

.project-info p {
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    /* Prevent tags from shrinking */
    flex-shrink: 0; 
}

.project-tags span {
    background-color: rgba(209, 93, 83, 0.1);
    color: var(--accent-color);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    /* Ensure span doesn't shrink inside wrap container */
    flex-shrink: 0;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
    margin-top: auto; 
    
}

.project-link:hover {
    color: var(--accent-color);
}

/* =========================================
   6. CONTACT SECTION & FOOTER
   ========================================= */
.contact {
    padding: 100px 10%;
    background-color: #080808; /* Alternating background color */
}

.contact-content {
    display: flex;
    justify-content: space-between;
    gap: 60px;
    margin-top: 50px;
}

/* Left Side Info */
.contact-info {
    flex-basis: 45%;
}

.contact-info h3 {
    font-size: 32px;
    color: var(--text-main);
    margin-bottom: 20px;
}

.contact-info p {
    color: var(--text-muted);
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 30px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.info-item i {
    font-size: 20px;
    color: var(--accent-color);
}

.info-item span {
    color: var(--text-main);
    font-size: 16px;
}

.contact-socials {
    margin-top: 30px;
}

/* Right Side Form */
.contact-form {
    flex-basis: 50%;
}

.contact-form form {
    display: flex;
    flex-direction: column;
}

.input-box {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.input-box input, 
.contact-form textarea {
    width: 100%;
    padding: 18px;
    background-color: #111;
    color: var(--text-main);
    border: 1px solid #333;
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 20px;
    transition: 0.3s ease;
}

.contact-form textarea {
    resize: none;
    height: 200px;
}

/* Highlight the boxes when typing */
.input-box input:focus, 
.contact-form textarea:focus {
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 10px rgba(209, 93, 83, 0.2);
}

.contact-form .btn {
    align-self: flex-start;
    cursor: pointer;
}

/* Footer */
.footer {
    text-align: center;
    padding: 25px;
    background-color: var(--bg-color);
    color: var(--text-muted);
    font-size: 14px;
    border-top: 1px solid #111;
}

/* =========================================
   6. RESPONSIVE DESIGN (Mobile Phones & Tablets)
   ========================================= */
@media (max-width: 900px) {
    header {
        flex-direction: column;
        gap: 20px;
    }
    
    nav a {
        margin: 0 10px;
    }

    .hero {
        flex-direction: column;
        text-align: center;
        gap: 50px;
        padding-top: 20px;
    }
    
    .hero-img-container {
        order: 1;
    }
    
    .hero-content {
        order: 2;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .hero-img {
        width: 300px;
        height: 300px;
    }

    /* Stack About Section Vertically */
    .about-content {
        flex-direction: column;
    }
    
    .resume-wrapper, .about-right-side {
        flex-basis: 100%;
        width: 100%;
    }
    
    .about-right-side {
        order: 1; /* Puts text above the resume on mobile */
    }
    
    .resume-wrapper {
        order: 2; /* Puts resume below text on mobile */
        height: 500px;
        margin-top: 40px;
    }

    .contact-content {
        flex-direction: column;
    }
    .input-box {
        flex-direction: column;
        gap: 0;
    }
}