/* === Reset === */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* === Body — neutral base, views override === */
body {
    background: #000;
    color: #d4d4d4;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === Loading State === */
.loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 1.2rem;
    color: #d4d4d4;
}

.loading-cursor {
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* === Accessibility === */
:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* === View Switcher Pill === */
.view-switcher {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 2px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    padding: 3px;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 12px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: opacity 0.3s;
}

.view-switcher-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: rgba(255, 255, 255, 0.35);
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
    white-space: nowrap;
    line-height: 1;
}

.view-switcher-btn:hover:not(.active):not(.disabled) {
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.05);
}

.view-switcher-btn.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: default;
}

.view-switcher-btn.disabled {
    color: rgba(255, 255, 255, 0.15);
    cursor: default;
}

.view-switcher-btn.disabled:hover::after {
    content: 'soon';
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 10px;
    white-space: nowrap;
    pointer-events: none;
}

.view-switcher-btn.disabled {
    position: relative;
}

.view-switcher-icon {
    width: 14px;
    height: 14px;
    display: block;
}

/* Mosaic view — minimal dark pill */
body.view-mosaic .view-switcher {
    background: rgba(0, 0, 0, 0.85);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
}

body.view-mosaic .view-switcher-btn {
    color: rgba(255, 255, 255, 0.4);
}

body.view-mosaic .view-switcher-btn:hover:not(.active):not(.disabled) {
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.08);
}

body.view-mosaic .view-switcher-btn.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

body.view-mosaic .view-switcher-btn.disabled {
    color: rgba(255, 255, 255, 0.15);
}

body.view-mosaic .view-switcher-btn.disabled:hover::after {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.4);
}

/* Light-background views (portfolio) */
body.view-portfolio .view-switcher {
    background: rgba(30, 30, 30, 0.85);
    border-color: rgba(0, 0, 0, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

body.view-portfolio .view-switcher-btn {
    color: rgba(255, 255, 255, 0.5);
}

body.view-portfolio .view-switcher-btn:hover:not(.active):not(.disabled) {
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.1);
}

body.view-portfolio .view-switcher-btn.active {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

body.view-portfolio .view-switcher-btn.disabled {
    color: rgba(255, 255, 255, 0.2);
}

body.view-portfolio .view-switcher-btn.disabled:hover::after {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.5);
}

/* Mobile */
@media (max-width: 640px) {
    .view-switcher {
        bottom: 1rem;
        font-size: 11px;
    }

    .view-switcher-btn {
        padding: 5px 10px;
    }
}

/* === Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
    .loading-cursor {
        animation: none;
    }
}
