/* ============================================
   MELOVAR'S TALE — Trailer Modal
   Floating CTA + Cinematic fullscreen overlay
   ============================================ */

/* ── Floating Trailer Button ── */
.trailer-fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.6rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--surface-950);
  background: var(--gradient-fire);
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow:
    var(--glow-fire),
    0 8px 32px hsla(20, 100%, 50%, 0.35),
    0 2px 8px hsla(0, 0%, 0%, 0.4);
  transition: all var(--transition-base);
  text-decoration: none;
  animation: trailerFabPulse 3s ease-in-out infinite;
}

.trailer-fab:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow:
    var(--glow-fire),
    0 12px 40px hsla(20, 100%, 50%, 0.5),
    0 4px 16px hsla(0, 0%, 0%, 0.5);
  animation: none;
}

.trailer-fab:active {
  transform: translateY(-1px) scale(0.98);
}

.trailer-fab-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: hsla(0, 0%, 0%, 0.2);
  flex-shrink: 0;
}

.trailer-fab-icon svg {
  width: 14px;
  height: 14px;
  fill: var(--surface-950);
  margin-left: 2px;
}

@keyframes trailerFabPulse {
  0%, 100% {
    box-shadow:
      var(--glow-fire),
      0 8px 32px hsla(20, 100%, 50%, 0.35),
      0 2px 8px hsla(0, 0%, 0%, 0.4);
  }
  50% {
    box-shadow:
      0 0 40px hsla(20, 100%, 50%, 0.5),
      0 8px 32px hsla(20, 100%, 50%, 0.45),
      0 2px 8px hsla(0, 0%, 0%, 0.4);
  }
}

/* ── Modal Overlay ── */
.trailer-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: hsla(220, 30%, 3%, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.trailer-modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* ── Modal Container ── */
.trailer-modal {
  position: relative;
  width: 92vw;
  max-width: 1100px;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow:
    0 0 80px hsla(210, 100%, 50%, 0.15),
    0 0 40px hsla(20, 100%, 50%, 0.1),
    0 32px 80px hsla(0, 0%, 0%, 0.7);
  border: 1px solid hsla(210, 40%, 50%, 0.15);
  transform: scale(0.9) translateY(20px);
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.trailer-modal-overlay.open .trailer-modal {
  transform: scale(1) translateY(0);
}

.trailer-modal video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #000;
}

/* ── Close Button ── */
.trailer-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid hsla(210, 40%, 50%, 0.2);
  background: hsla(220, 20%, 9%, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-base);
  opacity: 0;
  animation: trailerCloseAppear 0.4s 0.5s ease forwards;
}

@keyframes trailerCloseAppear {
  to { opacity: 1; }
}

.trailer-modal-close:hover {
  background: hsla(220, 20%, 14%, 0.85);
  border-color: var(--fire-500);
  color: var(--fire-400);
  transform: rotate(90deg);
  box-shadow: 0 0 20px hsla(20, 100%, 50%, 0.3);
}

.trailer-modal-close svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

/* ── Title Label ── */
.trailer-modal-title {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 3rem 1.5rem 1.2rem;
  background: linear-gradient(transparent, hsla(0, 0%, 0%, 0.8));
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 5;
}

.trailer-modal:hover .trailer-modal-title {
  opacity: 1;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .trailer-fab {
    bottom: 1.2rem;
    right: 1.2rem;
    padding: 0.7rem 1.2rem;
    font-size: 0.72rem;
    gap: 0.5rem;
  }

  .trailer-fab-icon {
    width: 24px;
    height: 24px;
  }

  .trailer-fab-icon svg {
    width: 12px;
    height: 12px;
  }

  .trailer-modal {
    width: 96vw;
    border-radius: var(--radius-lg);
  }

  .trailer-modal-close {
    top: 0.6rem;
    right: 0.6rem;
    width: 38px;
    height: 38px;
  }
}

@media (max-width: 480px) {
  .trailer-fab span:not(.trailer-fab-icon) {
    display: none;
  }

  .trailer-fab {
    padding: 0.9rem;
    border-radius: 50%;
    width: 54px;
    height: 54px;
    justify-content: center;
  }

  .trailer-fab-icon {
    background: none;
    width: auto;
    height: auto;
  }

  .trailer-fab-icon svg {
    width: 18px;
    height: 18px;
  }
}
