/* Persistent shell styles: loaded on every page and never unloaded by the router. */

:root {
    --shell-bg: #09090b;
    --shell-text: #f8fafc;
    --shell-muted: #a1a1aa;
    --shell-accent: #818cf8;
    --shell-card-bg: rgba(255, 255, 255, 0.03);
    --shell-border: rgba(255, 255, 255, 0.08);
}

[data-theme="light"] {
    --shell-bg: #f8fafc;
    --shell-text: #09090b;
    --shell-muted: #52525b;
    --shell-accent: #4f46e5;
    --shell-card-bg: rgba(0, 0, 0, 0.03);
    --shell-border: rgba(0, 0, 0, 0.08);
}

html {
    transition: background-color 0.3s ease, color 0.3s ease;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--shell-bg);
    color: var(--shell-text);
}

#canvas-bg,
#boids-canvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
}

#canvas-bg {
    opacity: 0.55;
}

/* Theme switch */
.theme-switch {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 100;
    display: flex;
    background: var(--shell-card-bg, rgba(255, 255, 255, 0.03));
    border: 1px solid var(--shell-border, rgba(255, 255, 255, 0.08));
    border-radius: 9999px;
    padding: 0.3rem;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.theme-switch button {
    background: transparent;
    border: none;
    color: var(--shell-text);
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.3s ease;
}

.theme-switch button:hover {
    transform: scale(1.05);
}

.theme-switch .icon-light,
.theme-switch .icon-dark {
    position: absolute;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.theme-switch .icon-light {
    opacity: 0;
    transform: rotate(-90deg);
}

.theme-switch .icon-dark {
    opacity: 1;
    transform: rotate(0deg);
}

[data-theme="light"] .theme-switch .icon-light {
    opacity: 1;
    transform: rotate(0deg);
}

[data-theme="light"] .theme-switch .icon-dark {
    opacity: 0;
    transform: rotate(90deg);
}

/* Floating music control */
.music-control {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 100;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    border: 1px solid var(--shell-border);
    background: var(--shell-card-bg);
    color: var(--shell-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: all 0.3s ease;
}

.music-control:hover {
    transform: scale(1.08);
    border-color: var(--shell-accent);
    color: var(--shell-accent);
}

.music-control .icon-play,
.music-control .icon-pause {
    position: absolute;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.music-control .icon-play {
    opacity: 1;
    transform: scale(1);
}

.music-control .icon-pause {
    opacity: 0;
    transform: scale(0.7);
}

.music-control.playing .icon-play {
    opacity: 0;
    transform: scale(0.7);
}

.music-control.playing .icon-pause {
    opacity: 1;
    transform: scale(1);
}

[data-route="/"] .music-control {
    display: none;
}

@media (max-width: 640px) {
    .theme-switch {
        top: 4.5rem;
        right: 1rem;
    }
}
