/* Atomic Decoration System V1
 * Shared base layer for section separators and anchored decorations.
 * Layer order follows the CANONICAL z-ladder defined in blocks.css (single source):
 *   z0 Surface::before + Background Media
 *   z1 Surface::after
 *   z2 Decoration explicit children (this module)  <-- HERE
 *   z3 Real content
 *   z4 Shapes / edge overlays
 * Decorations NEVER use ::before/::after on the host wrapper (those are reserved
 * by Surface substrate/texture and shape flow reservations). Decorations always
 * render through explicit <div class="awp-dec-layer"> real children with
 * pointer-events:none and aria-hidden=true.
 *
 * V1 renders STATIC SVG ONLY. No motion runtime, no pointer listeners, no RAF.
 * Interactive/animated decorations belong to Interaction Effects recipes (Phase 1C+)
 * which consume canonical Motion lifecycle separately.
 */

.awp-has-decoration {
	position: relative;
	isolation: isolate;
}

.awp-dec-layer {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	overflow: visible;
	pointer-events: none;
	z-index: 2;
	--awp-dec-color-primary: var(--wp--preset--color--primary, #087FF5);
	--awp-dec-color-primary-light: var(--wp--preset--color--primary-light, #52A7FF);
	--awp-dec-color-secondary: var(--wp--preset--color--secondary, #374657);
	--awp-dec-color-background: var(--wp--preset--color--background, #FFFFFF);
	--awp-dec-color-surface: var(--wp--preset--color--surface, #EAF3FA);
	--awp-dec-accent-line: var(--awp-decoration-accent-line, rgba(8, 127, 245, 0.22));
}

.awp-dec-layer--material { overflow: hidden; border-radius: inherit; }
.awp-dec-material-svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; pointer-events: none; }
.awp-dec-material-svg .awp-dec-spline { vector-effect: non-scaling-stroke; will-change: auto; opacity: 1; display: block; }
/* Surface-only clipping paints content at z1; materials join the clipped z0
   substrate there, not the z2 boundary decoration. Geometry and the fixed-depth
   band mask stay Blocks-owned (see blocks.css); this rule only re-layers the
   material so it follows that shared mask. */
/* Include the decoration host marker so this exception outranks Blocks' general
   Group decoration ladder regardless of stylesheet enqueue order. */
.awp-has-decoration.awp-has-edge-clip.awp-edge-clip--scope-surface-only > .awp-dec-layer--material { z-index: 0; }

.awp-dec-layer--boundary-bottom {
	pointer-events: none;
}

.awp-dec-svg {
	position: absolute;
	left: 0;
	right: 0;
	width: 100%;
	height: 100%;
	display: block;
	pointer-events: none;
}

.awp-dec-layer--boundary-bottom .awp-dec-svg {
	top: auto;
	bottom: 0;
	height: clamp(54px, 7vw, 100px);
	transform: translateY(38%);
	will-change: transform;
	opacity: 0.9;
}

.awp-dec-layer--boundary-top .awp-dec-svg {
	bottom: auto;
	top: 0;
	height: clamp(54px, 7vw, 100px);
	transform: translateY(-38%);
	will-change: transform;
	opacity: 0.9;
}

.awp-dec-layer--boundary-bottom.awp-dec-layer--ribbon .awp-dec-svg {
	opacity: 0.96;
	height: clamp(84px, 10.5vw, 168px);
	transform: translateY(56%);
}

.awp-dec-layer--ribbon .awp-dec-spline {
	mix-blend-mode: normal;
}

.awp-dec-layer--ribbon .awp-dec-spline--ribbon-1 {
	opacity: 1;
}

@supports not (mix-blend-mode: multiply) {
	.awp-dec-layer--ribbon .awp-dec-spline {
		opacity: 1;
	}
}

.awp-dec-layer--content-layer .awp-dec-svg {
	top: 0;
	bottom: 0;
	height: 100%;
}

.awp-dec-spline {
	will-change: transform, opacity;
	transform-origin: center;
}

.awp-dec-particle {
	will-change: transform, opacity;
	transform-origin: center;
}

.awp-dec-scatter-dot {
	will-change: opacity;
}

.awp-dec-layer--pointer,
.awp-dec-layer--parallax {
	--awp-dec-px: 0px;
	--awp-dec-py: 0px;
	--awp-dec-sy: 0px;
}

.awp-dec-layer--pointer .awp-dec-particle--pointer,
.awp-dec-layer--parallax .awp-dec-particle {
	transform: translate3d(calc(var(--awp-dec-px) * var(--awp-dec-k, 1)), calc(var(--awp-dec-py) * var(--awp-dec-k, 1) + var(--awp-dec-sy, 0px)), 0);
}

.awp-dec-path--draw {
	will-change: stroke-dashoffset, opacity;
}

.awp-dec-anchor-svg {
	position: absolute;
	width: clamp(140px, 22vw, 240px);
	height: clamp(140px, 22vw, 240px);
	pointer-events: none;
	will-change: opacity, transform;
}

.awp-dec-layer [data-awp-dec-corner="top-right"] {
	top: -6%;
	right: -4%;
}

.awp-dec-layer [data-awp-dec-corner="top-left"] {
	top: -6%;
	left: -4%;
}

.awp-dec-layer [data-awp-dec-corner="bottom-right"] {
	bottom: -6%;
	right: -4%;
}

.awp-dec-layer [data-awp-dec-corner="bottom-left"] {
	bottom: -6%;
	left: -4%;
}

@media (max-width: 1024px) {
	.awp-dec-layer--boundary-bottom .awp-dec-svg,
	.awp-dec-layer--boundary-top .awp-dec-svg {
		height: clamp(48px, 8vw, 80px);
	}
	.awp-dec-layer--boundary-bottom.awp-dec-layer--ribbon .awp-dec-svg {
		opacity: 0.94;
		height: clamp(78px, 11vw, 150px);
		transform: translateY(54%);
	}
}

@media (max-width: 781px) {
	.awp-dec-layer--ribbon .awp-dec-spline--i2 {
		display: none;
	}
	.awp-dec-spline--i2 {
		opacity: 0.72;
	}
	.awp-dec-layer--boundary-bottom .awp-dec-svg,
	.awp-dec-layer--boundary-top .awp-dec-svg {
		height: clamp(38px, 10vw, 68px);
		transform: translateY(30%);
	}
	.awp-dec-layer--boundary-top .awp-dec-svg {
		transform: translateY(-30%);
	}
	.awp-dec-anchor-svg {
		width: clamp(110px, 30vw, 180px);
		height: clamp(110px, 30vw, 180px);
	}
	.awp-dec-layer--boundary-bottom.awp-dec-layer--ribbon .awp-dec-svg {
		opacity: 0.92;
		height: clamp(72px, 13vw, 120px);
		transform: translateY(50%);
	}
}

@media (max-width: 500px) {
	.awp-dec-layer--ribbon .awp-dec-spline--i1,
	.awp-dec-layer--ribbon .awp-dec-spline--i2 {
		display: none;
	}
	.awp-dec-spline--i1,
	.awp-dec-spline--i2,
	.awp-dec-spline--i3 {
		opacity: 0.55;
	}
	.awp-dec-spline--i4,
	.awp-dec-spline--i5 {
		display: none;
	}
	.awp-dec-layer--boundary-bottom .awp-dec-svg,
	.awp-dec-layer--boundary-top .awp-dec-svg {
		height: clamp(32px, 12vw, 58px);
		transform: translateY(22%);
	}
	.awp-dec-layer--boundary-top .awp-dec-svg {
		transform: translateY(-22%);
	}
	.awp-dec-layer--ribbon .awp-dec-spline.awp-dec-spline--drift {
		animation: none !important;
		transform: none !important;
		transition: none !important;
	}
	.awp-dec-layer--boundary-bottom.awp-dec-layer--ribbon .awp-dec-svg {
		opacity: 0.90;
		height: clamp(64px, 16vw, 96px);
		transform: translateY(44%);
	}
}

@media (prefers-reduced-motion: reduce) {
	.awp-dec-spline,
	.awp-dec-particle,
	.awp-dec-path--draw {
		animation: none !important;
		transition: none !important;
	}
}
