/* ===========================================================================
   WAVES — the flowing artwork behind the three membership cards

   The motion is drawn by assets/js/waves.js. Everything here is the frame
   around it: the bed the artwork sits in, the still that stands in until the
   first WebGL frame lands, and the scrim that keeps the copy readable over it.

   Layer order inside a card, bottom to top:
     1. the card's own surface colour   — so the card is never blank
     2. .vub-plan__still                — the PNG, object-fit: cover
     3. .vub-plan__canvas               — the same artwork, flowing
     4. .vub-plan__bg::after            — the readability scrim
     5. the card's content              — text and buttons, untouched
   =========================================================================== */

/* The card keeps every dimension, colour and border it had in sections.css.
   All this adds is a stacking context for the bed to sit at the bottom of. */
.vub-plan {
	position: relative;
	isolation: isolate;
}

/* The bed. Absolutely positioned, so it fills the padding box and the card's
   border — the featured card's red one included — stays crisp on top of it. */
.vub-plan__bg {
	position: absolute;
	inset: 0;
	z-index: 0;
	overflow: hidden;
	border-radius: inherit;

	/* Decorative through and through: never a click target, never a tab stop,
	   never in the way of the button underneath the pointer. */
	pointer-events: none;

	/* The card's own surface, taken straight from the parent so the featured
	   card keeps its lighter --vub-surface-3. It is what shows if the artwork
	   is slow, blocked or missing, which is why there is no state in which one
	   of these cards is a blank rectangle. */
	background-color: inherit;
}

.vub-plan__still,
.vub-plan__canvas {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
}

/* The framing, and the only place it is defined.
   waves.js works the identical cover fit out in the shader from the canvas and
   image dimensions, so the hand-over in the next rule does not move the
   artwork by a pixel. Change this and change main() in waves.js with it. */
.vub-plan__still {
	object-fit: cover;
	object-position: 50% 50%;
}

/* The first frame is on the canvas. It is drawn with the displacement still
   ramped to zero (CFG.warmup in waves.js), so what fades up here is the same
   image that is already on screen and the motion grows out of the still rather
   than cutting to it. */
.vub-plan__canvas {
	opacity: 0;
	transition: opacity var(--vub-duration-slow) var(--vub-ease-out);
}

.vub-plan.is-wave-ready .vub-plan__canvas { opacity: 1; }

/* The scrim.

   The dense band from 20% to 90% is where every card's small muted copy sits —
   the period after the price, and the whole feature list. It is set so that
   even a pixel of pure white in the artwork, at the worst point of the whole
   animation cycle, still clears 4.5:1 against --vub-text-muted; measured worst
   case is 4.59:1 on the silver artwork and 5.31:1 on the red.

   Above and below that band there is nothing but padding and, at the foot, a
   button whose white bold label has better than 12:1 to spare. So the scrim
   eases off at both edges and the artwork comes up brightest exactly where
   there is nothing to read — which is what keeps these cards from looking like
   flat black rectangles.

   Moving any text out of the 20–90% band means re-checking these numbers. */
.vub-plan__bg::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(
		to bottom,
		rgba(8, 9, 10, 0.52) 0%,
		rgba(8, 9, 10, 0.62) 8%,
		rgba(8, 9, 10, 0.82) 20%,
		rgba(8, 9, 10, 0.82) 90%,
		rgba(8, 9, 10, 0.58) 100%
	);
}

/* The content rides above the bed. Everything in the card is in this list, so
   nothing is left sharing a stacking level with the artwork. */
.vub-plan__badge,
.vub-plan__name,
.vub-plan__price,
.vub-plan__features,
.vub-plan__cta {
	position: relative;
	z-index: 1;
}

/* --------------------------------------------------------------------------
   Reduced motion

   waves.js never starts, so no canvas is ever created and the still is the
   whole design. This is only here to say so — there is nothing to switch off.
   -------------------------------------------------------------------------- */
