/* Motion is an enhancement; visibility and navigation states still change immediately. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }

    .archive-nav-item:hover,
    .department-return:hover,
    .project-node:hover,
    .project-open:hover,
    .workspace-close:hover,
    .architecture-node:hover,
    .sentinel-system:hover,
    .services-card:hover,
    #enterFacility:hover {
        transform: none;
    }
}

#static-navigation,
.static-only {
    display: none;
}

#boot-fallback {
    display: block;
    width: fit-content;
    margin: 20px auto 0;
    padding: 12px;
    color: var(--text-secondary);
    font: 14px var(--font-mono);
    min-height: 44px;
    box-sizing: border-box;
}

#boot-fallback:focus-visible,
#static-navigation a:focus-visible {
    outline: 3px solid var(--reactor-bright);
    outline-offset: 4px;
}

/* Reuse the existing HTML as a read-only view, without dead JavaScript buttons. */
html.fallback-mode,
.fallback-mode body {
    height: auto;
    overflow: auto;
}

.fallback-mode *,
.fallback-mode *::before,
.fallback-mode *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
}

.fallback-mode #static-navigation,
.fallback-mode .static-only {
    display: block;
}

.fallback-mode #static-navigation {
    box-sizing: border-box;
    max-width: 1000px;
    margin: 24px auto;
    padding: 20px;
    border: 1px solid var(--reactor);
    font-family: var(--font-mono);
}

.fallback-mode #static-navigation nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.fallback-mode #static-navigation a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    box-sizing: border-box;
    padding: 12px;
    color: var(--text-primary);
    border: 1px solid var(--reactor);
}

.fallback-mode #helios,
.fallback-mode #aurora,
.fallback-mode #circuit-navigation,
.fallback-mode #department-services,
.fallback-mode .department button,
.fallback-mode .orion-projects,
.fallback-mode .orion-prompt,
.fallback-mode .project-detail,
.fallback-mode .workspace-navigation,
.fallback-mode .workspace-controls,
.fallback-mode .archive-navigation,
.fallback-mode .archive-detail,
.fallback-mode .archive-prompt,
.fallback-mode .archive-record-viewer,
.fallback-mode .personnel-navigation,
.fallback-mode .sentinel-system-record {
    display: none;
}

.fallback-mode #departments {
    position: static;
    pointer-events: auto;
}

.fallback-mode #departments > .department,
.fallback-mode #departments .department-header,
.fallback-mode #departments .project-workspace,
.fallback-mode #departments .workspace-section,
.fallback-mode #departments .personnel-section,
.fallback-mode #departments .sentinel-status,
.fallback-mode #departments .sentinel-systems {
    position: static;
    display: block;
    width: 100%;
    height: auto;
    max-height: none;
    transform: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    box-sizing: border-box;
    overflow: visible;
}

.fallback-mode #departments > .department {
    max-width: 1000px;
    padding: 24px 16px;
    margin: 24px auto;
    overflow-wrap: anywhere;
}

.fallback-mode #departments .department-header {
    margin: 16px 0;
}

.fallback-mode #departments .department-header h1 {
    font-size: clamp(24px, 6vw, 44px);
    letter-spacing: .12em;
}

.fallback-mode #departments .workspace-content,
.fallback-mode #departments .personnel-content,
.fallback-mode #departments .personnel-identity {
    box-sizing: border-box;
    width: 100%;
}

.fallback-mode .workspace-overview-grid,
.fallback-mode .status-grid,
.fallback-mode .hardware-category-content {
    grid-template-columns: minmax(0, 1fr);
}

.fallback-mode #departments .workspace-section {
    margin: 20px 0;
}

.fallback-mode #departments > #department-services {
    display: none;
}
