<?php
/**
 * ============================================================================
 * PROJECT: APEXA - ULTRA MODERN HIGH-PERFORMANCE WEB ENGINE
 * THEME:   CYBER YELLOW & DEEP BLACK
 * TYPE:    SINGLE FILE MONOLITHIC ARCHITECTURE
 * DATE:    2026
 * ============================================================================
 */

// --- 1. CONFIGURATION & SEO ENGINE ---
$config = [
    'brand_name' => 'APEXA',
    'theme_color' => '#FFD000', // Cyber Yellow
    'bg_color'    => '#050505', // Deep Black
    'email'       => 'contact@apexa.dev',
    'phone'       => '+880 1XXX XXXXXX',
    'address'     => 'india',
];

$seo = [
    'title'       => 'Apexa | Architects of High-Stakes Digital Platforms',
    'description' => 'We engineer high-frequency betting platforms, real-time odds engines, and casino infrastructures. Built with Raw PHP & Tailwind for maximum speed and security.',
    'keywords'    => 'raw php developer, betting site development, high traffic, mysql expert, tailwind css, indian developer, ',
    'og_image'    => 'apexa-banner.jpg', // Placeholder
    'canonical'   => 'https://apexa.dev'
];

// --- 2. PHP HELPER FUNCTIONS ---
function render_icon($name, $class = "w-6 h-6") {
    // Inline SVG Icon System for better performance than external libraries
    $icons = [
        'code' => '<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4" />',
        'lightning' => '<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z" />',
        'shield' => '<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z" />',
        'chart' => '<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z" />',
        'chevron-down' => '<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7" />',
        'menu' => '<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" />',
        'close' => '<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />',
        'database' => '<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4" />',
        'server' => '<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2m-2-4h.01M17 16h.01" />',
        'check' => '<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />'
    ];
    
    return isset($icons[$name]) ? '<svg class="'.$class.'" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">'.$icons[$name].'</svg>' : '';
}

// Dummy Form Handler
$msg = "";
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    $name = htmlspecialchars($_POST['name'] ?? '');
    $msg = "<div class='fixed top-5 right-5 bg-yellow-400 text-black px-6 py-3 rounded shadow-xl z-[100] animate-bounce'>Thanks $name! Request Received.</div>";
}
?>

<!DOCTYPE html>
<html lang="en" class="scroll-smooth">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="<?php echo $seo['description']; ?>">
    <meta name="keywords" content="<?php echo $seo['keywords']; ?>">
    <meta name="author" content="APEXA">
    <meta property="og:title" content="<?php echo $seo['title']; ?>">
    <meta property="og:image" content="<?php echo $seo['og_image']; ?>">
    <link rel="canonical" href="<?php echo $seo['canonical']; ?>">
    <title><?php echo $seo['title']; ?></title>

    <script src="https://cdn.tailwindcss.com"></script>
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        brand: {
                            yellow: '#FFD000', // The Hero Color
                            yellowDark: '#E6BC00',
                            black: '#050505',  // The Deep Dark
                            gray: '#121212',   // Card BG
                            light: '#EAEAEA'
                        }
                    },
                    fontFamily: {
                        sans: ['Space Grotesk', 'sans-serif'],
                        mono: ['Fira Code', 'monospace'],
                    },
                    animation: {
                        'blob': 'blob 7s infinite',
                        'float': 'float 6s ease-in-out infinite',
                        'pulse-slow': 'pulse 4s cubic-bezier(0.4, 0, 0.6, 1) infinite',
                        'spin-slow': 'spin 12s linear infinite',
                    },
                    keyframes: {
                        blob: {
                            '0%': { transform: 'translate(0px, 0px) scale(1)' },
                            '33%': { transform: 'translate(30px, -50px) scale(1.1)' },
                            '66%': { transform: 'translate(-20px, 20px) scale(0.9)' },
                            '100%': { transform: 'translate(0px, 0px) scale(1)' },
                        },
                        float: {
                            '0%, 100%': { transform: 'translateY(0)' },
                            '50%': { transform: 'translateY(-20px)' },
                        }
                    }
                }
            }
        }
    </script>

    <link href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Fira+Code:wght@400;500&display=swap" rel="stylesheet">

    <style>
        /* Base Setup */
        body {
            background-color: #050505;
            color: #EAEAEA;
            font-family: 'Space Grotesk', sans-serif;
            overflow-x: hidden;
        }

        /* Custom Scrollbar */
        ::-webkit-scrollbar { width: 8px; }
        ::-webkit-scrollbar-track { background: #050505; }
        ::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }
        ::-webkit-scrollbar-thumb:hover { background: #FFD000; }

        /* Typography & Utilities */
        .text-glow { text-shadow: 0 0 20px rgba(255, 208, 0, 0.3); }
        .border-glow { box-shadow: 0 0 15px rgba(255, 208, 0, 0.1); }
        
        /* 3D Button Effect */
        .btn-3d {
            transition: all 0.1s;
            box-shadow: 4px 4px 0px 0px #333;
            transform: translate(-2px, -2px);
        }
        .btn-3d:active {
            transform: translate(0px, 0px);
            box-shadow: 0px 0px 0px 0px #333;
        }
        .btn-3d-yellow {
            box-shadow: 4px 4px 0px 0px #E6BC00;
        }
        .btn-3d-yellow:active {
            box-shadow: 0px 0px 0px 0px #E6BC00;
        }

        /* Glassmorphism */
        .glass {
            background: rgba(18, 18, 18, 0.7);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.05);
        }
        
        .glass-yellow {
            background: rgba(255, 208, 0, 0.05);
            border: 1px solid rgba(255, 208, 0, 0.1);
        }

        /* Grid Background Pattern */
        .bg-grid-pattern {
            background-image: linear-gradient(to right, #1a1a1a 1px, transparent 1px),
                              linear-gradient(to bottom, #1a1a1a 1px, transparent 1px);
            background-size: 40px 40px;
            mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
        }

        /* Loader */
        #loader {
            position: fixed; top: 0; left: 0; width: 100%; height: 100%;
            background: #050505; z-index: 9999;
            display: flex; justify-content: center; align-items: center;
            transition: opacity 0.5s ease;
        }
        
        /* Reveal Animation Classes */
        .reveal { opacity: 0; transform: translateY(30px); transition: all 0.8s ease-out; }
        .reveal.active { opacity: 1; transform: translateY(0); }

        /* Complex Shapes */
        .clip-diagonal { clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%); }
    </style>
</head>
<body class="selection:bg-brand-yellow selection:text-black">

    <div id="loader">
        <div class="flex flex-col items-center gap-4">
            <div class="w-16 h-16 border-4 border-brand-yellow border-t-transparent rounded-full animate-spin"></div>
            <div class="font-mono text-brand-yellow animate-pulse">INITIALIZING SYSTEM...</div>
        </div>
    </div>

    <?php echo $msg; ?>

    <nav id="navbar" class="fixed w-full z-50 transition-all duration-300 top-0 border-b border-white/5 bg-brand-black/90 backdrop-blur-md">
        <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
            <div class="flex items-center justify-between h-24">
                <div class="flex-shrink-0 cursor-pointer group">
                    <span class="text-3xl font-bold tracking-tighter text-white">
                        APEX<span class="text-brand-yellow group-hover:text-white transition-colors">A</span>
                    </span>
                    <div class="h-1 w-0 bg-brand-yellow transition-all duration-300 group-hover:w-full"></div>
                </div>

                <div class="hidden md:block">
                    <div class="ml-10 flex items-baseline space-x-8">
                        <?php 
                        $navItems = ['Solutions', 'Engine', 'Process', 'Portfolio', 'Pricing'];
                        foreach ($navItems as $item) {
                            echo '<a href="#'.strtolower($item).'" class="text-gray-300 hover:text-brand-yellow px-3 py-2 rounded-md text-sm font-medium transition-colors uppercase tracking-widest">'.$item.'</a>';
                        }
                        ?>
                    </div>
                </div>

                <div class="hidden md:block">
                    <a href="#contact" class="bg-brand-yellow text-black font-bold py-3 px-6 rounded-sm btn-3d-yellow hover:bg-white hover:text-black transition-colors flex items-center gap-2">
                        <span>Start Project</span>
                        <?php echo render_icon('lightning', 'w-4 h-4'); ?>
                    </a>
                </div>

                <div class="-mr-2 flex md:hidden">
                    <button id="mobile-menu-btn" type="button" class="text-gray-400 hover:text-white p-2">
                        <?php echo render_icon('menu', 'w-8 h-8'); ?>
                    </button>
                </div>
            </div>
        </div>

        <div id="mobile-menu" class="hidden md:hidden bg-brand-gray border-b border-brand-yellow">
            <div class="px-2 pt-2 pb-3 space-y-1 sm:px-3">
                <?php 
                foreach ($navItems as $item) {
                    echo '<a href="#'.strtolower($item).'" class="text-gray-300 hover:text-brand-yellow block px-3 py-4 rounded-md text-base font-bold uppercase border-b border-white/5">'.$item.'</a>';
                }
                ?>
                <a href="#contact" class="block w-full text-center bg-brand-yellow text-black font-bold py-4 mt-4">START NOW</a>
            </div>
        </div>
    </nav>

    <section id="home" class="relative pt-32 pb-20 lg:pt-48 lg:pb-32 overflow-hidden bg-grid-pattern">
        <div class="absolute top-0 right-0 -mr-20 -mt-20 w-96 h-96 bg-brand-yellow opacity-10 blur-[100px] rounded-full animate-pulse-slow"></div>
        <div class="absolute bottom-0 left-0 -ml-20 -mb-20 w-72 h-72 bg-blue-500 opacity-5 blur-[100px] rounded-full"></div>

        <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 relative z-10">
            <div class="grid lg:grid-cols-2 gap-16 items-center">
                
                <div class="text-center lg:text-left reveal active">
                    <div class="inline-flex items-center gap-2 px-4 py-2 rounded-full border border-brand-yellow/30 bg-brand-yellow/5 mb-8">
                        <span class="relative flex h-3 w-3">
                          <span class="animate-ping absolute inline-flex h-full w-full rounded-full bg-brand-yellow opacity-75"></span>
                          <span class="relative inline-flex rounded-full h-3 w-3 bg-brand-yellow"></span>
                        </span>
                        <span class="text-xs font-mono text-brand-yellow uppercase tracking-widest">System Operational v4.2</span>
                    </div>

                    <h1 class="text-5xl md:text-7xl font-bold text-white tracking-tight leading-[1.1] mb-6">
                        ARCHITECTS OF <br>
                        <span class="text-brand-yellow text-glow">DIGITAL RISK</span>
                    </h1>
                    
                    <p class="text-lg md:text-xl text-gray-400 mb-10 max-w-2xl mx-auto lg:mx-0 font-light leading-relaxed">
                        We build high-frequency betting platforms and real-time odds engines using 
                        <span class="text-white font-medium border-b border-brand-yellow">Raw PHP</span> and 
                        <span class="text-white font-medium border-b border-brand-yellow">MySQL</span>. 
                        Designed for speed, security, and massive scale.
                    </p>
                    
                    <div class="flex flex-col sm:flex-row gap-6 justify-center lg:justify-start">
                        <a href="#contact" class="px-8 py-4 bg-brand-yellow text-black font-bold text-lg rounded-sm btn-3d-yellow w-full sm:w-auto text-center">
                            DEPLOY SYSTEM
                        </a>
                        <a href="#portfolio" class="px-8 py-4 border border-white/20 text-white font-bold text-lg rounded-sm hover:bg-white/5 transition-colors w-full sm:w-auto text-center flex items-center justify-center gap-2">
                            VIEW BLUEPRINTS
                            <?php echo render_icon('chevron-down', 'w-4 h-4'); ?>
                        </a>
                    </div>

                    <div class="mt-12 flex items-center justify-center lg:justify-start gap-6 text-gray-500 text-sm font-mono">
                        <span class="flex items-center gap-2"><div class="w-2 h-2 bg-blue-500 rounded-full"></div> PHP 8.3</span>
                        <span class="flex items-center gap-2"><div class="w-2 h-2 bg-brand-yellow rounded-full"></div> MySQL 8.0</span>
                        <span class="flex items-center gap-2"><div class="w-2 h-2 bg-cyan-400 rounded-full"></div> Tailwind</span>
                    </div>
                </div>

                <div class="relative hidden lg:block h-[600px] w-full">
                    <div class="absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 w-80 h-96 bg-brand-gray border border-white/10 rounded-xl glass animate-float z-20 flex flex-col overflow-hidden shadow-2xl shadow-brand-yellow/10">
                        <div class="h-8 bg-black/50 border-b border-white/5 flex items-center px-4 gap-2">
                            <div class="w-3 h-3 rounded-full bg-red-500"></div>
                            <div class="w-3 h-3 rounded-full bg-yellow-500"></div>
                            <div class="w-3 h-3 rounded-full bg-green-500"></div>
                        </div>
                        <div class="p-6 font-mono text-xs text-gray-400 space-y-2">
                            <div class="text-green-400">-> Initiating Core...</div>
                            <div class="pl-4 text-blue-400">$odds_engine->start();</div>
                            <div class="pl-4">Loading modules... [OK]</div>
                            <div class="pl-4">Connecting DB... <span class="text-brand-yellow">[CONNECTED]</span></div>
                            <div class="text-gray-600">// Optimizing queries</div>
                            <div class="pl-4 text-purple-400">foreach($users as $u) {</div>
                            <div class="pl-8 text-white">calculate_wager($u);</div>
                            <div class="pl-4 text-purple-400">}</div>
                            <div class="mt-4 border-t border-white/10 pt-2 text-brand-yellow animate-pulse">
                                STATUS: LIVE <br>
                                LATENCY: 14ms
                            </div>
                        </div>
                    </div>
                    
                    <div class="absolute top-20 right-10 p-4 bg-black border border-brand-yellow text-brand-yellow font-mono text-sm rounded shadow-[4px_4px_0px_0px_#333] animate-blob animation-delay-2000 z-30">
                        <span>$ WIN: 98.4%</span>
                    </div>
                    <div class="absolute bottom-32 left-0 p-4 bg-black border border-white/20 text-white font-mono text-sm rounded shadow-[4px_4px_0px_0px_#333] animate-blob z-30">
                        <span>User: 1.4M+</span>
                    </div>

                    <div class="absolute inset-0 border border-white/5 rounded-full animate-spin-slow opacity-20 border-dashed"></div>
                </div>
            </div>
        </div>
    </section>

    <div class="bg-brand-yellow text-black py-3 overflow-hidden border-y-4 border-black relative z-20 transform -rotate-1">
        <div class="whitespace-nowrap animate-[marquee_20s_linear_infinite] font-black text-xl uppercase tracking-widest flex gap-8">
            <span>High Performance</span> <span>•</span> 
            <span>Secure Betting</span> <span>•</span> 
            <span>Live Casinos</span> <span>•</span> 
            <span>Raw PHP Power</span> <span>•</span> 
            <span>Scalable Architecture</span> <span>•</span> 
            <span>24/7 Support</span> <span>•</span> 
            <span>Custom API</span> <span>•</span>
            <span>High Performance</span> <span>•</span> 
            <span>Secure Betting</span> <span>•</span> 
            <span>Live Casinos</span>
        </div>
    </div>

    <section id="engine" class="py-24 bg-brand-black relative">
        <div class="max-w-7xl mx-auto px-4 sm:px-6">
            <div class="grid md:grid-cols-2 gap-16 items-center">
                <div class="reveal">
                    <h4 class="text-brand-yellow font-mono mb-2">// THE ENGINE</h4>
                    <h2 class="text-4xl md:text-5xl font-bold text-white mb-6">NOT JUST CODE. <br> PURE <span class="text-transparent bg-clip-text bg-gradient-to-r from-brand-yellow to-white">LOGIC.</span></h2>
                    <p class="text-gray-400 mb-6 leading-relaxed">
                        In the world of iGaming, a millisecond delay can cost millions. We don't use bloated frameworks that slow you down. We write raw, optimized PHP coupled with finely-tuned MySQL queries.
                    </p>
                    <ul class="space-y-4 mt-8">
                        <?php 
                        $features = [
                            'Zero-Bloat Architecture',
                            'Hand-written SQL Optimization',
                            'Bank-Grade Security Layers',
                            'Real-Time WebSocket Integration'
                        ];
                        foreach($features as $f) {
                            echo '<li class="flex items-center gap-3 text-white font-medium">
                                <span class="p-1 bg-brand-yellow rounded-full text-black">'.render_icon('check', 'w-3 h-3').'</span>
                                '.$f.'
                            </li>';
                        }
                        ?>
                    </ul>
                </div>
                <div class="relative reveal delay-200">
                    <div class="grid grid-cols-2 gap-4">
                        <div class="bg-brand-gray p-6 rounded-xl border border-white/5 hover:border-brand-yellow/50 transition-colors group">
                            <div class="text-brand-yellow mb-4 group-hover:scale-110 transition-transform"><?php echo render_icon('server', 'w-10 h-10'); ?></div>
                            <h3 class="text-white font-bold text-xl">99.9%</h3>
                            <p class="text-gray-500 text-sm">Uptime Guaranteed</p>
                        </div>
                        <div class="bg-brand-gray p-6 rounded-xl border border-white/5 hover:border-brand-yellow/50 transition-colors group mt-8">
                            <div class="text-brand-yellow mb-4 group-hover:scale-110 transition-transform"><?php echo render_icon('database', 'w-10 h-10'); ?></div>
                            <h3 class="text-white font-bold text-xl">1M+</h3>
                            <p class="text-gray-500 text-sm">Daily Transactions</p>
                        </div>
                        <div class="bg-brand-gray p-6 rounded-xl border border-white/5 hover:border-brand-yellow/50 transition-colors group">
                            <div class="text-brand-yellow mb-4 group-hover:scale-110 transition-transform"><?php echo render_icon('lightning', 'w-10 h-10'); ?></div>
                            <h3 class="text-white font-bold text-xl">0.02s</h3>
                            <p class="text-gray-500 text-sm">Execution Time</p>
                        </div>
                        <div class="bg-brand-gray p-6 rounded-xl border border-white/5 hover:border-brand-yellow/50 transition-colors group mt-8">
                            <div class="text-brand-yellow mb-4 group-hover:scale-110 transition-transform"><?php echo render_icon('shield', 'w-10 h-10'); ?></div>
                            <h3 class="text-white font-bold text-xl">DDoS</h3>
                            <p class="text-gray-500 text-sm">Advanced Protection</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <section id="solutions" class="py-24 bg-[#0a0a0a] relative clip-diagonal">
        <div class="absolute inset-0 bg-brand-yellow opacity-[0.02]"></div>
        <div class="max-w-7xl mx-auto px-4 sm:px-6 relative z-10">
            <div class="text-center mb-20 reveal">
                <span class="text-brand-yellow tracking-widest uppercase font-bold text-sm">Capabilities</span>
                <h2 class="text-4xl md:text-5xl font-bold text-white mt-2">WE BUILD <span class="text-brand-yellow">MONEY MACHINES</span></h2>
            </div>

            <div class="grid md:grid-cols-3 gap-8">
                <div class="group bg-brand-black border border-white/5 p-8 rounded-sm hover:border-brand-yellow transition-all duration-300 relative overflow-hidden reveal">
                    <div class="absolute top-0 right-0 w-24 h-24 bg-brand-yellow opacity-10 rounded-bl-full transform translate-x-12 -translate-y-12 group-hover:translate-x-0 group-hover:translate-y-0 transition-transform"></div>
                    <div class="w-14 h-14 bg-white/5 rounded-lg flex items-center justify-center text-brand-yellow mb-6 group-hover:bg-brand-yellow group-hover:text-black transition-colors">
                        <?php echo render_icon('code'); ?>
                    </div>
                    <h3 class="text-2xl font-bold text-white mb-4">Betting Engines</h3>
                    <p class="text-gray-400 mb-6 line-clamp-3">Custom built odds calculation, risk management logic, and automated settlement systems. Supports multiple formats (Decimal, Fractional, American).</p>
                    <a href="#" class="text-brand-yellow font-bold uppercase text-sm tracking-wider hover:text-white flex items-center gap-2">Learn More <span>-></span></a>
                </div>

                <div class="group bg-brand-black border border-white/5 p-8 rounded-sm hover:border-brand-yellow transition-all duration-300 relative overflow-hidden reveal delay-100">
                    <div class="absolute top-0 right-0 w-24 h-24 bg-brand-yellow opacity-10 rounded-bl-full transform translate-x-12 -translate-y-12 group-hover:translate-x-0 group-hover:translate-y-0 transition-transform"></div>
                    <div class="w-14 h-14 bg-white/5 rounded-lg flex items-center justify-center text-brand-yellow mb-6 group-hover:bg-brand-yellow group-hover:text-black transition-colors">
                        <?php echo render_icon('database'); ?>
                    </div>
                    <h3 class="text-2xl font-bold text-white mb-4">Casino API Integrations</h3>
                    <p class="text-gray-400 mb-6 line-clamp-3">Seamless integration with top providers like Evolution, Pragmatic Play, and Jili. Unified wallet system for sports and casino balance.</p>
                    <a href="#" class="text-brand-yellow font-bold uppercase text-sm tracking-wider hover:text-white flex items-center gap-2">Learn More <span>-></span></a>
                </div>

                <div class="group bg-brand-black border border-white/5 p-8 rounded-sm hover:border-brand-yellow transition-all duration-300 relative overflow-hidden reveal delay-200">
                    <div class="absolute top-0 right-0 w-24 h-24 bg-brand-yellow opacity-10 rounded-bl-full transform translate-x-12 -translate-y-12 group-hover:translate-x-0 group-hover:translate-y-0 transition-transform"></div>
                    <div class="w-14 h-14 bg-white/5 rounded-lg flex items-center justify-center text-brand-yellow mb-6 group-hover:bg-brand-yellow group-hover:text-black transition-colors">
                        <?php echo render_icon('chart'); ?>
                    </div>
                    <h3 class="text-2xl font-bold text-white mb-4">Payment Gateways</h3>
                    <p class="text-gray-400 mb-6 line-clamp-3">Manual and automated deposit/withdrawal systems. Support for Bkash, Nagad, Rocket, Crypto (USDT/BTC), and International cards.</p>
                    <a href="#" class="text-brand-yellow font-bold uppercase text-sm tracking-wider hover:text-white flex items-center gap-2">Learn More <span>-></span></a>
                </div>
            </div>
        </div>
    </section>

    <section id="portfolio" class="py-24 bg-brand-black">
        <div class="max-w-7xl mx-auto px-4 sm:px-6">
            <div class="flex justify-between items-end mb-16 reveal">
                <div>
                    <h2 class="text-4xl font-bold text-white">RECENT <span class="text-brand-yellow">DEPLOYMENTS</span></h2>
                </div>
                <a href="#" class="hidden md:block text-gray-400 hover:text-brand-yellow font-mono text-sm">VIEW ALL PROJECTS -></a>
            </div>

            <div class="space-y-20">
                <div class="group relative grid md:grid-cols-12 gap-8 items-center reveal">
                    <div class="md:col-span-7 relative">
                        <div class="absolute inset-0 bg-brand-yellow opacity-0 group-hover:opacity-10 transition-opacity duration-500 rounded-xl transform rotate-3 scale-105"></div>
                        <div class="bg-brand-gray aspect-video rounded-lg border border-white/10 p-4 flex flex-col relative overflow-hidden group-hover:border-brand-yellow/50 transition-colors">
                             <div class="h-6 bg-black/50 rounded w-1/3 mb-4"></div>
                             <div class="flex gap-4 mb-4">
                                 <div class="h-32 bg-white/5 rounded w-1/4 animate-pulse"></div>
                                 <div class="h-32 bg-white/5 rounded w-1/4 animate-pulse delay-75"></div>
                                 <div class="h-32 bg-white/5 rounded w-1/4 animate-pulse delay-100"></div>
                                 <div class="h-32 bg-white/5 rounded w-1/4 animate-pulse delay-150"></div>
                             </div>
                             <div class="flex-1 bg-white/5 rounded border border-dashed border-white/10 flex items-center justify-center text-gray-600 font-mono">
                                 UI PREVIEW: BET-X PRO
                             </div>
                        </div>
                    </div>
                    <div class="md:col-span-5 md:-ml-12 z-10">
                        <div class="bg-black p-8 border border-white/10 rounded-sm shadow-2xl group-hover:border-brand-yellow transition-colors">
                            <h4 class="text-brand-yellow font-mono text-sm mb-2">01. iGaming Platform</h4>
                            <h3 class="text-2xl font-bold text-white mb-4">BetMaster Global</h3>
                            <p class="text-gray-400 mb-6 text-sm leading-relaxed">
                                A fully custom betting solution handling 50k+ active users. Features include live odds API integration, agent management system, and automated risk analysis.
                            </p>
                            <ul class="flex flex-wrap gap-2 text-xs font-mono text-gray-500 mb-6">
                                <li>#RawPHP</li>
                                <li>#MySQL</li>
                                <li>#Redis</li>
                                <li>#WebSockets</li>
                            </ul>
                            <a href="#" class="text-white hover:text-brand-yellow font-bold text-sm border-b border-transparent hover:border-brand-yellow transition-all pb-1 inline-block">CASE STUDY</a>
                        </div>
                    </div>
                </div>

                <div class="group relative grid md:grid-cols-12 gap-8 items-center reveal">
                    <div class="md:col-span-5 z-10 order-2 md:order-1 text-right md:text-left">
                        <div class="bg-black p-8 border border-white/10 rounded-sm shadow-2xl group-hover:border-brand-yellow transition-colors md:mr-[-3rem]">
                            <h4 class="text-brand-yellow font-mono text-sm mb-2">02. SaaS Solution</h4>
                            <h3 class="text-2xl font-bold text-white mb-4">Invoicely SaaS</h3>
                            <p class="text-gray-400 mb-6 text-sm leading-relaxed">
                                A multi-tenant invoicing system for freelancers. Ultra-lightweight backend ensuring invoice generation in under 200ms.
                            </p>
                            <ul class="flex flex-wrap gap-2 text-xs font-mono text-gray-500 mb-6 md:justify-end lg:justify-start">
                                <li>#PHP8</li>
                                <li>#Tailwind</li>
                                <li>#StripeAPI</li>
                            </ul>
                            <a href="#" class="text-white hover:text-brand-yellow font-bold text-sm border-b border-transparent hover:border-brand-yellow transition-all pb-1 inline-block">CASE STUDY</a>
                        </div>
                    </div>
                    <div class="md:col-span-7 relative order-1 md:order-2">
                        <div class="absolute inset-0 bg-blue-500 opacity-0 group-hover:opacity-10 transition-opacity duration-500 rounded-xl transform -rotate-3 scale-105"></div>
                        <div class="bg-brand-gray aspect-video rounded-lg border border-white/10 p-4 flex flex-col relative overflow-hidden group-hover:border-blue-500/50 transition-colors">
                             <div class="h-full w-full bg-white/5 rounded border border-dashed border-white/10 flex items-center justify-center text-gray-600 font-mono">
                                 UI PREVIEW: INVOICELY
                             </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <section id="pricing" class="py-24 bg-[#0a0a0a] border-t border-white/5">
        <div class="max-w-7xl mx-auto px-4 sm:px-6">
            <div class="text-center mb-16 reveal">
                <h2 class="text-4xl font-bold text-white">TRANSPARENT <span class="text-brand-yellow">INVESTMENT</span></h2>
                <p class="text-gray-400 mt-4">No hidden fees. Full source code ownership.</p>
            </div>

            <div class="grid md:grid-cols-3 gap-8">
                <div class="bg-brand-black p-8 border border-white/10 rounded-xl hover:border-white/30 transition-all reveal">
                    <h3 class="text-gray-400 font-bold uppercase tracking-wider text-sm mb-2">Starter</h3>
                    <div class="text-4xl font-bold text-white mb-6">$999 <span class="text-lg text-gray-500 font-normal">/ project</span></div>
                    <ul class="space-y-4 mb-8 text-gray-300 text-sm">
                        <li class="flex gap-2"><?php echo render_icon('check', 'text-brand-yellow w-5 h-5'); ?> Basic Betting UI</li>
                        <li class="flex gap-2"><?php echo render_icon('check', 'text-brand-yellow w-5 h-5'); ?> Admin Panel</li>
                        <li class="flex gap-2"><?php echo render_icon('check', 'text-brand-yellow w-5 h-5'); ?> 1 Payment Gateway</li>
                        <li class="flex gap-2 opacity-50"><svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path d="M6 18L18 6M6 6l12 12"/></svg> Live Odds API</li>
                    </ul>
                    <a href="#contact" class="block w-full py-3 border border-white/20 text-center text-white font-bold hover:bg-white hover:text-black transition-colors rounded-sm">SELECT</a>
                </div>

                <div class="bg-brand-gray p-8 border-2 border-brand-yellow rounded-xl transform scale-105 shadow-2xl shadow-brand-yellow/10 relative reveal delay-100">
                    <div class="absolute top-0 right-0 bg-brand-yellow text-black text-xs font-bold px-3 py-1 uppercase tracking-widest rounded-bl-lg">Popular</div>
                    <h3 class="text-brand-yellow font-bold uppercase tracking-wider text-sm mb-2">Business</h3>
                    <div class="text-4xl font-bold text-white mb-6">$2,499 <span class="text-lg text-gray-500 font-normal">/ project</span></div>
                    <ul class="space-y-4 mb-8 text-gray-300 text-sm">
                        <li class="flex gap-2"><?php echo render_icon('check', 'text-brand-yellow w-5 h-5'); ?> Premium UI/UX</li>
                        <li class="flex gap-2"><?php echo render_icon('check', 'text-brand-yellow w-5 h-5'); ?> Advanced Admin & Agent</li>
                        <li class="flex gap-2"><?php echo render_icon('check', 'text-brand-yellow w-5 h-5'); ?> Unlimited Gateways</li>
                        <li class="flex gap-2"><?php echo render_icon('check', 'text-brand-yellow w-5 h-5'); ?> Live Odds Integration</li>
                        <li class="flex gap-2"><?php echo render_icon('check', 'text-brand-yellow w-5 h-5'); ?> 1 Month Support</li>
                    </ul>
                    <a href="#contact" class="block w-full py-3 bg-brand-yellow text-center text-black font-bold hover:bg-white transition-colors rounded-sm btn-3d-yellow">SELECT</a>
                </div>

                <div class="bg-brand-black p-8 border border-white/10 rounded-xl hover:border-white/30 transition-all reveal delay-200">
                    <h3 class="text-gray-400 font-bold uppercase tracking-wider text-sm mb-2">Casino Empire</h3>
                    <div class="text-4xl font-bold text-white mb-6">Custom</div>
                    <ul class="space-y-4 mb-8 text-gray-300 text-sm">
                        <li class="flex gap-2"><?php echo render_icon('check', 'text-brand-yellow w-5 h-5'); ?> Everything in Business</li>
                        <li class="flex gap-2"><?php echo render_icon('check', 'text-brand-yellow w-5 h-5'); ?> Casino API (Slot/Live)</li>
                        <li class="flex gap-2"><?php echo render_icon('check', 'text-brand-yellow w-5 h-5'); ?> Mobile App (Android/iOS)</li>
                        <li class="flex gap-2"><?php echo render_icon('check', 'text-brand-yellow w-5 h-5'); ?> Dedicated Server Setup</li>
                    </ul>
                    <a href="#contact" class="block w-full py-3 border border-white/20 text-center text-white font-bold hover:bg-white hover:text-black transition-colors rounded-sm">CONTACT US</a>
                </div>
            </div>
        </div>
    </section>

    <section class="py-24 bg-brand-black">
        <div class="max-w-4xl mx-auto px-4">
            <h2 class="text-3xl font-bold text-white mb-12 text-center">FREQUENTLY ASKED <span class="text-brand-yellow">QUESTIONS</span></h2>
            
            <div class="space-y-4">
                <?php 
                $faqs = [
                    ['Do you provide the source code?', 'Yes. Unlike other agencies, we provide 100% full source code ownership upon project completion. You are not locked to us.'],
                    ['What server do I need?', 'For starting, a VPS with 4GB RAM is sufficient (DigitalOcean/Vultr). We handle the complete setup including Ubuntu, Nginx, PHP, and MySQL configuration.'],
                    ['Can you integrate Bkash/Nagad auto payment?', 'Absolutely. We have pre-built modules for Bangladeshi payment methods that can verify transactions automatically via SMS or App API.'],
                    ['Is Raw PHP secure?', 'Raw PHP is as secure as the developer writing it. We use PDO for database interactions (preventing SQL injection), CSRF tokens for forms, and XSS filtering. It is often more secure than a bloated WordPress plugin.']
                ];
                foreach($faqs as $index => $faq) {
                    echo '
                    <div class="border border-white/10 rounded-lg overflow-hidden reveal">
                        <button class="w-full text-left p-6 flex justify-between items-center bg-brand-gray hover:bg-white/5 transition-colors focus:outline-none" onclick="toggleFaq('.$index.')">
                            <span class="font-bold text-white">'.$faq[0].'</span>
                            <span id="icon-'.$index.'" class="text-brand-yellow text-2xl transform transition-transform duration-300">+</span>
                        </button>
                        <div id="content-'.$index.'" class="hidden p-6 bg-black text-gray-400 text-sm leading-relaxed border-t border-white/5">
                            '.$faq[1].'
                        </div>
                    </div>';
                }
                ?>
            </div>
        </div>
    </section>

    <section id="contact" class="py-24 bg-[#0a0a0a] relative overflow-hidden">
        <div class="absolute inset-0 bg-brand-yellow opacity-[0.03] bg-[radial-gradient(circle_at_center,_var(--tw-gradient-stops))] from-brand-yellow/20 via-transparent to-transparent"></div>
        
        <div class="max-w-6xl mx-auto px-4 sm:px-6 relative z-10">
            <div class="grid lg:grid-cols-2 gap-16">
                
                <div class="reveal">
                    <h4 class="text-brand-yellow font-mono mb-2">// GET IN TOUCH</h4>
                    <h2 class="text-5xl font-bold text-white mb-8">READY TO <br> <span class="text-brand-yellow">DOMINATE?</span></h2>
                    <p class="text-gray-400 mb-10 text-lg">
                        Tell us about your project. Whether it's a new betting platform, a custom CRM, or a performance audit. We reply within 2 hours.
                    </p>

                    <div class="space-y-6">
                        <div class="flex items-center gap-4">
                            <div class="w-12 h-12 bg-brand-yellow/10 rounded flex items-center justify-center text-brand-yellow">
                                <svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"/></svg>
                            </div>
                            <div>
                                <h5 class="text-white font-bold">Email Us</h5>
                                <p class="text-gray-500"><?php echo $config['email']; ?></p>
                            </div>
                        </div>
                        <div class="flex items-center gap-4">
                            <div class="w-12 h-12 bg-brand-yellow/10 rounded flex items-center justify-center text-brand-yellow">
                                <svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"/><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 11a3 3 0 11-6 0 3 3 0 016 0z"/></svg>
                            </div>
                            <div>
                                <h5 class="text-white font-bold">Location</h5>
                                <p class="text-gray-500"><?php echo $config['address']; ?></p>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="bg-brand-gray p-8 md:p-10 rounded-xl border border-white/5 shadow-2xl reveal delay-200">
                    <form action="" method="POST" class="space-y-6">
                        <div class="grid grid-cols-2 gap-6">
                            <div>
                                <label class="block text-gray-400 text-xs font-bold uppercase mb-2">Name</label>
                                <input type="text" name="name" class="w-full bg-black border border-white/10 text-white p-3 rounded focus:border-brand-yellow focus:outline-none transition-colors" placeholder="John Doe" required>
                            </div>
                            <div>
                                <label class="block text-gray-400 text-xs font-bold uppercase mb-2">Phone</label>
                                <input type="text" name="phone" class="w-full bg-black border border-white/10 text-white p-3 rounded focus:border-brand-yellow focus:outline-none transition-colors" placeholder="+880...">
                            </div>
                        </div>
                        <div>
                            <label class="block text-gray-400 text-xs font-bold uppercase mb-2">Service</label>
                            <select name="service" class="w-full bg-black border border-white/10 text-white p-3 rounded focus:border-brand-yellow focus:outline-none transition-colors">
                                <option>Betting Platform Development</option>
                                <option>Casino Integration</option>
                                <option>Performance Optimization</option>
                                <option>Other</option>
                            </select>
                        </div>
                        <div>
                            <label class="block text-gray-400 text-xs font-bold uppercase mb-2">Project Details</label>
                            <textarea name="message" rows="4" class="w-full bg-black border border-white/10 text-white p-3 rounded focus:border-brand-yellow focus:outline-none transition-colors" placeholder="Describe your vision..."></textarea>
                        </div>
                        <button type="submit" class="w-full py-4 bg-brand-yellow text-black font-bold uppercase tracking-wider rounded-sm btn-3d-yellow hover:bg-white transition-colors">
                            Send Proposal
                        </button>
                    </form>
                </div>

            </div>
        </div>
    </section>

    <footer class="bg-black border-t border-white/10 pt-20 pb-10">
        <div class="max-w-7xl mx-auto px-4 sm:px-6">
            <div class="grid grid-cols-1 md:grid-cols-4 gap-12 mb-12">
                <div class="col-span-1 md:col-span-2">
                    <span class="text-3xl font-bold tracking-tighter text-white">APEX<span class="text-brand-yellow">A</span></span>
                    <p class="text-gray-500 mt-4 max-w-sm leading-relaxed">
                        Bangladeshi-based elite software development agency. We specialize in high-concurrency PHP applications for the global iGaming industry.
                    </p>
                </div>
                <div>
                    <h4 class="text-white font-bold mb-4 uppercase tracking-widest text-sm">Links</h4>
                    <ul class="space-y-2 text-gray-500 text-sm">
                        <li><a href="#" class="hover:text-brand-yellow transition-colors">About Us</a></li>
                        <li><a href="#" class="hover:text-brand-yellow transition-colors">Services</a></li>
                        <li><a href="#" class="hover:text-brand-yellow transition-colors">Portfolio</a></li>
                        <li><a href="#" class="hover:text-brand-yellow transition-colors">Contact</a></li>
                    </ul>
                </div>
                <div>
                    <h4 class="text-white font-bold mb-4 uppercase tracking-widest text-sm">Legal</h4>
                    <ul class="space-y-2 text-gray-500 text-sm">
                        <li><a href="#" class="hover:text-brand-yellow transition-colors">Privacy Policy</a></li>
                        <li><a href="#" class="hover:text-brand-yellow transition-colors">Terms of Service</a></li>
                        <li><a href="#" class="hover:text-brand-yellow transition-colors">NDA Policy</a></li>
                    </ul>
                </div>
            </div>
            <div class="border-t border-white/10 pt-8 flex flex-col md:flex-row justify-between items-center">
                <p class="text-gray-600 text-sm">&copy; <?php echo date("Y"); ?> Apexa Solutions.</p>
                <div class="flex items-center gap-2 mt-4 md:mt-0">
                    <div class="w-2 h-2 bg-green-500 rounded-full animate-pulse"></div>
                    <span class="text-gray-500 text-xs font-mono uppercase">System Healthy</span>
                </div>
            </div>
        </div>
    </footer>

    <script>
        // Preloader Logic
        window.addEventListener('load', () => {
            const loader = document.getElementById('loader');
            loader.style.opacity = '0';
            setTimeout(() => {
                loader.style.display = 'none';
            }, 500);
        });

        // Mobile Menu Toggle
        const mobileBtn = document.getElementById('mobile-menu-btn');
        const mobileMenu = document.getElementById('mobile-menu');
        mobileBtn.addEventListener('click', () => {
            mobileMenu.classList.toggle('hidden');
        });

        // Scroll Reveal Animation (Intersection Observer)
        const observerOptions = {
            threshold: 0.1,
            rootMargin: "0px 0px -50px 0px"
        };
        const observer = new IntersectionObserver((entries) => {
            entries.forEach(entry => {
                if (entry.isIntersecting) {
                    entry.target.classList.add('active');
                    observer.unobserve(entry.target); // Reveal only once
                }
            });
        }, observerOptions);
        
        document.querySelectorAll('.reveal').forEach(el => {
            observer.observe(el);
        });

        // Navbar Glass Effect on Scroll
        const navbar = document.getElementById('navbar');
        window.addEventListener('scroll', () => {
            if (window.scrollY > 50) {
                navbar.classList.add('shadow-lg', 'border-brand-yellow/30');
                navbar.classList.remove('border-white/5');
            } else {
                navbar.classList.remove('shadow-lg', 'border-brand-yellow/30');
                navbar.classList.add('border-white/5');
            }
        });

        // Accordion Logic
        function toggleFaq(index) {
            const content = document.getElementById(`content-${index}`);
            const icon = document.getElementById(`icon-${index}`);
            
            if (content.classList.contains('hidden')) {
                // Close all others first (optional)
                document.querySelectorAll('[id^="content-"]').forEach(el => el.classList.add('hidden'));
                document.querySelectorAll('[id^="icon-"]').forEach(el => {
                    el.innerText = '+';
                    el.classList.remove('rotate-45');
                });

                content.classList.remove('hidden');
                icon.innerText = '-';
                icon.classList.add('rotate-45'); // Just for effect if we used an SVG rotation
            } else {
                content.classList.add('hidden');
                icon.innerText = '+';
                icon.classList.remove('rotate-45');
            }
        }
    </script>
</body>
</html>