/* Both decorations use the intersections of the same centre-aligned grid tile. */
.prism-atmosphere {
  --hero-grid-cell: clamp(72px, 11vw, 150px);
}

.prism-atmosphere::after {
  --cell: var(--hero-grid-cell);
}

.hero-hatching {
  position: absolute;
  inset: 0;
  pointer-events: none;
  --inset: calc(var(--hero-grid-cell) * .048);
  --pitch: calc(var(--hero-grid-cell) * .058);
  --ink: rgb(178 202 228 / 21.5%);
  -webkit-mask-image: linear-gradient(#000 0% 20%, rgb(0 0 0 / 72%) 43%, rgb(0 0 0 / 24%) 64%, transparent 80%);
  mask-image: linear-gradient(#000 0% 20%, rgb(0 0 0 / 72%) 43%, rgb(0 0 0 / 24%) 64%, transparent 80%);
}

.hero-hatching > i {
  --row: 0;
  --column: 0;
  position: absolute;
  left: calc(50% + var(--column) * var(--hero-grid-cell) + var(--inset));
  /* The tile's cross is at its centre, so the first cross is the remainder
     of half the scene height divided by the tile height. */
  top: calc(50% + (var(--row) - 3) * var(--hero-grid-cell) + var(--inset));
  top: calc(mod(50%, var(--hero-grid-cell)) + var(--row) * var(--hero-grid-cell) + var(--inset));
  width: calc(var(--hero-grid-cell) - 2 * var(--inset));
  aspect-ratio: 1;
  background: repeating-linear-gradient(45deg,
    transparent 0 calc(var(--pitch) - 1px),
    var(--ink) calc(var(--pitch) - .65px) calc(var(--pitch) - .35px),
    transparent var(--pitch));
}

.hero-hatching > :nth-child(1) { --column: -3; }
.hero-hatching > :nth-child(2) { --column: -1; --row: -1; }
.hero-hatching > :nth-child(4) { --column: 2; }
.hero-hatching > :nth-child(5) { --column: 4; --row: -1; }
.hero-hatching > :nth-child(6) { --column: -5; --row: 2; }
.hero-hatching > :nth-child(7) { --column: 3; --row: 2; }

/* Keep the cropped side tiles in the outermost cells on wide displays. */
@media (min-width: 1500px) {
  .hero-hatching > :nth-child(5) { left: calc(100% - mod(50%, var(--hero-grid-cell)) + var(--inset)); }
  .hero-hatching > :nth-child(6) { left: calc(mod(50%, var(--hero-grid-cell)) - var(--hero-grid-cell) + var(--inset)); }
  .hero-hatching > :nth-child(7) { left: calc(100% - mod(50%, var(--hero-grid-cell)) - var(--hero-grid-cell) + var(--inset)); }
}

@media (max-width: 600px) {
  .hero-hatching { --ink: rgb(178 202 228 / 18%); }
  .hero-hatching > :nth-child(1) { --column: -2; }
  .hero-hatching > :nth-child(4) { --column: 1; }
  .hero-hatching > :nth-child(5) { --column: 2; }
  .hero-hatching > :nth-child(6) { --column: -3; }
  .hero-hatching > :nth-child(7) { --column: 2; }
}
