/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #050816;
  --surface: rgba(255,255,255,0.04);
  --surface-hover: rgba(255,255,255,0.08);
  --border: rgba(255,255,255,0.08);
  --primary: #6366f1;
  --primary-glow: rgba(99,102,241,0.4);
  --cyan: #06b6d4;
  --cyan-glow: rgba(6,182,212,0.3);
  --success: #10b981;
  --danger: #f43f5e;
  --warning: #f59e0b;
  --text: #f1f5f9;
  --muted: #64748b;
  --font: 'Inter', sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  line-height: 1.6;
}

/* ===== ANIMATED BACKGROUND ===== */
.bg-grid {
  position: fixed; inset: 0; z-index: 0;
  background-image:
    linear-gradient(rgba(99,102,241,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99,102,241,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

.bg-orb {
  position: fixed; border-radius: 50%;
  pointer-events: none; z-index: 0;
  animation: orbFloat 12s ease-in-out infinite;
  will-change: transform;
}
.orb1 { width: 800px; height: 800px; background: radial-gradient(circle, rgba(99,102,241,0.15) 0%, transparent 70%); top: -300px; left: -200px; }
.orb2 { width: 700px; height: 700px; background: radial-gradient(circle, rgba(6,182,212,0.1) 0%, transparent 70%); top: 40%; right: -250px; animation-delay: -4s; }
.orb3 { width: 600px; height: 600px; background: radial-gradient(circle, rgba(16,185,129,0.08) 0%, transparent 70%); bottom: -200px; left: 30%; animation-delay: -8s; }

@keyframes orbFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-40px) scale(1.05); }
}

/* ===== NAV ===== */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 4rem;
  /* No backdrop-filter — it crashes Chrome GPU compositor on anchor navigation */
  background: rgba(5, 8, 22, 0.95);
  border-bottom: 1px solid var(--border);
}

.nav-brand { display: flex; align-items: center; gap: 0.5rem; }
.brand-icon { font-size: 1.4rem; }
.brand-name {
  font-size: 1.1rem; font-weight: 800; letter-spacing: 0.15em;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.nav-links { display: flex; align-items: center; gap: 2rem; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 0.9rem; font-weight: 500; transition: color 0.2s; }
.nav-links a:hover { color: var(--text); }
.nav-cta {
  padding: 0.5rem 1.2rem;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  color: white !important;
  border-radius: 8px; font-weight: 600 !important;
  transition: opacity 0.2s, transform 0.2s !important;
}
.nav-cta:hover { opacity: 0.9; transform: translateY(-1px); }

/* ===== HERO ===== */
.hero {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 8rem 2rem 4rem;
}

.hero-badge {
  display: inline-block;
  padding: 0.4rem 1.2rem;
  background: rgba(99,102,241,0.15);
  border: 1px solid rgba(99,102,241,0.3);
  border-radius: 100px;
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.05em;
  color: #a5b4fc; margin-bottom: 2rem;
  animation: fadeInDown 0.8s ease;
}

.hero-title {
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 900; line-height: 1.1; letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
  animation: fadeInDown 0.8s ease 0.1s both;
}

.gradient-text {
  background: linear-gradient(135deg, #6366f1, #06b6d4, #10b981);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-size: 200%; animation: gradientShift 4s ease infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero-subtitle {
  max-width: 650px; font-size: 1.15rem; color: #94a3b8;
  margin-bottom: 2.5rem; line-height: 1.7;
  animation: fadeInDown 0.8s ease 0.2s both;
}

.hero-stats {
  display: flex; align-items: center; gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px; padding: 1.5rem 2.5rem;
  margin-bottom: 2.5rem;
  animation: fadeInDown 0.8s ease 0.3s both;
}

.stat { text-align: center; padding: 0 2rem; }
.stat-num { display: block; font-size: 2rem; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 0.75rem; color: var(--muted); font-weight: 500; letter-spacing: 0.05em; }
.stat-divider { width: 1px; height: 40px; background: var(--border); }

.hero-actions {
  display: flex; gap: 1rem;
  animation: fadeInDown 0.8s ease 0.4s both;
}

.btn-primary {
  padding: 0.9rem 2rem; border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  color: white; font-weight: 700; font-size: 1rem;
  text-decoration: none; border: none; cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 0 30px var(--primary-glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 50px var(--primary-glow); }

.btn-secondary {
  padding: 0.9rem 2rem; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); font-weight: 600; font-size: 1rem;
  text-decoration: none; transition: background 0.2s, transform 0.2s;
}
.btn-secondary:hover { background: var(--surface-hover); transform: translateY(-2px); }

/* ===== SECTIONS ===== */
section { position: relative; z-index: 1; padding: 6rem 4rem; max-width: 1200px; margin: 0 auto; }

.section-label {
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.2em;
  color: var(--cyan); margin-bottom: 1rem; text-transform: uppercase;
}

.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800; letter-spacing: -0.02em;
  margin-bottom: 3rem; line-height: 1.2;
}

/* ===== PROBLEM ===== */
.problem-cards {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.problem-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 2rem;
  transition: border-color 0.3s, transform 0.3s;
}
.problem-card:hover { border-color: rgba(99,102,241,0.4); transform: translateY(-4px); }
.problem-icon { font-size: 2rem; margin-bottom: 1rem; }
.problem-card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.5rem; }
.problem-card p { color: var(--muted); font-size: 0.9rem; line-height: 1.6; }

.solution-banner {
  background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(6,182,212,0.1));
  border: 1px solid rgba(99,102,241,0.3);
  border-radius: 16px; padding: 2rem; text-align: center;
}
.solution-label {
  display: inline-block; font-size: 0.75rem; font-weight: 700;
  letter-spacing: 0.15em; color: var(--cyan); margin-bottom: 0.5rem;
}
.solution-banner p { color: var(--muted); font-size: 1rem; }

/* ===== BPMN FLOW ===== */
.flow-section { max-width: 1200px; margin: 0 auto; padding: 6rem 4rem; }

.bpmn-flow {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 0.5rem; justify-content: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 24px; padding: 3rem;
}

.flow-node {
  position: relative;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 16px; padding: 1.2rem;
  text-align: center; min-width: 130px;
  transition: transform 0.2s, border-color 0.2s;
}
.flow-node:hover { transform: translateY(-4px); border-color: rgba(99,102,241,0.4); }
.node-icon { font-size: 1.8rem; margin-bottom: 0.4rem; }
.node-title { font-size: 0.8rem; font-weight: 700; margin-bottom: 0.2rem; }
.node-sub { font-size: 0.65rem; color: var(--muted); }

.node-badge {
  position: absolute; top: -10px; right: -10px;
  font-size: 0.55rem; font-weight: 800; padding: 0.2rem 0.5rem;
  border-radius: 100px; letter-spacing: 0.05em;
}
.agent-badge { background: rgba(99,102,241,0.3); color: #a5b4fc; border: 1px solid rgba(99,102,241,0.5); }
.gateway-badge { background: rgba(245,158,11,0.2); color: #fcd34d; border: 1px solid rgba(245,158,11,0.4); }
.hitl-badge { background: rgba(244,63,94,0.2); color: #fda4af; border: 1px solid rgba(244,63,94,0.4); }
.fast-badge { background: rgba(16,185,129,0.2); color: #6ee7b7; border: 1px solid rgba(16,185,129,0.4); }
.rpa-badge { background: rgba(6,182,212,0.2); color: #67e8f9; border: 1px solid rgba(6,182,212,0.4); }

.flow-arrow { font-size: 1.5rem; color: var(--muted); padding: 0 0.25rem; }
.merge-arrow { margin-top: 0; }

.flow-split {
  display: flex; flex-direction: column; gap: 1rem;
  align-items: center;
}
.split-path { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.path-label {
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.1em;
  padding: 0.2rem 0.6rem; border-radius: 100px;
}
.path-label.danger { background: rgba(244,63,94,0.2); color: #fda4af; }
.path-label.success { background: rgba(16,185,129,0.2); color: #6ee7b7; }

/* ===== DEMO ===== */
.demo-section { max-width: 1200px; margin: 0 auto; padding: 6rem 4rem; text-align: center; }
.demo-subtitle { color: var(--muted); margin-bottom: 3rem; font-size: 1rem; }

.demo-container { max-width: 900px; margin: 0 auto; }

.demo-controls {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 1rem; margin-bottom: 1rem; justify-content: center;
}

.run-btn {
  padding: 0.8rem 2rem; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  color: white; font-weight: 700; font-size: 1rem;
  border: none; cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 0 20px var(--primary-glow);
}
.run-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 0 40px var(--primary-glow); }
.run-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.clear-btn {
  padding: 0.8rem 1.5rem; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--muted); font-weight: 600; cursor: pointer;
  transition: background 0.2s;
}
.clear-btn:hover { background: var(--surface-hover); color: var(--text); }

.demo-stats-row { display: flex; gap: 1.5rem; }
.ds { font-size: 0.85rem; color: var(--muted); }
.ds strong { font-weight: 700; }
.danger { color: var(--danger); }
.success { color: var(--success); }

.terminal {
  background: #0d1117; border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px; overflow: hidden;
  box-shadow: 0 25px 60px rgba(0,0,0,0.5);
  text-align: left;
}

.terminal-header {
  background: #161b22; padding: 0.8rem 1.2rem;
  display: flex; align-items: center; gap: 0.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.t-dot { width: 12px; height: 12px; border-radius: 50%; }
.t-dot.red { background: #ff5f56; }
.t-dot.yellow { background: #ffbd2e; }
.t-dot.green { background: #27c93f; }
.t-title { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); margin-left: 0.5rem; }

.terminal-body {
  padding: 1.5rem; min-height: 320px; max-height: 480px;
  overflow-y: auto; font-family: var(--mono); font-size: 0.78rem;
  line-height: 1.8;
}

.t-line { display: block; }
.t-line.muted { color: #4a5568; }
.t-line.header { color: #6366f1; font-weight: 600; }
.t-line.analyst { color: #a5b4fc; }
.t-line.gateway-hitl { color: #fda4af; }
.t-line.gateway-fast { color: #6ee7b7; }
.t-line.cloud { color: #67e8f9; }
.t-line.action { color: #fcd34d; }
.t-line.summary { color: #10b981; font-weight: 700; margin-top: 0.5rem; }
.t-line.separator { color: #2d3748; }

/* ===== TECH GRID ===== */
.tech-section { max-width: 1200px; margin: 0 auto; padding: 6rem 4rem; }
.tech-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.tech-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 2rem;
  transition: border-color 0.3s, transform 0.3s;
}
.tech-card:hover { border-color: rgba(6,182,212,0.4); transform: translateY(-4px); }
.tech-logo { font-size: 2rem; margin-bottom: 1rem; }
.tech-name { font-weight: 700; margin-bottom: 0.5rem; font-size: 0.95rem; }
.tech-desc { color: var(--muted); font-size: 0.85rem; line-height: 1.6; }

/* ===== TEAM ===== */
.team-section { max-width: 1200px; margin: 0 auto; padding: 6rem 4rem; text-align: center; }
.team-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.team-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 2rem; text-align: center;
  transition: border-color 0.3s, transform 0.3s;
}
.team-card:hover { transform: translateY(-4px); }
.highlight-card {
  border-color: rgba(99,102,241,0.4) !important;
  background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(6,182,212,0.05));
}
.team-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--surface-hover); border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1rem; margin: 0 auto 1rem;
}
.sg-avatar {
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  border-color: var(--primary); color: white;
}
.team-name { font-weight: 700; margin-bottom: 0.3rem; }
.team-role { color: var(--muted); font-size: 0.8rem; margin-bottom: 0.5rem; }
.team-contrib {
  font-size: 0.72rem; color: #a5b4fc;
  border-top: 1px solid var(--border); padding-top: 0.75rem; margin-top: 0.5rem;
  line-height: 1.6;
}

/* ===== FOOTER ===== */
.footer {
  position: relative; z-index: 1;
  text-align: center; padding: 4rem 2rem;
  border-top: 1px solid var(--border);
}
.footer-brand { font-size: 1.5rem; font-weight: 900; letter-spacing: 0.2em; margin-bottom: 0.5rem; }
.footer-sub { color: var(--muted); font-size: 0.85rem; margin-bottom: 1.5rem; }
.footer-links { display: flex; justify-content: center; gap: 2rem; margin-bottom: 1.5rem; }
.footer-links a { color: var(--muted); text-decoration: none; font-size: 0.9rem; transition: color 0.2s; }
.footer-links a:hover { color: var(--text); }
.footer-copy { color: #2d3748; font-size: 0.8rem; }

/* ===== ANIMATIONS ===== */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 3px; }
