/*
 * Skins — what the shell does for any skin. A skin is a design document (OS_TYPES__Skin); the OS's renderer
 * (OsSkinRenderer) writes its values onto the shell's own selectors. Nothing here names a skin: the rules below hold
 * for every one, and read the skin's variables (--skin-*). The brand (the Λ, the rainbow colours) is never restyled.
 */

/* ── Any skin: windows and the composer wear its palette and radii ── */
:root[data-skin] .a-win-frame {
    background: var(--skin-window);
    border-color: var(--skin-border);
    border-radius: var(--skin-r-window);
}
:root[data-skin] .oc-box { border-radius: var(--skin-r-composer); }
:root[data-skin] .rail-item:not(.is-img) { border-radius: var(--skin-r-button); }
:root[data-skin] .uc-user,
:root[data-skin] .ss-pill { border-radius: var(--skin-r-island); }
:root[data-skin] .lh-icon { border-radius: var(--skin-r-card, 14px); }
:root[data-skin] .nx-card { border-radius: var(--skin-r-card, 14px); }

/* ── The app in front: a short bar in its colour above its tile (a design may move, size or swap it) ── */
.rail .rail-dot { display: none; }
@media (min-width: 761px) {
    /* The corner pills are solid unless a design frosts them; the space's mark a solid disc. */
    :root[data-skin] .ss-pill,
    :root[data-skin] .uc-user { backdrop-filter: none; -webkit-backdrop-filter: none; }
    :root[data-skin] .ss-mono { background: hsl(var(--h, 320) 36% 27%); color: #fff; border-color: transparent; }
    :root[data-skin] .rail .rail-item.running::before {
        content: ''; position: absolute; top: -5px; left: 50%; width: 55%; height: 3px; border-radius: 2px;
        transform: translateX(-50%); background: var(--app, var(--skin-accent)); pointer-events: none;
        animation: rail-focus 0.25s cubic-bezier(.2, .8, .2, 1);
    }
    @keyframes rail-focus { from { width: 0; opacity: 0; } }
}

/* ── The OS's decorations' motion (waves under a dock, a star's glint) ── */
@keyframes aos-wave { to { -webkit-mask-position: -384px 0; mask-position: -384px 0; } }
@keyframes aos-glint { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
    :root[data-skin] .rail::before, :root[data-skin] .rail::after { animation: none; }
}

/* ── Glass: a skin whose window colour has alpha (#rrggbbaa) in a mode — the shell blurs what is behind it ── */
:root[data-skin-glass="both"] .a-win-frame,
:root[data-skin-glass="dark"]:not([data-theme="light"]) .a-win-frame,
:root[data-skin-glass="light"][data-theme="light"] .a-win-frame {
    backdrop-filter: blur(18px) saturate(1.15); -webkit-backdrop-filter: blur(18px) saturate(1.15);
}

/* ── Phones (design "A-OS Mobile · Prototype D"): the app bar and the sheets (apps, spaces, you) wear the skin —
      the sheets solid, rounded on top; "Get apps" in its accent ── */
@media (max-width: 760px) {
    :root[data-skin] .os-scroll .os-grid .a-win-frame { background: var(--skin-window); }
    :root:is([data-skin-glass="both"], [data-skin-glass="dark"]:not([data-theme="light"]), [data-skin-glass="light"][data-theme="light"]) .os-scroll .os-grid .a-win-frame {
        backdrop-filter: blur(18px) saturate(1.15); -webkit-backdrop-filter: blur(18px) saturate(1.15);
    }
    :root[data-skin] .os-m-bar { background: color-mix(in srgb, var(--skin-window, var(--bg, #0a0a0c)) 94%, transparent); box-shadow: inset 0 0 0 1px var(--skin-border, var(--line, rgba(255, 255, 255, 0.10))), 0 10px 24px -12px rgba(0, 0, 0, 0.9); }
    :root[data-skin] :is(.rail-sheet, .ss-pop, .uc-sheet) {
        /* Always solid: the skin's surface (it may be see-through, or unset) over the OS's ground. */
        background: linear-gradient(var(--skin-surface, transparent), var(--skin-surface, transparent)), var(--bg, #0a0a0c);
        border-radius: var(--skin-r-window, 28px) var(--skin-r-window, 28px) 0 0;
    }
    :root[data-skin] .rs-name { color: var(--skin-text2); }
    :root[data-skin] .rs-app.running { background: var(--skin-sel); box-shadow: inset 0 0 0 1px var(--skin-sel-line, var(--skin-border)); }
    :root[data-skin] .rs-app.running .rs-name { color: var(--skin-text); }
    :root[data-skin] .rs-get { background: var(--skin-accent, #8B5CF6); color: #fff; }
    :root[data-skin] .rs-find { background: var(--skin-window, rgba(255, 255, 255, 0.05)); color: var(--skin-muted, rgba(255, 255, 255, 0.5)); }
    :root[data-skin] .rs-q { color: var(--skin-text); }
}
