/* Demo videos (section #demos): one card per clip. Link this file after site.css:
     <link rel="stylesheet" href="assets/videos.css">
   Markup (built by assets/site.js from assets/videos.json):
     figure.vcard (--accent = the clip's colour)
       figcaption.vhead > h3.vtitle + p.vdesc       the title and the one line about what you see, ABOVE the video
       div.vbox > video + button.vplay + span.vdur   the thumbnail (poster), a click target, the length
   Layout: one column on phones; from 768 px two columns with the first clip across both.
   The thumbnail (assets/broll/sbs/<id>-thumb.jpg, 1280x720) holds the number, a "Basecamp > Chat view" label, a play symbol
   and a big title in the clip's colour; the same colour marks the card's title here. Everything is scoped to #demos so it
   wins over the older .videos rules in site.css whatever the order of the two files. */

#demos .videos{display:grid;grid-template-columns:minmax(0,1fr);gap:36px 24px;margin-top:6px}
@media (min-width:768px){
  #demos .videos{grid-template-columns:repeat(2,minmax(0,1fr));gap:0 28px}
  #demos .videos>.vcard:first-child{grid-column:1 / -1}
  /* each card spans two rows of the grid (its text, then its thumbnail): the rows are shared (subgrid), so the two thumbnails
     of a row start at the same height even when one text is a line longer; without subgrid support the cards simply stack */
  #demos .vcard{display:grid;grid-template-rows:subgrid;grid-row:span 2}
  #demos .vcard .vbox{margin-bottom:52px}
  #demos .videos>.vcard:last-child:nth-child(even){grid-column:1 / -1}   /* an odd one out at the end gets the full width, like the first */
}

#demos .vcard{--accent:#4f46e5;min-width:0;margin:0}

/* title and one line, above the video */
#demos .vcard figcaption.vhead{margin:0 0 12px;padding:2px 0 2px 14px;border-left:5px solid var(--accent);font-size:inherit;line-height:inherit;color:inherit}
#demos .vtitle{margin:0;font-size:20px;line-height:1.25;font-weight:700;letter-spacing:-.015em;color:var(--fg)}
#demos .vdesc{margin:5px 0 0;font-size:15px;line-height:1.45;color:#3b3b45}
#demos .vdesc b{font-weight:700;color:var(--fg)}

/* thumbnail */
#demos .vbox{position:relative;overflow:hidden;border-radius:14px;background:#14151a;box-shadow:0 1px 2px rgba(16,18,27,.1),0 16px 32px -18px rgba(16,18,27,.5);transition:transform .2s ease,box-shadow .2s ease}
#demos .vbox video,#demos .vbox img{display:block;width:100%;height:auto;aspect-ratio:16 / 9;object-fit:contain;background:#14151a;border:0;border-radius:0}
#demos .vplay{position:absolute;inset:0;z-index:2;display:block;width:100%;height:100%;margin:0;padding:0;border:0;border-radius:inherit;background:transparent;cursor:pointer;-webkit-tap-highlight-color:transparent}
#demos .vplay:focus-visible{outline:0;box-shadow:inset 0 0 0 4px #fff,inset 0 0 0 8px var(--accent)}
#demos .vdur{position:absolute;right:10px;bottom:10px;z-index:3;padding:2px 8px;border-radius:6px;background:rgba(0,0,0,.78);color:#fff;font-size:13px;font-weight:700;line-height:1.5;letter-spacing:.01em;font-variant-numeric:tabular-nums;pointer-events:none}
@media (min-width:768px){#demos .videos>.vcard:first-child .vdur{right:14px;bottom:14px;font-size:15px;padding:2px 10px}}
@media (max-width:480px){#demos .vdur{right:8px;bottom:8px;padding:1px 6px;font-size:12px}}
@media (hover:hover){#demos .vcard:hover .vbox{transform:translateY(-3px);box-shadow:0 1px 2px rgba(16,18,27,.1),0 22px 36px -16px rgba(16,18,27,.55)}}
@media (prefers-reduced-motion:reduce){#demos .vbox{transition:none}#demos .vcard:hover .vbox{transform:none}}

/* playing: the page shows the video's own controls, so the click target and the length go away */
#demos .vbox.playing{transform:none}
#demos .vbox.playing .vplay,#demos .vbox.playing .vdur{display:none}
