/* Decorative motion occupies the side gutters only; no moving ink behind copy. */
body[data-site-design="modules"] { isolation: isolate; }
.modules-ambient {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    contain: strict;
    --ambient-gutter: clamp(40px, calc((100vw - 1280px) / 2), 260px);
}
.ambient-rail {
    position: absolute;
    top: 112px;
    bottom: 0;
    width: var(--ambient-gutter);
    overflow: hidden;
    mask-image: linear-gradient(90deg, #000 40%, transparent);
}
.ambient-rail--left { left: 0; }
.ambient-rail--right { right: 0; transform: scaleX(-1); }
.ambient-contour {
    position: absolute;
    left: -68px;
    width: 220px;
    height: 240px;
    fill: none;
    stroke: #b6a0b0;
    stroke-width: 1.5;
    opacity: .65;
    animation: ambient-drift 22s ease-in-out infinite alternate;
    animation-delay: -14s;
}
.ambient-accent { stroke: #ce398f; }
.ambient-point { fill: #ce398f; stroke: none; }
.ambient-contour--ring { top: 1%; }
.ambient-contour--modules { top: 44%; animation-duration: 28s; animation-delay: -28s; }
.ambient-contour--path { top: 80%; animation-duration: 26s; animation-delay: -9s; }
.ambient-rail--right .ambient-contour { animation-direction: alternate-reverse; animation-delay: -24s; }
.ambient-rail--right .ambient-contour--ring { top: 28%; }
.ambient-rail--right .ambient-contour--modules { top: 73%; }
.ambient-rail--right .ambient-contour--path { top: -10%; }
.modules-ambient[data-state="paused"] .ambient-contour { animation-play-state: paused; }
.modules-ambient[data-motion="reduced"] .ambient-contour { animation: none; transform: rotate(-8deg); }
.modules-ambient[data-motion="slow"] .ambient-contour { animation-duration: 220s; }
.modules-ambient[data-motion="slow"] .ambient-contour--modules { animation-duration: 280s; }
.modules-ambient[data-motion="slow"] .ambient-contour--path { animation-duration: 260s; }
@keyframes ambient-drift {
    from { transform: translate3d(-14px, -26px, 0) rotate(-12deg); }
    to { transform: translate3d(32px, 32px, 0) rotate(14deg); }
}
@media (max-width: 760px) {
    .modules-ambient { --ambient-gutter: 24px; }
    .ambient-contour { opacity: .3; width: 150px; }
    .ambient-contour--path { display: none; }
}
@media print { .modules-ambient { display: none; } }

/* A short travelling accent makes motion legible without adding content. */
.ambient-trace { stroke-dasharray: 6 94; stroke-linecap: round; animation: ambient-trace 14s linear infinite; }
.modules-ambient[data-state="paused"] .ambient-trace { animation-play-state: paused; }
.modules-ambient[data-motion="reduced"] .ambient-trace { animation: none; }
.modules-ambient[data-motion="slow"] .ambient-trace { animation-duration: 140s; }
@keyframes ambient-trace { to { stroke-dashoffset: -100; } }
