/* .wave — the site's dotted wave (wave.svg) as a layer behind a section's content (CTA spec
   decisions 24, 25, 27, 35). An empty aria-hidden <div class="wave"> placed by utilities in the HTML
   (position-absolute + inset-0, or a corner), so it never shifts a layout. Here: behind the content
   (its host makes a stacking context: isolate) and never taking clicks, the picture at its own
   proportions by the width (round dots stay round), centred and cropped by the layer's box.
   Dials (starting values = Services' look, decision 35; wave_test.rb pins them):
     --wave-strength  how strong at full (opacity, so a browser without masks shows this, no fade)
     --wave-floor     how faint at the left edge, as a share of the strength
     --wave-reach     where full strength starts; a length when the floor is above 0 (a mask-position
                      % is a share of box − layer size, not of the box, so a % gives the wrong floor)
     --wave-sides     an extra fade layer (the CTA: the page's side fade past 1920)
   Hosts set the dials only, never the mask shorthand (it resets mask-composite to add: no fade).
   The mask: a solid layer minus (the side fade, plus the art fade), so both take strength away
   and multiply. The art-fade layer starts at reach·floor/(floor − 1) and is reach/(1 − floor)
   wide: the floor at the left edge, full from the reach on. */
.wave {
  --wave-strength: var(--alpha-20);
  --wave-floor: 0;
  --wave-reach: 60%;
  z-index: -1;
  pointer-events: none;
  background: url("/assets/wave-824028f4.svg") center / 100% auto no-repeat;
  opacity: var(--wave-strength);
  mask:
    linear-gradient(var(--color-black) 0 0),
    var(--wave-sides, none),
    linear-gradient(to right, var(--gradient-art-fade))
      calc(var(--wave-reach) * var(--wave-floor) / (var(--wave-floor) - 1)) 0 /
      calc(var(--wave-reach) / (1 - var(--wave-floor))) 100% no-repeat;
  mask-composite: subtract, add;
}

/* Phones: no wave (decisions 29, 34). Each wave's parent (a Services card, the CTA section) is a
   container, so the wave answers to its own space, as News's 30rem phone rule; on a phone the
   Services picture covered it anyway (measured 2026-11-25). Tablets and desktops keep it.
   The width is the parent's content box (inside its padding). A wave's parent must not set the
   container shorthand: it would drop the wave-host name. A browser without :has or container
   queries shows the wave on phones (decorative, aria-hidden): accepted. */
:has(> .wave) {
  container: wave-host / inline-size;
}

@container wave-host (width < 30rem) {
  .wave {
    display: none;
  }
}
