/* --- Variables & Setup --- */
:root {
    --bg-main: #060913;
    --bg-secondary: #0f1629;
    --text-main: #f8fafc;
    --text-muted: #cbd5e1;
    --accent-primary: #3b82f6;
    --accent-secondary: #8b5cf6;
    --accent-tertiary: #10b981;
    --accent-quaternary: #f43f5e;
    --gradient-primary: linear-gradient(135deg, #3b82f6, #8b5cf6);
    --glass-bg: rgba(15, 22, 41, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
}

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

/* Orb Container to fix overflow causing blank space below footer */
.orb-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

h1, h2, h3, h4, h5, h6, .logo {
    font-family: 'Outfit', sans-serif;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

/* --- Background Orbs (Bling) --- */
.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.15;
    animation: float-orb 15s infinite alternate ease-in-out;
}

.bg-orb-1 {
    top: -10%;
    left: -10%;
    width: 60vw;
    height: 60vw;
    background: var(--accent-primary);
}

.bg-orb-2 {
    top: 40%;
    right: -10%;
    width: 50vw;
    height: 50vw;
    background: var(--accent-secondary);
    animation-delay: -5s;
}

.bg-orb-3 {
    bottom: -10%;
    left: 20%;
    width: 40vw;
    height: 40vw;
    background: var(--accent-tertiary);
    animation-delay: -10s;
}

@keyframes float-orb {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(5%, 10%) scale(1.1); }
}

/* --- Reusable Components --- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2.5rem;
}

.section {
    padding: 120px 0;
}

.section-title {
    font-size: 3rem;
    margin-bottom: 3.5rem;
    position: relative;
    display: inline-block;
    color: #fff;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 80px;
    height: 5px;
    background: var(--gradient-primary);
    border-radius: 3px;
}

.btn {
    display: inline-block;
    padding: 0.85rem 1.75rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
}

.btn-outline {
    background: transparent;
    color: var(--accent-primary);
    border: 1px solid var(--accent-primary);
}

.btn-outline:hover {
    background: rgba(59, 130, 246, 0.15);
    transform: translateY(-3px);
}

.btn-large {
    padding: 1rem 2.5rem;
    font-size: 1.15rem;
}

/* --- Navbar --- */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 0;
    z-index: 1000;
    transition: var(--transition);
    background: transparent;
}

#navbar.scrolled {
    background: rgba(6, 9, 19, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 1rem 0;
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: white;
}

.logo span {
    color: var(--accent-primary);
}

.nav-links {
    display: flex;
    gap: 2.5rem;
}

.nav-links li a {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-muted);
}

.nav-links li a:hover {
    color: white;
}

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: white;
}

/* --- Hero Section --- */
#hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 110px 10% 60px; /* Reduced top padding */
    position: relative;
    overflow: hidden;
}

.hero-content {
    flex: 1;
    max-width: 650px;
    z-index: 2;
}

.greeting {
    font-family: 'Inter', sans-serif;
    color: var(--accent-primary);
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.name {
    font-size: 5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 0.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.title {
    font-size: 2.8rem;
    color: white;
    font-weight: 700;
    margin-bottom: 1.5rem;
    opacity: 0.95;
}

.summary {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
    max-width: 550px;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.social-links {
    display: flex;
    gap: 1.5rem;
}

.social-links a {
    font-size: 1.3rem;
    color: var(--text-muted);
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
}

.social-links a:hover {
    color: white;
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    transform: translateY(-4px);
    box-shadow: 0 5px 15px rgba(59,130,246,0.4);
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    z-index: 2;
}

.image-wrapper {
    position: relative;
    width: 400px;
    height: 400px;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    overflow: hidden;
    border: 4px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 15px 50px rgba(0,0,0,0.6);
    z-index: 1;
    animation: floating 6s ease-in-out infinite, morph 8s ease-in-out infinite;
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120%;
    height: 120%;
    background: var(--gradient-primary);
    transform: translate(-50%, -50%);
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.4;
    z-index: -1;
    animation: pulse 4s infinite alternate;
}

@keyframes morph {
    0% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
    50% { border-radius: 70% 30% 30% 70% / 70% 70% 30% 30%; }
    100% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
}

/* Animations */
.float-anim {
    animation: floating 6s ease-in-out infinite;
}
.float-anim-delay-1 {
    animation: floating 6s ease-in-out infinite;
    animation-delay: 1s;
}
.float-anim-delay-2 {
    animation: floating 6s ease-in-out infinite;
    animation-delay: 2s;
}
.float-anim-delay-3 {
    animation: floating 6s ease-in-out infinite;
    animation-delay: 3s;
}

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

@keyframes pulse {
    0% { opacity: 0.3; transform: translate(-50%, -50%) scale(0.9); }
    100% { opacity: 0.6; transform: translate(-50%, -50%) scale(1.1); }
}

/* --- About Section --- */
.about-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 5rem;
    align-items: center;
}

.about-text p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.about-text strong {
    color: white;
}

.about-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.stat-card:last-child {
    grid-column: span 2;
}

.stat-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 2rem 1.5rem;
    border-radius: 16px;
    text-align: center;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.stat-card h3 {
    font-size: 3rem;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
}

.stat-card p {
    color: var(--text-main);
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* --- Experience Section --- */
.timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20px;
    height: 100%;
    width: 2px;
    background: rgba(255,255,255,0.1);
}

.timeline-item {
    position: relative;
    padding-left: 60px;
    margin-bottom: 4rem;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: 9px;
    top: 5px;
    width: 24px;
    height: 24px;
    background: var(--bg-main);
    border: 4px solid var(--accent-primary);
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.6);
}

.timeline-content {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 2.5rem;
    border-radius: 16px;
    transition: var(--transition);
}

.timeline-content:hover {
    transform: translateX(15px);
    border-color: rgba(255,255,255,0.2);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.timeline-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.3rem;
    color: white;
}

.timeline-content h4 {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 1.2rem;
}

.timeline-content h4 span {
    color: var(--accent-primary);
    font-size: 1rem;
    font-weight: 600;
}

.timeline-content p {
    color: var(--text-muted);
    font-size: 1.05rem;
}

/* --- Skills Section --- */
.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
}

.skill-category {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 2.5rem;
    border-radius: 16px;
}

.skill-category h3 {
    margin-bottom: 2rem;
    font-size: 1.4rem;
    color: white;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.skill-tags span {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    font-size: 0.95rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.skill-tags span i {
    font-size: 1.2rem;
}

.skill-tags span:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: var(--accent-primary);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(59,130,246,0.3);
}

/* --- Projects Section --- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2.5rem;
}

.project-card {
    background: var(--glass-bg);
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.08);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    position: relative;
    padding: 2.5rem;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

.project-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.project-icon i {
    font-size: 2.5rem;
    color: var(--accent-primary);
}

.project-links a {
    font-size: 1.3rem;
    color: var(--text-muted);
    transition: var(--transition);
}

.project-links a:hover {
    color: var(--accent-primary);
}

.project-title {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: white;
}

.project-desc {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 2rem;
    flex-grow: 1;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.project-tech li {
    font-size: 0.85rem;
    color: var(--accent-primary);
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
}

.more-projects {
    text-align: center;
    margin-top: 5rem;
}

/* --- Contact Section --- */
.contact-content {
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

.contact-content p {
    color: var(--text-muted);
    font-size: 1.2rem;
    margin-bottom: 3rem;
}

.contact-info {
    margin-top: 4rem;
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.contact-info p {
    font-size: 1.1rem;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.contact-info i {
    color: var(--accent-primary);
    font-size: 1.5rem;
}

/* --- Footer --- */
footer {
    text-align: center;
    padding: 2rem 0;
    border-top: 1px solid var(--glass-border);
    color: var(--text-muted);
    font-size: 1rem;
    background: var(--bg-main); /* Match body to prevent weird visual breaks */
}

/* --- Selene Chatbot --- */
.chat-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
    z-index: 1000;
    transition: var(--transition);
    animation: ripple 2s infinite;
}

.chat-toggle:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.6);
}

.chat-window {
    position: fixed;
    bottom: 110px;
    right: 30px;
    width: 350px;
    height: 500px;
    max-height: calc(100vh - 140px);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1000;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform-origin: bottom right;
}

.chat-window.hidden-chat {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
    pointer-events: none;
}

.chat-header {
    padding: 1.2rem 1.5rem;
    background: rgba(0,0,0,0.3);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
}

.chat-title h3 {
    font-size: 1.1rem;
    color: white;
    margin-bottom: 0.2rem;
}

.chat-title .status {
    font-size: 0.8rem;
    color: var(--accent-tertiary);
    display: flex;
    align-items: center;
    gap: 5px;
}

.chat-title .status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--accent-tertiary);
    border-radius: 50%;
    display: inline-block;
}

.close-chat {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
}

.close-chat:hover {
    color: white;
}

.chat-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}
.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}

.message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.95rem;
    line-height: 1.4;
    animation: fadeInMsg 0.3s ease-in-out;
}

.message.bot {
    background: rgba(255,255,255,0.1);
    color: var(--text-main);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.message.user {
    background: var(--accent-primary);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chat-options {
    padding: 1rem;
    border-top: 1px solid var(--glass-border);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: rgba(0,0,0,0.2);
}

.chat-option-btn {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid var(--accent-primary);
    color: var(--text-main);
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.chat-option-btn:hover {
    background: var(--accent-primary);
    color: white;
}

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

@keyframes ripple {
    0% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.6), 0 4px 20px rgba(59, 130, 246, 0.4);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(59, 130, 246, 0), 0 4px 20px rgba(59, 130, 246, 0.4);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0), 0 4px 20px rgba(59, 130, 246, 0.4);
    }
}

/* --- Electric Border Effect --- */
@property --angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

.stat-card,
.skill-category,
.project-card {
    position: relative;
    background: var(--glass-bg);
    border: none;
    z-index: 1;
}

.stat-card::before,
.skill-category::before,
.project-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 2px; /* Border thickness */
    background: conic-gradient(from var(--angle), transparent 60%, var(--accent-primary) 85%, #fff 95%, var(--accent-primary) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: spinElectric 2.5s linear infinite;
    opacity: 0.7;
    pointer-events: none;
}

/* Extra electric glow on hover */
.stat-card::after,
.skill-category::after,
.project-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 2px;
    background: conic-gradient(from var(--angle), transparent 60%, var(--accent-primary) 85%, #fff 95%, var(--accent-primary) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    filter: blur(8px);
    animation: spinElectric 2.5s linear infinite;
    opacity: 0;
    pointer-events: none;
    z-index: -1;
    transition: opacity 0.3s;
}

.stat-card:hover::before,
.skill-category:hover::before,
.project-card:hover::before {
    opacity: 1;
    animation: spinElectric 1s linear infinite;
}

.stat-card:hover::after,
.skill-category:hover::after,
.project-card:hover::after {
    opacity: 0.8;
    animation: spinElectric 1s linear infinite;
}

@keyframes spinElectric {
    from { --angle: 0deg; }
    to { --angle: 360deg; }
}

/* --- Animations & Utilities --- */
.hidden {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.show {
    opacity: 1;
    transform: translateY(0);
}

/* --- Responsive Design --- */
@media (max-width: 992px) {
    #hero {
        flex-direction: column-reverse;
        justify-content: center;
        text-align: center;
        padding-top: 150px;
    }
    
    .hero-content {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .hero-actions {
        justify-content: center;
    }
    
    .name {
        font-size: 4rem;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .about-grid {
        grid-template-columns: 1fr;
    }
    
    .image-wrapper {
        width: 350px;
        height: 350px;
        margin-bottom: 3rem;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--bg-secondary);
        padding: 2rem 0;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        text-align: center;
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .name {
        font-size: 3rem;
    }

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