/* ==========================================================================
   seam.css — the pixelated border (seam.js) at the foot of a section.

   The section holding it needs position: relative and room at the bottom
   (padding-bottom ≥ --seam-height); the next section should start in the
   seam's light colour.
   ========================================================================== */

:root {
  --seam-lead: clamp(96px, 18svh, 220px);     /* light before the next section's content */
  --seam-height: clamp(220px, 14vw, 200px);   /* how tall the border is */
}

.pixel-seam {
  position: absolute;
  inset-inline: var(--card-gap);   /* as wide as the card it leads into */
  inset-block-end: 0;
  height: var(--seam-height);
  z-index: 3;
  pointer-events: none;

  --seam-pixel: 8;              /* one pixel, px */
  --seam-light: var(--light);   /* the colour that rises */
  --seam-ink: var(--dark);      /* letters and specks on the light */
  --seam-band: 5;               /* depth of the dithered band, in pixels */
  --seam-rise: 0.5;             /* how far the light rises as you scroll, 0–1 */
  --seam-motion: 0.75;          /* how much the edge moves per scroll, 0–1 */
}
.pixel-seam canvas { display: block; }

/* the section the seam leads into starts in the seam's light: no top rule */
section:has(> [data-pixel-seam]) + section,
section:has(> [data-pixel-seam]) + script + section {
  border-top: 0;
  /* breathing room on the light before its content arrives: the visitor
     scrolls a little further into the stars first */
  padding-top: var(--seam-lead);
}

/* not before the first scroll: it fades in once the visitor moves */
.pixel-seam { opacity: 0; transition: opacity 600ms ease; }
.pixel-seam.is-on { opacity: 1; }
