/* A broadcast calibration card for an empty, powered-on CRT. */
.tape-player__screen .tape-test-pattern {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  pointer-events: none;
  background-color: #9d969a;
  background-image:
    linear-gradient(#e3dfdd80 1px, transparent 1px),
    linear-gradient(90deg, #e3dfdd80 1px, transparent 1px);
  background-size: 20px 20px;
}
.tape-player__screen .tape-test-pattern--tuning { z-index: 2; }
.tape-test-pattern svg {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
}
/* Keep the circle legible in the portfolio's taller phone-sized tube. */
@media (max-width: 680px) {
  .tape-test-pattern svg { width: 112%; max-width: none; }
}

/* Two moving offsets of the cached noise tile make the interference. Keeping
   these as small images avoids rasterising enormous, subpixel-dense gradients
   on every TV activation (especially costly in software-rendered WebKit). */
.tape-player__screen .tape-static {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #777;
  pointer-events: none;
}
.tape-player__screen .tape-static--tuning { z-index: 2; }
.tape-static--tuning .tape-static__grain::after { animation-duration: .12s; }
.tape-static--tuning .tape-static__grain::before { animation-duration: .16s; }
.tape-static__grain {
  position: absolute;
  inset: 0;
  background: var(--tape-static-texture) repeat 0 0 / 192px 192px;
  image-rendering: pixelated;
}
.tape-static__grain::before {
  content: '';
  position: absolute;
  inset: -12%;
  background: var(--tape-static-texture) repeat 0 0 / 192px 192px;
  opacity: .32;
  z-index: 1;
  animation: tape-static-drift .24s linear infinite alternate;
}
.tape-static__grain::after {
  content: '';
  position: absolute;
  inset: -15%;
  pointer-events: none;
  background: var(--tape-static-texture) repeat 91px 73px / 192px 192px;
  mix-blend-mode: difference;
  opacity: .7;
  animation: tape-static-signal .2s linear infinite alternate;
  will-change: transform;
}
.tape-static::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, #1114 0 1px, transparent 1px 4px);
  pointer-events: none;
}
@keyframes tape-static-signal {
  from { transform: translateY(-3%); }
  to { transform: translateY(3%); }
}
@keyframes tape-static-drift {
  from { transform: translate(-3%, 3%); }
  to { transform: translate(4%, -3%); }
}
.tape-static.is-suspended .tape-static__grain,
html.is-tape-paused .tape-static__grain,
.tape-static.is-suspended .tape-static__grain::before,
html.is-tape-paused .tape-static__grain::before,
.tape-static.is-suspended .tape-static__grain::after,
html.is-tape-paused .tape-static__grain::after,
html.deck-open .tape-static__grain::before,
html.deck-open .tape-static__grain::after { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) {
  .tape-static__grain, .tape-static__grain::before, .tape-static__grain::after { animation: none; }
}
