/* =========================================================
   eban — Software Factory Agent Harnesses
   elizaga.dev design system · dark edition
   ========================================================= */

/* === Fonts === */
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&family=JetBrains+Mono:wght@400;500&display=swap');

/* === CSS Variables === */
:root {
  --bg:          #080c1a;
  --bg-2:        #0d1226;
  --bg-card:     rgba(255,255,255,0.03);
  --border:      rgba(255,255,255,0.08);
  --border-glow: rgba(168,85,247,0.4);
  --text:        #e2e8f0;
  --text-muted:  #64748b;
  --text-dim:    #94a3b8;
  --purple:      #a855f7;
  --cyan:        #06b6d4;
  --pink:        #ec4899;
  --green:       #10b981;
  --orange:      #f59e0b;
  --blue:        #3b82f6;
  --red:         #ef4444;
  --font-mono:   'JetBrains Mono', 'Courier New', monospace;
  --radius:      12px;
  --radius-sm:   6px;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.4), 0 8px 32px rgba(0,0,0,0.3);
  --shadow-glow: 0 0 40px rgba(168,85,247,0.15);
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--cyan); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--purple); }

/* === Canvas background === */
#bg-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
}

/* === Layout === */
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 2rem;
  position: relative;
  z-index: 1;
}

/* === Animations === */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(32px); }
  to   { opacity: 1; transform: translateY(0);    }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes gradientShift {
  0%   { background-position: 0%   50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0%   50%; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.6; }
}
@keyframes countUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0);   }
}

[data-animate] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
[data-animate].visible {
  opacity: 1;
  transform: translateY(0);
}

/* === Nav === */
#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 2rem;
  background: rgba(8,12,26,0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}
#nav.scrolled {
  border-bottom-color: var(--border);
  background: rgba(8,12,26,0.95);
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}
.nav-logo {
  font-size: 1.3rem;
  background: linear-gradient(135deg, var(--purple), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.nav-right {
  display: flex;
  gap: 2rem;
}
.nav-right a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s ease;
}
.nav-right a:hover { color: var(--text); }

/* === 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::before {
  content: '';
  position: absolute;
  top: 18%;
  left: 50%;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(168,85,247,0.12) 0%, rgba(6,182,212,0.06) 40%, transparent 70%);
  transform: translateX(-50%);
  pointer-events: none;
  z-index: -1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--purple);
  background: rgba(168,85,247,0.07);
  margin-bottom: 1.8rem;
  animation: fadeIn 0.6s ease forwards;
}

.hero-title {
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}

.gradient-text {
  display: block;
  background: linear-gradient(135deg, var(--purple) 0%, var(--cyan) 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 4s ease infinite;
}

.gradient-text-2 {
  display: block;
  background: linear-gradient(135deg, var(--cyan) 0%, var(--pink) 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 4s ease infinite reverse;
}

.hero-sub {
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  color: var(--text-dim);
  max-width: 580px;
  line-height: 1.7;
  margin-bottom: 3rem;
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  padding: 1.5rem 2rem;
  margin-bottom: 2.5rem;
  gap: 0;
}

.stat {
  text-align: center;
  padding: 0 2rem;
}
.stat-num {
  display: block;
  font-size: 1.6rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--purple), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 0.3rem;
}
.stat-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  text-transform: uppercase;
}
.stat-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
  flex-shrink: 0;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.85rem 2rem;
  background: linear-gradient(135deg, var(--purple), var(--cyan));
  color: white;
  text-decoration: none;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  transition: opacity 0.2s ease, transform 0.2s ease;
  position: relative;
  z-index: 1;
}
.cta-btn::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--purple), var(--cyan));
  filter: blur(12px);
  opacity: 0.5;
  z-index: -1;
  transition: opacity 0.3s ease;
}
.cta-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.cta-btn:hover::after { opacity: 0.7; }

/* === Sections === */
.section {
  position: relative;
  z-index: 1;
  padding: 6rem 0;
}
.section-dark {
  background: linear-gradient(180deg, transparent 0%, rgba(168,85,247,0.03) 50%, transparent 100%);
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}
.section-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--purple);
  margin-bottom: 0.8rem;
}
.section-header h2 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.8rem;
}
.section-sub {
  color: var(--text-dim);
  font-size: 1rem;
  max-width: 480px;
  margin: 0 auto;
}

/* === Harness Cards === */
.harness-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.2rem;
}

.harness-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
  cursor: default;
}
.harness-card:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.card-top {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.card-icon {
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}
.card-meta {
  flex: 1;
}
.card-meta h3 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 0.2rem;
}
.port-badge {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  background: rgba(255,255,255,0.05);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.role-badge {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  border: 1px solid;
  white-space: nowrap;
}
.role-orchestration { color: #a855f7; border-color: rgba(168,85,247,0.3); background: rgba(168,85,247,0.08); }
.role-execution     { color: #06b6d4; border-color: rgba(6,182,212,0.3);  background: rgba(6,182,212,0.08);  }
.role-planning      { color: #10b981; border-color: rgba(16,185,129,0.3); background: rgba(16,185,129,0.08); }
.role-skills        { color: #f59e0b; border-color: rgba(245,158,11,0.3); background: rgba(245,158,11,0.08); }
.role-approval      { color: #ef4444; border-color: rgba(239,68,68,0.3);  background: rgba(239,68,68,0.08);  }
.role-scheduling    { color: #ec4899; border-color: rgba(236,72,153,0.3); background: rgba(236,72,153,0.08); }
.role-projects      { color: #3b82f6; border-color: rgba(59,130,246,0.3); background: rgba(59,130,246,0.08); }

/* Card hover accent colors by type */
.card-queen:hover    { border-color: rgba(168,85,247,0.5);  box-shadow: 0 0 40px rgba(168,85,247,0.12);  }
.card-worker:hover   { border-color: rgba(6,182,212,0.5);   box-shadow: 0 0 40px rgba(6,182,212,0.12);   }
.card-planner:hover  { border-color: rgba(16,185,129,0.5);  box-shadow: 0 0 40px rgba(16,185,129,0.12);  }
.card-sti:hover      { border-color: rgba(245,158,11,0.5);  box-shadow: 0 0 40px rgba(245,158,11,0.12);  }
.card-dispatch:hover { border-color: rgba(239,68,68,0.5);   box-shadow: 0 0 40px rgba(239,68,68,0.12);   }
.card-n8n:hover      { border-color: rgba(236,72,153,0.5);  box-shadow: 0 0 40px rgba(236,72,153,0.12);  }
.card-pm:hover       { border-color: rgba(59,130,246,0.5);  box-shadow: 0 0 40px rgba(59,130,246,0.12);  }

.card-desc {
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.7;
  margin-bottom: 1.1rem;
}
.card-desc code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--purple);
  background: rgba(168,85,247,0.1);
  padding: 0.1rem 0.35rem;
  border-radius: var(--radius-sm);
}

.card-traits {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.card-traits li {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding-left: 1.1rem;
  position: relative;
}
.card-traits li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--purple);
  opacity: 0.6;
}

/* === Architecture Diagram === */
.arch-diagram {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  position: relative;
}
.arch-diagram::before {
  content: '● ● ●';
  display: block;
  color: #333;
  font-size: 0.75rem;
  letter-spacing: 0.3rem;
  padding: 0.7rem 1.2rem 0.6rem;
  border-bottom: 1px solid var(--border);
  background: #050810;
}
.arch-pre {
  background: #050810;
  padding: 2rem 2.5rem 2.5rem;
  overflow-x: auto;
  color: #7dd3fc;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.7;
  tab-size: 2;
}

/* === Flow Steps === */
.flow-steps {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.flow-step {
  display: flex;
  gap: 1.8rem;
  align-items: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  width: 100%;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.flow-step:hover {
  border-color: rgba(168,85,247,0.3);
  box-shadow: 0 0 24px rgba(168,85,247,0.08);
}

.step-num {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--purple), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  flex-shrink: 0;
  padding-top: 0.15rem;
}

.step-body h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.45rem;
  letter-spacing: -0.01em;
}
.step-body p {
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.7;
}
.step-body code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--cyan);
  background: rgba(6,182,212,0.08);
  padding: 0.1rem 0.35rem;
  border-radius: var(--radius-sm);
}

.flow-arrow {
  font-size: 1.3rem;
  color: var(--border);
  padding: 0.4rem 0;
  opacity: 0.6;
}

/* === Footer === */
.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
  background: rgba(5,8,16,0.6);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
}
.footer-logo {
  font-size: 1.2rem;
  background: linear-gradient(135deg, var(--purple), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.footer-note {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: italic;
}
.footer-nav {
  display: flex;
  gap: 1.5rem;
}
.footer-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
}
.footer-nav a:hover { color: var(--text); }

/* === Responsive === */
@media (max-width: 768px) {
  .harness-grid { grid-template-columns: 1fr; }
  .hero-stats   { gap: 0.5rem; flex-direction: column; }
  .stat-divider { width: 40px; height: 1px; }
  .stat         { padding: 0.5rem 0; }
  .nav-right    { display: none; }
  .arch-pre     { font-size: 0.68rem; padding: 1.5rem; }
  .flow-step    { flex-direction: column; gap: 1rem; }
  .footer-inner { flex-direction: column; text-align: center; }
  .footer-nav   { justify-content: center; }
}
