:root {
    --bg-color: #030303;
    --text-color: #00ffcc; /* Cyber blue/green */
    --accent-color: #fe0139; /* Lain core red */
    --glow: 0 0 10px rgba(0, 255, 204, 0.7);
    --window-bg: rgba(5, 10, 5, 0.85);
    --window-border: #00ffcc;
    --ui-font: 'Nunito', sans-serif;
    --page-bg-texture: url("../images/page-texture.svg");
    --taskbar-height: 35px;
    --page-header-offset: 58px;
    --page-shell-gutter: clamp(182px, 22vw, 360px);
    --page-side-art-visual-width: calc((100dvh - var(--taskbar-height) - var(--page-header-offset)) * 0.265);
}

::selection {
    background: var(--accent-color);
    color: white;
}

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

input,
textarea,
button,
select {
    font: inherit;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--ui-font);
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    user-select: none;
    font-size: 1.2rem;
    cursor: crosshair;
}

/* CRT Effects */
.scanlines {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 4px, 6px 100%;
    z-index: 100;
    pointer-events: none;
}

#webgl-bg {
    position: fixed;
    top: 0; 
    left: 0; 
    width: 100vw; 
    height: 100vh;
    z-index: -10;
    pointer-events: none;
    opacity: 0; /* Handled by Javascript fade-in */
    transition: opacity 2s ease;
}

.crt-flicker {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 255, 204, 0.02);
    opacity: 0.1;
    pointer-events: none;
    z-index: 998;
    animation: flicker 0.15s infinite;
}

.vignette {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: radial-gradient(circle, rgba(0,0,0,0) 60%, rgba(0,0,0,0.7) 100%);
    pointer-events: none;
    z-index: 1000;
}

@keyframes flicker {
    0% { opacity: 0.01; }
    50% { opacity: 0.04; }
    100% { opacity: 0.01; }
}

/* Boot Screen */
.boot-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: pre-wrap;
    text-shadow: var(--glow);
    z-index: 9998;
    background: var(--bg-color);
}

.boot-gate {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(180deg, rgba(3, 8, 7, 1) 0%, rgba(2, 8, 7, 1) 100%),
        var(--page-bg-texture);
    background-size: auto, 160px 160px;
    background-position: center, center;
    z-index: 9999;
    cursor: pointer;
    text-align: center;
}

.gate-content p {
    margin-top: 20px;
    font-size: 1.5rem;
    color: var(--window-border);
    letter-spacing: 2px;
}

.blink {
    animation: blink 1s infinite alternate;
}

@keyframes blink {
    from { opacity: 1; }
    to { opacity: 0.2; }
}

/* Desktop Utilities */
.hidden {
    display: none !important;
}

.desktop {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Icons */
.icon {
    position: absolute;
    width: 80px;
    text-align: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
}

a.icon {
    color: inherit;
    text-decoration: none;
}

.dock-img {
    width: clamp(54px, 8vw, 180px);
    height: clamp(54px, 8vw, 180px);
    object-fit: contain;
    margin-bottom: clamp(5px, 0.8vw, 18px);
    filter: drop-shadow(0 0 10px var(--window-border));
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    background: none;
    border: none;
}

.icon:hover .dock-img {
    filter: drop-shadow(0 0 20px #fff);
}

/* Central Cinematic Logo */
.central-logo {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 1;
    pointer-events: none;
}
.glitch-ascii {
    display: flex;
    align-items: baseline;
    justify-content: center;
    font-size: clamp(3rem, 6vw, 6rem);
    font-weight: bold;
    color: var(--text-color);
    text-shadow: 0 0 20px var(--text-color);
    margin: 0;
    line-height: 1;
    letter-spacing: -2px;
}
.glitch-ascii span {
    display: inline-block;
    transition: color 0.1s;
}
.central-logo .subtitle {
    font-size: 1.5rem;
    color: var(--window-border);
    margin-top: 10px;
    letter-spacing: 5px;
    opacity: 0.8;
}

/* Bottom Nav Dock */
.dock-container {
    position: fixed;
    bottom: clamp(60px, 8vh, 120px);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    width: 96vw;
    max-width: 96vw;
    gap: clamp(8px, 1.6vw, 42px);
    padding: clamp(6px, 0.8vw, 14px) clamp(8px, 1.2vw, 20px);
    z-index: 320;
    pointer-events: none; /* Let clicks pass through empty spaces */
}
.dock-container .icon {
    position: relative; /* Overrides absolute scattered layout */
    width: clamp(72px, 11vw, 240px);
    flex: 0 1 clamp(72px, 11vw, 240px);
    min-width: 0;
    pointer-events: auto; /* Re-enable clicks */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
}
.dock-container .icon:hover {
    opacity: 1.0;
}

/* ====== HUD ELEMENTS ====== */
.hud-element {
    position: fixed;
    z-index: 330;
    pointer-events: auto;
    font-size: clamp(1rem, 1.2vw, 1.5rem);
    text-shadow: 0 0 5px var(--window-border);
}
/* Relocated: Volume now in taskbar tray */
.hud-element.top-left {
    display: none;
}
.hud-element.top-right {
    top: 2vw;
    right: 2vw;
    cursor: crosshair;
}
.hud-element.bottom-left {
    left: 2vw;
    bottom: calc(35px + 1.2vw);
}
.vol-btn {
    cursor: pointer;
    font-weight: bold;
    transition: color 0.1s;
}
.vol-btn:hover {
    color: #fff;
    text-shadow: 0 0 10px #fff;
}
.corner-logo-img {
    width: clamp(40px, 4vw, 80px);
    height: clamp(40px, 4vw, 80px);
    object-fit: contain;
    border: 1px dashed var(--window-border);
    background: rgba(0, 255, 204, 0.1);
    border-radius: 50%;
}

#laincore-badge {
    display: inline-flex;
    align-items: center;
    gap: 34px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(12px);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
}

.laincore-badge-copy {
    display: flex;
    align-items: center;
}

.laincore-badge-text {
    font-size: clamp(2.3rem, 3vw, 3.8rem);
    font-weight: 800;
    letter-spacing: 2px;
    line-height: 0.95;
    color: #d8fff3;
    text-shadow:
        0 0 14px rgba(0, 255, 204, 0.35),
        0 0 28px rgba(255, 255, 255, 0.12);
}

.laincore-badge-art {
    position: relative;
    width: 164px;
    height: 164px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    isolation: isolate;
}

.laincore-badge-icon {
    position: absolute;
    width: 136px;
    height: 136px;
    object-fit: contain;
    transition: opacity 0.25s ease, transform 0.25s ease, filter 0.25s ease;
}

.laincore-badge-icon.primary {
    z-index: 2;
    filter: drop-shadow(0 0 10px rgba(0, 255, 204, 0.45));
}

.laincore-badge-icon.ghost {
    z-index: 1;
    opacity: 0.38;
    mix-blend-mode: screen;
    filter: hue-rotate(345deg) brightness(1.25) saturate(1.8);
}

/* OS Windows */
.os-window {
    position: absolute;
    background: var(--window-bg);
    border: 1px solid var(--window-border);
    border-top: 1px solid var(--window-border); /* Default */
    box-shadow: var(--glow), inset 0 0 20px rgba(0,255,204,0.1);
    display: flex;
    flex-direction: column;
    z-index: 10;
    min-width: 200px;
    min-height: 100px;
    --zoom: 1; /* Default zoom */
}

.os-window.active {
    border-top: 2px solid var(--accent-color);
    box-shadow: 0 0 15px rgba(254, 1, 57, 0.2), var(--glow);
}

.page-window {
    position: fixed;
    inset: 0 0 35px 0 !important;
    width: auto !important;
    height: auto !important;
    min-width: 0;
    min-height: 0;
    border: none;
    background:
        linear-gradient(180deg, rgba(3, 6, 7, 0.82) 0%, rgba(2, 5, 6, 0.92) 100%),
        var(--page-bg-texture);
    background-color: #000;
    background-size: cover, auto;
    background-position: center, center;
    box-shadow: none;
    backdrop-filter: blur(8px);
    overflow: hidden;
    isolation: isolate;
    z-index: 220;
}

.page-window::before,
.page-window::after {
    content: '';
    position: absolute;
    top: var(--page-header-offset);
    height: calc(100dvh - var(--taskbar-height) - var(--page-header-offset));
    width: calc((100dvh - var(--taskbar-height) - var(--page-header-offset)) * 1.333333);
    max-height: calc(100% - var(--page-header-offset));
    max-width: none;
    pointer-events: none;
    z-index: 0;
    opacity: 0.96;
    background-repeat: no-repeat;
    background-size: auto 100%;
    filter: drop-shadow(0 0 18px rgba(0, 255, 204, 0.12));
}

.page-window::before {
    left: 0;
    background-image: url("../images/left-border.png");
    background-image: -webkit-image-set(
        url("../images/left-border.webp") 1x,
        url("../images/left-border.png") 1x
    );
    background-image: image-set(
        url("../images/left-border.webp") type("image/webp"),
        url("../images/left-border.png") type("image/png")
    );
    background-position: left top;
}

.page-window::after {
    right: 0;
    width: var(--page-side-art-visual-width);
    background-image: url("../images/right-border.png");
    background-image: -webkit-image-set(
        url("../images/right-border.webp") 1x,
        url("../images/right-border.png") 1x
    );
    background-image: image-set(
        url("../images/right-border.webp") type("image/webp"),
        url("../images/right-border.png") type("image/png")
    );
    background-position: right top;
}

.page-window .window-header {
    position: sticky;
    top: 0;
    z-index: 2;
    cursor: default;
    padding: 12px clamp(16px, 2vw, 28px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
}

.page-window .window-content {
    width: min(1100px, calc(100vw - 40px));
    margin: clamp(18px, 3vw, 34px) auto;
    padding: clamp(20px, 3vw, 38px);
    position: relative;
    z-index: 1;
    background:
        linear-gradient(180deg, rgba(3, 8, 7, 0.95) 0%, rgba(2, 8, 7, 0.97) 100%),
        var(--page-bg-texture);
    background-size: auto, 160px 160px;
    background-position: center, center;
    border: 1px solid rgba(0, 255, 204, 0.35);
    box-shadow:
        0 20px 70px rgba(0, 0, 0, 0.55),
        inset 0 0 25px rgba(0, 255, 204, 0.08);
    color: #d8fff3;
    text-shadow: none;
    line-height: 1.55;
}

.page-window .window-content h1,
.page-window .window-content h2,
.page-window .window-content h3 {
    text-shadow: 0 0 8px rgba(0, 255, 204, 0.22);
}

.page-window .resize-handle {
    display: none;
}

.page-window input,
.page-window textarea,
.page-window button {
    font-size: inherit;
}

.page-window .blog-entry {
    border-bottom-color: rgba(0, 255, 204, 0.2);
}

#contact-window.page-window textarea {
    height: min(40vh, 320px) !important;
}

#art-window.page-window #art-viewer-container {
    height: min(62vh, 760px) !important;
}

body.page-open #webgl-bg {
    opacity: 0.18 !important;
    filter: brightness(0.45) saturate(0.65);
}

body.page-open .scanlines {
    opacity: 0.08;
}

body.page-open .central-logo {
    opacity: 0;
    pointer-events: none;
}

body.page-open #laincore-badge {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

body.page-open .dock-container {
    inset: 0;
    width: auto;
    max-width: none;
    padding: 0;
    transform: none;
    display: block;
    pointer-events: none;
}

body.page-open .dock-container .icon {
    position: fixed;
    width: clamp(81px, 10.5vw, 156px);
    flex: none;
    z-index: 321;
}

body.page-open .dock-container .dock-img {
    width: clamp(60px, 7.2vw, 123px);
    height: clamp(60px, 7.2vw, 123px);
    margin-bottom: 0;
}

body.page-open .dock-container .icon-text {
    display: none;
}

body.page-open .dock-container .icon:nth-child(1) { left: 16px; top: 20vh; }
body.page-open .dock-container .icon:nth-child(2) { left: 16px; top: 36vh; }
body.page-open .dock-container .icon:nth-child(3) { left: 16px; top: 52vh; }
body.page-open .dock-container .icon:nth-child(4) { left: 16px; top: 68vh; }

body.page-open .dock-container .icon:nth-child(5) { right: 16px; top: 24vh; }
body.page-open .dock-container .icon:nth-child(6) { right: 16px; top: 42vh; }
body.page-open .dock-container .icon:nth-child(7) { right: 16px; top: 60vh; }

body.page-open .page-window .window-header {
    padding-left: var(--page-shell-gutter);
    padding-right: var(--page-shell-gutter);
}

body.page-open .page-window .window-content {
    width: min(980px, calc(100vw - var(--page-shell-gutter) - var(--page-shell-gutter)));
}

@media only screen and (max-width: 1100px) {
    :root {
        --page-header-offset: 54px;
        --page-shell-gutter: 138px;
    }

    body.page-open .dock-container .icon {
        width: 78px;
    }

    body.page-open .dock-container .dock-img {
        width: 54px;
        height: 54px;
    }

    body.page-open .page-window .window-header {
        padding-left: var(--page-shell-gutter);
        padding-right: var(--page-shell-gutter);
    }

    body.page-open .page-window .window-content {
        width: min(900px, calc(100vw - var(--page-shell-gutter) - var(--page-shell-gutter)));
    }

    #laincore-badge {
        gap: 20px;
    }

    .laincore-badge-art {
        width: 108px;
        height: 108px;
    }

    .laincore-badge-icon {
        width: 88px;
        height: 88px;
    }
}

.window-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media only screen and (max-width: 820px) {
    :root {
        --page-header-offset: 52px;
        --page-shell-gutter: 18px;
    }

    .page-window::before,
    .page-window::after {
        display: block;
    }

    body.page-open .dock-container,
    body.page-open #laincore-badge,
    body.page-open .hud-element.top-left,
    body.page-open .hud-element.top-right {
        display: none;
    }

    body.page-open .page-window .window-header {
        padding-left: 12px;
        padding-right: 12px;
    }

    .page-window .zoom-btn {
        display: none;
    }

    .page-window .window-content,
    body.page-open .page-window .window-content,
    #blog-window.page-window .window-content {
        width: calc(100vw - 20px);
        margin: 10px auto 14px;
        padding: clamp(14px, 4vw, 20px);
        flex: 1 1 auto;
        min-height: calc(100dvh - var(--taskbar-height) - var(--page-header-offset) - 24px);
        line-height: 1.65;
        background:
            linear-gradient(180deg, rgba(3, 8, 7, 0.82) 0%, rgba(2, 8, 7, 0.9) 100%),
            var(--page-bg-texture);
    }

    #contact-window.page-window input[name="email"],
    #contact-window.page-window textarea {
        width: 100% !important;
        display: block;
        margin-top: 8px;
    }

    #contact-window.page-window button[type="submit"] {
        float: none !important;
        display: block;
        width: 100%;
    }

    #blog-window.page-window .window-content {
        padding: 0;
        display: flex;
        flex-direction: column;
        height: calc(100dvh - var(--taskbar-height) - var(--page-header-offset) - 24px);
        min-height: 0;
    }

    .blog-shell {
        display: block;
        flex: 1 1 auto;
        min-height: 0;
        height: 100%;
    }

    .blog-sidebar {
        display: flex;
        flex-direction: column;
        height: 100%;
        min-height: 0;
        overflow: hidden;
        border-right: none;
        border-bottom: 1px solid rgba(0, 255, 204, 0.18);
        background: rgba(2, 8, 7, 0.28);
    }

    #blog-window.mobile-blog-reading .blog-sidebar {
        display: none;
    }

    #blog-window:not(.mobile-blog-reading) .blog-reader {
        display: none;
    }

    #blog-window.mobile-blog-reading .blog-reader {
        display: flex;
    }

    .blog-sidebar-header {
        padding: 14px 16px 10px;
    }

    .blog-sidebar-title-group h2 {
        font-size: 1rem;
        line-height: 1.1;
    }

    .blog-kicker {
        display: none;
    }

    .blog-catalog {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
        padding: 8px 14px 14px 16px;
        overflow-y: auto;
    }

    .blog-archive-link {
        padding: 12px 0;
    }

    .blog-mobile-back {
        display: inline-flex;
        margin: 12px 16px 0;
        position: relative;
        z-index: 2;
        border-color: rgba(254, 1, 57, 0.36);
        background: rgba(254, 1, 57, 0.12);
        color: #fff2f5;
    }

    .blog-reader-header,
    .blog-reader-content {
        width: 100%;
        padding-left: 16px;
        padding-right: 16px;
    }

    .blog-reader {
        display: flex;
        flex-direction: column;
        height: 100%;
        min-height: 0;
    }

    .blog-reader-header {
        padding-top: 14px;
        padding-bottom: 8px;
        flex: 0 0 auto;
    }

    .blog-reader-header h1 {
        font-size: clamp(1.45rem, 6vw, 1.9rem);
        line-height: 1.15;
        margin: 8px 0 8px;
    }

    .blog-reader-meta {
        gap: 6px;
    }

    .blog-date,
    .blog-pill {
        font-size: 0.68rem;
    }

    .blog-pill {
        padding: 3px 8px;
    }

    .blog-reader-excerpt {
        display: none;
    }

    .blog-reader-meta .blog-pill + .blog-pill {
        display: none;
    }

    .blog-reader-content {
        flex: 1 1 auto;
        min-height: 0;
        padding-top: 14px;
        overflow-y: auto;
    }

    .blog-reader-content p {
        font-size: 1rem;
        line-height: 1.75;
    }

    #art-window.page-window .window-content {
        padding: 14px !important;
    }

    .gallery-grid {
        columns: 1;
        column-gap: 0;
        padding: 0;
    }
}

@media only screen and (max-width: 560px) {
    body.page-open .page-window .window-header {
        padding-left: 10px;
        padding-right: 10px;
    }

    .page-window .window-content,
    body.page-open .page-window .window-content,
    #blog-window.page-window .window-content {
        width: calc(100vw - 12px);
        margin: 6px auto 8px;
        padding: 14px;
        min-height: calc(100dvh - var(--taskbar-height) - var(--page-header-offset) - 14px);
    }

    #blog-window.page-window .window-content {
        height: calc(100dvh - var(--taskbar-height) - var(--page-header-offset) - 14px);
    }

    .blog-sidebar-header {
        padding: 12px 14px 10px;
    }

    .blog-catalog {
        padding: 6px 12px 12px 14px;
    }

    .blog-mobile-back {
        margin: 10px 14px 0;
    }

    .blog-reader-header,
    .blog-reader-content {
        padding-left: 14px;
        padding-right: 14px;
    }

    .blog-reader-header h1 {
        font-size: 1.35rem;
    }

    .blog-reader-content p {
        font-size: 0.95rem;
    }
}

.window-header {
    background: var(--window-border);
    color: var(--bg-color);
    padding: 6px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: grab;
    user-select: none;
    font-weight: bold;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.window-header:active {
    cursor: grabbing;
}

.header-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.close-btn, .zoom-btn {
    background: none;
    border: none;
    color: var(--bg-color);
    font-family: inherit;
    font-weight: bold;
    cursor: pointer;
    font-size: 1.4rem;
    padding: 0 4px;
    transition: color 0.2s, transform 0.1s;
}

.close-btn:hover, .zoom-btn:hover {
    color: white;
    transform: scale(1.1);
}

.window-content {
    padding: 20px;
    flex-grow: 1;
    overflow-y: auto;
    color: var(--text-color);
    text-shadow: var(--glow);
    /* Dynamic Zoom */
    font-size: calc(1.3rem * var(--zoom));
}

.window-content h1 { font-size: calc(2.5rem * var(--zoom)); }
.window-content h2 { font-size: calc(2rem * var(--zoom)); }
.window-content h3 { font-size: calc(1.6rem * var(--zoom)); }

.os-list {
    list-style-type: none;
    line-height: 2.2;
    font-size: 1em; /* Relative to window-content zoom */
}

/* Resize Handle */
.resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 15px;
    height: 15px;
    cursor: nwse-resize;
    background: linear-gradient(135deg, transparent 50%, var(--window-border) 50%);
    z-index: 100;
}

/* Terminal Specifics */
.terminal-content {
    font-size: 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.terminal-shell-view,
.terminal-wire-view {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1 1 auto;
    min-height: 0;
}

.terminal-shell-output {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.terminal-inline-command {
    color: #ffffff;
}

.wire-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 0.9em;
    opacity: 0.9;
}

.wire-status,
.wire-nick-label {
    letter-spacing: 1px;
}

.wire-log {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 12px;
    border: 1px solid rgba(0, 255, 204, 0.25);
    background: rgba(1, 7, 6, 0.45);
    box-shadow: inset 0 0 18px rgba(0, 255, 204, 0.06);
}

.wire-line {
    margin-bottom: 8px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.wire-line:last-child {
    margin-bottom: 0;
}

.wire-line.system {
    color: #d8fff3;
    opacity: 0.86;
}

.wire-line .wire-time {
    opacity: 0.7;
    margin-right: 8px;
}

.wire-line .wire-author {
    color: #ffffff;
    margin-right: 8px;
}

.wire-line .wire-body {
    color: var(--text-color);
}

.wire-help-text {
    font-size: 0.9em;
    opacity: 0.82;
}

.input-line {
    display: flex;
}

.prompt {
    margin-right: 10px;
}

.terminal-input {
    background: transparent;
    border: none;
    color: var(--text-color);
    font-family: inherit;
    font-size: 1.3rem;
    outline: none;
    width: 100%;
    text-shadow: var(--glow);
}

.icon-text {
    font-size: clamp(0.9rem, 1.1vw, 1.6rem);
    margin-top: clamp(2px, 0.5vw, 10px);
    letter-spacing: clamp(1px, 0.2vw, 4px);
    font-weight: bold;
    text-shadow: 0 0 10px var(--window-border);
    max-width: 100%;
    text-align: center;
}

/* Taskbar */
.taskbar {
    position: fixed;
    bottom: 0; left: 0; width: 100%; height: 35px;
    background: var(--window-bg);
    border-top: 2px solid var(--window-border);
    display: flex;
    align-items: center;
    padding: 0 10px;
    gap: 10px;
    z-index: 500;
    box-shadow: 0 -2px 10px rgba(0, 255, 204, 0.2);
}

.taskbar-windows {
    flex: 1;
    display: flex;
    gap: 8px;
    overflow: hidden;
    min-width: 0;
}

.taskbar-tray {
    display: flex;
    align-items: center;
    gap: clamp(10px, 1.2vw, 20px);
    margin-left: auto;
    padding-left: 10px;
    border-left: 1px solid rgba(0, 255, 204, 0.15);
}

.tray-item {
    font-size: clamp(0.75rem, 0.9vw, 0.95rem);
    color: var(--window-border);
    white-space: nowrap;
    display: flex;
    align-items: center;
}

.volume-tray {
    gap: 8px;
}

.volume-tray .vol-btn {
    cursor: pointer;
    font-weight: bold;
    padding: 0 4px;
    transition: color 0.1s;
}

.volume-tray .vol-btn:hover {
    color: #fff;
    text-shadow: 0 0 8px #fff;
}

.taskbar-socials {
    gap: 8px;
}

.taskbar-social-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.1s;
}

.taskbar-social-link:hover {
    color: #fff;
}

.start-btn {
    flex-shrink: 0;
    border: 1px solid var(--window-border);
    padding: 2px 15px;
    cursor: pointer;
    font-weight: bold;
    text-shadow: var(--glow);
}

.start-btn:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

.start-btn.active {
    background: rgba(254, 1, 57, 0.18);
    border-color: var(--accent-color);
    color: white;
    box-shadow: 0 0 18px rgba(254, 1, 57, 0.22);
}

.start-menu {
    position: fixed;
    left: 8px;
    bottom: 35px;
    width: min(390px, calc(100vw - 16px));
    display: flex;
    align-items: stretch;
    z-index: 540;
    pointer-events: auto;
}

.start-menu-rail {
    width: 44px;
    border: 1px solid rgba(0, 255, 204, 0.34);
    border-right: none;
    background: linear-gradient(180deg, rgba(3, 6, 7, 0.92) 0%, rgba(3, 6, 7, 0.56) 100%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 10px 0;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.start-menu-rail span {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    letter-spacing: 4px;
    font-size: 1rem;
    font-weight: 800;
    color: #d8fff3;
    text-shadow: 0 0 12px rgba(0, 255, 204, 0.28);
}

.start-menu-panel {
    flex: 1;
    min-width: 0;
    border: 1px solid rgba(0, 255, 204, 0.34);
    background: linear-gradient(180deg, rgba(5, 10, 10, 0.92) 0%, rgba(3, 8, 8, 0.82) 100%);
    backdrop-filter: blur(8px);
    box-shadow:
        0 0 24px rgba(0, 255, 204, 0.12),
        inset 0 0 0 1px rgba(255, 255, 255, 0.03);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.start-menu-caption {
    font-size: 0.86rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: rgba(216, 255, 243, 0.74);
    padding: 2px 4px 6px;
}

.start-menu-divider {
    height: 1px;
    margin: 4px 0;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 204, 0.34), transparent);
}

.start-menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(0, 255, 204, 0.24);
    background: transparent;
    color: #d8fff3;
    font: inherit;
    text-align: left;
    text-shadow: none;
}

.start-menu-item-main {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.start-menu-item-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.start-menu-item-icon {
    color: var(--accent-color);
    font-size: 1.1rem;
    line-height: 1;
}

.start-menu-arrow {
    color: rgba(216, 255, 243, 0.6);
}

.start-menu-item-launch {
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.start-menu-item-launch:hover {
    background: rgba(254, 1, 57, 0.14);
    border-color: var(--accent-color);
    color: white;
}

.start-menu-item.is-static {
    opacity: 0.82;
}

.taskbar-windows {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}

.taskbar-windows::-webkit-scrollbar {
    display: none;
}

.taskbar-window {
    flex: 0 0 auto;
    max-width: min(240px, 28vw);
    border: 1px solid rgba(0, 255, 204, 0.45);
    background: rgba(0, 255, 204, 0.08);
    color: var(--text-color);
    padding: 3px 12px;
    font-family: inherit;
    font-size: 1.05rem;
    cursor: pointer;
    text-shadow: var(--glow);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.taskbar-window:hover {
    background: rgba(0, 255, 204, 0.16);
    border-color: var(--window-border);
}

.taskbar-window.active {
    background: var(--window-border);
    color: var(--bg-color);
    text-shadow: none;
    border-top: 2px solid var(--accent-color);
}

.taskbar-socials {
    display: flex;
    gap: 15px;
    margin-left: auto;
    padding-right: 15px;
    border-right: 1px solid rgba(0, 255, 204, 0.2);
}

.taskbar-social-link {
    color: var(--window-border);
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
    transition: all 0.2s;
    text-shadow: var(--glow);
}

.taskbar-social-link:hover {
    color: #fff;
    text-shadow: 0 0 10px #fff, var(--glow);
    transform: translateY(-1px);
}

.clock {
    flex-shrink: 0;
    margin-left: 15px;
    font-weight: bold;
    text-shadow: var(--glow);
}


#game-window {
    min-width: 360px;
    min-height: 360px;
}

#game-window .window-content {
    padding: 14px;
    text-shadow: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background:
        linear-gradient(180deg, rgba(3, 8, 7, 0.92) 0%, rgba(2, 8, 7, 0.96) 100%);
}

.signal-game-hud {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    border: 1px solid rgba(0, 255, 204, 0.24);
    background: rgba(0, 0, 0, 0.22);
    padding: 10px 12px;
}

.signal-game-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 72px;
}

.signal-game-stat span {
    font-size: 0.8rem;
    letter-spacing: 1px;
    color: rgba(216, 255, 243, 0.68);
}

.signal-game-stat strong {
    font-size: 1.35rem;
    color: #fff;
    text-shadow: 0 0 10px rgba(0, 255, 204, 0.22);
}

.signal-reset-btn {
    border: 1px solid rgba(254, 1, 57, 0.52);
    background: rgba(254, 1, 57, 0.08);
    color: #ffd9e2;
    padding: 8px 12px;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    letter-spacing: 1px;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.signal-reset-btn:hover {
    background: rgba(254, 1, 57, 0.18);
    border-color: var(--accent-color);
    color: white;
}

#signal-canvas {
    width: 100%;
    min-height: 240px;
    display: block;
    border: 1px solid rgba(0, 255, 204, 0.28);
    background:
        linear-gradient(180deg, rgba(0, 10, 10, 0.92) 0%, rgba(1, 18, 16, 0.98) 100%);
    box-shadow: inset 0 0 26px rgba(0, 255, 204, 0.06);
}

.signal-status {
    text-align: center;
    color: rgba(216, 255, 243, 0.76);
    font-size: 0.92rem;
    line-height: 1.4;
}

/* Art Focus Overlay */
.art-focus-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(3, 8, 7, 0.94);
    backdrop-filter: blur(12px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    padding: 2.5vw;
}

.art-focus-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    gap: 15px;
    cursor: default;
    background: 
        linear-gradient(180deg, rgba(3, 8, 7, 0.98) 0%, rgba(2, 8, 7, 1) 100%),
        var(--page-bg-texture);
    background-size: auto, 160px 160px;
    border: 1px solid var(--window-border);
    padding: 10px;
    box-shadow: 0 0 40px rgba(0, 255, 204, 0.25);
}

.art-focus-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 10px;
}

.art-focus-meta {
    display: flex;
    flex-direction: column;
}

#focused-art-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
}

#focused-art-author {
    font-size: 1rem;
    color: var(--window-border);
    opacity: 0.8;
}

.art-focus-close {
    background: none;
    border: none;
    color: var(--window-border);
    font-size: 1.8rem;
    font-weight: bold;
    cursor: pointer;
    padding: 5px 10px;
}

.art-focus-close:hover {
    color: #fff;
    text-shadow: 0 0 10px #fff;
}

.art-focus-image-container {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0, 255, 204, 0.3);
}

#focused-art-image {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    display: block;
}

.art-focus-scanline {
    position: absolute;
    width: 100%;
    height: 100px;
    background: linear-gradient(
        0deg,
        transparent 0%,
        rgba(0, 255, 204, 0.05) 50%,
        transparent 100%
    );
    top: -100px;
    left: 0;
    pointer-events: none;
    z-index: 2;
    animation: art-scan 4s linear infinite;
}

@keyframes art-scan {
    0% { top: -100px; }
    100% { top: 100%; }
}


/* Blog Content */
/* Gallery & Art Layout (Strict pocl.vip replica) */
.gallery-nav {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px dashed rgba(0, 255, 204, 0.3);
}

.gallery-thumb {
    width: 60px;
    height: 60px;
    border-radius: 30px; /* pocl uses round caps/pills or rounded borders */
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    overflow: hidden;
    background: transparent;
    color: #fe0139;
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 30px;
}

.gallery-thumb.active {
    border: 2px solid #fe0139;
    animation: shake 100ms ease-in-out infinite;
}

.gallery-thumb:hover:not(.active) {
    border: 2px solid rgba(0, 255, 204, 0.5);
    transform: translateY(-3px);
}

.gallery-grid {
    columns: 2;
    column-gap: 20px;
    padding: 10px;
}

.art-card {
    display: block;
    break-inside: avoid;
    text-align: center;
    padding-bottom: 2.5em;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: filter 0.3s ease;
}

.art-card:hover {
    filter: drop-shadow(0 0 8px rgba(0, 255, 204, 0.5));
}

.art-card img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 0; /* No borders in reference */
}

.art-meta {
    margin-top: 15px;
    text-align: center;
}

.art-title {
    font-size: 1.1rem;
    display: block;
    color: #fff;
}

.art-author {
    font-size: 0.9rem;
    opacity: 0.8;
    display: block;
    margin-top: 5px;
}

.back-btn {
    display: inline-block;
    margin-bottom: 20px;
    color: #00ffd2;
    cursor: pointer;
    font-family: inherit;
    font-size: 1.1rem;
    text-transform: lowercase;
}

.back-btn:hover {
    text-decoration: underline;
}

/* pocl.vip shake animation */
@keyframes shake {
    2% { transform: translate(-0.5px, 2.5px) rotate(-0.5deg); }
    4% { transform: translate(0.5px, -1.5px) rotate(-0.5deg); }
    6% { transform: translate(1.5px, -1.5px) rotate(1.5deg); }
    8% { transform: translate(0.5px, 2.5px) rotate(-0.5deg); }
    10% { transform: translate(-1.5px, 2.5px) rotate(1.5deg); }
    12% { transform: translate(2.5px, -0.5px) rotate(-0.5deg); }
    14% { transform: translate(2.5px, 2.5px) rotate(1.5deg); }
    16% { transform: translate(1.5px, 1.5px) rotate(0.5deg); }
    18% { transform: translate(0.5px, 2.5px) rotate(1.5deg); }
    20% { transform: translate(1.5px, -1.5px) rotate(-0.5deg); }
    22% { transform: translate(0.5px, 1.5px) rotate(1.5deg); }
    24% { transform: translate(-0.5px, 1.5px) rotate(0.5deg); }
    26% { transform: translate(-1.5px, -1.5px) rotate(0.5deg); }
    28% { transform: translate(1.5px, 2.5px) rotate(1.5deg); }
    30% { transform: translate(2.5px, -1.5px) rotate(1.5deg); }
    32% { transform: translate(1.5px, 1.5px) rotate(1.5deg); }
    34% { transform: translate(2.5px, 0.5px) rotate(-0.5deg); }
    36% { transform: translate(2.5px, -0.5px) rotate(-0.5deg); }
    38% { transform: translate(0.5px, 0.5px) rotate(0.5deg); }
    40% { transform: translate(1.5px, -1.5px) rotate(1.5deg); }
    42% { transform: translate(0.5px, -0.5px) rotate(0.5deg); }
    44% { transform: translate(-0.5px, -0.5px) rotate(-0.5deg); }
    46% { transform: translate(1.5px, 2.5px) rotate(-0.5deg); }
    48% { transform: translate(2.5px, 2.5px) rotate(1.5deg); }
    50% { transform: translate(0.5px, 2.5px) rotate(1.5deg); }
    52% { transform: translate(1.5px, -1.5px) rotate(1.5deg); }
    54% { transform: translate(0.5px, 0.5px) rotate(1.5deg); }
    56% { transform: translate(1.5px, 1.5px) rotate(0.5deg); }
    58% { transform: translate(0.5px, 0.5px) rotate(1.5deg); }
    60% { transform: translate(-0.5px, 0.5px) rotate(-0.5deg); }
    62% { transform: translate(2.5px, -1.5px) rotate(1.5deg); }
    64% { transform: translate(2.5px, -0.5px) rotate(0.5deg); }
    66% { transform: translate(0.5px, 0.5px) rotate(1.5deg); }
    68% { transform: translate(-1.5px, -0.5px) rotate(0.5deg); }
    70% { transform: translate(2.5px, 0.5px) rotate(-0.5deg); }
    72% { transform: translate(1.5px, 0.5px) rotate(1.5deg); }
    74% { transform: translate(0.5px, 0.5px) rotate(1.5deg); }
    76% { transform: translate(-1.5px, -0.5px) rotate(0.5deg); }
    78% { transform: translate(-1.5px, -1.5px) rotate(-0.5deg); }
    80% { transform: translate(-0.5px, -0.5px) rotate(0.5deg); }
    82% { transform: translate(-0.5px, 1.5px) rotate(1.5deg); }
    84% { transform: translate(-1.5px, 2.5px) rotate(-0.5deg); }
    86% { transform: translate(-1.5px, -0.5px) rotate(-0.5deg); }
    88% { transform: translate(2.5px, -0.5px) rotate(-0.5deg); }
    90% { transform: translate(2.5px, -1.5px) rotate(-0.5deg); }
    92% { transform: translate(2.5px, 0.5px) rotate(-0.5deg); }
    94% { transform: translate(0.5px, 1.5px) rotate(-0.5deg); }
    96% { transform: translate(1.5px, 2.5px) rotate(0.5deg); }
    98% { transform: translate(2.5px, -0.5px) rotate(1.5deg); }
    0%, 100% { transform: translate(0, 0) rotate(0); }
}

#blog-window.page-window .window-content {
    position: relative;
    width: min(980px, calc(100vw - var(--page-shell-gutter) - var(--page-shell-gutter)));
    margin: clamp(18px, 3vw, 34px) auto;
    padding: 0;
    overflow: hidden;
    font-family: 'Nunito', sans-serif;
    background:
        linear-gradient(180deg, rgba(3, 8, 7, 0.9) 0%, rgba(2, 8, 7, 0.94) 100%),
        var(--page-bg-texture);
}

.blog-shell {
    display: grid;
    grid-template-columns: minmax(230px, 290px) minmax(0, 1fr);
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.blog-sidebar {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    background: rgba(0, 0, 0, 0.04);
    border-right: 1px solid rgba(0, 255, 204, 0.18);
}

.blog-sidebar-header {
    padding: 24px 24px 14px;
    border-bottom: 1px solid rgba(0, 255, 204, 0.12);
}

.blog-sidebar-title-group {
    min-width: 0;
}

.blog-kicker {
    margin-bottom: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: rgba(216, 255, 243, 0.75);
}

.blog-content h2 {
    margin-bottom: 0;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(0, 255, 204, 0.16);
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
}

.blog-mobile-back {
    display: none;
    align-items: center;
    gap: 8px;
    align-self: flex-start;
    margin: 14px 28px 0;
    padding: 6px 10px;
    border: 1px solid rgba(0, 255, 204, 0.24);
    background: rgba(0, 255, 204, 0.08);
    color: #d8fff3;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 1px;
    cursor: pointer;
}

.blog-catalog {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 10px 18px 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.blog-archive-link {
    width: 100%;
    padding: 10px 0;
    cursor: pointer;
    text-align: left;
    border: none;
    border-bottom: 1px solid rgba(0, 255, 204, 0.12);
    background: transparent;
    color: rgba(216, 255, 243, 0.76);
    font-family: 'Nunito', sans-serif;
    font-size: 0.95rem;
    line-height: 1.45;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.blog-archive-link:hover,
.blog-archive-link.active {
    color: white;
    border-bottom-color: rgba(0, 255, 204, 0.34);
    background: linear-gradient(90deg, rgba(0, 255, 204, 0.08), transparent 68%);
}

.blog-archive-date {
    flex: 0 0 auto;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: rgba(216, 255, 243, 0.62);
}

.blog-archive-separator {
    color: rgba(0, 255, 204, 0.36);
}

.blog-archive-title {
    min-width: 0;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.blog-date,
.blog-pill {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.blog-date {
    color: rgba(216, 255, 243, 0.68);
}

.blog-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border: 1px solid rgba(0, 255, 204, 0.2);
    background: rgba(0, 255, 204, 0.08);
    border-radius: 999px;
}

.blog-reader-meta,
.blog-tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.blog-tag-row {
    margin-top: 10px;
}

.blog-reader {
    min-width: 0;
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: transparent;
}

.blog-reader-header {
    width: min(100%, 720px);
    margin: 0 auto;
    padding: 32px 28px 16px;
    border-bottom: 1px solid rgba(0, 255, 204, 0.12);
}

.blog-reader-header h1 {
    margin: 14px 0 10px;
    color: white;
    font-size: clamp(1.9rem, 2.2vw, 2.5rem);
    font-weight: 800;
    line-height: 1.1;
}

.blog-reader-excerpt {
    text-align: left;
    color: rgba(216, 255, 243, 0.82);
    line-height: 1.65;
    font-size: 1rem;
}

.blog-reader-content h3 {
    font-size: 1.4rem;
    color: var(--accent-color);
    margin: 32px 0 16px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(0, 255, 204, 0.12);
    padding-bottom: 8px;
}

.blog-reader-content blockquote {
    border-left: 3px solid var(--accent-color);
    background: rgba(0, 255, 204, 0.05);
    padding: 16px 24px;
    margin: 24px 0;
    font-style: italic;
    color: rgba(216, 255, 243, 0.95);
    line-height: 1.7;
}

.blog-reader-content ul {
    margin: 20px 0;
    padding-left: 28px;
}

.blog-reader-content li {
    margin-bottom: 14px;
    line-height: 1.7;
}

.blog-reader-content b {
    color: #fff;
    font-weight: 700;
}

.blog-reader-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    width: min(100%, 720px);
    margin: 0 auto;
    padding: 22px 28px 42px;
}

.blog-reader-content p {
    text-align: left;
    margin-bottom: 18px;
    line-height: 1.8;
    font-size: 1.02rem;
    color: rgba(233, 245, 241, 0.96);
}

.blog-empty-state {
    text-align: left;
    color: rgba(216, 255, 243, 0.74);
}

@media only screen and (max-width: 960px) {
    .blog-shell {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(220px, 34%) minmax(0, 1fr);
    }

    .blog-sidebar {
        border-right: none;
        border-bottom: 1px solid rgba(0, 255, 204, 0.18);
    }

    .blog-reader-header,
    .blog-reader-content {
        padding-left: 24px;
        padding-right: 24px;
        width: 100%;
    }
}

/* Rainbow Glitch & Scanline Effect */
.glitch {
    position: relative;
    display: inline-block;
}

.glitch::before, .glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    pointer-events: none;
}

/* Stable logo color */
.glitch-ascii {
    position: relative;
    z-index: 1;
}

/* Multi-color RGB Split Layers */
.glitch::before {
    left: 3px;
    /* Rainbow fringing: Magenta + Yellow */
    text-shadow: -2px 0 #ff00ff, 1px 1px #ffcc00; 
    clip: rect(24px, 9999px, 90px, 0);
    animation: glitch-anim-primary 3s infinite linear alternate-reverse;
    opacity: 0.8;
}

.glitch::after {
    left: -3px;
    /* Rainbow fringing: Cyan + Red */
    text-shadow: 2px 0 #00ffff, -1px -1px #ff3333; 
    clip: rect(85px, 9999px, 140px, 0);
    animation: glitch-anim-secondary 2.5s infinite linear alternate-reverse;
    opacity: 0.8;
}

/* Cleaner variant for key hero text */
.clean-glitch::before,
.clean-glitch::after {
    clip: auto;
    animation: glitch-clean-shift 2.4s steps(2, end) infinite;
    opacity: 0.45;
}

.clean-glitch::before { left: 1px; }
.clean-glitch::after { left: -1px; }

.logo-ambient-glitch.clean-glitch::before,
.logo-ambient-glitch.clean-glitch::after {
    display: none;
}

.logo-ambient-glitch {
    animation: logo-shadow-drift 2.6s steps(2, end) infinite;
}

.scanline-sync {
    position: relative;
    overflow: hidden;
}

.scanline-sync .scanline-sync-bar {
    position: absolute;
    left: -6%;
    width: 112%;
    height: 2px;
    display: block;
    pointer-events: none;
    z-index: 6;
    opacity: 0;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(170, 255, 230, 0.0) 10%,
        rgba(170, 255, 230, 0.82) 50%,
        rgba(170, 255, 230, 0.0) 90%,
        transparent 100%
    );
    filter: blur(0.6px);
    box-shadow: 0 0 8px rgba(170, 255, 230, 0.25), 0 0 4px rgba(254, 1, 57, 0.3);
    animation: scanline-sync-move 6s linear infinite;
    animation-play-state: paused;
}

.scanline-sync.scanline-active .scanline-sync-bar {
    animation-play-state: running;
}

.scanline-sync.glitch-ascii::after {
    display: none;
}

/* Moving Logo Scanline Bar */
.glitch-ascii::after {
    content: "";
    position: absolute;
    left: -6%;
    width: 112%;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(170, 255, 230, 0.0) 10%,
        rgba(170, 255, 230, 0.8) 50%,
        rgba(170, 255, 230, 0.0) 90%,
        transparent 100%
    );
    filter: blur(0.6px);
    box-shadow: 0 0 8px rgba(170, 255, 230, 0.25);
    animation: scanline-move 6s linear infinite;
    z-index: 5;
    pointer-events: none;
}

/* Animations */
@keyframes scanline-move {
    0% { top: -15%; opacity: 0; }
    12% { opacity: 0.5; }
    88% { opacity: 0.5; }
    100% { top: 115%; opacity: 0; }
}

@keyframes scanline-sync-move {
    0% { top: -15%; opacity: 0; }
    12% { opacity: 0.5; }
    88% { opacity: 0.5; }
    100% { top: 115%; opacity: 0; }
}

@keyframes glitch-clean-shift {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(1px, 0); }
    50% { transform: translate(-1px, 0); }
    75% { transform: translate(0, 1px); }
}

@keyframes logo-shadow-drift {
    0%, 100% {
        text-shadow:
            0 0 20px var(--text-color),
            0 0 0 rgba(255, 0, 255, 0.5),
            0 0 0 rgba(0, 255, 255, 0.45);
    }
    35% {
        text-shadow:
            0 0 20px var(--text-color),
            1px 0 0 rgba(255, 0, 255, 0.5),
            -1px 0 0 rgba(0, 255, 255, 0.45);
    }
    70% {
        text-shadow:
            0 0 20px var(--text-color),
            -1px 0 0 rgba(255, 0, 255, 0.5),
            1px 0 0 rgba(0, 255, 255, 0.45);
    }
}

@keyframes glitch-anim-primary {
    0% { clip: rect(10px, 9999px, 20px, 0); transform: translate(0); }
    10% { clip: rect(40px, 9999px, 45px, 0); transform: translate(-3px, 1px); }
    20% { clip: rect(70px, 9999px, 75px, 0); transform: translate(3px, -1px); }
    30% { clip: rect(20px, 9999px, 30px, 0); transform: translate(-1px, 3px); }
    40% { clip: rect(90px, 9999px, 95px, 0); transform: translate(1px, -3px); }
    50% { clip: rect(10px, 9999px, 20px, 0); transform: translate(0); }
    100% { clip: rect(10px, 9999px, 20px, 0); transform: translate(0); }
}

@keyframes glitch-anim-secondary {
    0% { clip: rect(80px, 9999px, 90px, 0); transform: translate(0); }
    10% { clip: rect(10px, 9999px, 15px, 0); transform: translate(2px, -2px); }
    20% { clip: rect(50px, 9999px, 60px, 0); transform: translate(-2px, 2px); }
    30% { clip: rect(30px, 9999px, 40px, 0); transform: translate(4px, 1px); }
    40% { clip: rect(60px, 9999px, 75px, 0); transform: translate(-4px, -1px); }
    50% { clip: rect(80px, 9999px, 90px, 0); transform: translate(0); }
    100% { clip: rect(80px, 9999px, 90px, 0); transform: translate(0); }
}

.glitch-ascii.glitch::before, .glitch-ascii.glitch::after {
    font-size: clamp(3rem, 6vw, 6rem);
    letter-spacing: -2px;
}

/* ====== START MENU ====== */
.start-menu {
    position: fixed;
    bottom: 35px; /* Above taskbar */
    left: 0;
    width: 320px;
    height: 480px;
    background: #c0c0c0; /* Classic silver */
    border: 2px solid #fff;
    border-right-color: #808080;
    border-bottom-color: #808080;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.5);
    display: flex;
    z-index: 1000;
}

.start-menu.hidden { display: none; }

.start-menu-rail {
    width: 35px;
    background: linear-gradient(to bottom, #000080, #1084d0);
    display: flex;
    align-items: flex-end;
    padding-bottom: 20px;
    justify-content: center;
}

.start-menu-rail span {
    color: #fff;
    font-weight: bold;
    font-size: 1.5rem;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    letter-spacing: 2px;
}

.start-menu-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 2px;
    background: #c0c0c0;
}

.start-menu-caption {
    background: #808080;
    color: #fff;
    padding: 4px 10px;
    font-size: 0.8rem;
    font-weight: bold;
}

.start-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
    color: #000;
    font-family: inherit;
    font-size: 1.1rem;
}

.start-menu-item:hover {
    background: #000080;
    color: #fff;
}

.start-menu-item.is-static {
    cursor: default;
    opacity: 0.7;
}

.start-menu-item.is-static:hover {
    background: none;
    color: #000;
}

.start-menu-item-main {
    display: flex;
    align-items: center;
    gap: 12px;
}

.start-menu-item-icon {
    font-size: 1.4rem;
}

.start-menu-arrow {
    font-size: 1.2rem;
}

.start-menu-divider {
    height: 2px;
    background: #808080;
    border-bottom: 1px solid #fff;
    margin: 5px 2px;
}

/* ====== SIGNAL CATCH GAME ====== */
.game-window-content {
    background: #000;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px !important;
    overflow: hidden !important;
}

.signal-game-hud {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 0 10px;
    border: 1px solid var(--window-border);
    background: rgba(0, 255, 204, 0.1);
}

.signal-game-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 5px 12px;
}

.signal-game-stat span {
    font-size: 0.7rem;
    opacity: 0.7;
}

.signal-game-stat strong {
    font-size: 1.4rem;
    color: #fff;
}

.signal-reset-btn {
    background: var(--accent-color);
    border: none;
    color: white;
    padding: 4px 12px;
    font-family: inherit;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.9rem;
}

.signal-reset-btn:hover {
    filter: brightness(1.2);
}

#signal-canvas {
    border: 2px solid var(--window-border);
    background: #050505;
    image-rendering: pixelated;
    box-shadow: 0 0 15px rgba(0, 255, 204, 0.2);
}

.signal-status {
    margin-top: 15px;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Final mobile blog override block */
@media only screen and (max-width: 820px) {
    #blog-window.page-window .window-content {
        width: calc(100vw - 12px) !important;
        margin: 6px auto 8px !important;
        padding: 0 !important;
        display: flex !important;
        flex-direction: column;
        height: calc(100dvh - var(--taskbar-height) - var(--page-header-offset) - 14px) !important;
        min-height: calc(100dvh - var(--taskbar-height) - var(--page-header-offset) - 14px) !important;
        overflow: hidden;
    }

    #blog-window .blog-shell {
        display: flex !important;
        flex: 1 1 auto;
        min-height: 0;
        height: 100%;
    }

    #blog-window .blog-sidebar,
    #blog-window .blog-reader {
        flex: 1 1 auto;
        min-height: 0;
        height: 100%;
    }

    #blog-window .blog-sidebar {
        display: flex !important;
        flex-direction: column;
        overflow: hidden;
        border-right: none;
        border-bottom: none;
        background: rgba(2, 8, 7, 0.22);
    }

    #blog-window .blog-sidebar-header {
        flex: 0 0 auto;
        padding: 16px 16px 12px !important;
    }

    #blog-window .blog-catalog {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none !important;
        overflow-y: auto;
        padding: 0 16px 18px !important;
    }

    #blog-window .blog-archive-link {
        padding: 14px 0 !important;
        font-size: 1.2rem !important;
    }

    #blog-window .blog-reader {
        display: none !important;
        flex-direction: column;
        overflow: hidden;
    }

    #blog-window.mobile-blog-reading .blog-sidebar {
        display: none !important;
    }

    #blog-window.mobile-blog-reading .blog-reader {
        display: flex !important;
    }

    #blog-window .blog-mobile-back {
        display: none !important;
        align-self: flex-start;
        margin: 12px 16px 0 !important;
        padding: 8px 12px !important;
        border: 1px solid rgba(254, 1, 57, 0.42) !important;
        background: rgba(254, 1, 57, 0.12) !important;
        color: #fff2f5 !important;
        position: relative;
        z-index: 3;
    }

    #blog-window.mobile-blog-reading .blog-mobile-back {
        display: inline-flex !important;
    }

    #blog-window .blog-reader-header {
        width: 100% !important;
        margin: 0 !important;
        padding: 14px 16px 8px !important;
        flex: 0 0 auto;
    }

    #blog-window .blog-reader-header h1 {
        font-size: clamp(1.45rem, 6vw, 1.9rem) !important;
        line-height: 1.15;
        margin: 8px 0 8px !important;
    }

    #blog-window .blog-reader-excerpt {
        display: none;
    }

    #blog-window .blog-reader-meta .blog-pill + .blog-pill {
        display: none;
    }

    #blog-window .blog-reader-content {
        width: 100% !important;
        margin: 0 !important;
        padding: 14px 16px 24px !important;
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        font-size: 1.5rem !important;
    }

    #blog-window .blog-reader-content p {
        font-size: inherit !important;
        line-height: 1.7 !important;
    }
}

@media only screen and (max-width: 560px) {
    #blog-window.page-window .window-content {
        height: calc(100dvh - var(--taskbar-height) - var(--page-header-offset) - 12px) !important;
        min-height: calc(100dvh - var(--taskbar-height) - var(--page-header-offset) - 12px) !important;
    }

    #blog-window .blog-sidebar-header {
        padding: 14px 14px 10px !important;
    }

    #blog-window .blog-catalog {
        padding: 0 14px 16px !important;
    }

    #blog-window .blog-archive-link {
        font-size: 1.1rem !important;
    }

    #blog-window .blog-mobile-back {
        margin: 10px 14px 0 !important;
    }

    #blog-window .blog-reader-header,
    #blog-window .blog-reader-content {
        padding-left: 14px !important;
        padding-right: 14px !important;
    }

    #blog-window .blog-reader-header h1 {
        font-size: 1.35rem !important;
    }

    #blog-window .blog-reader-content p {
        font-size: 1.42rem !important;
    }
}

/* Final mobile free-form window override block */
@media only screen and (max-width: 820px) {
    .os-window:not(.page-window) {
        position: fixed !important;
        left: 8px !important;
        right: 8px !important;
        top: 10px !important;
        bottom: calc(var(--taskbar-height) + 8px) !important;
        width: auto !important;
        height: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        max-height: calc(100dvh - var(--taskbar-height) - 18px) !important;
        z-index: 420 !important;
        overflow: hidden;
    }

    .os-window:not(.page-window) .window-header {
        cursor: default !important;
        padding: 10px 12px !important;
    }

    .os-window:not(.page-window) .zoom-btn,
    .os-window:not(.page-window) .resize-handle {
        display: none !important;
    }

    .os-window:not(.page-window) .window-content {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        padding: 14px !important;
        font-size: 1.12rem;
    }

    #terminal-window .window-content {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        gap: 8px;
        font-size: 1.18rem !important;
    }

    #terminal-window .terminal-shell-view,
    #terminal-window .terminal-wire-view {
        gap: 8px;
    }

    #terminal-window .input-line {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    #terminal-window .prompt {
        margin-right: 0;
    }

    #terminal-window .terminal-input {
        min-height: 42px;
        font-size: 1.25rem;
        border-bottom: 1px solid rgba(0, 255, 204, 0.26);
    }

    #terminal-window .wire-status-row {
        align-items: flex-start;
        flex-direction: column;
    }

    #terminal-window .wire-log {
        padding: 10px;
    }

    #music-window .window-content {
        padding: 18px 14px !important;
        text-align: center;
    }

    #music-window .window-content > div {
        margin-top: 20px !important;
        display: flex !important;
        flex-wrap: wrap;
        justify-content: center !important;
        gap: 18px !important;
        font-size: clamp(2.4rem, 12vw, 3.6rem) !important;
        line-height: 1;
    }

    #music-window .window-content > div span {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 56px;
        min-height: 56px;
    }

    #music-track-title,
    #music-vol-display {
        font-size: 1.12rem !important;
        line-height: 1.45;
    }

    #music-vol-display {
        margin-top: 18px !important;
    }

    #game-window {
        min-width: 0 !important;
        min-height: 0 !important;
    }

    #game-window .window-content {
        padding: 12px !important;
        gap: 12px;
    }

    #game-window .signal-game-hud {
        gap: 10px;
        padding: 10px;
        align-items: stretch;
    }

    #game-window .signal-game-stat {
        min-width: 0;
    }

    #signal-canvas {
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        aspect-ratio: 3 / 2;
    }

    #game-window .signal-status {
        font-size: 0.96rem;
        line-height: 1.5;
    }

    #os-notification {
        top: auto !important;
        bottom: calc(var(--taskbar-height) + 8px) !important;
        max-height: min(36dvh, 260px) !important;
    }

    #os-notification .window-content {
        justify-content: center !important;
        align-items: center !important;
        text-align: center;
        gap: 10px;
    }

    #os-notification #notification-text {
        font-size: 1.18rem !important;
        line-height: 1.45;
        margin-bottom: 0 !important;
    }

    #os-notification button {
        width: 100%;
        max-width: 260px;
    }
}

@media only screen and (max-width: 560px) {
    .os-window:not(.page-window) {
        left: 6px !important;
        right: 6px !important;
        top: 6px !important;
        bottom: calc(var(--taskbar-height) + 6px) !important;
        max-height: calc(100dvh - var(--taskbar-height) - 12px) !important;
    }

    .os-window:not(.page-window) .window-header {
        padding: 8px 10px !important;
        font-size: 1rem !important;
    }

    .os-window:not(.page-window) .window-content {
        padding: 12px !important;
    }

    #terminal-window .window-content {
        font-size: 1.08rem !important;
    }

    #terminal-window .terminal-input {
        font-size: 1.15rem;
    }

    #music-window .window-content > div {
        gap: 14px !important;
        font-size: clamp(2.2rem, 13vw, 3.1rem) !important;
    }

    #music-track-title,
    #music-vol-display {
        font-size: 1rem !important;
    }

    #game-window .signal-game-hud {
        flex-direction: column;
    }

    #game-window .signal-reset-btn {
        width: 100%;
    }

    #game-window .signal-status {
        font-size: 0.88rem;
    }

    #os-notification #notification-text {
        font-size: 1.05rem !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .scanlines,
    .glitch-ascii::after,
    .scanline-sync .scanline-sync-bar,
    .logo-ambient-glitch,
    .clean-glitch::before,
    .clean-glitch::after,
    .glitch::before,
    .glitch::after {
        animation: none !important;
    }

    .central-logo,
    .icon,
    .dock-img,
    .art-card,
    .art-focus-content {
        transition: none !important;
    }
}

/* Audio Player UI Enhancements */
.music-player-content {
    overflow: hidden !important;
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-sizing: border-box;
}

.music-info-panel {
    border-bottom: 2px solid rgba(0, 255, 204, 0.4);
    padding-bottom: 12px;
    margin-bottom: 15px;
}

.music-title {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 4px;
    color: #00ffcc;
    filter: drop-shadow(0 0 5px rgba(0, 255, 204, 0.4));
}

.music-btn:hover {
    color: var(--text-color);
}

.spotify-btn:hover {
    background: rgba(29, 185, 84, 0.1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(29, 185, 84, 0.2);
}

@keyframes pulse {
    0%, 100% { transform: scaleY(1); opacity: 0.5; }
    50% { transform: scaleY(1.5); opacity: 1; }
}
