/*
 * The film player on /product-demos (product-demos.html, with lightbox.js): the home page's lightbox, so a film
 * plays the same way on every page. Every rule is copied from styles.css, where the home page keeps its own copy;
 * tests/demos.test.js fails if a rule here drifts from its original there. Loaded after page.css (tokens, button,
 * lockup) and booking.css (the dialog's ink and the glass button). No inline styles anywhere.
 */

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.lightbox {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
}

.lightbox::backdrop {
  background: rgba(10, 14, 11, 0.8);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.lb-stage {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: max(64px, env(safe-area-inset-top)) clamp(12px, 4vw, 64px) clamp(16px, 4vh, 48px);
}

.lb-frame {
  position: relative;
  width: min(100%, 1280px, calc((100dvh - 120px) * 16 / 9));
  aspect-ratio: 16 / 9;
}

.lb-video {
  width: 100%;
  height: 100%;
  border-radius: 16px;
  background: #000;
  box-shadow: 0 40px 120px -20px rgba(0, 0, 0, 0.6);
}

.lb-close {
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: background-color 0.25s ease;
}

.lb-close svg {
  width: 16px;
  height: 16px;
}

.lb-close:hover {
  background: rgba(255, 255, 255, 0.24);
}

.lb-close:active {
  transform: scale(0.94);
}

/* End card: over the film's last frame, the lockup and the one next step, plus a way to watch again. The field is
   near solid, so the film's own end title never shows through. */
.lb-end {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  border-radius: 16px;
  background: radial-gradient(ellipse 75% 70% at 50% 45%, rgba(26, 38, 30, 0.95), rgba(10, 14, 11, 0.985));
  -webkit-backdrop-filter: blur(18px) saturate(120%);
  backdrop-filter: blur(18px) saturate(120%);
  animation: fade-in 0.6s var(--ease) both;
}

.lb-end .lockup {
  --lh: 28px;
  --by: 12.5px;
  --ph: 13.5px;
}

.lb-end .lockup-by {
  color: rgba(255, 255, 255, 0.72);
}

.lb-end .lockup-pomodor {
  opacity: 0.8;
}

.lb-end[hidden] {
  display: none;
}

.lb-end-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  padding: 0 16px;
}

.lb-end .btn {
  height: 52px;
  padding: 0 26px;
  font-size: 16px;
}

/* Glass on a dark ground: white text on a light veil (the cream glass turns grey here). */
.lb-end .btn-glass {
  padding: 0 22px 0 18px;
  gap: 8px;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.34);
  box-shadow: none;
}

.lb-end .btn-glass:hover {
  background: rgba(255, 255, 255, 0.22);
}

.lb-end .btn-glass:focus-visible,
.lb-end .btn-primary:focus-visible {
  outline-color: #fff;
}

@media (max-width: 560px) {
  .lb-end {
    gap: 18px;
  }

  .lb-end .lockup {
    --lh: 22px;
    --by: 11px;
    --ph: 11.5px;
  }

  .lb-end .btn {
    height: 46px;
    padding: 0 20px;
    font-size: 15px;
  }

  .lb-end-actions {
    gap: 10px;
  }
}

.icon-again {
  width: 16px;
  height: 16px;
}

.lb-close:focus-visible {
  outline-color: #fff;
}

/* Entrance (where supported). */
.lightbox[open] {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.35s var(--ease),
    transform 0.45s var(--ease);
}

@starting-style {
  .lightbox[open] {
    opacity: 0;
  }
}
