/* AI-card previews (see static/js/cm-ai-card-preview.js), used by the
   homepage AI section and the shared AI block (Features, For Inspectors).
   Caption sizes follow the preview videos' own 4:3 layout: 1 card px is
   1/290 of the player width, so cqw keeps them in proportion at any size. */
.cmp-panel { position: absolute; inset: 0; z-index: 20; border-radius: 1rem; overflow: hidden;
  border: 1px solid rgba(255,255,255,.14); background: #111111; box-shadow: 0 30px 70px rgba(0,0,0,.55);
  transform-origin: 0 0; opacity: 0; visibility: hidden; pointer-events: none;
  transition: transform .32s cubic-bezier(.2,.8,.2,1), opacity .2s ease, visibility 0s linear .32s; }
.cmp-panel.is-open { visibility: visible; pointer-events: auto;
  transition: transform .32s cubic-bezier(.2,.8,.2,1), opacity .16s ease, visibility 0s; }
.cmp-panel.has-walkthrough { cursor: pointer; }

.cmp-player { position: relative; width: 100%; height: 100%; overflow: hidden; background: #111111; container-type: inline-size; }
.cmp-poster, .cmp-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.cmp-video { opacity: 0; transition: opacity .25s ease; background: #111111; }
.cmp-player.is-playing .cmp-video { opacity: 1; }
.cmp-shade { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(0,0,0,.9) 0%, rgba(0,0,0,.5) 22%, rgba(0,0,0,0) 40%); }

.cmp-watch { position: absolute; top: 12px; right: 12px; top: 3.45cqw; right: 3.45cqw; display: inline-flex; align-items: center;
  gap: 6px; gap: 1.38cqw; padding: 5px 10px; padding: 1.38cqw 2.76cqw; border-radius: 999px; cursor: pointer;
  background: rgba(0,0,0,.6); border: 1px solid rgba(255,255,255,.2); color: #fff; font-weight: 600;
  font-size: 13px; font-size: 3.45cqw; line-height: 1.2; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.cmp-watch svg { width: 14px; height: 14px; width: 4.14cqw; height: 4.14cqw; }
.cmp-watch[hidden], .cmp-btn[hidden] { display: none; }

.cmp-caption { position: absolute; left: 20px; bottom: 20px; left: 5.52cqw; bottom: 5.52cqw; display: flex; align-items: center;
  gap: 14px; gap: 4.14cqw; pointer-events: none; }
.cmp-icon { flex-shrink: 0; width: 44px; height: 44px; width: 12.41cqw; height: 12.41cqw; border-radius: 999px;
  background: rgba(77,183,255,.25); border: 2px solid rgba(77,183,255,.3); display: flex; align-items: center; justify-content: center; }
.cmp-icon svg { width: 24px; height: 24px; width: 6.9cqw; height: 6.9cqw; color: #4DB7FF; }
.cmp-words { opacity: 0; transform: translateY(6px); }
.cmp-words.cmp-in { animation: cmp-in .3s ease forwards; }
@keyframes cmp-in { to { opacity: 1; transform: none; } }
.cmp-title { color: #fff; font-weight: 600; line-height: 1.3; font-size: 17px; font-size: 4.83cqw; }
.cmp-text { color: #9CA3AF; line-height: 1.35; font-size: 14px; font-size: 4.14cqw; max-width: 72.4cqw; }

.cmp-modal { position: fixed; inset: 0; z-index: 9998; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(0,0,0,.92); opacity: 0; visibility: hidden;
  transition: opacity .2s ease, visibility 0s linear .2s; }
.cmp-modal.is-open { opacity: 1; visibility: visible; transition: opacity .2s ease; }
.cmp-sheet { width: 100%; max-width: 720px; max-width: min(720px, calc((100vh - 170px) * 4 / 3));
  transform: scale(.97); transition: transform .25s cubic-bezier(.2,.8,.2,1); }
.cmp-modal.is-open .cmp-sheet { transform: none; }
.cmp-modal .cmp-player { height: auto; aspect-ratio: 4 / 3; border-radius: 1rem; border: 1px solid rgba(255,255,255,.14); }
.cmp-modal .cmp-watch { display: none; }
.cmp-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.cmp-name { color: #fff; font-weight: 700; font-size: 1.05rem; }
.cmp-x { background: none; border: 0; color: #fff; font-size: 30px; line-height: 1; padding: 4px 10px; border-radius: 8px; cursor: pointer; }
.cmp-actions { display: flex; gap: 10px; margin-top: 14px; }
.cmp-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px;
  padding: 0 14px; border-radius: 12px; font-weight: 600; font-size: .95rem; color: #fff; cursor: pointer;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); }
.cmp-btn svg { width: 16px; height: 16px; }
.cmp-btn-primary { background: #4DB7FF; border-color: #4DB7FF; color: #111111; }
.cmp-x:focus-visible, .cmp-btn:focus-visible { outline: 2px solid #4DB7FF; outline-offset: 2px; }
html.cmp-lock { overflow: hidden; }

/* Shared AI block: the preview plays in place over the card's picture. */
.cmp-inplace { position: absolute; inset: 0; z-index: 5; opacity: 0; pointer-events: none; transition: opacity .25s ease; }
.cmp-inplace.is-open { opacity: 1; }

/* "Full walkthrough" call to action: once the preview has played and holds
   its last frame, the caption's line becomes a clear CertMate-blue button
   (in the caption's own space, so it never covers the result) and the small
   top pill steps aside. Purely visual: a click anywhere on the preview, or
   Enter on the card, already opens the walkthrough. */
.cmp-cta { display: none; align-items: center; gap: 6px; gap: 1.6cqw; margin-top: 6px; margin-top: 1.4cqw;
  padding: 6px 12px; padding: 1.6cqw 3.2cqw; border-radius: 999px; background: #4DB7FF; color: #111111;
  font-weight: 700; line-height: 1.2; font-size: 13px; font-size: 3.7cqw; white-space: nowrap; }
.cmp-cta svg { width: 13px; height: 13px; width: 3.7cqw; height: 3.7cqw; flex-shrink: 0; }
.cmp-player.is-ended .cmp-cta { display: inline-flex; animation: cmp-pulse 1.8s ease-out 2; }
.cmp-player.is-ended .cmp-text { display: none; }
.cmp-watch { transition: opacity .25s ease; }
.cmp-player.is-ended .cmp-watch { opacity: 0; pointer-events: none; }
/* data-watch-hide-final cards: the pill steps aside for the closing documents */
.cmp-player.is-final .cmp-watch { opacity: 0; pointer-events: none; }
.cmp-modal .cmp-cta { display: none !important; }
.cmp-modal .cmp-player.is-ended .cmp-text { display: block; }
.cmp-btn-primary.is-ended { animation: cmp-pulse 1.8s ease-out 2; }
@keyframes cmp-pulse { 0% { box-shadow: 0 0 0 0 rgba(77,183,255,.6); } 100% { box-shadow: 0 0 0 14px rgba(77,183,255,0); } }

/* Hint under the cards: the wording follows how this visitor can preview
   (hover, tap, or no preview at all with reduced motion / Save-Data). */
.cmp-hint { color: #9CA3AF; font-size: .875rem; line-height: 1.4; text-align: center; }
.cmp-hint-hover, .cmp-hint-touch, .cmp-hint-touch-only { display: none; }
@media (prefers-reduced-motion: no-preference) {
  html:not(.cmp-off) .cmp-hint .cmp-hint-plain { display: none; }
  html:not(.cmp-off) .cmp-hint .cmp-hint-touch-only { display: inline; }
}
@media (prefers-reduced-motion: no-preference) and (hover: hover) and (pointer: fine) {
  html:not(.cmp-off) .cmp-hint .cmp-hint-hover { display: inline; }
}
@media (prefers-reduced-motion: no-preference) and (hover: none), (prefers-reduced-motion: no-preference) and (pointer: coarse) {
  html:not(.cmp-off) .cmp-hint .cmp-hint-touch { display: inline; }
}

/* HVAC showcase (2026-10-15): floating preview over a two-card grid on a light
   section (soft grey shadow, not the AI sections' dark glow), and the
   player for a card's own full walkthrough (see cm-ai-card-preview.js). */
.cmp-float { position: absolute; z-index: 30; border-radius: 1rem; overflow: hidden;
  border: 1px solid rgba(17,17,17,.10); background: #111111;
  box-shadow: 0 28px 60px rgba(17,24,39,.24), 0 6px 16px rgba(17,24,39,.10);
  transform-origin: 0 0; opacity: 0; visibility: hidden; pointer-events: none;
  transition: transform .32s cubic-bezier(.2,.8,.2,1), opacity .2s ease, visibility 0s linear .32s; }
.cmp-float.is-open { visibility: visible; pointer-events: auto; cursor: pointer;
  transition: transform .32s cubic-bezier(.2,.8,.2,1), opacity .16s ease, visibility 0s; }
.cmf-sheet { max-width: 1040px; max-width: min(1040px, calc((100vh - 170px) * 4 / 3)); }
.cmf-video { display: block; width: 100%; aspect-ratio: 4 / 3; border-radius: 1rem; background: #111111;
  border: 1px solid rgba(255,255,255,.14); }
.cmf-video:focus-visible { outline: 2px solid #4DB7FF; outline-offset: 2px; }

