.os-window {
    position: absolute;
    top: 8%;
    left: 19%;
    display: grid;
    grid-template-rows: 36px minmax(0, 1fr) 25px;
    width: min(780px, calc(100% - 48px));
    height: min(590px, calc(100% - 42px));
    min-width: 330px;
    min-height: 250px;
    overflow: hidden;
    border: 2px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow), var(--inset-raised);
    pointer-events: auto;
}

.os-window.is-opening {
    animation: window-open var(--speed) steps(3, end);
}

@keyframes window-open {
    from { opacity: 0; transform: translate(7px, 7px) scale(0.985); }
}

.os-window.is-maximized {
    top: 3px !important;
    left: 3px !important;
    width: calc(100% - 6px) !important;
    height: calc(100% - 6px) !important;
}

.window-titlebar {
    display: flex;
    align-items: center;
    min-width: 0;
    padding: 3px 4px 3px 8px;
    border-bottom: 2px solid var(--border);
    background: var(--muted);
    color: var(--white);
    user-select: none;
}

.os-window.is-active .window-titlebar {
    background: var(--orange);
    color: var(--text);
}

.window-title-icon {
    margin-right: 7px;
}

.window-title {
    flex: 1;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.window-controls {
    display: flex;
    gap: 3px;
}

.window-control {
    display: grid;
    width: 26px;
    height: 24px;
    padding: 0;
    border: 2px solid var(--border);
    background: var(--surface);
    box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 rgba(0, 0, 0, 0.25);
    color: var(--text);
    font-weight: 700;
    line-height: 1;
    place-items: center;
}

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

.window-control--close:hover {
    background: var(--surface-dark);
    color: var(--white);
}

.window-body {
    min-width: 0;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    background: var(--surface);
}

.window-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    border-top: 2px solid var(--border);
    background: var(--surface-sunk);
    color: var(--muted);
    font-size: 10px;
}

.window-grip {
    width: 14px;
    height: 14px;
    background: repeating-linear-gradient(135deg, transparent 0 3px, var(--muted) 3px 4px);
}

.window--readme {
    top: 7%;
    left: 24%;
    width: min(760px, calc(100% - 48px));
    height: min(700px, calc(100% - 42px));
}

.window--about { top: 11%; left: 16%; width: min(720px, calc(100% - 48px)); height: min(570px, calc(100% - 42px)); }
.window--explorer { top: 6%; left: 20%; width: min(880px, calc(100% - 48px)); height: min(600px, calc(100% - 42px)); }
.window--project { top: 5%; left: 21%; width: min(900px, calc(100% - 48px)); height: min(640px, calc(100% - 38px)); }
.window--skills { top: 8%; left: 23%; width: min(820px, calc(100% - 48px)); height: min(610px, calc(100% - 42px)); }
.window--terminal { top: 10%; left: 25%; width: min(760px, calc(100% - 48px)); height: min(520px, calc(100% - 42px)); }
.window--contact,
.window--cv { top: 13%; left: 31%; width: min(560px, calc(100% - 48px)); height: min(460px, calc(100% - 42px)); }
.window--experiments { top: 10%; left: 27%; width: min(680px, calc(100% - 48px)); height: min(520px, calc(100% - 42px)); }
.window--trash { top: 16%; left: 30%; width: min(600px, calc(100% - 48px)); height: min(410px, calc(100% - 42px)); }
.window--settings { top: 12%; left: 30%; width: min(610px, calc(100% - 48px)); height: min(500px, calc(100% - 42px)); }
.window--private { top: 14%; left: 28%; width: min(620px, calc(100% - 48px)); height: min(430px, calc(100% - 42px)); }
.window--approach { top: 4%; left: 21%; width: min(850px, calc(100% - 48px)); height: min(650px, calc(100% - 36px)); }
.window--workbench { top: 3%; left: 17%; width: min(980px, calc(100% - 42px)); height: min(680px, calc(100% - 32px)); }
