/* Unit cost loops: silent looping videos. Each loop appears once on the site:
   "Every Trade" on features.html, "Guess vs Real" on index.html. */

.uc-loop {
  margin: 0;
}

.uc-frame {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 1rem;
  background: #0f172a;
  box-shadow: 0 18px 36px -22px rgba(15, 23, 42, 0.55);
}

.uc-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Pause control (WCAG 2.2.2). Stays quiet until the tile is hovered or the
   button has focus; touch screens always show it. */
.uc-toggle {
  position: absolute;
  right: 0.5rem;
  bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 9999px;
  background: #0f172a;
  color: #ffffff;
  cursor: pointer;
  transition: opacity 0.2s ease, border-color 0.2s ease;
}

.uc-toggle[hidden] {
  display: none;
}

.uc-toggle svg {
  width: 0.8rem;
  height: 0.8rem;
}

.uc-toggle:hover {
  border-color: #fe5d01;
}

.uc-toggle:focus-visible {
  outline: 2px solid #fe5d01;
  outline-offset: 2px;
}

@media (hover: hover) {
  .uc-toggle {
    opacity: 0.55;
  }

  .uc-frame:hover .uc-toggle,
  .uc-toggle:focus-visible {
    opacity: 1;
  }
}

.uc-caption {
  margin-top: 0.5rem;
  color: #64748b;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------- Home FAQ tile ----------
   Computers: inside the pinned left column, under the intro.
   Phones and tablets: after the questions, so it never pushes them down.
   Only one shows at any width, and a hidden one never fetches its video. */

.uc-tile-side {
  display: none;
  max-width: 16rem;
  margin-top: 1.75rem;
}

.uc-tile-after {
  width: 100%;
  max-width: 16rem;
  margin-inline: auto;
}

.uc-tile-after .uc-caption {
  text-align: center;
}

@media (min-width: 1024px) {
  .uc-tile-side {
    display: block;
  }

  .uc-tile-after {
    display: none;
  }
}

/* ---------- Feature display (Features page) ---------- */

.uc-display {
  margin-top: 3.5rem;
  overflow: hidden;
  border-radius: 1rem;
  box-shadow: 0 30px 60px -32px rgba(15, 23, 42, 0.6);
}

.uc-display-grid {
  display: grid;
  align-items: center;
}

.uc-display-copy {
  padding: 2.25rem 1.5rem 0.5rem;
}

.uc-display h3 {
  text-wrap: balance;
}

.uc-display .uc-frame {
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.uc-display .uc-toggle {
  right: 0.75rem;
  bottom: 0.75rem;
}

/* The video's navy grid fades into the panel's, so there is no visible box. */
.uc-display .uc-video {
  -webkit-mask-image: linear-gradient(180deg, transparent 0, rgba(0, 0, 0, 0.55) 8%, #000 16%);
  mask-image: linear-gradient(180deg, transparent 0, rgba(0, 0, 0, 0.55) 8%, #000 16%);
}

.uc-sample {
  display: inline-block;
  padding: 0.25rem 0.625rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 9999px;
  color: #cbd5e1;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Side by side from large phones up, so the square video never fills a tablet. */
@media (min-width: 640px) {
  .uc-display-grid {
    grid-template-columns: minmax(0, 1fr) 19rem;
  }

  .uc-display-copy {
    padding: 2rem 0.5rem 2rem 2rem;
  }

  .uc-display .uc-video {
    -webkit-mask-image: linear-gradient(90deg, transparent 0, rgba(0, 0, 0, 0.55) 6%, #000 11%);
    mask-image: linear-gradient(90deg, transparent 0, rgba(0, 0, 0, 0.55) 6%, #000 11%);
  }
}

/* Tablets: the panel is taller than the video, so fade its top and bottom too. */
@media (min-width: 640px) and (max-width: 1023.98px) {
  .uc-display .uc-video {
    -webkit-mask-image: linear-gradient(90deg, transparent 0, rgba(0, 0, 0, 0.55) 6%, #000 11%),
      linear-gradient(180deg, transparent 0, #000 12%, #000 88%, transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, rgba(0, 0, 0, 0.55) 6%, #000 11%),
      linear-gradient(180deg, transparent 0, #000 12%, #000 88%, transparent 100%);
    -webkit-mask-composite: source-in;
    mask-composite: intersect;
  }
}

@media (min-width: 1024px) {
  .uc-display-grid {
    grid-template-columns: minmax(0, 1fr) 30rem;
  }

  .uc-display-copy {
    padding: 2.5rem 1rem 2.5rem 3.5rem;
  }
}
