/* The first entry pauses once; subsequent scrolling stays native. */
@property --ms-gap {
  syntax: "<length>";
  inherits: true;
  initial-value: 0.5cm;
}
@property --ms-frame-radius {
  syntax: "<length>";
  inherits: true;
  initial-value: 36px;
}
.mobile-story { display:none; }

@media (max-width:640px) and (prefers-reduced-motion:no-preference) {
  .has-mobile-story #funktionen { padding-left:0; padding-right:0; padding-bottom:0; }
  .has-mobile-story #funktionen > .explorer-wrap { display:none; }
  .has-mobile-story .mobile-story {
    display:block;
    position:relative;
    height:460svh;
    /* Both use the same visible height, including while browser chrome moves.
       Their difference stays 360svh, so scroll progress never changes with it. */
    height:calc(300svh + var(--ms-viewport-height, 100dvh));
    margin-top:16px;
    text-align:center;
  }
  .ms-sticky {
    /* Same margin on every phone: half a centimetre in from this screen's edge. */
    --ms-gap:0.5cm;
    --ms-frame-radius:36px;
    position:sticky;
    top:0;
    width:100%;
    /* Keep the frame half a centimetre from the currently visible screen edge. */
    height:100svh;
    height:var(--ms-viewport-height, 100dvh);
    isolation:isolate;
    background:#fff;
    contain:layout style paint;
  }
  .ms-window {
    position:absolute;
    top:var(--ms-gap);
    right:var(--ms-gap);
    bottom:var(--ms-gap);
    left:var(--ms-gap);
    overflow:hidden;
    /* Horizontal gestures change the phone; vertical scroll and zoom stay native. */
    touch-action:pan-y pinch-zoom;
    border-radius:var(--ms-frame-radius);
    /* Keeps the sliding renders inside the stroke, including their shadow. */
    clip-path:inset(0 round var(--ms-frame-radius));
  }
  .ms-phone {
    position:absolute;
    left:50%; top:50%;
    /* Device art keeps its size while only the surrounding viewport expands. */
    height:min(calc(100svh - (2 * var(--ms-gap)) - 108px), calc((100vw - (2 * var(--ms-gap)) - 40px) * 1.92));
    aspect-ratio:540 / 1114;
    margin:0;
    transform:translate3d(-50%, -50%, 0) scale(.68);
  }
  .ms-phone img {
    display:block;
    width:100%; height:100%;
    object-fit:contain;
    filter:drop-shadow(0 10px 18px rgba(60,74,61,.14));
    -webkit-user-drag:none;
    user-select:none;
  }
  .ms-phone:not(:first-child) { visibility:hidden; }
  .ms-heading {
    position:absolute;
    top:calc(var(--ms-gap) + 16px);
    left:calc(var(--ms-gap) + 20px);
    right:calc(var(--ms-gap) + 20px);
    display:flex; align-items:center; justify-content:flex-end;
    color:#737873;
    pointer-events:none;
  }
  .ms-count { font-size:11px; font-variant-numeric:tabular-nums; letter-spacing:.04em; }
  .ms-count b { font-weight:500; }
  .ms-count span { opacity:.45; }
  .ms-footer {
    position:absolute;
    bottom:calc(var(--ms-gap) + 6px);
    left:calc(var(--ms-gap) + 20px);
    right:calc(var(--ms-gap) + 20px);
    color:#737873;
    display:flex; align-items:center; justify-content:space-between;
    min-height:44px;
  }
  .ms-label { font-size:12px; font-weight:400; margin:0; }
  .ms-steps { display:flex; gap:2px; }
  .ms-step {
    display:grid; place-items:center;
    width:44px; height:44px; padding:0;
    border:0; border-radius:22px;
    background:transparent; color:inherit; cursor:pointer;
  }
  .ms-step::after {
    content:""; width:6px; height:6px; border-radius:3px;
    background:currentColor; opacity:.3;
    transition:opacity 180ms var(--ease-out);
  }
  .ms-step[aria-current="step"]::after { width:18px; opacity:1; }
  .ms-step:focus-visible { outline:2px solid #6f8c74; outline-offset:-4px; }
  .ms-border {
    position:absolute; inset:0;
    width:100%; height:100%;
    pointer-events:none;
    opacity:0;
  }
  .ms-border rect { fill:none; stroke-width:1.5; }
  .ms-border-track { stroke:rgba(111,140,116,.09); }
  .ms-border-fill { stroke:#6f8c74; stroke-linecap:round; stroke-dasharray:100; stroke-dashoffset:100; }
  .site-header.mobile-version { transition:opacity 200ms var(--ease-out,cubic-bezier(.23,1,.32,1)), transform 200ms var(--ease-out,cubic-bezier(.23,1,.32,1)), visibility 200ms; }
  .mobile-scroll-active .site-header.mobile-version { opacity:0; visibility:hidden; transform:translateY(calc(-8px - env(safe-area-inset-top, 0px))); pointer-events:none; }
}
