/* --- Professional Color Palette & Theme Setup --- */
:root {
    --bg-main: #09090b; 
    --bg-card: rgba(24, 24, 27, 0.5); 
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    
    --accent-main: #3b82f6; 
    --accent-alt: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, var(--accent-main), var(--accent-alt), #ec4899);
    --accent-glow: rgba(59, 130, 246, 0.4);
    
    --border-color: rgba(255, 255, 255, 0.08);
    --nav-bg: linear-gradient(120deg, rgba(15, 23, 42, 0.38), rgba(17, 24, 39, 0.32));
    --nav-blend: linear-gradient(110deg, rgba(59, 130, 246, 0.16), rgba(236, 72, 153, 0.05) 55%, rgba(139, 92, 246, 0.14));
    --nav-border: rgba(255, 255, 255, 0.1);
    --nav-shadow: 0 6px 18px rgba(2, 6, 23, 0.18);
    --mobile-menu-bg: #101826;
    --mobile-menu-border: rgba(255, 255, 255, 0.12);
    --mobile-menu-shadow: -16px 0 30px rgba(0, 0, 0, 0.34);
    --mobile-menu-hover: rgba(255, 255, 255, 0.06);
    --mobile-menu-width: min(82vw, 320px);
    --input-bg: rgba(39, 39, 42, 0.4);
}

body.light-theme {
    --bg-main: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.7);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    
    --accent-main: #2563eb; 
    --accent-alt: #7c3aed;
    --accent-glow: rgba(37, 99, 235, 0.3);
    
    --border-color: rgba(0, 0, 0, 0.06);
    --nav-bg: linear-gradient(120deg, rgba(232, 240, 248, 0.5), rgba(225, 236, 248, 0.44));
    --nav-blend: linear-gradient(110deg, rgba(37, 99, 235, 0.13), rgba(125, 211, 252, 0.06) 55%, rgba(124, 58, 237, 0.09));
    --nav-border: rgba(148, 163, 184, 0.24);
    --nav-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
    --mobile-menu-bg: #ffffff;
    --mobile-menu-border: rgba(148, 163, 184, 0.36);
    --mobile-menu-shadow: -14px 0 26px rgba(15, 23, 42, 0.12);
    --mobile-menu-hover: rgba(15, 23, 42, 0.06);
    --input-bg: rgba(255, 255, 255, 0.9);
}

/* --- Smooth Theme Transition --- */
body, .glass-card, #navbar, .skill-tag, .btn, input, textarea, footer, .nav-links {
    transition: background-color 0.6s ease-in-out, color 0.6s ease-in-out, border-color 0.6s ease-in-out, box-shadow 0.6s ease-in-out;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', 'Segoe UI', system-ui, sans-serif; }
html { scroll-behavior: smooth; }

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    z-index: 0;
}

body.menu-open { overflow: hidden; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
a { text-decoration: none; color: inherit; }

/* --- Animated Background Orbs --- */
.bg-orb { position: fixed; border-radius: 50%; filter: blur(120px); z-index: -1; opacity: 0.4; animation: floatOrb 15s infinite alternate ease-in-out; }
.orb-1 { top: -10%; left: -10%; width: 400px; height: 400px; background: var(--accent-main); }
.orb-2 { bottom: -10%; right: -5%; width: 500px; height: 500px; background: var(--accent-alt); animation-delay: -5s; }

@keyframes floatOrb {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(60px, 80px) scale(1.2); }
}

/* --- Shifting Gradient Text --- */
.gradient-animate { background: var(--accent-gradient); background-size: 200% auto; -webkit-background-clip: text; -webkit-text-fill-color: transparent; animation: gradientShift 5s ease infinite; }
@keyframes gradientShift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

.section-title { font-size: 2.5rem; margin-bottom: 2.5rem; display: inline-block; font-weight: 800; }

/* Navbar */
#navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: var(--nav-bg);
    backdrop-filter: blur(22px) saturate(140%);
    -webkit-backdrop-filter: blur(22px) saturate(140%);
    z-index: 1000;
    border-bottom: 1px solid var(--nav-border);
    box-shadow: var(--nav-shadow);
    overflow: visible;
}
#navbar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--nav-blend);
    opacity: 0.42;
    pointer-events: none;
}
.nav-content {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 75px;
}
.logo { 
    display: flex; 
    align-items: center; 
    font-size: 1.8rem; 
    font-weight: 800;
    transition: opacity 0.3s ease;
}
.logo:hover { opacity: 0.8; }
.logo-img { 
    border-radius: 10px;
    height: 55px; 
    width: auto; 
    max-width: 150px;
    object-fit: contain;
}
.nav-links { display: flex; align-items: center; list-style: none; gap: 2.5rem; font-weight: 500; }
.nav-links a { position: relative; padding-bottom: 5px; }
.nav-links a::after { content: ''; position: absolute; width: 0; height: 2px; bottom: 0; left: 0; background: var(--accent-main); transition: width 0.3s ease; }
.nav-links a:hover::after { width: 100%; }

.menu-btn {
    display: none;
    width: 2.6rem;
    height: 2.6rem;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-primary);
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 1004;
    transition: color 0.3s ease, right 0.38s ease;
}

.menu-btn-lines {
    width: 1.6rem;
    height: 1.2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

.menu-btn-lines span {
    display: block;
    width: 100%;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform 0.28s ease, opacity 0.2s ease;
    transform-origin: center;
}

.menu-btn.active .menu-btn-lines span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.menu-btn.active .menu-btn-lines span:nth-child(2) {
    opacity: 0;
}

.menu-btn.active .menu-btn-lines span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.menu-btn:hover {
    color: var(--accent-main);
}
#theme-toggle { background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--text-primary); transition: transform 0.3s ease; }
#theme-toggle:hover { transform: scale(1.15) rotate(15deg); }

/* --- Hero Section (New Two-Column Layout) --- */
#hero { 
    min-height: 100vh; 
    display: flex; 
    flex-direction: row; 
    align-items: center; 
    justify-content: space-between; 
    padding-top: 100px; 
    gap: 2rem;
}
.hero-content { flex: 1; max-width: 600px; }
#hero h1 { font-size: 5rem; line-height: 1.1; margin-bottom: 1rem; font-weight: 800; letter-spacing: -1.5px; }
#hero h2 { font-size: 2.2rem; color: var(--text-primary); margin-bottom: 1.5rem; min-height: 52px; font-weight: 400; }
#hero p { font-size: 1.25rem; color: var(--text-secondary); max-width: 600px; margin-bottom: 2.5rem; }

/* Phone Frame Styles */
.hero-image-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}
.phone-frame {
    width: 280px;
    height: 580px;
    background-color: #000;
    border-radius: 40px;
    border: 10px solid #222; /* Dark sleek bezel */
    box-shadow: 
        0 0 0 2px rgba(255,255,255,0.1), /* Rim highlight */
        0 25px 50px -12px rgba(0,0,0,0.5); /* Deep drop shadow */
    position: relative;
    overflow: hidden;
    animation: floatPhone 6s ease-in-out infinite;
}
.notch {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 25px;
    background-color: #222;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
    z-index: 10;
}
.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures the image fills the phone beautifully */
}

@keyframes floatPhone {
    0%, 100% { transform: translateY(0px) rotate(-2deg); }
    50% { transform: translateY(-15px) rotate(2deg); }
}

/* Premium Shine Button */
.btn { position: relative; padding: 1rem 2.5rem; border-radius: 8px; font-weight: 600; font-size: 1.05rem; cursor: pointer; border: none; display: inline-block; text-align: center; overflow: hidden; }
.btn-primary { background: var(--accent-main); color: #fff; box-shadow: 0 10px 20px -10px var(--accent-glow); transition: transform 0.3s ease, box-shadow 0.3s ease; }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 15px 25px -10px var(--accent-glow); }
.btn-primary::after { content: ''; position: absolute; top: -50%; left: -60%; width: 20%; height: 200%; background: rgba(255,255,255,0.3); transform: rotate(45deg); transition: all 0.6s ease; }
.btn-primary:hover::after { left: 120%; }
.w-100 { width: 100%; }

/* Sections */
section { padding: 120px 0; }
.about-text { font-size: 1.15rem; color: var(--text-secondary); }

/* Glass Cards */
.glass-card { background: var(--bg-card); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid var(--border-color); border-radius: 16px; padding: 2.5rem; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05); transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.4s ease; }
.skills-grid { display: flex; flex-wrap: wrap; gap: 1rem; }
.skill-tag { background: var(--bg-card); color: var(--text-primary); padding: 0.8rem 1.6rem; border-radius: 50px; font-weight: 500; border: 1px solid var(--border-color); backdrop-filter: blur(10px); transition: all 0.3s ease; }
.skill-tag:hover { background: var(--accent-main); color: #fff; border-color: var(--accent-main); transform: translateY(-3px); box-shadow: 0 5px 15px var(--accent-glow); }

/* Projects Grid */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }
.projects-grid .glass-card:hover { transform: translateY(-10px); border-color: var(--accent-main); box-shadow: 0 15px 30px rgba(0,0,0,0.1); }
.glass-card h4 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.subtitle { color: var(--accent-main); font-size: 0.95rem; font-weight: 600; margin-bottom: 1.2rem; text-transform: uppercase; letter-spacing: 1px; }
.glass-card p { color: var(--text-secondary); font-size: 1rem; }

/* Contact Form */
.contact-wrapper { max-width: 700px; margin: 0 auto; }
.contact-form { display: flex; flex-direction: column; gap: 1.5rem; }
.input-group { display: flex; flex-direction: column; gap: 0.5rem; }
.input-group label { font-weight: 600; font-size: 0.95rem; color: var(--text-secondary); }
input, textarea { width: 100%; padding: 1.2rem; border-radius: 8px; border: 1px solid var(--border-color); background: var(--input-bg); color: var(--text-primary); font-size: 1rem; outline: none; transition: all 0.3s ease; }
input:focus, textarea:focus { border-color: var(--accent-main); box-shadow: 0 0 0 4px var(--accent-glow); background: var(--bg-card); }
.form-success { color: #10b981; text-align: center; font-weight: 600; font-size: 1.1rem; opacity: 0; transform: translateY(10px); transition: all 0.4s ease; height: 0; overflow: hidden; }
.form-success.show-msg { opacity: 1; transform: translateY(0); height: auto; padding-top: 15px; }

/* Footer */
footer { background: var(--bg-card); border-top: 1px solid var(--border-color); padding: 4rem 0 2rem; margin-top: 50px; backdrop-filter: blur(20px); }
.footer-content { display: flex; flex-direction: column; align-items: center; gap: 2rem; text-align: center; }
.footer-logo { font-size: 1.8rem; font-weight: 800; }
.social-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 2rem; }
.social-links a { color: var(--text-secondary); font-size: 1.8rem; transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); display: inline-block; }
.social-links a:hover { color: var(--accent-main); transform: translateY(-6px) scale(1.1); }
.copyright { color: var(--text-secondary); font-size: 0.9rem; margin-top: 1rem; }

/* --- Advanced Staggered Scroll Animations --- */
.hidden { opacity: 0; transform: translateY(40px); transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94); }
.show { opacity: 1; transform: translateY(0); }
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.3s; }
.stagger-3 { transition-delay: 0.5s; }

/* =========================================
   MOBILE RESPONSIVENESS (All Phones)
========================================= */
@media (max-width: 768px) {
    .menu-btn {
        display: inline-flex;
        position: fixed;
        top: 1.05rem;
        right: 1rem;
    }

    body.menu-open .menu-btn {
        right: calc(var(--mobile-menu-width) - 3.45rem);
    }
    
    .nav-links {
        position: fixed;
        top: 0;
        right: 0;
        width: var(--mobile-menu-width);
        height: 100dvh;
        background: var(--mobile-menu-bg);
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        gap: 0.15rem;
        padding: 5.75rem 1.15rem 1.5rem;
        transform: translateX(105%);
        opacity: 0;
        pointer-events: none;
        border-left: 1px solid var(--mobile-menu-border);
        box-shadow: var(--mobile-menu-shadow);
        transition: transform 0.38s ease, opacity 0.28s ease;
        z-index: 1002;
    }
    .nav-links.active { transform: translateX(0); opacity: 1; pointer-events: auto; }

    .nav-links li {
        width: 100%;
        border-bottom: 1px solid var(--mobile-menu-border);
    }

    .nav-links li:last-child {
        border-bottom: none;
        margin-top: 0.45rem;
    }

    .nav-links a {
        display: block;
        width: 100%;
        padding: 0.85rem 0.7rem;
        font-size: 1rem;
        font-weight: 600;
        border-radius: 10px;
        transition: background-color 0.25s ease, color 0.25s ease;
    }

    .nav-links a::after {
        display: none;
    }

    .nav-links a:hover,
    .nav-links a:focus-visible {
        background: var(--mobile-menu-hover);
    }

    #theme-toggle {
        margin-left: 0.7rem;
        margin-top: 0.45rem;
    }

    /* Change Hero to Stacked layout on Mobile */
    #hero {
        flex-direction: column;
        text-align: center;
        padding-top: 120px;
    }
    .hero-content {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    #hero h1 { font-size: 3rem; }
    #hero h2 { font-size: 1.6rem; min-height: 40px; }
    #hero p { font-size: 1.1rem; }
    
    /* Make Phone Smaller on Mobile */
    .phone-frame {
        width: 240px;
        height: 500px;
    }

    .section-title { font-size: 2rem; margin-bottom: 2rem; }
    section { padding: 80px 0; }
    .glass-card { padding: 1.5rem; }
    .projects-grid { grid-template-columns: 1fr; }
    .social-links { gap: 1.5rem; }

    /* Reduce background orb size on mobile */
    .orb-1 { width: 250px; height: 250px; }
    .orb-2 { width: 300px; height: 300px; }
}