/* AI mark demo: a short scene that plays on a loop. A box is marked on the reel, a request is typed, the AI
   plans three steps and ticks them, the change appears on the video, and it reports its check. mark-demo.js adds
   the step classes s1…s7 one after another (and clears them to start over); everything here only reacts. */
.mk { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr); gap: 32px; align-items: center; }
.mk-text h3 { margin: 4px 0 8px; }
.mk-text > p { margin: 0 0 20px; }

/* the reel frame */
.mk-frame { position: relative; width: min(100%, 260px); justify-self: center; aspect-ratio: 9 / 16; border-radius: 22px; overflow: hidden; border: 1px solid var(--line2);
  background: #000; box-shadow: 0 32px 64px -32px #000; direction: ltr; }
.mk-frame img { width: 100%; height: 100%; object-fit: cover; }
.mk-box { position: absolute; top: 6%; right: 6%; width: 38%; height: 12%; border: 2px dashed var(--accent); border-radius: 8px; opacity: 0; transform: scale(.6); transform-origin: top right;
  transition: opacity .3s ease-out, transform .4s cubic-bezier(.2,.8,.2,1); }
.mk-box::after { content: "AI mark"; position: absolute; top: calc(100% + 4px); right: 0; padding: 2px 6px; border-radius: 4px; background: var(--accent); color: var(--on-accent); font: 600 9px/1.4 var(--font); }
.mk-logo { position: absolute; inset: 0; display: grid; place-items: center; font: 800 15px/1 var(--font-display); color: #fff; letter-spacing: -.03em; opacity: 0; transform: scale(.8);
  transition: opacity .35s ease-out, transform .45s cubic-bezier(.3,1.4,.5,1); }
.mk-logo span { color: var(--accent); }
.mk-cap { position: absolute; left: 6%; right: 6%; bottom: 14%; text-align: center; font: 800 21px/1.15 var(--font-display); color: #fff; text-shadow: 0 2px 10px #000a;
  transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.mk-cap em { font-style: normal; transition: color .3s ease-out; }

/* the chat */
.mk-chat { position: relative; display: grid; gap: 10px; }
.mk-head { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.mk-head i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.mk-me, .mk-ai { max-width: 92%; padding: 12px 16px; border-radius: 16px; font-size: 15px; line-height: 1.45; }
.mk-me { justify-self: end; background: var(--panel2); border-end-end-radius: 4px; clip-path: inset(0 100% 0 0); transition: clip-path 1.3s steps(24, end); }
[dir="rtl"] .mk-me { clip-path: inset(0 0 0 100%); }
.mk-dots { position: absolute; top: 96px; inset-inline-start: 0; justify-self: start; display: flex; gap: 4px; padding: 12px 14px; border-radius: 14px; background: #00000040; border: 1px solid var(--line); opacity: 0; transition: opacity .2s; }
.mk-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: mk-dot 1s ease-in-out infinite; }
.mk-dots i:nth-child(2) { animation-delay: .15s; } .mk-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes mk-dot { 50% { transform: translateY(-3px); opacity: .5; } }
.mk-plan { justify-self: start; list-style: none; margin: 0; padding: 12px 16px; display: grid; gap: 6px; border-radius: 14px; background: #00000040; border: 1px solid var(--line);
  font-size: 14px; color: var(--muted); opacity: 0; transform: translateY(6px); transition: opacity .3s ease-out, transform .3s ease-out; }
.mk-plan li { display: flex; align-items: center; gap: 8px; }
.mk-plan li::before { content: ""; flex: none; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--line2); transition: background-color .25s, border-color .25s; }
.mk-plan li.done { color: var(--text); }
.mk-plan li.done::before { border-color: var(--ok); background: var(--ok) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M5 10.5l3 3 7-7" fill="none" stroke="%2306210f" stroke-width="2.6" stroke-linecap="round" stroke-linejoin="round"/></svg>') center / 11px no-repeat; }
.mk-ai { justify-self: start; background: #00000040; border: 1px solid var(--line); border-end-start-radius: 4px; opacity: 0; transform: translateY(6px); transition: opacity .3s ease-out, transform .3s ease-out; }
.mk-ai small { display: block; margin-top: 6px; color: var(--muted); font-size: 13px; }
.mk-ai small::before { content: "✓ "; color: var(--ok); }

/* the steps */
.mk.s1 .mk-box { opacity: 1; transform: none; }
.mk.s2 .mk-me { clip-path: inset(0 0 0 0); }
.mk.s3 .mk-dots { opacity: 1; }
.mk.s4 .mk-dots { opacity: 0; display: none; }
.mk.s4 .mk-plan { opacity: 1; transform: none; }
.mk.s5 .mk-logo { opacity: 1; transform: none; }
.mk.s5 .mk-cap em { color: var(--accent); }
.mk.s6 .mk-cap { transform: translateY(-48px); }
.mk.s7 .mk-ai { opacity: 1; transform: none; }

@media (max-width: 860px) {
  .mk { grid-template-columns: 1fr; gap: 24px; }
  .mk-frame { width: min(100%, 220px); order: -1; }
}
@media (prefers-reduced-motion: reduce) { .mk *, .mk *::before, .mk *::after { transition: none !important; animation: none !important; } }
