*{ box-sizing: border-box; }
html, body{ height:100%; margin:0; }

body{
  overflow: hidden;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;

  background:
    radial-gradient(circle at 40% 20%, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.0) 55%),
    radial-gradient(circle at 70% 35%, rgba(255,255,255,0.50) 0%, rgba(255,255,255,0.0) 60%),
    radial-gradient(circle at 35% 20%, #ffffff 0%, #f1f1f1 35%, #dcdcdc 100%);
}

/* Escenario */
#stage{
  position: fixed;
  inset: 0;
  overflow: hidden;
  perspective: 1200px;
  touch-action: none; /* ayuda con drag en touch */
}

/* Mundo desplazable */
#world{
  position: absolute;
  inset: 0;
  z-index: 3;
  will-change: transform;
  transform: translate3d(0,0,0);
}

/* “Pared” suave */
#wall{
  position: absolute;
  inset: 0;
  z-index: 0;
  background: none !important;
  pointer-events: none;
}

#frames{
  position: absolute;
  inset: 0;
}

/* Tarjetas */
.frame{
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--w);
  transform-origin: center;
  cursor: pointer;
  user-select: none;

  /* Base */
  --scale: 1;
  --kick: 0deg; /* acá metemos +/-10deg en hover/click */

  transform:
    perspective(1200px)
    rotateY(var(--ry))
    rotateZ(calc(var(--rz) + var(--kick)))
    scale(var(--scale));

  transition:
    transform 160ms ease,
    filter 160ms ease;

  filter: drop-shadow(0 18px 55px rgba(0,0,0,0.25));
}

.frame img{
  max-height: 62vh;
  object-fit: contain;
}

.frame .mat{
  background: #f8f8f8;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.10);
  box-shadow: 0 14px 40px rgba(0,0,0,0.16);

  /* flote suave sin tocar transform del contenedor */
  animation: floaty 6.5s ease-in-out infinite;
  animation-delay: var(--delay);
}

@keyframes floaty{
  0%,100%{ transform: translateY(0px); }
  50%{ transform: translateY(-10px); }
}

.frame img{
  display:block;
  width:100%;
  height:auto;
  border-radius: 4px;
  -webkit-user-drag: none;
}

.frame .label{
  margin-top: 8px;
  font-size: 12px;
  color: rgba(0,0,0,0.60);
}

/* ✅ EFECTO HOVER/CLICK */
/* Asegura stacking correcto */
.frame .mat{
  position: relative;
  z-index: 0;
}

/* ✅ Placa sólida detrás (siempre) para que el shadow se note */
.frame .mat::before{
  content:"";
  position:absolute;
  inset: -10px;                 /* “margen” sólido detrás */
  background: rgba(255,255,255,0.96);
  border-radius: 14px;
  z-index: -2;
  box-shadow: 0 20px 60px rgba(0,0,0,0.22);  /* shadow sobre algo sólido */
}

/* ✅ Borde amarillo solo cuando está activa (hover/click) */
.frame.is-active .mat::after{
  content:"";
  position:absolute;
  inset: -10px;                 /* mismo tamaño que la placa */
  border: 10px solid #ffd400;    /* borde 5px */
  border-radius: 20px;
  z-index: -1;
  pointer-events: none;
}

.frame.is-active .mat{
  outline: 5px solid #ffd400;  /* borde amarillo 5 */
  outline-offset: 6px;         /* “margen” alrededor */
}

/* ===== Curatorial text blocks ===== */
.curatorial{
  position: absolute;
  left: var(--x);
  top: 40%;
  transform: translateY(-50%);

  width: var(--w);
  text-align: center;
  color: rgba(0,0,0,0.88);

  padding: 18px 22px;
  z-index: 4;
  user-select: none;
}

.curatorial .kicker{
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.65;
  margin-bottom: 8px;
}

.curatorial .title{
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
}

.curatorial .subtitle{
  font-size: 18px;
  font-weight: 650;
  opacity: 0.72;
  margin: 10px 0 0 0;
}

.curatorial .desc{
  font-size: 14px;
  line-height: 1.7;
  opacity: 0.70;
  margin: 12px auto 0;
  max-width: 56ch;
}

@media (max-width: 820px){
  .curatorial .title{ font-size: 32px; }
  .curatorial .subtitle{ font-size: 16px; }
}

#noiseLayer{
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  opacity: 0.18;           /* ajustá: 0.10–0.30 */
  mix-blend-mode: multiply;

  background:
    radial-gradient(circle at 20% 30%, rgba(0,0,0,0.18) 0 1px, transparent 2px) 0 0/22px 22px,
    radial-gradient(circle at 70% 60%, rgba(0,0,0,0.12) 0 1px, transparent 2px) 0 0/18px 18px,
    radial-gradient(circle at 40% 80%, rgba(0,0,0,0.10) 0 1px, transparent 2px) 0 0/26px 26px;

  filter: contrast(120%) brightness(110%);
  animation: noiseShift 0.9s steps(2) infinite;
}

@keyframes noiseShift{
  0%   { transform: translate3d(0,0,0); }
  25%  { transform: translate3d(-1px, 1px,0); }
  50%  { transform: translate3d(1px,-1px,0); }
  75%  { transform: translate3d(-1px,-1px,0); }
  100% { transform: translate3d(1px, 1px,0); }
}


/* Base oscura con corte fijo */
#bottomStrip{
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 20vh;
  background: rgba(0,0,0,0.88);
  pointer-events: none;
  z-index: 2; /* ✅ debajo de tarjetas */
}
#bottomStrip::before{
  content:"";
  position:absolute;
  left:0; right:0; top:0;
  height: 2px;
  background: rgba(255,255,255,0.12);
}

/* Indicador */
#scrollIndicator{
  position: fixed;
  right: 18px;
  bottom: 22px;
  z-index: 12;
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(0,0,0,0.08);
  color: rgba(0,0,0,0.65);
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 999px;
  box-shadow: 0 10px 22px rgba(0,0,0,0.12);
  user-select: none;
}
#scrollIndicator .ind-line{
  font-weight: 600;
  letter-spacing: 0.2px;
}

#scrollIndicator .dots{
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
}

#scrollIndicator .dot{
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(0,0,0,0.18);
}

#scrollIndicator .dot.visible{
  background: rgba(0,0,0,0.45);
}

#scrollIndicator .dot.current{
  background: #ffd400;
  outline: 2px solid rgba(0,0,0,0.55);
  outline-offset: 2px;
}

/* Modal */
#modalOverlay{
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0,0,0,0.70);
  display: grid;
  place-items: center;
  padding: 16px;
}
#modalOverlay.hidden{ display:none; }

#modalCard{
  width: min(1100px, 96vw);
  max-height: 90vh;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.45);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
  position: relative;
}
#modalClose{
  position: absolute;
  top: 10px;
  right: 14px;
  border: none;
  background: transparent;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  color: rgba(0,0,0,0.55);
}
#modalClose:hover{ color: rgba(0,0,0,0.75); }

#modalLeft{
  background: #f3f4f6;
  display: grid;
  place-items: center;
  padding: 18px;
}
#modalImage{
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  box-shadow: 0 18px 45px rgba(0,0,0,0.18);
  border-radius: 8px;
}

#modalRight{ padding: 22px 22px 26px; overflow:auto; }
#modalTitle{ margin: 0 52px 6px 0; font-size: 26px; color: #111827; }
#modalArtist{ margin: 0 0 14px 0; font-size: 18px; color: rgba(0,0,0,0.55); }
.divider{ height: 1px; background: rgba(0,0,0,0.10); margin: 14px 0; }
.metaGrid{ display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.metaGrid .colSpan2{ grid-column: span 2; }
.metaLabel{ font-size: 12px; color: rgba(0,0,0,0.45); font-weight: 700; }
.metaValue{ font-size: 14px; color: rgba(0,0,0,0.75); }
.desc{ margin: 8px 0 0 0; font-size: 14px; color: rgba(0,0,0,0.72); line-height: 1.55; }

@media (max-width: 820px){
  #modalCard{ grid-template-columns: 1fr; }
  #modalImage{ max-height: 42vh; }
}
