/* ============================================================
   FACTLINE — Shared Components
   Header, Footer, Buttons, Modal, Cards
   ============================================================ */

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 56px;
  padding: 0 32px;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-weight: 600;
  font-size: 16px;
  line-height: 1;
  transition: transform 220ms ease, box-shadow 220ms ease, background 220ms ease, color 220ms ease, border-color 220ms ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient-accent);
  color: #FFFFFF;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: var(--bg-white);
  color: var(--purple-600);
  border: 1.5px solid var(--purple-300);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  border-color: var(--purple-600);
  box-shadow: var(--shadow-md);
}

.btn-ghost {
  background: transparent;
  color: var(--purple-600);
  border: 1.5px solid var(--purple-600);
  height: 40px;
  padding: 0 18px;
  font-size: 14px;
}

.btn-ghost:hover {
  background: var(--purple-50);
}

.btn-light {
  background: var(--bg-white);
  color: var(--purple-700);
  height: 56px;
  padding: 0 40px;
  box-shadow: var(--shadow-md);
}

.btn-light:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(15, 15, 20, 0.18);
}

.btn .btn-arrow {
  width: 18px;
  height: 18px;
  transition: transform 220ms ease;
}

.btn:hover .btn-arrow {
  transform: translateX(3px);
}

/* =========================================================
   Header
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.85);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  transition: box-shadow 220ms ease, background 220ms ease;
}

.site-header.is-scrolled {
  box-shadow: var(--shadow-sm);
  background: rgba(255, 255, 255, 0.92);
}

.site-header .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.01em;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  user-select: none;
  display: inline-flex;
  align-items: center;
}

/* When the logo wraps an <img>, the gradient-text styling above is harmless
   (no text node) and the image renders normally. The container uses
   inline-flex so its height matches the image and no baseline whitespace
   pushes the image down. */
.brand-logo img {
  display: block;
  height: 28px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
}

.footer-brand .brand-logo img { height: 34px; max-width: 220px; }

.nav-mobile-head .brand-logo img { height: 28px; }

.modal-logo img {
  display: block;
  height: 36px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
}

.nav-primary {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-primary a:not(.btn-ghost) {
  font-weight: 500;
  font-size: 15px;
  color: var(--text-primary);
  transition: color 180ms ease;
  position: relative;
}

.nav-primary a:not(.btn-ghost):hover {
  color: var(--purple-600);
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}

.nav-toggle:hover {
  background: var(--bg-card);
}

.nav-toggle-bar {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--text-primary);
  position: relative;
}

.nav-toggle-bar::before,
.nav-toggle-bar::after {
  content: '';
  position: absolute;
  left: 0;
  width: 20px;
  height: 1.5px;
  background: var(--text-primary);
  transition: transform 220ms ease, top 220ms ease;
}

.nav-toggle-bar::before { top: -6px; }
.nav-toggle-bar::after  { top: 6px; }

/* Mobile menu overlay */
.nav-mobile {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.98);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  z-index: 200;
  display: none;
  flex-direction: column;
  padding: 24px;
  opacity: 0;
  transition: opacity 220ms ease;
}

.nav-mobile.is-open {
  display: flex;
  opacity: 1;
}

.nav-mobile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

.nav-mobile-close {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}

.nav-mobile-close:hover { background: var(--bg-card); }

.nav-mobile-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}

.nav-mobile-list a {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  padding: 16px 0;
  border-bottom: 1px solid var(--border-light);
}

.nav-mobile-list a:last-child {
  border-bottom: none;
}

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  background: #0F0F14;
  color: #FFFFFF;
  padding: 64px 0;
  margin-top: 120px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 2fr;
  gap: 48px;
  align-items: start;
}

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

.footer-brand .brand-logo {
  font-size: 28px;
}

.footer-tagline {
  color: rgba(255, 255, 255, 0.6);
  font-size: 15px;
  line-height: 1.6;
  max-width: 280px;
}

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

.footer-col-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  margin-bottom: 16px;
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-col a {
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  transition: color 180ms ease;
}

.footer-col a:hover { color: #FFFFFF; }

.footer-bottom {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-copy {
  font-size: 13px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.5);
}

.footer-meta {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.4);
}

/* =========================================================
   Modal (intro)
   ========================================================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 20, 0.5);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms ease;
}

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

.modal-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  padding: 40px;
  transform: translateY(12px) scale(0.98);
  transition: transform 280ms cubic-bezier(.2,.8,.2,1);
}

.modal-backdrop.is-open .modal-card {
  transform: translateY(0) scale(1);
}

.modal-grad-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  transition: background 180ms ease, color 180ms ease;
}

.modal-close:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.modal-logo {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 700;
  font-size: 32px;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.01em;
}

.modal-tagline {
  margin-top: 8px;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-secondary);
}

.modal-body {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-body p {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--text-secondary);
  padding-left: 18px;
  position: relative;
}

.modal-body p::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--purple-300);
}

.modal-actions {
  margin-top: 32px;
}

.modal-actions .btn {
  width: 100%;
}

/* =========================================================
   Card (generic, used by stats & process)
   ========================================================= */
.card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 240ms ease, box-shadow 240ms ease, background 240ms ease;
}
