/* =====================================================================
   Public Site — Core Design System
   Enterprise CPaaS marketing site: glassmorphism, sticky nav, mega menu,
   animated stats, timelines, tabs, accordions, CTA bands.
   ===================================================================== */

* { box-sizing: border-box; }

body {
  font-family: var(--font-body, 'Inter', sans-serif);
  color: #1F2430;
  background: #ffffff;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading, 'Sora', sans-serif); font-weight: 700; }

a { color: inherit; }

.btn-brand {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  border: none; color: #fff !important; font-weight: 600;
  border-radius: var(--brand-radius); padding: 0.55rem 1.3rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-brand:hover { transform: translateY(-2px); box-shadow: 0 12px 24px -8px rgba(91,33,182,0.45); color: #fff; }

.btn-outline-brand {
  border: 1.5px solid var(--brand-primary); color: var(--brand-primary) !important;
  border-radius: var(--brand-radius); font-weight: 600; padding: 0.5rem 1.2rem;
  transition: background 0.2s ease, color 0.2s ease;
}
.btn-outline-brand:hover { background: var(--brand-primary); color: #fff !important; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  transition: box-shadow 0.25s ease;
}
.site-header.scrolled { box-shadow: 0 8px 30px -18px rgba(0,0,0,0.25); }

.site-logo-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  display: inline-block;
}
.site-logo-text { font-family: var(--font-heading); font-weight: 800; font-size: 1.1rem; color: #1F2430; }

.main-nav-item { position: relative; margin: 0 4px; }
.main-nav-item > a {
  display: flex; align-items: center; gap: 4px;
  padding: 10px 14px; font-weight: 600; font-size: 0.92rem;
  text-decoration: none; color: #333; border-radius: 10px;
}
.main-nav-item > a:hover { color: var(--brand-primary); background: rgba(91,33,182,0.06); }

.mega-menu {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%) translateY(10px);
  width: 720px; background: rgba(255,255,255,0.97);
  backdrop-filter: blur(20px);
  border-radius: 18px; box-shadow: 0 30px 60px -20px rgba(0,0,0,0.25);
  padding: 28px; opacity: 0; visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  border: 1px solid rgba(0,0,0,0.05);
}
.main-nav-item.has-mega:hover .mega-menu { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(6px); }
.mega-menu-heading { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: #9698a6; margin-bottom: 10px; font-weight: 700; }
.mega-menu-link { display: block; padding: 8px 10px; border-radius: 10px; text-decoration: none; margin-bottom: 2px; }
.mega-menu-link:hover { background: rgba(91,33,182,0.06); }
.mega-menu-link-label { display: block; font-weight: 600; color: #1F2430; font-size: 0.9rem; }
.mega-menu-link-desc { display: block; font-size: 0.78rem; color: #8a8fa3; }

.theme-toggle-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(0,0,0,0.08);
  background: #fff; display: inline-flex; align-items: center; justify-content: center;
}

.mobile-nav-toggle { border: none; background: transparent; font-size: 1.5rem; }
.mobile-nav-drawer {
  position: fixed; top: 0; right: -100%; width: 82%; max-width: 360px; height: 100vh;
  background: #fff; z-index: 1100; padding: 24px; box-shadow: -20px 0 60px rgba(0,0,0,0.15);
  transition: right 0.3s ease; overflow-y: auto;
}
.mobile-nav-drawer.show { right: 0; }
.mobile-nav-link { display: block; padding: 10px 0; font-weight: 600; text-decoration: none; color: #1F2430; }
.mobile-nav-sublink { display: block; padding: 6px 0; font-size: 0.9rem; text-decoration: none; color: #666; }
.btn-close-custom { border: none; background: #f2f2f5; width: 34px; height: 34px; border-radius: 50%; }

/* ---------- Hero ---------- */
.hero-section {
  position: relative; padding: 100px 0 90px; overflow: hidden;
  background: radial-gradient(circle at 15% 20%, rgba(91,33,182,0.10), transparent 45%),
              radial-gradient(circle at 85% 15%, rgba(14,165,233,0.10), transparent 40%);
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(91,33,182,0.08); color: var(--brand-primary);
  border-radius: 30px; padding: 6px 16px; font-size: 0.82rem; font-weight: 600;
}
.hero-title { font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.1; margin: 20px 0; }
.hero-title .gradient-text {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-lead { font-size: 1.1rem; color: #5b5f6f; max-width: 560px; }
.hero-visual-card {
  border-radius: 24px; padding: 24px;
  background: rgba(255,255,255,0.55); backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.6);
  box-shadow: 0 40px 80px -30px rgba(31,36,48,0.25);
}
.hero-visual-card .glass-chip {
  background: rgba(255,255,255,0.7); border-radius: 14px; padding: 12px 16px;
  display: flex; align-items: center; gap: 12px; margin-bottom: 10px;
  border: 1px solid rgba(255,255,255,0.8);
}

/* ---------- Stats ---------- */
.stats-strip { padding: 50px 0; border-top: 1px solid #eee; border-bottom: 1px solid #eee; }
.stat-number { font-size: 2.4rem; font-weight: 800; font-family: var(--font-heading); color: var(--brand-primary); }
.stat-caption { color: #757a8a; font-size: 0.9rem; }

/* ---------- Section headings ---------- */
.section-eyebrow {
  color: var(--brand-secondary); font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; font-size: 0.78rem;
}
.section-title { font-size: clamp(1.7rem, 3.5vw, 2.4rem); margin: 10px 0 14px; }
.section-lead { color: #6a6f80; max-width: 640px; }

/* ---------- Feature / Interactive cards ---------- */
.feature-card {
  border-radius: 20px; padding: 28px; height: 100%;
  background: #fff; border: 1px solid #eef0f5;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.feature-card:hover { transform: translateY(-6px); box-shadow: 0 30px 50px -25px rgba(31,36,48,0.2); border-color: transparent; }
.feature-icon {
  width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  color: #fff; font-size: 1.4rem; margin-bottom: 18px;
}

/* ---------- Glass CTA band ---------- */
.cta-band {
  border-radius: 28px; padding: 60px 40px; text-align: center; position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--brand-primary), #312e81);
  color: #fff;
}
.cta-band::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 80% 20%, rgba(255,255,255,0.15), transparent 45%);
}

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 30px; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: #e5e7ef; }
.timeline-item { position: relative; padding-bottom: 34px; }
.timeline-dot {
  position: absolute; left: -30px; top: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary)); border: 3px solid #fff;
  box-shadow: 0 0 0 2px #e5e7ef;
}

/* ---------- Tabs ---------- */
.custom-tabs .nav-link {
  border: none; border-radius: 30px; padding: 8px 20px; font-weight: 600; color: #555; margin-right: 6px;
}
.custom-tabs .nav-link.active { background: var(--brand-primary); color: #fff; }

/* ---------- Logo carousel ---------- */
.logo-carousel-track { display: flex; gap: 60px; align-items: center; animation: scrollLogos 30s linear infinite; }
.logo-carousel-track img { height: 32px; filter: grayscale(1); opacity: 0.6; }
@keyframes scrollLogos { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.logo-carousel-wrap { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }

/* ---------- Testimonials ---------- */
.testimonial-card {
  border-radius: 20px; padding: 30px; background: #fff; border: 1px solid #eef0f5; height: 100%;
}
.testimonial-quote { font-size: 1.02rem; color: #333; }
.testimonial-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }

/* ---------- Accordion / FAQ ---------- */
.faq-accordion .accordion-button { font-weight: 600; border-radius: 14px !important; }
.faq-accordion .accordion-item { border: 1px solid #eef0f5; border-radius: 14px; margin-bottom: 12px; overflow: hidden; }
.faq-accordion .accordion-button:not(.collapsed) { background: rgba(91,33,182,0.06); color: var(--brand-primary); box-shadow: none; }

/* ---------- Pricing ---------- */
.pricing-card { border-radius: 22px; border: 1px solid #eef0f5; padding: 32px; height: 100%; background: #fff; }
.pricing-card.featured { border: 2px solid var(--brand-primary); position: relative; transform: scale(1.03); }
.pricing-price { font-size: 2.4rem; font-weight: 800; font-family: var(--font-heading); }

/* ---------- Footer ---------- */
.site-footer { background: var(--brand-dark-bg); color: #cfd2de; }
.footer-heading { color: #fff; font-size: 0.9rem; font-weight: 700; margin-bottom: 14px; }
.footer-muted { color: #9599ac; }
.footer-links a { color: #9599ac; text-decoration: none; display: block; margin-bottom: 10px; font-size: 0.88rem; }
.footer-links a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.08); }
.social-icon {
  width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,0.06);
  display: flex; align-items: center; justify-content: center; text-decoration: none; color: #cfd2de;
}
.newsletter-msg.success { color: #4ade80; }
.newsletter-msg.error { color: #f87171; }

.back-to-top {
  position: fixed; bottom: 24px; right: 24px; width: 44px; height: 44px; border-radius: 50%;
  background: var(--brand-primary); color: #fff; border: none; display: none; align-items: center; justify-content: center;
  z-index: 900; box-shadow: 0 10px 24px -8px rgba(0,0,0,0.35);
}
.back-to-top.show { display: flex; }

/* ---------- Dark mode ---------- */
[data-bs-theme="dark"] body { background: var(--brand-dark-bg); color: #e5e7f0; }
[data-bs-theme="dark"] .site-header { background: rgba(11,17,32,0.75); border-color: rgba(255,255,255,0.06); }
[data-bs-theme="dark"] .feature-card,
[data-bs-theme="dark"] .testimonial-card,
[data-bs-theme="dark"] .pricing-card,
[data-bs-theme="dark"] .mobile-nav-drawer { background: #131a2c; border-color: rgba(255,255,255,0.06); color: #e5e7f0; }
[data-bs-theme="dark"] .mega-menu { background: rgba(19,26,44,0.97); border-color: rgba(255,255,255,0.06); }
[data-bs-theme="dark"] .mega-menu-link-label { color: #e5e7f0; }
[data-bs-theme="dark"] .site-logo-text,
[data-bs-theme="dark"] .main-nav-item > a,
[data-bs-theme="dark"] .mobile-nav-link { color: #e5e7f0; }

/* ---------- Blog post body typography ---------- */
.blog-post-body { font-size: 1.05rem; line-height: 1.8; color: #333a45; }
.blog-post-body h2 { font-size: 1.5rem; margin-top: 2rem; margin-bottom: 1rem; }
.blog-post-body h3 { font-size: 1.25rem; margin-top: 1.6rem; margin-bottom: 0.8rem; }
.blog-post-body p { margin-bottom: 1.2rem; }
.blog-post-body img { max-width: 100%; border-radius: 14px; margin: 1.2rem 0; }
.blog-post-body blockquote {
  border-left: 4px solid var(--brand-primary); padding: 12px 20px; background: #f8f8fb;
  border-radius: 0 12px 12px 0; margin: 1.5rem 0; font-style: italic; color: #555;
}
.blog-post-body ul, .blog-post-body ol { margin-bottom: 1.2rem; padding-left: 1.4rem; }
.blog-post-body code { background: #f2f2f7; padding: 2px 6px; border-radius: 6px; font-size: 0.9em; }
.blog-post-body pre { background: #1e1e2e; color: #e5e7f0; padding: 16px; border-radius: 12px; overflow-x: auto; }

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
  .hero-section { padding: 70px 0 60px; text-align: center; }
  .hero-lead { margin-left: auto; margin-right: auto; }
}
