/* ── B2BS.AI Theme — Aligned with b2bs.co.za ──────────────────── */

:root {
  --navy: #003459;
  --navy-deep: #001F3F;
  --navy-light: #004578;
  --cyan: #00A8E8;
  --cyan-dark: #0090C8;
  --cyan-light: #33BFEF;
  --white: #FFFFFF;
  --off-white: #F7F9FB;
  --gray-50: #F0F4F8;
  --text: #0D1B2A;
  --text-secondary: #3D5A73;
  --text-muted: #6B8299;
  --border: #E2EAF1;
  --border-medium: #C8D8E4;
  --success: #10B981;
  --error: #EF4444;
  --warning: #F59E0B;

  --font-body: 'Outfit', system-ui, sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;

  --max-width: 1200px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Reset ────────────────────────────────────────────────────── */

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

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--white);
  line-height: 1.7;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--cyan); text-decoration: none; transition: color 0.3s var(--ease); }
a:hover { color: var(--cyan-dark); }
img { max-width: 100%; display: block; }

/* ── Typography ───────────────────────────────────────────────── */

h1, h2, h3, h4, h5, h6 { font-family: var(--font-body); font-weight: 400; line-height: 1.15; color: var(--text); }

h1 { font-size: 3.25rem; letter-spacing: -0.5px; }
h2 { font-size: 2.5rem; }
h3 { font-size: 1.25rem; font-weight: 500; }
h4 { font-size: 1rem; font-weight: 500; }

.display { font-family: var(--font-display); font-style: italic; }

/* ── Layout ───────────────────────────────────────────────────── */

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 40px; }

/* ── Label / Tag ──────────────────────────────────────────────── */

.label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  color: var(--cyan);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.label::before {
  content: '';
  width: 20px;
  height: 2px;
  background: var(--cyan);
  flex-shrink: 0;
}

/* ── Header ───────────────────────────────────────────────────── */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 10px 40px;
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.site-header.scrolled {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
}

.logo { display: flex; align-items: center; gap: 0; text-decoration: none; }
.logo-text { color: var(--navy); font-size: 20px; font-weight: 700; }
.logo-accent { color: var(--cyan); font-size: 20px; font-weight: 700; }

.nav-links { display: flex; align-items: center; gap: 36px; }
.nav-links a {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  transition: color 0.3s var(--ease);
}
.nav-links a:hover, .nav-links a.active { color: var(--navy); }

.nav-cta {
  background: var(--cyan) !important;
  color: var(--white) !important;
  padding: 10px 24px;
  border-radius: 3px;
  font-weight: 600;
  font-size: 13px;
  transition: background 0.3s var(--ease), transform 0.3s var(--ease);
}
.nav-cta:hover { background: var(--cyan-dark) !important; transform: translateY(-2px); }

/* ── Hero ─────────────────────────────────────────────────────── */

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 130px 40px 100px;
  background: linear-gradient(160deg, var(--white) 0%, var(--off-white) 50%, rgba(0,168,232,0.03) 100%);
  position: relative;
  overflow: hidden;
}

/* Decorative orbs */
.hero::before {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,168,232,0.08) 0%, transparent 70%);
  top: -100px; right: -100px;
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,168,232,0.05) 0%, transparent 70%);
  bottom: 0; left: -80px;
  pointer-events: none;
}

.hero-content { position: relative; z-index: 1; max-width: 720px; }

.hero .tagline {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  color: var(--cyan);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.hero .tagline::before, .hero .tagline::after {
  content: '';
  width: 20px;
  height: 2px;
  background: var(--cyan);
}

.hero h1 { margin-bottom: 20px; }
.hero h1 .display { color: var(--cyan-dark); }

.hero .subtitle {
  color: var(--text-secondary);
  font-size: 17px;
  font-weight: 300;
  line-height: 1.8;
  max-width: 560px;
  margin: 0 auto 36px;
}

.hero-cta {
  display: inline-block;
  background: var(--cyan);
  color: var(--white);
  padding: 14px 36px;
  border-radius: 3px;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.3s var(--ease), transform 0.3s var(--ease);
}
.hero-cta:hover { background: var(--cyan-dark); transform: translateY(-2px); color: var(--white); }

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 56px;
  margin-top: 56px;
}
.hero-stat { text-align: center; }
.hero-stat .number { font-size: 2.25rem; font-weight: 400; color: var(--navy); letter-spacing: -0.5px; }
.hero-stat .stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; font-weight: 400; letter-spacing: 0.5px; }

/* ── Sections ─────────────────────────────────────────────────── */

.section { padding: 100px 40px; }
.section-alt { background: var(--off-white); }
.section-navy { background: var(--navy); color: var(--white); }
.section-navy h2, .section-navy h3 { color: var(--white); }
.section-navy .label { color: var(--cyan-light); }
.section-navy .label::before { background: var(--cyan-light); }

.section-title { text-align: center; margin-bottom: 56px; }
.section-title h2 { margin-bottom: 16px; }
.section-title p { color: var(--text-secondary); font-size: 17px; max-width: 520px; margin: 0 auto; line-height: 1.8; }

/* ── Divider ──────────────────────────────────────────────────── */

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--cyan) 20%, var(--border) 80%, transparent 100%);
  opacity: 0.3;
  margin: 56px 0;
}

/* ── Agent Cards ──────────────────────────────────────────────── */

.agents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.agent-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 32px 24px;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s var(--ease);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
  position: relative;
  overflow: hidden;
}
.agent-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--cyan);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}
.agent-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,52,89,0.06);
  border-color: var(--border-medium);
  color: inherit;
}
.agent-card:hover::before { opacity: 1; }

.agent-card-header { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 14px; }

.agent-icon {
  width: 40px;
  height: 40px;
  background: var(--off-white);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.agent-card h3 { font-size: 16px; font-weight: 500; margin-bottom: 2px; }
.agent-card .service-area {
  font-size: 11px;
  color: var(--cyan);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}
.agent-card .description { color: var(--text-secondary); font-size: 14px; line-height: 1.7; margin-bottom: 14px; font-weight: 300; }

.agent-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.agent-tag {
  background: var(--off-white);
  color: var(--text-muted);
  padding: 3px 10px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 500;
}

.agent-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.try-demo-link { color: var(--cyan); font-weight: 500; font-size: 13px; }

/* ── Service Cards ────────────────────────────────────────────── */

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.service-card {
  background: var(--off-white);
  border-radius: 8px;
  padding: 28px 24px;
  transition: transform 0.4s var(--ease);
}
.service-card:hover { transform: translateY(-2px); }
.service-card .service-icon { font-size: 1.5rem; margin-bottom: 14px; }
.service-card h3 { color: var(--navy); font-size: 16px; font-weight: 500; margin-bottom: 8px; }
.service-card p { color: var(--text-secondary); font-size: 14px; line-height: 1.7; font-weight: 300; }

.section-navy .service-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}
.section-navy .service-card h3 { color: var(--cyan-light); }
.section-navy .service-card p { color: rgba(255,255,255,0.6); }

/* ── Pricing ──────────────────────────────────────────────────── */

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.pricing-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 36px 28px;
  text-align: center;
  position: relative;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.pricing-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,52,89,0.06); }
.pricing-card.popular { border-color: var(--cyan); }
.pricing-card.popular::before {
  content: 'Most Popular';
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--cyan);
  color: var(--white);
  padding: 4px 14px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.pricing-card h3 { margin-bottom: 8px; font-weight: 500; }
.pricing-card .price { font-size: 2.5rem; font-weight: 400; color: var(--navy); margin-bottom: 4px; letter-spacing: -0.5px; }
.pricing-card .price-sub { color: var(--text-muted); font-size: 13px; margin-bottom: 20px; }
.pricing-card .tokens { color: var(--cyan); font-weight: 500; font-size: 15px; margin-bottom: 24px; }

.pricing-cta {
  display: inline-block;
  width: 100%;
  padding: 12px;
  border-radius: 3px;
  font-weight: 600;
  font-size: 14px;
  text-align: center;
  transition: all 0.3s var(--ease);
  border: 1.5px solid var(--border-medium);
  color: var(--navy);
  background: transparent;
  cursor: pointer;
  font-family: var(--font-body);
}
.pricing-cta:hover { background: var(--navy); color: var(--white); border-color: var(--navy); }
.pricing-card.popular .pricing-cta { background: var(--cyan); color: var(--white); border-color: var(--cyan); }
.pricing-card.popular .pricing-cta:hover { background: var(--cyan-dark); border-color: var(--cyan-dark); }

/* ── Buttons ──────────────────────────────────────────────────── */

.btn {
  display: inline-block;
  padding: 14px 32px;
  border-radius: 3px;
  font-weight: 600;
  font-size: 14px;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.3s var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--cyan); color: var(--white); }
.btn-primary:hover { background: var(--cyan-dark); color: var(--white); transform: translateY(-2px); }
.btn-navy { background: var(--navy); color: var(--white); }
.btn-navy:hover { background: var(--navy-deep); color: var(--white); transform: translateY(-2px); }
.btn-outline { background: transparent; border: 1.5px solid var(--border-medium); color: var(--navy); }
.btn-outline:hover { border-color: var(--navy); }

.filter-btn { padding: 8px 16px; font-size: 13px; }
.filter-btn.active { background: var(--navy); color: var(--white); border-color: var(--navy); }

/* ── Chat / Agent UI ──────────────────────────────────────────── */

.chat-container {
  max-width: 780px;
  margin: 0 auto;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.chat-header {
  background: var(--navy);
  color: var(--white);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.chat-header h3 { color: var(--white); font-size: 14px; font-weight: 500; }
.chat-header .badge { background: var(--cyan); padding: 2px 10px; border-radius: 3px; font-size: 11px; font-weight: 600; }

.chat-messages { padding: 24px; min-height: 300px; max-height: 500px; overflow-y: auto; }
.chat-message { margin-bottom: 16px; display: flex; gap: 12px; }
.chat-message.user { flex-direction: row-reverse; }
.chat-message .bubble {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.7;
  font-weight: 300;
}
.chat-message.assistant .bubble { background: var(--off-white); color: var(--text); }
.chat-message.user .bubble { background: var(--cyan); color: var(--white); }

.chat-input-area { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 12px; }
.chat-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 3px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 300;
  outline: none;
  transition: border-color 0.3s var(--ease);
}
.chat-input:focus { border-color: var(--cyan); }
.chat-send {
  background: var(--cyan);
  color: var(--white);
  border: none;
  padding: 12px 24px;
  border-radius: 3px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background 0.3s var(--ease);
}
.chat-send:hover { background: var(--cyan-dark); }
.chat-send:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Token Badge ──────────────────────────────────────────────── */

.token-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0,168,232,0.08);
  color: var(--cyan);
  padding: 6px 14px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 500;
}
.token-badge.low { background: rgba(245,158,11,0.08); color: var(--warning); }
.token-badge.depleted { background: rgba(239,68,68,0.08); color: var(--error); }

/* ── Auth Modal ───────────────────────────────────────────────── */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,20,40,0.4);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--white);
  border-radius: 8px;
  padding: 40px;
  max-width: 400px;
  width: 90%;
  text-align: center;
}
.modal h2 { margin-bottom: 8px; font-size: 1.5rem; }
.modal p { color: var(--text-secondary); margin-bottom: 24px; font-size: 15px; font-weight: 300; }
.modal input[type="email"] {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 3px;
  font-size: 15px;
  font-family: var(--font-body);
  margin-bottom: 16px;
  outline: none;
  font-weight: 300;
}
.modal input[type="email"]:focus { border-color: var(--cyan); }

/* ── Dashboard ────────────────────────────────────────────────── */

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
}
.stat-card .stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 2px; font-weight: 500; margin-bottom: 8px; }
.stat-card .stat-value { font-size: 2rem; font-weight: 400; color: var(--navy); letter-spacing: -0.5px; }
.stat-card .stat-sub { font-size: 13px; color: var(--text-muted); margin-top: 4px; font-weight: 300; }

/* ── Footer ───────────────────────────────────────────────────── */

.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.5);
  padding: 48px 40px;
  text-align: center;
  font-size: 13px;
  font-weight: 300;
}
.site-footer a { color: var(--cyan-light); }
.footer-inner { max-width: var(--max-width); margin: 0 auto; }
.footer-links { display: flex; justify-content: center; gap: 28px; margin-bottom: 16px; }

/* ── Markdown ─────────────────────────────────────────────────── */

.markdown-output h1 { font-size: 1.5rem; margin: 24px 0 12px; }
.markdown-output h2 { font-size: 1.25rem; margin: 20px 0 10px; }
.markdown-output h3 { font-size: 1.1rem; margin: 16px 0 8px; }
.markdown-output p { margin-bottom: 12px; }
.markdown-output ul, .markdown-output ol { margin-bottom: 12px; padding-left: 24px; }
.markdown-output li { margin-bottom: 4px; }
.markdown-output strong { color: var(--navy); font-weight: 500; }
.markdown-output hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.markdown-output code { background: var(--off-white); padding: 2px 6px; border-radius: 3px; font-family: var(--font-mono); font-size: 0.9em; }

/* ── Loading ──────────────────────────────────────────────────── */

.typing-indicator { display: inline-flex; gap: 4px; padding: 8px 0; }
.typing-indicator span {
  width: 6px; height: 6px;
  background: var(--cyan);
  border-radius: 50%;
  animation: typing 1.2s infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1); }
}

/* ── Animations ───────────────────────────────────────────────── */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.7s var(--ease) forwards; }
.fade-up-d1 { animation-delay: 0.1s; opacity: 0; }
.fade-up-d2 { animation-delay: 0.2s; opacity: 0; }
.fade-up-d3 { animation-delay: 0.3s; opacity: 0; }
.fade-up-d4 { animation-delay: 0.4s; opacity: 0; }

/* ── Responsive ───────────────────────────────────────────────── */

@media (max-width: 900px) {
  h1 { font-size: 2.25rem; }
  h2 { font-size: 1.75rem; }
  .hero { min-height: auto; padding: 120px 20px 64px; }
  .hero-stats { flex-direction: column; gap: 20px; }
  .section { padding: 64px 20px; }
  .agents-grid, .services-grid, .pricing-grid { grid-template-columns: 1fr; }
  .nav-links { gap: 20px; }
  .nav-links a:not(.nav-cta) { display: none; }
  .container { padding: 0 20px; }
}
