html:has(.ym-viewer[open]) { overflow: hidden; }

.ym-viewer {
  box-sizing: border-box;
  width: min(88vw, 960px);
  max-width: calc(100% - 24px);
  max-height: calc(100% - 24px);
  margin: auto;
  padding: 0;
  border: 1px solid #424242;
  color: #fafafa;
  background: #121212;
  font: 400 14px/1.4 Inter, Arial, sans-serif;
  overscroll-behavior: contain;
}
.ym-viewer::backdrop { background: rgb(5 5 5 / 91%); }
.ym-viewer__close, .ym-viewer__nav button, .ym-viewer__all {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #676767;
  border-radius: 50%;
  color: inherit;
  background: #151515;
  font: 400 24px/1 Arial, sans-serif;
  cursor: pointer;
}
.ym-viewer :is(.ym-viewer__close, .ym-viewer__nav button, .ym-viewer__all):hover { color: #111; background: #fff; }
.ym-viewer button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.ym-viewer__close { position: absolute; z-index: 2; top: 10px; right: 10px; }
.ym-viewer__stage { display: grid; place-items: center; background: #080808; }
.ym-viewer__stage > :is(img, video) {
  display: block;
  width: 100%;
  height: min(72vh, 760px);
  height: min(72dvh, 760px);
  object-fit: contain;
}
.ym-viewer__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  gap: 12px;
  padding: 10px 16px;
}
.ym-viewer__nav { display: flex; gap: 8px; }
.ym-viewer [hidden] { display: none; }
.ym-viewer__all {
  width: auto;
  min-width: max-content;
  padding-inline: 16px;
  border-radius: 2rem;
  font: inherit;
}
.ym-film-library {
  width: 100%;
  max-height: calc(100vh - 28px);
  max-height: calc(100dvh - 28px);
  overflow-y: auto;
  padding: clamp(16px, 3vw, 32px);
  background: #151514;
}
.ym-film-library h2 {
  padding-right: 48px;
  margin-bottom: 20px;
  font-size: clamp(26px, 4vw, 46px);
  line-height: 1.08;
  font-weight: 400;
  letter-spacing: -.055em;
}
.ym-film-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(6px, 1vw, 10px);
}
.ym-clip {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: end;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #222;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.ym-clip img, .ym-clip::before {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.ym-clip img { z-index: -2; object-fit: cover; }
.ym-clip::before {
  content: "";
  z-index: -1;
  background: linear-gradient(to top, rgb(0 0 0 / 85%), transparent 65%);
}
.ym-clip::after {
  content: "";
  position: absolute;
  top: 12px;
  left: 12px;
  width: 30px;
  height: 30px;
  border: 1px solid rgb(255 255 255 / 75%);
  border-radius: 50%;
  background: rgb(10 10 10 / 55%);
}
.ym-clip__title {
  display: block;
  padding: clamp(9px, 1.5vw, 20px);
  color: #fff;
  font-size: clamp(.9rem, 1.6vw, 1.45rem);
  font-weight: 500;
  line-height: 1.14;
  letter-spacing: -.03em;
  overflow-wrap: break-word;
}
.ym-clip__title::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: 22px;
  left: 24px;
  border-block: 5px solid transparent;
  border-left: 8px solid #fff;
}
.ym-clip:is(:hover, :focus-visible) .ym-clip__title { text-decoration: underline; text-underline-offset: .18em; }
@media (min-width: 760px) {
  .ym-film-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ym-film-grid .ym-clip { aspect-ratio: 1; }
}
@media (max-width: 600px) {
  .ym-viewer { width: calc(100% - 24px); }
  .ym-viewer__bar { padding-inline: 12px; }
}
@media (max-height: 450px) {
  .ym-viewer__stage > :is(img, video) { height: calc(100dvh - 96px); }
}
