/* Looping illustration clips (see clips.js). */
.hp-clip { position: relative; display: none; overflow: hidden; border-radius: inherit; background: #0b1f2c; }
.hp-clip video { display: block; width: 100%; height: 100%; object-fit: cover; }

/* replace: the clip takes the fallback's place once the video is ready */
.hp-clip[data-clip-mode="replace"] { aspect-ratio: 16 / 10; box-shadow: 0 18px 40px -28px #0b1f2c55; }
.hp-clip[data-clip-mode="replace"].is-ready { display: block; }
.has-clip > [data-clip-fallback] { display: none; }

/* overlay: the clip fades in over an image */
.hp-clip[data-clip-mode="overlay"] { position: absolute; inset: 0; display: block; opacity: 0; transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1); pointer-events: none; background: transparent; }
.hp-clip[data-clip-mode="overlay"].is-ready { opacity: 1; pointer-events: auto; }

.hp-clip-toggle {
  position: absolute; z-index: 2; inset-block-end: 12px; inset-inline-end: 12px;
  width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(11, 31, 44, 0.55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  color: var(--on-night); cursor: pointer; opacity: 0; transition: opacity 0.3s;
}
.hp-clip.is-ready .hp-clip-toggle { opacity: 0.85; }
.hp-clip-toggle:hover, .hp-clip-toggle:focus-visible { opacity: 1; }
.hp-clip-toggle::before { content: ""; position: absolute; inset: 0; margin: auto; width: 10px; height: 12px; border-inline: 3px solid var(--on-night); box-sizing: border-box; }
.hp-clip-toggle[data-state="paused"]::before { width: 0; height: 0; border-inline: 0; border-block: 7px solid transparent; border-inline-start: 11px solid var(--on-night); translate: 2px 0; }
html[dir="rtl"] .hp-clip-toggle[data-state="paused"]::before { border-inline-start: 0; border-inline-end: 11px solid var(--on-night); translate: -2px 0; }
@media (max-width: 600px) { .hp-clip-toggle { width: 44px; height: 44px; } }

/* Draft only (localhost): mark where a clip will go until its file exists */
html.clip-draft .hp-clip.is-missing[data-clip-mode="replace"] { display: block; aspect-ratio: auto; height: 0; overflow: visible; background: none; box-shadow: none; }
html.clip-draft .hp-clip.is-missing::after {
  content: "🎬 " attr(data-clip-label); position: absolute; z-index: 3; inset-block-start: 10px; inset-inline-start: 10px;
  padding: 4px 10px; border: 1px dashed #b38a00; border-radius: 6px; background: #fff1c2; color: #6b4e00;
  font: 600 12px/1.4 system-ui, sans-serif; white-space: nowrap; pointer-events: none;
}
html.clip-draft .hp-clip.is-missing[data-clip-mode="overlay"] { opacity: 1; }
