/* ==============================================
   HIDER · animations.css
   Ubicacion: frontend/css/animations.css
   Animaciones globales · blobs · reveal · hover
   ============================================== */


/* ── Scroll reveal ───────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition:
    opacity 0.7s var(--ease-out),
    transform 0.7s var(--ease-out);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-32px);
  transition:
    opacity 0.7s var(--ease-out),
    transform 0.7s var(--ease-out);
}

.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(32px);
  transition:
    opacity 0.7s var(--ease-out),
    transform 0.7s var(--ease-out);
}

.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Delay escalonado para grupos */
.reveal-group > *:nth-child(1) { transition-delay: 0.05s; }
.reveal-group > *:nth-child(2) { transition-delay: 0.15s; }
.reveal-group > *:nth-child(3) { transition-delay: 0.25s; }
.reveal-group > *:nth-child(4) { transition-delay: 0.35s; }
.reveal-group > *:nth-child(5) { transition-delay: 0.45s; }
.reveal-group > *:nth-child(6) { transition-delay: 0.55s; }

/* ── Float animation ─────────────────────────── */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-12px); }
}

@keyframes floatSlow {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  33%       { transform: translateY(-8px) rotate(1deg); }
  66%       { transform: translateY(-14px) rotate(-1deg); }
}

.float      { animation: float 4s ease-in-out infinite; }
.float-slow { animation: floatSlow 6s ease-in-out infinite; }

/* ── Blob background ─────────────────────────── */
@keyframes blobMove1 {
  0%, 100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
  25%       { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
  50%       { border-radius: 50% 60% 30% 60% / 40% 30% 70% 50%; }
  75%       { border-radius: 40% 30% 60% 50% / 70% 60% 30% 50%; }
}

@keyframes blobMove2 {
  0%, 100% { border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%; }
  33%       { border-radius: 70% 30% 50% 60% / 30% 60% 40% 70%; }
  66%       { border-radius: 50% 40% 30% 60% / 60% 40% 50% 30%; }
}

.blob {
  position: absolute;
  border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  animation: blobMove1 12s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

.blob-1 {
  width: clamp(300px, 40vw, 600px);
  height: clamp(300px, 40vw, 600px);
  background: radial-gradient(
    circle,
    rgba(184, 134, 90, 0.15) 0%,
    rgba(91, 66, 52, 0.05) 70%,
    transparent 100%
  );
  top: -10%;
  right: -5%;
  animation-duration: 14s;
}

.blob-2 {
  width: clamp(200px, 30vw, 450px);
  height: clamp(200px, 30vw, 450px);
  background: radial-gradient(
    circle,
    rgba(252, 244, 232, 0.6) 0%,
    rgba(240, 224, 200, 0.2) 70%,
    transparent 100%
  );
  bottom: -5%;
  left: -5%;
  animation: blobMove2 10s ease-in-out infinite;
}

.blob-3 {
  width: clamp(150px, 20vw, 300px);
  height: clamp(150px, 20vw, 300px);
  background: radial-gradient(
    circle,
    rgba(212, 168, 122, 0.2) 0%,
    transparent 70%
  );
  top: 40%;
  left: 20%;
  animation-duration: 16s;
  animation-delay: -3s;
}

/* ── Parallax image ──────────────────────────── */
.parallax-img {
  transition: transform 0.1s linear;
  will-change: transform;
}

/* ── Hover zoom image ────────────────────────── */
.img-zoom {
  overflow: hidden;
  border-radius: inherit;
}

.img-zoom img {
  transition: transform 0.9s var(--ease-out);
  will-change: transform;
}

.img-zoom:hover img {
  transform: scale(1.06);
}

/* ── Magnetic button ─────────────────────────── */
.btn-magnetic {
  transition:
    transform 0.3s var(--ease-out),
    box-shadow 0.3s var(--ease);
}

/* ── Spinner ─────────────────────────────────── */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(91, 66, 52, 0.2);
  border-top-color: var(--brown);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

.spinner-sm {
  width: 16px;
  height: 16px;
}

.spinner-white {
  border-color: rgba(252, 244, 232, 0.3);
  border-top-color: var(--cream);
}

/* ── Number counter ──────────────────────────── */
.count-up {
  display: inline-block;
  transition: transform 0.3s var(--ease-out);
}

/* ── Pulse dot ───────────────────────────────── */
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.5); opacity: 0.5; }
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 2s ease-in-out infinite;
}

/* ── Shimmer text ────────────────────────────── */
@keyframes shimmerText {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

.text-shimmer {
  background: linear-gradient(
    90deg,
    var(--brown) 0%,
    var(--gold) 50%,
    var(--brown) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmerText 3s linear infinite;
}

/* ── reveal-scale (cards e imágenes) ─────────── */
.reveal-scale {
  opacity: 0;
  transform: scale(0.9) translateY(22px);
  transition:
    opacity 0.75s var(--ease-out),
    transform 0.75s var(--ease-out);
}
.reveal-scale.visible {
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* ── reveal-blur (titulares grandes) ─────────── */
.reveal-blur {
  opacity: 0;
  filter: blur(10px);
  transform: translateY(14px);
  transition:
    opacity 0.9s var(--ease-out),
    filter   0.85s var(--ease-out),
    transform 0.9s var(--ease-out);
}
.reveal-blur.visible {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
}

/* ── reveal-clip (wipe desde abajo) ─────────── */
.reveal-clip {
  clip-path: inset(0 0 100% 0);
  transition: clip-path 0.95s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-clip.visible {
  clip-path: inset(0 0 0% 0);
}

/* ── Grids estáticos: hijos parten ocultos ───── */
.cat-grid.reveal-group > *,
.values-grid.reveal-group > *,
.testimonials-grid.reveal-group > *,
.hvalores-grid.reveal-group > *,
.hnums-grid.reveal-group > *,
.nov-launches-grid.reveal-group > *,
.nov-ventajas-grid.reveal-group > *,
.canales-grid.reveal-group > * {
  opacity: 0;
  transform: translateY(30px) scale(0.97);
  transition:
    opacity  0.65s var(--ease-out),
    transform 0.65s var(--ease-out);
}
.cat-grid.reveal-group > *.visible,
.values-grid.reveal-group > *.visible,
.testimonials-grid.reveal-group > *.visible,
.hvalores-grid.reveal-group > *.visible,
.hnums-grid.reveal-group > *.visible,
.nov-launches-grid.reveal-group > *.visible,
.nov-ventajas-grid.reveal-group > *.visible,
.canales-grid.reveal-group > *.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ══════════════════════════════════════════════
   TELÓN DE ENTRADA — Hider Bienvenido v100.0
══════════════════════════════════════════════ */

#hider-intro {
  position: fixed; inset: 0; z-index: 999999;
  overflow: hidden;
}

/* Paneles del telón — crema de marca */
.hi-panel {
  position: absolute; top: 0; height: 100%; width: 50.3%;
  background: #fcf4e8;
  z-index: 1;
  transition: transform 0.7s cubic-bezier(0.76, 0, 0.24, 1);
}
.hi-panel-l { left: 0; }
.hi-panel-r { right: 0; }
#hider-intro.hi-exit .hi-panel-l { transform: translateX(-102%); }
#hider-intro.hi-exit .hi-panel-r { transform: translateX(102%); }

/* Cuerpo — encima de los paneles */
.hi-body {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
#hider-intro.hi-exit .hi-body { opacity: 0; }

/* "Bienvenido a" */
.hi-welcome {
  font-family: var(--font-body);
  font-size: clamp(0.62rem, 1.7vw, 0.85rem);
  letter-spacing: 0.32em; text-transform: uppercase;
  color: rgba(91,66,52,0.48);
  margin: 0 0 0.55rem;
  opacity: 0; transform: translateY(10px);
  animation: hiFadeUp 0.45s ease-out 0.2s forwards;
}

/* Logo — slide desde abajo (clip reveal) */
.hi-logo-wrap {
  overflow: hidden;
  padding: 0.06em 0;
  margin-bottom: 0.45rem;
}
.hi-logo-img {
  width: clamp(140px, 28vw, 220px); height: auto;
  display: block;
  transform: translateY(105%);
  animation: hiBrand 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.4s forwards;
}
@keyframes hiBrand { to { transform: translateY(0); } }

/* "Tu lugar favorito." */
.hi-sub {
  font-family: var(--font-display);
  font-style: italic; font-weight: 400;
  font-size: clamp(1rem, 2.7vw, 1.35rem);
  color: rgba(91,66,52,0.58);
  margin: 0.5rem 0 0;
  opacity: 0;
  animation: hiFadeUp 0.45s ease-out 0.95s forwards;
}

/* Línea café suave */
.hi-rule {
  width: clamp(40px, 8vw, 56px); height: 1px;
  background: rgba(91,66,52,0.18);
  opacity: 0; margin-top: 1.1rem;
  animation: hiFade 0.4s ease 0.85s forwards;
}

@keyframes hiFadeUp { to { opacity: 1; transform: translateY(0); } }
@keyframes hiFade   { to { opacity: 1; } }

@media (max-width: 480px) {
  .hi-brand   { font-size: 4.5rem; }
  .hi-sub     { font-size: 0.95rem; }
}

/* ── Cursor orgánico Hider ───────────────────── */
.hider-cursor-blob {
  position: fixed;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  z-index: 2147483000;
  pointer-events: none;
  border-radius: 999px;
  opacity: 0;
  background: rgba(62, 38, 28, .36);
  border: 1px solid rgba(62, 38, 28, .46);
  box-shadow:
    0 10px 26px rgba(62, 38, 28, .24),
    inset 0 0 0 4px rgba(255, 248, 239, .18);
  mix-blend-mode: multiply;
  transition:
    width .18s ease,
    height .18s ease,
    opacity .18s ease,
    background .18s ease,
    border-color .18s ease;
}

.hider-cursor-blob.is-visible {
  opacity: 1;
}

.hider-cursor-blob.is-active {
  width: 38px;
  height: 38px;
  background: rgba(91, 57, 38, .32);
  border-color: rgba(91, 57, 38, .58);
}

[data-theme="dark"] .hider-cursor-blob {
  background: rgba(244, 205, 156, .34);
  border-color: rgba(244, 205, 156, .58);
  box-shadow:
    0 12px 30px rgba(0, 0, 0, .24),
    inset 0 0 0 4px rgba(255, 246, 232, .24);
  mix-blend-mode: screen;
}

@media (hover: none), (pointer: coarse), (prefers-reduced-motion: reduce) {
  .hider-cursor-blob { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hi-panel { transition: none !important; }
  .hi-logo-img { animation: none !important; transform: none !important; }
  .hi-welcome, .hi-sub, .hi-rule {
    animation: none !important; opacity: 1 !important; transform: none !important;
  }
}

/* ── Reduced motion ──────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .blob { animation: none; }
  .float, .float-slow { animation: none; }
  #hider-intro { transition: none !important; }
}
