/**
 * /mobile/css/oink-video-profile.css — VideoProfile styles.
 *
 * snoutOS glass overlay over an autoplay video bg.
 * Aspect-ratio variants: 9/16 (default), 4/5, 1/1, 16/9, fluid.
 * Variants: hero (default), inline, full-bleed.
 *
 * Mobile-first. Tablet + desktop progressive.
 * Tokens cascade from snoutos.css (assumed loaded upstream).
 */

.vp {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 24px;
  background: oklch(8% 0.02 280);
  isolation: isolate;
  contain: layout paint style;
}

/* Aspect ratio variants */
.vp--ar-9x16   { aspect-ratio: 9 / 16; }
.vp--ar-4x5    { aspect-ratio: 4 / 5; }
.vp--ar-1x1    { aspect-ratio: 1 / 1; }
.vp--ar-16x9   { aspect-ratio: 16 / 9; }
.vp--ar-fluid  { aspect-ratio: auto; min-height: 320px; }

/* Layout variants */
.vp--hero       { /* default */ }
.vp--inline     { border-radius: 16px; }
.vp--full-bleed { border-radius: 0; width: 100vw; margin-inline: calc(50% - 50vw); }

/* Media + poster fill the box */
.vp-media,
.vp-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: oklch(10% 0.02 280);
  z-index: 1;
}

.vp-poster {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Veil — subtle gradient improves text legibility over busy frames */
.vp-veil {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    oklch(0% 0 0 / 0.0)   0%,
    oklch(0% 0 0 / 0.15) 35%,
    oklch(0% 0 0 / 0.55) 78%,
    oklch(0% 0 0 / 0.78) 100%
  );
}

/* Overlay — glass action layer, click-through to children but NOT veil */
.vp-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 14px;
  padding: 20px 18px max(20px, env(safe-area-inset-bottom));
  pointer-events: none; /* let inert overlay pass clicks through */
}

.vp-overlay > * { pointer-events: auto; } /* re-enable on actual children */

.vp-titles {
  color: oklch(98% 0.01 280);
  text-shadow: 0 1px 2px oklch(0% 0 0 / 0.55);
}

.vp-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.vp-subtitle {
  margin: 4px 0 0;
  font-size: 14px;
  color: oklch(86% 0.02 280);
  line-height: 1.3;
}

.vp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  pointer-events: none;
}
.vp-actions > * { pointer-events: auto; }

/* Mute toggle — top-right glass button */
.vp-mute {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 4;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid color-mix(in oklch, oklch(97% 0.01 280) 18%, transparent);
  background: color-mix(in oklch, oklch(8% 0.02 280) 60%, transparent);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  color: oklch(94% 0.02 280);
  cursor: pointer;
  transition: background 160ms, transform 200ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.vp-mute:hover  { background: color-mix(in oklch, oklch(12% 0.02 280) 75%, transparent); }
.vp-mute:active { transform: scale(0.92); }
.vp-mute:focus-visible {
  outline: 2px solid oklch(72% 0.22 20);
  outline-offset: 2px;
}

.vp-mute svg { width: 22px; height: 22px; }
.vp-mute .vp-mute-off { display: none; }
.vp-mute[data-muted="0"] .vp-mute-on  { display: none; }
.vp-mute[data-muted="0"] .vp-mute-off { display: block; }

/* Duration label — small bottom-right badge */
.vp-duration {
  position: absolute;
  bottom: 14px;
  right: 14px;
  z-index: 4;
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in oklch, oklch(0% 0 0) 60%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: oklch(96% 0 0);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  pointer-events: none;
}

/* Reduced motion — flatten the autoplay vibe, kill any ken-burns scale */
@media (prefers-reduced-motion: reduce) {
  .vp-mute { transition: none; }
}

/* Reduced data — primitive's JS already disables video; CSS just trims weight */
@media (prefers-reduced-data: reduce) {
  .vp-veil { background: oklch(0% 0 0 / 0.5); }
}

/* Small viewports — tighten paddings */
@media (max-width: 380px) {
  .vp-overlay { padding-inline: 14px; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
  .vp-title    { font-size: 20px; }
  .vp-subtitle { font-size: 13px; }
}

/* Tablet — heroes can grow */
@media (min-width: 768px) {
  .vp { border-radius: 28px; }
  .vp-title    { font-size: 26px; }
  .vp-subtitle { font-size: 15px; }
}
