/* My Sanitär – effects layer "Durchfluss" (after style.css): things flow, fill and settle like water in a pipe.
   Only under html.ms-fx (never in the Elementor editor or with reduced motion), on screen, no layout properties. */
@media screen and (prefers-reduced-motion: no-preference) {
:root { --msfx-ease: cubic-bezier(.2, .7, .2, 1); --msfx-rise: 16px; }
@media (max-width: 767px) { :root { --msfx-rise: 10px; } }

/* 1. Settle-in below the first view (effects.js: .msfx-b block, .msfx-p photo box): once (.msfx-in), at once on
   focus (.msfx-now). Photos: "Rollladen". */
.msfx-b:not(.msfx-in) { opacity: 0; }
.msfx-p:not(.msfx-in) > img { opacity: 0; } /* not a clip: Chromium's lazy loader skips clipped images; the roll starts clipped */
.msfx-b.msfx-in { animation: msfx-rise .65s var(--msfx-ease) var(--msfx-d, 0s) backwards; }
.msfx-in img { animation: msfx-roll .8s var(--msfx-ease) var(--msfx-d, 0s) backwards; }
.msfx-in.msfx-now, .msfx-now img { animation: none; }
@keyframes msfx-rise { from { opacity: 0; transform: translateY(var(--msfx-rise)); } }
@keyframes msfx-roll { from { clip-path: inset(2.83% 2.83% 100%); transform: scale(1.06); } to { clip-path: inset(0); transform: none; } }

/* 2. Load moment: copy settles 70 ms apart, then the Typenschild; page heroes: the copper bend draws */
.ms-fx :is(.ms-hero-copy, .ms-page-hero .e-con-inner) > * { animation: msfx-rise .55s var(--msfx-ease) backwards; }
.ms-fx :is(.ms-hero-copy, .ms-page-hero .e-con-inner) > :nth-child(2) { animation-delay: .07s; }
.ms-fx :is(.ms-hero-copy, .ms-page-hero .e-con-inner) > :nth-child(3) { animation-delay: .14s; }
.ms-fx .ms-hero-copy > :nth-child(4) { animation-delay: .21s; }
.ms-fx .ms-hero-copy > :nth-child(5) { animation-delay: .28s; }
.ms-fx .e-con.ms-hero-badge { animation: msfx-rise .55s var(--msfx-ease) .45s backwards; }
.ms-fx .ms-page-hero > .e-con::before { animation: msfx-bend .7s cubic-bezier(.45, .05, .7, .95) .2s backwards; }
.ms-fx .ms-page-hero > .e-con > .e-con-inner::before { animation: msfx-up .45s cubic-bezier(.3, .2, .25, 1) .9s backwards; }
@media (max-width: 767px) { /* kept: re-created, they would redraw */
	.ms-fx .ms-page-hero > .e-con::before, .ms-fx .ms-page-hero > .e-con > .e-con-inner::before { display: block; visibility: hidden; }
}
@keyframes msfx-bend { 0% { clip-path: inset(100% calc(100% - 20px) 0 0); } 62% { clip-path: inset(0 calc(100% - 20px) 0 0); } to { clip-path: inset(0); } }
@keyframes msfx-up { from { clip-path: inset(100% 0 0); } to { clip-path: inset(0); } }

/* 3. Riser: steel when empty, --ms-flow (0–1) fills it with copper and lights the fittings; no .msfx-flow = static
   design. The segments skip Elementor's fade. */
.ms-fx .e-con.ms-step-card::before { transition: none; }
.msfx-flow .e-con.ms-step-card::before { background: var(--ms-pipe-steel); }
.msfx-flow::after, .ms-fx .ms-service-card::after, .ms-fx .ms-text-link .elementor-button-text::after { position: absolute; content: ""; background: var(--ms-kupfer); transform-origin: 0 0; }
.msfx-flow::after { z-index: 1; top: var(--msfx-ry); left: var(--msfx-rx); width: 3px; height: var(--msfx-rh); transform: scaleY(var(--ms-flow, 0)); }
.msfx-flow .e-con.ms-step-card > .ms-step-number { z-index: 2; }
.ms-fx .ms-step-number .elementor-heading-title { transition: border-color .3s; }
.msfx-flow .ms-step-number .elementor-heading-title:not(.msfx-on) { border-color: var(--ms-pipe-steel); }

/* 4. Zählwerk: the text turns transparent (same width, name, innerText); the count runs on top */
html .elementor-heading-title.msfx-n { position: relative; color: transparent; }
.msfx-n::after { position: absolute; top: 0; left: var(--msfx-x); width: var(--msfx-w); color: var(--ms-tiefblau); text-align: right; white-space: nowrap; content: attr(data-msfx-n); content: attr(data-msfx-n) / ""; }

/* 5. Glint: one run per hero view (.msfx-vis, after 2.6 s) on copies of copper A/B; ≤ 1024: the run over the photo.
   Band: centre of a 2000 px mask tile. */
@supports (mask-image: none) {
	.msfx-pulse { --g: #0000 calc(50% - 44px), #000 50%, #0000 calc(50% + 44px); position: absolute; z-index: 0; inset: 0; pointer-events: none; }
	.msfx-pulse::before, .msfx-pulse::after { position: absolute; border: 0 solid #f5c8a2; mask: linear-gradient(45deg, var(--g)) -3000px 0 / 2000px 2000px no-repeat; animation: 1.4s linear 2.6s; }
	.msfx-pulse-m::before { mask-image: linear-gradient(135deg, var(--g)); }
	@media (min-width: 1025px) {
		.msfx-pulse-i::before { bottom: 54.5px; left: -2px; width: calc(var(--ms-riser) - 2.5px); height: 25.5px; content: ""; border-width: 0 3px 3px 0; border-bottom-right-radius: 25.5px; }
		.msfx-pulse-i::after { top: 46.5px; right: -2px; bottom: 80px; left: calc(var(--ms-riser) - 7.5px); content: ""; border-width: 3px 0 0 3px; border-top-left-radius: 37.5px; }
		.msfx-vis .msfx-pulse-i::before { animation-name: msfx-pa; }
		.msfx-vis .msfx-pulse-i::after { animation-name: msfx-pb; }
	}
	@media (max-width: 1024px) {
		.msfx-pulse-m::before { top: -33.5px; left: -40px; width: calc(100% - 12px); height: 60px; content: ""; border-width: 3px 3px 0 0; border-top-right-radius: 31.5px; }
		.msfx-vis .msfx-pulse-m::before { animation-name: msfx-pc; }
	}
	@media (max-width: 767px) { .msfx-pulse-m::before { left: -24px; width: calc(100% - 16px); } }
}
@keyframes msfx-pa { 0% { mask-position: -1080px -973px; } 45%, to { mask-position: calc(100% + 1104px) -973px; } }
@keyframes msfx-pb { 0%, 37.5% { mask-position: -998.5px calc(100% + 1080px); } 66% { mask-position: -998.5px -998.5px; } to { mask-position: calc(100% + 1080px) -998.5px; } }
@keyframes msfx-pc { 0% { mask-position: -1080px -998.5px; } 70%, to { mask-position: calc(100% + 1130px) -998.5px; } }

/* 6. Hover = keyboard focus (tile zoom: hover only, it would cover the inset focus ring) */
.ms-fx .e-con.ms-service-card { transition: transform .45s var(--ms-ease), box-shadow .45s var(--ms-ease), border-color .16s; }
.ms-fx .e-con.ms-service-card:is(:hover, :has(:focus-visible)) { --msfx-h: 1; box-shadow: 0 22px 34px -24px rgba(5, 45, 72, .45); transform: translateY(-4px); }
.ms-fx .ms-service-card::after { inset: auto 0 0; height: 3px; transform: scaleX(var(--msfx-h, 0)); transition: transform .5s var(--ms-ease); }
.ms-fx .ms-card-image { overflow: hidden; }
.ms-fx .ms-card-image img { transform: scale(calc(1 + var(--msfx-h, 0) * .05)); transition: transform .6s var(--ms-ease); }
.ms-fx .ms-card-body::before { transition: background-color .3s; }
.ms-fx .ms-service-card:is(:hover, :has(:focus-visible)) .ms-card-body::before { background-color: var(--ms-wasser); }
/* cards: "Mehr erfahren" covers the card it lifts */
.ms-fx .ms-service-card .ms-text-link { position: static; }
.ms-fx .ms-service-card .ms-text-link .elementor-button::before { position: absolute; inset: -999px 0 0; content: ""; }
/* tiles: two copper clamps close in */
.ms-fx .ms-gallery .gallery-item { position: relative; }
.ms-fx .ms-gallery .gallery-item::after { --c: linear-gradient(var(--ms-pipe-copper) 0 0); position: absolute; z-index: 1; inset: 10px; content: ""; background: var(--c) 0 0 / 18px 2px, var(--c) 0 0 / 2px 18px, var(--c) 100% 100% / 18px 2px, var(--c) 100% 100% / 2px 18px; background-repeat: no-repeat; opacity: 0; filter: drop-shadow(0 0 1px rgba(3, 30, 48, .6)); pointer-events: none; transform: scale(1.05); transition: opacity .3s, transform .45s var(--ms-ease); }
.ms-fx .ms-gallery .gallery-item:is(:hover, :has(:focus-visible))::after { opacity: 1; transform: none; }
.ms-fx .ms-gallery .gallery-item:hover img { transform: scale(1.04); }
/* buttons fill from the left; the flat hover colour lands under the full fill */
.ms-fx :is(.ms-button, .ms-form) .elementor-button { position: relative; isolation: isolate; }
.ms-fx :is(.ms-button, .ms-form) .elementor-button::before, .ms-fx [data-msfx-t]::after { position: absolute; z-index: -1; inset: 0; content: ""; background: var(--msfx-fill, var(--ms-tiefblau)); border-radius: 3px; clip-path: inset(0 100% 0 0); transition: clip-path .35s var(--msfx-ease); }
.ms-fx .ms-button-light { --msfx-fill: #dfeaf2; }
.ms-fx .ms-button-ghost { --msfx-fill: rgba(255, 255, 255, .1); }
.ms-fx .ms2-cta-light .ms-button-light { --msfx-fill: var(--ms-tiefblau); }
.ms-fx :is(.ms-button, .ms-form) .elementor-button:is(:hover, :focus-visible)::before, .ms-fx [data-msfx-t]:is(:hover, :focus-visible)::after { clip-path: inset(0); }
.ms-fx :is(.ms-button, .ms-form) .elementor-button:hover { transition: background-color 0s .35s, border-color .35s, color .1s .05s; }
.ms-fx .ms-button-ghost .elementor-button:hover { background: transparent; }
.ms-fx .ms-button-outline .elementor-button:focus-visible { color: #fff; }
/* outline without the label copy (effects.js not run): the flat swap of style.css, no half-white label */
.ms-fx .ms-button-outline .elementor-button:not([data-msfx-t])::before { content: none; }
.ms-fx .ms-button-outline .elementor-button:not([data-msfx-t]):is(:hover, :focus-visible) { color: #fff; background: var(--ms-tiefblau); transition: background-color var(--ms-ui-dur) ease, border-color var(--ms-ui-dur) ease, color var(--ms-ui-dur) ease; }
/* outline: a white label copy (effects.js) opens with the fill */
@supports (content: "" / "") {
	.ms-fx .ms-button-outline [data-msfx-t] { transition: none; }
	.ms-fx .ms-button-outline [data-msfx-t]:is(:hover, :focus-visible) { transition: color 0s .35s, background-color 0s .35s; }
	.ms-fx [data-msfx-t]::after { z-index: 0; display: grid; place-items: center; color: #fff; background: none; content: attr(data-msfx-t) / ""; }
	.ms-fx [data-msfx-t]:is(:hover, :focus-visible)::after { color: #0000; transition: clip-path .35s var(--msfx-ease), color 0s .35s; }
}
/* text links: a 3 px line slides in at baseline + 6 px */
.ms-fx .ms-text-link .elementor-button-text { position: relative; }
.ms-fx .ms-text-link .elementor-button-text::after { inset: calc(50% + .32em + 6px) 0 auto; height: 3px; transform: scaleX(0); transition: transform .35s var(--ms-ease); }
.ms-fx .ms-text-link .elementor-button:is(:hover, :focus-visible) { text-decoration-thickness: 1.5px; }
.ms-fx .ms-text-link .elementor-button:is(:hover, :focus-visible) .elementor-button-text::after { transform: none; }
.ms-fx .ms-feature-card:is(:hover, :has(:focus-visible)) .elementor-icon { transform: translateY(-2px); }

/* 7. Header: soft shadow once scrolled */
.ms-fx.ms-scrolled .e-con.ms-mainbar { box-shadow: 0 10px 24px -18px rgba(5, 45, 72, .45); }

/* 8. Never Chromium's scroll anchor: a pseudo box cannot be restored, so a reload would replay as a smooth scroll */
.ms-fx .elementor-button::before, .ms-fx .elementor-button::after, .ms-fx .ms-text-link .elementor-button-text::after,
.ms-fx .ms-page-hero > .e-con::before, .ms-fx .ms-page-hero > .e-con > .e-con-inner::before,
.msfx-pulse, .msfx-pulse::before, .msfx-pulse::after { overflow-anchor: none; }
}
