/* ===== VARIABLES Y RESET ===== */
:root {
  --primary-gradient: linear-gradient(135deg, #29242d, #000000);
  --text-primary: #ffffff;
  --skeleton-bg: #2a2a2a;
  --skeleton-shimmer: #3a3a3a;
  --shadow-soft: 0 8px 32px rgba(0, 255, 13, 0.821);
  --transition-smooth: all 0.3s ease;
  --transition-elastic: all 2.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ===== LAYOUT BASE ===== */
body {
  display: block;
  flex-direction: unset;
  height: 100vh;
  margin: 0;
  background: var(--primary-gradient);
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: 'Urbanist', sans-serif;
}

.myGrad.fondo {
  position: fixed;
  top: 0; 
  left: 0; 
  width: 100vw; 
  height: 100vh;
  z-index: -1;
  margin: 0;
  border: none;
  pointer-events: none;
}

/* ===== TÍTULO ===== */
.titulo-container {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 32px;
  margin-bottom: 32px;
}

.titulo-principal {
  font-family: 'Urbanist', sans-serif;
  font-weight: 300;
  color: var(--text-primary);
  text-align: center;
  font-size: 4rem;
  letter-spacing: 2px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.descripcion {
  font-family: 'Urbanist', sans-serif;
  font-weight: 300;
  color: var(--text-primary);
  text-align: center;
  font-size: 1.2rem;
  line-height: 1.6;
  max-width: 800px;
  margin: 0 auto 2rem auto;
  opacity: 0.9;
}

/* ===== CONTENEDOR PRINCIPAL ===== */
.group {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 90vw;
  height: 80vh;
  overflow: hidden;
  margin: 0 auto;
}

/* ===== ITEMS BASE ===== */
.item {
  width: 15vw;
  height: 75vh;
  margin: 1vw;
  border-radius: 3vw;
  display: inline-block;
  cursor: pointer;
  position: relative;
  transition: var(--transition-smooth);
  overflow: hidden;
}

/* ===== SKELETON LOADERS ===== */
.skeleton-loader {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--skeleton-bg);
  border-radius: inherit;
  z-index: 1;
  opacity: 1;
  transition: opacity 0.5s ease;
}

.skeleton-loader.hidden {
  opacity: 0;
  pointer-events: none;
}

.skeleton-shimmer {
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--skeleton-bg) 0%,
    var(--skeleton-shimmer) 50%,
    var(--skeleton-bg) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 2s infinite ease-in-out;
  border-radius: inherit;
}

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

/* ===== IMÁGENES DE FONDO ===== */
.item-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 75%;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 2;
}

.item-bg.loaded {
  opacity: 1;
}

/* ===== OVERLAY PARA TEXTO ===== */
.text-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0%,
    rgba(0,0,0,0.1) 50%,
    rgba(0,0,0,0.4) 100%
  );
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 3;
  pointer-events: none;
}

/* ===== ESTADOS HOVER Y EXPANDED (DESKTOP) ===== */
@media (min-width: 1025px) {
  /* CORREGIDO: Mostrar texto en desktop cuando está expandido */
  .item.expanded::after {
    opacity: 1;
    transition-delay: 0.1s;
  }
}

/* ===== TEXTO DE SECCIONES ===== */
.item::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(8px);
  color: white;
  padding: 20px 30px;
  font-family: 'Urbanist', sans-serif;
  font-weight: 200;
  font-size: clamp(1.8rem, 6vw, 3.5rem);
  text-align: center;
  border-radius: 15px;
  border: 2px solid rgba(255,255,255,0.1);
  opacity: 0;
  transition: all 0.4s ease;
  pointer-events: none;
  white-space: nowrap;
  z-index: 5;
  letter-spacing: 1px;
}

/* Contenido específico para cada sección */
.item.grafico::after {
  content: 'DISEÑO GRÁFICO';
}

.item.web::after {
  content: 'DISEÑO WEB';
}

.item.tresd::after {
  content: 'DISEÑO 3D';
}

.item.contacto::after {
  content: 'CONTACTO';
}

/* ===== RESPONSIVE TABLET ===== */
@media (min-width: 834px) and (max-width: 1024px) {
  .titulo-principal {
    font-size: 4rem;
  }
  
  .group {
    flex-direction: column;
    width: 90vw;
    height: 80vh;
    justify-content: flex-start;
    align-items: center;
  }
  
  .item {
    width: 100%;
    height: 15vh;
    margin: 1vh 0;
    border-radius: 15px;
    transition: var(--transition-smooth);
  }
  
  .item.expanded {
    height: 42vh;
    box-shadow: var(--shadow-soft);
  }
  
  .item.expanded::after {
    opacity: 1;
    transition-delay: 0.2s;
  }
  
  .item.expanded .text-overlay {
    opacity: 1;
  }
}

/* ===== RESPONSIVE MOBILE - SIEMPRE EXPANDIDO ===== */
@media (max-width: 833px) {
  .titulo-principal {
    font-size: 3rem;
    margin-bottom: 16px;
  }
  
  .group {
    flex-direction: column;
    width: 95vw;
    height: auto;
    gap: 2vh;
    padding-bottom: 20px;
  }
  
  .item {
    width: 100%;
    height: 35vh; /* Aumentado de 25vh a 35vh */
    margin: 0;
    border-radius: 12px;
    transition: var(--transition-smooth);
  }
  
  /* MÓVIL: Títulos siempre visibles */
  .item::after {
    opacity: 1; /* Siempre visible en móvil */
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    padding: 15px 25px;
    transition: all 0.3s ease;
  }
  
  /* MÓVIL: Text overlay siempre visible para mejor contraste */
  .item .text-overlay {
    opacity: 0.7; /* Siempre visible en móvil pero más sutil */
  }
  
  /* MÓVIL: Eliminar estados de expansión */
  .item.expanded {
    height: 35vh; /* Mismo tamaño, no cambia */
    box-shadow: none; /* Sin sombra especial */
  }
}

/* ===== ESTADOS DE CARGA ===== */
.item.loading .item-bg {
  opacity: 0;
}

.item.loaded .skeleton-loader {
  opacity: 0;
  pointer-events: none;
}

.item.loaded .item-bg {
  opacity: 1;
}

/* ===== MEJORAS DE ACCESIBILIDAD ===== */
@media (prefers-reduced-motion: reduce) {
  .skeleton-shimmer {
    animation: none;
  }
  
  .item,
  .item::after,
  .text-overlay {
    transition: none;
  }
}

/* ===== FOCUS STATES ===== */
.item:focus {
  outline: 2px solid rgba(255,255,255,0.5);
  outline-offset: 2px;
}

/* ===== PRINT STYLES ===== */
@media print {
  .skeleton-loader {
    display: none;
  }
  
  .item-bg {
    opacity: 1 !important;
  }
}