/* jermaik: Bewegung und Ebenen (Nov 2026). Wird nur aktiv, wenn motion.js die Klasse m-on setzt. */
html.m-on [data-m-y], html.m-on [data-m-x], html.m-on [data-m-rot], html.m-on [data-m-scale], html.m-on [data-m-hero], html.m-on [data-m-img], html.m-on [data-m-skew] { transition-property: opacity !important; will-change: transform; }
html.m-on .m-w { display: inline-block; overflow: hidden; vertical-align: top; padding: .1em .07em .22em 0; margin: -.1em -.07em -.22em 0; }
html.m-on .m-wi { display: inline-block; transform: translateY(125%) rotate(4deg); transform-origin: 0 100%; transition: transform 1.05s cubic-bezier(.16,1,.3,1); transition-delay: calc(var(--i, 0) * 55ms); }
html.m-on .m-in .m-wi, html.m-on .m-wi.m-in { transform: none; }
html.m-on [data-m-clip] { clip-path: inset(100% 0 0 0); transition: clip-path 1.3s cubic-bezier(.16,1,.3,1), opacity .8s; }
html.m-on [data-m-clip].m-in { clip-path: inset(0 0 0 0); }

/* Filmrauschen auf hellen Flächen */
.grain-light { position: relative; overflow: clip; }
.grain-light > * { position: relative; z-index: 2; }
.grain-light::before { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); background-repeat: repeat; background-size: 300px 300px; opacity: 1; mix-blend-mode: multiply; filter: grayscale(1) contrast(1.9) brightness(1.1); animation: grainMove 1s steps(10, end) infinite; }
/* Text bleibt auf Korn und Karos gut lesbar */
.grain-light p { color: rgba(11,10,8,.92) !important; font-weight: 400; }
/* Karopapier wie im Matheheft */
.grain-light::after { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none; background-image: linear-gradient(rgba(11,10,8,.055) 1px, transparent 1px), linear-gradient(90deg, rgba(11,10,8,.055) 1px, transparent 1px); background-size: 34px 34px; background-position: -1px -1px; }
@media (max-width: 700px) { .grain-light::after { background-size: 26px 26px; } }
@keyframes grainMove { 0%, 100% { background-position: 0 0; } 10% { background-position: -38px -61px; } 20% { background-position: -97px 27px; } 30% { background-position: 44px -112px; } 40% { background-position: 113px 86px; } 50% { background-position: -126px 52px; } 60% { background-position: 71px 19px; } 70% { background-position: 8px 93px; } 80% { background-position: 131px 147px; } 90% { background-position: -59px 66px; } }
@media (max-width: 700px), (prefers-reduced-motion: reduce) { .grain-light::before { animation: none; } }
