/*
 * aegis-theme.css — Shared design system for all Aegis Protocol pages
 * Space Grotesk + JetBrains Mono, dark cyberpunk agentic aesthetic
 */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:      #050810;
  --bg2:     #0a0f1e;
  --surface: #0f1629;
  --surface2:#141d38;
  --border:  rgba(99,179,237,0.12);
  --border2: rgba(99,179,237,0.22);
  --accent:  #3b82f6;
  --accent2: #8b5cf6;
  --accent3: #06b6d4;
  --danger:  #ef4444;
  --green:   #10b981;
  --yellow:  #f59e0b;
  --text:    #e2e8f0;
  --muted:   #64748b;
  --glow:    rgba(59,130,246,0.35);

  /* ── Legacy aliases (for agent pages using old dashboard.css vars) ── */
  --bg-primary:    #0f1629;
  --bg-secondary:  #0a0f1e;
  --bg-tertiary:   #141d38;
  --text-primary:  #e2e8f0;
  --text-secondary:#64748b;
  --text-muted:    #64748b;
  --primary:       #3b82f6;
  --primary-dark:  #2563eb;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Space Grotesk', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  min-height: 100vh;
  cursor: none;
}

/* ── GRID BACKGROUND (CSS — no lag) ── */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0;
  background-image: radial-gradient(circle, rgba(59,130,246,0.18) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  opacity: 0.7;
}

/* mouse-glow overlay */
body::after {
  content: '';
  position: fixed; inset: 0; z-index: 0;
  background: radial-gradient(circle 320px at var(--mx, 50%) var(--my, 50%),
    rgba(59,130,246,0.08) 0%, transparent 70%);
  pointer-events: none;
  transition: background 0.05s;
}

/* ── CUSTOM CURSOR ── */
#aeCursor {
  width: 10px; height: 10px;
  background: var(--accent);
  border-radius: 50%;
  position: fixed; top: 0; left: 0;
  pointer-events: none; z-index: 9999;
  transform: translate(-50%,-50%);
  box-shadow: 0 0 14px var(--glow);
  transition: width 0.15s, height 0.15s, background 0.15s;
}
#aeCursorRing {
  width: 32px; height: 32px;
  border: 1.5px solid rgba(59,130,246,0.45);
  border-radius: 50%;
  position: fixed; top: 0; left: 0;
  pointer-events: none; z-index: 9998;
  transform: translate(-50%,-50%);
  transition: width 0.25s, height 0.25s, border-color 0.2s;
}
body.cursor-hover #aeCursor { width: 16px; height: 16px; }
body.cursor-hover #aeCursorRing { width: 48px; height: 48px; }

/* ── NAVBAR ── */
.ae-nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 200;
  height: 62px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 48px;
  background: rgba(5,8,16,0.75);
  backdrop-filter: blur(20px) saturate(1.5);
  border-bottom: 1px solid var(--border);
}
.ae-nav-brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1rem; letter-spacing: -0.02em;
  color: #fff; text-decoration: none;
}
.ae-nav-brand svg { width: 26px; height: 26px; flex-shrink: 0; }
.ae-nav-links { display: flex; align-items: center; gap: 4px; }
.ae-nav-links a {
  padding: 6px 13px;
  font-size: 0.84rem; font-weight: 600;
  color: var(--muted); text-decoration: none;
  border-radius: 8px; font-family: 'Space Grotesk', sans-serif;
  transition: color 0.15s, background 0.15s;
}
.ae-nav-links a:hover { color: #fff; background: rgba(255,255,255,0.05); }
.ae-nav-links a.ae-active { color: var(--accent); background: rgba(59,130,246,0.08); }
.ae-nav-links .ae-nav-cta {
  background: var(--accent); color: #fff !important;
  padding: 7px 18px; border-radius: 10px; margin-left: 4px;
}
.ae-nav-links .ae-nav-cta:hover { background: #2563eb !important; }

/* Hamburger Button */
.ae-hamburger {
  display: none; background: transparent; border: none; color: #fff; cursor: none;
}
.ae-hamburger svg { width: 24px; height: 24px; }

/* ── PAGE WRAPPER ── */
.ae-page { position: relative; z-index: 1; padding-top: 62px; }

/* ── PAGE HERO ── */
.ae-page-hero {
  padding: 72px 64px 52px;
  border-bottom: 1px solid var(--border);
}
.ae-page-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent3); margin-bottom: 12px;
}
.ae-page-hero h1 {
  font-size: clamp(1.9rem, 4vw, 3rem);
  font-weight: 800; letter-spacing: -0.03em;
  margin-bottom: 12px; line-height: 1.1;
}
.ae-page-hero p {
  font-size: 1rem; color: var(--muted);
  max-width: 560px; line-height: 1.65;
}

/* ── CONTAINERS ── */
.ae-container { max-width: 1100px; margin: 0 auto; padding: 0 48px; }
.ae-section { padding: 64px 64px; }

/* ── CARDS ── */
.ae-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px 32px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.ae-card:hover {
  border-color: var(--border2);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3), 0 0 20px rgba(59,130,246,0.06);
}
.ae-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

/* ── GRID 3-COL ── */
.ae-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.ae-grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }

/* ── BADGES ── */
.ae-badge {
  display: inline-block;
  padding: 3px 12px; border-radius: 100px;
  font-size: 0.72rem; font-weight: 800;
  letter-spacing: 0.06em; text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace;
}
.ae-badge-blue  { background: rgba(59,130,246,0.12);  color: #60a5fa; border: 1px solid rgba(59,130,246,0.2); }
.ae-badge-green { background: rgba(16,185,129,0.12);  color: #34d399; border: 1px solid rgba(16,185,129,0.2); }
.ae-badge-red   { background: rgba(239,68,68,0.12);   color: #f87171; border: 1px solid rgba(239,68,68,0.2); }
.ae-badge-purple{ background: rgba(139,92,246,0.12);  color: #a78bfa; border: 1px solid rgba(139,92,246,0.2); }
.ae-badge-yellow{ background: rgba(245,158,11,0.12);  color: #fbbf24; border: 1px solid rgba(245,158,11,0.2); }

/* ── BUTTONS ── */
.ae-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 26px;
  font-size: 0.9rem; font-weight: 700;
  border-radius: 11px; text-decoration: none;
  border: none; cursor: none;
  font-family: 'Space Grotesk', sans-serif;
  transition: all 0.18s;
}
.ae-btn-primary {
  background: var(--accent); color: #fff;
  box-shadow: 0 0 24px rgba(59,130,246,0.3);
}
.ae-btn-primary:hover { background: #2563eb; transform: translateY(-2px); box-shadow: 0 0 36px rgba(59,130,246,0.5); }
.ae-btn-ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--border2);
}
.ae-btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.ae-btn-sm { padding: 7px 16px; font-size: 0.8rem; border-radius: 8px; }

/* ── TYPOGRAPHY ── */
.ae-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 6px;
}
.ae-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800; letter-spacing: -0.03em;
}
.ae-mono { font-family: 'JetBrains Mono', monospace; }
.ae-muted { color: var(--muted); }

/* ── DIVIDER ── */
.ae-divider { border: none; border-top: 1px solid var(--border); margin: 40px 0; }

/* ── ICON BOX ── */
.ae-icon {
  width: 48px; height: 48px;
  border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ae-icon svg { width: 22px; height: 22px; }
.ae-icon-blue   { background: rgba(59,130,246,0.12); }
.ae-icon-purple { background: rgba(139,92,246,0.12); }
.ae-icon-cyan   { background: rgba(6,182,212,0.12); }
.ae-icon-green  { background: rgba(16,185,129,0.12); }
.ae-icon-yellow { background: rgba(245,158,11,0.12); }
.ae-icon-red    { background: rgba(239,68,68,0.12); }

/* ── STEP LIST ── */
.ae-steps { display: flex; flex-direction: column; gap: 0; }
.ae-step {
  display: flex; gap: 20px; align-items: flex-start;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}
.ae-step:last-child { border-bottom: none; }
.ae-step-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem; font-weight: 700;
  color: var(--accent); letter-spacing: 0.1em;
  padding: 4px 10px;
  background: rgba(59,130,246,0.08);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: 6px;
  flex-shrink: 0; margin-top: 2px;
}
.ae-step-content h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 5px; }
.ae-step-content p  { font-size: 0.88rem; color: var(--muted); line-height: 1.6; }

/* ── INLINE FLEX ROW ── */
.ae-row { display: flex; align-items: flex-start; gap: 16px; }
.ae-row-center { align-items: center; }

/* ── STAT STRIP ── */
.ae-stat-strip {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  border: 1px solid var(--border);
  border-radius: 18px; overflow: hidden;
}
.ae-stat-cell {
  padding: 36px 28px; background: var(--surface);
  text-align: center;
  transition: background 0.2s;
}
.ae-stat-cell:hover { background: rgba(59,130,246,0.05); }
.ae-stat-cell + .ae-stat-cell { border-left: 1px solid var(--border); }
.ae-stat-num {
  font-size: 2rem; font-weight: 800;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, #fff, var(--muted));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; margin-bottom: 5px;
}
.ae-stat-lbl { font-size: 0.8rem; font-weight: 600; color: var(--muted); }

/* ── INPUT / TEXTAREA ── */
.ae-input, .ae-textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 11px;
  color: var(--text);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.92rem;
  padding: 12px 16px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.ae-input:focus, .ae-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}
.ae-textarea { resize: vertical; min-height: 120px; }

/* ── FORM GROUP ── */
.ae-form-group { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.ae-form-group label { font-size: 0.84rem; font-weight: 600; color: var(--text); }

/* ── SELECT ── */
.ae-select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 11px;
  color: var(--text);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.92rem;
  padding: 12px 16px;
  outline: none;
  cursor: none;
  transition: border-color 0.2s;
}
.ae-select:focus { border-color: var(--accent); }

/* ── REVEAL ── */
.ae-reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.65s ease, transform 0.65s ease; }
.ae-reveal.visible { opacity: 1; transform: none; }

/* ── FOOTER ── */
.ae-footer {
  border-top: 1px solid var(--border);
  padding: 28px 64px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.78rem; color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  position: relative; z-index: 1;
  margin-top: 60px;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(59,130,246,0.25); border-radius: 2px; }

/* ── UTILS ── */
.mb-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-20 { margin-bottom: 20px; }
.mb-32 { margin-bottom: 32px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.gap-12 { gap: 12px; }
.gap-20 { gap: 20px; }
.text-center { text-align: center; }
.flex { display: flex; }
.items-center { align-items: center; }
.w-full { width: 100%; }

@media (max-width: 768px) {
  .ae-nav { padding: 0 20px; }
  .ae-hamburger { display: flex; align-items: center; justify-content: center; }
  .ae-nav-links {
    position: fixed; top: 62px; right: 0; bottom: 0; left: 0;
    background: #050810;
    flex-direction: column; padding: 40px 24px; gap: 16px;
    transform: translateX(100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-top: 1px solid var(--border);
  }
  .ae-nav-links.ae-mobile-open { transform: translateX(0); }
  .ae-nav-links a { font-size: 1.1rem; padding: 12px 20px; width: 100%; text-align: center; }
  .ae-nav-links .ae-nav-cta { margin-left: 0; margin-top: 12px; }

  .ae-page-hero { padding: 56px 24px 36px; }
  .ae-section { padding: 48px 24px; }
  .ae-footer { flex-direction: column; gap: 16px; text-align: center; padding: 32px 24px; }
  
  .ae-stat-strip { grid-template-columns: repeat(2,1fr); }
  .ae-stat-cell + .ae-stat-cell { border-left: none; }
  .ae-stat-cell:nth-child(odd) { border-right: 1px solid var(--border); }
  .ae-stat-cell:nth-child(n+3) { border-top: 1px solid var(--border); }
  
  .ae-container { padding: 0 20px; }
  .ae-row { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .ae-stat-strip { grid-template-columns: 1fr; }
  .ae-stat-cell:nth-child(odd) { border-right: none; }
  .ae-stat-cell + .ae-stat-cell { border-top: 1px solid var(--border); }
}
