/* Click-to-play video card + accessible YouTube modal.
   Behavior: /js/video-card.js. Usage and copy-paste snippet: docs/video-cards.md.

   .vc-section            page section that holds one card
   .video-card            [data-video-card][data-youtube-id][data-title][data-duration]
   .video-card-copy       HTML copy outside the poster: eyebrow, title, text, badge, CTA
   .video-card-poster     the <button> click target (16:9 poster + play button)
   .vc-modal              the shared dialog, built once by js/video-card.js

   Selectors are scoped two classes deep where page stylesheets style bare
   h2/p/button, so the card looks the same on every page. */

/* ------------------------------------------------------------------ section */
.vc-section { padding: clamp(48px, 6vw, 88px) 0; border-bottom: 1px solid var(--line, #e7e7e2); background: var(--soft, #f7f7f3); overflow-x: clip; }

/* --------------------------------------------------------------------- card */
.video-card {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  align-items: center;
  gap: clamp(28px, 4.5vw, 72px);
  min-width: 0;
}
.video-card .video-card-copy { min-width: 0; max-width: 440px; }

.video-card .video-card-eyebrow {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 16px;
  color: var(--ink, #050505); font-family: "Geist Mono", monospace; font-size: 12px; font-weight: 560;
  letter-spacing: 0.15em; line-height: 1.3; text-transform: uppercase;
}
.video-card .video-card-eyebrow img { display: block; width: 18px; height: 18px; flex: none; }

.video-card .video-card-title {
  max-width: 16ch; margin: 0 0 16px;
  color: var(--ink, #050505); font-size: clamp(30px, 3.4vw, 46px); font-weight: 620;
  letter-spacing: -0.045em; line-height: 1.02; text-wrap: balance;
}
.video-card .video-card-text {
  max-width: 44ch; margin: 0;
  color: var(--muted, #64645f); font-size: clamp(17px, 1.45vw, 19px); line-height: 1.55; text-wrap: pretty;
}
.video-card .video-card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 26px; }
.video-card .video-card-duration {
  display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 12px;
  border: 1px solid var(--line, #e7e7e2); border-radius: 999px; background: #fff;
  color: var(--ink, #050505); font-family: "Geist Mono", monospace; font-size: 12px; font-weight: 560; letter-spacing: 0.06em;
}
.video-card .video-card-duration::before {
  content: ""; width: 0; height: 0; border-style: solid; border-width: 5px 0 5px 8px;
  border-color: transparent transparent transparent var(--coral, #ff6f61);
}

/* ---------------------------------------------------------- poster button */
.video-card .video-card-poster {
  --lift: 0px;
  position: relative; display: block; width: 100%; min-width: 0; margin: 0; padding: 0; overflow: hidden;
  aspect-ratio: 16 / 9; border: 1px solid var(--line, #e7e7e2); border-radius: 18px; background: #16142e;
  color: inherit; font: inherit; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent;
  box-shadow: 0 1px 2px rgba(31, 29, 61, 0.06), 0 22px 48px -26px rgba(31, 29, 61, 0.34);
  transform: translateY(var(--lift));
  transition: transform 520ms var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1)), box-shadow 520ms var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1));
}
.video-card .video-card-poster picture,
.video-card .video-card-poster img { display: block; width: 100%; height: 100%; }
.video-card .video-card-poster img { object-fit: cover; }
.video-card .video-card-poster:focus-visible { outline: 3px solid var(--explore-lilac-border, #6f4bd8); outline-offset: 4px; }

/* Play button. The poster art has a small play mark baked in; this button sits
   exactly over it (--vc-play-x/y) and is always larger, so only one shows.
   Set --vc-play-x / --vc-play-y on the card when a poster puts it elsewhere. */
.video-card .video-card-play {
  position: absolute; left: var(--vc-play-x, 50%); top: var(--vc-play-y, 50%);
  display: grid; place-items: center;
  width: clamp(56px, 9%, 104px); aspect-ratio: 1; border-radius: 50%;
  background: #fff; box-shadow: 0 10px 30px -8px rgba(12, 11, 28, 0.55), 0 0 0 6px rgba(255, 255, 255, 0.22);
  transform: translate(-50%, -50%);
  transition: transform 320ms var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1)), box-shadow 320ms ease;
}
.video-card .video-card-play::before {
  content: ""; width: 0; height: 0; margin-left: 9%;
  border-style: solid; border-width: 0.62em 0 0.62em 1.02em; border-color: transparent transparent transparent var(--navy, #1f1d3d);
  font-size: clamp(14px, 1.9vw, 24px);
}
.video-card .video-card-badge {
  position: absolute; right: 14px; bottom: 14px; padding: 5px 9px; border-radius: 8px;
  background: rgba(12, 11, 28, 0.78); color: #fff; font-family: "Geist Mono", monospace; font-size: 12px; font-weight: 560; letter-spacing: 0.04em; line-height: 1;
}

/* Soft light + one-time glint on hover, same as the shared .shot-frame. */
.video-card .video-card-poster::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 400ms ease;
  background: radial-gradient(520px circle at 60% 40%, rgba(255, 255, 255, 0.16), transparent 60%);
}
.video-card .video-card-glint {
  position: absolute; inset: -20% -60%; pointer-events: none; opacity: 0; transform: translateX(-60%) skewX(-18deg);
  background: linear-gradient(90deg, transparent 38%, rgba(255, 255, 255, 0.28) 50%, transparent 62%);
}
@media (hover: hover) and (pointer: fine) {
  .video-card .video-card-poster:hover { --lift: -8px; box-shadow: 0 2px 4px rgba(31, 29, 61, 0.06), 0 44px 80px -30px rgba(31, 29, 61, 0.45); }
  .video-card .video-card-poster:hover::after { opacity: 1; }
  .video-card .video-card-poster:hover .video-card-glint { opacity: 1; transform: translateX(60%) skewX(-18deg); transition: transform 1100ms var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1)), opacity 200ms ease; }
  .video-card .video-card-poster:hover .video-card-play { transform: translate(-50%, -50%) scale(1.08); box-shadow: 0 14px 36px -8px rgba(12, 11, 28, 0.6), 0 0 0 8px rgba(255, 255, 255, 0.28); }
}
.video-card .video-card-poster:active .video-card-play { transform: translate(-50%, -50%) scale(0.96); }

/* -------------------------------------------------------------- hero video */
/* .video-card--hero: the poster IS the hero's visual column (app pages greet the
   visitor with the video; the image collection sits directly below the hero).
   No copy column: the hero's own h1/text/CTAs are the copy. Usage: docs/video-cards.md.

   Layout is explicit markup + a named grid, on purpose. The hero grid carries
   .product-hero-grid--video and three children in reading order:
     .product-hero-lead (eyebrow, h1, definition) → .video-card--hero → .product-hero-more
   Desktop places lead/more in the left column and the video in the right; phones
   simply stack them in source order, so the poster sits under the headline.
   Do not reintroduce :has() or display: contents here. PR #97 reflowed the hero
   with `:has()` + `display: contents` + `order`, which removed the IntersectionObserver-
   watched .reveal copy wrapper from the box tree; that was the only structural
   change in the release that froze /mailbaser/ in production. Plain classes need no
   relational style invalidation and keep every observed element a real box. */
.product-hero-grid.product-hero-grid--video {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  grid-template-areas: "lead video" "more video";
  grid-template-rows: auto auto;
  align-content: center; align-items: start;
  column-gap: var(--editorial-gap, clamp(32px, 5vw, 80px)); row-gap: 0;
}
.product-hero-grid.product-hero-grid--video > * { min-width: 0; margin-top: 0; }
.product-hero-grid--video > .product-hero-lead { grid-area: lead; align-self: end; }
.product-hero-grid--video > .product-hero-more { grid-area: more; align-self: start; }
.product-hero-grid--video > .video-card--hero { grid-area: video; align-self: center; }

.video-card.video-card--hero {
  position: relative; isolation: isolate; display: block;
  width: 100%; max-width: 820px; min-height: 0; margin: 0; justify-self: end;
  scroll-margin-top: 140px;
}
.video-card.video-card--hero::before {
  position: absolute; z-index: -1; inset: 28px -12px 18px 28px; content: "";
  border-radius: 28px; background: var(--vc-plate, var(--fr-plate, var(--lilac, #c5b0f4))); opacity: 0.5;
  transform: rotate(-1.6deg);
}
.video-card.video-card--hero .video-card-poster {
  border-radius: 20px;
  box-shadow: 0 1px 2px rgba(31, 29, 61, 0.06), 0 34px 72px -30px rgba(31, 29, 61, 0.5);
}
.video-card.video-card--hero .video-card-hero-label {
  display: flex; align-items: center; gap: 8px; margin: 14px 0 0;
  color: var(--muted, #64645f); font-family: "Geist Mono", monospace; font-size: 11.5px; font-weight: 560;
  letter-spacing: 0.12em; line-height: 1.3; text-transform: uppercase;
}
.video-card.video-card--hero .video-card-hero-label::before {
  content: ""; width: 0; height: 0; flex: none; border-style: solid; border-width: 5px 0 5px 8px;
  border-color: transparent transparent transparent var(--coral, #ff6f61);
}
@media (max-width: 840px) {
  /* Phones: one column in source order — eyebrow, h1, definition, video, rest + CTAs. */
  .product-hero-grid.product-hero-grid--video { grid-template-columns: minmax(0, 1fr); grid-template-areas: "lead" "video" "more"; }
  .product-hero-grid.product-hero-grid--video > .video-card--hero { margin: 4px 0 30px; }
  .video-card.video-card--hero { max-width: none; justify-self: stretch; }
  .video-card.video-card--hero::before { inset: 16px -8px 18px 8px; border-radius: 18px; transform: none; }
}

/* ------------------------------------------------------------------ mobile */
@media (max-width: 900px) {
  .video-card { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .video-card .video-card-copy { max-width: none; }
  .video-card .video-card-poster { order: -1; }
}
@media (max-width: 760px) {
  .video-card .video-card-poster { border-radius: 14px; }
  .video-card .video-card-play { width: 56px; }
  .video-card .video-card-play::before { font-size: 15px; }
  .video-card .video-card-badge { right: 10px; bottom: 10px; font-size: 11px; }
}

/* ------------------------------------------------------------------- modal */
html.vc-modal-open { overflow: hidden; }
.vc-modal[hidden] { display: none; }
.vc-modal {
  position: fixed; inset: 0; z-index: 2147483647;
  display: grid; place-items: center; padding: clamp(12px, 4vw, 48px);
}
.vc-modal-sentinel { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.vc-modal-backdrop { position: absolute; inset: 0; background: rgba(12, 11, 28, 0.86); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.vc-modal-panel {
  position: relative; width: min(1200px, 100%, calc((100dvh - 120px) * 16 / 9));
  min-width: 0; color: #fff; animation: vc-modal-in 260ms var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1));
}
.vc-modal-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.vc-modal .vc-modal-title { min-width: 0; margin: 0; color: #fff; font-size: clamp(15px, 1.6vw, 18px); font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; }
.vc-modal .vc-modal-close {
  display: grid; flex: none; width: 44px; height: 44px; place-items: center; padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.28); border-radius: 50%; background: rgba(255, 255, 255, 0.08);
  color: #fff; font: inherit; font-size: 22px; line-height: 1; cursor: pointer; transition: background-color 160ms ease, transform 160ms ease;
}
.vc-modal .vc-modal-close:hover { background: rgba(255, 255, 255, 0.18); }
.vc-modal .vc-modal-close:active { transform: scale(0.96); }
.vc-modal .vc-modal-close:focus-visible { outline: 3px solid #c5b0f4; outline-offset: 3px; }
.vc-modal-frame { position: relative; overflow: hidden; aspect-ratio: 16 / 9; border-radius: 14px; background: #000; box-shadow: 0 40px 120px rgba(0, 0, 0, 0.5); }
.vc-modal-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.vc-modal-frame iframe:focus-visible { outline: 3px solid #c5b0f4; outline-offset: -3px; }
@keyframes vc-modal-in { from { opacity: 0; transform: scale(0.985); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  .video-card .video-card-poster, .video-card .video-card-play { transition: box-shadow 200ms ease; }
  .video-card .video-card-poster:hover, .video-card .video-card-poster:active { --lift: 0px; }
  .video-card .video-card-poster:hover .video-card-play,
  .video-card .video-card-poster:active .video-card-play { transform: translate(-50%, -50%); }
  .video-card .video-card-glint, .video-card .video-card-poster::after { display: none; }
  .vc-modal-panel { animation: none; }
}
