/* KIVA mesh backgrounds for dark sections, as on the site (src/styles/globals.css).
   Usage: <section class="mesh-bg mesh-corner"> … </section>
   Inner wrappers must not paint their own ink background over the mesh.
   The meshes are static images; the grain is a tiling SVG laid over them. */

.mesh-bg {
  position: relative;
  isolation: isolate;
  background-color: #111827;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

/* Fine grain under the content, so text and logos stay sharp. */
.mesh-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: url('grain.svg');
  background-size: 240px 240px;
  mix-blend-mode: overlay;
  opacity: 0.55;
}

/* On narrow screens the position keeps each style's own light in view. */
.mesh-hero { background-image: url('hero.webp'); }
.mesh-corner { background-image: url('corner.webp'); background-position: 85% top; }
.mesh-teal { background-image: url('teal.webp'); background-position: 15% center; }
.mesh-teal-tall { background-image: url('teal-tall.webp'); background-position: 15% top; }
.mesh-teal-mirror { background-image: url('teal-mirror.webp'); background-position: 85% top; }
.mesh-indigo { background-image: url('indigo.webp'); background-position: center top; }
.mesh-indigo-side { background-image: url('indigo-side.webp'); background-position: left center; }
.mesh-horizon { background-image: url('horizon.webp'); background-position: 80% bottom; }

/* A section that sits directly above other ink sections: mesh and grain fade to ink at the bottom. */
.mesh-indigo-hero {
  background-image: linear-gradient(to bottom, transparent 65%, #111827), url('indigo.webp');
  background-position: center top;
}
.mesh-indigo-hero::before { mask-image: linear-gradient(to bottom, black 65%, transparent); }
