/* ═══════════════════════════════════════════════════════════
   NexusAI Portfolio — Dark Purple Theme (Zarza Edition)
   ═══════════════════════════════════════════════════════════ */

/* ─── CSS Variables ─── */
:root {
  --white: #ffffff;
  --bg-primary: #07060f;
  --bg-secondary: #0e0b1a;
  --bg-tertiary: #150f26;
  --text-primary: #f0e8ff;
  --text-secondary: #c4b5fd;
  --text-muted: #8b7ab8;
  --blue: #9333ea;
  --blue-light: #a855f7;
  --cyan: #c084fc;
  --violet: #7c3aed;
  --gradient: linear-gradient(135deg, var(--violet) 0%, var(--blue) 50%, var(--cyan) 100%);
  --gradient-subtle: linear-gradient(135deg, rgba(124,58,237,0.2) 0%, rgba(147,51,234,0.15) 50%, rgba(192,132,252,0.2) 100%);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 40px rgba(147,51,234,0.35);
  --glass-bg: rgba(255,255,255,0.04);
  --glass-border: rgba(168,85,247,0.2);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Poppins', sans-serif;
  --font-display: 'Space Grotesk', sans-serif;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --nav-height: 72px;
}

/* ─── Reset & Base ─── */
*, *::before, *::after {
  margin: 0; padding: 0; box-sizing: border-box;
}
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; transition: color var(--transition); }
img { max-width: 100%; display: block; }
ul { list-style: none; }
button, input, textarea { font-family: inherit; border: none; outline: none; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ─── Background Effects ─── */
.bg-blobs {
  position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none;
}
.blob {
  position: absolute; border-radius: 50%;
  filter: blur(90px); opacity: 0.4;
  /* Static blobs — animating filter:blur() forces a GPU repaint every frame
     which tanks FPS on most devices. Static is just as visually effective. */
  transform: translateZ(0);
}
.blob-1 {
  width: 560px; height: 560px;
  background: radial-gradient(circle, rgba(147,51,234,0.45), transparent 70%);
  top: -10%; right: -5%;
}
.blob-2 {
  width: 450px; height: 450px;
  background: radial-gradient(circle, rgba(124,58,237,0.35), transparent 70%);
  bottom: 20%; left: -10%;
  animation-delay: -7s;
}
.blob-3 {
  width: 380px; height: 380px;
  background: radial-gradient(circle, rgba(192,132,252,0.3), transparent 70%);
  top: 50%; right: 20%;
  animation-delay: -14s;
}
/* blobFloat removed — see .blob comment above */
.grid-overlay {
  position: fixed; inset: 0; z-index: -1;
  background-image:
    linear-gradient(rgba(168,85,247,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(168,85,247,0.05) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}

/* ─── Typography Utilities ─── */
.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.section-tag {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.8rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--cyan);
  background: rgba(192,132,252,0.12);
  border: 1px solid rgba(192,132,252,0.2);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  margin-bottom: 16px;
}
.section-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700; line-height: 1.2; margin-bottom: 16px;
}
.section-desc { font-size: 1.1rem; color: var(--text-secondary); max-width: 600px; }
.section-header { text-align: center; margin-bottom: 64px; }
.section-header .section-desc { margin: 0 auto; }
.section { padding: 100px 0; position: relative; contain: layout style; }
/* Skip rendering sections until they scroll near the viewport.
   Testimonials and Contact are excluded — content-visibility: auto
   delays the IntersectionObserver on those sections, causing the
   fade-up animations to pop in late when the user scrolls to them. */
.section.about,
.section.services,
.section.demo,
.section.features,
.section.process {
  content-visibility: auto;
  contain-intrinsic-size: 0 600px;
}

/* ─── Glassmorphism ─── */
.glass {
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(168,85,247,0.18);
  border-radius: var(--radius-lg);
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px;
  font-family: var(--font-display); font-size: 0.95rem; font-weight: 600;
  border-radius: var(--radius-md); cursor: pointer;
  transition: all var(--transition); white-space: nowrap;
}
.btn-primary {
  background: var(--gradient);
  color: var(--white);
  box-shadow: 0 4px 20px rgba(147,51,234,0.4);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(147,51,234,0.55);
}
.btn-glow:hover {
  box-shadow: 0 0 30px rgba(147,51,234,0.5), 0 6px 20px rgba(147,51,234,0.35);
}
.btn-secondary {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
  border: 1px solid rgba(168,85,247,0.25);
}
.btn-secondary:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(192,132,252,0.2);
}
.btn-lg { padding: 16px 32px; font-size: 1rem; }
.btn-full { width: 100%; justify-content: center; }

/* ─── Navbar ─── */
.navbar {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 1000; height: var(--nav-height);
  transition: all var(--transition);
}
.navbar.scrolled {
  background: rgba(7,6,15,0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(168,85,247,0.15);
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}
.nav-container { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; }
.logo-img {
  width: 38px; height: 38px;
  object-fit: contain;
  border-radius: 8px;
  filter: drop-shadow(0 0 8px rgba(147,51,234,0.5));
}
.logo .accent {
  background: var(--gradient);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-links a { font-size: 0.9rem; font-weight: 500; color: var(--text-secondary); position: relative; }
.nav-links a::after {
  content: ''; position: absolute; bottom: -4px; left: 0;
  width: 0; height: 2px; background: var(--gradient);
  border-radius: 2px; transition: width var(--transition);
}
.nav-links a:hover { color: var(--text-primary); }
.nav-links a:hover::after { width: 100%; }
.nav-cta { padding: 10px 20px; font-size: 0.85rem; }
.mobile-toggle { display: none; flex-direction: column; gap: 5px; background: none; cursor: pointer; padding: 4px; }
.mobile-toggle span { display: block; width: 24px; height: 2px; background: var(--text-primary); border-radius: 2px; transition: all var(--transition); }
.mobile-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
.mobile-toggle.active span:nth-child(2) { opacity: 0; }
.mobile-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }

/* ─── Hero ─── */
.hero { padding: calc(var(--nav-height) + 60px) 0 100px; min-height: 100vh; display: flex; align-items: center; }
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.badges { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; font-size: 0.8rem; font-weight: 500;
  border-radius: var(--radius-full);
  background: rgba(168,85,247,0.1);
  color: var(--text-secondary);
  border: 1px solid rgba(168,85,247,0.2);
}
.badge-glow { animation: badgePulse 3s ease-in-out infinite; will-change: opacity; }
.badge-glow:nth-child(2) { animation-delay: -1s; }
.badge-glow:nth-child(3) { animation-delay: -2s; }
/* opacity is GPU-composited; box-shadow was causing CPU repaints every frame */
@keyframes badgePulse {
  0%, 100% { opacity: 0.75; }
  50% { opacity: 1; }
}
.hero-title { font-family: var(--font-heading); font-size: clamp(2.2rem,5vw,3.5rem); font-weight: 800; line-height: 1.15; margin-bottom: 20px; }
.hero-subtitle { font-size: 1.15rem; color: var(--text-secondary); line-height: 1.7; margin-bottom: 32px; max-width: 520px; }
.hero-cta { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 48px; }
.hero-stats { display: flex; align-items: center; gap: 24px; }
.stat { display: flex; flex-direction: column; }
.stat-row { display: flex; align-items: baseline; gap: 1px; }
.stat-num { font-family: var(--font-display); font-size: 1.75rem; font-weight: 700; color: var(--text-primary); }
.stat-suffix { font-family: var(--font-display); font-size: 1.75rem; font-weight: 700; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.stat-divider { width: 1px; height: 40px; background: rgba(168,85,247,0.2); }

/* ─── Dashboard Mockup ─── */
.hero-visual { position: relative; }
.dashboard-mockup {
  background: rgba(14,11,26,0.9);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  border: 1px solid rgba(168,85,247,0.2);
  overflow: hidden;
}
/* float-card animation removed — JS animation loop was causing jank */
.float-card { }
.mockup-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px;
  background: rgba(21,15,38,0.9);
  border-bottom: 1px solid rgba(168,85,247,0.12);
}
.mockup-dots { display: flex; gap: 6px; }
.mockup-dots span { width: 10px; height: 10px; border-radius: 50%; background: rgba(168,85,247,0.2); }
.mockup-dots span:first-child { background: #ef4444; }
.mockup-dots span:nth-child(2) { background: #f59e0b; }
.mockup-dots span:nth-child(3) { background: #22c55e; }
.mockup-title { font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); flex: 1; }
.mockup-status { display: flex; align-items: center; gap: 6px; font-size: 0.75rem; color: #22c55e; font-weight: 500; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: #22c55e; animation: pulse 2s ease-in-out infinite; will-change: opacity; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.mockup-body { display: flex; min-height: 320px; }
.mockup-sidebar {
  width: 48px;
  background: rgba(21,15,38,0.8);
  border-right: 1px solid rgba(168,85,247,0.1);
  padding: 12px 0;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.sidebar-item {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); color: var(--text-muted); cursor: pointer; transition: all var(--transition);
}
.sidebar-item.active { background: rgba(147,51,234,0.2); color: var(--blue); }
.mockup-main { flex: 1; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.mockup-metrics { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.metric-card { background: rgba(21,15,38,0.7); padding: 10px; border-radius: var(--radius-sm); border: 1px solid rgba(168,85,247,0.1); }
.metric-label { display: block; font-size: 0.65rem; color: var(--text-muted); margin-bottom: 4px; }
.metric-value { display: block; font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; }
.metric-change { font-size: 0.6rem; font-weight: 500; }
.metric-change.positive { color: #22c55e; }
.mockup-chart { display: flex; align-items: flex-end; gap: 6px; height: 60px; padding: 0 4px; }
.chart-bar {
  flex: 1; height: var(--h); background: var(--gradient);
  border-radius: 4px 4px 0 0; opacity: 0.8;
  animation: barGrow 1.5s ease-out forwards; transform-origin: bottom;
}
@keyframes barGrow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.mockup-chat-preview { display: flex; flex-direction: column; gap: 6px; }
.chat-line {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.7rem; padding: 6px 10px; border-radius: var(--radius-sm);
}
.chat-line.ai { background: rgba(21,15,38,0.7); color: var(--text-secondary); border: 1px solid rgba(168,85,247,0.1); }
.chat-line.user { background: rgba(147,51,234,0.15); color: var(--cyan); margin-left: 20px; }
.chat-avatar-sm {
  width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 0.55rem; font-weight: 700; color: white; flex-shrink: 0;
}
.ai-av { background: var(--gradient); }
.user-av { background: var(--text-muted); }
.float-badge {
  position: absolute; display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  background: rgba(14,11,26,0.9);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md), 0 0 20px rgba(147,51,234,0.2);
  font-size: 0.8rem; font-weight: 600;
  border: 1px solid rgba(168,85,247,0.25);
  /* floatBadge animation removed — unnecessary motion */
}
.float-badge-1 { top: 10%; left: -30px; }
.float-badge-2 { bottom: 15%; right: -20px; }
/* floatBadge keyframes removed */

/* ─── About ─── */
.about { background: var(--bg-secondary); }
.about-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 24px; margin-bottom: 48px; }
.about-card { padding: 32px 24px; transition: all var(--transition); }
.about-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg), 0 0 30px rgba(147,51,234,0.2); border-color: rgba(168,85,247,0.35); }
.about-icon {
  width: 56px; height: 56px; display: flex; align-items: center; justify-content: center;
  background: var(--gradient-subtle); border-radius: var(--radius-md);
  color: var(--cyan); margin-bottom: 20px;
}
.about-card h3 { font-family: var(--font-heading); font-size: 1.1rem; font-weight: 600; margin-bottom: 10px; }
.about-card p { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.6; }
.tech-stack { text-align: center; }
.tech-label { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 16px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 500; }
.tech-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.tech-tag {
  padding: 8px 20px;
  background: rgba(168,85,247,0.08);
  border: 1px solid rgba(168,85,247,0.2);
  border-radius: var(--radius-full);
  font-size: 0.85rem; font-weight: 500; color: var(--text-secondary);
  transition: all var(--transition);
}
.tech-tag:hover { border-color: var(--cyan); color: var(--cyan); transform: translateY(-2px); box-shadow: 0 0 16px rgba(192,132,252,0.2); }

/* ─── Services ─── */
.services-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; }
.service-card {
  padding: 32px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(168,85,247,0.15);
  border-radius: var(--radius-lg);
  transition: all var(--transition); cursor: pointer; position: relative; overflow: hidden;
}
.service-card::before {
  content: ''; position: absolute; inset: 0;
  background: var(--gradient); opacity: 0;
  transition: opacity var(--transition); border-radius: inherit;
}
.service-card:hover { transform: translateY(-8px) scale(1.02); box-shadow: var(--shadow-lg), 0 0 40px rgba(147,51,234,0.2); border-color: rgba(168,85,247,0.4); }
.service-card:hover::before { opacity: 0.05; }
.service-icon {
  width: 52px; height: 52px; display: flex; align-items: center; justify-content: center;
  background: var(--gradient-subtle); border-radius: var(--radius-md);
  color: var(--cyan); margin-bottom: 20px; position: relative; transition: all var(--transition);
}
.service-card:hover .service-icon { background: var(--gradient); color: white; box-shadow: 0 4px 20px rgba(147,51,234,0.4); }
.service-card h3 { font-family: var(--font-heading); font-size: 1.15rem; font-weight: 600; margin-bottom: 10px; position: relative; }
.service-card p { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.6; margin-bottom: 16px; position: relative; }
.service-link {
  /* Button reset */
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  /* Styling */
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--cyan);
  position: relative;
  transition: gap var(--transition), letter-spacing var(--transition), color var(--transition);
}
.service-link:hover { color: var(--blue-light); gap: 8px; }
.service-card:hover .service-link { letter-spacing: 0.02em; gap: 8px; }

/* ─── Demo Section ─── */
.demo { background: var(--gradient-subtle); }
.demo-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; padding: 48px; }
.demo-panel-left h3 { font-family: var(--font-heading); font-size: 1.5rem; font-weight: 700; margin-bottom: 16px; }
.demo-panel-left p { color: var(--text-secondary); margin-bottom: 24px; line-height: 1.7; }
.demo-features-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 32px; }
.demo-features-list li { display: flex; align-items: center; gap: 10px; font-size: 0.95rem; font-weight: 500; }
.demo-widget-preview { display: flex; justify-content: center; }
.chat-widget {
  width: 100%; max-width: 340px;
  background: rgba(14,11,26,0.95);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg), 0 0 30px rgba(147,51,234,0.25);
  border: 1px solid rgba(168,85,247,0.25);
  overflow: hidden;
}
.widget-header { display: flex; align-items: center; gap: 12px; padding: 16px 20px; background: var(--gradient); color: white; }
.widget-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.widget-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; }
.widget-name { display: block; font-weight: 600; font-size: 0.9rem; }
.widget-status { display: flex; align-items: center; gap: 6px; font-size: 0.75rem; opacity: 0.85; }
.widget-messages { padding: 16px; display: flex; flex-direction: column; gap: 10px; min-height: 180px; }
.widget-msg { padding: 10px 14px; border-radius: var(--radius-md); font-size: 0.85rem; max-width: 85%; line-height: 1.5; }
.ai-msg { background: rgba(168,85,247,0.1); color: var(--text-secondary); align-self: flex-start; border-bottom-left-radius: 4px; border: 1px solid rgba(168,85,247,0.15); }
.user-msg { background: rgba(147,51,234,0.2); color: var(--cyan); align-self: flex-end; border-bottom-right-radius: 4px; }
.widget-input-preview { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid rgba(168,85,247,0.12); color: var(--text-muted); font-size: 0.85rem; }

/* ─── Features ─── */
.features-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; margin-bottom: 48px; }
.feature-card { padding: 32px; transition: all var(--transition); }
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md), 0 0 20px rgba(147,51,234,0.15); }
.feature-icon { width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-md); margin-bottom: 16px; }
.feature-icon.blue { background: rgba(147,51,234,0.15); color: var(--blue); }
.feature-icon.cyan { background: rgba(192,132,252,0.12); color: var(--cyan); }
.feature-icon.violet { background: rgba(124,58,237,0.15); color: var(--violet); }
.feature-card h3 { font-family: var(--font-heading); font-size: 1.05rem; font-weight: 600; margin-bottom: 8px; }
.feature-card p { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.6; }
.counters-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; }
.counter-card { text-align: center; padding: 40px 24px; transition: all var(--transition); }
.counter-card:hover { transform: scale(1.03); box-shadow: var(--shadow-glow); }
.counter-value { display: block; font-family: var(--font-display); font-size: 2.5rem; font-weight: 700; background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; margin-bottom: 8px; }
.counter-label { font-size: 0.95rem; color: var(--text-secondary); font-weight: 500; }

/* ─── Process Timeline ─── */
.process { background: var(--bg-secondary); }
.timeline { position: relative; max-width: 700px; margin: 0 auto; }
.timeline::before {
  content: ''; position: absolute; left: 24px; top: 0; bottom: 0;
  width: 2px; background: linear-gradient(to bottom, var(--violet), var(--blue), var(--cyan));
  border-radius: 2px;
}
.timeline-item { display: flex; gap: 32px; margin-bottom: 32px; position: relative; }
.timeline-item:last-child { margin-bottom: 0; }
.timeline-dot {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--bg-secondary);
  border: 2px solid var(--blue);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; z-index: 1;
  box-shadow: 0 0 20px rgba(147,51,234,0.3);
}
.timeline-dot span { font-family: var(--font-display); font-size: 0.8rem; font-weight: 700; color: var(--cyan); }
.timeline-content { flex: 1; padding: 24px 28px; transition: all var(--transition); }
.timeline-content:hover { transform: translateX(8px); box-shadow: var(--shadow-md), 0 0 20px rgba(147,51,234,0.15); }
.timeline-content h3 { font-family: var(--font-heading); font-size: 1.1rem; font-weight: 600; margin-bottom: 8px; }
.timeline-content p { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.6; }

/* ─── Testimonials ─── */
.testimonials-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; }
.testimonial-card { padding: 32px; transition: all var(--transition); }
.testimonial-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg), 0 0 30px rgba(124,58,237,0.25); border-color: rgba(168,85,247,0.35); }
.stars { color: #f59e0b; font-size: 1rem; margin-bottom: 16px; letter-spacing: 2px; }
.testimonial-text { font-size: 0.95rem; color: var(--text-secondary); line-height: 1.7; margin-bottom: 24px; font-style: italic; }
.testimonial-author { display: flex; align-items: center; gap: 12px; }
.author-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700; color: white;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid rgba(168,85,247,0.3);
  box-shadow: 0 0 12px rgba(147,51,234,0.25);
}
.author-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.author-name { display: block; font-weight: 600; font-size: 0.9rem; }
.author-company { display: block; font-size: 0.8rem; color: var(--text-muted); }

/* ─── Contact ─── */
.contact { background: var(--bg-secondary); }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: start; }
.contact-details { display: flex; flex-direction: column; gap: 16px; margin: 32px 0; }
.contact-item { display: flex; align-items: center; gap: 12px; color: var(--text-secondary); font-size: 0.95rem; }
.contact-item svg { color: var(--cyan); flex-shrink: 0; }
.social-links { display: flex; gap: 12px; }
.social-icon {
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md);
  background: rgba(168,85,247,0.08);
  border: 1px solid rgba(168,85,247,0.2);
  color: var(--text-secondary); transition: all var(--transition);
}
.social-icon:hover { background: var(--gradient); color: white; border-color: transparent; transform: translateY(-3px); box-shadow: 0 4px 20px rgba(147,51,234,0.4); }
.contact-form { padding: 40px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 8px; color: var(--text-primary); }
.form-group input,
.form-group textarea {
  width: 100%; padding: 12px 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(168,85,247,0.2);
  border-radius: var(--radius-md);
  font-size: 0.95rem; color: var(--text-primary);
  transition: all var(--transition); resize: vertical;
}
.form-group input:focus,
.form-group textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(192,132,252,0.15); background: rgba(255,255,255,0.06); }
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-muted); }

/* ─── Footer ─── */
.footer { background: rgba(7,6,15,0.98); border-top: 1px solid rgba(168,85,247,0.12); padding-top: 60px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; padding-bottom: 40px; }
.footer-desc { font-size: 0.9rem; color: var(--text-muted); margin-top: 12px; max-width: 280px; }
.footer-links h4,
.footer-social h4 {
  font-family: var(--font-display); font-size: 0.85rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 16px; color: var(--text-primary);
}
.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-links a { font-size: 0.9rem; color: var(--text-secondary); transition: color var(--transition); }
.footer-links a:hover { color: var(--cyan); }
.footer-bottom { border-top: 1px solid rgba(168,85,247,0.1); padding: 20px 0; }
.footer-bottom p { font-size: 0.85rem; color: var(--text-muted); text-align: center; }

/* ─── Chat Modal ─── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(7,6,15,0.75);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; opacity: 0; visibility: hidden;
  transition: all 0.4s cubic-bezier(0.4,0,0.2,1);
  /* Pre-promote to compositor layer so first-open doesn't trigger a GPU stall */
  will-change: opacity;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal {
  width: 100%; max-width: 540px; max-height: calc(100vh - 48px);
  display: flex; flex-direction: column;
  transform: scale(0.9) translateY(20px); opacity: 0;
  transition: all 0.4s cubic-bezier(0.4,0,0.2,1);
  box-shadow: var(--shadow-lg), 0 0 60px rgba(147,51,234,0.3);
  overflow: hidden;
  background: var(--bg-secondary);
  border: 1px solid rgba(168,85,247,0.25);
  border-radius: var(--radius-xl);
}
.modal-overlay.active .modal { transform: scale(1) translateY(0); opacity: 1; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(168,85,247,0.15);
  background: linear-gradient(135deg, rgba(124,58,237,0.3) 0%, rgba(147,51,234,0.2) 50%, rgba(192,132,252,0.3) 100%);
  flex-shrink: 0; min-height: 74px;
}
.modal-header-left { display: flex; align-items: center; gap: 12px; }
.modal-avatar {
  width: 46px; height: 46px; border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(192,132,252,0.5);
  box-shadow: 0 0 16px rgba(147,51,234,0.4);
  flex-shrink: 0;
  background: var(--bg-secondary);
}
.modal-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; }
.modal-header h3 {
  font-family: var(--font-heading); font-size: 0.95rem; font-weight: 600;
  color: var(--white);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px;
}
.modal-status { display: flex; align-items: center; gap: 6px; font-size: 0.75rem; color: rgba(255,255,255,0.65); }
.modal-close {
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.7); cursor: pointer; transition: all var(--transition);
}
.modal-close:hover { background: rgba(255,255,255,0.15); color: white; }
.modal-chat {
  flex: 1; overflow-y: auto; padding: 24px;
  display: flex; flex-direction: column; gap: 16px;
  min-height: 0; scroll-behavior: smooth;
  background: var(--bg-primary);
}
.modal-chat::-webkit-scrollbar { width: 4px; }
.modal-chat::-webkit-scrollbar-track { background: transparent; }
.modal-chat::-webkit-scrollbar-thumb { background: rgba(168,85,247,0.3); border-radius: 4px; }

/* Chat bubbles */
.chat-bubble { display: flex; gap: 10px; max-width: 85%; animation: bubbleIn 0.3s ease-out; will-change: transform, opacity; }
@keyframes bubbleIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.chat-bubble.user { align-self: flex-end; flex-direction: row-reverse; }
.bubble-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700; color: white; flex-shrink: 0;
  overflow: hidden;
}
.bubble-avatar.ai { background: var(--gradient); }
.bubble-avatar.ai img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; }
.bubble-avatar.user { background: var(--text-muted); }
.bubble-content { padding: 12px 16px; border-radius: var(--radius-md); font-size: 0.9rem; line-height: 1.55; }
.chat-bubble.ai .bubble-content {
  background: rgba(168,85,247,0.1);
  color: var(--text-primary);
  border: 1px solid rgba(168,85,247,0.15);
  border-bottom-left-radius: 4px;
}
.chat-bubble.user .bubble-content { background: var(--gradient); color: white; border-bottom-right-radius: 4px; }

/* Typing indicator */
.typing-indicator { display: flex; gap: 10px; align-items: flex-end; animation: bubbleIn 0.3s ease-out; }
.typing-dots {
  display: flex; gap: 4px; padding: 14px 18px;
  background: rgba(168,85,247,0.1);
  border: 1px solid rgba(168,85,247,0.15);
  border-radius: var(--radius-md); border-bottom-left-radius: 4px;
}
.typing-dots span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-muted);
  animation: typingBounce 1.4s ease-in-out infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-6px); opacity: 1; } }

.modal-input-area {
  display: flex; gap: 10px; padding: 16px 20px;
  border-top: 1px solid rgba(168,85,247,0.15);
  background: var(--bg-secondary); flex-shrink: 0;
}
.modal-input-area input {
  flex: 1; padding: 12px 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(168,85,247,0.2);
  border-radius: var(--radius-md); font-size: 0.9rem;
  color: var(--text-primary); transition: all var(--transition);
}
.modal-input-area input::placeholder { color: var(--text-muted); }
.modal-input-area input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(192,132,252,0.15); background: rgba(255,255,255,0.07); }
.send-btn {
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  background: var(--gradient); color: white;
  border-radius: var(--radius-md); cursor: pointer; transition: all var(--transition); flex-shrink: 0;
}
.send-btn:hover { transform: scale(1.05); box-shadow: 0 4px 18px rgba(147,51,234,0.45); }
.send-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ─── Scroll Animations ─── */
/* Scale-fade reveal: elements gently bloom into view (scale 0.96 → 1 + opacity).
   Feels more polished than a slide-up, and avoids the "content jumps" effect
   that bothered users with translateY reveals.
   Duration kept at 0.3 s so it never feels slow. */
.fade-up {
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.3s ease,
              transform 0.3s ease;
  will-change: opacity, transform;
}
.fade-up.visible {
  opacity: 1;
  transform: scale(1);
  will-change: auto;
}
.delay-1 { transition-delay: 0.04s; }
.delay-2 { transition-delay: 0.08s; }
.delay-3 { transition-delay: 0.12s; }
.delay-4 { transition-delay: 0.16s; }
.delay-5 { transition-delay: 0.20s; }

/* ─── Toast ─── */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 3000;
  padding: 14px 24px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg), 0 0 20px rgba(147,51,234,0.2);
  border: 1px solid rgba(168,85,247,0.2);
  font-size: 0.9rem; font-weight: 500; color: var(--text-primary);
  transform: translateY(100px); opacity: 0;
  transition: all 0.4s cubic-bezier(0.4,0,0.2,1);
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-left: 4px solid #22c55e; }
.toast.error { border-left: 4px solid #ef4444; }

/* ─── Responsive ─── */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-subtitle { margin: 0 auto 32px; }
  .hero-cta { justify-content: center; }
  .hero-stats { justify-content: center; }
  .badges { justify-content: center; }
  .hero-visual { max-width: 500px; margin: 0 auto; }
  .about-grid { grid-template-columns: repeat(2,1fr); }
  .services-grid { grid-template-columns: repeat(2,1fr); }
  .features-grid { grid-template-columns: repeat(2,1fr); }
  .testimonials-grid { grid-template-columns: repeat(2,1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .demo-panel { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .section { padding: 72px 0; }
  .nav-links {
    position: fixed; top: var(--nav-height); left: 0; right: 0;
    background: rgba(7,6,15,0.96);
    backdrop-filter: blur(20px);
    flex-direction: column; padding: 24px; gap: 0;
    border-bottom: 1px solid rgba(168,85,247,0.15);
    transform: translateY(-120%); opacity: 0;
    transition: all var(--transition); box-shadow: var(--shadow-md);
  }
  .nav-links.active { transform: translateY(0); opacity: 1; }
  .nav-links a { padding: 14px 0; width: 100%; border-bottom: 1px solid rgba(168,85,247,0.08); }
  .nav-cta { display: none; }
  .mobile-toggle { display: flex; }
  .about-grid { grid-template-columns: 1fr; }
  .services-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }
  .counters-row { grid-template-columns: 1fr; }
  .testimonials-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .demo-panel { padding: 28px; }
  .float-badge { display: none; }
  .hero-stats { flex-direction: column; gap: 16px; }
  .stat-divider { display: none; }
  .modal { max-height: calc(100vh - 32px); border-radius: var(--radius-lg); }

  /* Remove backdrop-filter on mobile — major GPU/battery drain on low-end devices */
  .glass {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(21, 15, 38, 0.97);
  }
  .navbar.scrolled {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(7, 6, 15, 0.97);
  }
  .modal-overlay {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(7, 6, 15, 0.85);
  }
}

/* Disable remaining animations for users with motion sensitivity */
@media (prefers-reduced-motion: reduce) {
  .badge-glow,
  .status-dot,
  .typing-dots span,
  .chart-bar {
    animation: none !important;
    will-change: auto !important;
  }
  .fade-up {
    opacity: 1 !important;
    transform: scale(1) !important;
    transition: none !important;
  }
  * { transition-duration: 0.01ms !important; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 1.8rem; }
  .hero-cta { flex-direction: column; }
  .hero-cta .btn { width: 100%; justify-content: center; }
  .contact-form { padding: 24px; }
}