/* /video-metadata-generator (static/video-metadata-generator.html, filled by
   backend/core/video_demo.py). Loaded after app.css and public.css; colours are app tokens, so
   both themes follow. Every rule sits under .vmg (the @font-face blocks are the only exception).

   The page is an editing suite: a black program monitor showing a real clip's still, an
   inspector beside it with the metadata PixelKeyAI wrote, and a clip bin underneath. Picking a
   clip (or the gentle auto-advance) swaps the open result; that cut is the one authored motion.
   Without JavaScript every clip is still reachable through its #clip-<slug> link (:target). */

@font-face { font-family: "Geist"; font-style: normal; font-weight: 400; font-display: swap; src: url(/static/fonts/geist-400.woff2) format("woff2"); }
@font-face { font-family: "Geist"; font-style: normal; font-weight: 600; font-display: swap; src: url(/static/fonts/geist-600.woff2) format("woff2"); }
@font-face { font-family: "Geist"; font-style: normal; font-weight: 700; font-display: swap; src: url(/static/fonts/geist-700.woff2) format("woff2"); }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url(/static/fonts/geist-mono-500.woff2) format("woff2"); }

.vmg {
  --vmg-sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --vmg-mono: "Geist Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --vmg-ease: cubic-bezier(.16, 1, .3, 1);
  --vmg-chip-bg: rgba(var(--gold-rgb), .1);
  --vmg-chip-bd: rgba(var(--gold-rgb), .3);
  --vmg-chip-tx: var(--text);
  --vmg-accent: var(--gold);
  --vmg-on-accent: #000;
  --vmg-dwell: 7s;
  width: 100%; max-width: var(--pk-max); box-sizing: border-box; margin: 0 auto; padding: 0 24px;
  font-family: var(--vmg-sans); color: var(--text);
}
[data-theme="light"] .vmg {
  --vmg-chip-bg: #f8eccf; --vmg-chip-bd: rgba(var(--gold-rgb), .4); --vmg-chip-tx: #6f560f;
  --vmg-accent: color-mix(in srgb, var(--gold) 62%, #000);
}
.vmg ::selection { background: rgba(var(--gold-rgb), .35); color: var(--text); }
.vmg :is(a, button, [role="button"]):focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 8px; }
.vmg .vmg-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.vmg h2 { margin: 0; font-size: clamp(1.5rem, 2.4vw, 2rem); font-weight: 700; line-height: 1.15; letter-spacing: -.02em; text-wrap: balance; color: var(--text); }

/* ── Hero: the promise, then the editor ── */
.vmg .vmg-hero { padding: 40px 0 16px; }
.vmg .vmg-intro { display: grid; gap: 24px; }
.vmg .vmg-crumbs { margin: 0 0 16px; font-size: 13px; color: var(--muted); }
.vmg .vmg-crumbs a { color: var(--muted); text-decoration: none; border: 0; }
.vmg .vmg-crumbs a:hover { color: var(--pk-link); }
.vmg .vmg-crumbs span { margin: 0 8px; }
.vmg h1 { margin: 0 0 16px; max-width: 22ch; font-size: clamp(2.2rem, 4.2vw, 3.4rem); font-weight: 700; line-height: 1.02;
  letter-spacing: -.03em; text-wrap: balance; color: var(--text); }
.vmg p[data-answer] { max-width: 60ch; margin: 0; font-size: 1.05rem; line-height: 1.6; color: var(--dim); }
.vmg .vmg-act { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.vmg .vmg-btn { display: inline-flex; align-items: center; min-height: 44px; box-sizing: border-box; padding: 12px 24px; border: 0; border-radius: 10px;
  background: var(--gold); color: var(--vmg-on-accent); font-size: 15px; font-weight: 600; text-decoration: none;
  transition: filter .15s, transform .15s var(--vmg-ease); }
.vmg .vmg-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.vmg .vmg-btn:focus-visible { outline-color: var(--text); }
.vmg .vmg-quiet { padding: 8px 0; font-size: 15px; font-weight: 600; color: var(--pk-link); text-decoration: underline;
  text-decoration-color: rgba(var(--gold-rgb), .45); text-underline-offset: 4px; border: 0; }
.vmg .vmg-quiet:hover { text-decoration-color: currentColor; }
.vmg .vmg-terms { flex-basis: 100%; margin: 0; font-size: 13px; color: var(--muted); }
@media (min-width: 1000px) {
  .vmg .vmg-hero { padding-top: 40px; }
  .vmg .vmg-intro { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: end; gap: 24px 48px; }
  .vmg .vmg-lead { display: contents; }
  .vmg .vmg-lead > :not(p) { grid-column: 1 / -1; }
  .vmg h1 { margin: 0; }
  .vmg .vmg-crumbs { margin-bottom: -8px; }
  .vmg .vmg-act { padding-bottom: 4px; }
}

/* ── The editor: monitor + inspector, the bin below ── */
.vmg .vmg-editor { margin-top: 24px; border: 1px solid var(--border); border-radius: 16px;
  background: var(--s1); }
/* One grid for the open panel and the bin (stage and panels are display: contents), so the bin
   can sit right under the monitor: monitor, bin, then the inspector on a narrow screen. */
.vmg .vmg-editor { display: grid; grid-template-columns: minmax(0, 1fr); padding: 16px; }
.vmg .vmg-stage, .vmg .vmg-panel { display: contents; }
.vmg .vmg-monitor { grid-row: 1; }
.vmg .vmg-bin { grid-row: 2; }
.vmg .vmg-inspector { grid-row: 3; min-width: 0; padding-top: 16px; }
/* Without JavaScript: the first clip shows; a #clip-<slug> link shows its own instead. */
.vmg .vmg-editor:not(.vmg-js) .vmg-off:not(:target),
.vmg .vmg-editor:not(.vmg-js) .vmg-stage:has(.vmg-panel:target) .vmg-panel:not(:target),
.vmg .vmg-editor.vmg-js .vmg-off { display: none; }

.vmg .vmg-monitor { position: relative; margin: 0; overflow: hidden; aspect-ratio: 16 / 9; border-radius: 10px; background: #000; }
.vmg .vmg-monitor img { display: block; width: 100%; height: 100%; object-fit: cover; }
.vmg .vmg-monitor.vmg-tall img { object-fit: contain; }
.vmg .vmg-monitor figcaption { position: absolute; inset: auto 0 0; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px;
  padding: 24px 12px 12px; background: linear-gradient(to top, rgba(0, 0, 0, .72), transparent); }
.vmg .vmg-file, .vmg .vmg-tc { font: 500 12px/1.3 var(--vmg-mono); color: #fff; font-variant-numeric: tabular-nums; }
.vmg .vmg-file { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vmg .vmg-monitor .vmg-tc { flex: none; padding: 4px 8px; border-radius: 6px; background: rgba(0, 0, 0, .6); }

.vmg .vmg-inspector { display: flex; flex-direction: column; align-items: flex-start; }
.vmg .vmg-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.vmg .vmg-badge { padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--dim); }
.vmg .vmg-badge-ist { border-color: var(--vmg-chip-bd); background: var(--vmg-chip-bg); color: var(--vmg-chip-tx); }
.vmg .vmg-label { margin: 0 0 4px; font-size: 12px; color: var(--muted); }
.vmg .vmg-label span { font-variant-numeric: tabular-nums; }
.vmg .vmg-title { margin: 0 0 16px; font-size: 20px; font-weight: 600; line-height: 1.3; letter-spacing: -.01em; text-wrap: pretty; color: var(--text); }
.vmg .vmg-desc { margin: 0 0 16px; max-width: 62ch; font-size: 15px; line-height: 1.55; color: var(--dim); }
.vmg .vmg-kws { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.vmg .vmg-kws li { padding: 4px 10px; border: 1px solid var(--vmg-chip-bd); border-radius: 8px; background: var(--vmg-chip-bg);
  font-size: 13px; line-height: 1.35; color: var(--vmg-chip-tx); }
.vmg .vmg-kw-more { display: inline-flex; align-items: center; min-height: 32px; margin: 8px 0 0 -8px; padding: 4px 8px; border: 0; border-radius: 8px;
  background: none; font: 600 13px var(--vmg-sans); color: var(--pk-link); cursor: pointer; }
.vmg .vmg-kw-more:hover { background: var(--s2); }
.vmg .vmg-kw-more[hidden] { display: none; }
.vmg .vmg-kw-more:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
@media (max-width: 999px) {
  .vmg .vmg-editor.vmg-js .vmg-panel:not(.vmg-all) .vmg-kws li:nth-child(n+17) { display: none; }
}
.vmg .vmg-facts { display: flex; gap: 24px; margin: 16px 0 0; }
.vmg .vmg-facts dt { font-size: 12px; color: var(--muted); }
.vmg .vmg-facts dd { margin: 0; font-size: 13px; font-weight: 600; color: var(--text); }


/* The bin: every clip, its kind of footage and its length. */
.vmg .vmg-bin { min-width: 0; padding: 16px 0 0; }
.vmg .vmg-bin-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; margin-bottom: 16px; }
.vmg .vmg-bin-head h2 { font-size: 15px; font-weight: 600; letter-spacing: 0; }
.vmg .vmg-bin-head p { margin: 0; font-size: 13px; color: var(--muted); }
.vmg .vmg-bin-list { display: grid; grid-auto-flow: column; grid-auto-columns: 136px; gap: 12px; margin: 0; padding: 4px 4px 8px;
  list-style: none; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: 4px; scrollbar-width: thin; scrollbar-color: var(--border2) transparent; }
.vmg .vmg-bin-list li { scroll-snap-align: start; }
.vmg .vmg-clip { display: block; border: 0; border-radius: 8px; text-decoration: none; color: var(--dim); }
.vmg .vmg-clip-frame { position: relative; display: block; overflow: hidden; aspect-ratio: 16 / 9; border-radius: 8px; background: #000;
  outline: 2px solid transparent; outline-offset: 2px; transition: outline-color .2s; }
.vmg .vmg-clip-frame img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: .72; transition: opacity .2s, transform .4s var(--vmg-ease); }
.vmg .vmg-clip-frame.vmg-tall img { object-fit: contain; }
.vmg .vmg-clip-frame .vmg-tc { position: absolute; right: 4px; bottom: 4px; padding: 2px 6px; border-radius: 4px; background: rgba(0, 0, 0, .66); font-size: 11px; }
.vmg .vmg-clip-kind { display: block; margin-top: 8px; font-size: 13px; line-height: 1.3; }
.vmg .vmg-clip-bar { display: block; height: 2px; margin-top: 6px; border-radius: 2px; background: var(--vmg-accent); transform: scaleX(0); transform-origin: left; }
.vmg .vmg-clip:hover .vmg-clip-frame img { opacity: 1; transform: scale(1.03); }
.vmg .vmg-clip:hover { color: var(--text); }
.vmg .vmg-clip[aria-current="true"] { color: var(--text); font-weight: 600; }
.vmg .vmg-clip[aria-current="true"] .vmg-clip-frame { outline-color: var(--vmg-accent); }
.vmg .vmg-clip[aria-current="true"] .vmg-clip-frame img { opacity: 1; }
.vmg .vmg-clip[aria-current="true"] .vmg-clip-bar { transform: scaleX(1); }

/* Wide: the editing-suite layout. The open panel's monitor and inspector and the bin share one
   grid, so the bin sits under the monitor and the inspector runs down the right. */
@media (min-width: 1000px) {
  .vmg .vmg-editor { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); grid-template-rows: auto 1fr; gap: 0 32px; padding: 24px; }
  .vmg .vmg-monitor { grid-column: 1; grid-row: 1; }
  .vmg .vmg-inspector { grid-column: 2; grid-row: 1 / span 2; padding-top: 4px; }
  .vmg .vmg-kw-more { display: none; }
  .vmg .vmg-bin { grid-column: 1; grid-row: 2; padding-top: 24px; }
  .vmg .vmg-bin-list { grid-auto-flow: row; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; padding: 4px 0 0; overflow: visible; }
}

/* The playhead: while the editor auto-advances, the open clip's bar fills over its dwell time. */
@keyframes vmg-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.vmg .vmg-editor.vmg-playing .vmg-clip[aria-current="true"] .vmg-clip-bar { animation: vmg-fill var(--vmg-dwell) linear both; }
.vmg .vmg-editor.vmg-playing.vmg-hold .vmg-clip[aria-current="true"] .vmg-clip-bar { animation-play-state: paused; }

/* The cut: the new still wipes in, its keywords follow in reading order. */
@keyframes vmg-wipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes vmg-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes vmg-fade { from { opacity: 0; } to { opacity: 1; } }
.vmg .vmg-panel.vmg-enter .vmg-monitor img { animation: vmg-wipe .55s var(--vmg-ease) both; }
.vmg .vmg-panel.vmg-enter .vmg-inspector > :not(.vmg-kws) { animation: vmg-fade .4s var(--vmg-ease) both; }
.vmg .vmg-panel.vmg-enter .vmg-kws li { animation: vmg-rise .45s var(--vmg-ease) both; animation-delay: calc(var(--i, 0) * 22ms + 120ms); }

/* ── Agencies ── */
.vmg .vmg-sec { padding: 64px 0 0; }
.vmg .vmg-sub { max-width: 62ch; margin: 12px 0 24px; font-size: 15px; line-height: 1.6; color: var(--dim); }
.vmg .vmg-agencies { display: grid; gap: 40px; }
.vmg .vmg-table-wrap { overflow-x: auto; }
.vmg .vmg-table { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.vmg .vmg-table th, .vmg .vmg-table td { padding: 12px 16px 12px 0; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.vmg .vmg-table thead th { padding-top: 0; font-size: 12px; font-weight: 400; color: var(--muted); }
.vmg .vmg-table tbody th { font-weight: 600; }
.vmg .vmg-table tbody th a { color: var(--text); text-decoration: underline; text-decoration-color: var(--border2); text-underline-offset: 4px; border: 0; }
.vmg .vmg-table tbody th a:hover { color: var(--pk-link); text-decoration-color: currentColor; }
.vmg .vmg-table td { color: var(--dim); }
.vmg .vmg-notes { display: flex; flex-direction: column; gap: 24px; }
.vmg .vmg-note h3 { margin: 0 0 4px; font-size: 15px; font-weight: 600; color: var(--text); }
.vmg .vmg-note p { margin: 0; max-width: 56ch; font-size: 15px; line-height: 1.6; color: var(--dim); }
@media (min-width: 1000px) {
  .vmg .vmg-agencies { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 64px; align-items: end; }
  .vmg .vmg-notes { padding-bottom: 8px; }
}
@media (max-width: 600px) {
  .vmg .vmg-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .vmg .vmg-table, .vmg .vmg-table tbody, .vmg .vmg-table tr, .vmg .vmg-table th, .vmg .vmg-table td { display: block; }
  .vmg .vmg-table tr { padding: 12px 0; border-bottom: 1px solid var(--border); }
  .vmg .vmg-table th, .vmg .vmg-table td { padding: 2px 0; border: 0; }
  .vmg .vmg-table tbody th { margin-bottom: 4px; }
  .vmg .vmg-table td::before { content: attr(data-label) ": "; color: var(--muted); }
}

/* ── FAQ (public.css draws the items) ── */
.vmg #faq h2 { margin-bottom: 24px; }

/* ── Close ── */
.vmg .vmg-close { margin-top: 72px; padding: 48px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.vmg .vmg-close h2 { font-size: clamp(1.9rem, 3.4vw, 2.8rem); letter-spacing: -.03em; }
.vmg .vmg-close p { margin: 12px 0 24px; font-size: 1.05rem; line-height: 1.6; color: var(--dim); }

/* ── Blog and tools ── */
.vmg .vmg-extra { padding-top: 48px; }
.vmg .vmg-extra h2 { margin: 0 0 16px; font-size: 1.15rem; letter-spacing: -.01em; }
.vmg .vmg-extra .pk-chips { margin-bottom: 8px; }
.vmg .vmg-extra .pk-grid + h2 { margin-top: 40px; }

@media (prefers-reduced-motion: reduce) {
  .vmg *, .vmg *::before, .vmg *::after { animation: none !important; transition: none !important; }
}
