/* ==========================================================================
   Neural Partners - Main Stylesheet  
   Shared styles across all pages - Dual-lane architecture support
   ========================================================================== */

/* CSS Custom Properties (Variables) - Extended from critical.css */
:root {
  /* Extended Brand Colors */
  --neural-purple-light: #5a2e8a;
  --neural-purple-dark: #2a0f47;
  --neural-orange-light: #f59e0b;
  --neural-orange-dark: #b45309;
  --neural-blue: #00b8d3;  /* New brand color for Intelligence section - corrected */
  
  /* Grays */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  
  /* Typography - matching critical.css */
  --font-primary: 'Open Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Monaco, 'Cascadia Code', monospace;
  --font-weight-normal: 400;
  --font-weight-semibold: 600;
  
  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  
  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;
  
  /* Transitions - Dual-lane aware */
  --transition-fast: 150ms ease-in-out;
  --transition-normal: 250ms ease-in-out;
  --transition-slow: 350ms ease-in-out;
  
  /* Dual-lane variables */
  --animation-duration: 0.6s; /* Primary Lane default */
  --transition-duration: 0.3s; /* Primary Lane default */
}

/* ==========================================================================
   Base Styles
   ========================================================================== */

/* Reset and normalize */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-primary);
  line-height: 1.6;
  scroll-behavior: smooth;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Prevent horizontal scroll on mobile */
  overflow-x: hidden;
}

body {
  background: var(--neural-black);
  color: var(--neural-white);
  font-family: var(--font-primary);
  margin: 0;
  padding: 0;
  /* Prevent horizontal scroll on mobile */
  overflow-x: hidden;
  width: 100%;
}

/* Dual-lane body classes */
body.neural-optimized-lane {
  --animation-duration: 0.1s;
  --transition-duration: 0.1s;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: var(--space-md);
  color: var(--gray-900);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
  margin-bottom: var(--space-md);
  line-height: 1.7;
}

a {
  color: var(--neural-orange);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover,
a:focus {
  color: var(--neural-purple);
}

/* Focus styles for accessibility */
:focus-visible {
  outline: 2px solid var(--neural-primary);
  outline-offset: 2px;
}

/* Remove outline for mouse users */
:focus:not(:focus-visible) {
  outline: none;
}

/* Performance optimizations for Core Web Vitals */
img, video {
  /* Prevent layout shifts */
  aspect-ratio: attr(width) / attr(height);
  height: auto;
}

/* Contain layout for performance */
.hero,
.section {
  contain: layout style;
}

/* GPU acceleration for animations */
.service-card,
.benefit,
.btn {
  transform: translateZ(0);
  will-change: auto;
}

/* Optimize font loading for FCP */
@font-face {
  font-family: 'Open Sans';
  font-display: swap;
  src: local('Open Sans');
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Lists */
ul, ol {
  margin-bottom: var(--space-md);
  padding-left: var(--space-lg);
}

li {
  /* margin-bottom: var(--space-xs); */
}

/* ==========================================================================
   Layout Components
   ========================================================================== */

/* Account for fixed header - handled by design-system.css */
/* main padding-top is now centrally managed in design-system.css */

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

@media (min-width: 640px) {
  .container {
    padding: 0 var(--space-lg);
  }
}

@media (min-width: 1024px) {
  .container {
    padding: 0 var(--space-xl);
  }
}

.section {
  padding: var(--space-4xl) 0;
}

.section--dark {
  background-color: var(--neural-dark);
  color: var(--white);
}

.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4,
.section--dark h5,
.section--dark h6 {
  color: var(--white);
}

.section__header {
  text-align: center;
  margin-bottom: var(--space-4xl);
}

.section__title {
  margin-bottom: var(--space-md);
  background: linear-gradient(135deg, var(--neural-primary), var(--neural-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section--dark .section__title {
  background: linear-gradient(135deg, var(--white), var(--neural-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section__description {
  font-size: 1.125rem;
  color: var(--gray-600);
  max-width: 600px;
  margin: 0 auto;
}

.section--dark .section__description {
  color: var(--gray-300);
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

.header {
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(var(--neural-grey-rgb), 0.2);
  transition: all var(--transition-normal);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  max-width: 1400px;
  margin: 0 auto;
}

.nav__brand {
  flex-shrink: 0;
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--gray-900);
  transition: color var(--transition-fast);
}

.nav__logo:hover {
  color: var(--neural-primary);
}

.nav__logo-icon {
  color: var(--neural-primary);
}

.nav__menu {
  display: none;
  flex: 1;
  justify-content: center;
}

@media (min-width: 768px) {
  .nav__menu {
    display: flex;
  }
}

.nav__list {
  display: flex;
  gap: var(--space-xl);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__link {
  color: var(--gray-700);
  font-weight: 500;
  position: relative;
  transition: color var(--transition-fast);
}

.nav__link:hover,
.nav__link:focus {
  color: var(--neural-primary);
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--neural-primary);
  transition: width var(--transition-normal);
}

.nav__link:hover::after {
  width: 100%;
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.nav__toggle {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-xs);
}

@media (min-width: 768px) {
  .nav__toggle {
    display: none;
  }
}

.nav__toggle-line {
  width: 24px;
  height: 2px;
  background-color: var(--neural-white);
  transition: all var(--transition-fast);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm) var(--space-lg);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.5;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.btn--primary {
  background: linear-gradient(135deg, var(--neural-primary), var(--neural-secondary));
  color: var(--white);
  box-shadow: var(--shadow-sm);
}

.btn--primary:hover {
  background: linear-gradient(135deg, var(--neural-secondary), var(--neural-primary));
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  color: var(--white);
}

.btn--secondary {
  background: var(--white);
  color: var(--neural-primary);
  border-color: var(--neural-primary);
}

.btn--secondary:hover {
  background: var(--neural-primary);
  color: var(--white);
}

.btn--large {
  padding: var(--space-md) var(--space-xl);
  font-size: 1rem;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero {
  padding-top: 120px;
  padding-bottom: var(--space-4xl);
  background: linear-gradient(135deg, var(--neural-light) 0%, var(--white) 100%);
  position: relative;
  overflow: hidden;
}

.hero__container {
  display: grid;
  gap: var(--space-4xl);
  align-items: center;
}

@media (min-width: 1024px) {
  .hero__container {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4xl);
  }
}

.hero__content {
  text-align: center;
}

@media (min-width: 1024px) {
  .hero__content {
    text-align: left;
  }
}

.hero__badge {
  display: inline-flex;
  padding: var(--space-xs) var(--space-md);
  background: var(--primary-50);
  color: var(--neural-primary);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: var(--space-lg);
}

.hero__title {
  margin-bottom: var(--space-lg);
  font-weight: 700;
}

.hero__title-highlight {
  background: linear-gradient(135deg, var(--neural-primary), var(--neural-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__description {
  font-size: 1.125rem;
  color: var(--gray-600);
  margin-bottom: var(--space-xl);
  max-width: 500px;
}

@media (min-width: 1024px) {
  .hero__description {
    margin-left: 0;
    margin-right: 0;
  }
}

.hero__actions {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
  flex-wrap: wrap;
  justify-content: center;
}

@media (min-width: 1024px) {
  .hero__actions {
    justify-content: flex-start;
  }
}

.hero__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--space-lg);
}

.stat {
  text-align: center;
}

@media (min-width: 1024px) {
  .stat {
    text-align: left;
  }
}

.stat__number {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--neural-primary);
  margin-bottom: var(--space-xs);
}

.stat__label {
  font-size: 0.875rem;
  color: var(--gray-600);
  font-weight: 500;
}

.hero__visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
}

.hero__visual-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
  border-radius: 50%;
}

.hero__network {
  position: relative;
  width: 300px;
  height: 300px;
}

.network-node {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--neural-primary);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.network-node:nth-child(1) {
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  animation-delay: 0s;
}

.network-node:nth-child(2) {
  top: 40%;
  left: 20%;
  animation-delay: 0.4s;
}

.network-node:nth-child(3) {
  top: 40%;
  right: 20%;
  animation-delay: 0.8s;
}

.network-node:nth-child(4) {
  bottom: 30%;
  left: 30%;
  animation-delay: 1.2s;
}

.network-node:nth-child(5) {
  bottom: 30%;
  right: 30%;
  animation-delay: 1.6s;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.2);
  }
}

/* ==========================================================================
   Services Section
   ========================================================================== */

.services-grid {
  display: grid;
  gap: var(--space-xl);
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.service-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.service-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(135deg, var(--neural-primary), var(--neural-secondary));
}

.service-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--primary-50);
  border-radius: var(--radius-lg);
  color: var(--neural-primary);
  margin-bottom: var(--space-lg);
}

.service-card__title {
  margin-bottom: var(--space-md);
  color: var(--gray-900);
}

.service-card__description {
  color: var(--gray-600);
  margin-bottom: var(--space-lg);
}

.service-card__link {
  color: var(--neural-primary);
  font-weight: 500;
  font-size: 0.875rem;
  transition: color var(--transition-fast);
}

.service-card__link:hover {
  color: var(--neural-secondary);
}

/* ==========================================================================
   Benefits Section
   ========================================================================== */

.benefits-grid {
  display: grid;
  gap: var(--space-xl);
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.benefit {
  text-align: center;
}

@media (min-width: 768px) {
  .benefit {
    text-align: left;
  }
}

.benefit__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--neural-primary), var(--neural-secondary));
  color: var(--white);
  border-radius: var(--radius-lg);
  font-weight: 700;
  font-size: 1.125rem;
  margin-bottom: var(--space-lg);
}

.benefit__title {
  margin-bottom: var(--space-md);
  color: var(--white);
}

.benefit__description {
  color: var(--gray-300);
}

/* ==========================================================================
   CTA Section
   ========================================================================== */

.cta {
  background: linear-gradient(135deg, var(--neural-primary), var(--neural-secondary));
  color: var(--white);
}

.cta__content {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.cta__title {
  color: var(--white);
  margin-bottom: var(--space-lg);
}

.cta__description {
  font-size: 1.125rem;
  margin-bottom: var(--space-xl);
  opacity: 0.9;
}

.cta__actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

.cta .btn--primary {
  background: var(--white);
  color: var(--neural-primary);
}

.cta .btn--primary:hover {
  background: var(--gray-100);
  color: var(--neural-primary);
}

.cta .btn--secondary {
  background: transparent;
  color: var(--white);
  border-color: var(--white);
}

.cta .btn--secondary:hover {
  background: var(--white);
  color: var(--neural-primary);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  background-color: var(--neural-dark);
  color: var(--white);
  padding: var(--space-4xl) 0 var(--space-xl);
}

.footer__top {
  display: grid;
  gap: var(--space-4xl);
  margin-bottom: var(--space-3xl);
}

@media (min-width: 768px) {
  .footer__top {
    grid-template-columns: 1fr 2fr;
  }
}

.footer__brand {
  max-width: 400px;
}

.footer__logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--white);
  margin-bottom: var(--space-lg);
}

.footer__description {
  color: var(--gray-300);
  line-height: 1.6;
}

.footer__links {
  display: grid;
  gap: var(--space-xl);
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.footer__column-title {
  font-weight: 600;
  margin-bottom: var(--space-md);
  color: var(--white);
}

.footer__list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer__link {
  color: var(--gray-300);
  line-height: 1.8;
  transition: color var(--transition-fast);
}

.footer__link:hover {
  color: var(--neural-accent);
}

.footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-xl);
  border-top: 1px solid var(--gray-700);
  flex-wrap: wrap;
  gap: var(--space-md);
}

.footer__copyright {
  color: var(--gray-400);
  font-size: 0.875rem;
}

.footer__social {
  display: flex;
  gap: var(--space-md);
}

.footer__social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--gray-800);
  color: var(--gray-300);
  border-radius: var(--radius-lg);
  transition: all var(--transition-fast);
}

.footer__social-link:hover {
  background: var(--neural-primary);
  color: var(--white);
  transform: translateY(-2px);
}

/* ==========================================================================
   Utilities
   ========================================================================== */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .hero__title-highlight,
  .section__title {
    -webkit-text-fill-color: unset;
    background: unset;
    color: var(--neural-primary);
  }
}

/* ==========================================================================
   Header Component Styles
   ========================================================================== */

/* Mobile-first responsive navigation */
@media (min-width: 768px) {
    .nav__menu {
        display: flex !important;
    }
    
    .nav__toggle {
        display: none !important;
    }
}

/* Navigation link hover effects */
.nav__link {
    position: relative;
}

.nav__link:hover {
    opacity: 1 !important;
    color: var(--neural-white) !important;
}

.nav__link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--neural-white);
    transition: width var(--transition-normal);
}

.nav__link:hover::after {
    width: 100%;
}

/* Active link styling */
.nav__link--active::after {
    width: 100%;
    background: var(--neural-white);
}

/* Mobile overlay enhancements */
.nav__mobile-overlay a:hover {
    color: var(--neural-purple) !important;
    transform: translateX(6px);
}

/* Logo responsive behavior */
.nav__brand img {
    transition: all var(--transition-normal);
}

@media (max-width: 640px) {
    .nav__brand img {
        height: 28px !important;
        max-width: 160px !important;
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    .nav__brand img {
        height: 30px !important;
        max-width: 180px !important;
    }
}

/* Performance optimized animations */
.nav__toggle-line,
.nav__mobile-overlay {
    will-change: transform, opacity;
}

/* High contrast mode support for header */
@media (prefers-contrast: high) {
    .header {
        border-bottom-color: var(--neural-white);
    }
}

/* Enhanced button styling */
.neural-btn--primary {
    background: linear-gradient(135deg, var(--neural-purple), #4a1a5a);
    transition: all var(--transition-normal);
    border: none;
}

.neural-btn--primary:hover {
    background: linear-gradient(135deg, #4a1a5a, var(--neural-purple));
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(var(--neural-purple-rgb), 0.3);
}

/* Reduced motion support for header */
@media (prefers-reduced-motion: reduce) {
    .nav__toggle-line,
    .nav__link::after,
    .nav__brand img,
    .nav__mobile-overlay a {
        transition: none;
    }
}

/* ==========================================================================
   Footer Component Styles
   ========================================================================== */

/* Responsive Footer Layout */
@media (max-width: 768px) {
    .footer__main {
        grid-template-columns: 1fr !important;
        gap: var(--space-3xl) !important;
    }
    
    .footer__social-cta {
        flex-direction: column !important;
        text-align: center !important;
        gap: var(--space-xl) !important;
    }
    
    .footer__social-cta > div:last-child {
        text-align: center !important;
    }
    
    .footer__bottom {
        flex-direction: column !important;
        text-align: center !important;
    }
}

@media (max-width: 640px) {
    .neural-grid--3 {
        grid-template-columns: 1fr !important;
        gap: var(--space-xl) !important;
    }
}

/* Footer Link Hover Effects */
.footer__link:hover,
.footer__legal-link:hover {
    color: var(--neural-white) !important;
}

.footer__social-link:hover {
    background: var(--neural-purple) !important;
    color: var(--neural-white) !important;
    transform: translateY(-2px);
}

/* SEO & Accessibility Enhancements */
.footer__brand a:focus,
.footer__link:focus,
.footer__social-link:focus,
.footer__legal-link:focus {
    outline: 2px solid var(--neural-purple);
    outline-offset: 2px;
}

/* Performance Optimizations */
.footer__social-link,
.footer__link {
    will-change: transform, color;
}

/* High contrast mode support for footer */
@media (prefers-contrast: high) {
    .footer__main,
    .footer__social-cta {
        border-color: var(--neural-white) !important;
    }
}

/* Reduced motion support for footer */
@media (prefers-reduced-motion: reduce) {
    .footer__link,
    .footer__social-link,
    .footer__legal-link {
        transition: none !important;
    }
    
    .footer__social-link:hover {
        transform: none !important;
    }
}

/* ==========================================================================
   NEURAL PARTNERS HERO SECTION - CSS COMPONENTS
   ========================================================================== 
   
   This section contains all styling for the homepage hero section including:
   - Chat widget with IDE/terminal styling
   - Scroll indicator with animations
   - Text glow effects and neural color integration
   - Responsive layout system
   
   TECHNICAL ARCHITECTURE:
   - Flexbox positioning prevents chat widget upward expansion
   - Design system variables for consistent spacing/colors
   - Progressive enhancement for mobile-first responsive design
   
   ========================================================================== */

/* Neural Chat Widget Container - Fixed positioning */
.neural-chat-widget-container {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Important: align to top */
}

/* Neural Chat Widget - IDE/Terminal Style with fixed positioning */
.neural-hero__chat-widget {
    background: rgba(0, 0, 0, 0.03); /* Neural black with ultra-low opacity */
    backdrop-filter: blur(5px);
    border: 3px solid var(--neural-purple); /* Neural purple 3px border */
    border-radius: var(--radius-lg);
    padding: 0;
    margin: 0; /* Remove margin - positioning handled by container */
    max-width: 920px; /* Increased from 800px */
    width: 100%;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        0 0 20px rgba(var(--neural-purple-rgb), 0.3);
    position: relative;
    overflow: hidden;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    height: auto; /* Let content determine height */
    display: flex;
    flex-direction: column;
    max-height: 500px; /* Set maximum height to prevent excessive growth */
}

/* Chat Header - VS Code style title bar */
.neural-chat__header {
    background: rgba(0, 0, 0, 0.02); /* Ultra-transparent neural black header */
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: #cccccc;
    flex-shrink: 0; /* Header stays fixed at top */
}

/* Chat Status Indicator */
.neural-chat__status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #cccccc;
}

.neural-chat__status::before {
    content: "●●●";
    color: #ff5f56;
    margin-right: 0.5rem;
}

.neural-chat__status-dot {
    width: 6px;
    height: 6px;
    background: #00ff00; /* Terminal green */
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

/* Messages Container - Expandable with scroll overflow */
.neural-chat__messages {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: transparent;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.4;
    flex-grow: 1; /* Messages container expands to fill available space */
    justify-content: flex-start; /* Start messages from top of container */
    align-items: stretch;
    overflow-y: auto; /* Allow scrolling if content exceeds max height */
    min-height: 200px; /* Ensure minimum space for messages */
    max-height: 300px; /* Limit maximum height for scrolling */
}

/* Individual Message Styling */
.neural-chat__message {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    padding: 0.25rem 0;
    width: 100%;
}

.neural-chat__message.visible {
    opacity: 1;
    transform: translateY(0);
}

.neural-chat__message--user {
    flex-direction: row-reverse;
    justify-content: flex-start;
    text-align: right;
}

.neural-chat__message--system {
    flex-direction: row;
    justify-content: flex-start;
    text-align: left;
}

/* Avatar Styling - Terminal/IDE inspired */
.neural-chat__avatar {
    width: 24px;
    height: 24px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 600;
    flex-shrink: 0;
    font-family: 'JetBrains Mono', monospace;
    margin-top: 0.1rem;
}

.neural-chat__message--user .neural-chat__avatar {
    background: var(--neural-orange) !important; /* Neural orange for user */
    color: var(--neural-white);
}

.neural-chat__message--user .neural-chat__avatar::before {
    content: ">";
    font-weight: bold;
}

.neural-chat__message--system .neural-chat__avatar {
    background: var(--neural-purple) !important; /* Neural purple for system */
    color: var(--neural-white);
}

.neural-chat__message--system .neural-chat__avatar::before {
    content: "$";
    font-weight: bold;
}

/* Message Bubble Styling */
.neural-chat__bubble {
    max-width: 85%;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    line-height: 1.4;
    position: relative;
    background: transparent;
    border: none;
    font-family: 'JetBrains Mono', monospace;
}

.neural-chat__message--user .neural-chat__bubble {
    background: rgba(var(--neural-orange-rgb), 0.1) !important;
    color: var(--neural-white) !important; /* Neural white for user messages */
    border-right: 2px solid var(--neural-orange) !important;
    padding-right: 0.75rem;
    margin-right: 0.25rem;
    text-align: right;
}

.neural-chat__message--system .neural-chat__bubble {
    background: rgba(var(--neural-mid-grey-rgb), 0.8) !important;
    color: var(--neural-white) !important; /* Neural white for system messages */
    border-left: 2px solid var(--neural-purple) !important;
    padding-left: 0.75rem;
    margin-left: 0.25rem;
    text-align: left;
}

.neural-chat__message--system .neural-chat__bubble .message-text {
    color: var(--neural-white) !important; /* Neural white for responses */
}

/* Chat CTA Button Styling */
.neural-chat__cta {
    padding: 1rem;
    text-align: center;
    border-top: 1px solid rgba(var(--neural-grey-rgb), 0.3);
    background: rgba(45, 45, 48, 0.8) !important; /* Ultra dark background */
    flex-shrink: 0; /* CTA stays fixed at bottom */
}

.neural-chat__cta .neural-btn {
    min-width: 200px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    background: var(--neural-black) !important;
    border: 1px solid var(--neural-purple) !important;
    color: var(--neural-white) !important;
    padding: 0.6rem 1.2rem;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.neural-chat__cta .neural-btn:hover {
    background: var(--neural-purple) !important;
    color: var(--neural-white) !important;
    box-shadow: 0 0 10px rgba(var(--neural-purple-rgb), 0.4) !important;
}

/* Animation Keyframes */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}



/* ==========================================================================
   HERO TEXT EFFECTS AND STYLING
   ========================================================================== */

/* Hero-specific tagline styling with subtle glow */
.neural-hero .neural-tagline {
    font-size: 1.25rem;
    letter-spacing: 0.15em;
    position: relative;
    z-index: 10;
    text-shadow: 
        0 0 20px rgba(255, 255, 255, 0.1),
        0 0 40px rgba(255, 255, 255, 0.05),
        0 0 80px rgba(var(--neural-soft-blue-rgb), 0.06);
}

/* Neural Statement with subtle glow - Minimal, refined styling */
.neural-statement {
    color: var(--neural-light-grey);
    position: relative;
    z-index: 2;
    text-shadow: 
        0 0 15px rgba(255, 255, 255, 0.08),
        0 0 30px rgba(255, 255, 255, 0.04),
        0 0 60px rgba(var(--neural-soft-blue-rgb), 0.1);
}

/* Ensure the colored keywords (Modern/Disruptive) maintain their original styling */
.neural-key-word {
    font-weight: var(--font-weight-medium);
    position: relative;
    transition: all var(--transition-normal);
    text-shadow: none; /* Remove glow from colored words */
}

.neural-key-word--warm {
    color: var(--neural-orange);
}

.neural-key-word--cool {
    color: var(--neural-purple);
}

.neural-key-word:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
}

/* ==========================================================================
   RESPONSIVE DESIGN FOR HERO COMPONENTS
   ========================================================================== */

/* Hero section main layout */
.neural-hero {
    padding: 0;
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    background-color: var(--neural-black);
    width: 100vw !important;
    margin: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw !important;
    margin-right: -50vw !important;
    touch-action: pan-y; /* Enable vertical scrolling */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

/* Hero container with flexbox layout */
.neural-hero__container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-4xl) var(--space-xl);
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    min-height: 100vh;
}

/* Responsive hero container */
@media (min-width: 768px) and (max-width: 1023px) {
    .neural-hero__container {
        padding: var(--space-3xl) var(--space-lg);
    }
}

@media (min-width: 1024px) {
    .neural-hero__container {
        padding: var(--space-5xl) var(--space-xl);
        max-width: 1200px;
    }
}

/* Hero content structure */
.neural-hero__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    position: relative;
    z-index: 3;
}

/* Desktop-specific headline layout */
@media (min-width: 1024px) {
    .neural-hero__headline {
        line-height: 1.1;
        margin-bottom: var(--space-md);
    }
}

/* Hero text section spacing */
.neural-hero__text {
    margin-bottom: var(--space-lg); /* Reduced from var(--space-2xl) */
}

@media (min-width: 768px) {
    .neural-hero__text {
        margin-bottom: var(--space-xl); /* Reduced from var(--space-3xl) */
    }
}

/* Flexible spacer to control chat widget positioning */
.neural-hero__spacer {
    flex: 1;
    min-height: 20px; /* Further reduced spacing */
    display: flex;
    align-items: flex-end;
}

@media (max-width: 767px) {
    .neural-hero__spacer {
        min-height: 15px;
    }
}

/* Tagline underline positioning */
.neural-hero .neural-tagline::before {
    content: '';
    position: absolute;
    bottom: calc(-1 * var(--space-2xl));
    left: 50%;
    transform: translateX(-50%);
    width: 320px;
    height: 4px;
    background: linear-gradient(90deg, var(--neural-orange), var(--neural-purple));
    border-radius: var(--radius-sm);
}

/* Responsive navigation padding */
@media (max-width: 768px) {
    .nav {
        padding: var(--space-md) var(--space-md);
    }
}

@media (max-width: 480px) {
    .nav {
        padding: var(--space-md) var(--space-sm);
    }
}

/* Responsive Chat Widget Design */
@media (max-width: 768px) {
    .neural-hero__chat-widget {
        max-width: 95%;
        margin: 0 auto 4rem auto;
        font-size: 0.8rem;
        min-height: 280px; /* Maintain minimum height on mobile */
        touch-action: pan-y; /* Enable vertical scrolling */
    }
    
    .neural-chat__header {
        padding: 0.625rem 0.875rem;
    }
    
    .neural-chat__messages {
        padding: 0.875rem;
        gap: 0.375rem;
        font-size: 0.8rem;
    }
    
    .neural-chat__bubble {
        max-width: 90%;
        font-size: 0.8rem;
        padding: 0.375rem 0.625rem;
    }
    
    .neural-chat__cta {
        padding: 0.875rem;
    }
    
    .neural-chat__cta .neural-btn {
        min-width: 180px;
        font-size: 0.75rem;
        padding: 0.5rem 1rem;
    }
}

@media (max-width: 480px) {
    .neural-hero__chat-widget {
        max-width: 100%;
        margin: 0 auto 3rem auto;
        border-radius: var(--radius-md);
        min-height: 260px; /* Smaller minimum height for mobile */
    }
    
    .neural-chat__bubble {
        max-width: 92%;
        font-size: 0.75rem;
    }
    
    .neural-chat__avatar {
        width: 20px;
        height: 20px;
        font-size: 0.55rem;
    }
    
    .neural-chat__messages {
        font-size: 0.75rem;
    }
}

/* ==========================================================================
   Intelligence Hub Specific Styles
   ========================================================================== */

.intelligence-hero {
    background: linear-gradient(135deg, var(--neural-black) 0%, var(--neural-dark-grey) 100%);
    padding: var(--space-4xl) 0;
    position: relative;
    overflow: hidden;
}

.intelligence-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(
        ellipse at 30% 40%,
        rgba(var(--neural-purple-rgb), 0.1) 0%,
        transparent 70%
    ),
    radial-gradient(
        ellipse at 70% 60%,
        rgba(var(--neural-orange-rgb), 0.08) 0%,
        transparent 65%
    );
    z-index: 1;
}

.intelligence-hero__content {
    position: relative;
    z-index: 2;
}

.intelligence-hero__badge {
    display: inline-block;
    padding: var(--space-xs) var(--space-lg);
    background: linear-gradient(135deg, rgba(var(--neural-orange-rgb), 0.2), rgba(var(--neural-purple-rgb), 0.2));
    border: 1px solid rgba(var(--neural-orange-rgb), 0.3);
    border-radius: var(--radius-full);
    color: var(--neural-orange);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: var(--space-lg);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.intelligence-search {
    position: relative;
    max-width: 600px;
    margin: var(--space-2xl) auto 0;
}

.intelligence-search__icon {
    position: absolute;
    left: var(--space-lg);
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 1.125rem;
    z-index: 3;
}

.intelligence-search__input {
    width: 100%;
    padding: var(--space-lg) var(--space-lg) var(--space-lg) calc(var(--space-lg) + 32px);
    background: rgba(var(--gray-800), 0.8);
    border: 2px solid rgba(var(--gray-400), 0.2);
    border-radius: var(--radius-lg);
    color: var(--white);
    font-size: 1rem;
    transition: all var(--transition-normal);
    backdrop-filter: blur(10px);
}

.intelligence-search__input::placeholder {
    color: var(--gray-400);
}

.intelligence-search__input:focus {
    outline: none;
    border-color: var(--neural-accent);
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.3);
    background: var(--gray-800);
}

.intelligence-category__icon {
    width: 48px;
    height: 48px;
    margin: 0 auto var(--space-md);
    background: linear-gradient(135deg, var(--neural-primary), var(--neural-secondary));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--white);
    font-weight: 700;
}

.intelligence-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--space-xl);
    margin-top: var(--space-2xl);
}

.intelligence-post__image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--neural-primary), var(--neural-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--white);
    position: relative;
    overflow: hidden;
    font-weight: 700;
}

.intelligence-post__image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50"><circle cx="10" cy="10" r="0.5" fill="rgba(255,255,255,0.2)"/><circle cx="40" cy="15" r="0.5" fill="rgba(255,255,255,0.2)"/><circle cx="20" cy="35" r="0.5" fill="rgba(255,255,255,0.2)"/><circle cx="35" cy="40" r="0.5" fill="rgba(255,255,255,0.2)"/></svg>') repeat;
}

.intelligence-post__category {
    background: rgba(6, 182, 212, 0.1);
    color: var(--neural-accent);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.875rem;
}

.intelligence-post__arrow {
    color: var(--neural-accent);
    font-size: 1.125rem;
    transition: transform var(--transition-normal);
}

.neural-card:hover .intelligence-post__arrow {
    transform: translateX(4px);
}

.intelligence-categories .neural-card:hover {
    border-color: var(--neural-accent);
    box-shadow: 0 15px 40px rgba(6, 182, 212, 0.1);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .intelligence-hero {
        padding: var(--space-2xl) 0;
    }
    
    .intelligence-posts-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
    
    .intelligence-search {
        margin: var(--space-lg) auto 0;
    }
    
    .intelligence-search__input {
        padding: var(--space-md) var(--space-md) var(--space-md) calc(var(--space-md) + 28px);
    }
    
    .intelligence-search__icon {
        left: var(--space-md);
    }
}

/* ==========================================================================
   Neural Cookie Consent Banner
   ========================================================================== */

.neural-cookie-banner {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    right: 2rem;
    max-width: 600px;
    z-index: 999999; /* Increased z-index to ensure it's always on top */
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(99, 102, 241, 0.1);
    color: var(--white);
    font-family: var(--font-primary);
    animation: slideInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    /* Ensure visibility */
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(100px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.neural-cookie-banner__content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.neural-cookie-banner__text p {
    margin: 0 0 1rem 0;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
}

.neural-cookie-banner__text p:first-child {
    font-size: 1.1rem;
    color: var(--white);
}

.neural-cookie-banner__text p strong {
    color: var(--white);
}

.neural-cookie-banner__footer {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0 !important;
}

.neural-cookie-banner__footer a {
    color: rgba(99, 102, 241, 0.9);
    text-decoration: none;
    transition: color 0.2s ease;
}

.neural-cookie-banner__footer a:hover {
    color: var(--neural-primary);
    text-decoration: underline;
}

.neural-cookie-banner__actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.neural-cookie-banner .neural-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.neural-cookie-banner .neural-btn--primary {
    background: var(--neural-primary);
    color: var(--white);
    border-color: var(--neural-primary);
}

.neural-cookie-banner .neural-btn--primary:hover {
    background: var(--primary-700);
    border-color: var(--primary-700);
    transform: translateY(-1px);
}

.neural-cookie-banner .neural-btn--secondary {
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    border-color: rgba(255, 255, 255, 0.3);
}

.neural-cookie-banner .neural-btn--secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.5);
}

.neural-cookie-banner .neural-btn--text {
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    border: none;
    padding-left: 0;
    padding-right: 0;
}

.neural-cookie-banner .neural-btn--text:hover {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: underline;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .neural-cookie-banner {
        bottom: 1rem;
        left: 1rem;
        right: 1rem;
        padding: 1.5rem;
        max-width: none;
    }
    
    .neural-cookie-banner__actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .neural-cookie-banner .neural-btn {
        justify-content: center;
        width: 100%;
    }
    
    .neural-cookie-banner .neural-btn--text {
        width: auto;
        align-self: center;
        margin-top: 0.5rem;
    }
}

@media (max-width: 480px) {
    .neural-cookie-banner {
        padding: 1rem;
    }
    
    .neural-cookie-banner__text p:first-child {
        font-size: 1rem;
    }
}


/* ==========================================================================
   Mobile Responsive Fixes - iPhone and all mobile devices
   ========================================================================== */

/* Mobile base styles for all devices under 768px */
@media (max-width: 768px) {
    /* Container and section fixes */
    section {
        padding: 3rem 1.25rem;
        overflow-x: hidden;
    }
    
    .container {
        padding: 0 1.25rem;
        max-width: 100%;
    }
    
    /* Typography scaling */
    h1 {
        font-size: clamp(1.75rem, 5vw, 2.5rem);
        line-height: 1.2;
    }
    
    h2 {
        font-size: clamp(1.5rem, 4vw, 2rem);
        line-height: 1.3;
    }
    
    h3 {
        font-size: clamp(1.25rem, 3.5vw, 1.75rem);
        line-height: 1.3;
    }
    
    p {
        font-size: 1rem;
        line-height: 1.6;
    }
    
    /* Grid layouts - force single column */
    .neural-grid,
    .service-cards,
    .intelligence-grid,
    .core-cards-container {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }
    
    /* Card components */
    .neural-card,
    .service-card,
    .intelligence-card {
        width: 100%;
        margin: 0 0 1rem 0;
        padding: 1.5rem;
    }
    
    /* Buttons */
    .btn,
    .neural-btn {
        font-size: 0.9rem;
        padding: 0.75rem 1.5rem;
        min-height: 44px; /* iOS touch target */
    }
    
    /* Forms - prevent zoom on iOS */
    input,
    textarea,
    select {
        font-size: 16px;
        width: 100%;
    }
}

/* iPhone specific styles (390-430px width) */
@media (max-width: 430px) {
    /* Tighter padding for small screens */
    section {
        padding: 2.5rem 1rem;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    /* Even smaller typography */
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    p {
        font-size: 0.95rem;
    }
    
    /* Smaller cards */
    .neural-card,
    .service-card,
    .intelligence-card {
        padding: 1.25rem;
    }
}

/* Very small phones (under 375px) */
@media (max-width: 375px) {
    section {
        padding: 2rem 0.75rem;
    }
    
    .container {
        padding: 0 0.75rem;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.35rem;
    }
    
    /* Minimal padding on cards */
    .neural-card,
    .service-card,
    .intelligence-card {
        padding: 1rem;
    }
}
