/* ═══════════════════════════════════════════════════════════
   Barber Go · Efectos (fx.css + fx.js)
   Solo movimiento: no cambia fuentes, textos ni colores. Usa el
   mismo dorado de producción (#F59E0B / #fde68a) y el negro --ink.
   Todo se apaga con prefers-reduced-motion.
   ═══════════════════════════════════════════════════════════ */
:root { --fx-ease: cubic-bezier(.22, 1, .36, 1); --fx-gold: 245, 158, 11; }

/* ── 1. INTRO: la tijera corta la pantalla y se abre (1 vez por sesión) ── */
.fx-intro { display: none; }
html.fx-intro-on .fx-intro {
  display: block; position: fixed; inset: 0; z-index: 10000; pointer-events: auto;
  animation: fx-intro-out 0s linear 1.75s forwards;
}
.fx-intro-half { position: absolute; left: 0; right: 0; height: 50.5%; background: #0B0C0E; }
.fx-intro-top { top: 0; animation: fx-half-up .7s cubic-bezier(.76, 0, .24, 1) 1s forwards; }
.fx-intro-bot { bottom: 0; animation: fx-half-down .7s cubic-bezier(.76, 0, .24, 1) 1s forwards; }
.fx-intro-logo {
  position: absolute; left: 50%; top: calc(50% - 46px); width: min(230px, 54vw); height: auto;
  transform: translate(-50%, -50%); opacity: 0;
  animation: fx-logo 1.05s var(--fx-ease) forwards;
}
.fx-intro-line { position: absolute; left: 8vw; right: 8vw; top: 50%; height: 2px; transform: translateY(-50%); }
.fx-intro-line > span:first-child {
  position: absolute; inset: 0; background: rgb(var(--fx-gold)); transform-origin: left; transform: scaleX(0);
  box-shadow: 0 0 18px rgba(var(--fx-gold), .7);
  animation: fx-line .65s var(--fx-ease) .25s forwards, fx-fade .25s linear .95s forwards;
}
.fx-intro-scissors {
  position: absolute; top: 50%; left: 0; width: 44px; height: 24px; margin-top: -12px; color: rgb(var(--fx-gold));
  animation: fx-scissors .65s var(--fx-ease) .25s forwards, fx-fade .2s linear .95s forwards;
}
.fx-intro-scissors svg { position: absolute; inset: 0; width: 44px; height: 24px; transform-origin: 30% 50%; }
.fx-intro-scissors .fx-blade-a { animation: fx-snip-a .13s ease-in-out 6 alternate .2s; }
.fx-intro-scissors .fx-blade-b { animation: fx-snip-b .13s ease-in-out 6 alternate .2s; }
/* Mientras dura la intro el hero espera; al abrirse entra con su animación de siempre */
html.fx-hold .bh-hero .bh-reveal.bh-visible { opacity: 0; transform: translateY(16px) scale(.98); }

@keyframes fx-logo { 0% { opacity: 0; transform: translate(-50%, -40%) scale(.96); } 25%, 80% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -60%) scale(1.02); } }
@keyframes fx-line { to { transform: scaleX(1); } }
@keyframes fx-scissors { to { left: calc(100% - 22px); } }
@keyframes fx-fade { to { opacity: 0; } }
@keyframes fx-half-up { to { transform: translateY(-101%); } }
@keyframes fx-half-down { to { transform: translateY(101%); } }
@keyframes fx-intro-out { to { visibility: hidden; pointer-events: none; } }
@keyframes fx-snip-a { to { transform: rotate(-16deg); } }
@keyframes fx-snip-b { to { transform: rotate(16deg); } }

/* ── 2. LUZ QUE SIGUE AL CURSOR + grilla que aparece debajo (hero y CTA final) ── */
.fx-light {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(640px circle at var(--mx, 70%) var(--my, 40%), rgba(var(--fx-gold), .085), transparent 62%);
}
.fx-light::before {
  content: ''; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(var(--fx-gold), .09) 1px, transparent 1px), linear-gradient(90deg, rgba(var(--fx-gold), .09) 1px, transparent 1px);
  background-size: 56px 56px; background-position: center;
  -webkit-mask-image: radial-gradient(320px circle at var(--mx, 70%) var(--my, 40%), #000, transparent 75%);
          mask-image: radial-gradient(320px circle at var(--mx, 70%) var(--my, 40%), #000, transparent 75%);
}
.bh-hero > .bh-container { position: relative; z-index: 1; }

/* ── 3. TÍTULOS: cada palabra sube desde una ranura ── */
.fx-split .fx-w { display: inline-block; clip-path: inset(-.6em -.25em -.12em -.25em); }
.fx-split .fx-w > span {
  display: inline-block; transform: translateY(125%) rotate(4deg); transform-origin: left bottom;
  transition: transform .95s var(--fx-ease); transition-delay: calc(var(--i) * 65ms + 100ms);
}
.fx-split.fx-in .fx-w > span { transform: none; }
.fx-split.fx-done .fx-w { clip-path: none; }

/* ── 4. TARJETAS: reflector dorado + borde que se enciende bajo el cursor ── */
.fx-spot {
  position: absolute; inset: 0; z-index: 0; border-radius: inherit; pointer-events: none;
  opacity: 0; transition: opacity .4s var(--fx-ease);
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(var(--fx-gold), .075), transparent 45%);
}
.fx-spot::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), rgba(var(--fx-gold), .65), transparent 65%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.fx-card:hover > .fx-spot { opacity: 1; }

/* Inclinación 3D en planes y testimonios */
.price-card.fx-tilt.visible:hover, .testi-card.fx-tilt:hover {
  transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-6px);
  transition: transform .18s ease-out, box-shadow .4s ease, border-color .4s ease, background .3s ease;
}

/* Plan Premium: un haz dorado orbita el borde */
@property --fx-a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.fx-orbit {
  position: absolute; inset: -1px; z-index: 0; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background: conic-gradient(from var(--fx-a), transparent 0 68%, rgba(var(--fx-gold), .9) 86%, #fde68a 91%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: fx-orbit 4.5s linear infinite;
}
@keyframes fx-orbit { to { --fx-a: 360deg; } }

/* Ítems de los planes entran en cascada y la estrella gira */
.price-card.visible .price-items li { animation: fx-li .55s var(--fx-ease) both; animation-delay: calc(var(--i, 0) * 45ms + 350ms); }
.price-card.visible .price-items .check { display: inline-block; animation: fx-star .7s var(--fx-ease) both; animation-delay: calc(var(--i, 0) * 45ms + 420ms); }
@keyframes fx-li { from { opacity: 0; transform: translateX(-10px); } }
@keyframes fx-star { from { opacity: 0; transform: rotate(-180deg) scale(.3); } }

/* Íconos del problema tiemblan como un celular que no para */
@media (hover: hover) { .pain-card:hover .pain-icon { animation: fx-buzz .5s ease-in-out; } }
@keyframes fx-buzz { 20%, 60% { transform: rotate(-9deg); } 40%, 80% { transform: rotate(9deg); } }

/* ── 5. BOTONES: destello que recorre el botón + imán (fx.js) ── */
.fx-has-shine { position: relative; isolation: isolate; }
.fx-shine { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; pointer-events: none; z-index: 1; }
.fx-shine::after {
  content: ''; position: absolute; top: -10%; bottom: -10%; left: 0; width: 38%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent);
  transform: translateX(-160%) skewX(-20deg);
  animation: fx-shine 5.5s var(--fx-ease) infinite; animation-delay: var(--d, 1.2s);
}
@keyframes fx-shine { 0%, 72% { transform: translateX(-160%) skewX(-20deg); } 100% { transform: translateX(360%) skewX(-20deg); } }

/* Chispas doradas al tocar un CTA de WhatsApp */
.fx-burst { position: fixed; z-index: 9997; width: 0; height: 0; pointer-events: none; }
.fx-burst i { position: absolute; left: -3px; top: -3px; width: 6px; height: 6px; border-radius: 50%; background: rgb(var(--fx-gold)); box-shadow: 0 0 10px rgba(var(--fx-gold), .8); }
.fx-burst b { position: absolute; left: -20px; top: -20px; width: 40px; height: 40px; border-radius: 50%; border: 2px solid rgba(var(--fx-gold), .9); }

/* ── 6. TIJERA: sobre un CTA de WhatsApp el puntero lleva una tijera ── */
.fx-cur-scissors { position: fixed; top: 0; left: 0; z-index: 9998; pointer-events: none; opacity: 0; transition: opacity .2s ease; color: rgb(var(--fx-gold)); filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .6)); }
.fx-cur-scissors span { display: block; position: relative; width: 30px; height: 15px; }
.fx-cur-scissors svg { position: absolute; inset: 0; width: 30px; height: 15px; transform-origin: 30% 50%; }
.fx-cut .fx-cur-scissors { opacity: 1; }
.fx-cut .fx-cur-scissors .fx-blade-a { animation: fx-snip-a .2s ease-in-out infinite alternate; }
.fx-cut .fx-cur-scissors .fx-blade-b { animation: fx-snip-b .2s ease-in-out infinite alternate; }

/* ── 7. CAPTURAS: se descubren como una cortina al entrar en pantalla ── */
.fx-wipe { clip-path: inset(0 0 100% 0 round 24px); transition: clip-path 1.15s cubic-bezier(.77, 0, .18, 1) .2s; }
.fx-wipe.fx-in { clip-path: inset(0 0 0 0 round 24px); }
.fx-wipe.fx-done { clip-path: none; }

/* ── 8. FAQ: abre y cierra con altura animada (fx.js) ── */
.faq-item.fx-anim { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  html.fx-intro-on .fx-intro { display: none; }
  html.fx-hold .bh-hero .bh-reveal.bh-visible { opacity: 1; transform: none; }
  .fx-split .fx-w > span { transform: none; transition: none; }
  .fx-orbit, .fx-shine::after, .price-card.visible .price-items li, .price-card.visible .price-items .check { animation: none; }
  .fx-wipe { clip-path: none; transition: none; }
}

/* ═══════════ CAPA 2 · "efecto guau" ═══════════ */

/* ── 9. SCROLL SUAVE con inercia (Lenis) ── */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

/* ── 10. TÍTULO DEL HERO: cada letra cae en 3D ── */
.fx-chars .fx-cw { display: inline-block; white-space: nowrap; }
.fx-chars .fx-c {
  display: inline-block; opacity: 0; transform-origin: 50% 100%;
  transform: perspective(600px) translateY(.35em) rotateX(-95deg);
}
.fx-chars.fx-go .fx-c { animation: fx-char .9s var(--fx-ease) forwards; animation-delay: calc(var(--i) * 26ms); }
@keyframes fx-char { 60% { opacity: 1; } to { opacity: 1; transform: none; } }

/* ── 11. TELÉFONO DEL HERO: llega volando desde el fondo ── */
html.fx-hold .bh-phone { opacity: 0; }
.bh-phone.fx-fly { animation: fx-fly 1.3s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes fx-fly {
  from { opacity: 0; scale: 1.35; translate: 0 90px; filter: blur(14px); }
  60% { filter: blur(0); }
  to { opacity: 1; scale: 1; translate: 0 0; filter: none; }
}
.bh-glow.fx-fly { animation: fx-glow 1.6s var(--fx-ease) both; }
@keyframes fx-glow { from { scale: .2; opacity: 0; } 50% { opacity: .3; } }

/* ── 12. PLANES: se reparten como cartas desde el centro ── */
.price-card.fx-deal {
  transition: opacity .7s ease, transform .4s cubic-bezier(.25, 1, .5, 1), box-shadow .4s ease, border-color .4s ease,
              translate 1.3s cubic-bezier(.7, 0, .2, 1) var(--dd, 0s), rotate 1.3s cubic-bezier(.7, 0, .2, 1) var(--dd, 0s);
}

/* ── 13. CELULARES DEL FLUJO: salen del mazo y se abren en abanico ── */
.phones-fan.fx-stack .pw { translate: var(--sx, 0) 0; rotate: var(--sr, 0deg); }
.phones-fan .pw { transition: all .4s cubic-bezier(.34, 1.56, .64, 1), translate 1.1s cubic-bezier(.34, 1.3, .64, 1) var(--dd, 0s), rotate 1.1s cubic-bezier(.34, 1.3, .64, 1) var(--dd, 0s); }

/* ── 14. TESTIMONIOS: "escribiendo…" antes de que aparezca el mensaje ── */
.testi-bubble { position: relative; }
.fx-typing {
  position: absolute; left: 0; top: 4px; display: inline-flex; gap: 5px; padding: 12px 16px;
  border-radius: 18px 18px 18px 4px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .07);
  transition: opacity .3s ease, transform .3s ease;
}
.fx-typing i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .5); animation: fx-dot 1s ease-in-out infinite; }
.fx-typing i:nth-child(2) { animation-delay: .15s; } .fx-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes fx-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-5px); opacity: 1; } }
.testi-card.fx-wait .testi-bubble > :not(.fx-typing) { opacity: 0; transform: translateY(8px); }
.testi-bubble > :not(.fx-typing) { transition: opacity .5s var(--fx-ease), transform .5s var(--fx-ease); }
.testi-card:not(.fx-wait) .fx-typing { opacity: 0; transform: scale(.8); pointer-events: none; }

/* ── 15. CTA FINAL: linterna que dibuja el contorno de "BARBER GO" ── */
.cta-watermark.fx-wm-lit {
  color: transparent; -webkit-text-stroke: 1.5px rgba(var(--fx-gold), .55);
  -webkit-mask-image: radial-gradient(260px circle at var(--wx, -999px) var(--wy, -999px), #000, transparent 70%);
          mask-image: radial-gradient(260px circle at var(--wx, -999px) var(--wy, -999px), #000, transparent 70%);
}

@media (prefers-reduced-motion: reduce) {
  html.fx-hold .bh-phone { opacity: 1; }
  .fx-chars .fx-c { opacity: 1; transform: none; animation: none; }
  .bh-phone.fx-fly, .bh-glow.fx-fly { animation: none; }
}
