/* Theme-Toggle, Site-Chrome, Matrix-Übergang (ohne Ambient-Panel) */

.site-chrome {
    position: fixed;
    top: max(12px, env(safe-area-inset-top, 0px));
    right: max(12px, env(safe-area-inset-right, 0px));
    z-index: 4000;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px;
    border-radius: 999px;
    background: rgba(244, 244, 244, 0.92);
    border: 1px solid rgba(10, 10, 10, 0.14);
    box-shadow: 0 10px 32px rgba(10, 10, 10, 0.1);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    color: #0a0a0a;
    -webkit-tap-highlight-color: transparent;
}

html.theme-dark .site-chrome {
    background: rgba(22, 22, 22, 0.9);
    border-color: rgba(244, 244, 244, 0.16);
    color: #f4f4f4;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.45);
}

.theme-toggle {
    appearance: none;
    -webkit-appearance: none;
    min-height: 40px;
    min-width: 44px;
    padding: 8px 12px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: inherit;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.12em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    line-height: 0;
}

.theme-toggle-svg {
    display: block;
    width: 22px;
    height: 22px;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
    background: rgba(10, 10, 10, 0.06);
    outline: none;
}

html.theme-dark .theme-toggle:hover,
html.theme-dark .theme-toggle:focus-visible {
    background: rgba(244, 244, 244, 0.08);
}

body.tfs-site .tfs-masthead__tools .theme-toggle {
    min-height: 56px;
    border-radius: 0;
    padding: 0 14px;
}

body.tfs-site .tfs-masthead__tools .theme-toggle:hover {
    background: #0a0a0a;
    color: #fff;
}

html.theme-dark body.tfs-site .tfs-masthead__tools .theme-toggle:hover {
    background: #f4f4f4;
    color: #0a0a0a;
}

#matrix-rain {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 2500;
    pointer-events: none;
    opacity: 0;
    mix-blend-mode: normal;
    transition: opacity 0.26s ease;
}

#matrix-rain.is-on {
    opacity: 0.78;
}

#matrix-rain.is-leaving {
    opacity: 1;
    transition: opacity 0.22s ease 0.03s;
}

@media (prefers-reduced-motion: reduce) {
    #matrix-rain {
        display: none;
    }
}

body.is-play-mode .site-chrome {
    visibility: hidden;
    pointer-events: none;
}