.frame {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(250, 246, 234, 0.92) 0%, rgba(232, 226, 213, 0.92) 100%);
}

.media {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transform: scale(1.018);
  transition:
    opacity 220ms ease,
    transform 420ms cubic-bezier(0.2, 0.82, 0.2, 1);
}

.frame[data-loaded="true"] .media {
  opacity: 1;
  transform: scale(1);
}

.static {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0%, rgba(15, 15, 15, 0.08) 100%),
    radial-gradient(circle at 20% 22%, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0) 36%),
    radial-gradient(circle at 80% 68%, rgba(0, 0, 0, 0.16) 0%, rgba(0, 0, 0, 0) 42%),
    linear-gradient(180deg, #efe9d8 0%, #ddd4c0 100%);
  transition: opacity 180ms ease;
}

.static::before,
.static::after {
  content: "";
  position: absolute;
  inset: -12%;
}

.static::before {
  background:
    url("/grain.svg"),
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.22) 0 2px,
      rgba(0, 0, 0, 0.08) 2px 4px,
      transparent 4px 7px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.09) 0 1px,
      rgba(255, 255, 255, 0.18) 1px 2px,
      transparent 2px 5px
    );
  background-repeat: repeat, repeat, repeat;
  background-size: 140px 140px, 100% 100%, 100% 100%;
  mix-blend-mode: multiply;
  opacity: 0.9;
  animation: image-static-drift 520ms steps(6) infinite;
}

.static::after {
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, 0.1) 36%,
      rgba(0, 0, 0, 0.14) 100%
    );
  mix-blend-mode: soft-light;
}

.frame[data-loaded="true"] .static {
  opacity: 0;
}

@keyframes image-static-drift {
  0% {
    transform: translate3d(0, 0, 0);
  }

  25% {
    transform: translate3d(-1.5%, 1%, 0);
  }

  50% {
    transform: translate3d(1.2%, -1.2%, 0);
  }

  75% {
    transform: translate3d(-0.8%, 1.5%, 0);
  }

  100% {
    transform: translate3d(0, 0, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .media,
  .static,
  .static::before {
    transition: none;
    animation: none;
  }
}
