/* ============================================================
   SignalMatrix AI — Global stylesheet
   Reusable across every page: reset, layout primitives (container,
   section, eyebrow, h2, btn), the header/nav, the trust bar, and the
   footer. Load this on every page, after colors-and-type.css and
   before the page's own stylesheet.

   Anything page-specific (hero, stat cards, FAQ, forms, etc.) does NOT
   belong here — it lives in that page's own <page>/style.css instead,
   so this file stays safe to share unmodified across the whole site.
   ============================================================ */

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

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--navy-900);
  color: var(--fg);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body { overflow-x: hidden; }

h1, h2, h3, h4, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a {
  color: var(--pillar-crm);
  text-decoration: none;
}

input, select, textarea, button { font-family: inherit; }
select option { background: var(--navy-800); color: var(--fg); }

.icon { width: 16px; height: 16px; display: block; }
.icon--sm { width: 14px; height: 14px; }
.icon--lg { width: 22px; height: 22px; }
.icon--chevron { width: 14px; height: 14px; }
.icon--check { width: 18px; height: 18px; flex: none; margin-top: 2px; }

.text-green { color: var(--brand-green); }

/* ---------------------------------------------------------------
   LAYOUT PRIMITIVES
   --------------------------------------------------------------- */

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 64px);
}
.container--narrow { max-width: 980px; }
.container--banner { max-width: 900px; }

.section { padding: clamp(56px, 9vw, 96px) 0; }
.section--alt {
  background: #0C1222;
  border-top: 1px solid var(--stroke-3);
  border-bottom: 1px solid var(--stroke-3);
}

.eyebrow {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  align-items: flex-start;
  margin-bottom: var(--space-xl);
}
.eyebrow__label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pillar-crm);
}
.eyebrow__rule {
  display: block;
  width: 48px;
  height: 2px;
  background: var(--pillar-crm);
}

.h2 {
  font-family: var(--font-display);
  font-size: 44px;
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--fg);
  text-wrap: balance;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  border-radius: var(--radius-md);
  font-size: var(--t-button-size);
  font-weight: 600;
  transition: all var(--dur-base) var(--ease-out);
  text-decoration: none;
  cursor: pointer;
  border: 0;
  white-space: nowrap;
}
.btn--primary {
  background: var(--brand-green);
  color: #001F11;
  padding: 12px 18px;
}
.btn--primary:hover {
  filter: brightness(1.10);
  transform: translateY(-2px);
  color: #001F11;
}
.btn--secondary {
  background: transparent;
  border: 1.5px solid var(--pillar-crm);
  color: var(--pillar-crm);
  padding: 16px 24px;
}
.btn--secondary:hover { background: var(--pillar-crm-tint); }
.btn--lg { padding: 16px 24px; font-size: 15px; }
.btn--nav { padding: 12px 18px; }

/* ---------------------------------------------------------------
   NAV
   --------------------------------------------------------------- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 15, 30, 0.82);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--stroke-3);
}
.site-nav__inner {
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  height: 72px;
}
.site-nav__logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.025em;
  color: var(--fg);
  white-space: nowrap;
}
.site-nav__panel {
  display: flex;
  align-items: center;
  gap: var(--space-2xl);
  margin-left: auto;
}
.site-nav__links {
  display: flex;
  gap: var(--space-xl);
  justify-content: flex-end;
  align-items: center;
}
.site-nav__link {
  font-size: var(--t-nav-size);
  font-weight: var(--t-nav-weight);
  color: rgba(255, 255, 255, 0.85);
}
.site-nav__link:hover { color: var(--fg); }

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: none;
  background: none;
  border: 0;
  border-radius: var(--radius-md);
  color: var(--fg);
  cursor: pointer;
}
.nav-toggle:hover { background: var(--navy-800); }
.nav-toggle__icon { width: 22px; height: 22px; }
.nav-toggle__bar {
  transform-origin: center;
  transition: transform var(--dur-base) var(--ease-out), opacity var(--dur-base) var(--ease-out);
}
.nav-toggle.is-open .nav-toggle__bar--top { transform: translateY(6px) rotate(45deg); }
.nav-toggle.is-open .nav-toggle__bar--mid { opacity: 0; }
.nav-toggle.is-open .nav-toggle__bar--bot { transform: translateY(-6px) rotate(-45deg); }

.sm-nav-dd {
  position: relative;
  display: flex;
  align-items: center;
}
/* Override page-specific legacy nav CSS that uses .nav-dropdown class */
.site-nav .sm-nav-dd { visibility: visible; opacity: 1; pointer-events: auto; transform: none; }
.nav-dropdown__trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 0;
  padding: 0;
  font-size: var(--t-nav-size);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
}
.nav-dropdown__trigger:hover { color: var(--fg); }
.nav-dropdown__trigger--active {
  font-weight: 600;
  color: var(--pillar-crm);
}

/* Mega menu — opens toward the bottom-right, anchored to its own
   trigger's left edge. Verified to fit within the viewport from 1025px
   up at the current column count/width; re-check with mega-check2.js in
   the scratchpad tooling if columns are added. Visibility is driven by
   JS (.is-open, with a hover-intent close delay — see global.js) rather
   than a plain :hover selector: a far column can sit well away from the
   trigger, and :hover drops the instant the pointer leaves the box
   mid-transit, which a delay absorbs but an instant CSS hide can't.
   :focus-within stays CSS-only since keyboard focus has no such gap. */
.mega-menu {
  position: absolute;
  top: 100%;
  left: -20px;
  display: none;
  align-items: flex-start;
  gap: 22px;
  padding: 20px;
  background: var(--navy-800);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.45), 0 0 32px rgba(167, 139, 250, 0.10);
  z-index: 10;
  max-width: calc(100vw - 40px);
}
.sm-nav-dd.is-open .mega-menu,
.sm-nav-dd:focus-within .mega-menu {
  display: flex;
}
.mega-menu__column {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 140px;
}
.mega-menu__heading {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}
.mega-menu__heading:hover { color: var(--fg); }
.mega-menu__heading--active { color: var(--pillar-crm); }
.mega-menu__sublinks {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 4px;
}
.mega-menu__sublink {
  padding: 7px 10px;
  border-radius: var(--radius-md);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
}
.mega-menu__sublink:hover {
  background: var(--navy-700);
  color: var(--fg);
}
.mega-menu__sublink--active {
  font-weight: 600;
  color: var(--fg);
  background: var(--pillar-crm-tint);
}

/* ---------------------------------------------------------------
   TRUST BAR
   --------------------------------------------------------------- */

.trust-bar {
  border-top: 1px solid var(--stroke-3);
  border-bottom: 1px solid var(--stroke-3);
}
.trust-bar__inner {
  padding: 22px clamp(20px, 5vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.trust-bar__item {
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-mute);
}
.trust-bar__dot {
  width: 5px;
  height: 5px;
  border-radius: 99px;
  background: var(--pillar-crm);
  flex: none;
}

/* ---------------------------------------------------------------
   FOOTER
   --------------------------------------------------------------- */

.site-footer {
  background: var(--navy-900);
  border-top: 1px solid var(--stroke-3);
  padding: clamp(40px, 7vw, 64px) 0 32px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 0.8fr 0.95fr 0.8fr 1.1fr;
  gap: 40px;
}
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}
.footer-brand__logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.025em;
  color: var(--fg);
  align-self: flex-start;
}
.footer-brand__tagline {
  font-size: 13px;
  line-height: 1.6;
  color: var(--fg-mute);
  max-width: 320px;
}
.footer-brand__contacts {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: var(--space-sm);
}
.footer-brand__contacts a {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--fg-mute);
}
.footer-brand__contacts a:hover { color: var(--brand-green); }

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.footer-col__title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-green);
}
.footer-col a {
  font-size: 13px;
  color: var(--fg);
}
.footer-col a:hover { color: var(--brand-green); }
.footer-col__link--active {
  font-size: 13px;
  font-weight: 600;
  color: var(--pillar-crm) !important;
}

.footer-cta {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: flex-start;
}
.footer-cta__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--fg);
}
.footer-cta__desc {
  font-size: 13px;
  line-height: 1.6;
  color: var(--fg-mute);
}
.footer-cta__button {
  justify-content: space-between;
  width: 100%;
  padding: 16px 20px;
  font-size: 14px;
}
.footer-social {
  display: flex;
  gap: 10px;
  padding-top: var(--space-sm);
}
.footer-social a {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--navy-700);
  border: 1px solid var(--stroke-1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-mute);
}
.footer-social a:hover {
  border-color: var(--brand-green);
  color: var(--brand-green);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2xl);
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--stroke-3);
}
.footer-badges { display: flex; gap: var(--space-md); }
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 9px 16px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
}
.badge-pill .icon { color: var(--brand-green); }
.footer-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-sm);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--fg-dim);
}
.footer-legal a { color: var(--fg-dim); }
.footer-legal a:hover { color: var(--brand-green); }

/* ---------------------------------------------------------------
   RESPONSIVE / MOBILE — nav, trust bar, footer only.
   Page-specific responsive rules (hero, grids, forms, etc.) live in
   that page's own style.css, in matching @media blocks.
   --------------------------------------------------------------- */

@media (max-width: 1024px) {
  .nav-toggle { display: inline-flex; }

  .site-nav__panel {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-lg);
    margin-left: 0;
    background: var(--navy-900);
    border-bottom: 1px solid var(--stroke-3);
    padding: var(--space-xl) clamp(20px, 5vw, 64px) var(--space-2xl);
    max-height: calc(100vh - 72px);
    overflow-y: auto;
  }
  .site-nav.is-open .site-nav__panel { display: flex; }

  .site-nav__links {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 2px;
  }
  .site-nav__link { padding: 12px 0; }

  .sm-nav-dd {
    flex-direction: column;
    align-items: stretch;
    padding-bottom: 0;
    margin-bottom: 0;
  }
  .nav-dropdown__trigger {
    width: 100%;
    justify-content: space-between;
    padding: 12px 0;
  }
  .mega-menu {
    position: static;
    display: none;
    flex-direction: column;
    gap: var(--space-lg);
    width: 100%;
    max-width: none;
    box-shadow: none;
    background: none;
    border: 0;
    padding: var(--space-sm) 0 var(--space-sm) var(--space-md);
    margin-top: 4px;
  }
  .sm-nav-dd.is-open .mega-menu { display: flex; }
  .mega-menu__column { min-width: 0; }

  .btn--nav { width: 100%; justify-content: center; margin-top: var(--space-sm); }

  .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 32px; }
  .footer-cta { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: var(--space-lg); }
  .footer-legal { justify-content: flex-start; }

  .trust-bar__inner {
    flex-wrap: wrap;
    justify-content: center;
    white-space: normal;
    text-align: center;
    row-gap: 10px;
  }

  .site-nav__logo { font-size: 17px; }
}
