.home-video-media { position: relative; overflow: hidden; }

.home-video-poster {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: #050914;
  color: #fff;
  cursor: pointer;
}

.home-video-poster img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-video-poster::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgb(5 9 20 / 40%), rgb(5 9 20 / 5%));
  content: "";
  pointer-events: none;
}

.home-video-play-icon {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  display: grid;
  width: 60px;
  height: 60px;
  place-items: center;
  transform: translate(-50%, -50%);
  border: 1px solid rgb(255 255 255 / 70%);
  border-radius: 50%;
  background: var(--ll-brand-solid);
  color: #fff;
  box-shadow: 0 8px 26px rgb(0 0 0 / 35%);
  transition: transform 140ms ease;
}

.home-video-play-icon svg { width: 23px; height: 23px; margin-left: 3px; }
.home-video-poster:hover .home-video-play-icon { transform: translate(-50%, -50%) scale(1.06); }
.home-video-poster:focus-visible { outline: 3px solid var(--ll-focus); outline-offset: -4px; }

.home-video-dialog {
  position: fixed;
  inset: 0;
  width: min(calc(100vw - 48px), 115vh);
  max-width: 1200px;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 16px;
  overflow: visible;
  border: 1px solid var(--ll-border);
  border-radius: 18px;
  background: var(--ll-surface);
  color: var(--ll-text);
  box-shadow: 0 24px 80px rgb(0 0 0 / 30%);
}

.home-video-dialog:not([open]) { display: none; }
.home-video-dialog[open] { display: grid; grid-template-rows: 44px minmax(0, 1fr); gap: 8px; }
.home-video-dialog::backdrop { background: rgb(5 9 20 / 84%); backdrop-filter: blur(5px); }

.home-video-dialog-title {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.home-video-dialog-header { display: flex; min-height: 44px; align-items: center; justify-content: flex-end; }

.home-video-dialog-close {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--ll-border);
  border-radius: 50%;
  background: var(--ll-surface-raised);
  color: var(--ll-text);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.home-video-dialog-close:focus-visible,
.home-video-dialog-fallback:focus-visible { outline: 3px solid var(--ll-focus); outline-offset: 3px; }

.home-video-dialog-content {
  display: flex;
  width: 100%;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.home-video-player {
  width: 100%;
  flex: 0 0 auto;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 12px;
  background: #050914;
}

.home-video-player iframe,
.home-video-media iframe { display: block; width: 100%; height: 100%; border: 0; }

.home-video-dialog-hint {
  display: none;
  margin: 12px 0 8px;
  color: var(--ll-text-muted);
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
}

.home-video-dialog-fallback {
  display: inline-block;
  margin-top: 10px;
  color: var(--ll-text-secondary);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 900px) {
  .home-video-dialog[open] {
    width: 100vw;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    overflow: hidden;
    border: 0;
    border-radius: 0;
  }

  .home-video-dialog-content {
    width: min(100%, 100dvh);
    max-height: 100%;
    min-height: 0;
    margin: 0 auto;
  }

  .home-video-dialog-hint { display: block; margin-top: 12px; }
  .home-video-dialog-fallback { margin-top: 8px; }
}

@media (max-width: 900px) and (orientation: landscape) {
  .home-video-dialog-hint { display: none; }
  .home-video-dialog-fallback { margin-top: 4px; }
}
