/* ============================================================
   LUXURY STEEL PETS — PREMIUM ANIMATIONS v1
   Stack: CSS + IntersectionObserver. Zero dependencies.
   Basado en UI/UX Pro Max guidelines (reveal, stagger, ken burns,
   parallax, smooth scroll, reduced-motion respect).
============================================================ */

/* ───── Smooth scroll con offset del header sticky ───── */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

/* ───── Respect prefers-reduced-motion (ACCESIBILIDAD CRÍTICA) ───── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .ken-burns { animation: none !important; }
  .animate-float, .animate-float-medium { animation: none !important; }
}

/* ───── Scroll progress bar (top of page) ───── */
.lsp-scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 9999;
  background: var(--gradient-coral);
  transform-origin: left center;
  transform: scaleX(0);
  will-change: transform;
  pointer-events: none;
}

/* ───── Reveal on scroll ───── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Reveal direcciones alternativas */
.reveal-left { opacity: 0; transform: translateX(-40px); transition: opacity .8s cubic-bezier(.16,1,.3,1), transform .8s cubic-bezier(.16,1,.3,1); }
.reveal-left.visible { opacity: 1; transform: translateX(0); }
.reveal-right { opacity: 0; transform: translateX(40px); transition: opacity .8s cubic-bezier(.16,1,.3,1), transform .8s cubic-bezier(.16,1,.3,1); }
.reveal-right.visible { opacity: 1; transform: translateX(0); }
.reveal-scale { opacity: 0; transform: scale(.92); transition: opacity .8s cubic-bezier(.16,1,.3,1), transform .8s cubic-bezier(.16,1,.3,1); }
.reveal-scale.visible { opacity: 1; transform: scale(1); }

/* ───── Stagger reveal (hijos en cascada) ───── */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-stagger.visible > *:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger.visible > *:nth-child(2) { transition-delay: 80ms; }
.reveal-stagger.visible > *:nth-child(3) { transition-delay: 160ms; }
.reveal-stagger.visible > *:nth-child(4) { transition-delay: 240ms; }
.reveal-stagger.visible > *:nth-child(5) { transition-delay: 320ms; }
.reveal-stagger.visible > *:nth-child(6) { transition-delay: 400ms; }
.reveal-stagger.visible > *:nth-child(7) { transition-delay: 480ms; }
.reveal-stagger.visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* ───── Ken Burns (imágenes hero con movimiento sutil) ───── */
@keyframes ken-burns {
  0%   { transform: scale(1.00) translate(0, 0); }
  25%  { transform: scale(1.05) translate(-0.8%, -0.3%); }
  50%  { transform: scale(1.08) translate(0.5%, 0.8%); }
  75%  { transform: scale(1.04) translate(0.8%, -0.5%); }
  100% { transform: scale(1.00) translate(0, 0); }
}
.ken-burns {
  animation: ken-burns 24s ease-in-out infinite;
  will-change: transform;
}

/* ───── Image zoom on hover (parent tiene overflow hidden) ───── */
.img-zoom-wrap {
  overflow: hidden;
  border-radius: inherit;
}
.img-zoom {
  transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}
.img-zoom-wrap:hover .img-zoom,
.group:hover .img-zoom {
  transform: scale(1.08);
}

/* ───── Parallax lite (usa transform, no background-attachment) ───── */
.parallax-element {
  transition: transform 0.1s linear;
  will-change: transform;
}

/* ───── Hover lift universal ───── */
.lift-hover {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.3s ease;
}
.lift-hover:hover {
  transform: translateY(-6px);
  box-shadow: 0 30px 60px -20px rgba(255, 111, 97, 0.35);
}

/* ───── Pricing card lift (más dramático) ───── */
.pricing-lift {
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.3s ease;
}
.pricing-lift:hover {
  transform: translateY(-10px);
  box-shadow: 0 50px 80px -25px rgba(255, 111, 97, 0.4);
  border-color: var(--coral);
}

/* ───── Float animations (sutil en badges flotantes) ───── */
@keyframes float-slow {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}
@keyframes float-medium {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
.animate-float         { animation: float-slow 6s ease-in-out infinite; will-change: transform; }
.animate-float-medium  { animation: float-medium 4s ease-in-out infinite; will-change: transform; }

/* ───── Shiny button sweep (cobre/oro sobre botones CTA) ───── */
.btn-coral,
.btn-shine {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.btn-coral::before,
.btn-shine::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg,
    transparent 30%,
    rgba(255, 255, 255, 0.35) 50%,
    transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  z-index: -1;
}
.btn-coral:hover::before,
.btn-shine:hover::before {
  transform: translateX(100%);
}

/* ───── Gradient text animado (para el keyword principal) ───── */
.gradient-text-animated {
  background: linear-gradient(90deg,
    #FF6F61 0%, #E07A2A 25%, #FFD700 50%, #E07A2A 75%, #FF6F61 100%);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient-shift 10s ease infinite;
}
@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

/* ───── Typewriter cursor ───── */
.type-cursor::after {
  content: '|';
  display: inline-block;
  color: var(--coral);
  animation: blink-caret 1s step-end infinite;
  font-weight: 300;
  margin-left: 2px;
}
@keyframes blink-caret {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0; }
}

/* ───── Counter (tabular numbers para evitar CLS) ───── */
.counter-num {
  font-variant-numeric: tabular-nums;
  display: inline-block;
}

/* ───── FAQ smooth expand (usa grid trick) ───── */
.faq-item {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.faq-item.open { grid-template-rows: 1fr; }
.faq-item > .faq-content {
  overflow: hidden;
  min-height: 0;
}

/* ───── Marquee (testimonios o partners) ───── */
@keyframes marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.marquee {
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, black 10%, black 90%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, black 10%, black 90%, transparent);
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 45s linear infinite;
  gap: 2rem;
}
.marquee:hover .marquee-track {
  animation-play-state: paused;
}

/* ───── Sticky mobile CTA ───── */
.sticky-cta {
  position: fixed;
  bottom: -120px;
  left: 12px;
  right: 12px;
  z-index: 40;
  transition: bottom 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}
.sticky-cta.visible {
  bottom: 16px;
  pointer-events: auto;
}
.sticky-cta > * {
  pointer-events: auto;
}
@media (min-width: 1024px) {
  .sticky-cta { display: none; }
}

/* ───── Cursor warm glow (sutil, desktop only) ───── */
@media (hover: hover) and (pointer: fine) {
  .lsp-cursor-glow {
    position: fixed;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 111, 97, 0.15), transparent 60%);
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: transform 0.15s ease-out;
    mix-blend-mode: multiply;
    opacity: 0;
  }
  body.has-cursor-glow .lsp-cursor-glow { opacity: 1; }
}

/* ───── Scroll indicator (flecha abajo en hero) ───── */
@keyframes scroll-indicator-bounce {
  0%, 100% { transform: translateY(0); opacity: 0.4; }
  50%      { transform: translateY(10px); opacity: 1; }
}
.scroll-indicator {
  animation: scroll-indicator-bounce 2s ease-in-out infinite;
}

/* ───── Number badge pop ───── */
@keyframes pop-in {
  0%   { transform: scale(0); opacity: 0; }
  60%  { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
.pop-in { animation: pop-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both; }

/* ───── Image skeleton shimmer (loading state) ───── */
@keyframes shimmer {
  0%   { background-position: -1000px 0; }
  100% { background-position:  1000px 0; }
}
.img-skeleton {
  background: linear-gradient(90deg, #FFF5ED 25%, #FFE8D4 50%, #FFF5ED 75%);
  background-size: 1000px 100%;
  animation: shimmer 2s infinite linear;
}

/* ───── Pulse (dots en estado online) ───── */
@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(39, 174, 96, 0.5); }
  70%  { box-shadow: 0 0 0 8px rgba(39, 174, 96, 0); }
  100% { box-shadow: 0 0 0 0 rgba(39, 174, 96, 0); }
}
.pulse-ring {
  animation: pulse-ring 2s infinite;
}

/* ───── Section enter con gradient sweep (tipo Stripe) ───── */
@keyframes section-reveal {
  0%   { transform: translateY(40px); opacity: 0; clip-path: inset(10% 0 10% 0); }
  100% { transform: translateY(0);    opacity: 1; clip-path: inset(0 0 0 0); }
}

/* ───── Card border glow on hover ───── */
.card-glow {
  position: relative;
}
.card-glow::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: var(--gradient-coral);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: -1;
  filter: blur(8px);
}
.card-glow:hover::after {
  opacity: 0.4;
}

/* ───── Button press scale feedback ───── */
button, .btn-coral, .btn-outline-warm {
  transition: transform 0.1s ease-out,
              background-color 0.2s ease,
              box-shadow 0.3s ease;
}
button:active, .btn-coral:active, .btn-outline-warm:active {
  transform: scale(0.97);
}

/* ───── Text balance para hero headlines (evita viudas) ───── */
.text-balance {
  text-wrap: balance;
  -webkit-text-wrap: balance;
}

/* ───── Hero image subtle tilt on scroll ───── */
.hero-img-tilt {
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  transform-style: preserve-3d;
}

/* ───── JULIA INTERACTIVE CHAT ─────────────── */
.julia-phone {
  width: min(320px, 100%);
  aspect-ratio: 9 / 19;
  background: linear-gradient(180deg, #1A0E08 0%, #2A1810 100%);
  border-radius: 3rem;
  border: 8px solid #1A0E08;
  box-shadow: 0 40px 80px -20px rgba(255,111,97,.4), 0 20px 40px -15px rgba(0,0,0,.3);
  padding: 28px 16px 16px;
  position: relative;
  overflow: hidden;
}
.julia-phone::before {
  content: '';
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  width: 90px; height: 22px; background: #0A0604; border-radius: 12px;
}

.julia-header {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; margin-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.julia-header .avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--gradient-coral);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 14px;
  box-shadow: 0 0 0 2px rgba(39,174,96,.8), 0 0 0 4px rgba(39,174,96,.3);
  animation: julia-online 2s infinite;
}
@keyframes julia-online {
  0%,100% { box-shadow: 0 0 0 2px rgba(39,174,96,.8), 0 0 0 4px rgba(39,174,96,.3); }
  50%     { box-shadow: 0 0 0 2px rgba(39,174,96,.8), 0 0 0 8px rgba(39,174,96,0); }
}
.julia-header .name { color: #FFF8F2; font-weight: 600; font-size: 14px; }
.julia-header .status { color: #58B87A; font-size: 11px; display: flex; align-items: center; gap: 4px; }
.julia-header .status::before {
  content: ''; width: 6px; height: 6px; background: #58B87A;
  border-radius: 50%; display: inline-block;
}

.julia-msgs { display: flex; flex-direction: column; gap: 10px; padding: 0 4px; }

.julia-msg {
  max-width: 78%;
  padding: 9px 12px;
  border-radius: 18px;
  font-size: 12px; line-height: 1.45;
  opacity: 0;
  transform: translateY(12px) scale(.95);
  transition: opacity .4s cubic-bezier(.16,1,.3,1), transform .4s cubic-bezier(.16,1,.3,1);
}
.julia-msg.visible { opacity: 1; transform: translateY(0) scale(1); }

.julia-msg.from-julia {
  background: rgba(255,255,255,.08);
  color: #FFF8F2;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.05);
}
.julia-msg.from-user {
  background: var(--gradient-coral);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 12px rgba(255,111,97,.3);
}
.julia-msg .context {
  display: block; margin-top: 6px; padding: 6px 8px;
  background: rgba(0,0,0,.25); border-radius: 8px;
  font-size: 10.5px; line-height: 1.5;
}
.julia-msg .action-btn {
  display: inline-block; margin-top: 8px; padding: 5px 10px;
  background: var(--coral); color: #fff; font-size: 10px;
  font-weight: 600; border-radius: 999px; text-decoration: none;
}

/* Typing indicator */
.julia-typing {
  display: inline-flex; gap: 4px; align-items: center;
  background: rgba(255,255,255,.08); backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.05);
  padding: 10px 14px; border-radius: 18px; border-bottom-left-radius: 4px;
  align-self: flex-start; opacity: 0;
  transition: opacity .3s ease;
}
.julia-typing.visible { opacity: 1; }
.julia-typing span {
  width: 6px; height: 6px; background: rgba(255,255,255,.5); border-radius: 50%;
  animation: julia-dot 1.2s infinite;
}
.julia-typing span:nth-child(2) { animation-delay: .2s; }
.julia-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes julia-dot {
  0%, 60%, 100% { transform: translateY(0); opacity: .4; }
  30%           { transform: translateY(-4px); opacity: 1; }
}

/* Floating stat cards around the phone */
.julia-stat-card {
  position: absolute;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0,0,0,.04);
  border-radius: 16px;
  padding: 10px 14px;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,.15);
  display: flex; align-items: center; gap: 10px;
  font-size: 12px;
  z-index: 2;
}
@media (prefers-reduced-motion: no-preference) {
  .julia-stat-card { animation: float-medium 5s ease-in-out infinite; }
}

/* ───── TIMELINE ANIMADO (3 pasos) ──────────── */
.timeline-container { position: relative; }

/* Línea conectora animada: crece horizontalmente on-view */
.timeline-line {
  position: absolute;
  top: 40px; left: 16%; right: 16%;
  height: 3px;
  background: linear-gradient(90deg, var(--coral) 0%, var(--orange-warm) 100%);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 1.6s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 3px;
  z-index: 1;
}
.timeline-container.in-view .timeline-line { transform: scaleX(1); }

/* Cada step */
.timeline-step {
  position: relative;
  z-index: 2;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.timeline-container.in-view .timeline-step { opacity: 1; transform: translateY(0); }
.timeline-container.in-view .timeline-step:nth-child(2) { transition-delay: 300ms; }
.timeline-container.in-view .timeline-step:nth-child(3) { transition-delay: 600ms; }
.timeline-container.in-view .timeline-step:nth-child(4) { transition-delay: 900ms; }

/* Número con pop */
.timeline-num {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--gradient-coral);
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  font-size: 28px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 24px;
  box-shadow: 0 20px 40px -15px rgba(255,111,97,.5);
  position: relative;
  transform: scale(0);
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.timeline-container.in-view .timeline-num { transform: scale(1); }
.timeline-container.in-view .timeline-step:nth-child(2) .timeline-num { transition-delay: 400ms; }
.timeline-container.in-view .timeline-step:nth-child(3) .timeline-num { transition-delay: 700ms; }
.timeline-container.in-view .timeline-step:nth-child(4) .timeline-num { transition-delay: 1000ms; }

/* Pulse ring on active */
.timeline-num::before {
  content: '';
  position: absolute; inset: -6px;
  border-radius: 50%;
  border: 2px solid var(--coral);
  opacity: 0;
}
.timeline-container.in-view .timeline-num::before {
  animation: timeline-pulse 2s ease-out infinite;
}
@keyframes timeline-pulse {
  0%   { opacity: .6; transform: scale(1); }
  100% { opacity: 0;  transform: scale(1.3); }
}

/* Check icon que aparece en pasos "completados" */
.timeline-check {
  position: absolute;
  top: -8px; right: -8px;
  width: 28px; height: 28px;
  background: #27AE60;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  box-shadow: 0 4px 12px rgba(39,174,96,.4);
  transform: scale(0);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.timeline-container.in-view .timeline-step.done .timeline-check { transform: scale(1); }
.timeline-container.in-view .timeline-step:nth-child(2).done .timeline-check { transition-delay: 800ms; }
.timeline-container.in-view .timeline-step:nth-child(3).done .timeline-check { transition-delay: 1100ms; }
.timeline-container.in-view .timeline-step:nth-child(4).done .timeline-check { transition-delay: 1400ms; }
