/* Metallic base for the floating depth field. */
body.portal-space {
    position: relative;
    isolation: isolate;
    background:
        radial-gradient(circle at 82% 14%, rgba(244, 247, 245, 0.14), transparent 27%),
        radial-gradient(ellipse at 50% 50%, rgba(190, 194, 191, 0.25), transparent 48%),
        linear-gradient(128deg, #3f4241 0%, #777b79 43%, #525654 100%);
    background-attachment: fixed;
}

body.portal-space::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background:
        radial-gradient(circle at 16% 24%, rgba(255,255,255,0.055), transparent 22%),
        radial-gradient(circle at 82% 76%, rgba(20,22,21,0.08), transparent 26%),
        linear-gradient(105deg, rgba(255,255,255,0.04), transparent 24%, transparent 76%, rgba(0,0,0,0.1));
}

.portal-space-canvas {
    position: fixed;
    inset: 0;
    z-index: -1;
    display: block;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.portal-motion-toggle {
    position: fixed;
    right: max(18px, env(safe-area-inset-right));
    bottom: max(18px, env(safe-area-inset-bottom));
    z-index: 10;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.38);
    border-radius: 50%;
    color: #f5f5f5;
    background: rgba(28, 32, 30, 0.68);
    box-shadow: 0 8px 24px rgba(0,0,0,0.22), inset 0 0 0 1px rgba(255,255,255,0.1);
    cursor: pointer;
    transition: background-color 160ms ease;
}

.portal-motion-toggle[hidden] {
    display: none;
}

.portal-motion-toggle:hover {
    background: rgba(39, 42, 41, 0.92);
}

.portal-motion-toggle:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 4px;
}

.portal-motion-icon {
    width: 10px;
    height: 12px;
    border-left: 3px solid currentColor;
    border-right: 3px solid currentColor;
}

.portal-motion-toggle[aria-pressed="true"] .portal-motion-icon {
    width: 0;
    height: 0;
    margin-left: 3px;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-left: 10px solid currentColor;
    border-right: 0;
}

@media (prefers-reduced-motion: reduce) {
    .portal-motion-toggle {
        transition: none;
    }
}
