/* =========================================
   Design System & Variables
   ========================================= */
:root {
    --bg-dark: #050505;
    --bg-card: #0a0a0a;
    --bg-glass: rgba(255, 255, 255, 0.05);

    --primary: #6366f1;
    /* Indigo */
    --secondary: #a855f7;
    /* Purple */
    --accent: #0ea5e9;
    /* Sky Blue */
    --text-main: #ffffff;
    --text-muted: #94a3b8;

    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'Fira Code', monospace;

    --glow-primary: 0 0 20px rgba(99, 102, 241, 0.5);
    --glow-secondary: 0 0 20px rgba(168, 85, 247, 0.5);

    --transition-fast: 0.2s ease;
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =========================================
   Reset & Base Styles
   ========================================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}

ul {
    list-style: none;
}

/* =========================================
   Utility Classes
   ========================================= */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

.section-padding {
    padding: 100px 0;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--secondary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glass {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn {
    display: inline-block;
    padding: 12px 32px;
    border-radius: 99px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    transition: var(--transition-fast);
}

.btn-primary {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: var(--glow-primary);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: 0.5s;
    z-index: -1;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.8), 0 0 60px rgba(168, 85, 247, 0.4);
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-outline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-main);
}

.btn-outline:hover {
    border-color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

/* =========================================
   Navbar
   ========================================= */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: 0.3s;
    padding: 20px 0;
}

.navbar.scrolled {
    padding: 15px 0;
    background: rgba(5, 5, 5, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.nav-menu {
    display: flex;
    gap: 40px;
}

.nav-link {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 500;
}

.nav-link:hover {
    color: var(--text-main);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* =========================================
   Canvas Background
   ========================================= */
#bg-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: all;
    /* Allow mouse interaction */
}

/* =========================================
   Hero Section
   ========================================= */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    /* Ensure content is above canvas */
    max-width: 800px;
}


.hero-title {
    font-size: 5rem;
    line-height: 1.1;
    font-weight: 800;
    margin-bottom: 24px;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 40px;
    max-width: 600px;
}

.hero-buttons {
    display: flex;
    gap: 16px;
}

/* =========================================
   Services Section
   ========================================= */
.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 16px;
}

.section-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 60px;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.service-card {
    padding: 40px;
    border-radius: 20px;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
}

.service-card:hover {
    transform: translateY(-5px);
    /* Reduced hover lift to prevent jitters with open demos */
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.service-icon {
    font-size: 2.5rem;
    margin-bottom: 24px;
    display: inline-block;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    color: var(--accent);
}

.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.service-card p {
    color: var(--text-muted);
    flex-grow: 1;
    /* Pushes button to bottom */
}

/* Toggle Button */
.btn-text {
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.btn-text:hover {
    color: var(--secondary);
}

.btn-text i {
    transition: transform 0.3s;
}

.btn-text.active i {
    transform: rotate(180deg);
}

/* Demo Content Area */
.demo-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, margin-top 0.4s;
    margin-top: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.demo-content.active {
    max-height: 300px;
    /* Specific height limit */
    margin-top: 20px;
    padding-top: 20px;
}

/* 1. Chat UI */
.chat-ui {
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-message {
    padding: 8px 12px;
    border-radius: 12px;
    max-width: 85%;
}

.chat-message.bot {
    background: rgba(255, 255, 255, 0.1);
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

.chat-message.user {
    background: var(--primary);
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

/* 2. Workflow UI (Enhanced) */
.workflow-ui {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
    padding: 10px;
}

.flow-node {
    padding: 10px 20px;
    border-radius: 8px;
    width: 100%;
    text-align: center;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.flow-node.gmail {
    background: rgba(234, 67, 53, 0.2);
    color: #ffadad;
    border: 1px solid rgba(234, 67, 53, 0.4);
}

.flow-node.openai {
    background: rgba(16, 163, 127, 0.2);
    color: #8ceec8;
    border: 1px solid rgba(16, 163, 127, 0.4);
}

.flow-node.slack {
    background: rgba(74, 21, 75, 0.4);
    color: #e6a8ea;
    border: 1px solid rgba(74, 21, 75, 0.6);
}

.flow-line {
    width: 2px;
    height: 15px;
    background: rgba(255, 255, 255, 0.2);
}

/* 3. Charts UI */
.chart-ui {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 100px;
    padding: 0 10px;
}

.bar {
    width: 15%;
    background: linear-gradient(to top, var(--primary), var(--secondary));
    border-radius: 4px 4px 0 0;
    animation: growBar 1s ease-out forwards;
}

@keyframes growBar {
    from {
        height: 0;
    }
}

/* 4. App Mockup (Image) */
.app-mockup-image {
    margin-top: 10px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.app-mockup-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s;
}

.app-mockup-image:hover img {
    transform: scale(1.02);
}

/* =========================================
   Custom Solutions Section
   ========================================= */
.custom-solutions-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 60px;
    border-radius: 30px;
    gap: 40px;
    position: relative;
    overflow: hidden;
}

.custom-content {
    flex: 1;
    z-index: 2;
}

.custom-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.custom-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-main);
    font-weight: 500;
}

.custom-list li i {
    color: var(--secondary);
}

.custom-visual {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.visual-circle {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.2) 0%, transparent 70%);
    border-radius: 50%;
    position: absolute;
    animation: pulse 4s infinite ease-in-out;
}

.puzzle-icon {
    font-size: 8rem;
    color: rgba(255, 255, 255, 0.8);
    z-index: 2;
    filter: drop-shadow(0 0 20px rgba(168, 85, 247, 0.5));
}

@keyframes pulse {
    0% {
        transform: scale(0.8);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }

    100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
}

@media (max-width: 768px) {
    .custom-solutions-container {
        flex-direction: column;
        padding: 30px;
        text-align: center;
    }

    .custom-list li {
        justify-content: center;
        text-align: left;
        /* Keep text aligned left even if centered in flex */
    }

    .section-title,
    .section-subtitle {
        text-align: center !important;
    }
}

/* 4. App Mockup (Dashboard Style) */
.app-mockup {
    background: #1a1a1a;
    border-radius: 8px;
    height: 160px;
    border: 1px solid #333;
    display: flex;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.app-sidebar {
    width: 40px;
    background: #252525;
    border-right: 1px solid #333;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 15px;
    gap: 10px;
}

.app-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #444;
}

.app-dot:first-child {
    background: var(--primary);
}

.app-main {
    flex-grow: 1;
    padding: 15px;
    background: #151515;
}

.app-header-bar {
    height: 10px;
    width: 40%;
    background: #333;
    border-radius: 5px;
    margin-bottom: 15px;
}

.app-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.app-card {
    height: 40px;
    background: #252525;
    border-radius: 6px;
    border: 1px solid #333;
}

.app-card.wide {
    grid-column: span 2;
    height: 50px;
    background: rgb(21, 21, 35);
    border: 1px dashed #444;
    position: relative;
}

.app-card.wide::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 4px;
    background: var(--secondary);
    opacity: 0.3;
}

/* =========================================
   WhatsApp Float
   ========================================= */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #25D366;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    transition: transform 0.3s;
}

.whatsapp-float:hover {
    transform: scale(1.1);
}

/* =========================================
   Features / Tech Stack
   ========================================= */
.features-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.feature-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.feature-item i {
    color: var(--primary);
    font-size: 1.2rem;
}

.tech-stack-marquee {
    display: flex;
    gap: 40px;
    overflow: hidden;
    padding: 40px 0;
    mask-image: linear-gradient(to right, transparent, black 20%, black 80%, transparent);
}

.tech-tag {
    font-family: var(--font-mono);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 6px;
    white-space: nowrap;
}

/* =========================================
   Contact Form
   ========================================= */
.contact-container {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-main);
    font-family: var(--font-main);
    font-size: 1rem;
    transition: 0.3s;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    background: rgba(255, 255, 255, 0.05);
}

/* =========================================
   Footer
   ========================================= */
.footer {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 60px 0;
    margin-top: 60px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.social-links {
    display: flex;
    gap: 20px;
}

.social-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

.social-icon:hover {
    background: var(--primary);
    color: white;
}

/* =========================================
   Animations
   ========================================= */
@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

.hidden {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.show {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================
   Responsive
   ========================================= */
@media (max-width: 768px) {
    .hero-title {
        font-size: 3rem;
    }

    .nav-menu {
        display: none;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        flex-direction: column;
        gap: 30px;
    }
}