/* ================================================================
   CAROUSEL 3D + CARDS + SITE-FRAME MODAL
   ================================================================ */

.scene {
  position: relative;
  width: 100%;
  height: 13em;
  perspective: 200em;
  font-size: 1.4vw;
  overflow: hidden;
  user-select: none;
  mask: linear-gradient(90deg, #0000 0%, rgba(255,255,255,0.4) 3%, #fff 6% 94%, rgba(255,255,255,0.4) 97%, #0000 100%);
  -webkit-mask: linear-gradient(90deg, #0000 0%, rgba(255,255,255,0.4) 3%, #fff 6% 94%, rgba(255,255,255,0.4) 97%, #0000 100%);
}
.carousel-slot {
  --h: 11em;
  --ratio: 1;
  position: absolute;
  top: 1em;
  left: 50%;
  width: calc(var(--h) * var(--ratio));
  height: var(--h);
  border-radius: 1.5em;
}
.card-wrap {
  width: 100%;
  height: 100%;
  cursor: pointer;
  transform: perspective(800px);
  transform-style: preserve-3d;
}
.card-wrap:hover .card-info { transform: translateY(0); }
.card-wrap:hover .card-info p { opacity: 1; }
.card-wrap:hover .card-info,
.card-wrap:hover .card-info p { transition: 0.6s cubic-bezier(0.23, 1, 0.32, 1); }
.card-wrap:hover .card-info:after {
  transition: 5s cubic-bezier(0.23, 1, 0.32, 1);
  opacity: 1;
  transform: translateY(0);
}
.card-wrap:hover .card-bg {
  transition: 0.6s cubic-bezier(0.23, 1, 0.32, 1), opacity 5s cubic-bezier(0.23, 1, 0.32, 1);
  opacity: 0.8;
}
.card-wrap:hover .card {
  transition: 0.6s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 2s cubic-bezier(0.23, 1, 0.32, 1);
  box-shadow: rgba(255,255,255,0.15) 0 0 40px 5px, white 0 0 0 1px, rgba(0,0,0,0.5) 0 20px 50px 0, inset rgba(255,255,255,0.08) 0 0 0 5px;
}
.card {
  position: relative;
  width: 100%;
  height: 100%;
  background-color: #333;
  overflow: hidden;
  border-radius: 1.5em;
  box-shadow: none;
  transition: 1s cubic-bezier(0.445, 0.05, 0.55, 0.95);
}
.card-bg {
  opacity: 1;
  position: absolute;
  top: -20px; left: -20px;
  width: calc(100% + 40px);
  height: calc(100% + 40px);
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  transition: 1s cubic-bezier(0.445, 0.05, 0.55, 0.95), opacity 5s 1s cubic-bezier(0.445, 0.05, 0.55, 0.95);
  pointer-events: none;
}
.card-info {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 1em;
  color: #fff;
  transform: translateY(40%);
  transition: 0.6s 1.6s cubic-bezier(0.215, 0.61, 0.355, 1);
  pointer-events: none;
}
.card-info p {
  opacity: 0;
  text-shadow: black 0 2px 3px;
  transition: 0.6s 1.6s cubic-bezier(0.215, 0.61, 0.355, 1);
  font-family: "Raleway", sans-serif;
  font-size: 14px;
  line-height: 1.5em;
}
.card-info * { position: relative; z-index: 1; }
.card-info:after {
  content: "";
  position: absolute;
  top: 0; left: 0;
  z-index: 0;
  width: 100%; height: 100%;
  background-image: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.6) 100%);
  background-blend-mode: overlay;
  opacity: 0;
  transform: translateY(100%);
  transition: 5s 1s cubic-bezier(0.445, 0.05, 0.55, 0.95);
}
.card-info h1 {
  font-family: "Playfair Display", serif;
  font-size: 1.1em;
  font-weight: 700;
  text-shadow: rgba(0,0,0,0.5) 0 10px 10px;
  white-space: nowrap;
}
@media (prefers-reduced-motion: reduce) { .scene { --speed-scale: 0.25; } }

/* ── Site preview modal ── */
#site-frame-lb {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9500;
  align-items: center;
  justify-content: center;
}
#site-frame-lb.open { display: flex; }
#site-frame-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.88);
  cursor: pointer;
}
#site-frame-panel {
  position: relative;
  z-index: 1;
  width: 90vw;
  max-width: 1100px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: #0e0e0e;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 32px 100px rgba(0,0,0,0.8);
  animation: sfPanelIn 0.28s cubic-bezier(0.23,1,0.32,1);
}
@keyframes sfPanelIn {
  from { opacity: 0; transform: scale(0.95) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
#site-frame-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  height: 48px;
  background: #0e0e0e;
  flex-shrink: 0;
}
#site-frame-title {
  flex: 1;
  font-family: var(--font-d, 'DM Sans', sans-serif);
  font-size: 12px;
  font-weight: 400;
  color: rgba(255,255,255,0.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: #050505;
  border-radius: 6px;
  padding: 6px 12px;
}
#site-frame-external,
#site-frame-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.35);
  font-size: 18px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s;
  flex-shrink: 0;
  padding: 0;
}
#site-frame-external:hover,
#site-frame-close:hover { color: #fff; }
#site-frame-body {
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}
#site-frame-img {
  width: 100%;
  height: auto;
  display: block;
  max-height: calc(90vh - 53px);
  object-fit: contain;
}
#site-frame-iframe-wrap {
  width: 100%;
  overflow: hidden;
  flex-shrink: 0;
  /* height calculada por JS (1080 × scale) */
}
#site-frame-iframe {
  width: 1920px;
  height: 1080px;
  border: none;
  display: block;
  transform-origin: top left;
  background: #fff;
}
@media (max-width: 600px) {
  #site-frame-panel {
    width: 94vw;
    max-width: 94vw;
    max-height: 88svh;
    border-radius: 12px;
  }
  #site-frame-img { max-height: calc(88svh - 53px); }
}
