/* =========================================

   13. LUXURY AMBIENT EFFECTS

   Dolly Beatriz — Immersive Collection

   ========================================= */

/* Variables para la iluminación del cursor */

.inmersive-projects {

  --luz-mouse-x: 50%;

  --luz-mouse-y: 50%;

}

/* Resplandor arquitectónico */

.inmersive-projects::before {

  content: "";

  position: absolute;

  inset: 0;

  z-index: 0;

  background: radial-gradient(

    circle 480px at

    var(--luz-mouse-x) var(--luz-mouse-y),

    rgb(255 255 255 / 48%) 0%,

    rgb(215 194 161 / 11%) 38%,

    transparent 75%

  );

  pointer-events: none;

}

/* Marco editorial */

.projects-experience::before {

  content: "";

  position: absolute;

  inset: -16px -20px;

  z-index: -1;

  border: 1px solid rgb(51 37 31 / 10%);

  pointer-events: none;

}

/* Líneas arquitectónicas discretas */

.projects-experience::after {

  content: "";

  position: absolute;

  top: -16px;

  right: -20px;

  width: 68px;

  height: 68px;

  border-top: 1px solid var(--arena);

  border-right: 1px solid var(--arena);

  pointer-events: none;

}

/* Profundidad del fondo al seleccionar */

.projects-ambient-media {

  animation: movimiento-ambiental 18s ease-in-out infinite alternate;

}

@keyframes movimiento-ambiental {

  from {

    transform: scale(1.08) translate3d(-0.5%, 0, 0);

  }

  to {

    transform: scale(1.14) translate3d(0.5%, -0.6%, 0);

  }

}

/* Resaltar elegantemente el marco activo */

.project-card.is-active::after {

  border-color: rgb(215 194 161 / 80%);

  box-shadow: inset 0 0 0 1px

    rgb(255 255 255 / 18%);

}

/* Pequeño refinamiento en los títulos */

.project-meta h3 {

  text-shadow: 0 2px 16px rgb(0 0 0 / 18%);

}

/* Accesibilidad */

@media (prefers-reduced-motion: reduce) {

  .projects-ambient-media {

    animation: none !important;

  }

  .inmersive-projects::before {

    display: none;

  }

}

@media (max-width: 760px) {

  .projects-experience::before {

    inset: -10px -8px;

  }

  .projects-experience::after {

    right: -8px;

    top: -10px;

    width: 34px;

    height: 34px;

  }

}

/* Portadas provisionales hasta incorporar los renders oficiales */
.project-media--placeholder {
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--cafe), var(--marron));
}
.project-placeholder {
  position: relative;
  z-index: 1;
  color: var(--arena);
  font: 400 clamp(24px, 3vw, 38px)/1.2 var(--fuente-titulos);
  letter-spacing: .22em;
  transform: translateY(-38px);
}

/* =========================================
   CINEMATIC AMBIENT TRANSITIONS
   Fondo con dos capas independientes
   ========================================= */

/* Contenedor de ambos fondos */
.inmersive-projects .projects-ambient {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: -1;
}

/* Ambas fotografías comienzan ocultas */
.inmersive-projects .projects-ambient
.projects-ambient-media {
  position: absolute;
  inset: -7%;

  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  opacity: 0;
  filter: blur(42px) saturate(0.7);

  transform: scale(1.07);

  transition:
    opacity 1300ms ease,
    transform 1700ms cubic-bezier(0.22, 1, 0.36, 1);

  animation: none;
  will-change: opacity;
}

/* Fotografía ambiental seleccionada */
.inmersive-projects .projects-ambient
.projects-ambient-media.is-active {
  opacity: 0.17;
  transform: scale(1.13);
}

/* Conservamos el efecto durante el cambio */
.inmersive-projects .projects-ambient.is-changing
.projects-ambient-media.is-active {
  opacity: 0.17;
}

/* Velo de color piedra perla */
.inmersive-projects .projects-ambient-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;

  background: linear-gradient(
    115deg,
    rgb(232 233 229 / 76%) 0%,
    rgb(232 233 229 / 56%) 45%,
    rgb(232 233 229 / 80%) 100%
  );

  pointer-events: none;
}

/* El contenido permanece por encima del ambiente */
.inmersive-projects .projects-experience {
  position: relative;
  z-index: 2;
}

/* Movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  .inmersive-projects .projects-ambient
  .projects-ambient-media {
    transition: none !important;
    transform: none !important;
    will-change: auto;
  }
}
