/* Tutorial video dialog. Used by /docs/, /docs/video/ and the landing page. */
/* The dialog is as wide as the screen allows while the 16:9 picture plus the
   56 px title bar still fits the height, so the video never letterboxes. */
.vd {
  --bar: 56px;
  --gap: 32px;
  width: min(1280px, calc(100vw - var(--gap)), calc((100dvh - var(--gap) - var(--bar)) * 16 / 9));
  max-width: none; max-height: calc(100dvh - var(--gap));
  padding: 0; border: 0; border-radius: 6px; overflow: hidden;
  background: #0f1216; color: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .5);
}
.vd::backdrop { background: rgba(8, 10, 14, .8); }
.vd[open] { animation: vd-in 200ms cubic-bezier(.2, .8, .2, 1); }
.vd[open]::backdrop { animation: vd-fade 200ms ease-out; }
@keyframes vd-in { from { opacity: 0; transform: scale(.98); } }
@keyframes vd-fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .vd[open], .vd[open]::backdrop { animation: none; }
}
html:has(.vd[open]) { overflow: hidden; }

.vd-bar { display: flex; align-items: center; gap: 8px; height: var(--bar); padding: 0 8px 0 16px; }
.vd-title {
  flex: 1; min-width: 0; margin: 0;
  font-size: 14px; font-weight: 500; color: #c9d1d9;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.vd-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 40px; min-width: 40px; padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, .22); border-radius: 4px;
  background: transparent; color: #fff; font-family: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
}
.vd-btn:hover { background: rgba(255, 255, 255, .08); }
.vd-btn:focus-visible { outline: 2px solid #8fa6f0; outline-offset: 2px; }
.vd-close { padding: 0; }

.vd-media { background: #000; }
.vd-video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.vd-video:focus-visible { outline: 2px solid #8fa6f0; outline-offset: -2px; }

/* Phones: edge to edge, no rounded corners. */
@media (max-width: 640px), (max-height: 500px) {
  .vd { --gap: 0px; border-radius: 0; }
}
