/* Photo Kit v1: dependency-free photo direction utilities */

.pk-scrim-b,
.pk-scrim-l,
.pk-grain,
.pk-kenburns,
.pk-frame {
  position: relative;
}

.pk-scrim-b::after,
.pk-scrim-l::after {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  content: "";
  inset: 0;
}

.pk-scrim-b::after {
  background: linear-gradient(to top, rgb(0 0 0 / 0.72), rgb(0 0 0 / 0.08) 62%, transparent);
}

.pk-scrim-l::after {
  background: linear-gradient(to right, rgb(0 0 0 / 0.72), rgb(0 0 0 / 0.08) 64%, transparent);
}

/* Keep overlaid text above the scrim without requiring a child selector. */
.pk-scrim-b > *,
.pk-scrim-l > * {
  position: relative;
  z-index: 2;
}

.pk-duotone {
  --pk-tint: #6d4352;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--pk-tint);
}

.pk-duotone > img,
.pk-duotone > picture,
.pk-duotone > picture > img,
.pk-duotone > video {
  display: block;
  width: 100%;
  filter: grayscale(1);
  mix-blend-mode: screen;
  opacity: 0.88;
}

.pk-duotone::after {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  content: "";
  inset: 0;
  background: var(--pk-tint);
  mix-blend-mode: multiply;
  opacity: 0.8;
}

.pk-duotone > :where(:not(img):not(picture):not(video)) {
  position: relative;
  z-index: 2;
}

.pk-grain {
  isolation: isolate;
  overflow: hidden;
}

.pk-grain::after {
  position: absolute;
  z-index: 3;
  pointer-events: none;
  content: "";
  inset: 0;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.78' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.9'/%3E%3C/svg%3E");
}

.pk-arch {
  overflow: hidden;
  border-radius: 50% 50% 0 0 / 34% 34% 0 0;
}

.pk-round-xl {
  overflow: hidden;
  border-radius: 2rem;
}

.pk-circle {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 50%;
}

.pk-circle > img,
.pk-circle > picture,
.pk-circle > video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pk-kenburns {
  overflow: hidden;
}

.pk-kenburns > img,
.pk-kenburns > picture,
.pk-kenburns > video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: pk-kenburns 25s ease-in-out alternate infinite;
  transform-origin: center;
}

@keyframes pk-kenburns {
  from { transform: scale(1); }
  to { transform: scale(1.08); }
}

.pk-frame {
  padding: clamp(0.5rem, 1.8vw, 1rem);
  border: 1px solid currentColor;
}

.pk-frame > img,
.pk-frame > picture,
.pk-frame > video {
  display: block;
  width: 100%;
}

@media (prefers-reduced-motion: reduce) {
  .pk-kenburns > img,
  .pk-kenburns > picture,
  .pk-kenburns > video {
    animation: none;
    transform: none;
  }
}
