/*
 * The demo-video block on / and /youtube-video-to-text (SEO/GEO audit finding §7, geo.md:98).
 *
 * Nothing from YouTube loads until the visitor asks for it: the poster is a still from i.ytimg.com, which
 * the site CSP already allows, and `video.js` swaps in the youtube-nocookie player on the first click.
 * That keeps YouTube's player bundle and its storage off the first paint, and keeps the privacy page's
 * third-party table true — the embed is something the visitor chooses to load.
 *
 * Both sheets that load this file (index.html's inline sheet and seo.css) define --surface, --line, --ink-3,
 * --blue, --yellow and --shadow, so it uses nothing else. seo.css has no dark mode; index.html does. Using
 * only tokens means this block follows whichever page it lands on.
 */

.demo {
  max-width: 820px;
  margin: 40px auto 0;
}

.demo-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #000;
  box-shadow: var(--shadow);
}

/* The facade and the player fill the same box, so pressing play moves nothing on the page. */
.demo-frame > button,
.demo-frame > iframe {
  position: absolute;
  border: 0;
  inset: 0;
  width: 100%;
  height: 100%;
}

.demo-play {
  display: grid;
  padding: 0;
  background: none;
  cursor: pointer;
  place-items: center;
}

.demo-play img {
  position: absolute;
  /* maxresdefault is a true 16:9 still, so `cover` crops nothing; it is here for the fallback poster,
     whose 4:3 box `cover` trims back to exactly the letterboxed frame. */
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.demo-disc {
  /* The poster is absolutely positioned, so a static disc would paint underneath it. */
  position: relative;
  display: grid;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.55);
  place-items: center;
  transition: transform 0.18s ease;
}

.demo-disc svg {
  width: 26px;
  height: 26px;
  /* A triangle sits left of where the eye puts it when its bounding box is centred. */
  margin-left: 4px;
  fill: #fff;
}

.demo-play:hover .demo-disc {
  transform: scale(1.07);
}

/* The frame clips, so the ring goes inside it rather than around it. */
.demo-play:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: -5px;
}

.demo-play:focus-visible .demo-disc {
  transform: scale(1.07);
}

.demo-cap {
  margin: 14px 0 0;
  color: var(--ink-3);
  font-size: 14px;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .demo-disc {
    transition: none;
  }

  .demo-play:hover .demo-disc,
  .demo-play:focus-visible .demo-disc {
    transform: none;
  }
}

@media (max-width: 560px) {
  .demo {
    margin-top: 30px;
  }

  .demo-disc {
    width: 60px;
    height: 60px;
  }

  .demo-disc svg {
    width: 21px;
    height: 21px;
  }
}
