/* Base Reset and Typography */
html {
    scroll-behavior: smooth;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: #050508; 
    color: #ffffff;
    position: relative;
    overflow-x: hidden; 
}

/* --- Navigation Bar (Frosted Neon Glass) --- */
nav {
    display: flex;
    justify-content: space-between;
    padding: 1.5rem 5rem; 
    position: fixed; 
    width: 100%;
    top: 0;
    z-index: 100;
    background: rgba(5, 5, 8, 0.75); 
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(138, 79, 255, 0.3); 
    box-shadow: 0 10px 30px rgba(138, 79, 255, 0.15); 
}

.logo {
    font-weight: 700;
    font-size: 1.2rem;
}

.nav-links a {
    color: #ffffff;
    text-decoration: none;
    margin-left: 2.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.nav-links a:hover {
    color: #c19cf5;
    text-shadow: 0 0 10px rgba(138, 79, 255, 0.6); 
}

/* --- Social Links Pill Container (Desktop Layout) --- */
.social-links {
    position: fixed;
    left: 2rem; 
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    z-index: 100;
    background: rgba(5, 5, 8, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(138, 79, 255, 0.2); 
    padding: 1.5rem 1rem;
    border-radius: 50px; 
    box-shadow: 0 5px 20px rgba(138, 79, 255, 0.1); 
}

.social-links a {
    color: #888;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-links a:hover {
    color: #c19cf5; 
    transform: scale(1.15); 
    filter: drop-shadow(0 0 8px rgba(138, 79, 255, 0.8)); 
}

/* --- Main Hero Layout --- */
.hero {
    display: flex;
    justify-content: space-between;
    align-items: center; 
    height: 100vh; 
    padding: 0 8%; 
    position: relative;
    gap: 2rem; 
}

.left-text {
    z-index: 2;
    flex: 1; 
}

.name {
    font-size: 4rem; 
    line-height: 1.1;
    font-weight: 700;
}

/* --- Center Portrait Box Layout & Glow Effects --- */
.center-portrait {
    position: relative; 
    flex: 0 0 350px; 
    height: 480px; 
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    cursor: pointer; 
}

.glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 350px; 
    height: 350px;
    background: radial-gradient(circle, rgba(105, 40, 210, 0.5) 0%, rgba(105, 40, 210, 0) 70%);
    filter: blur(60px);
    z-index: -1; 
    border-radius: 50%;
}

.portrait-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    position: absolute;
    bottom: 0;
    mask-image: linear-gradient(to bottom, black 75%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 75%, transparent 100%);
    transition: all 0.6s cubic-bezier(0.25, 0.8, 0.25, 1); 
    z-index: 2;
}

.portrait-intro {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -40%); 
    width: 85%;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 3;
    pointer-events: none; 
}

.portrait-intro h3 {
    color: #c19cf5;
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.portrait-intro p {
    font-size: 0.95rem;
    color: #e0e0e0;
    line-height: 1.7;
}

/* Cinematic Hover Micro-interactions */
.center-portrait:hover .portrait-img {
    opacity: 0.08; 
    transform: scale(0.95); 
    filter: blur(8px);
}

.center-portrait:hover .portrait-intro {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%); 
}

.right-text {
    z-index: 2;
    text-align: right;
    flex: 1; 
}

.role-title {
    font-size: 3.8rem; 
    line-height: 1.1;
    font-weight: 700;
    background: linear-gradient(to right, #6b21db, #c19cf5);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Fixed Desktop Floating Actions */
.resume-btn {
    position: fixed;
    right: 4rem;
    bottom: 2.5rem;
    color: #888;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 2px;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 100;
}

.resume-btn:hover {
    color: #ffffff;
}

/* --- Featured Project Cards Layout --- */
.projects-section {
    min-height: 100vh;
    padding: 6rem 12%;
    background-color: #050508; 
    position: relative;
    z-index: 2;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 4rem;
    text-align: center;
    background: linear-gradient(to right, #ffffff, #888888);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
}

.project-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 2.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    cursor: pointer;
    position: relative;
}

.project-card:hover {
    transform: translateY(-5px);
    border-color: rgba(138, 79, 255, 0.4);
    box-shadow: 0 10px 30px rgba(105, 40, 210, 0.15);
    background: rgba(255, 255, 255, 0.04);
}

.project-name {
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 1rem;
}

.project-desc {
    color: #a0a0a0;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

/* Custom CSS Advanced Tooltips logic */
.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.tech-stack span {
    background: rgba(138, 79, 255, 0.1);
    color: #c19cf5;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    position: relative; 
    cursor: help; 
}

.tech-stack span::after {
    content: attr(data-detail); 
    position: absolute;
    bottom: 140%; 
    left: 50%;
    transform: translateX(-50%) translateY(10px); 
    background-color: #0d0d14;
    color: #e0e0e0;
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 400;
    white-space: normal; 
    width: max-content;
    max-width: 200px;
    text-align: center;
    line-height: 1.4;
    border: 1px solid rgba(138, 79, 255, 0.4);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 10;
}

.tech-stack span:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* --- Contact Area & Connected Action Bar Layouts --- */
.contact-section {
    min-height: 80vh;
    padding: 6rem 12%;
    background-color: #050508;
    position: relative;
    z-index: 2;
}

.contact-container {
    display: flex;
    justify-content: space-between;
    gap: 4rem;
    align-items: flex-start;
}

.contact-info {
    flex: 1;
}

.contact-info h3 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #ffffff;
}

.contact-info p {
    color: #a0a0a0;
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 2.5rem;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #c19cf5;
    font-weight: 500;
}

.contact-item svg {
    color: #8a4fff;
}

/* Contact Connect Bar Layout */
.contact-connect-bar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-top: 2.5rem;
}

.connect-icon {
    color: #888;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.connect-icon:hover {
    color: #c19cf5;
    transform: translateY(-3px);
    filter: drop-shadow(0 0 8px rgba(138, 79, 255, 0.6));
}

.connect-resume-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(138, 79, 255, 0.1);
    border: 1px solid rgba(138, 79, 255, 0.3);
    color: #c19cf5;
    padding: 0.6rem 1.4rem;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.connect-resume-btn:hover {
    background: rgba(138, 79, 255, 0.2);
    border-color: #8a4fff;
    transform: translateY(-3px);
    box-shadow: 0 0 20px rgba(138, 79, 255, 0.3);
    color: #ffffff;
}

.contact-form-wrapper {
    flex: 1;
    width: 100%;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-group input,
.input-group textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: #ffffff;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.input-group input::placeholder,
.input-group textarea::placeholder {
    color: #666;
}

.input-group input:focus,
.input-group textarea:focus {
    border-color: #8a4fff;
    box-shadow: 0 0 15px rgba(138, 79, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
}

.submit-btn {
    background: linear-gradient(to right, #6b21db, #8a4fff);
    color: #ffffff;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    align-self: flex-start;
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(105, 40, 210, 0.3);
}

footer {
    text-align: center;
    padding: 2rem 12%;
    background-color: #030305;
    color: #555;
    font-size: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* --- Responsive Layout Breakpoints --- */
@media (max-width: 1024px) {
    .name { font-size: 3.5rem; }
    .role-title { font-size: 3.2rem; }
    .center-portrait { flex: 0 0 300px; height: 420px; } 
    .glow { width: 300px; height: 300px; }
}

/* RESPONSIVE RENDERING MATRIX FOR MOBILE DEVICES */
@media (max-width: 768px) {
    .hero {
        flex-direction: column; 
        justify-content: flex-start; 
        padding-top: 9.5rem; /* Prevents stacked nav bars from covering content */
        text-align: center;
        gap: 0;
        height: auto;
        min-height: 100vh;
    }

    .left-text, .right-text {
        text-align: center;
        flex: none;
        width: 100%;
        position: relative;
    }

    .name {
        font-size: 2.8rem;
        line-height: 1.2;
        margin-top: 0.5rem;
        margin-bottom: 1rem;
    }

    .role-title {
        font-size: 2.8rem;
        line-height: 1.2;
    }

    /* Suppresses fixed desktop positioning wrappers safely on touch viewports */
    .social-links, .resume-btn {
        display: none !important;
    }

    /* Centers integrated link blocks beautifully under mobile descriptions */
    .contact-connect-bar {
        justify-content: center;
        margin-bottom: 1rem;
    }

    .center-portrait {
        position: relative;
        margin: 0 auto 2.5rem auto; 
        width: 100%;
        max-width: 260px;
        height: 380px;
        flex: none;
        z-index: 5;
    }

    .portrait-img {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
        position: absolute;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
        mask-image: none;
        -webkit-mask-image: none;
    }

    .portrait-intro {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -45%);
        width: 95%;
    }

    .portrait-intro h3 {
        font-size: 1.4rem;
        margin-bottom: 0.5rem;
    }

    .portrait-intro p {
        font-size: 0.85rem;
        line-height: 1.6;
    }

    .center-portrait:hover .portrait-img {
        opacity: 0.1;
        filter: blur(6px);
    }

    .center-portrait:hover .portrait-intro {
        opacity: 1;
        visibility: visible;
        transform: translate(-50%, -50%);
    }

    nav {
        padding: 1rem;
        justify-content: center;
        flex-direction: column;
        align-items: center;
        gap: 0.6rem;
        background: rgba(5, 5, 8, 0.95);
    }

    .logo {
        text-align: center;
        width: 100%;
        margin-bottom: 0.2rem;
    }

    .nav-links {
        display: flex;
        gap: 1.5rem;
    }

    .nav-links a {
        margin: 0;
        font-size: 0.85rem;
    }

    .project-grid {
        grid-template-columns: 1fr;
    }

    .contact-container {
        flex-direction: column;
        gap: 3rem;
    }

    .contact-info h3 {
        font-size: 1.7rem;
    }

    .submit-btn {
        width: 100%;
        align-self: stretch;
    }
}