/* =================================================================
   Visual Nails — gallery-sphere.css
   Galería 3D (esfera Fibonacci scroll-driven, GSAP). Paleta de marca.
   Basado en el efecto provisto, re-tematizado a malva/rosa profundo.
   ================================================================= */

.showcase {
  --card-w: 168px;
  --card-h: 224px;
  position: relative;
  background: radial-gradient(120% 120% at 50% 0%, var(--plum-deep-2) 0%, var(--plum-deep) 70%);
  color: var(--on-dark);
}
.showcase__grid-overlay {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(120% 100% at 50% 30%, #000 40%, transparent 90%);
}

/* Contenedor de scroll (define el largo del recorrido) */
.gallery-container {
  position: relative;
  height: 300vh;
  width: 100%;
  z-index: 1;
}

.scene {
  position: sticky; top: 0;
  height: 100vh; width: 100%;
  display: flex; justify-content: center; align-items: center;
  perspective: 1200px;
  overflow: hidden;
}

.sphere {
  position: relative; width: 0; height: 0;
  transform-style: preserve-3d;
}

/* Tarjeta tipo "clay" re-tematizada */
.clay-card {
  position: absolute;
  width: var(--card-w); height: var(--card-h);
  left: calc(var(--card-w) / -2); top: calc(var(--card-h) / -2);
  background: #2a1c2b;
  border-radius: 16px; padding: 7px;
  transform-style: preserve-3d; backface-visibility: visible;
  border: 1px solid rgba(255,255,255,0.05);
  box-shadow: 8px 12px 26px rgba(0,0,0,.5), inset 2px 2px 5px rgba(255,255,255,.05), inset -2px -2px 6px rgba(0,0,0,.5);
  transition: filter .4s var(--ease);
}
.clay-card img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 10px;
  filter: none;                /* color completo: todas las imágenes claras */
  transition: filter .45s var(--ease);
}
.clay-card.active-card { filter: drop-shadow(0 0 24px rgba(235,180,188,.45)); }

/* Texto flotante lateral — anclado DENTRO de la escena fija (no se solapa con el hero) */
.floating-text {
  position: absolute; z-index: 5;
  top: 50%; left: clamp(1rem, 5vw, 6%);
  transform: translateY(-50%);
  width: min(340px, 40vw);
  padding: 1rem 1.2rem;
  background: linear-gradient(120deg, rgba(43,30,44,.55), rgba(43,30,44,0));
  border-radius: var(--radius);
}
.floating-text .eyebrow { color: var(--blush); display: block; margin-bottom: .8rem; }
.floating-text h2 { color: var(--on-dark); font-size: clamp(1.7rem, 3.2vw, 2.4rem); margin-bottom: .9rem; text-shadow: 0 6px 24px rgba(0,0,0,.5); }
.floating-text p { color: rgba(251,246,239,.8); font-size: .98rem; }
.floating-text .meta { margin-top: 1rem; display: inline-flex; gap: .5rem; align-items: center; font-size: .82rem; color: var(--blush); font-weight: 600; letter-spacing: .04em; }

.network-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }

/* Fallback estático (reduced-motion / sin JS): grid simple */
.showcase__fallback { display: none; }
.no-sphere .gallery-container { display: none; }
.no-sphere .showcase__fallback {
  display: grid; position: relative; z-index: 1;
  grid-template-columns: repeat(4, 1fr); gap: .8rem;
  padding-block: clamp(2.5rem, 6vw, 4rem);
}
.no-sphere .showcase__fallback img { border-radius: var(--radius-sm); aspect-ratio: 3/4; object-fit: cover; width: 100%; }

@media (max-width: 768px) {
  /* Esfera adaptada a móvil: cards más chicas y 3D menos extremo */
  .showcase { --card-w: 104px; --card-h: 138px; }
  .scene {
    perspective: 900px;
    align-items: center;
    padding-bottom: 30vh;   /* sube la esfera para dejar espacio al texto */
  }

  /* Texto de técnica a lo ancho, en la zona media-baja (no al fondo, no se pierde) */
  .floating-text {
    top: 58%; bottom: auto; left: 0; right: 0;
    transform: none; width: 100%;
    text-align: center;
    padding: 1rem 1.3rem 0;
    background: none;
  }
  .floating-text h2 { font-size: 1.5rem; margin-bottom: .6rem; }
  .floating-text p { font-size: .92rem; }
  .floating-text .meta { justify-content: center; }

  /* Fallback (reduced-motion / sin GSAP): cuadrícula a 2 columnas */
  .no-sphere .showcase__fallback { grid-template-columns: repeat(2, 1fr); gap: .6rem; }
}
