/* ============================================================
   AIcallable — Global Stylesheet
   ============================================================ */

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

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #080b14;
  --bg-card:   #0d1220;
  --bg-card2:  #111827;
  --border:    rgba(99,102,241,.18);
  --border2:   rgba(99,102,241,.08);
  --purple:    #7c3aed;
  --purple-l:  #a78bfa;
  --blue:      #2563eb;
  --blue-l:    #60a5fa;
  --cyan:      #06b6d4;
  --cyan-l:    #67e8f9;
  --green:     #10b981;
  --orange:    #f59e0b;
  --text:      #e2e8f0;
  --text-muted:#94a3b8;
  --text-dim:  #64748b;
  --gradient:  linear-gradient(135deg, var(--purple) 0%, var(--blue) 50%, var(--cyan) 100%);
  --glow:      0 0 40px rgba(124,58,237,.25);
  --radius:    12px;
  --radius-lg: 20px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

::selection { background: rgba(124,58,237,.4); color: #fff; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--purple); border-radius: 3px; }

/* ---------- Typography ---------- */
h1,h2,h3,h4,h5 { line-height: 1.2; font-weight: 700; }
h1 { font-size: clamp(2.2rem, 6vw, 4rem); }
h2 { font-size: clamp(1.6rem, 4vw, 2.6rem); }
h3 { font-size: clamp(1.2rem, 3vw, 1.6rem); }
h4 { font-size: 1.1rem; }
p  { color: var(--text-muted); }

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---------- Layout ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
section { padding: 96px 0; }
.section-label {
  display: inline-block;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--purple-l);
  background: rgba(124,58,237,.12);
  border: 1px solid rgba(124,58,237,.3);
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: 20px;
}
.section-header { text-align: center; margin-bottom: 64px; }
.section-header p { max-width: 600px; margin: 16px auto 0; font-size: 1.1rem; }

/* ---------- Navigation ---------- */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(8,11,20,.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border2);
  transition: background .3s;
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; max-width: 1200px; margin: 0 auto; padding: 0 24px;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; font-weight: 800; font-size: 1.25rem; color: #fff;
}
.nav-logo-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--gradient);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: #fff; font-weight: 800;
}
.nav-links {
  display: flex; align-items: center; gap: 4px; list-style: none;
}
.nav-links a {
  color: var(--text-muted); text-decoration: none; font-size: .9rem;
  padding: 8px 14px; border-radius: 8px; transition: all .2s;
  font-weight: 500;
}
.nav-links a:hover, .nav-links a.active {
  color: #fff; background: rgba(124,58,237,.15);
}
.nav-cta {
  display: flex; align-items: center; gap: 12px;
}
.nav-hamburger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px;
}
.nav-hamburger span {
  width: 24px; height: 2px; background: var(--text-muted);
  border-radius: 2px; transition: all .3s;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; border-radius: 10px; font-size: .95rem;
  font-weight: 600; text-decoration: none; cursor: pointer;
  border: none; transition: all .25s; font-family: inherit;
}
.btn-primary {
  background: var(--gradient); color: #fff;
  box-shadow: 0 4px 24px rgba(124,58,237,.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(124,58,237,.5);
}
.btn-secondary {
  background: rgba(255,255,255,.06); color: #fff;
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: rgba(255,255,255,.1); transform: translateY(-2px);
}
.btn-sm { padding: 8px 16px; font-size: .85rem; }
.btn-outline {
  background: transparent; color: var(--purple-l);
  border: 1px solid rgba(124,58,237,.4);
}
.btn-outline:hover {
  background: rgba(124,58,237,.1); color: #fff;
}

/* ---------- Cards ---------- */
.card {
  background: var(--bg-card); border: 1px solid var(--border2);
  border-radius: var(--radius-lg); padding: 32px;
  transition: all .3s;
}
.card:hover {
  border-color: var(--border);
  box-shadow: var(--glow);
  transform: translateY(-4px);
}
.card-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; margin-bottom: 20px;
}

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

/* ---------- Badge ---------- */
.badge {
  display: inline-block; font-size: .7rem; font-weight: 600;
  padding: 3px 10px; border-radius: 100px;
  letter-spacing: .06em; text-transform: uppercase;
}
.badge-live { background: rgba(16,185,129,.15); color: var(--green); border: 1px solid rgba(16,185,129,.3); }
.badge-soon { background: rgba(245,158,11,.12); color: var(--orange); border: 1px solid rgba(245,158,11,.25); }
.badge-beta { background: rgba(99,102,241,.15); color: var(--purple-l); border: 1px solid rgba(99,102,241,.3); }

/* ---------- Code blocks ---------- */
.code-block {
  background: #0a0e1a; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  font-family: 'JetBrains Mono', monospace; font-size: .85rem;
  line-height: 1.8; overflow-x: auto; position: relative;
}
.code-block .code-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border2);
}
.code-dots { display: flex; gap: 6px; }
.code-dots span {
  width: 12px; height: 12px; border-radius: 50%;
}
.code-dots span:nth-child(1) { background: #ff5f57; }
.code-dots span:nth-child(2) { background: #febc2e; }
.code-dots span:nth-child(3) { background: #28c840; }
.code-lang { color: var(--text-dim); font-size: .75rem; }

.tok-keyword  { color: #c792ea; }
.tok-string   { color: #c3e88d; }
.tok-comment  { color: #546e7a; }
.tok-fn       { color: #82aaff; }
.tok-num      { color: #f78c6c; }
.tok-type     { color: #ffcb6b; }
.tok-op       { color: #89ddff; }
.tok-prop     { color: #80cbc4; }

/* ---------- Hero Background ---------- */
.hero-bg {
  position: absolute; inset: 0; overflow: hidden; pointer-events: none;
}
.hero-orb {
  position: absolute; border-radius: 50%; filter: blur(80px); opacity: .35;
}
.orb-1 { width: 600px; height: 600px; background: var(--purple); top: -200px; right: -100px; }
.orb-2 { width: 400px; height: 400px; background: var(--blue); bottom: -100px; left: -100px; }
.orb-3 { width: 300px; height: 300px; background: var(--cyan); top: 30%; left: 40%; opacity: .2; }

/* ---------- Animated grid bg ---------- */
.grid-bg {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(99,102,241,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99,102,241,.04) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

/* ---------- Stats ---------- */
.stats-row { display: flex; gap: 48px; flex-wrap: wrap; }
.stat-item { }
.stat-num {
  font-size: 2.4rem; font-weight: 800; line-height: 1;
  background: var(--gradient);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-label { color: var(--text-dim); font-size: .85rem; margin-top: 4px; }

/* ---------- Feature List ---------- */
.feature-list { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.feature-list li {
  display: flex; align-items: flex-start; gap: 12px;
  color: var(--text-muted);
}
.feature-list li::before {
  content: ''; width: 20px; height: 20px; min-width: 20px;
  background: rgba(124,58,237,.2); border: 1px solid rgba(124,58,237,.4);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 20 20' fill='%237c3aed' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' d='M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-size: 12px; background-repeat: no-repeat; background-position: center;
  margin-top: 2px;
}

/* ---------- Tab / Toggle ---------- */
.tabs { display: flex; gap: 4px; background: var(--bg-card); padding: 4px; border-radius: 10px; border: 1px solid var(--border2); width: fit-content; margin-bottom: 32px; }
.tab-btn {
  padding: 8px 20px; border-radius: 8px; border: none; background: none;
  color: var(--text-muted); font-size: .9rem; font-weight: 500; cursor: pointer;
  transition: all .2s; font-family: inherit;
}
.tab-btn.active {
  background: var(--gradient); color: #fff;
  box-shadow: 0 2px 12px rgba(124,58,237,.3);
}

/* ---------- Footer ---------- */
footer {
  background: var(--bg-card); border-top: 1px solid var(--border2);
  padding: 64px 0 32px;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px;
  margin-bottom: 48px;
}
.footer-brand p { color: var(--text-dim); font-size: .9rem; line-height: 1.7; margin-top: 12px; max-width: 280px; }
.footer-col h5 { color: #fff; font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 16px; }
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-links a { color: var(--text-dim); text-decoration: none; font-size: .9rem; transition: color .2s; }
.footer-links a:hover { color: var(--purple-l); }
.footer-bottom {
  border-top: 1px solid var(--border2); padding-top: 24px;
  display: flex; justify-content: space-between; align-items: center;
  color: var(--text-dim); font-size: .85rem;
}
.social-links { display: flex; gap: 12px; }
.social-link {
  width: 36px; height: 36px; border-radius: 8px;
  background: rgba(255,255,255,.05); border: 1px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim); text-decoration: none; font-size: .9rem;
  transition: all .2s;
}
.social-link:hover { background: rgba(124,58,237,.2); border-color: var(--border); color: var(--purple-l); }

/* ---------- Page Hero ---------- */
.page-hero {
  padding: 140px 0 80px; position: relative; overflow: hidden; text-align: center;
}

/* ---------- Connector Card ---------- */
.connector-card {
  background: var(--bg-card); border: 1px solid var(--border2);
  border-radius: var(--radius); padding: 24px;
  display: flex; align-items: center; gap: 16px;
  transition: all .3s;
}
.connector-card:hover {
  border-color: var(--border); transform: translateY(-2px);
  box-shadow: var(--glow);
}
.connector-logo {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; background: rgba(255,255,255,.05);
  border: 1px solid var(--border2);
}
.connector-info { flex: 1; }
.connector-info h4 { color: #fff; font-size: 1rem; margin-bottom: 2px; }
.connector-info p { font-size: .8rem; color: var(--text-dim); }

/* ---------- Pricing ---------- */
.pricing-card {
  background: var(--bg-card); border: 1px solid var(--border2);
  border-radius: var(--radius-lg); padding: 40px 32px;
  display: flex; flex-direction: column; gap: 24px;
  transition: all .3s;
}
.pricing-card.featured {
  border-color: var(--purple); background: linear-gradient(180deg, rgba(124,58,237,.08) 0%, var(--bg-card) 100%);
  box-shadow: 0 0 60px rgba(124,58,237,.15);
}
.pricing-card:hover { transform: translateY(-4px); }
.price-amount { font-size: 3rem; font-weight: 800; color: #fff; line-height: 1; }
.price-amount span { font-size: 1.2rem; color: var(--text-muted); font-weight: 400; }
.price-period { color: var(--text-dim); font-size: .9rem; }
.pricing-features { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.pricing-features li { display: flex; align-items: center; gap: 10px; font-size: .9rem; color: var(--text-muted); }
.pricing-features li .check { color: var(--green); font-size: 1rem; }
.pricing-features li .cross { color: var(--text-dim); font-size: 1rem; }

/* ---------- Table ---------- */
.compare-table { width: 100%; border-collapse: collapse; margin-top: 48px; }
.compare-table th {
  padding: 16px 24px; text-align: left; font-size: .85rem; font-weight: 600;
  color: var(--text-muted); border-bottom: 1px solid var(--border2);
  letter-spacing: .04em;
}
.compare-table td {
  padding: 14px 24px; font-size: .9rem; color: var(--text-muted);
  border-bottom: 1px solid var(--border2);
}
.compare-table tr:last-child td { border-bottom: none; }
.compare-table td:first-child { color: var(--text); font-weight: 500; }
.compare-table .yes { color: var(--green); }
.compare-table .no { color: var(--text-dim); }

/* ---------- Doc layout ---------- */
.doc-layout { display: grid; grid-template-columns: 260px 1fr; gap: 48px; align-items: start; }
.doc-sidebar {
  position: sticky; top: 88px;
  background: var(--bg-card); border: 1px solid var(--border2);
  border-radius: var(--radius); padding: 24px;
}
.doc-sidebar h5 { color: var(--text-dim); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 12px; margin-top: 20px; }
.doc-sidebar h5:first-child { margin-top: 0; }
.doc-sidebar ul { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.doc-sidebar a {
  display: block; padding: 7px 12px; border-radius: 7px;
  color: var(--text-muted); text-decoration: none; font-size: .875rem;
  transition: all .2s;
}
.doc-sidebar a:hover, .doc-sidebar a.active {
  background: rgba(124,58,237,.12); color: var(--purple-l);
}
.doc-content h2 { margin: 40px 0 16px; }
.doc-content h2:first-child { margin-top: 0; }
.doc-content p { margin-bottom: 16px; }
.doc-content pre { margin: 24px 0; }

/* ---------- Flow Arrow Animation ---------- */
.flow-arrow-wrap {
  position: relative;
  width: 100%;
  height: 2px;
  margin: 4px 0;
}
.flow-line {
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, rgba(124,58,237,.2), rgba(124,58,237,.7), rgba(124,58,237,.2));
  border-radius: 1px;
}
.flow-dot {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--purple-l);
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  animation: flow-right 2.1s ease-in-out infinite;
}
@keyframes flow-right {
  0%         { left: -7px; opacity: 0; }
  8%         { opacity: 1; }
  92%        { opacity: 1; }
  100%       { left: calc(100% + 7px); opacity: 0; }
}
.flow-dot-back {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--purple-l);
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  animation: flow-left 2.1s ease-in-out infinite;
}
@keyframes flow-left {
  0%         { left: calc(100% + 7px); opacity: 0; }
  8%         { opacity: 1; }
  92%        { opacity: 1; }
  100%       { left: -7px; opacity: 0; }
}

/* ---------- AI Symbol Ticker ---------- */
.ai-ticker {
  position: relative;
  width: 18px;
  height: 18px;
  display: block;
}
.ai-ticker i {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-style: normal;
  font-size: 13px;
  line-height: 1;
  opacity: 0;
  animation: ai-tick 5s infinite;
}
.ai-ticker i:nth-child(1) { animation-delay: 0s; }
.ai-ticker i:nth-child(2) { animation-delay: 1.25s; }
.ai-ticker i:nth-child(3) { animation-delay: 2.5s; }
.ai-ticker i:nth-child(4) { animation-delay: 3.75s; }
@keyframes ai-tick {
  0%, 4%   { opacity: 0; transform: translateY(5px); }
  12%, 20% { opacity: 1; transform: translateY(0); }
  28%, 100% { opacity: 0; transform: translateY(-5px); }
}

/* ---------- Animations ---------- */
@keyframes float {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}
@keyframes pulse-glow {
  0%,100% { box-shadow: 0 0 20px rgba(124,58,237,.3); }
  50%      { box-shadow: 0 0 40px rgba(124,58,237,.6); }
}
@keyframes spin-slow { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes fade-up {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes data-flow {
  0%   { transform: translateY(100%); opacity: 0; }
  20%  { opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translateY(-100%); opacity: 0; }
}

.animate-fade-up { animation: fade-up .6s ease forwards; }
.animate-float   { animation: float 4s ease-in-out infinite; }

/* ---------- Mobile ---------- */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .doc-layout { grid-template-columns: 1fr; }
  .doc-sidebar { position: static; }
}

@media (max-width: 768px) {
  section { padding: 64px 0; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .nav-links, .nav-cta { display: none; }
  .nav-hamburger { display: flex; }
  .footer-grid { grid-template-columns: 1fr; }
  .stats-row { gap: 24px; }
  .page-hero { padding: 120px 0 60px; }
}

/* ---------- Mobile menu ---------- */
.mobile-menu {
  display: none; position: fixed; inset: 0; z-index: 999;
  background: rgba(8,11,20,.98); flex-direction: column;
  align-items: center; justify-content: center; gap: 24px;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  color: var(--text); text-decoration: none; font-size: 1.4rem; font-weight: 600;
  transition: color .2s;
}
.mobile-menu a:hover { color: var(--purple-l); }
.mobile-close {
  position: absolute; top: 20px; right: 24px;
  background: none; border: none; color: var(--text); font-size: 1.5rem; cursor: pointer;
}

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.text-sm     { font-size: .875rem; }
.mt-4  { margin-top: 16px; }
.mt-8  { margin-top: 32px; }
.mt-12 { margin-top: 48px; }
.mb-4  { margin-bottom: 16px; }
.gap-3 { gap: 12px; }
.flex  { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.inline-flex { display: inline-flex; }
.items-center { align-items: center; }
.gap-4 { gap: 16px; }
.relative { position: relative; }
.overflow-hidden { overflow: hidden; }
