/**
 * Flux Playground — shared chrome (nav, drawer, start overlay, primary CTA, glass HUD bar).
 * Each page must define :root: --text-color, --accent, --glass-bg, --glass-border, --glass-blur,
 * --site-header-height, --z-site-backdrop, --z-site-sidebar, --z-site-header.
 */

/* —— Site shell: top nav + left drawer —— */
.site-backdrop {
    position: fixed;
    top: var(--site-header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.42);
    z-index: var(--z-site-backdrop);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}

.site-backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--site-header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px 0 16px;
    background: rgba(5, 5, 16, 0.94);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: var(--z-site-header);
}

.site-header__brand {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.site-header__brand-mark {
    color: var(--accent);
    font-weight: 700;
}

.site-header__brand-rest {
    font-weight: 500;
    opacity: 0.88;
}

.site-header__tagline {
    display: none;
}

@media (min-width: 520px) {
    .site-header__tagline {
        display: inline;
        font-size: 0.58rem;
        font-weight: 400;
        letter-spacing: 0.04em;
        text-transform: none;
        color: rgba(255, 255, 255, 0.38);
        margin-left: 0.35rem;
        border-left: 1px solid rgba(255, 255, 255, 0.15);
        padding-left: 0.65rem;
    }
}

.site-header__toggle {
    width: 42px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 0;
    color: var(--text-color);
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.site-header__toggle:hover {
    border-color: rgba(0, 255, 204, 0.45);
    color: var(--accent);
    background: rgba(0, 255, 204, 0.06);
}

.site-header__toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.site-header__toggle .fa-fw {
    width: 1.1em;
}

.site-sidebar {
    position: fixed;
    top: var(--site-header-height);
    left: 0;
    bottom: 0;
    width: min(232px, 88vw);
    background: rgba(10, 12, 24, 0.97);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    z-index: var(--z-site-sidebar);
    transform: translateX(-100%);
    transition: transform 0.26s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    padding: 14px 0 24px;
    overflow-y: auto;
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.35);
}

.site-sidebar.is-open {
    transform: translateX(0);
}

.site-sidebar__label {
    font-size: 0.55rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.32);
    padding: 6px 16px 10px;
    margin-top: 4px;
}

.site-sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 10px;
}

.site-sidebar__link {
    display: block;
    padding: 11px 12px;
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 0;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.site-sidebar__link:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--accent);
}

.site-sidebar__link--current {
    color: var(--accent);
    border-color: rgba(0, 255, 204, 0.35);
    background: rgba(0, 255, 204, 0.06);
}

.site-sidebar__note {
    margin: 18px 16px 0;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.58rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.35);
}

/* —— Start overlay —— */
#startOverlay {
    position: fixed;
    inset: 0;
    --overlay-purple: rgba(133, 83, 244, 0.14);
    --overlay-blue: rgba(59, 130, 246, 0.11);
    --overlay-pink: rgba(244, 63, 94, 0.08);
    background:
        radial-gradient(ellipse 85% 65% at 12% 18%, var(--overlay-purple), transparent 58%),
        radial-gradient(ellipse 75% 55% at 88% 82%, var(--overlay-blue), transparent 55%),
        radial-gradient(ellipse 70% 50% at 50% 100%, var(--overlay-pink), transparent 50%),
        linear-gradient(165deg, rgba(5, 5, 16, 0.91) 0%, rgba(8, 6, 22, 0.9) 45%, rgba(6, 8, 20, 0.92) 100%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: opacity 0.5s ease;
}

#startOverlay h1 {
    margin-bottom: 12px;
    font-weight: 300;
    letter-spacing: 3px;
    font-size: 1.35rem;
    color: var(--text-color);
}

#startOverlay .sub {
    margin-bottom: 8px;
    color: var(--accent);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

#startOverlay p {
    margin-bottom: 28px;
    color: #888;
    font-size: 0.8rem;
    max-width: 420px;
    text-align: center;
    line-height: 1.45;
    padding: 0 16px;
}

/* —— Galaxy CTA —— */
.galaxy-btn {
    --btn-bg: #0c0c14;
    --btn-text: #ffffff;
    --btn-primary: #8553f4;
    --btn-secondary: #3b82f6;
    --btn-accent: #f43f5e;
    --btn-radius: 0;
    font-family: inherit;
    font-size: 15px;
    padding: 0.85em 1.85em;
    border-radius: var(--btn-radius);
    border: none;
    background: var(--btn-bg);
    position: relative;
    cursor: pointer;
    overflow: hidden;
    z-index: 1;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    box-shadow:
        0 3px 0 0 rgba(133, 83, 244, 0.55),
        0 0.5em 1.25em -0.35em rgba(133, 83, 244, 0.45);
}

.galaxy-btn:focus-visible {
    outline: 2px solid var(--btn-primary);
    outline-offset: 4px;
}

.galaxy-btn:active {
    transform: translateY(3px) scale(0.99);
    box-shadow: 0 0 0 0 rgba(133, 83, 244, 0.35), 0 0.2em 0.75em -0.25em rgba(0, 0, 0, 0.55);
}

.galaxy-btn__content {
    display: flex;
    align-items: center;
    gap: 0.65em;
    position: relative;
    z-index: 2;
    color: var(--btn-text);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.galaxy-btn::before {
    content: "";
    position: absolute;
    inset: -4px;
    z-index: 0;
    background: conic-gradient(
        from 0deg, var(--btn-bg) 0deg, var(--btn-primary) 60deg,
        var(--btn-secondary) 120deg, var(--btn-bg) 180deg,
        var(--btn-accent) 240deg, var(--btn-primary) 300deg, var(--btn-bg) 360deg);
    border-radius: var(--btn-radius);
    animation: flux-galaxy-spin 4s linear infinite;
    filter: blur(6px);
    opacity: 0.65;
}

.galaxy-btn::after {
    content: "";
    position: absolute;
    inset: 2px;
    background: var(--btn-bg);
    border-radius: var(--btn-radius);
    z-index: 1;
}

@keyframes flux-galaxy-spin {
    to { transform: rotate(360deg); }
}

.start-overlay--hidden {
    opacity: 0;
    pointer-events: none;
}

.hidden {
    opacity: 0;
    pointer-events: none;
}

/* —— Glass HUD: full-width bottom bar (Hand tracking, Flux Sonics, Flux Shapes) —— */
#hud.hud-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    transform: none;
    width: 100%;
    max-width: none;
    z-index: 10;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px 16px;
    padding: 10px 16px;
    padding-bottom: max(10px, env(safe-area-inset-bottom, 0px));
    pointer-events: auto;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-bottom: none;
    border-radius: 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
}
