/* PRA interactive demo (pra_demo.js). Every class is prefixed with prad- so the demo can live inside other pages. */
#pra-demo { --m: #8C1D40; --m2: #5c1029; --gold: #FFC627; --ink: #1d2128; --muted: #626a74; --line: #e4e7eb;
  --soft: #f4f5f7; --tint: #f8eff2; --orange: #e0670f; color: var(--ink); font-size: 15px; line-height: 1.45;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
#pra-demo * { box-sizing: border-box; }
:where(#pra-demo) img { box-shadow: none; margin: 0; max-width: none; }
:where(#pra-demo) button, :where(#pra-demo) select { font: inherit; color: inherit; }
.prad-fine { font-size: 0.76em; color: #8b929a; margin: 10px 2px 0; }

/* ---------------------------------------------------------------- hero + tabs */
.prad-hero { position: relative; overflow: hidden; border-radius: 16px 16px 0 0; color: #fff; padding: 26px 28px 0;
  background: radial-gradient(700px 260px at 90% -30%, rgba(255, 198, 39, 0.30), transparent 60%),
              radial-gradient(600px 300px at -10% 130%, rgba(33, 145, 140, 0.32), transparent 60%),
              linear-gradient(120deg, #5c1029, #8C1D40 60%, #a3264f); }
.prad-hero h3 { margin: 0 0 4px; font-size: 1.8em; line-height: 1.15; font-weight: 800; color: #fff; letter-spacing: -0.01em; }
.prad-hero p { margin: 0 0 18px; color: rgba(255,255,255,0.85); }
.prad-tabs { display: flex; gap: 8px; }
.prad-tab { display: flex; align-items: center; gap: 10px; border: 0; cursor: pointer; padding: 11px 20px 11px 12px;
  border-radius: 12px 12px 0 0; background: rgba(255,255,255,0.14); color: #fff; font-weight: 700; transition: background 0.2s; }
.prad-tab:hover { background: rgba(255,255,255,0.22); }
.prad-tab.on { background: #fff; color: var(--ink); }
.prad-tab-k { width: 26px; height: 26px; border-radius: 50%; background: var(--gold); color: #3b0a1a; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; font-size: 0.9em; }
.prad-pane { display: none; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 16px 16px; padding: 20px 22px 22px; background: #fff; }
.prad-pane.on { display: block; animation: prad-in 0.35s ease-out; }
@keyframes prad-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.prad-msg { margin: 0 0 14px; font-size: 1.02em; color: #2d333b; }
.prad-msg b { color: var(--m); }

/* ---------------------------------------------------------------- thumbnails and clip strips */
.prad-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.prad-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.prad-pane > .prad-thumbs { margin-bottom: 16px; }
.prad-thumbs button { position: relative; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden;
  cursor: pointer; background: #111; opacity: 0.7; transition: opacity 0.15s, border-color 0.15s, transform 0.15s; }
.prad-thumbs button:hover { opacity: 0.95; transform: translateY(-1px); }
.prad-thumbs button.on { opacity: 1; border-color: var(--m); box-shadow: 0 0 0 3px rgba(140, 29, 64, 0.16); }
.prad-thumbs img { width: 104px; height: 68px; object-fit: cover; display: block; }
.prad-thumbs .prad-cls { position: absolute; left: 5px; bottom: 5px; }
.prad-cls { display: inline-block; font-style: normal; font-size: 0.68em; font-weight: 800; text-transform: capitalize;
  padding: 1px 7px; border-radius: 999px; }
.prad-cls-0 { background: #ede4f1; color: #440154; }
.prad-cls-1 { background: #dff1ef; color: #136b66; }
.prad-cls-2 { background: #fdf6c7; color: #6b5c00; }
.prad-strip { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; margin-top: 8px; }
.prad-strip button { padding: 0; border: 2px solid transparent; border-radius: 7px; overflow: hidden; cursor: pointer;
  background: none; opacity: 0.55; transition: opacity 0.15s, border-color 0.15s; }
.prad-strip button:hover { opacity: 0.9; }
.prad-strip button.on { opacity: 1; border-color: var(--m); }
.prad-strip img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }

/* ---------------------------------------------------------------- 1: score a video */
.prad-seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--soft); border: 1px solid var(--line); }
.prad-seg button { border: 0; background: none; padding: 7px 16px; border-radius: 999px; cursor: pointer; font-size: 0.88em; font-weight: 700; color: var(--muted); }
.prad-seg button.on { background: var(--m); color: #fff; box-shadow: 0 2px 8px rgba(140, 29, 64, 0.3); }
.prad-a { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.prad-col { min-width: 0; }
.prad-stage { position: relative; border-radius: 14px; overflow: hidden; background: #111; aspect-ratio: 384 / 224;
  box-shadow: 0 12px 30px rgba(20, 24, 31, 0.18); }
.prad-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.35s; }
.prad-stage img.on { opacity: 1; }
.prad-total { display: flex; align-items: baseline; gap: 6px 10px; flex-wrap: wrap; margin-top: 14px; padding: 10px 14px;
  border-radius: 12px; background: var(--soft); }
.prad-total span { font-size: 0.82em; color: var(--muted); margin-right: auto; }
.prad-total b { font-size: 1.5em; font-weight: 800; font-variant-numeric: tabular-nums; }
.prad-total b.pra { color: var(--m); }
.prad-total em { font-style: normal; font-size: 0.8em; color: var(--muted); margin-right: 8px; }
.prad-panel { border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px 16px; background: #fff; }
.prad-nav { display: flex; gap: 6px; align-items: center; }
.prad-nav select { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft);
  font-weight: 700; font-size: 0.95em; cursor: pointer; }
.prad-arrow { width: 36px; height: 36px; flex: none; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer;
  font-size: 1.3em; line-height: 1; color: var(--m); }
.prad-arrow:hover { background: var(--tint); }
.prad-nums { display: flex; gap: 26px; margin: 12px 4px 0; }
.prad-nums b { display: block; font-size: 2.4em; line-height: 1; font-weight: 800; font-variant-numeric: tabular-nums; }
.prad-nums .pra b { color: var(--orange); }
.prad-nums span { font-size: 0.8em; color: var(--muted); }
.prad-panel svg { width: 100%; height: auto; display: block; margin-top: 4px; }
.prad-pulse { animation: prad-pulse 2.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes prad-pulse { 0%, 100% { transform: scale(0.8); } 50% { transform: scale(1.3); } }
.prad-key { display: flex; gap: 16px; justify-content: center; font-size: 0.8em; color: var(--muted); margin: 2px 0 8px; }
.prad-key span { display: inline-flex; align-items: center; gap: 6px; }
.prad-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--orange); border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.2); }
.prad-star { color: #f2a20c; font-style: normal; font-size: 1.2em; line-height: 1; }
.prad-desc div { display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: start; padding: 6px 8px; border-radius: 10px;
  font-size: 0.84em; color: var(--muted); transition: background 0.25s, color 0.25s; }
.prad-desc div.on { background: var(--soft); color: var(--ink); }
.prad-desc b { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 0.9em; }

/* ---------------------------------------------------------------- 2: where it looks */
.prad-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.prad-fig { margin: 0; border-radius: 16px; padding: 10px 10px 12px; background: var(--soft); border: 1px solid var(--line); }
.prad-fig.ours { background: var(--tint); border-color: #e7c6d2; }
.prad-fig-h { font-weight: 800; font-size: 1.02em; margin: 2px 4px 8px; color: #4a5059; }
.prad-fig.ours .prad-fig-h { color: var(--m); }
.prad-fig canvas { width: 100%; height: auto; display: block; border-radius: 10px; }
.prad-fig figcaption { display: flex; align-items: center; gap: 12px; margin: 10px 4px 0; }
.prad-iou { font-size: 2.2em; line-height: 1; font-weight: 800; color: #7d8590; font-variant-numeric: tabular-nums; }
.prad-fig.ours .prad-iou { color: var(--m); }
.prad-fig figcaption span { font-size: 0.8em; color: var(--muted); line-height: 1.25; }
.prad-ctrl { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.prad-grow { flex: 1; min-width: 0; }
.prad-grow .prad-strip { margin-top: 0; }
.prad-play { width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%; background: var(--m); color: #fff !important;
  cursor: pointer; font-size: 1em; box-shadow: 0 3px 10px rgba(140, 29, 64, 0.35); }
.prad-play:hover { background: var(--m2); }

@media (max-width: 900px) { .prad-a { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .prad-hero { padding: 20px 16px 0; }
  .prad-hero h3 { font-size: 1.4em; }
  .prad-pane { padding: 14px 12px 16px; }
  .prad-pair { grid-template-columns: 1fr; }
  .prad-thumbs img { width: 76px; height: 52px; }
  .prad-strip { grid-template-columns: repeat(4, 1fr); }
  .prad-tab { padding: 10px 14px 10px 10px; }
}
@media (prefers-reduced-motion: reduce) { #pra-demo * { transition: none !important; animation: none !important; } }
