/* ==========================================================================
   COMPONENTES MODULARES — HEADER EDITORIAL CON FIRMA GRANDE,
   CUADRADOS SEGUIDORES DE CURSOR, MARQUEE Y LIGHTBOX
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. HEADER CON FIRMA GRANDE ARRIBA A LA IZQUIERDA (ESTILO ELDA BROGLIO)
   -------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding-top: 1.5rem;
  padding-bottom: 1rem;
  z-index: var(--z-nav);
  pointer-events: none;
  background-color: transparent;
  transition: transform var(--transition-normal);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

/* Firma Grande a la Izquierda — Totalmente Visible y Protagonista */
.header-signature-anchor {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  position: relative;
  z-index: calc(var(--z-nav) + 2);
  transform-origin: left center;
}

.header-signature-img {
  height: clamp(62px, 7vw, 92px);
  width: auto;
  max-width: 280px;
  object-fit: contain;
  display: block;
  transform-origin: 30% 50%;
  animation: signatureOrganicMotion 6s ease-in-out infinite;
  transition: transform 0.4s var(--ease-out-expo), filter 0.3s;
  filter: contrast(1.15) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.05));
}

.header-signature-anchor:hover .header-signature-img {
  animation-play-state: paused;
  transform: rotate(-5deg) scale(1.1);
  filter: contrast(1.2) drop-shadow(0 6px 14px rgba(0, 0, 0, 0.12));
}

/* Movimiento orgánico sutil de la firma */
@keyframes signatureOrganicMotion {
  0%, 100% {
    transform: rotate(0deg) scale(1) translateY(0);
  }
  25% {
    transform: rotate(-2.5deg) scale(1.03) translateY(-2px);
  }
  50% {
    transform: rotate(1.8deg) scale(0.98) translateY(1.5px);
  }
  75% {
    transform: rotate(-1.2deg) scale(1.02) translateY(-1px);
  }
}

/* Contenedor del Menú de Navegación a la Derecha */
.header-nav-wrapper {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 1rem;
}

/* Cápsula de enlaces del menú */
.nav-pill-capsule {
  display: inline-flex;
  align-items: center;
  background-color: #ffffff;
  border: 1px solid var(--color-border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  border-radius: var(--radius-full);
  padding: 0.35rem 0.6rem;
  gap: 0.25rem;
  transition: box-shadow var(--transition-normal), border-color var(--transition-normal);
}

.nav-pill-capsule:hover {
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.08);
  border-color: var(--color-border-hover);
}

.nav-pill-link {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  padding: 0.5rem 1.15rem;
  border-radius: var(--radius-full);
  transition: background-color var(--transition-fast), color var(--transition-fast);
  white-space: nowrap;
}

.nav-pill-link:hover,
.nav-pill-link.active {
  color: var(--color-text);
  background-color: rgba(0, 0, 0, 0.06);
}

/* Botón Contacto en Píldora */
.nav-contact-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #ffffff;
  border: 1px solid var(--color-text);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05);
  border-radius: var(--radius-full);
  padding: 0.65rem 1.6rem;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text);
  transition: all var(--transition-normal);
  white-space: nowrap;
}

.nav-contact-pill:hover {
  background-color: var(--color-text);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Botón Hamburguesa Mobile */
.menu-toggle {
  display: none;
  background: #ffffff;
  border: 1px solid var(--color-border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  border-radius: var(--radius-full);
  cursor: pointer;
  padding: 0.85rem;
  z-index: calc(var(--z-nav) + 2);
  color: var(--color-text);
}

.menu-toggle-icon {
  width: 22px;
  height: 14px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.menu-toggle-icon span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--color-text);
  border-radius: 2px;
  transition: transform var(--transition-normal), opacity var(--transition-normal);
}

.menu-toggle.is-open .menu-toggle-icon span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.menu-toggle.is-open .menu-toggle-icon span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.is-open .menu-toggle-icon span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* Menú Overlay Mobile en Blanco */
.mobile-nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  background-color: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  z-index: calc(var(--z-nav) + 1);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--container-padding);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.mobile-nav-overlay.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.mobile-nav-item {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 10vw, 4.5rem);
  font-weight: 400;
  font-style: italic;
  color: var(--color-text);
  letter-spacing: -0.02em;
  transform: translateY(20px);
  opacity: 0;
  transition: transform var(--transition-normal), opacity var(--transition-normal), color var(--transition-fast);
}

.mobile-nav-overlay.is-active .mobile-nav-item {
  transform: translateY(0);
  opacity: 1;
}

.mobile-nav-overlay.is-active .mobile-nav-item:nth-child(1) { transition-delay: 0.1s; }
.mobile-nav-overlay.is-active .mobile-nav-item:nth-child(2) { transition-delay: 0.15s; }
.mobile-nav-overlay.is-active .mobile-nav-item:nth-child(3) { transition-delay: 0.2s; }
.mobile-nav-overlay.is-active .mobile-nav-item:nth-child(4) { transition-delay: 0.25s; }

.mobile-nav-item:hover,
.mobile-nav-item:focus {
  opacity: 0.6;
}

.mobile-nav-footer {
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mobile-nav-footer a {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
}

/* --------------------------------------------------------------------------
   2. CUADRADOS QUE SIGUEN EL CURSOR (INTERACTIVO)
   -------------------------------------------------------------------------- */
.cursor-squares-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none !important;
  z-index: 9999999;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.cursor-squares-container.is-active {
  opacity: 1;
}

/* Cada nodo cuadrado seguidor */
.cursor-square-node {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none !important;
  transform-origin: center center;
  transition: width 0.25s var(--ease-out-expo),
              height 0.25s var(--ease-out-expo),
              background-color 0.25s var(--ease-out-expo),
              border-color 0.25s var(--ease-out-expo),
              border-radius 0.25s var(--ease-out-expo);
  will-change: transform;
}

.cursor-square-node.is-bordered {
  border: 1.5px solid #111113;
  background-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.cursor-square-node.is-filled {
  background-color: #111113;
  border: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

/* Cuadrado líder */
.cursor-square-lead {
  border: 2px solid #111113;
  background-color: rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.cursor-square-lead::after {
  content: '';
  width: 3px;
  height: 3px;
  background-color: #111113;
  border-radius: 1px;
}

.cursor-square-text {
  display: none;
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #ffffff;
  pointer-events: none;
  text-align: center;
}

/* Estado al pasar por proyectos: el cuadrado se expande con texto */
.cursor-square-lead.is-hovering-project {
  width: 88px !important;
  height: 88px !important;
  background-color: #111113 !important;
  border-color: #111113 !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
  border-radius: 8px;
}

.cursor-square-lead.is-hovering-project::after {
  display: none;
}

.cursor-square-lead.is-hovering-project .cursor-square-text {
  display: block;
}

/* Partículas cuadradas en la estela de movimiento */
.cursor-square-particle {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none !important;
  border: 1.5px solid rgba(17, 17, 19, 0.6);
  background-color: transparent;
  opacity: 0.8;
  transition: opacity 0.5s var(--ease-out-expo), transform 0.5s var(--ease-out-expo);
  will-change: transform, opacity;
}

.cursor-square-particle.is-filled {
  background-color: rgba(17, 17, 19, 0.55);
  border: none;
}

/* --------------------------------------------------------------------------
   3. MARQUEE INFINITO
   -------------------------------------------------------------------------- */
.marquee-wrapper {
  width: 100%;
  overflow: hidden;
  user-select: none;
  background-color: #ffffff;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  padding: 2rem 0;
  position: relative;
}

.marquee-track {
  display: flex;
  width: max-content;
  will-change: transform;
  animation: marqueeLoop var(--marquee-speed) linear infinite;
}

.marquee-wrapper:hover .marquee-track {
  animation-play-state: paused;
}

.marquee-content {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.marquee-item {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.5vw, 3.25rem);
  font-style: italic;
  font-weight: 400;
  color: var(--color-text);
  padding: 0 2rem;
  display: inline-flex;
  align-items: center;
  gap: 2rem;
  white-space: nowrap;
}

.marquee-item .marquee-sep {
  font-size: 0.6em;
  font-style: normal;
  color: var(--color-text-muted);
}

@keyframes marqueeLoop {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-50%, 0, 0); }
}

/* --------------------------------------------------------------------------
   4. BOTONES EDITORIALES
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.05rem 2.25rem;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: var(--radius-full);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
  border: 1px solid transparent;
  text-align: center;
}

.btn-primary {
  background-color: #111113;
  color: #ffffff;
  border-color: #111113;
}

.btn-primary:hover {
  background-color: #000000;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.btn-outline {
  background-color: #ffffff;
  color: var(--color-text);
  border-color: var(--color-border-hover);
}

.btn-outline:hover {
  border-color: var(--color-text);
  background-color: rgba(0, 0, 0, 0.03);
  transform: translateY(-2px);
}

.btn-whatsapp {
  background-color: #128c7e;
  color: #ffffff;
  border-color: #128c7e;
}

.btn-whatsapp:hover {
  background-color: #075e54;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(18, 140, 126, 0.25);
}

.btn-icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
  transition: transform var(--transition-fast);
}

.btn:hover .btn-icon {
  transform: translateX(3px);
}

/* --------------------------------------------------------------------------
   5. LIGHTBOX DE IMÁGENES
   -------------------------------------------------------------------------- */
.lightbox-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: var(--z-lightbox);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal), visibility var(--transition-normal);
  padding: 2rem;
}

.lightbox-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-image {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.12);
  transform: scale(0.96);
  transition: transform var(--transition-normal);
}

.lightbox-modal.is-open .lightbox-image {
  transform: scale(1);
}

.lightbox-caption {
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: #ffffff;
  border: 1px solid var(--color-border);
  color: var(--color-text);
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.lightbox-close:hover {
  background-color: var(--color-text);
  color: #ffffff;
  transform: rotate(90deg);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: #ffffff;
  border: 1px solid var(--color-border);
  color: var(--color-text);
  width: 50px;
  height: 50px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.lightbox-nav:hover {
  background-color: var(--color-text);
  color: #ffffff;
}

.lightbox-prev { left: 2rem; }
.lightbox-next { right: 2rem; }

/* --------------------------------------------------------------------------
   6. ANIMACIONES DE REVEAL
   -------------------------------------------------------------------------- */
.reveal-init {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.85s var(--ease-out-expo), transform 0.85s var(--ease-out-expo);
  will-change: opacity, transform;
}

.reveal-init.is-inview {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
