/* Loaded only for Dívka z výtahu. Rails and subtle panels move behind the text. */
html:not(.reader-mode) .elevator-story-content { position: relative; z-index: 3; }
.elevator-story {
    position: fixed;
    top: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
    color: var(--text-muted);
    mask-image: linear-gradient(transparent, #000 12%, #000 88%, transparent);
}
.elevator-story::before,
.elevator-story::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: -128px;
    width: 1px;
    opacity: .3;
    background: repeating-linear-gradient(to bottom, currentColor 0 42px, transparent 42px 128px);
    animation: elevator-story-rise 11s linear infinite;
    animation-play-state: paused;
}
.elevator-story::before { left: 0; }
.elevator-story::after { right: 0; }
.elevator-story__panels {
    position: absolute;
    inset: 0 0 -512px;
    opacity: .055;
    background: repeating-linear-gradient(to bottom, currentColor 0 256px, transparent 256px 512px);
    /* Four rail lengths per repeat: panels and rails travel at the same speed. */
    animation: elevator-story-panels-rise 44s linear infinite;
    animation-play-state: paused;
}
.elevator-story.is-running .elevator-story__panels,
.elevator-story.is-running::before,
.elevator-story.is-running::after { animation-play-state: running; }
@keyframes elevator-story-rise {
    to { transform: translateY(-128px); }
}
@keyframes elevator-story-panels-rise {
    to { transform: translateY(-512px); }
}
.elevator-story-toggle {
    position: fixed;
    right: max(1rem, env(safe-area-inset-right));
    bottom: max(1rem, env(safe-area-inset-bottom));
    z-index: 210;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    min-height: 44px;
    padding: .5rem .8rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-card);
    color: var(--text-muted);
    font: inherit;
    font-size: .75rem;
    cursor: pointer;
}
.elevator-story-toggle::before { content: 'Ⅱ'; font-size: .8rem; }
.elevator-story-toggle[aria-pressed="false"]::before { content: '↑'; }
.elevator-story-toggle:hover { color: var(--text); border-color: var(--accent); }
.elevator-story-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.elevator-story[hidden],
.elevator-story-toggle[hidden],
.reader-mode .elevator-story,
.reader-mode .elevator-story-toggle { display: none; }
.reader-mode .elevator-story__panels,
.reader-mode .elevator-story::before,
.reader-mode .elevator-story::after { animation-play-state: paused; }
@media (max-width: 860px) {
    .elevator-story-toggle { bottom: calc(76px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
    .elevator-story__panels, .elevator-story::before, .elevator-story::after { animation: none; }
}
@media print {
    .elevator-story, .elevator-story-toggle { display: none; }
}
