/* ============================================================
   RAYNE3XL — cuadros.css · galería inmersiva galaxia
   Capas: starfield canvas (fijo) → nebulosas → contenido
   Hero: imagen de referencia galaxia+caballete con obra compuesta
   ============================================================ */

body[data-page="cuadros"] { background: #050508; }

/* ---------- fixed space backdrop ---------- */
.space-bg {
  position: fixed; inset: 0;
  z-index: 0;
  pointer-events: none;
}
#starfield { position: absolute; inset: 0; width: 100%; height: 100%; }
.nebula {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  mix-blend-mode: screen;
  opacity: 0.12;
  animation: nebDrift 46s ease-in-out infinite alternate;
}
.nebula--teal { width: 55vw; height: 45vw; left: -15vw; top: 8vh; background: radial-gradient(circle, var(--teal), transparent 65%); }
.nebula--pink { width: 45vw; height: 40vw; right: -12vw; top: 42vh; background: radial-gradient(circle, var(--pink), transparent 65%); animation-delay: -18s; }
.nebula--blue { width: 40vw; height: 38vw; left: 28vw; bottom: -18vh; background: radial-gradient(circle, var(--blue), transparent 65%); animation-delay: -32s; }
@keyframes nebDrift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(6vw, -4vh) scale(1.15); }
}

main { position: relative; z-index: 1; }

/* ---------- hero: pieza del momento en el caballete real ---------- */
.cua-hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 90px;
  position: relative;
}
.cua-hero__head { text-align: center; margin-bottom: clamp(1.2rem, 3vh, 2.4rem); }
.cua-hero__head h1 { font-size: var(--t-h1); }
.cua-hero__head .desc { color: var(--cream-dim); max-width: 58ch; margin: 1rem auto 0; }

/* the easel scene — reference image with art composited on canvas */
.easel-scene {
  position: relative;
  width: min(1100px, 94vw);
  margin: 0 auto;
  aspect-ratio: 1672 / 941;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.9);
  animation: floatY 7s ease-in-out infinite;
}
@keyframes floatY { 50% { transform: translateY(-10px); } }
.easel-scene__bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
/* art overlay sits exactly on the blank canvas of the reference photo
   canvas region in source: x 39.41%→70.22% · y 25.4%→68.44% */
.easel-scene__art {
  position: absolute;
  left: 39.41%;
  top: 25.4%;
  width: 30.81%;
  height: 43.04%;
  overflow: hidden;
  background: #101010;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 22px rgba(0,0,0,0.55);
}
.easel-scene__art img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: brightness(0.94) contrast(1.03);
  transition: opacity 0.5s ease;
}
.easel-scene__art.is-fading img { opacity: 0; }

/* featured piece info bar */
.cua-hero__info {
  width: min(1100px, 94vw);
  margin: 1.4rem auto 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.cua-hero__meta .label {
  font-family: var(--font-label);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 0.3rem;
}
.cua-hero__meta .title {
  font-family: var(--font-display);
  font-weight: 900;
  text-transform: uppercase;
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  line-height: 1.1;
}
.cua-hero__meta .price { color: var(--cream-dim); font-size: 0.95rem; margin-top: 0.2rem; display: block; }
.cua-hero__actions { display: flex; gap: 0.7rem; align-items: center; flex-wrap: wrap; }
.easel-nav {
  display: flex; gap: 0.5rem;
}
.easel-nav button {
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(13,13,13,0.6);
  color: var(--cream);
  font-size: 1.15rem;
  transition: border-color var(--fast), background var(--fast);
}
.easel-nav button:hover { border-color: var(--accent); background: rgba(13,13,13,0.9); }

/* ---------- collections: floating framed canvases ---------- */
.coll { padding-block: clamp(3rem, 8vh, 6rem); }
.coll__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.6rem;
}
.coll__head h2 { font-size: var(--t-h2); }
.coll__count {
  font-family: var(--font-label);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cream-faint);
  white-space: nowrap;
}

.coll__row {
  display: flex;
  gap: clamp(1.2rem, 3vw, 2.2rem);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 1.8rem 0.3rem 2.2rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}
.coll__row::-webkit-scrollbar { height: 4px; }
.coll__row::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 2px; }

/* floating framed canvas */
.piece {
  flex: 0 0 auto;
  width: clamp(240px, 30vw, 330px);
  scroll-snap-align: center;
  animation: floatY 6s ease-in-out infinite;
}
.piece:nth-child(2n)  { animation-delay: -1.6s; }
.piece:nth-child(3n)  { animation-delay: -3.1s; }
.piece:nth-child(4n)  { animation-delay: -4.4s; }
.piece__frame {
  position: relative;
  background: #0e0b08;
  padding: 10px;
  border: 6px solid #241a10;
  border-radius: 3px;
  box-shadow:
    0 0 0 1px rgba(212, 175, 55, 0.28),
    0 24px 50px -18px rgba(0, 0, 0, 0.95),
    0 0 44px -8px color-mix(in srgb, var(--accent) 26%, transparent);
  cursor: zoom-in;
  transition: transform var(--fast) var(--ease), box-shadow var(--fast);
}
.piece__frame:hover {
  transform: scale(1.03) rotate(-0.5deg);
  box-shadow:
    0 0 0 1px rgba(212, 175, 55, 0.5),
    0 30px 60px -18px rgba(0, 0, 0, 1),
    0 0 66px -6px color-mix(in srgb, var(--accent) 45%, transparent);
}
.piece__frame img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  filter: brightness(0.96);
}
.piece__info { padding: 0.9rem 0.2rem 0; }
.piece__title {
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}
.piece__price { color: var(--cream-dim); font-size: 0.85rem; margin: 0.15rem 0 0.7rem; }
.piece__btns { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ---------- trust + commission ---------- */
.cua-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2.4rem;
  justify-content: center;
  padding: 1.2rem var(--gutter);
  border-block: 1px solid var(--line-soft);
  background: rgba(13,13,13,0.55);
  backdrop-filter: blur(6px);
  font-family: var(--font-label);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cream-dim);
}
.cua-trust span::before { content: "♛ "; color: var(--accent); }

.cua-commission {
  text-align: center;
  padding-block: clamp(4rem, 10vh, 7rem);
}
.cua-commission h2 { font-size: var(--t-h2); max-width: 20ch; margin-inline: auto; }
.cua-commission p { color: var(--cream-dim); margin: 1.2rem auto 2rem; max-width: 46ch; }

@media (max-width: 720px) {
  .easel-scene { width: 100vw; border-radius: 0; }
  .cua-hero__info { padding-inline: var(--gutter); }
}
@media (prefers-reduced-motion: reduce) {
  .easel-scene, .piece, .nebula, .easel-scene__bg { animation: none !important; }
}
