/* Chosen desktop arrangement and profile terminal. */
@media(min-width:641px){#profileWindow{top:105px;left:8vw;width:min(570px,50vw);height:calc(100svh - 140px)}#writingWindow{top:65px;left:40vw;width:55vw;height:calc(100svh - 190px)}}
#profileWindow .terminal-body{color:var(--text-soft)}
#profileWindow .terminal-body :not(h1){color:var(--text-soft)}
#profileWindow .terminal-body .terminal-prompt{color:var(--accent)}
#profileWindow .terminal-list li{padding-left:0}
#profileWindow .terminal-list li::before{content:none}
#profileWindow .terminal-links a::before{color:var(--text-soft)}
#profileWindow .terminal-links a:hover,#profileWindow .terminal-links a:focus-visible{color:var(--text)}
#profileWindow .ask-terminal{margin-top:7px}
.terminal-booting #profileWindow .ask-terminal,#profileWindow.is-animating .ask-terminal{visibility:hidden}
.ask-response p,.writing-cli-output p{margin:8px 0;overflow-wrap:anywhere}
.ask-form,.writing-cli-form{display:flex;align-items:baseline;gap:9px}
.input-wrap{position:relative;display:flex;flex:1;min-width:0}
.input-wrap input{width:100%;min-width:0;background:transparent;border:0;outline:0;color:var(--text-soft);font:inherit;caret-color:var(--accent);padding:0}
.input-cursor{display:none;position:absolute;left:0;top:1px;width:8px;height:1em;background:var(--accent);pointer-events:none;animation:cursorBlink 1.6s steps(1,end) infinite}
.input-wrap input:placeholder-shown:not(:focus)+.input-cursor{display:block}
.writing-cli{padding:10px 26px 18px;color:var(--text-soft);flex:0 0 auto}
.writing-cli-output:not(:empty){margin-bottom:8px}.writing-cli .terminal-prompt{color:var(--accent)}
.writing-window .ls-entry{grid-template-columns:10ch 1ch 5ch 5ch 12ch minmax(0,1fr)}
@container (max-width:660px){.writing-window .ls-entry{grid-template-columns:10ch 12ch minmax(0,1fr)}}
@container (max-width:480px){.writing-window .ls-entry{grid-template-columns:12ch minmax(0,1fr)}}
@media(max-width:640px){
 #terminalProfile{display:block;position:relative;min-height:100svh;padding:0}
 #profileWindow,#writingWindow{position:fixed;top:18px;left:14px;box-sizing:border-box;width:calc(100vw - 28px);height:calc(100svh - 94px);min-width:0;min-height:0;max-width:none;max-height:none;overflow:hidden;animation:none}
 #profileWindow .terminal-body,#writingWindow .terminal-body{overflow:auto}
 .terminal-resize-grip{display:none}.terminal-bar{cursor:default;touch-action:auto}
 .writing-window .ls-entry{grid-template-columns:12ch minmax(0,1fr)}
 .ls-permissions,.ls-size,.ls-links,.ls-owner,.ls-group{display:none}
 .writing-cli{padding:12px 16px 20px}
}

/* Orbital desktop */
body {
    background: radial-gradient(ellipse at 76% 23%, #231a17 0, #100e0e 41%, #030303 84%);
}
.earth-scene {
    --diameter: min(83vw, 91svh);
    position: fixed;
    inset: 0;
    overflow: hidden;
    touch-action: none;
    cursor: default;
    background-image: url("assets/stars.png");
    background-size: 600px 600px;
}
#bgScene { cursor: grab; }
.earth-scene:focus-visible { outline: 2px solid var(--accent); outline-offset: -4px; }
#bgScene {
    position: absolute;
    inset: auto;
    width: var(--diameter);
    height: var(--diameter);
    left: 71%;
    top: 44%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: url("assets/earth-poster.webp") center / cover;
    box-shadow: -2px -2px 5px #ffa675cf, -4px -5px 16px #f3662977, -8px -10px 44px #ed59262e;
}
.earth-scene output:not(:empty) {
    position: absolute;
    top: 56px;
    left: 16px;
    padding: 6px 9px;
    background: #050b14dc;
    color: #dce9fb;
    font-size: 12px;
}
#terminalProfile { pointer-events: none; }
.terminal-window {
    pointer-events: auto;
    box-sizing: border-box;
    border: 3px solid transparent;
    border-radius: 11px;
    background: linear-gradient(145deg, #10161c, #070b10 65%) padding-box,
        conic-gradient(from 22deg, #f5fbff, #56667b 9%, white 17%, #25303c 27%, #99a9bb 42%, white 51%, #384454 62%, #d1dae5 76%, #586678 86%, white) border-box;
    box-shadow: inset 0 0 0 1px #020407, 0 12px 38px #0009;
    backdrop-filter: none;
}
.terminal-window.is-front {
    box-shadow: inset 0 0 0 1px #020407, 0 0 0 1px #c6d8eb88, 0 12px 24px #000b, 0 30px 70px #0006;
}
.terminal-bar {
    height: 38px;
    background: linear-gradient(105deg, #34445855, #fff9 22%, transparent 42%, #28374f55 65%, #fffc 84%, transparent),
        linear-gradient(#fafcff, #b1bfd0 13%, #eaf0f6 46%, #8a99ac 50%, #a5b2c2 63%, #d6dfe8 93%, #495564);
    border-bottom: 1px solid #000;
}
@media (pointer:fine) and (prefers-reduced-motion:no-preference) {
    .terminal-bar { background-attachment: fixed, scroll; }
}
.terminal-bar .terminal-title, .terminal-window.is-front .terminal-title {
    color: #101722;
    text-shadow: 0 1px #ffffff9c;
    font-weight: 700;
}
.terminal-bar span { box-shadow: inset 0 1px 2px #000a, 0 1px 0 #ffffffe0; }
@media(min-width:641px) {
    #profileWindow { left: 2vw; top: 17svh; width: min(620px,46vw); height: auto; max-height: 80svh; }
    #writingWindow { left: min(calc(2vw + 614px),47.5vw); top: 23svh; width: min(860px,50vw); height: 71svh; }
}
@media(max-width:640px) {
    .earth-scene { --diameter: min(97vw, 60svh); }
    #bgScene { left: 62%; top: calc(20svh + var(--diameter) * 0.05); }
    #profileWindow,#writingWindow { top: 16svh; height: calc(84svh - 75px - env(safe-area-inset-bottom)); }
}

.terminal-window { animation: none; }

#profileWindow .terminal-body { padding-bottom: 14px; }
.earth-scene { cursor: move; }
.earth-scene output { pointer-events: none; }
.mobile-tabs { display: none; }
@media(max-width:640px) {
    #terminalProfile {
        position: fixed;
        inset: 16svh 12px max(10px, env(safe-area-inset-bottom));
        --mobile-terminal-height: calc(84svh - max(10px, env(safe-area-inset-bottom)) - 46px);
        min-height: 0;
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }
    .mobile-tabs {
        pointer-events: auto;
        display: flex;
        gap: 0;
        height: 46px;
        padding: 0 8px;
        border: 2px solid #bec6cf;
        border-radius: 11px 11px 0 0;
        cursor: default;
    }
    .window-lights { display: flex; gap: 5px; margin: 0 10px 0 3px; }
    .mobile-tabs button {
        flex: 1;
        align-self: stretch;
        border: 0;
        border-radius: 0;
        background: transparent;
        color: #192331;
        font: inherit;
        font-size: 13px;
        font-weight: 600;
        cursor: pointer;
    }
    .mobile-tabs button[aria-selected=true] {
        background: #ffffff42;
        box-shadow: inset 0 -3px #bd4b20;
    }
    #profileWindow, #writingWindow {
        position: relative;
        inset: auto;
        width: 100%;
        height: var(--mobile-terminal-height);
        min-height: 0;
        flex: 0 0 var(--mobile-terminal-height);
        max-height: var(--mobile-terminal-height);
        border-top: 0;
        border-radius: 0 0 11px 11px;
    }
    #profileWindow .terminal-body,
    #writingWindow .terminal-body {
        min-height: 0;
        padding: 18px 16px 20px;
    }
    .writing-cli { padding: 12px 16px 20px; }
    #profileWindow:not(.is-front), #writingWindow:not(.is-front),
    .terminal-window > .terminal-bar { display: none; }
}
