/* Film cards and viewer; loaded on the XLAB homepage. */
.carousel-card .carousel-video { opacity: 0; transition: opacity .48s ease; }
.carousel-card.is-video-ready .carousel-video { opacity: 1; }
.carousel-card .carousel-video[hidden] { display: none; }
.carousel-card::after {
  z-index: 1;
  background:
    linear-gradient(180deg, #1110161a 0%, transparent 48%, #111016ad 100%),
    var(--project-title-scrim, linear-gradient(90deg, #1110168a 0%, #11101633 48%, transparent 85%)),
    linear-gradient(120deg, rgba(var(--project-tint, 127, 117, 244), .38), rgba(var(--project-tint, 127, 117, 244), .32));
}
.carousel-card[data-colour="lemon"] {
  --project-title-scrim: linear-gradient(110deg, #eaf475c7 0%, #eaf47580 48%, transparent 88%);
}
.carousel-card[data-colour="lemon"] .carousel-project-copy { text-shadow: none; }
.carousel-project-copy {
  position: absolute;
  top: 25%;
  left: 5%;
  right: 13%;
  z-index: 2;
  pointer-events: none;
  color: var(--project-accent, var(--yellow));
  text-shadow: 0 2px 28px #0006;
}
.carousel-project-copy small {
  display: block;
  margin-bottom: 12px;
  color: #fff;
  font-size: clamp(12px, 1vw, 15px);
  letter-spacing: .12em;
  font-weight: 500;
  line-height: 1.25;
}
.carousel-project-copy strong {
  display: block;
  font-size: clamp(32px, 4.4vw, 68px);
  line-height: .96;
  letter-spacing: -.055em;
  font-weight: 800;
}
.carousel-watch {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: translateZ(0);
  z-index: 4;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 10px;
  padding: 22px;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: var(--yellow);
  font: inherit;
  cursor: grab;
  touch-action: pan-y pinch-zoom;
  -webkit-tap-highlight-color: transparent;
}
.carousel-watch:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: -5px;
}
.carousel-play-mark {
  display: grid;
  place-items: center;
  order: 2;
  width: 49px;
  height: 49px;
  flex: 0 0 49px;
  border: 1px solid #eaf47570;
  border-radius: 50%;
  color: var(--yellow);
  background: #222124bd;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform .22s ease, background .22s ease, color .22s ease;
}
.carousel-play-mark svg { width: 16px; height: 16px; margin-left: 2px; }
.carousel-watch-label {
  margin-top: 16px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  text-shadow: 0 1px 12px #000a;
  opacity: 0;
  transform: translateX(4px);
  transition: opacity .22s ease, transform .22s ease;
}
.carousel-watch:hover .carousel-play-mark,
.carousel-watch:focus-visible .carousel-play-mark { background: var(--yellow); color: var(--ink); transform: scale(1.06); }
.carousel-watch:hover .carousel-watch-label,
.carousel-watch:focus-visible .carousel-watch-label { opacity: 1; transform: none; }
.carousel-stage.is-dragging .carousel-watch { cursor: grabbing; }
.carousel-stage.is-dragging .carousel-play-mark { transform: none; }
.carousel-card figcaption { pointer-events: none; }
.carousel-card figcaption strong { display: block; max-width: 480px; font-size: clamp(17px, 1.6vw, 24px); line-height: 1.08; }
.carousel-card figcaption small { font-size: 12px; letter-spacing: .08em; }
body.film-open { overflow: hidden; }
.film-dialog {
  box-sizing: border-box;
  width: min(1100px, calc(100vw - 48px));
  max-width: none;
  max-height: calc(100svh - 48px);
  margin: auto;
  padding: 0;
  border: 1px solid #7f75f450;
  border-radius: 20px;
  background: #222124;
  color: #f6f6f2;
  box-shadow: 0 35px 120px #0009;
  overflow: auto;
  overscroll-behavior: contain;
}
.film-dialog::backdrop { background: #111014e8; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.film-dialog-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 23px 28px;
}
#film-category { margin: 0 0 7px; color: #bdb8d5; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
#film-title { margin: 0; font-size: clamp(20px, 2.1vw, 30px); line-height: 1.13; font-weight: 500; letter-spacing: -.03em; }
#film-close {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border: 1px solid #ffffff35;
  border-radius: 50%;
  background: transparent;
  color: var(--yellow);
  font: 300 29px/1 var(--font);
  cursor: pointer;
}
#film-close:hover { color: var(--ink); background: var(--yellow); border-color: var(--yellow); }
.film-player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: calc(100svh - 230px);
  min-height: 180px;
  background: #080809;
}
.film-embed { position: absolute; inset: 0; display: block; width: 100%; height: 100%; border: 0; background: #080809; }
.film-video { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; background: #080809; }
.film-playback-message { position: absolute; top: 50%; left: 24px; right: 24px; transform: translateY(-50%); margin: 0; padding: 16px; border-radius: 10px; background: #222124eb; color: #f6f6f2; text-align: center; font-size: 15px; line-height: 1.5; pointer-events: none; }
.film-loading { position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 14px; color: #dfdce9; font-size: 16px; pointer-events: none; }
.film-loading-spinner { width: 19px; height: 19px; border: 2px solid #7f75f450; border-top-color: var(--yellow); border-radius: 50%; animation: film-loading-spin 1s linear infinite; }
@keyframes film-loading-spin { to { transform: rotate(360deg); } }
.film-dialog-bottom { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 20px 28px; color: #b8b4c1; font-size: 14px; line-height: 1.5; }
#film-source { flex: 0 0 auto; color: var(--yellow); text-decoration: underline; text-underline-offset: 5px; }
#film-source:hover { color: #fff; }
@media (max-width: 760px) {
  .carousel-project-copy { top: 24%; left: 6%; right: 13%; }
  .carousel-project-copy small { font-size: 10px; margin-bottom: 8px; letter-spacing: .09em; }
  .carousel-project-copy strong { font-size: clamp(28px, 8vw, 48px); }
  .carousel-watch { padding: 14px; }
  .carousel-play-mark { width: 40px; height: 40px; flex-basis: 40px; }
  .carousel-play-mark svg { width: 14px; height: 14px; }
  .carousel-watch-label { display: none; }
  .carousel-card figcaption strong { font-size: clamp(15px, 4vw, 20px); line-height: 1.08; }
  .carousel-card figcaption small { font-size: 10px; }
  .film-dialog { width: calc(100vw - 24px); max-height: calc(100svh - 24px); border-radius: 15px; }
  .film-dialog-top { padding: 18px; gap: 15px; }
  #film-title { font-size: 20px; }
  #film-category { font-size: 11px; line-height: 1.5; }
  .film-player { min-height: 0; max-height: calc(100svh - 220px); }
  .film-dialog-bottom { align-items: flex-start; padding: 16px 18px; gap: 16px; flex-direction: column; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .film-loading-spinner { animation: none; }
  .carousel-play-mark, .carousel-watch-label, .carousel-card .carousel-video { transition: none; }
}
