/* ═══ COLOR FLOW MAP (from design-spec.sections[].bg_context) ═══
 * index.html:
 *   nav        → transparent-on-dark (scrolled: solid #0A1628)
 *   hero       → DARK  (#0A1628)      | text: #EDF2F7 white
 *   logo-strip → DARK  (#0A1628)      | text: #EDF2F7
 *   problem    → DARK  (#0A1628)      | text: #EDF2F7
 *   how-it-works-overview → DARK_ALT (#0E1E38) | text: #EDF2F7
 *   features-grid → DARK (#0A1628)   | text: #EDF2F7
 *   metric-demo → code (#071020)      | text: #EDF2F7
 *   testimonials → DARK (#0A1628)     | text: #EDF2F7
 *   pricing-teaser → DARK_ALT (#0E1E38) | text: #EDF2F7
 *   final-cta  → DARK  (#0A1628)      | text: #EDF2F7
 *   footer     → DARK  (#071020)      | text: #90A4AE
 *
 * pricing.html:
 *   nav        → transparent-on-LIGHT → must force solid (light-top)
 *   hero       → LIGHT (#F7F9FC)      | text: #0A1628
 *   pricing-tiers → WHITE (#FFFFFF)   | text: #0A1628
 *   pricing-faq → LIGHT (#F7F9FC)     | text: #0A1628
 *   footer     → DARK  (#071020)      | text: #90A4AE
 *
 * blog/*, docs/*, legal/*, contact.html:
 *   nav        → transparent-on-LIGHT → must force solid (light-top)
 *   hero / header → LIGHT             | text: #0A1628
 *   content    → WHITE / LIGHT alternating | text: #0A1628
 *   footer     → DARK  (#071020)      | text: #90A4AE
 *
 * login/*.html:
 *   nav        → transparent-on-dark (scrolled: solid #0A1628)
 *   panel      → DARK  (#0A1628)      | text: #EDF2F7
 *   footer     → DARK  (#071020)      | text: #90A4AE
 *
 * NOTE: Adjacent dark→dark sections need border-top: 1px solid #1E3352 as separator
 * ═══════════════════════════════════════════════════════════════ */

/* ─── RESET & BASE ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  color: #EDF2F7;
  background: #0A1628;
}

body.kbs-page--light-top {
  background: #F7F9FC;
  color: #0A1628;
}

/* ─── CSS CUSTOM PROPERTIES ────────────────────────────────────── */
:root {
  --kbs-navy:          #0A1628;
  --kbs-navy-alt:      #0E1E38;
  --kbs-navy-card:     #122035;
  --kbs-navy-border:   #1E3352;
  --kbs-code-bg:       #071020;
  --kbs-teal:          #00C9A7;
  --kbs-teal-aa:       #007D67;
  --kbs-red:           #F43F5E;
  --kbs-amber:         #F59E0B;
  --kbs-green:         #10B981;
  --kbs-fg-dark-1:     #EDF2F7;
  --kbs-fg-dark-2:     #90A4AE;
  --kbs-fg-dark-3:     #607080;
  --kbs-fg-light-1:    #0A1628;
  --kbs-fg-light-2:    #4A5568;
  --kbs-bg-light:      #F7F9FC;
  --kbs-bg-white:      #FFFFFF;
  --kbs-section-pad:   96px;
  --kbs-section-pad-m: 64px;
  --kbs-container:     1200px;
  --kbs-radius-card:   8px;
  --kbs-radius-btn:    6px;
  --kbs-radius-code:   4px;
}

/* ─── TYPOGRAPHY ───────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Inter', system-ui, sans-serif;
  line-height: 1.15;
  font-weight: 700;
}

.kbs-page--dark-top h1,
.kbs-page--dark-top h2,
.kbs-page--dark-top h3 { color: var(--kbs-fg-dark-1); }

.kbs-page--light-top h1,
.kbs-page--light-top h2,
.kbs-page--light-top h3 { color: var(--kbs-fg-light-1); }

/* Context-scoped text colors — bound to container, not page-theme */
.kbs-section--dark h1,
.kbs-section--dark h2,
.kbs-section--dark h3,
.kbs-section--dark p { color: var(--kbs-fg-dark-1); }

.kbs-section--dark-alt h1,
.kbs-section--dark-alt h2,
.kbs-section--dark-alt h3,
.kbs-section--dark-alt p { color: var(--kbs-fg-dark-1); }

.kbs-section--light h1,
.kbs-section--light h2,
.kbs-section--light h3 { color: var(--kbs-fg-light-1); }
.kbs-section--light p { color: var(--kbs-fg-light-2); }

.kbs-section--white h1,
.kbs-section--white h2,
.kbs-section--white h3 { color: var(--kbs-fg-light-1); }
.kbs-section--white p { color: var(--kbs-fg-light-2); }

a { color: var(--kbs-teal); text-decoration: none; }
a:hover { text-decoration: underline; }

/* scoped link colors */
.kbs-section--dark a,
.kbs-section--dark-alt a { color: var(--kbs-teal); }
.kbs-section--light a,
.kbs-section--white a { color: var(--kbs-teal-aa); }

code, pre, .mono {
  font-family: 'JetBrains Mono', 'Fira Code', Consolas, 'Courier New', monospace;
  font-size: 0.875rem;
}

/* ─── LAYOUT UTILITIES ─────────────────────────────────────────── */
.kbs-container {
  max-width: var(--kbs-container);
  margin: 0 auto;
  padding: 0 24px;
}

.kbs-section {
  padding: var(--kbs-section-pad) 0;
}

.kbs-section--dark {
  background: var(--kbs-navy);
  border-top: 1px solid var(--kbs-navy-border);
}

.kbs-section--dark-alt {
  background: var(--kbs-navy-alt);
  border-top: 1px solid var(--kbs-navy-border);
}

.kbs-section--light {
  background: var(--kbs-bg-light);
}

.kbs-section--white {
  background: var(--kbs-bg-white);
}

.kbs-section--code {
  background: var(--kbs-code-bg);
}

.kbs-section__label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.kbs-section--dark .kbs-section__label,
.kbs-section--dark-alt .kbs-section__label { color: var(--kbs-teal); }
.kbs-section--light .kbs-section__label,
.kbs-section--white .kbs-section__label { color: var(--kbs-teal-aa); }
.kbs-section--code .kbs-section__label { color: var(--kbs-teal); }

.kbs-section__headline {
  font-size: clamp(1.75rem, 3vw, 2.75rem);
  font-weight: 700;
  margin-bottom: 16px;
}

.kbs-section__subhead {
  font-size: 1.125rem;
  line-height: 1.65;
  max-width: 680px;
}

.kbs-section--dark .kbs-section__subhead,
.kbs-section--dark-alt .kbs-section__subhead { color: var(--kbs-fg-dark-2); }
.kbs-section--light .kbs-section__subhead,
.kbs-section--white .kbs-section__subhead { color: var(--kbs-fg-light-2); }

/* ─── BUTTONS ───────────────────────────────────────────────────── */
.kbs-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--kbs-radius-btn);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  text-decoration: none;
  border: 2px solid transparent;
  line-height: 1;
  white-space: nowrap;
}

.kbs-btn--primary {
  background: var(--kbs-teal);
  color: #0A1628;
  border-color: var(--kbs-teal);
}
.kbs-btn--primary:hover {
  background: #00b396;
  border-color: #00b396;
  color: #0A1628;
  text-decoration: none;
}

.kbs-btn--outline-dark {
  background: transparent;
  color: var(--kbs-fg-dark-1);
  border-color: rgba(237, 242, 247, 0.35);
}
.kbs-btn--outline-dark:hover {
  border-color: var(--kbs-fg-dark-1);
  color: var(--kbs-fg-dark-1);
  text-decoration: none;
}

.kbs-btn--outline-light {
  background: transparent;
  color: var(--kbs-fg-light-1);
  border-color: #CBD5E0;
}
.kbs-btn--outline-light:hover {
  border-color: var(--kbs-fg-light-1);
  color: var(--kbs-fg-light-1);
  text-decoration: none;
}

.kbs-btn--ghost-dark {
  background: transparent;
  color: var(--kbs-fg-dark-2);
  border-color: transparent;
}
.kbs-btn--ghost-dark:hover {
  color: var(--kbs-fg-dark-1);
  background: rgba(255,255,255,0.06);
  text-decoration: none;
}

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

/* ─── CARD BASE ─────────────────────────────────────────────────── */
.kbs-card {
  background: var(--kbs-navy-card);
  border: 1px solid var(--kbs-navy-border);
  border-radius: var(--kbs-radius-card);
  padding: 28px;
}

.kbs-card--light {
  background: var(--kbs-bg-white);
  border: 1px solid #E2E8F0;
  border-radius: var(--kbs-radius-card);
  padding: 28px;
}

.kbs-card .kbs-card__icon {
  color: var(--kbs-teal);
  font-size: 1.5rem;
  margin-bottom: 16px;
}

.kbs-card--light .kbs-card__icon { color: var(--kbs-teal-aa); }

.kbs-card h3 { color: var(--kbs-fg-dark-1); font-size: 1.125rem; margin-bottom: 10px; }
.kbs-card p { color: var(--kbs-fg-dark-2); font-size: 0.9375rem; line-height: 1.65; }

.kbs-card--light h3 { color: var(--kbs-fg-light-1); }
.kbs-card--light p { color: var(--kbs-fg-light-2); }

/* ─── PAGE HERO SLIM (subpages) ─────────────────────────────────── */
.kbs-page-hero {
  padding: 120px 0 80px;
}

.kbs-section--dark.kbs-page-hero {
  background: var(--kbs-navy);
  border-top: none;
}

.kbs-page-hero__inner {
  max-width: var(--kbs-container);
  margin: 0 auto;
  padding: 0 24px;
}

.kbs-page-hero__eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 16px;
  display: block;
}

.kbs-section--dark .kbs-page-hero__eyebrow { color: var(--kbs-teal); }
.kbs-section--light .kbs-page-hero__eyebrow { color: var(--kbs-teal-aa); }

.kbs-page-hero h1 {
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 20px;
}

.kbs-section--dark .kbs-page-hero h1 { color: var(--kbs-fg-dark-1); }
.kbs-section--light .kbs-page-hero h1 { color: var(--kbs-fg-light-1); }

.kbs-page-hero__subhead {
  font-size: 1.125rem;
  line-height: 1.65;
  max-width: 640px;
}

.kbs-section--dark .kbs-page-hero__subhead { color: var(--kbs-fg-dark-2); }
.kbs-section--light .kbs-page-hero__subhead { color: var(--kbs-fg-light-2); }

/* ─── BREADCRUMB ─────────────────────────────────────────────────── */
.kbs-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  margin-bottom: 20px;
}
.kbs-breadcrumb a { color: var(--kbs-fg-dark-2); }
.kbs-breadcrumb a:hover { color: var(--kbs-teal); }
.kbs-breadcrumb span { color: var(--kbs-fg-dark-3); }

.kbs-section--light .kbs-breadcrumb a { color: var(--kbs-fg-light-2); }
.kbs-section--light .kbs-breadcrumb a:hover { color: var(--kbs-teal-aa); }
.kbs-section--light .kbs-breadcrumb span { color: #A0AEC0; }

/* ─── LOGO SVG helpers ──────────────────────────────────────────── */
.kbs-nav__logo img {
  height: 32px;
  width: auto;
  max-width: 200px;
  display: block;
}

/* ─── FOOTER ────────────────────────────────────────────────────── */
.kbs-footer {
  background: var(--kbs-code-bg);
  border-top: 1px solid var(--kbs-navy-border);
  padding: 72px 0 40px;
}

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

.kbs-footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 64px;
}

.kbs-footer__brand p {
  color: var(--kbs-fg-dark-3);
  font-size: 0.875rem;
  line-height: 1.6;
  margin-top: 16px;
  max-width: 280px;
}

.kbs-footer__col h4 {
  color: var(--kbs-fg-dark-1);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.kbs-footer__col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kbs-footer__col ul li a {
  color: var(--kbs-fg-dark-2);
  font-size: 0.875rem;
  text-decoration: none;
  transition: color 0.15s;
}

.kbs-footer__col ul li a:hover { color: var(--kbs-teal); text-decoration: none; }

.kbs-footer__bottom {
  border-top: 1px solid var(--kbs-navy-border);
  padding-top: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.kbs-footer__copy {
  color: var(--kbs-fg-dark-3);
  font-size: 0.8125rem;
}

.kbs-footer__social {
  display: flex;
  gap: 16px;
}

.kbs-footer__social a {
  color: var(--kbs-fg-dark-3);
  font-size: 1rem;
  transition: color 0.15s;
  text-decoration: none;
}

.kbs-footer__social a:hover { color: var(--kbs-teal); }

.kbs-footer__legal-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.kbs-footer__legal-links a {
  color: var(--kbs-fg-dark-3);
  font-size: 0.8125rem;
  text-decoration: none;
}

.kbs-footer__legal-links a:hover { color: var(--kbs-fg-dark-2); }

/* ─── COOKIE BANNER ─────────────────────────────────────────────── */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--kbs-navy-alt);
  border-top: 1px solid var(--kbs-navy-border);
  padding: 16px 24px;
}

.cookie-banner__inner {
  max-width: var(--kbs-container);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.cookie-banner__text {
  flex: 1;
  font-size: 0.875rem;
  color: var(--kbs-fg-dark-2);
}

.cookie-banner__text a { color: var(--kbs-teal); }

.cookie-banner__btn--primary {
  padding: 8px 20px;
  background: var(--kbs-teal);
  color: var(--kbs-navy);
  border: none;
  border-radius: var(--kbs-radius-btn);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  white-space: nowrap;
}

.cookie-banner__btn--primary:hover { background: #00b396; }

/* ─── FADE-IN ANIMATION (with failsafe) ─────────────────────────── */
.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: none;
}

/* ─── RESPONSIVE ─────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .kbs-footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

@media (max-width: 768px) {
  :root {
    --kbs-section-pad: 64px;
  }

  .kbs-grid-2 { grid-template-columns: 1fr; }
  .kbs-grid-3 { grid-template-columns: 1fr; }
  .kbs-grid-4 { grid-template-columns: repeat(2, 1fr); }

  .kbs-footer__grid { grid-template-columns: 1fr; gap: 32px; }
  .kbs-footer__bottom { flex-direction: column; align-items: flex-start; }

  .kbs-page-hero { padding: 100px 0 56px; }
}

@media (max-width: 480px) {
  .kbs-grid-4 { grid-template-columns: 1fr; }
}
