/* =========================================
   1. GLOBAL & LAYOUT BASE
   ========================================= */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Google Sans', 'Montserrat', sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #90bcfe 0%, #a83878 100%) fixed;
    overflow-x: hidden; /* Prevents horizontal scrolling issues on mobile */
}

main {
    width: 100%;
}

section {
    min-height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 80px 20px;
    box-sizing: border-box;
    scroll-margin-top: 70px;
}

/* =========================================
   2. TYPOGRAPHY & BUTTONS
   ========================================= */
.bigHeading {
    font-size: 6rem;
    margin-bottom: 20px;
    color: #fff;
    text-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #7a37a6 0%, #b83881 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: bold;
}

.btn {
    font-family: 'Google Sans', 'Montserrat', sans-serif;
    font-size: 1rem;
    margin: 2rem 0;
    padding: 15px 35px;
    background: linear-gradient(135deg, #7a37a6 0%, #b83881 100%);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(122, 55, 166, 0.3);
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 25px rgba(122, 55, 166, 0.4);
    filter: brightness(1.1);
}

/* =========================================
   3. SHARED SECTION STYLES (GLASSMORPHISM)
   ========================================= */
   /* =========================================
   3. UNIFIED GLASSMORPHISM PANELS
   ========================================= */
.glass-panel, .portfolio-category, .about-me, .resume, .contact {
    background: rgba(255, 255, 255, 0.85);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 1200px;
    margin: 40px auto;
    padding: 60px;
    color: #333;
    
    /* Animation defaults */
    opacity: 0; 
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.25, 1, 0.5, 1);
    will-change: transform, opacity;
}

.glass-panel.appear, .portfolio-category.appear, .about-me.appear, .resume.appear, .contact.appear {
    opacity: 1;
    transform: translateY(0);
}
.about-me, .resume, .contact, .portfolio-category {
    background: rgba(255, 255, 255, 0.85);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 1200px;
    margin: 80px auto;
    padding: 50px;
    color: #333;
    box-sizing: border-box;
    opacity: 0; 
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.25, 1, 0.5, 1);
    will-change: transform, opacity;
}

.about-me.appear, .resume.appear, .contact.appear, .portfolio-category.appear {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================
   4. NAVBAR
   ========================================= */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 2%;
    box-sizing: border-box;
    transition: background 0.3s ease, padding 0.3s ease;
    will-change: background, padding; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.95);
    padding: 0px 5%;
    backdrop-filter: none; 
    -webkit-backdrop-filter: none;
}

.navbar ul {
    list-style: none;
    display: flex;
    gap: 30px;
    margin: 0;
    padding: 0;
}

.navbar a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.navbar.scrolled ul li a,
.navbar.scrolled .hari {
    color: #333;
}

.navbar.scrolled .menu-icon {
    filter: invert(1);
}

.menu-icon {
    display: none;
    width: 30px;
    height: 30px;
    cursor: pointer;
}

/* Animated Logo Text */
.hari {
    font-size: 2rem;
    font-weight: bold;
    display: flex;
    gap: 2px;
    color: antiquewhite;
}

.hari span {
    display: inline-block;
    color: #fff;
    animation: wavy-text 2s ease-out infinite;
    animation-delay: calc(0.1s * var(--i));
}

@keyframes wavy-text {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); color: #ffffff; }
}

/* =========================================
   5. HOME SECTION & WAVES
   ========================================= */
.home {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    padding: 0 10%;
    min-height: 100vh;
    box-sizing: border-box;
    animation: main-float 6s ease-in-out infinite;
    will-change: transform;
    position: relative;
    overflow: hidden;
    background: linear-gradient(315deg, #a83878 3%, #7194c7 38%, #3aa19b 68%, #a83878 98%);
    background-size: 400% 400%;
    animation: gradient-shift 15s ease infinite;
    z-index: 1;
}

@keyframes gradient-shift {
    0% { background-position: 0% 0%; }
    50% { background-position: 100% 100%; }
    100% { background-position: 0% 0%; }
}

@keyframes main-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.home-content, .pfp-container {
    transition: opacity 0.1s linear; 
    will-change: opacity; 
}

.home-content {
    flex: 1;
    max-width: 600px;
}

.pfp-container {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.pfp {
    width: 500px;
    height: 500px;
    object-fit: cover;
    border-radius: 50%;
    border: 8px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    animation: float 4s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* Waves */
.wave {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 1000% 1000% 0 0;
    position: absolute; 
    width: 200%;
    height: 12em;
    animation: wave-move 10s -3s linear infinite;
    transform: translate3d(0, 0, 0);
    opacity: 0.5;
    bottom: 0;
    left: 0;
    z-index: -1; 
}

.wave:nth-of-type(2) {
    bottom: -1.25em;
    animation: wave-move 18s linear reverse infinite;
    opacity: 0.3;
}

.wave:nth-of-type(3) {
    bottom: -2.5em;
    animation: wave-move 20s -1s reverse infinite;
    opacity: 0.2;
}

@keyframes wave-move {
    0% { transform: translateX(0); }
    25% { transform: translateX(-25%); }
    50% { transform: translateX(-50%); }
    75% { transform: translateX(-25%); }
    100% { transform: translateX(0); }
}

/* =========================================
   6. ABOUT ME
   ========================================= */
.about-container {
    display: flex;
    flex-wrap: wrap;
    gap: 50px;
    align-items: flex-start;
    width: 100%;
}

.about-text {
    flex: 1.5;
    min-width: 300px;
    text-align: left;
}

.about-text p {
    line-height: 1.8;
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: #444;
}

.skills-grid {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.skill-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-left: 4px solid #7a37a6;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.skill-card:hover {
    transform: translateX(5px);
}

.skill-icon {
    font-size: 1.5rem;
    color: #7a37a6;
    margin-bottom: 10px;
}

.skill-card h3 {
    margin: 0 0 8px 0;
    color: #222;
    font-size: 1.2rem;
}

.skill-card p {
    margin: 0;
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* =========================================
   7. RESUME / TECH SPECS
   ========================================= */
.resume.appear .resume-item {
    animation: fadeInUp 0.6s ease forwards;
}

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

.resume-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    text-align: left;
}

.resume-block h3 {
    color: #7a37a6;
    border-bottom: 2px solid rgba(122, 55, 166, 0.2);
    padding-bottom: 10px;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.resume-block.specs {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.resume-item {
    margin-bottom: 25px;
}

.resume-item h4 {
    margin: 0;
    font-size: 1.2rem;
}

.date {
    display: block;
    font-size: 0.9rem;
    color: #b83881;
    margin-bottom: 10px;
}

.specs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
    justify-content: flex-start;
    margin-top: 10px;
    width: 100%;
}

.spec-tag {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(122, 55, 166, 0.1);
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    color: #7a37a6;
    white-space: nowrap;
    height: 35px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.spec-tag:hover {
    background: rgba(122, 55, 166, 0.2);
    transform: translateY(-2px);
    border-color: rgba(122, 55, 166, 0.3);
}

/* =========================================
   8. FEATURED WORKS (INDEX PREVIEW GRID)
   ========================================= */
.featured-works-section {
    padding: 80px 20px;
    background-color: #fafafa;
}

.works-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 1000px;
    margin: 0 auto;
}

.preview-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 30px 20px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(122, 55, 166, 0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.preview-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(122, 55, 166, 0.15);
    border-color: rgba(122, 55, 166, 0.4);
}

.preview-icon {
    width: 60px;
    height: 60px;
    background: rgba(122, 55, 166, 0.1);
    color: #7a37a6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.preview-card:hover .preview-icon {
    background: #7a37a6;
    color: #ffffff;
}

.preview-card h3 {
    margin: 0 0 10px 0;
    font-size: 1.2rem;
    color: #222;
}

.preview-card p {
    margin: 0;
    font-size: 0.95rem;
    color: #666;
    line-height: 1.5;
}

/* =========================================
   9. PORTFOLIO GALLERY (FULL PAGE)
   ========================================= */
.portfolio-main {
    padding-top: 120px;
    padding-bottom: 60px;
    min-height: 100vh;
}

.portfolio-header {
    text-align: center;
    margin-bottom: 50px;
}

.portfolio-header h1 {
    font-size: 3rem;
}

.portfolio-header p {
    color: antiquewhite;
    font-size: 1.2rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.active-link {
    color: #b83881 !important;
    border-bottom: 2px solid #b83881;
}

.portfolio-gallery {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 60px;
}

.category-title {
    font-size: 2rem;
    color: #7a37a6;
    margin-bottom: 30px;
    border-bottom: 2px solid rgba(122, 55, 166, 0.2);
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.gallery-card {
    background: #fff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05);
    display: flex; 
    flex-direction: column; 
    text-decoration: none;
    color: inherit;
}

.gallery-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(122, 55, 166, 0.2);
}

.card-media {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    overflow: hidden;
    position: relative;
}

.card-media img, .card-media iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: none;
}

.placeholder-media {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #c3d9fb;
    color: #333;
    font-weight: bold;
    font-size: 1.2rem;
}

.card-info {
    padding: 25px 20px;
    text-align: left;
    display: flex;
    flex-direction: column;
    flex-grow: 1; 
}

.card-info h3 {
    margin: 0 0 5px 0;
    color: #333;
    font-size: 1.25rem;
    line-height: 1.3;
}

.card-role {
    font-size: 0.85rem;
    color: #b83881;
    font-weight: bold;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-info p {
    color: #555;
    font-size: 0.9rem;
    margin-bottom: 25px;
    line-height: 1.6;
    text-align: left;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px;
    margin-top: auto; 
}

.tech-tags span {
    background: rgba(122, 55, 166, 0.1);
    color: #7a37a6;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
}

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

/* =========================================
   10. CONTACT & FOOTER
   ========================================= */
.contact {
    text-align: center;
}

.contact-subtitle {
    margin-bottom: 40px;
    color: #666;
    font-size: 1.1rem;
}

.contact-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.contact-card {
    text-decoration: none;
    color: inherit;
    background: rgba(122, 55, 166, 0.05);
    padding: 30px;
    border-radius: 15px;
    width: 100%;
    max-width: 400px;
    transition: all 0.3s ease;
    border: 1px solid rgba(122, 55, 166, 0.1);
}

.contact-card:hover {
    background: rgba(122, 55, 166, 0.1);
    transform: scale(1.02);
}

.social-links-container h3 {
    margin-bottom: 20px;
    color: #7a37a6;
}

.social-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

.social-tag {
    text-decoration: none;
    background: #fff;
    color: #b83881;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    font-size: 0.9rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    border: 1px solid rgba(184, 56, 129, 0.2);
}

.social-tag:hover {
    background: #b83881;
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(184, 56, 129, 0.3);
}

footer {
    color: #4e0048;
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.21);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(9.6px);
    -webkit-backdrop-filter: blur(9.6px);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
}
/* =========================================
   10. CONTACT & FOOTER
   ========================================= */
.contact-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.social-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

.social-tag {
    text-decoration: none;
    background: #fff;
    color: #b83881;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    font-size: 0.9rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    border: 1px solid rgba(184, 56, 129, 0.2);
}

.social-tag:hover {
    background: #b83881;
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(184, 56, 129, 0.3);
}

footer {
    color: #4e0048;
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.21);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(9px);
    -webkit-backdrop-filter: blur(9px);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    margin-top: 40px;
}

/* =========================================
   11. UNIFIED RESPONSIVE STYLES (TABLET/MOBILE)
   ========================================= */

/* For Tablets and smaller desktop screens */
@media (max-width: 992px) {
    .about-me, .resume, .contact, .portfolio-category {
        padding: 30px;
        width: 95%;
    }
    
    .home {
        padding: 0 5%;
    }
    
    .about-container {
        gap: 30px;
    }
}

/* For Mobile Phones */
@media (max-width: 768px) {
    /* Navbar Dropdown */
    .menu-icon {
        display: block;
        transition: transform 0.4s ease;
    }
    
    .navbar ul {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        flex-direction: column;
        background: rgba(255, 255, 255, 0.98);
        padding: 20px 0;
        gap: 15px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    }
    
    .navbar ul.active {
        display: flex;
    }
    
    .navbar ul li a {
        color: #333; /* Make text dark so it's readable on white background */
        display: block;
        padding: 10px;
        text-align: center;
        font-size: 1.1rem;
    }

    .hari {
        font-size: 1.5rem;
    }

    /* Home Hero Section */
    .home {
        flex-direction: column-reverse; /* Stacks text under the image */
        justify-content: center;
        text-align: center;
        padding-top: 120px; 
    }
    
    .home-content {
        margin-top: 20px;
    }

    .bigHeading {
        font-size: 2.5rem; /* Shrink giant text */
        line-height: 1.2;
    }

    .pfp-container {
        justify-content: center;
        width: 100%;
    }

    .pfp {
        width: 220px; /* Shrink image so it fits on screen */
        height: 220px;
        border-width: 4px;
    }

    /* Main Section Containers */
    .about-me, .resume, .contact, .portfolio-category {
        padding: 25px 15px;
        margin: 40px auto;
        width: 95%;
    }

    .section-title {
        font-size: 1.8rem;
    }

    /* About Section */
    .about-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .about-text {
        text-align: center;
    }

    /* Resume Section */
    .resume-grid {
        grid-template-columns: 1fr; /* Make resume single column */
        gap: 20px;
    }

    .specs {
        justify-content: center; /* Center the tags on mobile */
    }

    /* Contact Section */
    .social-tag {
        width: 130px;
        text-align: center;
    }

    /* Portfolio Pages & Grids */
    .category-title {
        font-size: 1.4rem;
        flex-direction: column; /* Stacks icon above title if screen is too narrow */
        text-align: center;
        gap: 5px;
    }

    .portfolio-header h1 {
        font-size: 2rem;
    }

    .gallery-grid {
        grid-template-columns: 1fr; /* Force 1 column on mobile */
    }

    .gallery-card {
        max-width: 100%; /* Allows cards to stretch full width of screen */
    }
    
    .works-preview-grid {
        grid-template-columns: 1fr; /* Force works preview to 1 column */
    }
}
