/* ==========================================================================
   Scene: embed & extract (embedding landing page, home and features pages)
   A video master lies on the floor. A caption file drops onto it and is
   written in as a glowing caption track (no re-encode); then caption
   channels rise back out of the master as separate files (extraction).
   Requires scenes.css (the shared 3D engine). One 9 s loop.
   ========================================================================== */

/* the video master: a long block with frame lines on its top face */
.s-embed .master {
  --x: 30px; --y: 104px; --w: 380px; --h: 92px; --d: 26px; --c: #1c1c20;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .12), transparent 55%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .09) 0 2px, transparent 2px 38px),
    var(--c);
  border: 1px solid rgba(255, 255, 255, .08);
}
.s-embed .master .face-label {
  align-items: flex-start;
  justify-content: flex-start;
  padding: 10px 0 0 14px;
  font: 700 11px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .12em;
  color: rgba(255, 255, 255, .55);
}

/* the caption track lane on the master, filled as the captions go in */
.s-embed .track {
  --x: 44px; --y: 166px; --w: 352px; --h: 16px; --z: 27px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .06);
  overflow: hidden;
}
.s-embed .track i {
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .55) 0 18px, transparent 18px 26px) 0 50% / 100% 4px no-repeat,
    linear-gradient(90deg, #a2160f, #f04848);
  box-shadow: 0 0 16px rgba(240, 72, 72, .8);
  transform-origin: left;
  animation: emb-fill 9s ease-in-out infinite;
}
.s-embed .track span {
  position: absolute; right: 8px; top: 0; line-height: 16px;
  font: 700 9px/16px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .1em; color: #fff;
}

/* the sidecar caption file dropped onto the master (any format in, MCC out) */
.s-embed .cap { --x: 54px; --y: 106px; --w: 118px; --h: 82px; --z: 30px; animation: emb-drop 9s cubic-bezier(.5, 0, .3, 1) infinite; }

/* a wire from the caption file's landing spot along the master */
.s-embed .w-in { --wx: 100px; --wy: 174px; --len: 280px; --wz: 28px; --speed: 3s; }

/* caption channels extracted back out, one file each */
.s-embed .ch { --y: 112px; --w: 62px; --h: 50px; --z: 30px; animation: emb-out 9s cubic-bezier(.3, 1.3, .5, 1) infinite; }
.s-embed .ch .ext { top: 8px; left: 10px; font-size: 11px; color: #fff; }
.s-embed .ch .lines { inset: 26px 10px 6px; scale: .45; transform-origin: 0 0; }
.s-embed .c1 { --x: 222px; }
.s-embed .c2 { --x: 286px; animation-delay: .25s; }
.s-embed .c3 { --x: 350px; animation-delay: .5s; }

.s-embed .hud-what { top: 8%; left: 2%; }
.s-embed .hud-re   { top: 8%; right: 2%; }
.s-embed .hud-std  { bottom: 8%; left: 2%; }
.s-embed .hud-near { bottom: 8%; right: 2%; }

/* drop in, sit on the master while the track fills, then fade into it */
@keyframes emb-drop {
  0% { translate: 0 0 160px; opacity: 0; }
  8% { opacity: 1; }
  20%, 40% { translate: 0 0 0; opacity: 1; }
  50%, 100% { translate: 0 0 -24px; opacity: 0; }
}
@keyframes emb-fill {
  0%, 22% { transform: scaleX(0); }
  44%, 90% { transform: scaleX(1); }
  98%, 100% { transform: scaleX(0); }
}
@keyframes emb-out {
  0%, 52% { translate: 0 0 -26px; opacity: 0; }
  62%, 88% { translate: 0 0 40px; opacity: 1; }
  96%, 100% { translate: 0 0 40px; opacity: 0; }
}

/* Reduced motion: frozen with the track written and the channels out */
@media (prefers-reduced-motion: reduce) {
  .s-embed .track i { transform: scaleX(1); }
  .s-embed .cap { translate: 0 0 70px; opacity: 1; }
  .s-embed .ch { translate: 0 0 40px; opacity: 1; }
}

/* ---- Page helpers for the embedding landing page ------------------------ */
.embed-steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.embed-steps li { counter-increment: step; display: flex; gap: 1rem; align-items: flex-start; }
.embed-steps li::before {
  content: counter(step);
  flex: 0 0 2rem; height: 2rem; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700; color: #fff;
  background: var(--ccc-red);
  box-shadow: 0 0 18px rgba(240, 72, 72, .35);
}
.embed-steps h3 { font-size: 1.05rem; margin: .2rem 0 .25rem; }
.embed-steps p { margin: 0; color: var(--ccc-text-muted); }
.price-tag { font-size: clamp(2.5rem, 2rem + 2vw, 3.5rem); font-weight: 700; line-height: 1; color: #fff; }
.price-tag small { font-size: 1rem; font-weight: 400; color: var(--ccc-text-muted); }
