/* =====================================================
   Statify Lab — Global CSS (assets/css/global.css)
   Supplements styles.css with header/footer/nav styles
   Last Updated: 2026-06-28
===================================================== */

/* =====================================================
   LOGO
===================================================== */
.logo-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.site-logo {
  height: 36px;
  width: auto;
  display: block;
  object-fit: contain;
  transition: opacity 0.2s;
}

.site-logo:hover {
  opacity: 0.85;
}

/* =====================================================
   TOPBAR / HEADER
===================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 200;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--surface, #fff) 88%, transparent);
  border-bottom: 1px solid var(--border, #e5e7eb);
  transition: background 0.3s;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  min-height: 64px;
}

/* =====================================================
   NAV LIST
===================================================== */
.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 13px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted, #6b7280);
  text-decoration: none;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
  font-family: inherit;
  white-space: nowrap;
  pointer-events: auto;
  user-select: none;
}

.nav-link:hover {
  color: var(--text, #111827);
  background: rgba(124, 58, 237, 0.07);
}

.nav-link--active {
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.09);
  font-weight: 600;
}

/* =====================================================
   DROPDOWN NAV
===================================================== */
.nav-dropdown {
  position: relative;
  display: inline-block;
}

.nav-dropdown-btn {
  user-select: none;
  pointer-events: auto;
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 220px;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  z-index: 300;
  list-style: none;
  padding: 8px;
  margin: 0;
  animation: dropIn 0.18s ease;
  pointer-events: auto;
}

.nav-dropdown-menu.open {
  display: block;
  pointer-events: auto;
}

@keyframes dropIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.nav-dropdown-link {
  display: block;
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text, #374151);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.nav-dropdown-link:hover {
  background: rgba(124, 58, 237, 0.08);
  color: #7c3aed;
}

/* =====================================================
   NAV (DESKTOP)
===================================================== */
.nav {
  display: flex;
  flex: 1;
  justify-content: center;
}

@media (max-width: 900px) {
  .nav {
    display: none;
  }

  .nav.open {
    display: block;
  }
}

/* =====================================================
   TOPBAR ACTIONS
===================================================== */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border, #e5e7eb);
  background: transparent;
  color: var(--muted, #6b7280);
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
  pointer-events: auto;
  user-select: none;
}

.btn-icon:hover {
  border-color: #7c3aed;
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.06);
}

.btn-sm {
  font-size: 0.83rem;
  padding: 8px 16px;
  border-radius: 8px;
}

/* Mobile hamburger */
.mobile-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--border, #e5e7eb);
  background: transparent;
  color: var(--text, #374151);
  cursor: pointer;
  padding: 0;
  transition: all 0.2s;
}

.mobile-hamburger:hover {
  border-color: #7c3aed;
  color: #7c3aed;
}

/* =====================================================
   FOOTER
===================================================== */
.site-footer {
  background: var(--surface, #fff);
  border-top: 1px solid var(--border, #e5e7eb);
  padding: 56px 0 0;
  margin-top: 60px;
}

.footer-top {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 48px;
  padding-bottom: 48px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.footer-logo-link {
  display: inline-block;
}

.footer-logo {
  height: 34px;
  width: auto;
  display: block;
  object-fit: contain;
  transition: opacity 0.2s;
}

.footer-logo:hover {
  opacity: 0.8;
}

.footer-tagline {
  color: var(--muted, #6b7280);
  font-size: 0.875rem;
  line-height: 1.65;
  margin: 0;
  max-width: 240px;
}

.footer-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(124, 58, 237, 0.08);
  border: 1px solid rgba(124, 58, 237, 0.18);
  color: #7c3aed;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.footer-copy {
  color: var(--muted, #9ca3af);
  font-size: 0.78rem;
  margin: 4px 0 0;
}

/* Footer nav grid */
.footer-nav-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.footer-col-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted, #6b7280);
  margin: 0 0 16px;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.footer-link {
  font-size: 0.875rem;
  color: var(--text, #374151);
  text-decoration: none;
  opacity: 0.75;
  transition: color 0.2s, opacity 0.2s;
}

.footer-link:hover {
  color: #7c3aed;
  opacity: 1;
}

.footer-link--active {
  color: #7c3aed;
  opacity: 1;
  font-weight: 600;
}

/* Footer bottom bar */
.footer-bottom {
  border-top: 1px solid var(--border, #f3f4f6);
  padding: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-bottom-text {
  color: var(--muted, #9ca3af);
  font-size: 0.78rem;
  margin: 0;
  line-height: 1.5;
}

.footer-legal-links {
  display: flex;
  gap: 18px;
  flex-shrink: 0;
}

.footer-legal-link {
  font-size: 0.78rem;
  color: var(--muted, #9ca3af);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-legal-link:hover {
  color: #7c3aed;
}

/* =====================================================
   RESPONSIVE
===================================================== */
@media (max-width: 900px) {
  .mobile-hamburger {
    display: inline-flex;
  }

  .nav {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--surface, #fff);
    border-bottom: 1px solid var(--border, #e5e7eb);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    z-index: 199;
    padding: 12px 16px 20px;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
  }

  .nav-link {
    width: 100%;
    justify-content: flex-start;
    padding: 10px 14px;
  }

  .nav-dropdown-menu {
    display: none;
    position: static;
    transform: none;
    box-shadow: none;
    border: none;
    border-radius: 0;
    padding: 4px 0 4px 16px;
    background: transparent;
  }

  .nav-dropdown-menu.open {
    display: block;
  }

  .topbar-actions .btn-sm {
    display: none;
  }
}

@media (max-width: 768px) {
  .footer-top {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-nav-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  .footer-tagline {
    max-width: 100%;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

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

  .topbar-inner {
    gap: 10px;
  }
}

/* =====================================================
   DARK MODE ADJUSTMENTS
===================================================== */
body.dark .nav-dropdown-menu {
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
}

body.dark .nav {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}