/* ========== FrameVivoAI — Efeitos premium (Apple + sci-fi) ========== */

/* ---------- Reduced motion: desliga animações pesadas ---------- */
@media (prefers-reduced-motion: reduce) {
  .cinematic-enter,
  .cinematic-enter *,
  [data-reveal],
  .card-3d,
  .cta-magnetic-wrap,
  .modal-imobiliario-box,
  .proof-pulse,
  .glitch-overlay {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
  .hero-mouse-glow::before { opacity: 0.03 !important; }
}

/* ---------- A) Hero: luz que segue o mouse ---------- */
.hero-mouse-glow {
  position: relative;
}
.hero-mouse-glow::before {
  content: '';
  position: absolute;
  inset: -50%;
  width: 120%;
  height: 120%;
  background: radial-gradient(
    circle 40% at var(--mx, 50%) var(--my, 50%),
    rgba(14, 165, 233, 0.08) 0%,
    rgba(249, 115, 22, 0.04) 35%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.4s ease;
}
.hero-mouse-glow > * { position: relative; z-index: 1; }

/* ---------- A) Hero: entrada cinematográfica ---------- */
.cinematic-enter {
  opacity: 0;
  filter: blur(12px);
  transform: translateY(24px);
}
.cinematic-enter.is-visible {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
  transition: opacity 0.8s ease-out, filter 0.8s ease-out, transform 0.8s ease-out;
}
.cinematic-enter-delay-1 { transition-delay: 0.1s; }
.cinematic-enter-delay-2 { transition-delay: 0.2s; }
.cinematic-enter-delay-3 { transition-delay: 0.35s; }
.cinematic-enter-delay-4 { transition-delay: 0.5s; }
.cinematic-enter-delay-5 { transition-delay: 0.65s; }

/* ---------- B) Scroll reveal universal ---------- */
[data-reveal] {
  opacity: 0;
  transition-property: opacity, transform, filter;
  transition-duration: 0.6s;
  transition-timing-function: ease-out;
}
[data-reveal].is-visible { opacity: 1; }

[data-reveal="fade-up"] {
  transform: translateY(28px);
}
[data-reveal="fade-up"].is-visible {
  transform: translateY(0);
}

[data-reveal="fade-in"] {
  transform: none;
}
[data-reveal="fade-in"].is-visible {
  transform: none;
}

[data-reveal="blur-in"] {
  filter: blur(8px);
  transform: translateY(12px);
}
[data-reveal="blur-in"].is-visible {
  filter: blur(0);
  transform: translateY(0);
}

/* ---------- C) Canvas partículas (container) ---------- */
.particles-canvas-wrap {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.particles-canvas-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* ---------- D) Cards 3D premium ---------- */
.card-3d-wrap {
  perspective: 1200px;
}
.card-3d {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.15s ease-out, box-shadow 0.3s ease;
  overflow: hidden;
}
/* Só o bloco de texto acima do sheen (cards normais: capa + texto separados) */
.card-3d > div.p-5 {
  position: relative;
  z-index: 2;
}
.card-3d::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255, 255, 255, 0.03) 45%,
    rgba(255, 255, 255, 0.06) 50%,
    transparent 55%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.card-3d:hover::after { opacity: 1; }

.card-sheen {
  position: absolute;
  width: 80%;
  height: 80%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 1;
}

.card-3d-border-glow {
  position: relative;
}
.card-3d-border-glow::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    135deg,
    rgba(14, 165, 233, 0.2) 0%,
    transparent 40%,
    transparent 60%,
    rgba(249, 115, 22, 0.1) 100%
  );
  background-size: 200% 200%;
  animation: border-glow-drift 8s ease-in-out infinite;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.6;
}
@keyframes border-glow-drift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@media (max-width: 767px) {
  .card-3d-wrap { perspective: none; }
  .card-3d:hover { transform: none; }
  .card-3d::after { display: none; }
}

/* ---------- E) CTA magnético ---------- */
.cta-magnetic-wrap {
  position: relative;
  display: inline-block;
}
.cta-magnetic-btn {
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.4s ease;
}
.cta-magnetic-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    110deg,
    transparent 30%,
    rgba(255, 255, 255, 0.12) 50%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}
.cta-magnetic-btn:hover::before { opacity: 1; }
.cta-magnetic-btn:active { transform: scale(0.98); }

.proof-pulse {
  animation: cta-glow-pulse 2.5s ease-in-out infinite;
}
@keyframes cta-glow-pulse {
  0%, 100% { box-shadow: 0 0 40px -10px rgba(14, 165, 233, 0.4); }
  50% { box-shadow: 0 0 50px -5px rgba(14, 165, 233, 0.5); }
}

/* ---------- G) Prova social dinâmica ---------- */
.proof-social-block {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(51, 65, 85, 0.5);
  font-size: 0.8125rem;
  color: rgba(148, 163, 184, 0.95);
}
.proof-social-block .proof-number {
  font-weight: 700;
  color: #0ea5e9;
}

/* ---------- H) Easter glitch (uma vez por sessão) ---------- */
.glitch-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(14, 165, 233, 0.03) 50%,
    transparent 100%
  );
  animation: glitch-flash 120ms ease-out forwards;
}
@keyframes glitch-flash {
  0% { opacity: 0; filter: contrast(1); }
  30% { opacity: 0.8; filter: contrast(1.2); }
  100% { opacity: 0; filter: contrast(1); }
}

/* ---------- Modal cinematográfico: refinamentos ---------- */
.modal-imobiliario.is-open .modal-imobiliario-box {
  animation: modal-enter 0.25s ease-out;
}
@keyframes modal-enter {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
