/* ══════════════════════════════════════════════════
   DISEÑO DE SISTEMA & ESTILOS CORE - EDUARDO FRANCO
   ══════════════════════════════════════════════════ */

/* Poppins local */
@font-face {
  font-family: 'Poppins';
  src: url('fonts/Poppins-Thin.ttf') format('truetype');
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Poppins';
  src: url('fonts/Poppins-Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Poppins';
  src: url('fonts/Poppins-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Poppins';
  src: url('fonts/Poppins-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Poppins';
  src: url('fonts/Poppins-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Poppins';
  src: url('fonts/Poppins-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-bg: #000000;
  --color-text: #ffffff;
  --color-text-muted: rgba(255, 255, 255, 0.45);
  --color-text-dim: rgba(255, 255, 255, 0.15);
  --color-accent: #ffffff;
  
  --font-sans: 'Poppins', sans-serif;
  --font-serif: 'Cormorant Garamond', serif;
  
  --transition-smooth: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  overflow: hidden;
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Scrollbar personalizado premium */
::-webkit-scrollbar {
  width: 3px;
  height: 3px;
}
::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.4);
}

/* ══ CURSOR MAGNÉTICO / REVELACIÓN NEGATIVA ══ */
body.has-custom-cursor,
body.has-custom-cursor * {
  cursor: none !important;
}

.cursor {
  position: fixed;
  inset: 0;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 10000;
}

.cursor__dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ffffff;
  pointer-events: none;
  transform: translate3d(-100px, -100px, 0) translate(-50%, -50%);
  visibility: hidden;
  z-index: 10001;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.cursor.is-active .cursor__dot {
  visibility: visible;
}

.cursor.is-hidden .cursor__dot,
.cursor.is-reveal .cursor__dot {
  visibility: hidden;
}

.cursor.is-hover .cursor__dot {
  width: 5px;
  height: 5px;
}

/*
  Círculo blanco de revelación (referente):
  mix-blend-mode: difference → sobre negro queda blanco;
  donde cruza letras blancas, esa intersección se vuelve negra.
*/
.circulo-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #ffffff;
  border: none;
  pointer-events: none;
  z-index: 9998;
  transform: translate3d(-100px, -100px, 0) translate(-50%, -50%) scale(0.35);
  /* Clave del referente: invierte solo la intersección con las letras */
  mix-blend-mode: difference;
  visibility: hidden;
  transition: width 0.55s cubic-bezier(0.16, 1, 0.3, 1),
              height 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

.circulo-cursor.is-ready {
  visibility: visible;
}

.cursor.is-hidden ~ .circulo-cursor {
  visibility: hidden;
}

/* Estado menú: círculo grande — letras negras solo dentro del círculo */
.circulo-cursor.is-blend {
  width: clamp(140px, 16vw, 200px);
  height: clamp(140px, 16vw, 200px);
}

/* Aislar fotos/UI para que el negativo se lea sobre tipografía */
.home-slideshow,
.slideshow-overlay,
.hero-firma,
.category-loop-viewport,
.gallery-grid,
.whatsapp-fab,
.lightbox {
  isolation: isolate;
}

/* ══ LOADER (LÍNEA SUPERIOR) ══ */
.loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 2px;
  background: transparent;
  z-index: 10000;
  pointer-events: none;
  transition: opacity 0.6s ease;
}
.loader__line {
  height: 100%;
  width: 0%;
  background: var(--color-accent);
  transition: width 0.1s ease;
}

/* ══ NAVEGACIÓN HORIZONTAL ══ */
.horizontal-container {
  display: flex;
  width: 400vw; /* 4 paneles de 100vw */
  height: 100vh;
  transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.panel {
  width: 100vw;
  height: 100vh;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8rem 6rem;
  position: relative;
  box-sizing: border-box;
  overflow: hidden;
}

/* Trabajos: header arriba + panel con scroll propio */
#panel-trabajos {
  justify-content: flex-start;
  padding-top: 6.5rem;
  overflow-x: hidden;
  overflow-y: auto;
}
#panel-trabajos .section-header {
  flex-shrink: 0;
  width: 100%;
}

/* ══ BOTÓN SUPERIOR DERECHO (INICIO / MENÚ) — siempre visible ══ */
.top-right-btn {
  position: fixed;
  top: 3.5rem;
  right: 6rem;
  background: transparent;
  color: var(--color-text);
  border: none;
  padding: 0.5rem 0;
  cursor: pointer;
  z-index: 1100;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  text-align: right;
  transition: var(--transition-fast);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.top-right-btn:hover {
  letter-spacing: 6px;
  opacity: 0.8;
}
.top-right-btn:focus {
  outline: none;
}
/* Ocultar únicamente durante el loader inicial */
.top-right-btn.hidden {
  opacity: 0;
  pointer-events: none;
}

/* ══ PANEL 1: HOME ══ */
#panel-home {
  padding: 0;
}

/* Slideshow de Fondo */
.home-slideshow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: hidden;
  background: #000;
}
.slideshow-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.08);
  transition: opacity 1.8s ease-in-out, transform 6s cubic-bezier(0.16, 1, 0.3, 1);
  filter: grayscale(10%) contrast(105%);
}
.slideshow-item.active {
  opacity: 1;
  transform: scale(1.02);
}

.slideshow-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--color-bg);
  opacity: 0.96; /* Casi negro para el menú */
  z-index: 2;
  transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

/* Detalle decorativo: oculto en el nuevo layout HOME */
.decor-dot {
  display: none;
}

/* Contenedor principal de contenidos del Home */
.hero-wrapper {
  position: relative;
  z-index: 3;
  width: 100%;
  height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  align-items: center;
  padding: 6rem 6rem 7.5rem;
  box-sizing: border-box;
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Fade out del contenido cuando se oculta el menú */
.hero-wrapper.menu-hidden {
  opacity: 0;
  transform: scale(0.98);
  pointer-events: none;
}

.decor-dot.menu-hidden {
  opacity: 0;
}

/* Columna Izquierda: Firma + loop */
.hero-left {
  display: flex;
  align-items: flex-end;
  align-self: end;
  height: 100%;
  padding-bottom: 6vh;
}
.hero-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  max-width: 70vw;
}
.hero-firma {
  display: block;
  width: min(27.5vw, 500px);
  height: auto;
  user-select: none;
  pointer-events: none;
}
.category-loop-viewport {
  overflow: hidden;
  font-size: clamp(2rem, 6vw, 5.5rem);
  height: 1.35em;
  line-height: 1.35;
  box-sizing: content-box;
}
.category-loop {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1em;
  line-height: 1.35;
  letter-spacing: -0.03em;
  color: #c6c6c6;
  text-transform: none;
  margin: 0;
  display: block;
  will-change: transform, opacity;
  transform: translateY(110%);
  opacity: 0;
  transition: transform 0.65s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.45s ease;
}
.category-loop.is-in {
  transform: translateY(0);
  opacity: 1;
}
.category-loop.is-out {
  transform: translateY(-110%);
  opacity: 0;
}

/* Columna Derecha: Menú principal (arriba a la derecha) */
.hero-right {
  display: flex;
  align-items: flex-start;
  align-self: start;
  justify-content: flex-end;
  padding-top: 5.5rem;
  padding-right: 1rem;
  height: 100%;
}
.main-menu {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  text-align: right;
}
.main-menu .menu-item {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: clamp(2.4rem, 6vw, 5rem);
  /* Color sólido (no rgba): necesario para el corte negro limpio con difference */
  color: #5a5a5a;
  text-decoration: none;
  letter-spacing: 0.04em;
  line-height: 0.95;
  text-transform: uppercase;
  transition: color 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.55s cubic-bezier(0.16, 1, 0.3, 1),
              font-family 0.01s linear,
              font-style 0.01s linear,
              font-weight 0.01s linear;
  display: inline-block;
  transform-origin: right center;
  position: relative;
  z-index: 2;
}
.main-menu .menu-item:hover,
.main-menu .menu-item.is-cursor-target {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: #ffffff;
  transform: translateX(-10px);
  letter-spacing: 0.01em;
}

/* Barra inferior */
.hero-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  z-index: 4;
  padding: 0 6rem 2.75rem;
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.hero-wrapper.menu-hidden ~ .hero-bottom {
  opacity: 0;
  pointer-events: none;
}
.hero-bottom-line {
  width: 100%;
  height: 1px;
  background: rgba(255, 255, 255, 0.85);
  margin-bottom: 1.25rem;
}

.bottom-link {
  background: transparent;
  border: none;
  color: var(--color-text);
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.7rem;
  letter-spacing: 2px;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition-fast);
  text-transform: uppercase;
}
.bottom-link:hover {
  opacity: 0.7;
}

.social-links {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.85rem;
}
.social-divider {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.7rem;
  line-height: 1;
  user-select: none;
}

/* ══ PANELES INTERIORES (TRABAJOS, MANIFIESTO, CONTACTO) ══ */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 1.5rem;
}

.panel h2 {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 300;
  font-size: 2.2rem;
  letter-spacing: 1px;
}

/* Filtros de galería */
.filters-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.85rem;
}
.filter-buttons,
.subfilter-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 1.5rem;
}
.subfilter-buttons {
  gap: 1.1rem;
}
.subfilter-buttons[hidden] {
  display: none;
}
.subfilter-btn {
  font-size: 0.68rem;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.35);
}
.filter-btn {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.75rem;
  letter-spacing: 1px;
  cursor: pointer;
  padding: 0.2rem 0;
  position: relative;
  transition: var(--transition-fast);
}
.filter-btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0%;
  height: 1px;
  background-color: var(--color-accent);
  transition: var(--transition-fast);
}
.filter-btn.active {
  color: var(--color-text);
}
.filter-btn.active::after {
  width: 100%;
}
.filter-btn:hover {
  color: var(--color-text);
}

/* Galería: CSS Grid estándar (sin alturas fijas ni columnas forzadas) */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  align-items: start;
  width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* En pantallas anchas: máximo 3 columnas para evitar tarjetas demasiado bajas */
@media (min-width: 1200px) {
  .gallery-grid {
    grid-template-columns: repeat(3, minmax(280px, 1fr));
  }
}

.gallery-item {
  width: 100%;
  margin: 0;
  padding: 0;
  background-color: #0d0d0d;
  border-radius: 2px;
  cursor: pointer;
}

.gallery-item img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center;
  border-radius: 2px;
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.gallery-item:hover img {
  transform: scale(1.02);
}

/* ══ LIGHTBOX GALERÍA ══ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1),
    visibility 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}
.lightbox.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.lightbox__close {
  position: absolute;
  top: 1.75rem;
  right: 2rem;
  z-index: 3010;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.85);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem;
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.lightbox__close:hover {
  opacity: 0.55;
  transform: scale(1.06);
}
.lightbox__figure {
  position: relative;
  z-index: 3005;
  margin: 0;
  max-width: min(92vw, 1400px);
  max-height: 88vh;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox__img {
  display: block;
  max-width: 100%;
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: scale(0.96) translateY(12px);
  transition:
    opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}
.lightbox.is-open .lightbox__img.is-ready {
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* Panel Manifiesto */
.manifesto-content {
  max-width: 800px;
  margin: 0 auto;
}
.manifesto-content h2 {
  margin-bottom: 3rem;
}
.quote {
  font-family: var(--font-serif);
  font-size: 3rem;
  font-style: italic;
  line-height: 1.2;
  margin-bottom: 2rem;
  color: var(--color-text);
  border-left: none;
  padding-left: 0;
}
.body-text {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--color-text-muted);
}

/* Panel Contacto — editorial blanco / tipografía grande */
#panel-contacto {
  background: #ffffff;
  color: #000000;
  justify-content: flex-start;
  align-items: stretch;
  padding: clamp(1.5rem, 4vw, 3.5rem) clamp(1.5rem, 5vw, 4.5rem);
  overflow-x: hidden;
  overflow-y: auto;
}

.contact-layout {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

.contact-meta {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: clamp(0.62rem, 1.1vw, 0.72rem);
  letter-spacing: 0.08em;
  line-height: 1.55;
  text-transform: uppercase;
  color: #000000;
}

.contact-meta__name {
  font-weight: 600;
}

.contact-meta__link {
  color: inherit;
  text-decoration: none;
}

.contact-meta__link:hover {
  opacity: 0.55;
}

.contact-form {
  width: min(920px, 100%);
  margin: auto 0;
  padding-top: clamp(4.5rem, 10vh, 7rem);
  display: flex;
  flex-direction: column;
}

.contact-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  align-items: end;
  gap: 1rem 1.5rem;
  width: 100%;
  padding: clamp(1.35rem, 3.2vh, 2.4rem) 0 clamp(0.85rem, 1.8vh, 1.25rem);
  border: none;
  border-bottom: 1px solid #000000;
  background: transparent;
  text-align: left;
}

.contact-field__label {
  font-size: clamp(2.4rem, 7vw, 5.4rem);
  line-height: 0.92;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: #000000;
  cursor: text;
}

.contact-field--sans .contact-field__label {
  font-family: var(--font-sans);
  font-weight: 700;
  font-style: normal;
}

.contact-field--serif .contact-field__label,
.contact-submit {
  font-family: var(--font-serif);
  font-weight: 400;
  font-style: italic;
}

.contact-field__input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: clamp(0.58rem, 1.1vw, 0.72rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: right;
  color: #000000;
  padding: 0 0 0.35rem;
  align-self: end;
}

.contact-field__input::placeholder {
  color: rgba(0, 0, 0, 0.35);
  opacity: 1;
}

.contact-field__textarea {
  resize: none;
  min-height: 2.4em;
  line-height: 1.4;
  overflow: hidden;
}

.contact-field--message {
  align-items: start;
}

.contact-field--message .contact-field__label {
  padding-top: 0.15em;
}

.contact-submit {
  display: block;
  width: 100%;
  margin-top: 0;
  padding: clamp(1.35rem, 3.2vh, 2.4rem) 0 clamp(0.85rem, 1.8vh, 1.25rem);
  border: none;
  border-bottom: 1px solid #000000;
  background: transparent;
  font-size: clamp(2.4rem, 7vw, 5.4rem);
  line-height: 0.92;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  text-align: left;
  color: #000000;
  cursor: pointer;
  transition: opacity 0.35s ease;
}

.contact-submit:hover {
  opacity: 0.45;
}

/* INICIO en negro solo cuando estamos en Contacto */
body.on-contact .top-right-btn {
  color: #000000;
  background: transparent;
}
body.on-contact .top-right-btn:hover {
  opacity: 0.65;
}

/* ══ MODAL DE CRÉDITOS ══ */
.credits-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}
.credits-modal.active {
  opacity: 1;
  pointer-events: auto;
}
.credits-modal__backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.credits-modal__content {
  position: relative;
  background: #080808;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4.5rem 3.5rem;
  width: 90%;
  max-width: 440px;
  border-radius: 4px;
  text-align: center;
  z-index: 2010;
  transform: scale(0.95);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.credits-modal.active .credits-modal__content {
  transform: scale(1);
}
.credits-modal__close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: transparent;
  border: none;
  color: var(--color-text);
  font-size: 1.8rem;
  cursor: pointer;
  line-height: 1;
  transition: opacity 0.3s ease;
}
.credits-modal__close:hover {
  opacity: 0.6;
}
.credits-modal h4 {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: 4px;
  margin-bottom: 2rem;
  color: var(--color-text);
}
.credits-modal p {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-style: italic;
  line-height: 1.6;
  color: var(--color-text-muted);
  margin-bottom: 1.2rem;
}
.credits-modal p:last-child {
  margin-bottom: 0;
}

/* ══ WHATSAPP FLOTANTE ══ */
.whatsapp-fab {
  position: fixed;
  /* Alineado bajo CONTÁCTO: padding del hero (6rem) + hero-right (1rem) */
  right: 7rem;
  left: auto;
  bottom: 5.75rem;
  z-index: 1500;
  text-decoration: none;
  color: var(--color-text);
  opacity: 0;
  animation: whatsapp-fab-enter 0.9s cubic-bezier(0.16, 1, 0.3, 1) 1.1s forwards;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

/* Oculto solo en el slide Trabajos; visible en Home y el resto */
body.on-trabajos .whatsapp-fab {
  opacity: 0 !important;
  visibility: hidden;
  pointer-events: none;
  animation: none;
}

.whatsapp-fab__pill {
  display: inline-flex;
  flex-direction: row-reverse;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 3.25rem;
  height: 3.25rem;
  max-width: 3.25rem;
  padding: 0;
  box-sizing: border-box;
  overflow: visible;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transition:
    max-width 0.55s cubic-bezier(0.16, 1, 0.3, 1),
    width 0.55s cubic-bezier(0.16, 1, 0.3, 1),
    padding 0.45s cubic-bezier(0.16, 1, 0.3, 1),
    gap 0.35s ease,
    background 0.35s ease,
    border-color 0.35s ease,
    transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  animation: whatsapp-fab-float 3.6s ease-in-out 2s infinite;
}

.whatsapp-fab__label {
  display: block;
  flex: 0 0 auto;
  width: 0;
  max-width: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  white-space: nowrap;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: none;
  color: rgba(255, 255, 255, 0.88);
  opacity: 0;
  transform: none;
  transition:
    opacity 0.35s ease,
    width 0.55s cubic-bezier(0.16, 1, 0.3, 1),
    max-width 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

.whatsapp-fab__icon {
  flex-shrink: 0;
  width: 1.55rem;
  height: 1.55rem;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  overflow: hidden;
  border-radius: 50%;
  transition: margin 0.35s ease, transform 0.35s ease;
}

.whatsapp-fab__icon img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  /* PNG blanco sobre negro: el negro se funde en el fondo oscuro */
  mix-blend-mode: lighten;
}

.whatsapp-fab:hover .whatsapp-fab__pill,
.whatsapp-fab:focus-visible .whatsapp-fab__pill {
  width: auto;
  max-width: 22rem;
  padding: 0 0.35rem 0 1.3rem;
  gap: 0;
  overflow: hidden;
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(8, 8, 8, 0.92);
  transform: translateY(-2px);
  animation-play-state: paused;
}

/* Solo el icono: separación ligera a la derecha del texto */
.whatsapp-fab:hover .whatsapp-fab__icon,
.whatsapp-fab:focus-visible .whatsapp-fab__icon {
  margin-left: 8px;
  margin-right: 0.55rem;
}

.whatsapp-fab:hover .whatsapp-fab__label,
.whatsapp-fab:focus-visible .whatsapp-fab__label {
  width: auto;
  max-width: 18rem;
  opacity: 1;
  transform: none;
}

.whatsapp-fab:focus {
  outline: none;
}

.whatsapp-fab:focus-visible .whatsapp-fab__pill {
  outline: 1px solid rgba(255, 255, 255, 0.45);
  outline-offset: 3px;
}

/* Contacto (fondo blanco): invertir a pastilla clara */
body.on-contact .whatsapp-fab {
  color: #000000;
}

body.on-contact .whatsapp-fab__pill {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(0, 0, 0, 0.18);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
}

body.on-contact .whatsapp-fab__label {
  color: rgba(0, 0, 0, 0.78);
}

body.on-contact .whatsapp-fab__icon img {
  /* En Contacto (fondo claro): icono negro, fondo blanco del PNG se funde */
  filter: invert(1);
  mix-blend-mode: multiply;
}

body.on-contact .whatsapp-fab:hover .whatsapp-fab__pill,
body.on-contact .whatsapp-fab:focus-visible .whatsapp-fab__pill {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.28);
}

@keyframes whatsapp-fab-enter {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes whatsapp-fab-float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

/* ══ RESPONSIVE DESIGN (MEDIA QUERIES) ══ */
@media (max-width: 1024px) {
  .hero-wrapper {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    gap: 2rem;
    padding: 5.5rem 4rem 7rem;
    align-content: stretch;
  }
  .hero-right {
    order: -1;
    padding-top: 0.5rem;
    padding-right: 0;
    padding-bottom: 0;
    justify-content: flex-end;
    align-items: flex-start;
    align-self: start;
    height: auto;
  }
  .hero-left {
    align-items: flex-start;
    align-self: end;
    justify-content: flex-start;
    height: auto;
    padding-bottom: 5vh;
  }
  .category-loop-viewport {
    font-size: clamp(1.3rem, 5vw, 3.25rem);
  }
  .category-loop {
    text-align: left;
  }
  .hero-brand {
    align-items: flex-start;
    max-width: 100%;
    text-align: left;
  }
  .hero-firma {
    width: min(36vw, 390px);
  }
  .main-menu {
    align-items: flex-end;
    text-align: right;
    gap: 1rem;
  }
  .main-menu .menu-item {
    font-size: clamp(1.7rem, 7vw, 3.2rem);
    font-weight: 100;
    transform-origin: right center;
  }
  .main-menu .menu-item:hover {
    transform: translateX(-6px);
  }
  .top-right-btn {
    top: 2rem;
    right: 4rem;
    z-index: 1200;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }
  .hero-bottom {
    padding: 0 4rem 2.5rem;
    align-items: flex-start;
  }
  .whatsapp-fab {
    right: 4rem;
  }
  .panel {
    padding: 6rem 4rem;
  }
}

@media (max-width: 768px) {
  /* Layout vertical: sin slide horizontal ni overflow lateral */
  html {
    overflow-x: hidden;
  }

  body {
    overflow-x: hidden;
    overflow-y: auto;
    height: auto;
    min-height: 100%;
  }

  .horizontal-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 0;
    transform: none !important;
    transition: none;
    will-change: auto;
  }

  .panel {
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 0;
    flex-shrink: 1;
    padding: 5.5rem 1.5rem 4rem;
    overflow: visible;
    overflow-x: hidden;
  }

  #panel-home {
    min-height: 100svh;
    height: 100svh;
    padding: 0;
    overflow: hidden;
  }

  #panel-trabajos {
    justify-content: flex-start;
    padding-top: 5.5rem;
    padding-bottom: 4rem;
    overflow-x: hidden;
    overflow-y: visible;
  }

  #panel-trabajos .gallery-grid {
    width: 100%;
  }

  #panel-manifiesto,
  #panel-contacto {
    min-height: auto;
    justify-content: flex-start;
  }

  .hero-wrapper {
    padding: 4.5rem 1.75rem 6.5rem;
    gap: 1.75rem;
    width: 100%;
    max-width: 100%;
    height: 100%;
    min-height: 100svh;
  }
  .hero-firma {
    width: min(41vw, 340px);
    max-width: 100%;
  }
  .category-loop-viewport {
    font-size: clamp(1.1rem, 4.5vw, 2.4rem);
    max-width: 100%;
  }
  .main-menu .menu-item {
    font-size: clamp(1.5rem, 6.5vw, 2.6rem);
  }
  .hero-bottom {
    padding: 0 1.75rem 2rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .social-links {
    gap: 0.55rem;
    flex-wrap: wrap;
    justify-content: flex-start;
    max-width: 100%;
  }
  .bottom-link {
    font-size: 0.6rem;
    letter-spacing: 1.5px;
  }
  .top-right-btn {
    top: 1.35rem;
    right: 1.5rem;
    font-size: 0.7rem;
    letter-spacing: 2.5px;
    z-index: 1200;
    background: rgba(0, 0, 0, 0.35);
    padding: 0.45rem 0;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 2rem;
    width: 100%;
    max-width: 100%;
  }
  .filters-wrap {
    align-items: flex-start;
    width: 100%;
    max-width: 100%;
  }
  .filter-buttons,
  .subfilter-buttons {
    justify-content: flex-start;
    gap: 1rem 1.25rem;
    width: 100%;
    max-width: 100%;
  }

  /* Galería móvil: mismo grid auto-fit */
  .gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 1.25rem;
    width: 100%;
    max-width: 100%;
  }

  .gallery-item {
    width: 100%;
    max-width: 100%;
  }

  .gallery-item img {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
  }

  .manifesto-content,
  .contact-layout {
    width: 100%;
    max-width: 100%;
  }

  .quote {
    font-size: 2.2rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  #panel-contacto {
    min-height: auto;
    padding: 5.5rem 1.25rem 3rem;
  }

  .contact-meta {
    position: relative;
    margin-bottom: 2.5rem;
  }

  .contact-form {
    padding-top: 0;
    margin: 0;
  }

  .contact-field {
    grid-template-columns: 1fr;
    gap: 0.55rem;
    padding: 1.5rem 0 0.9rem;
  }

  .contact-field__label,
  .contact-submit {
    font-size: clamp(2.1rem, 12vw, 3.2rem);
  }

  .contact-field__input {
    text-align: left;
  }

  .contact-submit {
    padding: 1.5rem 0 0.9rem;
  }

  .whatsapp-fab {
    right: 1.75rem;
    left: auto;
    bottom: 4.85rem;
  }

  .whatsapp-fab__pill {
    width: 3rem;
    height: 3rem;
    max-width: 3rem;
    padding: 0;
  }

  .whatsapp-fab:hover .whatsapp-fab__pill,
  .whatsapp-fab:focus-visible .whatsapp-fab__pill {
    width: auto;
    max-width: 18rem;
    padding: 0 0.3rem 0 1.1rem;
  }

  .whatsapp-fab:hover .whatsapp-fab__icon,
  .whatsapp-fab:focus-visible .whatsapp-fab__icon {
    margin-left: 8px;
    margin-right: 0.45rem;
  }

  .whatsapp-fab__label {
    font-size: 0.64rem;
    letter-spacing: 0.05em;
  }
}

/*
  Firma (.hero-firma) en móvil: +5% adicional.
  Escritorio/portátil sin cambios: min(27.5vw, 500px).
  Base móvil previa min(41vw, 340px) × 1.05 = min(43.05vw, 357px).
*/
@media (max-width: 767px) {
  .hero-firma {
    width: min(43.05vw, 357px);
    max-width: 100%;
  }
}

/* En táctil: pastilla abierta (sin hover) */
@media (hover: none), (pointer: coarse) {
  .whatsapp-fab__pill {
    width: auto;
    max-width: 18rem;
    height: 3rem;
    padding: 0 0.3rem 0 1.1rem;
    gap: 0;
    animation: none;
  }

  .whatsapp-fab__icon {
    margin-left: 8px;
    margin-right: 0.45rem;
  }

  .whatsapp-fab__label {
    width: auto;
    max-width: 14rem;
    opacity: 1;
    transform: none;
  }
}

/* Sin cursor custom en táctil */
@media (hover: none), (pointer: coarse) {
  body.has-custom-cursor,
  body.has-custom-cursor * {
    cursor: auto !important;
  }
  .cursor,
  .circulo-cursor {
    display: none !important;
  }
}

/* Accesibilidad: Reducir animaciones si se prefiere */
@media (prefers-reduced-motion: reduce) {
  .horizontal-container {
    transition: none;
  }
  .slideshow-item {
    transition: none;
    transform: none;
  }
  .slideshow-overlay {
    transition: none;
  }
  .hero-wrapper {
    transition: none;
  }
  .gallery-item img {
    transition: none;
  }
  .credits-modal, .credits-modal__content {
    transition: none;
  }
  .whatsapp-fab,
  .whatsapp-fab__pill {
    animation: none;
  }
  .whatsapp-fab {
    opacity: 1;
  }
  .lightbox,
  .lightbox__img {
    transition: none;
  }
  .lightbox.is-open .lightbox__img.is-ready {
    transform: none;
  }
}