/* Component: Trailer modal — triggered by the hero's "Watch Trailer" button.
   Not part of the original Figma file (Figma only shows the trailer trigger,
   node 549:2094 — the modal itself is a UX addition). Video frame is a plain
   16:9 placeholder (dark fill + play icon) until the Bunny.net embed is
   wired in — swap .trailer-modal__placeholder for an <iframe> then. */
.trailer-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.trailer-modal.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease;
}

.trailer-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(24, 24, 24, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Sized off both viewport dimensions at once — width caps at 90vw, but on
   tall/narrow viewports 16:9 would blow past 90vh first, so the height leg
   (converted to an equivalent width via the ratio) takes over. Whichever
   constraint is tighter wins, so the frame always reads as "~90% of the
   screen" no matter the breakpoint or aspect ratio. */
.trailer-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(90vw, calc(90vh * 16 / 9));
  transform: scale(0.96);
  transition: transform 0.3s ease;
}

.trailer-modal.is-open .trailer-modal__dialog {
  transform: scale(1);
}

/* Sits inside the frame's top-right corner (not above it) — at 90% of the
   viewport there isn't reliably room around the dialog for an external
   close button, so it overlaps the video on a dark scrim instead. */
.trailer-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: rgba(24, 24, 24, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: opacity 0.2s ease, background 0.2s ease;
}

.trailer-modal__close:hover {
  opacity: 0.8;
}

.trailer-modal__close img {
  width: 18px;
  height: 18px;
}

.trailer-modal__frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}

.trailer-modal__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #242424;
}

.trailer-modal__play {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 140px;
  height: 140px;
  padding: 20px;
  border-radius: 999px;
  border: 0.6px solid rgba(255, 255, 255, 0.24);
  background: rgba(22, 22, 22, 0.32);
}

.trailer-modal__play-inner {
  display: flex;
  align-items: center;
  padding: 20px;
  border-radius: 999px;
  border: 0.8px solid rgba(255, 255, 255, 0.32);
}

.trailer-modal__play-inner img {
  width: 40px;
  height: 40px;
}

@media (max-width: 640px) {
  .trailer-modal {
    padding: 16px;
  }

  .trailer-modal__close {
    top: 8px;
    right: 8px;
    width: 36px;
    height: 36px;
  }

  .trailer-modal__play {
    width: 88px;
    height: 88px;
    padding: 12px;
  }

  .trailer-modal__play-inner {
    padding: 12px;
  }

  .trailer-modal__play-inner img {
    width: 28px;
    height: 28px;
  }
}

/* Body scroll lock while the modal is open */
.has-modal-open {
  overflow: hidden;
}
