/* ───────── VIA inline cinematic explainer ───────── */
.vx-wrap {
  --vx-accent: #F59E0B;
  position: relative;
  width: 100%;
  max-width: 960px;
  margin: 36px auto 0;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  background: #0a0c10;
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow:
    0 30px 80px rgba(0,0,0,0.55),
    0 0 0 1px rgba(245,158,11,0.05) inset,
    0 0 120px rgba(245,158,11,0.04);
}
#via-explainer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.vx-stage {
  position: absolute; inset: 0;
  overflow: hidden;
}
.vx-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
}

/* film grain */
.vx-grain {
  position: absolute; inset: -5%;
  pointer-events: none;
  opacity: 0.10;
  mix-blend-mode: overlay;
  background-image:
    radial-gradient(rgba(255,255,255,0.8) 0.5px, transparent 0.5px),
    radial-gradient(rgba(255,255,255,0.6) 0.5px, transparent 0.5px);
  background-size: 3px 3px, 5px 5px;
  background-position: 0 0, 1px 1px;
  animation: vxGrain 1.2s steps(6) infinite;
}
@keyframes vxGrain {
  0%   { transform: translate(0,0); }
  20%  { transform: translate(-2%,1%); }
  40%  { transform: translate(1%,-1%); }
  60%  { transform: translate(-1%,2%); }
  80%  { transform: translate(2%,-2%); }
  100% { transform: translate(0,0); }
}

.vx-vignette {
  position: absolute; inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.55) 100%);
}

.vx-layer { position: absolute; inset: 0; pointer-events: none; }

/* top strip: ticker + scene label */
.vx-overlay {
  padding: 18px 22px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  grid-template-columns: 1fr auto;
  gap: 6px;
}
.vx-ticker {
  grid-row: 1; grid-column: 1 / span 2;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  color: rgba(245,158,11,0.75);
  text-transform: uppercase;
}
.vx-timecode {
  grid-row: 3; grid-column: 2;
  justify-self: end;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.55);
}
.vx-scene-label {
  grid-row: 3; grid-column: 1;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
}

/* captions: middle/lower third, staggered */
.vx-captions {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 40px 44px 72px;
  transition: opacity 0.3s ease;
}
.vx-caption {
  max-width: 640px;
}
.vx-cap-eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--vx-accent);
  text-transform: uppercase;
  margin-bottom: 10px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.6s ease 0s, transform 0.6s cubic-bezier(.2,.7,.2,1) 0s;
}
.vx-caption.in .vx-cap-eyebrow { opacity: 1; transform: translateY(0); }
.vx-cap-headline {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(22px, 3.6vw, 44px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-wrap: pretty;
  text-shadow: 0 2px 20px rgba(0,0,0,0.6);
}
.vx-cap-headline span {
  display: block;
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.7s cubic-bezier(.2,.7,.2,1) calc(0.12s + var(--i,0) * 0.12s),
    transform 0.7s cubic-bezier(.2,.7,.2,1) calc(0.12s + var(--i,0) * 0.12s);
}
.vx-caption.in .vx-cap-headline span {
  opacity: 1; transform: translateY(0);
}

/* scene-specific caption accents */
.vx-cap-old       .vx-cap-headline span:last-child { color: rgba(255,255,255,0.55); }
.vx-cap-inflect   .vx-cap-eyebrow { color: #fff; background: var(--vx-accent); padding: 3px 8px; display: inline-block; }
.vx-cap-inflect   .vx-cap-headline { font-size: clamp(26px, 4.4vw, 52px); }
.vx-cap-protocol  .vx-cap-eyebrow { color: var(--vx-accent); }
.vx-cap-call      .vx-cap-headline { font-size: clamp(28px, 4.8vw, 58px); letter-spacing: -0.025em; }
.vx-cap-call      .vx-cap-headline span:last-child { color: var(--vx-accent); }

/* controls */
.vx-controls {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 14px 20px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.35));
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.vx-wrap:hover .vx-controls,
.vx-wrap:focus-within .vx-controls { opacity: 1; transform: translateY(0); }

.vx-btn {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(0,0,0,0.4);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  flex-shrink: 0;
}
.vx-btn:hover { border-color: var(--vx-accent); color: var(--vx-accent); background: rgba(245,158,11,0.1); }
.vx-btn svg { width: 10px; height: 11px; fill: currentColor; display: none; }

.vx-play .vx-icon-play  { display: none; }
.vx-play .vx-icon-pause { display: block; }
.vx-play[data-playing="0"] .vx-icon-play  { display: block; }
.vx-play[data-playing="0"] .vx-icon-pause { display: none; }

.vx-audio .vx-icon-muted { display: block; }
.vx-audio .vx-icon-sound { display: none; }
.vx-audio[data-on="1"] { color: var(--vx-accent); border-color: var(--vx-accent); }
.vx-audio[data-on="1"] .vx-icon-muted { display: none; }
.vx-audio[data-on="1"] .vx-icon-sound { display: block; }

/* scrubber */
.vx-scrub {
  position: relative;
  flex: 1;
  height: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
}
.vx-scrub-track {
  position: absolute; left:0; right:0; top: 50%;
  height: 2px; transform: translateY(-50%);
  background: rgba(255,255,255,0.14);
  border-radius: 2px;
}
.vx-scrub-fill {
  position: absolute; left:0; top:50%;
  height: 2px; transform: translateY(-50%);
  background: var(--vx-accent);
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(245,158,11,0.5);
}
.vx-scrub-head {
  position: absolute; top: 50%;
  width: 10px; height: 10px;
  transform: translate(-50%, -50%);
  background: var(--vx-accent);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(245,158,11,0.15);
}
.vx-scrub-markers {
  position: absolute; left: 0; right: 0; top: 0; bottom: 0;
  pointer-events: none;
}
.vx-scrub-marker {
  position: absolute; top: 50%;
  width: 1px; height: 10px;
  transform: translate(-50%, -50%);
  background: rgba(255,255,255,0.25);
}

/* tweaks panel */
.vx-tweaks {
  position: fixed;
  right: 22px; bottom: 22px;
  width: 260px;
  background: rgba(15,16,20,0.94);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(245,158,11,0.35);
  border-radius: 12px;
  padding: 16px 16px 14px;
  color: #e6e6e6;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  z-index: 9999;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  display: none;
}
.vx-tweaks[data-open="1"] { display: block; }
.vx-tweaks-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #F59E0B;
  margin-bottom: 10px;
  display: flex; justify-content: space-between; align-items: center;
}
.vx-tweaks-title button {
  background: transparent; color: #888; border: 0; cursor: pointer; font-size: 14px;
}
.vx-tweaks label {
  display: flex; flex-direction: column; gap: 4px;
  margin-bottom: 12px;
  font-size: 12px;
  color: #bbb;
}
.vx-tweaks input[type=range] { width: 100%; accent-color: #F59E0B; }
.vx-tweaks-row { display: flex; gap: 8px; }
.vx-tweaks-swatch {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
}
.vx-tweaks-swatch[data-active="1"] { border-color: #fff; }

@media (max-width: 768px) {
  .vx-wrap { margin-top: 24px; border-radius: 10px; }
  .vx-captions { padding: 30px 22px 60px; }
  .vx-cap-headline { font-size: clamp(19px, 5.8vw, 28px); }
  .vx-controls { padding: 10px 14px 12px; }
  .vx-tweaks { right: 12px; left: 12px; bottom: 12px; width: auto; }
}
