/* =============================================================================
   BUAMS AI new-ui — PUBLIC SITE SHELL (header, footer, section rhythm)
   Spec: /frontend_design.md §K

   Used by the marketing/public pages (home, and future landing surfaces).
   Shares every token and component with the auth pages — this file adds only
   the shell those pages do not need: a sticky site header, a mobile nav
   drawer, the footer, and the vertical rhythm between page sections.
   ============================================================================= */

/* ── Containers & section rhythm ──────────────────────────────────────────── */
.bui-container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--bui-space-6);
}

.bui-container-narrow {
  max-width: 820px;
}

.bui-section {
  padding-block: var(--bui-space-16);
}

.bui-section-tight {
  padding-block: var(--bui-space-12);
}

.bui-section-alt {
  background: var(--bui-surface-2);
  border-block: 1px solid var(--bui-line);
}

.bui-section-dark {
  background: linear-gradient(160deg, var(--bui-primary-900), var(--bui-primary-700));
  color: #fff;
}

@media (max-width: 767.98px) {
  .bui-container { padding-inline: var(--bui-space-4); }
  .bui-section { padding-block: var(--bui-space-12); }
  .bui-section-tight { padding-block: var(--bui-space-10); }
}

/* ── Section heading block ────────────────────────────────────────────────── */
.bui-section-head {
  max-width: 720px;
  margin-bottom: var(--bui-space-10);
}

.bui-section-head-center {
  margin-inline: auto;
  text-align: center;
}

.bui-section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--bui-space-2);
  margin-bottom: var(--bui-space-3);
  padding: var(--bui-space-1) var(--bui-space-3);
  background: var(--bui-primary-50);
  border: 1px solid var(--bui-primary-200);
  border-radius: var(--bui-radius-pill);
  font-size: var(--bui-text-overline);
  font-weight: var(--bui-fw-heavy);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--bui-primary-700);
}

.bui-section-dark .bui-section-eyebrow {
  background: rgba(255, 255, 255, .10);
  border-color: rgba(255, 255, 255, .20);
  color: #fff;
}

.bui-section-title {
  font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.125rem);
  line-height: var(--bui-lh-tight);
  font-weight: var(--bui-fw-heavy);
  letter-spacing: -.02em;
  color: var(--bui-ink-900);
}

.bui-section-dark .bui-section-title { color: #fff; }

.bui-section-lede {
  margin-top: var(--bui-space-4);
  font-size: 1.0625rem;
  line-height: var(--bui-lh-normal);
  color: var(--bui-ink-500);
}

.bui-section-dark .bui-section-lede { color: rgba(255, 255, 255, .78); }

/* =============================================================================
   SITE HEADER
   ============================================================================= */
.bui-site-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: var(--bui-surface);
  border-bottom: 1px solid transparent;
  transition: border-color var(--bui-transition), box-shadow var(--bui-transition);
}

/* Applied by site-nav.js once the page scrolls, so the header only gains a
   border/shadow when it is actually overlapping content. */
.bui-site-header.is-stuck {
  border-bottom-color: var(--bui-line);
  box-shadow: var(--bui-shadow-sm);
}

.bui-site-header-inner {
  display: flex;
  align-items: center;
  gap: var(--bui-space-6);
  min-height: 72px;
}

.bui-site-brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  gap: var(--bui-space-2);
}

/* The logo asset is a SQUARE lockup with the "BUAMS AI" wordmark inside the
   speech bubble, so shrinking it shrinks the wordmark too. 44px rendered the
   text illegibly; 52px is the largest that still sits comfortably in the 72px
   header. A proper horizontal lockup (or a bare-mark variant) would let the
   header brand read at any size — flagged as an asset request. */
.bui-site-brand img {
  height: 52px;
  width: auto;
}

@media (max-width: 991.98px) {
  .bui-site-brand img { height: 46px; }
}

/* ── Desktop nav ──────────────────────────────────────────────────────────── */
/* The <nav> is the flex item of .bui-site-header-inner, so the auto margin
   that pushes navigation + actions to the right has to live HERE. Putting it
   on the <ul> does nothing: a block-level flex container with width:auto
   already fills its parent, so the auto margin resolves to zero and the whole
   header packs to the left. */
.bui-site-nav-wrap {
  display: flex;
  align-items: center;
  min-width: 0;
  margin-left: auto;
}

.bui-site-nav {
  display: flex;
  align-items: center;
  gap: var(--bui-space-1);
  list-style: none;
  flex-wrap: nowrap;
}

.bui-nav-link {
  display: inline-flex;
  align-items: center;
  gap: var(--bui-space-1);
  padding: var(--bui-space-2) var(--bui-space-3);
  border: 0;
  background: none;
  border-radius: var(--bui-radius-md);
  font-size: var(--bui-text-sm);
  font-weight: var(--bui-fw-semibold);
  color: var(--bui-ink-700);
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--bui-transition), background-color var(--bui-transition);
}

.bui-nav-link:hover,
.bui-nav-link[aria-expanded='true'] {
  background: var(--bui-primary-50);
  color: var(--bui-primary-700);
  text-decoration: none;
}

.bui-nav-link:focus-visible {
  outline: 2px solid var(--bui-primary-700);
  outline-offset: 2px;
}

.bui-nav-link[aria-current='page'] {
  color: var(--bui-primary-700);
}

.bui-nav-caret {
  font-size: .75rem;
  transition: transform var(--bui-transition);
}

.bui-nav-link[aria-expanded='true'] .bui-nav-caret {
  transform: rotate(180deg);
}

/* ── Dropdown ─────────────────────────────────────────────────────────────── */
.bui-nav-item {
  position: relative;
}

.bui-nav-menu {
  position: absolute;
  top: calc(100% + var(--bui-space-2));
  /* Anchored to the trigger's RIGHT edge. The nav sits hard against the right
     of the header, so a left-anchored 268px menu on the last item ("Company")
     would open past the viewport edge and cause horizontal scroll. */
  right: 0;
  left: auto;
  z-index: 20;
  min-width: 268px;
  max-width: calc(100vw - var(--bui-space-8));
  padding: var(--bui-space-2);
  background: var(--bui-surface);
  border: 1px solid var(--bui-line);
  border-radius: var(--bui-radius-lg);
  box-shadow: var(--bui-shadow-lg);
  list-style: none;
}

.bui-nav-menu-item {
  display: flex;
  align-items: flex-start;
  gap: var(--bui-space-3);
  padding: var(--bui-space-3);
  border-radius: var(--bui-radius-md);
  color: var(--bui-ink-700);
  transition: background-color var(--bui-transition);
}

.bui-nav-menu-item:hover {
  background: var(--bui-primary-50);
  text-decoration: none;
}

.bui-nav-menu-item:focus-visible {
  outline: 2px solid var(--bui-primary-700);
  outline-offset: -2px;
}

.bui-nav-menu-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  background: var(--bui-primary-100);
  border-radius: var(--bui-radius-md);
  color: var(--bui-primary-700);
  font-size: 1rem;
}

.bui-nav-menu-title {
  display: block;
  font-size: var(--bui-text-sm);
  font-weight: var(--bui-fw-bold);
  color: var(--bui-ink-900);
}

.bui-nav-menu-sub {
  display: block;
  margin-top: 2px;
  font-size: var(--bui-text-xs);
  line-height: var(--bui-lh-snug);
  color: var(--bui-ink-500);
}

/* ── Header actions ───────────────────────────────────────────────────────── */
.bui-site-actions {
  display: flex;
  align-items: center;
  gap: var(--bui-space-2);
  flex-shrink: 0;
}

/* ── Mobile toggle + drawer ───────────────────────────────────────────────── */
.bui-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: var(--bui-touch-min);
  height: var(--bui-touch-min);
  margin-left: auto;
  padding: 0;
  background: none;
  border: 1px solid var(--bui-line);
  border-radius: var(--bui-radius-md);
  color: var(--bui-ink-900);
  font-size: 1.25rem;
  cursor: pointer;
}

.bui-nav-toggle:focus-visible {
  outline: 2px solid var(--bui-primary-700);
  outline-offset: 2px;
}

.bui-nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1040;
  background: rgba(15, 26, 21, .45);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--bui-transition);
}

.bui-nav-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.bui-nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1045;
  width: min(360px, 88vw);
  display: flex;
  flex-direction: column;
  padding: var(--bui-space-5);
  background: var(--bui-surface);
  box-shadow: var(--bui-shadow-lg);
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform var(--bui-transition-slow);
}

.bui-nav-drawer.is-open {
  transform: translateX(0);
}

.bui-nav-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--bui-space-3);
  margin-bottom: var(--bui-space-5);
  padding-bottom: var(--bui-space-4);
  border-bottom: 1px solid var(--bui-line);
}

.bui-drawer-group {
  margin-bottom: var(--bui-space-5);
}

.bui-drawer-group-title {
  margin-bottom: var(--bui-space-2);
  font-size: var(--bui-text-overline);
  font-weight: var(--bui-fw-heavy);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--bui-ink-500);
}

.bui-drawer-link {
  display: block;
  padding: var(--bui-space-3) var(--bui-space-2);
  border-radius: var(--bui-radius-md);
  font-size: var(--bui-text-body);
  font-weight: var(--bui-fw-semibold);
  color: var(--bui-ink-900);
  min-height: var(--bui-touch-min);
}

.bui-drawer-link:hover {
  background: var(--bui-primary-50);
  color: var(--bui-primary-700);
  text-decoration: none;
}

.bui-drawer-actions {
  display: flex;
  flex-direction: column;
  gap: var(--bui-space-3);
  margin-top: auto;
  padding-top: var(--bui-space-5);
  border-top: 1px solid var(--bui-line);
}

/* Lock background scroll while the drawer is open */
body.bui-nav-open {
  overflow: hidden;
}

/* Between the sidebar breakpoint and a comfortable desktop there is not much
   room for three dropdowns, a link and two CTAs. Tighten the spacing rather
   than let the header overflow its container. */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .bui-site-header-inner { gap: var(--bui-space-3); }
  .bui-nav-link { padding-inline: var(--bui-space-2); font-size: var(--bui-text-xs); }
  .bui-site-actions { gap: var(--bui-space-1); }
}

@media (max-width: 991.98px) {
  .bui-site-nav-wrap,
  .bui-site-actions {
    display: none;
  }

  .bui-nav-toggle {
    display: inline-flex;
  }

  .bui-site-header-inner {
    min-height: 64px;
  }
}

/* =============================================================================
   SITE FOOTER
   ============================================================================= */

/* ── Crisis notice ────────────────────────────────────────────────────────
   Stays ABOVE the footer and is deliberately high-contrast: this is safety
   information on a behavioural-health product, not decoration. */
.bui-crisis-notice {
  padding-block: var(--bui-space-4);
  background: var(--bui-warning-bg);
  border-top: 1px solid rgba(161, 98, 7, .28);
  border-bottom: 1px solid rgba(161, 98, 7, .28);
}

.bui-crisis-inner {
  display: flex;
  align-items: flex-start;
  gap: var(--bui-space-3);
  font-size: var(--bui-text-sm);
  line-height: var(--bui-lh-normal);
  color: #6E4305;
}

.bui-crisis-inner .bi {
  flex-shrink: 0;
  margin-top: 2px;
  font-size: 1.1rem;
  color: var(--bui-warning);
}

.bui-crisis-inner a {
  color: #6E4305;
  font-weight: var(--bui-fw-bold);
  text-decoration: underline;
}

.bui-site-footer {
  padding-top: var(--bui-space-16);
  background: var(--bui-primary-900);
  color: rgba(255, 255, 255, .72);
}

.bui-footer-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: var(--bui-space-10) var(--bui-space-8);
  padding-bottom: var(--bui-space-12);
}

.bui-footer-brand img {
  height: 52px;
  width: auto;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, .32));
}

.bui-footer-blurb {
  max-width: 320px;
  margin-top: var(--bui-space-4);
  font-size: var(--bui-text-sm);
  line-height: var(--bui-lh-normal);
  color: rgba(255, 255, 255, .66);
}

.bui-footer-contact {
  margin-top: var(--bui-space-5);
  display: flex;
  flex-direction: column;
  gap: var(--bui-space-2);
  list-style: none;
}

.bui-footer-contact li {
  display: flex;
  align-items: center;
  gap: var(--bui-space-2);
  font-size: var(--bui-text-sm);
}

.bui-footer-contact a { color: rgba(255, 255, 255, .84); }
.bui-footer-contact a:hover { color: #fff; }
.bui-footer-contact .bi { color: rgba(255, 255, 255, .5); }

.bui-footer-col-title {
  margin-bottom: var(--bui-space-4);
  font-size: var(--bui-text-overline);
  font-weight: var(--bui-fw-heavy);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .52);
}

.bui-footer-list {
  display: flex;
  flex-direction: column;
  gap: var(--bui-space-3);
  list-style: none;
}

.bui-footer-list a {
  font-size: var(--bui-text-sm);
  color: rgba(255, 255, 255, .74);
}

.bui-footer-list a:hover {
  color: #fff;
  text-decoration: none;
}

.bui-footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--bui-space-4);
  flex-wrap: wrap;
  padding-block: var(--bui-space-6);
  border-top: 1px solid rgba(255, 255, 255, .12);
  font-size: var(--bui-text-xs);
  color: rgba(255, 255, 255, .56);
}

.bui-footer-legal {
  display: flex;
  align-items: center;
  gap: var(--bui-space-5);
  flex-wrap: wrap;
  list-style: none;
}

.bui-footer-legal a { color: rgba(255, 255, 255, .72); }
.bui-footer-legal a:hover { color: #fff; }

@media (max-width: 991.98px) {
  .bui-footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .bui-footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 575.98px) {
  .bui-footer-grid {
    grid-template-columns: 1fr;
    gap: var(--bui-space-8);
  }
  .bui-footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ── Floating contact button ──────────────────────────────────────────────
   The legacy site had a WhatsApp button bottom-LEFT and a Product Hunt badge
   bottom-RIGHT, both fixed, both overlapping content on small screens. One
   button only, and it tucks away below sm so it never covers a form field. */
.bui-float-contact {
  position: fixed;
  right: var(--bui-space-5);
  bottom: var(--bui-space-5);
  z-index: 1035;
  display: inline-flex;
  align-items: center;
  gap: var(--bui-space-2);
  padding: var(--bui-space-3) var(--bui-space-5);
  background: #25D366;
  border-radius: var(--bui-radius-pill);
  box-shadow: 0 6px 20px rgba(37, 211, 102, .38);
  color: #fff;
  font-size: var(--bui-text-sm);
  font-weight: var(--bui-fw-semibold);
  transition: transform var(--bui-transition), box-shadow var(--bui-transition);
}

.bui-float-contact:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(37, 211, 102, .46);
  color: #fff;
  text-decoration: none;
}

.bui-float-contact .bi { font-size: 1.15rem; }

@media (max-width: 575.98px) {
  .bui-float-contact {
    right: var(--bui-space-4);
    bottom: var(--bui-space-4);
    padding: 0;
    width: var(--bui-space-12);
    height: var(--bui-space-12);
    justify-content: center;
  }
  .bui-float-contact span { display: none; }
}
