:root {
    --bg-color: #050505;
    --neon-cyan: #22d3ee;
    --neon-blue: #3b82f6;
    --glass-bg: rgba(10, 10, 10, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-main: #ffffff;
    --text-muted: #94a3b8;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
}

/* --- 3D BACKGROUND LAYER (ULTRA HD) --- */
#canvas-wrapper {
    position: fixed;
    top: 50%;
    left: 50%;
    /* BALANCED HD: Render at 110vw (Fast) & Scale up (Big) */
    width: 110vw;
    height: 110vh;
    z-index: -1;
    /* Translate(-35%, -35%) + Scale(1.25) aligns visually with the original look */
    transform: translate(-35%, -35%) scale(1.25);
    transform-origin: center center;
    pointer-events: auto;
    /* Removed expensive image-rendering for smoothness */
    transition: opacity 0.5s ease;
}

#canvas-wrapper.hidden-on-scroll {
    opacity: 0;
    pointer-events: none;
}

/* --- RIPPLE GRID EFFECT (Aceternity Style - Optimized) --- */
#ripple-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: grid;
    /* Reduced to 15 columns for higher performance */
    grid-template-columns: repeat(15, 1fr);
    gap: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: auto;
}

#ripple-grid .grid-box {
    aspect-ratio: 1;
    background: transparent;
    border: 0.5px solid #27272a;
    opacity: 0.4;
    cursor: pointer;
    will-change: opacity, background-color;
    /* Force GPU layer */
    transform: translateZ(0);
    /* "Extreme Smooth" = Fast In (Responsive) + Slow Out (Luxurious Trail) */
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
        background-color 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

#ripple-grid .grid-box:hover {
    opacity: 0.8;
    background-color: rgba(255, 255, 255, 0.1);
    /* Hover In: Faster for responsiveness */
    transition: opacity 0.15s ease-out,
        background-color 0.15s ease-out;
}

/* Ripple animation keyframes - Pure Opacity/Color (High Performance) */
@keyframes cell-ripple {
    0% {
        opacity: 0.4;
        background-color: transparent;
    }

    30% {
        opacity: 0.8;
        background-color: rgba(255, 255, 255, 0.08);
    }

    100% {
        opacity: 0.4;
        background-color: transparent;
    }
}

#ripple-grid .grid-box.rippling {
    transition: none !important;
    animation: cell-ripple var(--duration, 200ms) ease-out forwards;
    animation-delay: var(--delay, 0ms);
}

/* HIDE SPLINE WATERMARK */
#logo-blocker {
    position: fixed;
    bottom: 0;
    right: 0;
    width: 180px;
    height: 60px;
    background: var(--bg-color);
    z-index: 0;
    pointer-events: none;
}

/* --- NAVIGATION --- */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 3rem;
    z-index: 100;
    pointer-events: none;
}

.brand {
    pointer-events: auto;
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: 2px;
    line-height: 1;
    text-shadow: 0 0 20px rgba(34, 211, 238, 0.4);

}

.brand-sub {
    font-size: 0.6rem;
    color: var(--neon-cyan);
    letter-spacing: 3px;
    margin-top: 5px;
}

.system-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(34, 211, 238, 0.05);
    border: 1px solid rgba(34, 211, 238, 0.2);
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 12px;
    color: var(--neon-cyan);
    margin-top: 8px;
    pointer-events: auto;
    font-weight: bolder;
}

.dot {
    width: 6px;
    height: 6px;
    background: var(--neon-cyan);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.nav-links {
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    padding: 12px 30px;
    border-radius: 50px;
    border: 1px solid var(--glass-border);
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1px;
    transition: color 0.3s, text-shadow 0.3s;
}

.nav-links a:hover {
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* --- SECTIONS --- */
section {
    min-height: 100vh;
    width: 100%;
    position: relative;
    display: flex;
    padding: 3rem;
}

/* HERO SECTION */
#hero {
    align-items: center;
    justify-content: flex-start;
}

.hero-content {
    max-width: 650px;
    z-index: 10;
}

h1.hero-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 5.5rem;
    line-height: 0.9;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    letter-spacing: -2px;
}

.text-cyan {
    color: var(--neon-cyan);
    text-shadow: 0 0 20px rgba(34, 211, 238, 0.5), 0 0 40px rgba(34, 211, 238, 0.3);
}

.hero-desc {
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 2.5rem;
    max-width: 420px;
    border-left: 2px solid var(--neon-cyan);
    padding-left: 1.5rem;
}

.cta-btn {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: 1px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cta-btn:hover {
    background: var(--neon-cyan);
    color: #000;
    border-color: var(--neon-cyan);
    box-shadow: 0 0 30px rgba(34, 211, 238, 0.4);
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.7rem;
    letter-spacing: 3px;
    color: var(--text-muted);
    gap: 10px;
    opacity: 0.7;
    animation: bounce 2s infinite;
}

/* PROJECT SECTION */
#project-section {
    align-items: center;
    justify-content: center;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3rem;
    width: 100%;
    max-width: 1900px;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5);
    z-index: 10;
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.glass-panel.visible {
    opacity: 1;
    transform: translateY(0);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1.5rem;
}

/* FORM INPUTS */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    color: #fff;
    padding: 1rem;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: all 0.3s;
}

input:focus {
    border-color: var(--neon-cyan);
    background: rgba(34, 211, 238, 0.05);
}

/* ANALYZE BUTTON */
button#analyzeButton {
    width: 100%;
    padding: 1.2rem;
    background: linear-gradient(90deg, #0891b2, #3b82f6);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

button#analyzeButton:hover {
    box-shadow: 0 0 40px rgba(59, 130, 246, 0.5);
    transform: translateY(-2px);
}

button#analyzeButton:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* RESULTS AREA */
#results {
    margin-top: 2rem;
}

.result-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.tag {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 6px;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.tag-green {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.tag-red {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Lists */
ul.simple-list {
    list-style: none;
    padding-left: 0;
    color: var(--text-main);
    font-size: 0.9rem;
    line-height: 1.6;
}

ul.simple-list li {
    margin-bottom: 8px;
    padding-left: 16px;
    position: relative;
}

ul.simple-list li::before {
    content: '>';
    color: var(--neon-cyan);
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* Loader */
.loader {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--neon-cyan);
    border-radius: 50%;
    animation: spin 1s infinite;
}

.hidden {
    display: none;
}

@keyframes pulse {
    0% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.4);
    }

    70% {
        opacity: 0.7;
        box-shadow: 0 0 0 6px rgba(34, 211, 238, 0);
    }

    100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(34, 211, 238, 0);
    }
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    40% {
        transform: translateX(-50%) translateY(-10px);
    }

    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* Mobile Responsive */
@media(max-width: 768px) {

    /* Show Mobile Menu Button */
    #mobile-menu-btn.hidden {
        display: flex !important;
    }

    /* Mobile Nav Links Overlay */
    .nav-links {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(5, 5, 5, 0.95);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 3rem;
        z-index: 40;
        /* Behind the menu button (z-50) */

        /* Hidden by default on mobile */
        opacity: 0;
        pointer-events: none;
        transform: translateY(-20px);
        transition: all 0.4s ease;
    }

    .nav-links.active {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

    .nav-links a {
        font-size: 1.5rem;
    }

    /* Typography Adjustments */
    h1.hero-title {
        font-size: 3rem;
        line-height: 1.1;
    }

    /* Layout Adjustments */
    .form-grid {
        grid-template-columns: 1fr;
    }

    .glass-panel {
        padding: 1.5rem;
        margin-top: 2rem;
    }

    section {
        padding: 1.5rem;
    }

    #logo-blocker {
        width: 120px;
        height: 40px;
    }

    /* Chat Widget Mobile */
    #chat-container {
        width: 90vw;
        right: 5vw;
        bottom: 100px;
        height: 60vh;
    }
}

/* Chatbot Styles */
#chat-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--neon-cyan);
    color: #000;
    border: none;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#chat-toggle:hover {
    transform: scale(1.1);
}

#chat-container {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 350px;
    height: 500px;
    background: rgba(10, 10, 10, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    backdrop-filter: blur(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: bottom right;
}

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

.chat-header {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scrollbar-width: thin;
    scrollbar-color: var(--neon-cyan) transparent;
}

.ai-msg,
.user-msg {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.9rem;
    max-width: 85%;
    line-height: 1.4;
}

.ai-msg {
    background: rgba(255, 255, 255, 0.05);
    color: #e5e7eb;
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

.user-msg {
    background: var(--neon-cyan);
    color: #000;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

.chat-input-area {
    padding: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 10px;
}

#chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px;
    color: white;
    outline: none;
}

#send-chat {
    background: transparent;
    border: none;
    color: var(--neon-cyan);
    cursor: pointer;
}

.pulse {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 0 rgba(16, 185, 129, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}


/* --- CHATBOT STYLES --- */
#chat-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 10000;
    font-family: 'Inter', sans-serif;
}

.fab-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(10, 10, 10, 0.8);
    border: 1px solid var(--neon-cyan);
    color: var(--neon-cyan);
    cursor: pointer;
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fab-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(34, 211, 238, 0.5);
}

.chat-container {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-header {
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--neon-cyan);
    letter-spacing: 1px;
}

.online-dot {
    width: 8px;
    height: 8px;
    background: #22d3ee;
    border-radius: 50%;
    box-shadow: 0 0 10px #22d3ee;
}

.chat-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ai-msg {
    background: rgba(255, 255, 255, 0.05);
    padding: 12px 16px;
    border-radius: 15px;
    border-bottom-left-radius: 2px;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #d1d5db;
    max-width: 85%;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-footer {
    padding: 20px;
}

.input-wrapper {
    background: #000;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    display: flex;
    padding: 5px 5px 5px 20px;
}

.input-wrapper input {
    background: transparent;
    border: none;
    color: white;
    flex: 1;
    font-size: 0.9rem;
    outline: none;
}

.input-wrapper button {
    background: transparent;
    border: none;
    color: var(--neon-cyan);
    cursor: pointer;
    padding: 10px;
    display: flex;
    align-items: center;
}

.hidden {
    display: none !important;
    opacity: 0;
    transform: translateY(20px);
}

.close-btn {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    opacity: 0.5;
}

.close-btn:hover {
    opacity: 1;
}



/* --- CHATBOT STYLES --- */
#chat-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 10001;
    font-family: 'Inter', sans-serif;
}

.chat-fab {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(10, 10, 10, 0.8);
    border: 1px solid var(--neon-cyan);
    color: var(--neon-cyan);
    cursor: pointer;
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.3);
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-fab:hover {
    transform: scale(1.1);
}

.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: rgba(15, 15, 15, 0.95);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
}

.chat-header {
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--neon-cyan);
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.online-dot {
    width: 8px;
    height: 8px;
    background: #22d3ee;
    border-radius: 50%;
    box-shadow: 0 0 8px #22d3ee;
}

.chat-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-msg,
.user-msg {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.ai-msg {
    background: rgba(255, 255, 255, 0.05);
    color: #e5e7eb;
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

.user-msg {
    background: rgba(34, 211, 238, 0.15);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
    border: 1px solid rgba(34, 211, 238, 0.2);
}

.chat-footer {
    padding: 20px;
}

.input-container {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    padding: 5px 5px 5px 15px;
    align-items: center;
}

#chatInput {
    background: transparent;
    border: none;
    color: white;
    flex: 1;
    outline: none;
    font-size: 0.85rem;
}

#sendMessage {
    background: var(--neon-cyan);
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    color: black;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hidden {
    display: none;
}

#close-chat {
    background: transparent;
    border: none;
    color: #6b7280;
    cursor: pointer;
}



/* Shining Animation for AI Thinking State */
.shining-text {
    background: linear-gradient(110deg, #888, 35%, #fff, 50%, #888, 75%, #888);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 600;
    display: inline-block;
    animation: shine 2s linear infinite;
}

@keyframes shine {
    from {
        background-position: 200% 0;
    }

    to {
        background-position: -200% 0;
    }
}


/* Ensure the chat body is a flex container so align-self works */
#chat-messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 15px;
    overflow-y: auto;
}

/* HIGH VISIBILITY USER MESSAGE */
.user-msg {
    align-self: flex-end;
    /* Push to the right */
    background: #22d3ee !important;
    /* Bright Neon Cyan */
    color: #000000 !important;
    /* Sharp Black text */
    padding: 10px 15px;
    border-radius: 15px 15px 2px 15px;
    font-weight: 500;
    max-width: 80%;
    word-wrap: break-word;
    box-shadow: 0 4px 15px rgba(34, 211, 238, 0.2);
    display: block !important;
    /* Ensure it's not hidden */
}

/* AI MESSAGE */
.ai-msg {
    align-self: flex-start;
    /* Stay on the left */
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    padding: 10px 15px;
    border-radius: 15px 15px 15px 2px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 80%;
}