/* Cogniverse — /demo.
 *
 * Loaded after styles.css and legal.css: the page reuses the legal pages'
 * header, footer and title, and adds only the video frame.
 *
 * The video is a FACADE. The iframe is created on the first click, never on
 * load: this bundle makes no third-party request by default (see README), and
 * a YouTube iframe on load hands every visitor's IP to Google before anyone
 * asked for the video. The poster is self-hosted for the same reason, and the
 * embed host is youtube-nocookie.com. */

/* Header, main and footer share the wider measure, or the logo and the
   footer sit 180px inside a frame that runs past them. */
.dm-page .lg-wrap {
  max-width: 1120px;
}

.dm-lede {
  margin: 14px 0 0;
  max-width: 40em;
  font-size: 17px;
  line-height: 1.55;
  color: var(--fg2);
  text-wrap: pretty;
}

/* 16:9, and never taller than the viewport leaves under the header and the
   title: on a wide, short screen a width-driven frame pushes its own controls
   below the fold. */
.dm-frame {
  position: relative;
  margin-top: clamp(28px, 4.5vh, 44px);
  width: min(100%, calc((100svh - 220px) * 16 / 9));
  min-width: min(100%, 320px);
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  border: 1px solid #1A202E;
}

.dm-frame iframe,
.dm-play {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.dm-play {
  padding: 0;
  margin: 0;
  background: #000;
  cursor: pointer;
}

.dm-play img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity .2s;
}

.dm-btn {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 72px;
  height: 72px;
  margin: -36px 0 0 -36px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 4px;
  border-radius: 50%;
  background: #135BEC;
  color: #fff;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .45);
  transition: transform .2s cubic-bezier(.2, .7, .2, 1), background .2s;
}

.dm-play:hover img { opacity: .85; }
.dm-play:hover .dm-btn { transform: scale(1.06); background: #0D4BC4; }

.dm-play:focus-visible {
  outline: 2px solid #5B8DEF;
  outline-offset: -2px;
}

.dm-note {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--fg3);
}

.dm-note a {
  color: var(--fg2);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.dm-note a:hover { color: var(--fg1); }

@media (prefers-reduced-motion: reduce) {
  .dm-btn, .dm-play img { transition: none; }
}
