/* ===========================================================
   Lead Jefe — Homepage Enhancements
   Cursor-tracked card glow, brass cursor halo, sticky CTA,
   live toast, kinetic H1, count-up stats, smart popups.
   =========================================================== */

/* ── Cursor-tracked card glow ─────────────────────────────── */
.card { position: relative; overflow: hidden; }
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 300ms ease;
  background: radial-gradient(
    500px circle at var(--mx, 50%) var(--my, 50%),
    rgba(212,168,87,0.18),
    transparent 40%
  );
  pointer-events: none;
  z-index: 0;
}
.card:hover::before { opacity: 1; }
.card > * { position: relative; z-index: 1; }

/* ── Brass cursor halo (desktop only) ─────────────────────── */
@media (hover: hover) and (pointer: fine) {
  .lj-cursor {
    position: fixed;
    top: 0; left: 0;
    width: 28px; height: 28px;
    border: 1.5px solid rgba(212,168,87,0.55);
    border-radius: 999px;
    pointer-events: none;
    transition: width 180ms ease, height 180ms ease, opacity 300ms ease, border-color 180ms ease, background 180ms ease;
    z-index: 9998;
    mix-blend-mode: screen;
    opacity: 0;
    will-change: transform;
  }
  .lj-cursor.active { opacity: 1; }
  .lj-cursor.hovering-button {
    width: 52px; height: 52px;
    border-color: rgba(245,215,152,0.85);
    background: rgba(212,168,87,0.08);
  }
}
@media (prefers-reduced-motion: reduce) { .lj-cursor { display: none; } }

/* ── Kinetic H1 letter animation ──────────────────────────── */
.lj-h1-letter {
  display: inline-block;
  opacity: 0;
  transform: translateY(14px);
  animation: lj-letter-in 600ms cubic-bezier(0.22,1,0.36,1) forwards;
  animation-delay: calc(var(--i, 0) * 40ms);
}
/* Re-apply brass gradient to each letter inside .text-brass-gradient
   because background-clip:text does not propagate through child spans */
.text-brass-gradient .lj-h1-letter {
  background: linear-gradient(135deg, #F5D798 0%, #D4A857 50%, #B08838 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
@keyframes lj-letter-in { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .lj-h1-letter { opacity: 1; transform: none; animation: none; }
}

/* ── Sticky download CTA ──────────────────────────────────── */
.lj-sticky-cta {
  position: fixed;
  left: 50%; bottom: 20px;
  transform: translate(-50%, 100px);
  opacity: 0;
  transition: all 350ms cubic-bezier(0.22,1,0.36,1);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(180deg, rgba(10,11,15,0.95), rgba(10,11,15,0.92));
  border: 1px solid rgba(212,168,87,0.35);
  padding: 9px 12px 9px 18px;
  border-radius: 999px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(212,168,87,0.15);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  max-width: calc(100vw - 32px);
  font-family: Inter, system-ui, sans-serif;
}
.lj-sticky-cta.visible { opacity: 1; transform: translate(-50%, 0); }
.lj-sticky-cta .txt {
  font-size: 13px;
  color: rgba(245,245,247,0.85);
  white-space: nowrap;
}
.lj-sticky-cta .btn {
  background: linear-gradient(135deg, #E5B968, #D4A857, #B08838);
  color: #08090C; font-weight: 700; font-size: 13px;
  padding: 8px 16px;
  border-radius: 999px;
  white-space: nowrap;
  text-decoration: none;
  transition: transform 180ms ease;
}
.lj-sticky-cta .btn:hover { transform: translateY(-1px); }
.lj-sticky-cta .close {
  color: rgba(245,245,247,0.5);
  background: transparent; border: 0;
  min-width: 36px; min-height: 36px;
  padding: 6px 8px; cursor: pointer;
  font-size: 20px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.lj-sticky-cta .close:hover { color: rgba(245,245,247,0.95); }
/* Hide sticky CTA on any mobile, tablet, or touch device.
   Covers: phones, iPads (portrait + landscape), iPad Pro landscape, and any
   device where the chat bubble would clash with the sticky pill.
   Large desktop only — 1280px+ viewport AND fine pointer AND real hover. */
@media (max-width: 1280px) {
  .lj-sticky-cta { display: none !important; }
}
@media (hover: none), (pointer: coarse) {
  .lj-sticky-cta { display: none !important; }
}

/* ── Live activity toast (bottom-left) ────────────────────── */
.lj-toast {
  position: fixed;
  left: 20px; bottom: 100px;
  transform: translateX(-120%);
  opacity: 0;
  transition: all 450ms cubic-bezier(0.22,1,0.36,1);
  z-index: 59;
  background: linear-gradient(180deg, rgba(16,18,26,0.96), rgba(10,11,15,0.96));
  border: 1px solid rgba(255,255,255,0.08);
  border-left: 3px solid #D4A857;
  padding: 12px 38px 12px 14px;
  border-radius: 10px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 340px;
  font-size: 13px;
  line-height: 1.4;
  color: rgba(245,245,247,0.85);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  font-family: Inter, system-ui, sans-serif;
}
.lj-toast.visible { opacity: 1; transform: translateX(0); }
.lj-toast .icon { font-size: 18px; line-height: 1; margin-top: 1px; }
.lj-toast .body { flex: 1; }
.lj-toast .time { color: rgba(245,245,247,0.42); font-size: 11px; margin-top: 3px; }
.lj-toast .close {
  position: absolute;
  right: 4px; top: 4px;
  background: transparent; border: 0;
  color: rgba(245,245,247,0.45);
  cursor: pointer;
  width: 32px; height: 32px;
  padding: 4px; line-height: 1; font-size: 16px;
  display: inline-flex; align-items: center; justify-content: center;
}
.lj-toast .close:hover { color: rgba(245,245,247,0.95); }
@media (max-width: 720px) { .lj-toast { display: none; } }

/* ── Smart popup modal ────────────────────────────────────── */
.lj-modal-bg {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  opacity: 0; pointer-events: none;
  transition: opacity 300ms ease;
  padding: 20px;
  font-family: Inter, system-ui, sans-serif;
}
.lj-modal-bg.visible { opacity: 1; pointer-events: all; }
.lj-modal {
  background: linear-gradient(180deg, #10121A, #0A0B0F);
  border: 1px solid rgba(212,168,87,0.35);
  border-radius: 20px;
  padding: 40px 34px;
  max-width: 480px; width: 100%;
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  text-align: center;
  position: relative;
  box-shadow: 0 40px 120px rgba(0,0,0,0.65), 0 0 0 1px rgba(212,168,87,0.1);
  transform: translateY(30px) scale(0.97);
  transition: transform 300ms cubic-bezier(0.22,1,0.36,1);
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 480px) {
  .lj-modal { padding: 32px 22px 28px; border-radius: 18px; }
  .lj-modal h2 { font-size: 24px !important; }
  .lj-modal p { font-size: 14px !important; }
  .lj-modal .primary { padding: 13px 24px; width: 100%; box-sizing: border-box; }
}
.lj-modal-bg.visible .lj-modal { transform: none; }
.lj-modal h2 {
  font-size: 28px; font-weight: 900; color: #fff;
  margin: 0 0 12px; letter-spacing: -0.02em;
  line-height: 1.1;
}
.lj-modal h2 .brass {
  background: linear-gradient(135deg, #F5D798, #D4A857, #B08838);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.lj-modal p {
  color: rgba(245,245,247,0.7);
  font-size: 15px; line-height: 1.6;
  margin: 0 0 24px;
}
.lj-modal .primary {
  display: inline-block;
  background: linear-gradient(135deg, #E5B968, #D4A857, #B08838);
  color: #08090C; font-weight: 800;
  padding: 13px 28px;
  border-radius: 10px;
  text-decoration: none;
  margin-bottom: 12px;
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.lj-modal .primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 40px rgba(212,168,87,0.3);
}
.lj-modal .secondary {
  display: block;
  background: transparent; border: none;
  color: rgba(245,245,247,0.5);
  font-size: 13px; cursor: pointer;
  margin: 0 auto; padding: 8px 16px;
}
.lj-modal .secondary:hover { color: rgba(245,245,247,0.9); }
.lj-modal .x {
  position: absolute;
  top: 10px; right: 10px;
  width: 44px; height: 44px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(245,245,247,0.6);
  cursor: pointer;
  font-size: 20px; line-height: 1;
  transition: all 180ms ease;
  display: inline-flex; align-items: center; justify-content: center;
}
.lj-modal .x:hover { border-color: rgba(212,168,87,0.45); color: #fff; }
.lj-modal .pill {
  display: inline-flex;
  align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  background: rgba(212,168,87,0.1);
  border: 1px solid rgba(212,168,87,0.3);
  color: #E5B968;
  margin-bottom: 14px;
}
