/* ==========================================================================
   ebg elements - decor shared by many ebg sections.

   .ebg-bg-shapes   corner line patterns (ebg .bg-shape-1 / .bg-shape-2):
                    370px images top-left and bottom-right, mix-blend-mode
                    difference. The section sets --ebg-shape-1 / --ebg-shape-2
                    to url(...). Drawn as pseudo-elements so the client never
                    sees or breaks them in the editor.
   .ebg-marquee-x   horizontal loop (logo rows, tickers). Group block with the
                    content (a list, images) as its first child; ebg-marquee.js
                    copies it into a track. --ebg-marquee-duration (32s) is the
                    time for one group; hover / focus pauses. The content's own
                    end padding must equal its gap so the seam is invisible. In
                    the editor (no JS) the content shows as-is.
   .ebg-marquee-vr  vertical marquee (ebg .marquee-vr). ebg-marquee.js
                    repeats the paragraph text into .ebg-marquee-vr__item copies;
                    without JS (editor) the plain text shows.
   .ebg-glow        blurred accent disc behind the content (::before). Vars:
                    --ebg-glow-size (200px), --ebg-glow-blur (50px),
                    --ebg-glow-opacity (0.26), --ebg-glow-ink (accent), position
                    --ebg-glow-top / -bottom / -start / -end (auto). Header side
                    panel: 3% / 3% end. Hero h01 keeps its own copy (inserted
                    pattern markup is static).
   .ebg-texture-lines  diagonal 1px hairlines every 14px at 115deg, masked to the
                    outer thirds (::before). --ebg-line-texture-dark sets the ink.
   .ebg-blooms      two soft accent radial blooms, top end and bottom start
                    (::after). --ebg-footer-bloom-top / -bottom set the inks.
   Each draws one pseudo-element: .ebg-glow and .ebg-texture-lines both use
   ::before, so do not combine them on one element. The host needs no
   position: the utilities add position: relative and isolation.
   Not ported by decision (2026-11-05): ebg's vertical "Scroll Down" link
   (.banner-scroll). Visitors know pages scroll; it adds noise.
   ========================================================================== */

@layer components {

	.ebg-bg-shapes {
		position: relative;
		isolation: isolate;

		&::before,
		&::after {
			content: "";
			position: absolute;
			z-index: -1;
			inline-size: 100%;
			max-inline-size: 370px;
			aspect-ratio: 370 / 590;
			background: var(--ebg-shape-1) center / contain no-repeat;
			mix-blend-mode: difference;
			pointer-events: none;
		}

		&::before {
			top: 0;
			left: 0;
		}

		&::after {
			right: 0;
			bottom: 0;
			background-image: var(--ebg-shape-2, var(--ebg-shape-1));
		}

		@media (max-width: 767px) {
			&::before,
			&::after { max-inline-size: 260px; }
		}
	}

	.ebg-marquee-x {
		overflow: hidden;

		& .ebg-marquee-x__track {
			display: flex;
			margin-block: 0; /* Blocksy's flow spacing (--theme-content-spacing) adds 24px below every group child */
			inline-size: max-content;
		}

		& .ebg-marquee-x__group { flex: none; }

		@media (prefers-reduced-motion: no-preference) {
			& .ebg-marquee-x__track { animation: ebg-marquee-x var(--ebg-marquee-duration, 32s) linear infinite; }
		}

		&:is(:hover, :focus-within) .ebg-marquee-x__track { animation-play-state: paused; }
	}

	@keyframes ebg-marquee-x {
		to { transform: translateX(calc(-1 * var(--ebg-marquee-shift, 50%))); }
	}

	/* Outlined giant words (Layout H11 footer marquee .marquee-text): a list
	   whose items are drawn as a white outline at 20% strength, 70% on hover,
	   each followed by a hollow accent separator shape (ebg puts a photo
	   there). Every item carries its separator, so the seam between loop copies
	   gets one too. The dimming is on the stroke colour, not opacity, so the
	   separator stays at full strength. Put it inside .ebg-marquee-x for the
	   loop; for dark surfaces.
	   Separators are outline-only SVG masks painted in --ebg-ow-sep-ink, so they
	   need no icon font and echo the outlined words. Presets (modifier class on
	   the list): --sep-asterisk (default) | sparkle | star4 | star | star6 |
	   star8 | burst | ring | diamond | plus | none. A custom one: set --ebg-ow-mask to an SVG url().
	   Tune with --ebg-ow-fs, --ebg-ow-stroke, --ebg-ow-gap (word to separator to
	   word), --ebg-ow-ink, --ebg-ow-sep-ink, --ebg-ow-shape (separator size, in
	   word em). ebg sizes: 136 / 100 / 80 / 50px at > 1399 / 1399 / 1024 / 767. */
	.ebg-outline-words {
		--ebg-ow-fs: 136px;
		--ebg-ow-stroke: 2px;
		--ebg-ow-gap: 60px; /* ebg: 30px either side of the photo */
		--ebg-ow-ink: #FFFFFF;
		--ebg-ow-stroke-mix: 20%; /* outline strength */
		--ebg-ow-fill: transparent; /* hollow by default */
		--ebg-ow-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.3' stroke-linejoin='round'%3E%3Cdefs%3E%3Cmask id='m'%3E%3Crect width='24' height='24' fill='white' stroke='none'/%3E%3Cpath d='M12 4.3v15.4M5.33 8.15l13.34 7.7M5.33 15.85l13.34-7.7' stroke='black' stroke-width='3.4' stroke-linecap='round'/%3E%3C/mask%3E%3C/defs%3E%3Cpath d='M12 4.3v15.4M5.33 8.15l13.34 7.7M5.33 15.85l13.34-7.7' stroke-width='6' stroke-linecap='round' mask='url(%23m)'/%3E%3C/svg%3E");

		display: flex;
		flex-wrap: nowrap;
		margin: 0;
		padding: 0;
		list-style: none;

		& li {
			display: inline-flex;
			flex: none;
			align-items: center;
			margin: 0;
			color: var(--ebg-ow-ink);
			font-family: var(--font-display);
			font-size: var(--ebg-ow-fs);
			font-weight: 600;
			line-height: 1.2;
			letter-spacing: -0.03em;
			white-space: nowrap;
			-webkit-text-fill-color: var(--ebg-ow-fill);
			-webkit-text-stroke: var(--ebg-ow-stroke) color-mix(in oklab, var(--ebg-ow-ink) var(--ebg-ow-stroke-mix), transparent);
			transition: -webkit-text-stroke-color 0.3s ease-in-out;

			&:hover { -webkit-text-stroke-color: color-mix(in oklab, var(--ebg-ow-ink) 70%, transparent); }

			&::after {
				content: "" / "";
				flex: none;
				inline-size: var(--ebg-ow-shape, 0.42em);
				block-size: var(--ebg-ow-shape, 0.42em);
				margin-inline: calc(var(--ebg-ow-gap) / 2);
				background-color: var(--ebg-ow-sep-ink, var(--ebg-accent));
				opacity: var(--ebg-ow-sep-opacity, 0.5); /* separators stay quiet next to the words */
				mask: var(--ebg-ow-mask) center / contain no-repeat;
			}
		}

		&.ebg-outline-words--sep-asterisk { --ebg-ow-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.3' stroke-linejoin='round'%3E%3Cdefs%3E%3Cmask id='m'%3E%3Crect width='24' height='24' fill='white' stroke='none'/%3E%3Cpath d='M12 4.3v15.4M5.33 8.15l13.34 7.7M5.33 15.85l13.34-7.7' stroke='black' stroke-width='3.4' stroke-linecap='round'/%3E%3C/mask%3E%3C/defs%3E%3Cpath d='M12 4.3v15.4M5.33 8.15l13.34 7.7M5.33 15.85l13.34-7.7' stroke-width='6' stroke-linecap='round' mask='url(%23m)'/%3E%3C/svg%3E"); } /* 6-arm asterisk (ebg tji-star shape) */
		&.ebg-outline-words--sep-sparkle { --ebg-ow-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.3' stroke-linejoin='round'%3E%3Cpath d='M12 1.4C12.9 8 16 11.1 22.6 12 16 12.9 12.9 16 12 22.6 11.1 16 8 12.9 1.4 12 8 11.1 11.1 8 12 1.4z'/%3E%3C/svg%3E"); } /* 4-point star with curved sides */
		&.ebg-outline-words--sep-star { --ebg-ow-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.3' stroke-linejoin='round'%3E%3Cpath d='M12.00 2.00 L14.65 9.16 22.27 9.46 16.28 14.19 18.35 21.54 12.00 17.30 5.65 21.54 7.72 14.19 1.73 9.46 9.35 9.16z'/%3E%3C/svg%3E"); } /* 5-point star */
		&.ebg-outline-words--sep-ring { --ebg-ow-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.3' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10.3'/%3E%3C/svg%3E"); } /* circle */
		&.ebg-outline-words--sep-diamond { --ebg-ow-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.3' stroke-linejoin='round'%3E%3Cpath d='M12 1.5 22.5 12 12 22.5 1.5 12z'/%3E%3C/svg%3E"); } /* square on its point */
		&.ebg-outline-words--sep-star4 { --ebg-ow-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.3' stroke-linejoin='round'%3E%3Cpath d='M12.00 1.20 L14.55 9.45 22.80 12.00 14.55 14.55 12.00 22.80 9.45 14.55 1.20 12.00 9.45 9.45z'/%3E%3C/svg%3E"); } /* sharp 4-point star */
		&.ebg-outline-words--sep-star6 { --ebg-ow-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.3' stroke-linejoin='round'%3E%3Cpath d='M12.00 1.20 L14.70 7.32 21.35 6.60 17.40 12.00 21.35 17.40 14.70 16.68 12.00 22.80 9.30 16.68 2.65 17.40 6.60 12.00 2.65 6.60 9.30 7.32z'/%3E%3C/svg%3E"); } /* 6-point star */
		&.ebg-outline-words--sep-star8 { --ebg-ow-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.3' stroke-linejoin='round'%3E%3Cpath d='M12.00 1.20 L14.37 6.27 19.64 4.36 17.73 9.63 22.80 12.00 17.73 14.37 19.64 19.64 14.37 17.73 12.00 22.80 9.63 17.73 4.36 19.64 6.27 14.37 1.20 12.00 6.27 9.63 4.36 4.36 9.63 6.27z'/%3E%3C/svg%3E"); } /* 8-point star */
		&.ebg-outline-words--sep-burst { --ebg-ow-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.3' stroke-linejoin='round'%3E%3Cpath d='M12.00 1.20 L13.97 4.66 17.40 2.65 17.37 6.63 21.35 6.60 19.34 10.03 22.80 12.00 19.34 13.97 21.35 17.40 17.37 17.37 17.40 21.35 13.97 19.34 12.00 22.80 10.03 19.34 6.60 21.35 6.63 17.37 2.65 17.40 4.66 13.97 1.20 12.00 4.66 10.03 2.65 6.60 6.63 6.63 6.60 2.65 10.03 4.66z'/%3E%3C/svg%3E"); } /* 12-point burst */
		&.ebg-outline-words--sep-plus { --ebg-ow-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.3' stroke-linejoin='round'%3E%3Cpath d='M9.2 1.6h5.6v7.6h7.6v5.6h-7.6v7.6H9.2v-7.6H1.6V9.2h7.6z'/%3E%3C/svg%3E"); } /* cross */

		&.ebg-outline-words--sep-none li {
			padding-inline-end: var(--ebg-ow-gap); /* keeps the spacing the separator carried */

			&::after { content: none; }
		}

		@media (max-width: 1399px) { --ebg-ow-fs: 100px; }
		@media (max-width: 1024px) { --ebg-ow-fs: 80px; --ebg-ow-gap: 50px; }
		/* Phones: a 1px stroke at 20% vanishes, so a faint fill and a stronger
		   outline keep the words legible while they still read as outlines. */
		@media (max-width: 767px) {
			--ebg-ow-fs: 50px;
			--ebg-ow-stroke: 1px;
			--ebg-ow-gap: 40px;
			--ebg-ow-stroke-mix: 35%;
			--ebg-ow-fill: color-mix(in oklab, var(--ebg-ow-ink) 8%, transparent);
		}
		@media (prefers-reduced-motion: reduce) { & li { transition: none; } }
	}

	/* Scroll-stacked cards (ebg .service-stack, without GSAP). Each child of
	   .ebg-stack sticks at --ebg-stack-top; ebg-stack.js sets --ebg-stack-p (0..1)
	   while the next card slides over it, and the stuck card fades, shrinks to
	   90% and drops 50px. Only cards that fit on the screen stack: the script
	   gives them .is-stacking (no width breakpoint). Plain list under reduced
	   motion and without the script (editor). Tune with --ebg-stack-top,
	   --ebg-stack-gap. */
	.ebg-stack {
		--ebg-stack-top: 40px;
		--ebg-stack-gap: 30px;

		display: flex;
		flex-direction: column;
		gap: var(--ebg-stack-gap);
		margin: 0;

		& > * { margin: 0; }
	}

	@media (prefers-reduced-motion: no-preference) {
		.ebg-stack > .is-stacking {
			position: sticky;
			top: var(--ebg-stack-top);
			transform-origin: 50% 0;
			opacity: calc(1 - var(--ebg-stack-p, 0));
			scale: calc(1 - 0.08 * var(--ebg-stack-p, 0));
			translate: 0 calc(40px * var(--ebg-stack-p, 0));
			will-change: transform, opacity;
		}

		.ebg-stack > .is-stacking.is-covered {
			visibility: hidden;
			pointer-events: none;
			opacity: 0;
			will-change: auto;
		}

		.block-editor-block-list__layout .ebg-stack > * { position: static; opacity: 1; scale: none; translate: none; visibility: visible; will-change: auto; }
	}

	/* Editor: no loop script, so the words wrap and stay editable. */
	.block-editor-block-list__layout .ebg-outline-words { flex-wrap: wrap; }

	.ebg-marquee-vr {
		display: flex;
		align-items: center;
		overflow: hidden;
		writing-mode: sideways-lr;

		& .ebg-marquee-vr__item {
			white-space: nowrap;

			@media (prefers-reduced-motion: no-preference) {
				animation: ebg-marquee-vr 15s linear 2.5s infinite;
			}
		}


		& .ebg-marquee-vr__sep { margin-block: 40px; }

	}

	:where(.ebg-glow, .ebg-texture-lines, .ebg-blooms) {
		position: relative;
		isolation: isolate;
	}

	.ebg-glow::before {
		content: "";
		position: absolute;
		inset: var(--ebg-glow-top, auto) var(--ebg-glow-end, auto) var(--ebg-glow-bottom, auto) var(--ebg-glow-start, auto);
		z-index: -1;
		inline-size: var(--ebg-glow-size, 200px);
		block-size: var(--ebg-glow-size, 200px);
		border-radius: 50%;
		background: var(--ebg-glow-ink, var(--ebg-accent));
		filter: blur(var(--ebg-glow-blur, 50px));
		opacity: var(--ebg-glow-opacity, 0.26);
		pointer-events: none;
	}

	.ebg-texture-lines::before {
		content: "";
		position: absolute;
		inset: 0;
		z-index: -1;
		background: repeating-linear-gradient(115deg, transparent 0 13px, var(--ebg-line-texture-dark, oklch(100% 0 0 / 0.035)) 13px 14px);
		mask-image: linear-gradient(to right, black 0, transparent 28%, transparent 72%, black 100%);
		pointer-events: none;
	}

	.ebg-blooms::after {
		content: "";
		position: absolute;
		inset: 0;
		z-index: -1;
		background:
			radial-gradient(ellipse 40% 60% at 85% 20%, var(--ebg-footer-bloom-top, color-mix(in oklab, var(--ebg-accent) 18%, transparent)), transparent 100%),
			radial-gradient(ellipse 30% 50% at 15% 85%, var(--ebg-footer-bloom-bottom, color-mix(in oklab, var(--ebg-accent-bright, var(--ebg-accent)) 12%, transparent)), transparent 100%);
		pointer-events: none;
	}

	@keyframes ebg-marquee-vr {
		to { translate: 0 100%; }
	}
}
