/* Adapted from the original landing page floating-video.css; isolated from section styles. */
.floating-video {
  --video-top: max(104px, calc(env(safe-area-inset-top) + 16px));
  /* Keep clear of the live site's 56 px chat launcher, 30 px above the bottom. */
  --video-bottom-clearance: max(112px, calc(env(safe-area-inset-bottom) + 96px));
  position: fixed;
  z-index: 30;
  top: var(--video-top);
  right: max(24px, calc(env(safe-area-inset-right) + 16px));
  width: min(160px, calc((100dvh - var(--video-top) - var(--video-bottom-clearance)) * 9 / 16));
  color: var(--color-on-accent);
  transform-origin: top right;
  animation: floating-video-reveal 300ms ease-out both;
}
.floating-video[hidden] {
  display: none;
}
.floating-video__preview {
  position: relative;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--color-on-accent) 28%, var(--color-forest));
  border-radius: 16px;
  background: var(--color-forest);
  box-shadow: 0 6px 20px color-mix(in srgb, var(--color-forest) 14%, transparent);
  transition: box-shadow 200ms ease;
}
.floating-video__media,
.floating-video__frame,
.floating-video__frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.floating-video__media {
  pointer-events: none;
}
.floating-video__open {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  padding: 16px 8px;
  border: 0;
  color: var(--color-on-accent);
  background: linear-gradient(transparent 50%, var(--color-forest));
}
.floating-video__play {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 50%;
  background: var(--color-accent);
}
.floating-video__play svg {
  width: 21px;
  height: 21px;
}
.floating-video__caption {
  color: #bdcac5;
  font-size: 15px;
  font-weight: 500;
}
.floating-video__open:focus-visible {
  outline: 3px solid #f6b294;
  outline-offset: -5px;
  border-radius: inherit;
}
.floating-video__close {
  position: absolute;
  z-index: 1;
  isolation: isolate;
  display: grid;
  place-items: center;
  /* Remains at least 44 px even during the 0.96-scale entrance. */
  width: 46px;
  height: 46px;
  padding: 13px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--color-forest);
}
.floating-video__close::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 5px;
  border: 1px solid #bcc6b7;
  border-radius: inherit;
  background: #fffef8;
  box-shadow: 0 2px 6px color-mix(in srgb, var(--color-forest) 12%, transparent);
}
.floating-video__close svg {
  width: 20px;
  height: 20px;
}
.floating-video__dismiss {
  top: -11px;
  right: -11px;
}
.floating-video__close:hover::before {
  background: #f5e0d7;
}
.floating-video__close:focus-visible {
  outline: 3px solid #f6b294;
  outline-offset: 1px;
}
.floating-video-dialog {
  position: fixed;
  inset: 0;
  width: min(
    380px,
    calc(100vw - 96px - env(safe-area-inset-left) - env(safe-area-inset-right)),
    calc(84dvh * 9 / 16),
    calc((100dvh - 96px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) * 9 / 16)
  );
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  border: 0;
  overflow: visible;
  background: transparent;
  color: var(--color-on-accent);
}
.floating-video-dialog::backdrop {
  background: color-mix(in srgb, var(--color-forest) 70%, transparent);
}
.floating-video-dialog__player {
  position: relative;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border-radius: 12px;
  background: var(--color-forest);
  box-shadow: 0 24px 55px rgb(25 43 44 / 22%);
}
.floating-video-dialog__close {
  top: -12px;
  right: -12px;
}
.floating-video__status {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 16px;
  background: var(--color-forest);
  text-align: center;
  font-size: 14px;
}
.floating-video__status a,
.floating-video__play-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid #f6b294;
  border-radius: 8px;
  color: var(--color-on-accent);
  background: transparent;
  font-size: 14px;
}
@keyframes floating-video-reveal {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
@media (hover: hover) and (pointer: fine) {
  .floating-video__preview:hover {
    box-shadow: 0 8px 24px color-mix(in srgb, var(--color-forest) 20%, transparent);
  }
}
@media (min-width: 640px) and (max-height: 440px) {
  .floating-video__open {
    padding: 6px 2px;
    gap: 4px;
  }
  .floating-video__caption {
    line-height: 1.2;
  }
}
@media (max-width: 639px) {
  .floating-video {
    --video-top: max(88px, calc(env(safe-area-inset-top) + 16px));
    right: max(16px, calc(env(safe-area-inset-right) + 16px));
    width: min(96px, calc(100dvh - var(--video-top) - var(--video-bottom-clearance)));
  }
  .floating-video__preview {
    aspect-ratio: 1;
    border-radius: 50%;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--color-forest) 14%, transparent);
  }
  .floating-video__media .floating-video__frame {
    top: 35%;
    bottom: auto;
    height: auto;
    aspect-ratio: 9 / 16;
    transform: translateY(-35%);
  }
  .floating-video__open {
    justify-content: flex-end;
    align-items: flex-end;
    padding: 12px;
    background: linear-gradient(transparent 50%, #15252380);
  }
  .floating-video__play {
    width: 28px;
    height: 28px;
  }
  .floating-video__play svg {
    width: 18px;
    height: 18px;
  }
  .floating-video__caption {
    display: none;
  }
  .floating-video-dialog {
    width: min(
      400px,
      calc(100vw - 32px - env(safe-area-inset-left) - env(safe-area-inset-right)),
      calc((100dvh - 80px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) * 9 / 16)
    );
  }
}
@media (prefers-reduced-motion: reduce) {
  .floating-video {
    animation: none;
  }
  .floating-video__preview {
    transition: none;
  }
}

.floating-video button, .floating-video-dialog button { font-family: inherit; cursor: pointer; }
.floating-video__status[hidden], .floating-video__status [hidden] { display: none; }
.floating-video__sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
