/*
 * OrangeBills vintage print effect.
 * Markup: .orange-print > img.orange-print-image + span.orange-print-tint + span.orange-print-grain,
 * with the gradient-map SVG filter passed in through --print-filter. --print-intensity runs from 0 to 1.
 */
.orange-print {
  --print-intensity: 1;
  --print-orange: #ff7845;
  --print-turquoise: #00b6b4;
  --print-cream: #fff3e5;
  --print-ink: #3a1a12;
  position: relative;
  display: block;
  overflow: hidden;
  isolation: isolate;
  background: var(--print-cream);
}

.orange-print-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: var(--print-filter, none);
}

.orange-print-tint,
.orange-print-grain {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

/* Turquoise drifts in from the upper corners and fades through cream into the warm print. */
.orange-print-tint {
  background:
    radial-gradient(ellipse 60% 65% at 0% 0%, rgb(0 182 180 / .75) 0%, rgb(0 182 180 / .35) 42%, transparent 78%),
    radial-gradient(ellipse 80% 90% at 100% 0%, var(--print-turquoise) 0%, rgb(0 182 180 / .65) 42%, transparent 82%),
    linear-gradient(rgb(0 182 180 / .18), rgb(0 182 180 / .18));
  mix-blend-mode: color;
  opacity: var(--print-intensity);
}

/* Cream haze behind the texture, then halftone dots broken up by paper noise and a soft grain. */
.orange-print-grain {
  background:
    radial-gradient(ellipse 60% 48% at 52% 18%, var(--print-cream) 0%, rgb(255 243 229 / .7) 38%, rgb(255 243 229 / .18) 68%, transparent 88%),
    linear-gradient(rgb(255 243 229 / .16), rgb(255 243 229 / .16));
  opacity: var(--print-intensity);
}
.orange-print-grain::before,
.orange-print-grain::after {
  position: absolute;
  inset: 0;
  content: "";
}
.orange-print-grain::before {
  background: radial-gradient(circle, var(--print-ink) 0 1px, transparent 1.6px) 0 0 / 5px 5px;
  mask-image: var(--print-noise);
  mask-size: 220px 220px;
  mix-blend-mode: multiply;
  opacity: .28;
}
.orange-print-grain::after {
  background: var(--print-noise) 0 0 / 280px 280px;
  mix-blend-mode: soft-light;
  opacity: .75;
}
.orange-print-grain {
  --print-noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .38 0 0 0 0 .32 0 0 0 1.6 -.45'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
