<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <link rel="icon" type="image/png" href="/favicon.png" />
    <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
    <link rel="apple-touch-icon" href="/favicon.png" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Tradealicious - AI-Powered Crypto Trading</title>
    <meta name="description" content="Tradealicious: AI-powered crypto trading platform with autonomous agents, smart contracts, and advanced risk management." />
    
    <!-- Preconnect to external domains -->
    <link rel="preconnect" href="https://firebasestorage.googleapis.com" crossorigin>
    <link rel="dns-prefetch" href="https://firebasestorage.googleapis.com">
    <link rel="dns-prefetch" href="https://www.googletagmanager.com">
    
    <!-- Removed preload tags for Firebase Storage images due to CSP restrictions on tradealicious.com -->
    <!-- Images will load on demand instead -->
    
    <!-- Oak Sans Font - Self-hosted for better performance and reliability -->
    <link href="/fonts/oak-sans.css" rel="stylesheet">
    
    <!-- Preload critical resources -->
    <!-- Logo images are bundled through Vite imports, no need to preload -->
    
    <!-- Meta tags for SEO -->
    <meta property="og:title" content="Tradealicious - AI-Powered Crypto Trading" />
    <meta property="og:description" content="AI-powered crypto trading platform with autonomous agents and smart contracts" />
    <meta property="og:type" content="website" />
    <meta property="og:url" content="https://tradealicious.com" />
    <meta property="og:image" content="/favicon.png" />
    
    <meta name="twitter:card" content="summary_large_image" />
    <meta name="twitter:title" content="Tradealicious - AI-Powered Crypto Trading" />
    <meta name="twitter:description" content="AI-powered crypto trading platform with autonomous agents and smart contracts" />
    <meta name="twitter:image" content="/favicon.png" />
    
    <!-- Theme color meta tag -->
    <meta name="theme-color" content="#FFFFFF" id="theme-color">
    
    <!-- Security headers managed by Firebase hosting -->
    
    
    <!-- Critical BigInt polyfill - must run before any modules -->
    <script>
      // Ensure BigInt can be serialized to JSON
      if (typeof BigInt !== 'undefined' && !BigInt.prototype.toJSON) {
        BigInt.prototype.toJSON = function() {
          return this.toString();
        };
      }
    </script>
    
    <!-- Critical theme initialization script -->
    <script>
      (function() {
        try {
          const storageKey = 'tradealicious-theme';
          const storedTheme = localStorage.getItem(storageKey);
          let theme = 'dark'; // Default to dark theme for landing page
          
          if (storedTheme === 'light' || storedTheme === 'dark') {
            theme = storedTheme;
          } else if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
            theme = 'dark';
          }
          
          // Apply theme immediately to prevent flash
          const root = document.documentElement;
          
          if (root) {
            root.classList.remove('light', 'dark');
            
            if (theme === 'dark') {
              root.classList.add('dark');
              root.style.colorScheme = 'dark';
              root.setAttribute('data-theme', 'dark');
              const themeColorMeta = document.getElementById('theme-color');
              if (themeColorMeta) {
                themeColorMeta.setAttribute('content', '#1B1212');
              }
            } else {
              root.classList.add('light');
              root.style.colorScheme = 'light';
              root.setAttribute('data-theme', 'light');
              const themeColorMeta = document.getElementById('theme-color');
              if (themeColorMeta) {
                themeColorMeta.setAttribute('content', '#FFFFFF');
              }
            }
          }
          
          // Apply to body when it's available
          const applyToBody = function() {
            if (document.body) {
              document.body.classList.remove('light', 'dark');
              document.body.classList.add(theme);
            }
          };
          
          if (document.body) {
            applyToBody();
          } else {
            // Wait for body to be available
            if (document.addEventListener) {
              document.addEventListener('DOMContentLoaded', applyToBody);
            }
          }
        } catch (e) {
          console.warn('Theme initialization failed:', e);
        }
      })();
    </script>
    <script type="module" crossorigin src="/assets/index-DwmCgmIe.js"></script>
    <link rel="stylesheet" crossorigin href="/assets/style-XUKSP2to.css">
  </head>
  <body>
    <div id="root"></div>
  </body>
</html>