/* PREMIUM — LeaseBase Ambient Motion & Visual Polish
   Supplements animations.css. All animations gated behind
   prefers-reduced-motion. GPU-composited (transform + opacity). */

/* ── Custom Properties (tunable) ──────────────────────────── */
:root {
  --lb-anim-hero-mesh: 24s;
  --lb-anim-dot-drift: 60s;
  --lb-anim-glow-pulse: 4s;
  --lb-anim-cta-pulse: 3s;
  --lb-anim-float-slow: 18s;
  --lb-anim-float-med: 14s;
  --lb-anim-screenshot-bob: 8s;
  --lb-anim-hero-reveal: 800ms;
}

/* ── 1. Hero Gradient Mesh ─────────────────────────────────── */
.lb-hero {
  position: relative;
  overflow: hidden;
}

.lb-hero::before {
  content: '';
  position: absolute;
  inset: -50%;
  width: 200%;
  height: 200%;
  z-index: 0;
  opacity: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 30%, rgba(34, 197, 94, 0.08) 0%, transparent 70%),
    radial-gradient(ellipse 50% 60% at 80% 60%, rgba(59, 130, 246, 0.05) 0%, transparent 70%),
    radial-gradient(ellipse 70% 40% at 50% 80%, rgba(34, 197, 94, 0.06) 0%, transparent 60%);
  pointer-events: none;
}

/* Ensure hero content sits above the mesh */
.lb-hero > * {
  position: relative;
  z-index: 1;
}

/* ── 2. Dot Grid Pattern ──────────────────────────────────── */
.lb-section--dark {
  position: relative;
}

.lb-section--dark::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image: radial-gradient(circle 1px, rgba(255, 255, 255, 0.5) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* Keep section content above the dot grid */
.lb-section--dark > * {
  position: relative;
  z-index: 1;
}

/* ── 3. Green Glow Accent (AI cards) ──────────────────────── */
[data-track-section="intelligence"] .lb-card--dark,
.lb-card--glow {
  position: relative;
}

/* ── 4. CTA Button Glow ───────────────────────────────────── */
.lb-btn--primary {
  transition: transform 200ms ease, box-shadow 200ms ease;
}

/* ── 5. Hero Slide-Up Reveal ──────────────────────────────── */
.lb-hero h1 {
  opacity: 0;
  transform: translateY(20px);
}

.lb-hero .lb-hero-enter--delayed,
.lb-hero p {
  opacity: 0;
  transform: translateY(16px);
}

/* ── 6. Card Hover Refinements ────────────────────────────── */
.lb-card {
  transition: transform 300ms ease, box-shadow 300ms ease, border-color 300ms ease;
}

.lb-card--dark {
  transition: transform 300ms ease, box-shadow 300ms ease, border-color 300ms ease;
}

.lb-pricing-card--featured {
  transition: transform 300ms ease, box-shadow 300ms ease;
}

/* ── 7. Section Transition Depth ──────────────────────────── */
.lb-section--dark + .lb-section--gray::before,
.lb-section--dark + .lb-section--white::before {
  content: '';
  position: absolute;
  top: -40px;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(to bottom, #0D1320, transparent);
  pointer-events: none;
  z-index: 2;
}

.lb-section--gray + .lb-section--dark::before,
.lb-section--white + .lb-section--dark::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(to bottom, transparent, #0D1320);
  pointer-events: none;
  z-index: 2;
}

/* ── 8. Floating Geometric Element (hero) ─────────────────── */
.lb-hero::after {
  content: '';
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 30%;
  border: 1px solid rgba(34, 197, 94, 0.08);
  top: 15%;
  right: 8%;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
}

/* ── 9. Count-Up Helper (JS does the counting) ───────────── */
.lb-count-up {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.1;
  color: #22c55e;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  display: inline-block;
}

.lb-count-up__label {
  display: block;
  font-size: var(--lb-text-sm, 0.875rem);
  font-weight: 500;
  color: var(--lb-gray-400, #9ca3af);
  margin-top: 4px;
  letter-spacing: 0;
}

/* ── 10. Screenshot Float (keyframes in motion block below) ── */

/* ── MOTION-ENABLED BLOCK ─────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {

  /* 1. Hero mesh animation */
  .lb-hero::before {
    opacity: 1;
    animation: lb-mesh-drift var(--lb-anim-hero-mesh) ease-in-out infinite alternate;
  }

  @keyframes lb-mesh-drift {
    0%   { transform: translate(0, 0)   scale(1); }
    33%  { transform: translate(-8%, 5%) scale(1.05); }
    66%  { transform: translate(6%, -4%) scale(0.97); }
    100% { transform: translate(-3%, 7%) scale(1.03); }
  }

  /* 2. Dot grid slow drift */
  .lb-section--dark::after {
    animation: lb-dot-drift var(--lb-anim-dot-drift) linear infinite;
  }

  @keyframes lb-dot-drift {
    to { background-position: 24px 24px; }
  }

  /* 3. Green glow pulse on AI cards */
  [data-track-section="intelligence"] .lb-card--dark,
  .lb-card--glow {
    animation: lb-glow-pulse var(--lb-anim-glow-pulse) ease-in-out infinite;
  }

  @keyframes lb-glow-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
    50%      { box-shadow: 0 0 24px 2px rgba(34, 197, 94, 0.07); }
  }

  /* 4. CTA button breathing glow */
  .lb-btn--primary {
    animation: lb-cta-glow var(--lb-anim-cta-pulse) ease-in-out infinite;
  }

  .lb-btn--primary:hover {
    animation: none;
    box-shadow: 0 0 20px 4px rgba(34, 197, 94, 0.25);
    transform: translateY(-1px);
  }

  @keyframes lb-cta-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
    50%      { box-shadow: 0 0 14px 2px rgba(34, 197, 94, 0.15); }
  }

  /* 5. Hero slide-up reveal */
  .lb-hero h1 {
    animation: lb-slide-up var(--lb-anim-hero-reveal) ease-out forwards;
  }

  .lb-hero .lb-hero-enter--delayed,
  .lb-hero p {
    animation: lb-slide-up var(--lb-anim-hero-reveal) ease-out 300ms forwards;
  }

  @keyframes lb-slide-up {
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* 6. Card hover refinements */
  .lb-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
  }

  .lb-card--dark:hover {
    transform: translateY(-6px);
    border-color: rgba(34, 197, 94, 0.25);
    box-shadow: 0 0 30px rgba(34, 197, 94, 0.08), 0 12px 32px rgba(0, 0, 0, 0.2);
  }

  .lb-pricing-card--featured:hover {
    transform: translateY(-4px);
    box-shadow: 0 0 40px rgba(34, 197, 94, 0.12), 0 16px 48px rgba(0, 0, 0, 0.15);
  }

  /* 8. Floating geometric element */
  .lb-hero::after {
    opacity: 1;
    animation: lb-float-geo var(--lb-anim-float-slow) ease-in-out infinite;
  }

  @keyframes lb-float-geo {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25%      { transform: translate(12px, -18px) rotate(8deg); }
    50%      { transform: translate(-6px, -10px) rotate(-4deg); }
    75%      { transform: translate(8px, 14px) rotate(6deg); }
  }

  /* 10. Screenshot float */
  .lb-screenshot {
    animation: lb-screenshot-bob var(--lb-anim-screenshot-bob) ease-in-out infinite;
  }

  @keyframes lb-screenshot-bob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-4px); }
  }
}

/* ── MOBILE: disable floating elements ────────────────────── */
@media (max-width: 768px) {
  .lb-hero::after {
    display: none;
  }

  .lb-hero::before {
    inset: -20%;
    width: 140%;
    height: 140%;
  }
}
