/* Native Group style: decorative enhancement only; no editorial layout rules. */
.wp-block-group:is(.is-style-neural-network, .is-style-neural-accents, .is-style-particles) {
	position: relative;
	isolation: isolate;
}

.wp-block-group:is(.is-style-neural-network, .is-style-neural-accents, .is-style-particles)::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background-size: max(100%, 960px) auto;
	background-position: center top;
	background-repeat: repeat-y;
	pointer-events: none;
	opacity: .85;
}

.wp-block-group.is-style-neural-network::before {
	background-image: url("../images/neural-field.svg");
}

.wp-block-group.is-style-particles::before {
	background-image: url("../images/particles.svg");
}

.wp-block-group.is-style-particles > .wayscout-neural-canvas,
.wp-block-group.is-style-particles::before {
	filter: brightness(.5);
}

.wp-block-group:is(.is-style-neural-network, .is-style-neural-accents, .is-style-particles)[data-neural-active]::before {
	display: none;
}

.wayscout-neural-canvas {
	position: absolute;
	overflow-anchor: none;
	left: 0;
	right: 0;
	top: var(--wayscout-neural-top, 0px);
	z-index: -1;
	width: 100%;
	height: var(--wayscout-neural-height, 100%);
	pointer-events: none;
	opacity: calc(.85 * var(--wayscout-neural-entry, 1));
	transform: scale(calc(.035 + .965 * var(--wayscout-neural-entry, 1)));
	transform-origin: center;
}

/* Underpage preview: complete, small graphs from the same geometry as Canvas. */
.wp-block-group.is-style-neural-accents::before {
	background-image: var(--wayscout-neural-accent-preview, none);
	background-size: 100% auto;
	background-repeat: no-repeat;
}

.wayscout-neural-toggle {
	position: fixed;
	right: 1rem;
	bottom: max(1rem, var(--wayscout-neural-control-clearance, 0px));
	z-index: 80;
	padding: .25rem .65rem;
	border: 1px solid var(--wp--preset--color--accent-5);
	border-radius: 2rem;
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--accent-1);
	font: inherit;
	font-size: .75rem;
	line-height: 1.2;
	min-height: 32px;
	cursor: pointer;
}

.wayscout-neural-toggle:hover {
	border-color: var(--wp--preset--color--accent-1);
}

.wayscout-neural-toggle:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent-1);
	outline-offset: 3px;
}

.wayscout-neural-canvas[hidden],
.wayscout-neural-toggle[hidden] {
	display: none;
}

/* Core's unselected resize helper retains its desktop inline width in narrow
   columns. Let the native logo image fit that column; keep selected controls
   and logos in rows (including the footer) untouched. */
.editor-styles-wrapper .wp-block-column .wp-block-site-logo:not(.is-selected) .components-resizable-box__container {
	display: contents;
}

/* Native block styles remain readable without script and in the editor. */
.wayscout-reveal-defs { position: absolute; pointer-events: none; overflow-anchor: none; }
.is-style-arrival-left[data-text-arriving] {
	translate: calc(-1 * min(160px, 35vw) * (1 - var(--wayscout-text-entry, 0))) 0;
	opacity: var(--wayscout-text-entry, 0);
}

.wp-block-image.is-style-scroll-object { position: relative; }
.wp-block-image.is-style-scroll-object[data-scroll-active] img,
.wp-block-image.is-style-scroll-object[data-scroll-active] .wayscout-arrival-canvas {
	translate: 0 calc(110px * var(--wayscout-scroll, 0));
	scale: calc(1 - .055 * var(--wayscout-scroll, 0));
}

:is(.wp-block-image, .wp-block-cover).is-style-scene-depth[data-scroll-active] { overflow: clip; }
:is(.wp-block-image, .wp-block-cover).is-style-scene-depth[data-scroll-active] img {
	transform: scale(calc(1.065 - .065 * var(--wayscout-scroll, 1)));
}

.is-style-scroll-heading[data-scroll-active] {
	translate: 0 calc(14px * (1 - var(--wayscout-scroll, 1)));
	opacity: calc(.72 + .28 * var(--wayscout-scroll, 1));
}

@keyframes wayscout-product-arrival {
	from { transform: perspective(900px) translateZ(-1800px); opacity: .12; }
	to { transform: none; opacity: 1; }
}

.wp-block-image.is-style-scroll-object[data-entry-active] img {
	animation: wayscout-product-arrival 1700ms cubic-bezier(.16, 1, .3, 1) both;
}

.wp-block-image.is-style-scroll-object[data-arrival-rendering] img { opacity: 0; animation: none; }
.wayscout-arrival-canvas { position: absolute; pointer-events: none; overflow-anchor: none; }

body[data-wayscout-motion-paused] .wp-block-image.is-style-scroll-object[data-entry-active] img,
.wp-block-image.is-style-scroll-object[data-entry-offscreen] img {
	animation-play-state: paused;
}

.wp-block-group.is-style-route-stop { position: relative; }
.wp-block-group.is-style-route-stop::before {
	content: "";
	position: absolute;
	left: -1rem;
	top: var(--wayscout-route-start, 0px);
	bottom: var(--wayscout-route-end, 0px);
	width: 2px;
	background: var(--wp--preset--color--accent-1);
	pointer-events: none;
	transform-origin: top;
}
.wp-block-group.is-style-route-stop::after {
	content: "";
	position: absolute;
	left: calc(-1rem - 3px);
	bottom: var(--wayscout-route-end, 0px);
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--wp--preset--color--accent-1);
	pointer-events: none;
	transform: translateY(50%);
}

@media (prefers-reduced-motion: no-preference) {
	body:not([data-wayscout-motion-static]) .wp-block-group.is-style-route-stop[data-route-ready]::before {
		transform: scaleY(0);
	}
	body:not([data-wayscout-motion-static]) .wp-block-group.is-style-route-stop[data-route-ready]::after {
		opacity: 0;
	}
	body:not([data-wayscout-motion-static]) .wp-block-group.is-style-route-stop[data-route-drawn]::before {
		animation: wayscout-route-draw 650ms ease-out both;
	}
	body:not([data-wayscout-motion-static]) .wp-block-group.is-style-route-stop[data-route-drawn]::after {
		animation: wayscout-route-end 650ms step-end both;
	}
	body[data-wayscout-motion-paused] .wp-block-group.is-style-route-stop[data-route-drawn]::before,
	body[data-wayscout-motion-paused] .wp-block-group.is-style-route-stop[data-route-drawn]::after {
		animation-play-state: paused;
	}
}

@keyframes wayscout-route-draw {
	from { transform: scaleY(0); }
	to { transform: scaleY(1); }
}

@keyframes wayscout-route-end {
	from { opacity: 0; }
	to { opacity: 1; }
}

@media (max-width: 767px) {
	.wayscout-neural-toggle { min-height: 44px; }
}

@media (max-width: 781px) {
	.wp-block-image.is-style-scroll-object[data-scroll-active] img,
	.wp-block-image.is-style-scroll-object[data-scroll-active] .wayscout-arrival-canvas {
		translate: 0 calc(36px * var(--wayscout-scroll, 0));
		scale: calc(1 - .025 * var(--wayscout-scroll, 0));
	}
	:is(.wp-block-image, .wp-block-cover).is-style-scene-depth[data-scroll-active] img {
		transform: scale(calc(1.025 - .025 * var(--wayscout-scroll, 1)));
	}
	.is-style-scroll-heading[data-scroll-active] {
		translate: 0 calc(8px * (1 - var(--wayscout-scroll, 1)));
	}
}

@media (prefers-reduced-motion: no-preference) {
	.wp-block-button__link,
	.wp-block-navigation-item__content {
		transition: transform 160ms ease;
	}
	.wp-block-button__link:active,
	.wp-block-navigation-item__content:active {
		transform: scale(.98);
	}
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
	.wp-block-button__link:hover,
	.wp-block-navigation-item__content:hover {
		transform: translateY(-2px);
	}
}
