/* Nexus Playground (/nexus/). The owner's 2025 Nexus page, ported from
   styles.css at tag kleto-site-2025 ("Nexus page styles"). The rules
   below the top bar are the original ones; only the top bar is new.
   It loads after /css/site.css, which supplies the fonts, the reset and
   the .logo / .wordmark lockup. */

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

/* Top bar: current lockup home, and a quiet way back. It passes pointer
   events through to the canvas everywhere except its two links. */
.nx-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 64px;
    padding: 0 var(--gutter);
    pointer-events: none;
}
.nx-bar a { pointer-events: auto; }
.nx-back {
    display: inline-flex;
    gap: 8px;
    font-size: 14px;
    color: var(--muted);
    border-bottom: 1px solid var(--line-2);
    padding-bottom: 3px;
    transition: color .2s, border-color .2s;
}
.nx-back:hover { color: var(--white); border-color: var(--white); }

/* Nexus page styles (original) */
.nexus-body {
    font-family: 'Space Grotesk', sans-serif;
    background-color: #000000;
    color: #ffffff;
    overflow: hidden;
    height: 100vh;
}

.playground-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* KLETO wordmark background */
.wordmark-background {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.25;
    z-index: 0;
    pointer-events: none;
    animation: float 20s ease-in-out infinite;
    width: 400px;
    height: auto;
    color: #ffffff;
}

.wordmark-background svg {
    display: block;
    width: 100%;
    height: auto;
}

/* Show full wordmark by default, hide glyph */
.wordmark-full {
    display: block;
}

.wordmark-glyph {
    display: none;
}

@keyframes float {
    0%, 100% { transform: translate(-50%, -50%) rotate(0deg) scale(1); }
    25% { transform: translate(-50%, -50%) rotate(1deg) scale(1.02); }
    50% { transform: translate(-50%, -50%) rotate(0deg) scale(1.05); }
    75% { transform: translate(-50%, -50%) rotate(-1deg) scale(1.02); }
}

/* Floating Controls */
.floating-controls {
    position: fixed;
    top: 50%;
    right: 30px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 1000;
}

.floating-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.floating-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.08);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.floating-btn:hover {
    transform: translateY(-2px) scale(1.05);
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.floating-btn:hover::before {
    opacity: 1;
}

.floating-btn:active {
    transform: translateY(0) scale(0.95);
}

.floating-btn svg {
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.floating-btn:hover svg {
    transform: scale(1.1);
}

/* Button specific styles */
.theme-btn:hover {
    border-color: rgba(255, 255, 255, 0.5);
}

.settings-btn:hover {
    background: rgba(177, 140, 255, 0.2);
    border-color: rgba(177, 140, 255, 0.45);
}

.reset-btn:hover {
    background: rgba(255, 154, 213, 0.2);
    border-color: rgba(255, 154, 213, 0.45);
}

.back-btn:hover {
    background: rgba(255, 241, 168, 0.2);
    border-color: rgba(255, 241, 168, 0.45);
}

@media (max-width: 768px) {
    .floating-controls {
        right: 20px;
        gap: 12px;
    }

    .floating-btn {
        width: 45px;
        height: 45px;
    }

    .wordmark-full {
        width: 300px;
    }
}

@media (max-width: 480px) {
    .floating-controls {
        right: 15px;
        gap: 10px;
    }

    .floating-btn {
        width: 40px;
        height: 40px;
    }

    /* Switch to glyph on mobile */
    .wordmark-full {
        display: none;
    }

    .wordmark-glyph {
        display: block;
        width: 200px;
        height: auto;
    }
}

/* Settings Modal Styles */
.settings-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.settings-modal.active {
    display: flex;
    opacity: 1;
    pointer-events: none; /* allow interaction with underlying canvas */
}

.settings-dialog {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    padding: 0;
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    pointer-events: auto; /* allow clicks inside the dialog */
}

.settings-header {
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.settings-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffffff;
    text-align: center;
    font-family: 'Space Mono', monospace;
    letter-spacing: 0.1em;
}

.settings-header .close-btn {
    position: absolute;
    right: 1.5rem;
}

.close-btn {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.settings-content {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.setting-group {
    margin-bottom: 1.5rem;
}

.setting-label {
    display: block;
    color: #ffffff;
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.setting-control {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.setting-value {
    flex: 1;
    text-align: center;
    color: #cccccc;
    font-family: 'Space Mono', monospace;
    font-size: 1rem;
    min-width: 80px;
}

.setting-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.setting-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.setting-btn:active {
    transform: scale(0.95);
}

@media (max-width: 768px) {
    .settings-dialog {
        width: 95%;
        max-height: 90vh;
    }

    .settings-header {
        padding: 1rem 1.5rem;
    }

    .settings-header h2 {
        font-size: 1.25rem;
    }

    .settings-content {
        padding: 1.5rem;
    }
}
