body {
    overflow: hidden;
    background: var(--surface-dark);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.45;
}

button,
a,
summary {
    cursor: pointer;
}

.skip-link {
    position: fixed;
    z-index: 10000;
    top: 8px;
    left: 8px;
    padding: 8px 12px;
    transform: translateY(-150%);
    border: 2px solid var(--border);
    background: var(--surface);
    color: var(--text);
}

.skip-link:focus {
    transform: none;
}

.boot-screen {
    position: fixed;
    z-index: 9000;
    inset: 0;
    display: grid;
    place-items: center;
    background: var(--surface-dark);
    color: var(--surface);
    transition: opacity 180ms linear, visibility 180ms linear;
}

.boot-screen.is-done {
    visibility: hidden;
    opacity: 0;
}

.boot-panel {
    width: min(520px, calc(100% - 40px));
}

.boot-logo {
    width: 48px;
    height: 48px;
    margin-bottom: 28px;
    color: var(--surface);
}

.boot-title {
    margin-bottom: 6px;
    color: var(--orange);
    font-weight: 700;
}

.boot-state {
    margin-bottom: 24px;
    font-size: 18px;
}

.boot-log {
    display: grid;
    min-height: 104px;
    gap: 4px;
    color: #aaa79f;
    font-size: 12px;
}

.boot-log span {
    opacity: 0;
    animation: boot-line 100ms linear forwards;
}

.boot-log span:nth-child(2) { animation-delay: 180ms; }
.boot-log span:nth-child(3) { animation-delay: 360ms; }
.boot-log span:nth-child(4) { animation-delay: 540ms; }

.boot-progress {
    height: 8px;
    margin-top: 18px;
    border: 1px solid #77746f;
}

.boot-progress span {
    display: block;
    width: 100%;
    height: 100%;
    background: var(--orange);
    transform-origin: left;
    animation: boot-progress 900ms steps(8, end) both;
}

@keyframes boot-line { to { opacity: 1; } }
@keyframes boot-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.desktop-shell {
    position: relative;
    display: grid;
    grid-template-rows: var(--system-bar-height) minmax(0, 1fr) var(--taskbar-height);
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background: var(--desktop);
}

.system-bar,
.taskbar {
    position: relative;
    z-index: 5000;
    display: flex;
    align-items: center;
    border-color: var(--border);
    background: var(--surface);
}

.system-bar {
    gap: 18px;
    padding: 0 12px;
    border-bottom: 2px solid var(--border);
}

.system-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.system-logo {
    width: 22px;
    height: 22px;
}

.system-message {
    flex: 1;
    margin: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.system-route {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 28px;
    padding: 2px 4px 2px 8px;
    border: 2px solid var(--border);
    background: var(--orange);
    box-shadow: var(--inset-raised);
    font-size: 11px;
    font-weight: 700;
}

.system-route span {
    white-space: nowrap;
}

.system-route b {
    padding: 3px 6px;
    background: var(--surface-dark);
    color: var(--surface);
    font-size: 9px;
    font-weight: 400;
    white-space: nowrap;
}

.system-route:active {
    box-shadow: var(--inset-sunk);
    transform: translate(1px, 1px);
}

.system-clock {
    min-width: 48px;
    font-weight: 700;
    text-align: right;
}

.desktop-area {
    position: relative;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background-color: var(--desktop);
    background-image:
        linear-gradient(var(--desktop-grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--desktop-grid) 1px, transparent 1px);
    background-size: 16px 16px;
}

.desktop-area::before {
    position: absolute;
    inset: 18px;
    border: 1px solid rgba(22, 22, 22, 0.18);
    content: "";
    pointer-events: none;
}

.wallpaper-mark {
    position: absolute;
    right: 42px;
    bottom: 50px;
    display: grid;
    color: rgba(22, 22, 22, 0.13);
    font-weight: 700;
    line-height: 0.85;
    pointer-events: none;
    text-align: right;
}

.wallpaper-mark span:first-child {
    color: rgba(255, 90, 0, 0.28);
    font-size: clamp(76px, 12vw, 190px);
}

.wallpaper-mark span:last-child {
    font-size: 13px;
}

.desktop-icons {
    position: absolute;
    z-index: 10;
    top: 28px;
    left: 30px;
    display: grid;
    grid-template-columns: repeat(5, 96px);
    grid-auto-rows: 96px;
    gap: 12px 14px;
}

.desktop-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    min-width: 0;
    padding: 5px 3px;
    border: 2px solid transparent;
    background: transparent;
    font-size: 12px;
    line-height: 1.2;
    text-align: center;
}

.desktop-icon__image {
    width: 46px;
    height: 46px;
    filter: drop-shadow(3px 3px 0 rgba(22, 22, 22, 0.15));
}

.desktop-icon span {
    max-width: 88px;
    padding: 1px 3px;
    overflow-wrap: anywhere;
}

.desktop-icon:hover,
.desktop-icon.is-selected {
    border-color: var(--border);
    background: rgba(243, 240, 231, 0.66);
}

.desktop-icon.is-selected span {
    background: var(--orange);
}

.desktop-icon--secret {
    animation: secret-reveal 240ms steps(3, end);
}

@keyframes secret-reveal {
    from { opacity: 0; transform: translateY(8px); }
}

.desktop-readout {
    position: absolute;
    bottom: 25px;
    left: 30px;
    display: grid;
    padding: 10px 12px;
    border-left: 4px solid var(--orange);
    background: rgba(243, 240, 231, 0.64);
    color: var(--muted);
    font-size: 10px;
    pointer-events: none;
}

.window-layer {
    position: absolute;
    z-index: 100;
    inset: 0;
    pointer-events: none;
}

.taskbar {
    gap: 5px;
    min-width: 0;
    padding: 5px 7px;
    border-top: 2px solid var(--border);
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.6);
}

.start-button,
.taskbar-item,
.network-button {
    height: 34px;
    border: 2px solid var(--border);
    background: var(--surface);
    box-shadow: var(--inset-raised);
}

.start-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 11px;
    font-size: 12px;
    font-weight: 700;
}

.start-button[aria-expanded="true"] {
    background: var(--orange);
    box-shadow: var(--inset-sunk);
}

.taskbar-windows {
    display: flex;
    flex: 1;
    gap: 4px;
    min-width: 0;
    overflow: auto hidden;
    scrollbar-width: none;
}

.taskbar-item {
    min-width: 110px;
    max-width: 180px;
    overflow: hidden;
    padding: 0 10px;
    font-size: 11px;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.taskbar-item.is-active {
    border-bottom-color: var(--orange);
    background: var(--surface-sunk);
    box-shadow: var(--inset-sunk);
    font-weight: 700;
}

.taskbar-item.is-minimized {
    color: var(--muted);
}

.taskbar-status {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    padding: 0 8px;
    border: 2px solid var(--border);
    box-shadow: var(--inset-sunk);
    font-size: 11px;
    white-space: nowrap;
}

.network-button {
    display: grid;
    width: 27px;
    height: 24px;
    padding: 3px;
    border-width: 0 1px;
    place-items: center;
}

.start-menu {
    position: absolute;
    z-index: 10;
    bottom: calc(100% + 3px);
    left: 7px;
    width: 248px;
    padding: 5px;
    border: 2px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow), var(--inset-raised);
}

.start-menu header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: -5px -5px 5px;
    padding: 12px;
    background: var(--surface-dark);
    color: var(--surface);
}

.start-menu header div {
    display: grid;
}

.start-menu header span {
    color: #aaa79f;
    font-size: 10px;
}

.start-menu__logo {
    width: 38px;
    height: 38px;
    color: var(--surface);
}

.start-menu > button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px;
    border: 0;
    background: transparent;
    text-align: left;
}

.start-menu > button:hover,
.start-menu > button:focus-visible {
    background: var(--orange);
}

.start-menu hr,
.context-menu hr {
    height: 2px;
    margin: 4px;
    border: 0;
    background: var(--border);
}

.network-panel {
    position: absolute;
    right: 7px;
    bottom: calc(100% + 3px);
    display: grid;
    width: 280px;
    gap: 8px;
    padding: 13px;
    border: 2px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow), var(--inset-raised);
}

.network-panel > span {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    border-bottom: 1px dotted var(--muted);
    font-size: 11px;
}

.network-panel b { color: var(--green); }
.network-panel b.danger { color: var(--danger); }

.context-menu {
    position: fixed;
    z-index: 7000;
    width: 202px;
    padding: 4px;
    border: 2px solid var(--border);
    background: var(--surface);
    box-shadow: 5px 5px 0 rgba(22, 22, 22, 0.28), var(--inset-raised);
}

.context-menu button {
    display: block;
    width: 100%;
    padding: 7px 8px;
    border: 0;
    background: transparent;
    text-align: left;
}

.context-menu button:hover,
.context-menu button:focus-visible {
    background: var(--orange);
}

.no-script {
    position: fixed;
    z-index: 20000;
    inset: 0;
    overflow: auto;
    padding: clamp(24px, 6vw, 80px);
    background: var(--surface);
}

.no-script article {
    max-width: 760px;
    padding-block: 12px;
    border-top: 2px solid var(--border);
}

body.crt .desktop-shell::after {
    position: fixed;
    z-index: 8500;
    inset: 0;
    background: repeating-linear-gradient(to bottom, transparent 0, transparent 3px, rgba(0, 0, 0, 0.055) 3px, rgba(0, 0, 0, 0.055) 4px);
    content: "";
    pointer-events: none;
}

body.secret-mode .desktop-area {
    cursor: crosshair;
}

body.no-animations *,
body.no-animations *::before,
body.no-animations *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
}
