/* ================================================
   HEROCALL — Shared Design System
   ================================================ */

/* ---------- CSS Variables (Dark Default) ---------- */
:root {
  --bg: #0a0a0f;
  --bg-elevated: #111118;
  --bg-card: #161621;
  --bg-subtle: #0d0d14;
  --border: rgba(255,255,255,0.06);
  --border-hover: rgba(255,255,255,0.12);
  --text: #f0f0f5;
  --text-secondary: #8b8b9e;
  --text-muted: #5a5a6e;
  --accent: #10b981;
  --accent-light: #34d399;
  --accent-dark: #059669;
  --accent-subtle: rgba(16,185,129,0.1);
  --blue: #3b82f6;
  --blue-bg: rgba(59,130,246,0.1);
  --green: #10b981;
  --green-bg: rgba(16,185,129,0.1);
  --purple: #a855f7;
  --purple-bg: rgba(168,85,247,0.1);
  --orange: #f97316;
  --orange-bg: rgba(249,115,22,0.1);
  --cyan: #06b6d4;
  --cyan-bg: rgba(6,182,212,0.1);
  --red: #ef4444;
  --red-bg: rgba(239,68,68,0.1);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.3);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.4);
  --radius: 12px;
  --radius-lg: 18px;
  --transition: 0.2s ease;
}

/* ---------- Light Theme ---------- */
[data-theme="light"] {
  --bg: #ffffff;
  --bg-elevated: #f8fafc;
  --bg-card: #f1f5f9;
  --bg-subtle: #f9fafb;
  --border: rgba(0,0,0,0.06);
  --border-hover: rgba(0,0,0,0.12);
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --accent: #059669;
  --accent-light: #10b981;
  --accent-dark: #047857;
  --accent-subtle: rgba(5,150,105,0.08);
  --blue: #2563eb;
  --blue-bg: rgba(37,99,235,0.08);
  --green: #059669;
  --green-bg: rgba(5,150,105,0.08);
  --purple: #7c3aed;
  --purple-bg: rgba(124,58,237,0.08);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.1);
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--accent-light); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent); }
img { max-width: 100%; display: block; }

/* ---------- Container ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ---------- Nav ---------- */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  padding: 0 24px; height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  background: #ffffff;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: background var(--transition);
}
[data-theme="light"] .site-nav { background: #ffffff; }
.nav-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.nav-logo-icon { width: 42px; height: 42px; }
.nav-logo-icon svg { width: 100%; height: 100%; }
.nav-logo-text { font-weight: 800 !important; font-size: 1.4rem !important; letter-spacing: -0.03em; }
.nav-menu { display: flex; align-items: center; gap: 8px; list-style: none; }
.nav-menu a {
  color: var(--text-secondary); font-size: 0.85rem; font-weight: 500;
  padding: 6px 12px; border-radius: 8px; transition: all var(--transition);
}
.nav-menu a:hover { color: var(--text); background: var(--bg-elevated); }
.nav-actions { display: flex; align-items: center; gap: 12px; }

/* Dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown > a::after { content: ' ▾'; font-size: 0.7em; opacity: 0.5; }
.nav-dropdown-menu {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%) translateY(8px);
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px; min-width: 220px; opacity: 0; visibility: hidden;
  transition: all 0.2s; box-shadow: var(--shadow-lg);
}
.nav-dropdown:hover .nav-dropdown-menu { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.nav-dropdown-menu a {
  display: block; padding: 8px 12px; border-radius: 8px;
  color: var(--text-secondary); font-size: 0.85rem;
}
.nav-dropdown-menu a:hover { background: var(--bg-card); color: var(--text); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: 10px; font-weight: 600; font-size: 0.9rem;
  cursor: pointer; border: none; transition: all var(--transition);
  text-decoration: none; font-family: inherit; line-height: 1;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-1px); box-shadow: 0 4px 20px rgba(16,185,129,0.25); }
.btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--border-hover); color: var(--text); background: var(--bg-elevated); }
.btn-lg { padding: 14px 28px; font-size: 1rem; border-radius: 12px; }

/* ---------- Theme Toggle ---------- */
.theme-toggle {
  width: 40px; height: 22px; border-radius: 50px; cursor: pointer;
  background: var(--bg-card); border: 1px solid var(--border);
  position: relative; transition: all 0.3s; display: flex; align-items: center; padding: 2px;
}
.theme-toggle-knob {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent); transition: all 0.3s; margin-left: auto;
}
[data-theme="light"] .theme-toggle-knob { margin-left: 0; margin-right: auto; }
.theme-toggle::before {
  content: '🌙'; font-size: 0.55rem; position: absolute; left: 4px; top: 50%; transform: translateY(-50%);
}
[data-theme="light"] .theme-toggle::before { content: '☀️'; }

/* ---------- Sections ---------- */
.section { padding: 48px 0; position: relative; }
.section-alt { background: var(--bg-subtle); }
.section-header { text-align: center; margin-bottom: 28px; }
.section-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 14px; border-radius: 50px;
  background: var(--accent-subtle); color: var(--accent-light);
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  margin-bottom: 16px;
}
.section-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800;
  letter-spacing: -0.03em; line-height: 1.15; margin-bottom: 12px;
}
.section-title .muted { color: var(--text-muted); font-weight: 500; }
.section-subtitle {
  font-size: 1.05rem; color: var(--text-secondary); max-width: 600px;
  margin: 0 auto; line-height: 1.7;
}

/* ---------- Cards ---------- */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px;
  transition: all 0.3s;
}
.card:hover { border-color: var(--border-hover); transform: translateY(-4px); box-shadow: var(--shadow-md); }
.card-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; margin-bottom: 16px;
}
.card-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.card-desc { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.6; }
.card-stat {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 6px; font-size: 0.75rem; font-weight: 700;
  margin-top: 12px;
}

/* ---------- Grids ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* ---------- Page Hero ---------- */
.page-hero {
  padding: 100px 0 40px; text-align: center;
  background: linear-gradient(180deg, rgba(16,185,129,0.04) 0%, transparent 60%);
}
.page-hero .section-badge { margin-bottom: 20px; }
.page-hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem); font-weight: 800;
  letter-spacing: -0.03em; line-height: 1.1; margin-bottom: 16px;
}
.page-hero h1 .accent { color: var(--accent-light); }
.page-hero p {
  font-size: 1.15rem; color: var(--text-secondary);
  max-width: 600px; margin: 0 auto 28px; line-height: 1.7;
}

/* ---------- Stats Bar ---------- */
.stats-bar { display: flex; justify-content: center; gap: 40px; flex-wrap: wrap; }
.stat-item { text-align: center; }
.stat-num { font-size: 2.2rem; font-weight: 800; color: var(--accent-light); }
.stat-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }

/* ---------- CTA Section ---------- */
.cta-section {
  padding: 48px 0; text-align: center;
  background: linear-gradient(180deg, var(--bg) 0%, rgba(16,185,129,0.04) 100%);
}
.cta-section h2 { font-size: 2rem; font-weight: 800; margin-bottom: 12px; letter-spacing: -0.02em; }
.cta-section p { color: var(--text-secondary); margin-bottom: 24px; max-width: 500px; margin-left: auto; margin-right: auto; }
.cta-guarantees { display: flex; justify-content: center; gap: 24px; margin-top: 16px; flex-wrap: wrap; }
.cta-guarantee { font-size: 0.8rem; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.cta-guarantee .check { color: var(--green); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border); padding: 48px 24px 24px; background: var(--bg);
}
.footer-grid {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px;
  margin-bottom: 32px;
}
.footer-brand p { font-size: 0.85rem; color: var(--text-muted); margin-top: 12px; line-height: 1.6; max-width: 280px; }
.footer-col h4 { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-secondary); margin-bottom: 12px; }
.footer-col a { display: block; color: var(--text-muted); font-size: 0.85rem; padding: 4px 0; transition: color var(--transition); }
.footer-col a:hover { color: var(--text); }
.footer-bottom {
  max-width: 1200px; margin: 0 auto;
  padding-top: 24px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
  font-size: 0.8rem; color: var(--text-muted);
}
.footer-bottom-links { display: flex; gap: 20px; }
.footer-bottom-links a { color: var(--text-muted); }
.footer-bottom-links a:hover { color: var(--text); }

/* ---------- Fade-in Animation ---------- */
.fade-in {
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ---------- Pulse ---------- */
@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(16,185,129,0.4); }
  50% { opacity: 0.8; box-shadow: 0 0 0 6px rgba(16,185,129,0); }
}
.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green); display: inline-block; animation: pulse 2s infinite;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
/* Mobile hamburger */
.nav-hamburger {
  display: none; cursor: pointer; background: none; border: none;
  padding: 4px; flex-direction: column; gap: 5px;
}
.nav-hamburger span {
  display: block; width: 22px; height: 2px; background: var(--text);
  border-radius: 2px; transition: all 0.3s;
}
.nav-mobile-menu {
  display: none; position: fixed; top: 64px; left: 0; right: 0;
  background: var(--bg-elevated); border-bottom: 1px solid var(--border);
  padding: 16px 24px; z-index: 999; box-shadow: var(--shadow-lg);
}
.nav-mobile-menu.open { display: block; }
.nav-mobile-menu a {
  display: block; padding: 12px 0; color: var(--text-secondary);
  font-size: 0.95rem; font-weight: 500; border-bottom: 1px solid var(--border);
  transition: color 0.2s;
}
.nav-mobile-menu a:last-child { border-bottom: none; }
.nav-mobile-menu a:hover { color: var(--text); }
.nav-mobile-menu .mobile-cta {
  margin-top: 16px; display: block; text-align: center;
}

@media (max-width: 768px) {
  .section { padding: 32px 0; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .nav-menu { display: none; }
  .nav-actions { display: none; }
  .nav-hamburger { display: flex; }
  .footer-grid { grid-template-columns: 1fr; }
  .stats-bar { gap: 20px; }
  .page-hero { padding: 100px 0 40px; }
  .site-nav { padding: 0 16px; }
}

/* Agent Demo Widget */
.agent-demo { max-width: 480px; margin: 2rem auto 0; }
.agent-widget {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-md);
}
.agent-header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.02);
}
.agent-avatar {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; background: var(--accent-subtle);
}
.agent-info h4 { font-size: 0.85rem; font-weight: 700; }
.agent-live {
  font-size: 0.7rem; color: var(--green);
  display: flex; align-items: center; gap: 4px;
}
.agent-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green); animation: pulse 2s infinite;
}
.agent-chat { padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.agent-msg {
  padding: 10px 14px; border-radius: 12px;
  font-size: 0.82rem; line-height: 1.5; max-width: 85%;
  opacity: 0; animation: msgAppear 0.4s ease-out forwards;
}
.agent-user {
  background: var(--accent); color: #fff;
  align-self: flex-end; border-bottom-right-radius: 4px;
}
.agent-bot {
  background: var(--bg-elevated); border: 1px solid var(--border);
  color: var(--text-secondary); border-bottom-left-radius: 4px;
}
.agent-bot strong { color: var(--text); }
.msg-1 { animation-delay: 0.5s; }
.msg-2 { animation-delay: 1.5s; }
.msg-3 { animation-delay: 3s; }
.msg-4 { animation-delay: 4s; }
@keyframes msgAppear {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.agent-metrics {
  display: flex; border-top: 1px solid var(--border);
}
.agent-metric {
  flex: 1; text-align: center; padding: 10px 8px;
  border-right: 1px solid var(--border);
}
.agent-metric:last-child { border-right: none; }
.metric-num { display: block; font-size: 0.95rem; font-weight: 800; color: var(--accent-light); }
.metric-label { display: block; font-size: 0.65rem; color: var(--text-muted); margin-top: 2px; }

/* Hub page mini bot cards */
.hub-bots { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin: 2rem auto 0; max-width: 720px; }
.hub-bot-card {
  flex: 1; min-width: 200px; max-width: 220px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px; text-align: center;
  box-shadow: var(--shadow-md);
}
.hub-bot-card .agent-avatar { margin: 0 auto 8px; }
.hub-bot-card h4 { font-size: 0.8rem; font-weight: 700; margin-bottom: 4px; }
.hub-bot-card p { font-size: 0.72rem; color: var(--text-muted); line-height: 1.4; margin: 0; }
.hub-bot-card .agent-live { justify-content: center; margin-top: 6px; }

/* Newsletter */
.newsletter-section {
  padding: 80px 0;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
}
.newsletter-form { max-width: 480px; margin: 0 auto; }
.newsletter-input-wrap {
  display: flex; gap: 8px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 6px 6px 6px 16px;
  transition: border-color 0.2s;
}
.newsletter-input-wrap:focus-within { border-color: var(--accent); }
.newsletter-input-wrap input {
  flex: 1; border: none; background: transparent;
  color: var(--text); font-family: inherit; font-size: 0.9rem;
  outline: none; min-width: 0;
}
.newsletter-input-wrap input::placeholder { color: var(--text-muted); }
.newsletter-input-wrap .btn { white-space: nowrap; padding: 10px 20px; }
.newsletter-note {
  font-size: 0.8rem; color: var(--text-muted); margin-top: 12px;
}
