/**
 * LA24 - Effects & Animations v2.0
 * 
 * FIXED:
 * - Menú fullscreen (oculta menú original correctamente)
 * - Hamburguesa visible en desktop
 * - Reveal on scroll funciona al scrollear
 * 
 * NEW:
 * - WhatsApp button verde y grande
 * - Botones scroll más visibles (naranja)
 * - Efecto typewriter en títulos
 * - Navbar más ancha y logo más grande
 */

/* ============================================================
   NAVBAR MEJORADA - Más ancha y logo más grande
   ============================================================ */

.site-header {
  padding: 8px 0;
}

.site-header .nav {
  padding: 20px 32px;
  min-height: 70px;
}

.site-header .brand,
.site-header .custom-logo-link {
  font-size: 28px;
  letter-spacing: 0.4em;
  font-weight: 700;
}

.site-header .custom-logo {
  height: 40px;
  width: auto;
}

/* Hamburguesa SIEMPRE visible (para menú fullscreen) */
.site-header .nav-toggle {
  display: flex !important;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 50px;
  height: 50px;
  z-index: 10001;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.site-header .nav-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.site-header .nav-toggle__bar {
  width: 24px;
  height: 2px;
  background: #fff;
  margin: 3px 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Ocultar menú inline en TODOS los tamaños (usamos fullscreen) */
.menu-fullscreen-enabled .site-header .menu {
  display: none !important;
}

/* ============================================================
   SMOOTH SCROLL (Lenis base styles)
   ============================================================ */

html.lenis, html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

/* ============================================================
   CURSOR PERSONALIZADO
   ============================================================ */

@media (hover: hover) and (pointer: fine) {
  * {
    cursor: none !important;
  }
}

.cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 20px;
  height: 20px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99999;
  mix-blend-mode: difference;
  transform: translate(-50%, -50%);
  transition: width 0.3s ease, height 0.3s ease, background 0.3s ease;
}

.cursor-follower {
  position: fixed;
  top: 0;
  left: 0;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99998;
  transform: translate(-50%, -50%);
  transition: width 0.15s ease, height 0.15s ease, border-color 0.15s ease;
}

.cursor.cursor--hover {
  width: 60px;
  height: 60px;
  background: rgba(255, 165, 0, 0.4);
}

.cursor-follower.cursor--hover {
  width: 80px;
  height: 80px;
  border-color: rgba(255, 165, 0, 0.6);
}

.cursor.cursor--click {
  transform: translate(-50%, -50%) scale(0.8);
}

@media (hover: none), (pointer: coarse) {
  .cursor,
  .cursor-follower {
    display: none !important;
  }
  
  * {
    cursor: auto !important;
  }
}

/* ============================================================
   REVEAL ON SCROLL - Corregido
   ============================================================ */

[data-reveal] {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity, transform;
}

[data-reveal].is-revealed {
  opacity: 1;
  transform: translateY(0) !important;
}

[data-reveal="fade"] {
  transform: translateY(0);
}

[data-reveal="fade"].is-revealed {
  opacity: 1;
}

[data-reveal="slide-left"] {
  transform: translateX(-50px);
}

[data-reveal="slide-right"] {
  transform: translateX(50px);
}

[data-reveal="scale"] {
  transform: scale(0.9);
}

[data-reveal="scale"].is-revealed {
  transform: scale(1) !important;
}

/* Stagger delays */
[data-reveal-delay="1"] { transition-delay: 0.1s; }
[data-reveal-delay="2"] { transition-delay: 0.2s; }
[data-reveal-delay="3"] { transition-delay: 0.3s; }
[data-reveal-delay="4"] { transition-delay: 0.4s; }
[data-reveal-delay="5"] { transition-delay: 0.5s; }
[data-reveal-delay="6"] { transition-delay: 0.6s; }

/* ============================================================
   EFECTO TYPEWRITER - Títulos de sección
   ============================================================ */

.typewriter-text {
  display: inline;
}

.typewriter-cursor {
  display: inline-block;
  width: 3px;
  height: 1em;
  background: #FF9500;
  margin-left: 4px;
  animation: blink 0.7s step-end infinite;
  vertical-align: text-bottom;
}

.typewriter-cursor.is-hidden {
  opacity: 0;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ============================================================
   MENÚ FULLSCREEN - Corregido
   ============================================================ */

.menu-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(10, 10, 12, 0.98);
  backdrop-filter: blur(30px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-fullscreen.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.menu-fullscreen-inner {
  text-align: center;
  padding: 20px;
}

.menu-fullscreen-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.menu-fullscreen-list li {
  overflow: hidden;
  margin: 0.3em 0;
}

.menu-fullscreen-list a {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: clamp(36px, 10vw, 80px);
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.15em 0;
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              color 0.3s ease;
}

.menu-fullscreen.is-open .menu-fullscreen-list a {
  transform: translateY(0);
  opacity: 1;
}

/* Stagger animation */
.menu-fullscreen-list li:nth-child(1) a { transition-delay: 0.05s; }
.menu-fullscreen-list li:nth-child(2) a { transition-delay: 0.1s; }
.menu-fullscreen-list li:nth-child(3) a { transition-delay: 0.15s; }
.menu-fullscreen-list li:nth-child(4) a { transition-delay: 0.2s; }
.menu-fullscreen-list li:nth-child(5) a { transition-delay: 0.25s; }
.menu-fullscreen-list li:nth-child(6) a { transition-delay: 0.3s; }

.menu-fullscreen-list a:hover {
  color: #FF9500;
}

.menu-fullscreen-list a::after {
  content: '';
  display: block;
  width: 0;
  height: 4px;
  background: linear-gradient(90deg, #FF9500, #FFD700);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  margin-top: 0.05em;
}

.menu-fullscreen-list a:hover::after {
  width: 100%;
}

/* Cerrar X animation */
.site-header.is-open .nav-toggle__bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.site-header.is-open .nav-toggle__bar:nth-child(2) {
  opacity: 0;
}

.site-header.is-open .nav-toggle__bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ============================================================
   BOTONES FLOTANTES - WhatsApp verde, Scroll naranja
   ============================================================ */

/* WhatsApp - Verde clásico y más grande */
.float-btn--whatsapp,
.float-btn--wa,
a.float-btn[href*="wa.me"] {
  width: 64px !important;
  height: 64px !important;
  background: #25D366 !important;
  border: 2px solid #20BA5A !important;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4),
              0 8px 40px rgba(0, 0, 0, 0.3) !important;
}

.float-btn--whatsapp:hover,
.float-btn--wa:hover,
a.float-btn[href*="wa.me"]:hover {
  background: #20BA5A !important;
  transform: translateY(-4px) scale(1.05) !important;
  box-shadow: 0 8px 30px rgba(37, 211, 102, 0.5),
              0 12px 50px rgba(0, 0, 0, 0.4) !important;
}

.float-btn--whatsapp svg,
.float-btn--wa svg,
a.float-btn[href*="wa.me"] svg {
  width: 28px !important;
  height: 28px !important;
  fill: #fff !important;
}

/* Back to top - Naranja llamativo */
.float-btn--top,
button.float-btn[data-scroll-top] {
  background: linear-gradient(135deg, #FF9500, #FF6B00) !important;
  border: 2px solid #FF9500 !important;
  box-shadow: 0 4px 20px rgba(255, 149, 0, 0.4),
              0 8px 40px rgba(0, 0, 0, 0.3) !important;
}

.float-btn--top:hover,
button.float-btn[data-scroll-top]:hover {
  background: linear-gradient(135deg, #FFB347, #FF9500) !important;
  transform: translateY(-4px) !important;
  box-shadow: 0 8px 30px rgba(255, 149, 0, 0.5),
              0 12px 50px rgba(0, 0, 0, 0.4) !important;
}

.float-btn--top svg,
button.float-btn[data-scroll-top] svg {
  fill: #fff !important;
}

/* Scroll indicator del hero - Naranja y animado */
.scroll-indicator {
  color: #FF9500 !important;
  font-size: 36px !important;
  opacity: 1 !important;
  animation: scrollBounce 2s ease-in-out infinite;
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  text-decoration: none;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 149, 0, 0.5);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
}

.scroll-indicator:hover {
  border-color: #FF9500;
  background: rgba(255, 149, 0, 0.2);
}

@keyframes scrollBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* ============================================================
   SCROLL HORIZONTAL - WORK SECTION
   ============================================================ */

.section--work-horizontal {
  position: relative;
  padding: 0;
  overflow: hidden;
}

.work-horizontal-wrapper {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.work-horizontal-header {
  padding: 60px 0 40px;
}

.work-horizontal-track {
  display: flex;
  gap: 32px;
  padding: 0 32px;
  will-change: transform;
}

.work-horizontal-track .work-card {
  flex: 0 0 auto;
  width: clamp(320px, 45vw, 550px);
}

.work-horizontal-track .work-media {
  border-radius: 16px;
}

.work-horizontal-track .work-video {
  aspect-ratio: 16 / 10;
  height: auto;
}

.work-progress {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.work-progress.is-visible {
  opacity: 1;
}

.work-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #FF9500, #FFD700);
  border-radius: 3px;
  transition: width 0.1s linear;
}

@media (max-width: 768px) {
  .section--work-horizontal {
    padding: 80px 0;
  }
  
  .work-horizontal-wrapper {
    min-height: auto;
    display: block;
  }
  
  .work-horizontal-track {
    flex-direction: column;
    padding: 0 16px;
  }
  
  .work-horizontal-track .work-card {
    width: 100%;
  }
  
  .work-progress {
    display: none;
  }
}

/* ============================================================
   SCROLL-TRIGGERED VIDEO PLAYBACK
   ============================================================ */

.scroll-video video,
.work-media video,
.cat-media video {
  transition: opacity 0.5s ease;
}

.video-paused {
  opacity: 0.7;
}

/* ============================================================
   IMAGE REVEAL EFFECT
   ============================================================ */

.image-reveal {
  position: relative;
  overflow: hidden;
}

.image-reveal::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--bg, #0e0f10);
  z-index: 2;
  transform: scaleX(1);
  transform-origin: right;
  transition: transform 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.image-reveal.is-revealed::before {
  transform: scaleX(0);
}

.image-reveal img,
.image-reveal video {
  transform: scale(1.15);
  transition: transform 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.image-reveal.is-revealed img,
.image-reveal.is-revealed video {
  transform: scale(1);
}

/* ============================================================
   HOVER EFFECTS
   ============================================================ */

.hover-lift {
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
  transform: translateY(-10px);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
}

/* Magnetic effect */
.magnetic {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   GRADIENT TEXT ANIMADO
   ============================================================ */

.gradient-text {
  background: linear-gradient(
    90deg,
    #fff 0%,
    #FF9500 25%,
    #FFD700 50%,
    #FF9500 75%,
    #fff 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientFlow 3s linear infinite;
}

@keyframes gradientFlow {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}

/* ============================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================ */

@media (max-width: 768px) {
  .site-header .nav {
    padding: 16px 20px;
    min-height: 60px;
  }
  
  .site-header .brand,
  .site-header .custom-logo-link {
    font-size: 22px;
  }
  
  .site-header .nav-toggle {
    width: 44px;
    height: 44px;
  }
  
  .float-btn--whatsapp,
  .float-btn--wa,
  a.float-btn[href*="wa.me"] {
    width: 56px !important;
    height: 56px !important;
  }
  
  .scroll-indicator {
    font-size: 28px !important;
    width: 44px;
    height: 44px;
  }
}
