:root { --bg: #050506; --grain: .09; --menubar: 30px; --statusbar: 26px; }

body.env-desk { overflow: hidden; }
.desk {
  position: relative;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(60% 55% at 78% 92%, rgba(90, 43, 255, .16), transparent 70%),
    radial-gradient(45% 40% at 62% 30%, rgba(31, 51, 255, .07), transparent 70%),
    var(--bg);
}
.desk::after {
  content: ""; position: absolute; inset: 0; z-index: 300; pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 50%, transparent 55%, rgba(0, 0, 0, .55) 100%),
    repeating-linear-gradient(to bottom, transparent 0 2px, rgba(0, 0, 0, .22) 2px 3px);
}

.menubar {
  position: absolute; z-index: 200; inset: 0 0 auto 0; height: var(--menubar);
  display: flex; align-items: stretch; justify-content: space-between;
  background: var(--bone); color: #060608;
  border-bottom: 1px solid #000;
  font: 13px/1 var(--f-mono);
}
.menus { display: flex; align-items: stretch; }
.menu { position: relative; display: flex; }
.menu-btn {
  display: flex; align-items: center; gap: 7px;
  padding: 0 11px; border: 0; background: none; color: inherit;
}
.menu-mark { font-weight: 500; padding-left: 12px; }
.menu-mark .px { width: 15px; height: auto; --px-fill: transparent; --px-accent: var(--cobalt); }
.menu-btn:hover, .menu-btn[aria-expanded="true"], .menu-btn:focus-visible { background: var(--cobalt); color: var(--bone); outline: none; }
.menu-btn[aria-expanded="true"] .px, .menu-btn:hover .px { --px-accent: var(--bone); }
.menu-list {
  position: absolute; top: 100%; left: 0; min-width: 210px; margin: 0; padding: 4px 0;
  list-style: none; background: var(--bone); color: #060608;
  border: 1px solid #000; box-shadow: 4px 4px 0 #000;
}
.menu-list a, .menu-list button {
  display: block; width: 100%; padding: 6px 16px; border: 0; background: none;
  text-align: left; text-decoration: none; color: inherit; font: 13px/1.2 var(--f-mono);
}
.menu-list a:hover, .menu-list button:hover, .menu-list a:focus-visible, .menu-list button:focus-visible { background: var(--cobalt); color: var(--bone); outline: none; }
.menu-list .sep { height: 1px; margin: 4px 0; background: #000; opacity: .25; }
.menubar-r { display: flex; align-items: center; gap: 18px; padding-right: 14px; white-space: nowrap; }
.mb-np { max-width: 260px; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
.mb-np:hover { color: var(--cobalt); }
.mb-vis b { font-weight: 500; letter-spacing: .06em; }
.mb-clock { font-variant-numeric: tabular-nums; }

.wallpaper { position: absolute; inset: var(--menubar) 0 var(--statusbar) 0; z-index: 0; pointer-events: none; }
.wp-texture {
  position: absolute; left: -1vw; bottom: 0; width: 66vw; height: 64%;
  display: flex; flex-direction: column; justify-content: flex-end;
  overflow: hidden; white-space: nowrap;
  font: 9px/1 var(--f-mono); color: #1d2140;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 70%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 70%);
}
.wp-texture span { display: block; transform: translateX(calc(var(--i) * -2.7px)); letter-spacing: calc(.06em - var(--i) * .0012em); }
.wp-texture b { font-weight: 400; color: #33407e; }

.wp-who {
  position: absolute; left: 3vw; top: 3.5vh; margin: 0;
  font: 400 clamp(108px, 18.5vw, 320px)/.74 var(--f-fell);
  letter-spacing: -.035em; color: var(--bone);
  text-shadow: .5px 0 0 rgba(95, 225, 255, .35), -.5px 0 0 rgba(90, 43, 255, .4);
}
.wp-who span { display: block; }
.wp-who span + span { margin-left: 8.5vw; font-style: italic; }
.wp-daniel {
  position: absolute; left: 4vw; top: calc(3.5vh + 18.5vw * 1.48 - 5.4vw); margin: 0;
  font: clamp(118px, 19vw, 340px)/1 var(--f-hand);
  color: var(--cobalt);
  transform: rotate(-7deg);
  text-shadow: 0 0 26px rgba(31, 51, 255, .65), 0 0 2px rgba(120, 140, 255, .9);
  animation: phosphor 9s steps(1) infinite;
}
.wp-daniel.is-forged { font-family: var(--f-fell); font-style: italic; font-size: clamp(96px, 15vw, 270px); letter-spacing: -.02em; transform: rotate(-4deg); }
@keyframes phosphor { 0%, 91%, 100% { opacity: 1; } 92% { opacity: .78; } 93% { opacity: 1; } 95% { opacity: .9; } }
.wp-aside {
  position: absolute; left: 35vw; top: calc(3.5vh + 6.4vw); margin: 0;
  font: italic 15px/1 var(--f-fell); color: var(--grey-1);
}
.wp-fig {
  position: absolute; right: 120px; bottom: 14px; margin: 0;
  font: 10px/1 var(--f-mono); color: var(--grey-2); letter-spacing: .04em;
}

.sysinfo {
  position: absolute; z-index: 2; left: 3.3vw; bottom: calc(var(--statusbar) + 18px);
  font: 11px/1.55 var(--f-mono); color: var(--grey-1);
}
.sysinfo p { margin: 0; }
.sysinfo b { color: var(--bone); font-weight: 500; letter-spacing: .08em; }
.sysinfo .visitors { color: var(--bone); letter-spacing: .08em; }
.last-login { color: var(--lilac); }

.icons {
  position: absolute; z-index: 5; top: calc(var(--menubar) + 14px); right: 10px; bottom: calc(var(--statusbar) + 10px);
  display: flex; flex-direction: column; flex-wrap: wrap-reverse; align-content: flex-start; gap: 2px;
}
.icon {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  width: 92px; padding: 7px 2px 6px; border: 0; background: none;
  color: var(--bone); text-decoration: none; font: 12px/1.25 var(--f-mono); text-align: center;
}
.icon .px {
  width: 40px; height: 40px;
  --px-fill: #0d0e1a; --px-accent: var(--cobalt-hot);
  filter: drop-shadow(0 0 7px rgba(31, 51, 255, .35));
  transition: filter .15s, transform .15s;
}
.icon span { padding: 1px 5px; max-width: 100%; overflow-wrap: anywhere; }
.icon:hover span, .icon:focus-visible span, .icon.is-selected span { background: var(--cobalt); color: var(--bone); }
.icon:hover .px, .icon:focus-visible .px { filter: drop-shadow(0 0 12px rgba(63, 85, 255, .9)) brightness(1.15); transform: translateY(-1px); }
.icon:focus-visible { outline: 1px dotted var(--bone); outline-offset: -2px; }
.icon-untitled .px { --px-accent: var(--lilac); opacity: .85; }

.windows { position: absolute; inset: var(--menubar) 0 var(--statusbar) 0; z-index: 10; pointer-events: none; }
.win {
  position: absolute; left: var(--x); top: var(--y); width: var(--w, 320px);
  pointer-events: auto;
  background: var(--os-grey); color: #08080a;
  border: 1px solid #000;
  box-shadow: 1px 1px 0 #000, 7px 7px 0 rgba(0, 0, 0, .6), 0 0 70px rgba(31, 51, 255, .12);
  font: 13px/1.45 var(--f-mono);
}
.win[hidden] { display: none; }
.win-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  height: 27px; padding: 0 4px 0 9px;
  background: #5c5c66; color: #e9e9ee;
  cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
}
.win.is-front .win-bar { background: var(--cobalt-ink); color: #fff; }
.win.is-dragging .win-bar { cursor: grabbing; }
.win.is-dragging { box-shadow: 1px 1px 0 #000, 14px 14px 0 rgba(0, 0, 0, .45), 0 0 90px rgba(31, 51, 255, .2); }
.win-bar h2 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 400 19px/1 var(--f-bit); letter-spacing: .02em; }
.win-ctl { display: flex; gap: 3px; flex: none; }
.win-ctl button {
  width: 19px; height: 17px; padding: 0; border: 1px solid; border-color: #fff #222 #222 #fff;
  background: var(--os-grey); color: #000; font: 12px/1 var(--f-mono);
}
.win-ctl button:active { border-color: #222 #fff #fff #222; }
.win.is-shaded .win-body, .win.is-shaded .win-status { display: none; }
.win-status {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 3px 9px 2px; border-top: 1px solid #8d8b85;
  font: 16px/1.15 var(--f-bit); color: #222;
}
.win-status a { color: var(--cobalt-ink); }
.linkish { padding: 0; border: 0; background: none; text-decoration: underline; text-underline-offset: .18em; font: inherit; color: var(--cobalt-ink); }

.win-help { --x: 56vw; --y: 4.5vh; --w: min(530px, 36vw); }
.tabs { display: flex; gap: 2px; padding: 10px 14px 0; border-bottom: 1px solid #7e7e7e; }
.tabs [role="tab"] {
  min-width: 74px; padding: 3px 11px 2px; border: 2px outset #eee; border-bottom: 0;
  background: var(--os-grey); color: #151515; font: 18px/1 var(--f-bit);
}
.tabs [aria-selected="true"] { position: relative; top: 1px; border-style: inset; background: #dedcd6; }
.pane {
  padding: 20px clamp(16px, 2.4vw, 30px) 22px;
  min-height: 330px;
  background: repeating-linear-gradient(0deg, #cbc9c3 0 1px, #c5c3bd 2px 4px);
}
.path { margin: 0 0 12px; font: 15px/1 var(--f-bit); letter-spacing: .06em; color: #3a3a3a; }
.help-h {
  margin: 0; font: 400 clamp(42px, 4.2vw, 64px)/.8 var(--f-bit); letter-spacing: -.03em;
  color: #061fa3; text-shadow: 1px 1px #f4f4f4, 0 0 4px #3b79ff;
}
.help-h del { text-decoration-thickness: 3px; text-decoration-color: #1f33ff; color: #2a3271; opacity: .55; }
.help-h ins {
  display: block; margin: 4px 0 0 34%; text-decoration: none;
  font: clamp(46px, 4.6vw, 70px)/.9 var(--f-hand); color: var(--cobalt);
  transform: rotate(-4deg); text-shadow: none;
}
.topics { margin: 0; padding: 0; list-style: none; border-top: 1px dotted #6c6a65; }
.topics a {
  display: grid; grid-template-columns: 22px 1fr; align-items: center; gap: 8px;
  padding: 4px 6px; border-bottom: 1px dotted #6c6a65; text-decoration: none; color: #0b0b0d;
}
.topics .px { width: 18px; height: 18px; --px-fill: #f1efe9; --px-accent: var(--cobalt); }
.topics b { font: 400 21px/1 var(--f-bit); color: #061fa3; }
.topics a:hover, .topics a:focus-visible { background: #061a77; outline: none; }
.topics a:hover b, .topics a:focus-visible b { color: #e9f1ff; }
.terminal-line { margin: 16px 0 0; font: 21px/1 var(--f-bit); color: #092ba6; }
.terminal-line span:first-child { color: #020d3b; }
.terminal-line a { color: inherit; text-decoration: none; }
.terminal-line a:hover, .terminal-line a:focus-visible { background: #061a77; color: #e9f1ff; outline: none; }

.question-box { width: min(100%, 410px); margin: 6px 0 0 auto; padding: 10px 12px; border: 2px inset #ececec; background: #06167b; color: #c9dfff; box-shadow: 6px 6px 0 rgba(0, 0, 0, .34); }
.question-title { padding-bottom: 6px; border-bottom: 1px solid #779cfb; color: #fff; font: 19px/1 var(--f-bit); letter-spacing: .1em; }
.question-box p { margin: 12px 0; font: 21px/1.05 var(--f-bit); }
.answers { display: grid; gap: 3px; width: fit-content; }
.answers button { padding: 1px 7px; border: 0; background: transparent; color: #c9dfff; text-align: left; font: 21px/1.1 var(--f-bit); }
.answers button:hover, .answers button:focus-visible, .answers button.selected, .answers button.pending { background: #d7e3ff; color: #00136e; outline: 0; }
.index-note { margin: 18px 0 0; font-size: 11px; color: #333; }
.index-note a { color: var(--cobalt-ink); }

.find label { display: block; margin-bottom: 8px; font-size: 12px; }
.find input {
  width: 100%; padding: 5px 8px; border: 2px inset #eee; background: #fff; color: #000;
  font: 20px/1 var(--f-bit); outline: none;
}
.find input:focus { box-shadow: 0 0 0 2px var(--cobalt); }
.find-results { margin: 12px 0 0; padding: 0; list-style: none; max-height: 220px; overflow: auto; background: #fff; border: 2px inset #eee; }
.find-results:empty { display: none; }
.find-results a { display: grid; grid-template-columns: 70px 1fr; gap: 8px; padding: 4px 8px; text-decoration: none; color: #000; }
.find-results a:hover, .find-results a:focus-visible { background: var(--cobalt-ink); color: #fff; outline: none; }
.find-results i { font: normal 15px/1.2 var(--f-bit); color: #555; }
.find-results a:hover i { color: #c9dfff; }
.find-results .none { padding: 6px 8px; font-size: 12px; color: #444; }

.win-status-window { --x: 31vw; --y: 70vh; --w: 250px; }
.win-status-window .win-body { padding: 12px 14px 14px; background: #06167b; color: #c9dfff; }
.np-k { margin: 0 0 4px; font: 15px/1 var(--f-bit); letter-spacing: .12em; color: #7f9cff; }
.np-track { display: block; color: #fff; font: 23px/1 var(--f-bit); text-decoration: none; overflow-wrap: anywhere; }
.np-track:hover { text-decoration: underline; }
.np-artist { margin: 3px 0 10px; font: 17px/1.1 var(--f-bit); }
.np-link { margin: 0; font-size: 11px; }
.np-link a { color: #c9dfff; }

.win-hello { --x: 15vw; --y: 14vh; --w: min(440px, 46vw); }
.win-hello .win-body { background: #000; padding: 6px; }
.hello { position: relative; margin: 0; }
.hello img { width: 100%; height: auto; image-rendering: pixelated; }
.hello-door { position: absolute; left: 47.6%; top: 44.4%; width: 4.8%; height: 15.4%; }
.hello-door:hover, .hello-door:focus-visible { box-shadow: 0 0 18px 6px rgba(233, 241, 255, .55); outline: none; }
.hello figcaption { position: absolute; left: 14px; bottom: 10px; font: 26px/1 var(--f-bit); color: #e9f1ff; text-shadow: 0 0 8px #3b79ff; }

.win-trash { --x: 58vw; --y: 46vh; --w: 300px; }
.win-sys { --x: 36vw; --y: 20vh; --w: 330px; }
.win-untitled { --x: 60vw; --y: 54vh; --w: 300px; }
.filelist { margin: 0; padding: 8px; list-style: none; background: #fff; border: 2px inset #eee; margin: 10px; min-height: 90px; }
.filelist a { display: grid; grid-template-columns: 20px 1fr auto; gap: 8px; align-items: center; padding: 3px 6px; color: #000; text-decoration: none; }
.filelist .px { width: 18px; height: 18px; --px-fill: #fff; --px-accent: var(--cobalt); }
.filelist i { font: normal 15px/1 var(--f-bit); color: #666; }
.filelist a:hover, .filelist a:focus-visible { background: var(--cobalt-ink); color: #fff; outline: none; }
.filelist .empty { padding: 6px; color: #666; }
.trash-msg { margin: 0 12px 10px; min-height: 1em; font: 17px/1.1 var(--f-bit); color: var(--cobalt-ink); }
.win-sys .win-body { padding: 18px 20px; }
.sys-eye .px { width: 64px; height: auto; margin: 0 auto 14px; --px-fill: #f1efe9; --px-accent: var(--cobalt); }
.sys-list { display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; margin: 0; font-size: 12px; }
.sys-list dt { color: #55534e; }
.sys-list dd { margin: 0; }
.sys-note { margin: 14px 0 0; text-align: center; font: 19px/1 var(--f-bit); color: #061fa3; }
.you { margin: 10px; padding: 12px; min-height: 120px; background: #fff; border: 2px inset #eee; font: 12px/1.6 var(--f-mono); white-space: pre-wrap; }

.statusbar {
  position: absolute; z-index: 200; inset: auto 0 0 0; height: var(--statusbar);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 14px; border-top: 1px solid rgba(236, 232, 222, .14);
  background: #050506; color: var(--grey-1); font: 11px/1 var(--f-mono); letter-spacing: .02em;
}
#hint { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#hint.is-meta { color: var(--bone); }

.boot {
  position: fixed; inset: 0; z-index: 9500; padding: 7vh 7vw;
  background: #000; color: var(--phosphor-blue);
  font: 22px/1.25 var(--f-bit);
  text-shadow: 0 0 6px rgba(120, 170, 255, .6), 1px 0 0 rgba(95, 225, 255, .3), -1px 0 0 rgba(90, 43, 255, .3);
}
.boot pre { margin: 0; font: inherit; white-space: pre-wrap; }
.boot-skip { position: absolute; left: 7vw; bottom: 6vh; margin: 0; color: var(--grey-2); font-size: 18px; }
.boot.is-off { animation: crt-off .55s cubic-bezier(.7, 0, .9, .4) forwards; }
@keyframes crt-off {
  0% { transform: scale(1, 1); filter: brightness(1); }
  55% { transform: scale(1, .004); filter: brightness(4); background: #e9f1ff; }
  100% { transform: scale(0, .004); opacity: 0; }
}
.desk.is-waking { animation: crt-on .6s var(--ease-out) both; }
@keyframes crt-on { from { opacity: 0; transform: scaleY(.01); filter: brightness(3); } 60% { opacity: 1; transform: scaleY(1.01); } to { transform: none; filter: none; } }

#installed { color: var(--grey-1); }
.icon-prompt { transition: opacity 2.6s var(--ease-out); }
.icon-prompt .px { --px-fill: #e7e1d3; --px-accent: #55545a; filter: none; opacity: .9; }
.icon-prompt.is-arriving { opacity: 0; transition: none; }

.win-prompt { --x: 18vw; --y: 16vh; --w: min(470px, 40vw); }
.win-prompt .win-body { padding: 0; background: var(--paper); }
.pc { position: relative; padding: 18px 22px 16px 40px; color: #1a1a1d;
  background: repeating-linear-gradient(to bottom, transparent 0 23px, rgba(31, 51, 255, .09) 23px 24px); }
.pc::before { content: ""; position: absolute; left: 26px; top: 0; bottom: 0; width: 1px; background: rgba(31, 51, 255, .25); }
.pc-head { display: flex; justify-content: space-between; margin: 0 0 14px; font: 11px/1 var(--f-mono); letter-spacing: .14em; color: #55545a; }
.pc-head b { font-weight: 500; color: #1a1a1d; }
.pc-script { margin: 0; white-space: pre-wrap; font: italic 15px/24px var(--f-read); }
.pc-hand { margin: 14px 0 0 38%; font: 24px/1 var(--f-hand); color: #55545a; transform: rotate(-3deg); }
.pc-more { margin: 14px 0 0; text-align: right; font: 11px var(--f-mono); }
.pc-more a { color: #55545a; text-decoration-style: dotted; }
.pc-more a:hover { color: var(--cobalt); }

.ghost {
  position: absolute; left: 0; top: 0; z-index: 280; pointer-events: none;
  opacity: 0; transition: opacity 1.6s ease, transform .1s linear; will-change: transform;
}
.ghost.is-on { opacity: .26; }
.ghost.is-gliding { transition: opacity 1.6s ease, transform 1.6s cubic-bezier(.45, 0, .2, 1); }
.ghost.is-ahead { transition: opacity 2s ease; }
.ghost.is-call.is-on { opacity: .6; }
.ghost.is-ahead.is-on { opacity: .14; }
.ghost svg { display: block; }
.ghost-ring {
  position: absolute; z-index: 279; width: 18px; height: 18px; margin: -9px 0 0 -9px; pointer-events: none;
  border: 1px solid var(--bone); border-radius: 50%; opacity: 0; animation: ghost-ring .6s ease-out;
}
@keyframes ghost-ring { 0% { opacity: .35; transform: scale(.3); } 100% { opacity: 0; transform: scale(1.4); } }

.smudges { position: absolute; inset: 0; z-index: 260; pointer-events: none; overflow: hidden; }
.smudge {
  position: absolute; width: 54px; height: 62px; margin: -31px 0 0 -27px;
  fill: none; stroke: var(--bone); stroke-width: .7; opacity: .075;
  transform: rotate(var(--r));
  -webkit-mask-image: radial-gradient(closest-side, #000 40%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 40%, transparent 100%);
}

@media (max-width: 820px), (max-height: 520px) {
  body.env-desk { overflow: auto; }
  .desk { height: auto; min-height: 100svh; padding-bottom: calc(var(--statusbar) + 24px); }
  .desk::after { position: fixed; }
  .menubar { position: sticky; }
  .mb-np, .mb-vis { display: none; }
  .menu-btn { padding: 0 9px; }
  .menu-mark span { display: none; }
  .wallpaper { position: relative; inset: auto; height: 118vw; max-height: 620px; }
  .wp-who { top: 20px; left: 16px; font-size: 27vw; }
  .wp-who span + span { margin-left: 10vw; }
  .wp-daniel { top: calc(20px + 27vw * 1.48 - 11vw); left: 26vw; font-size: 30vw; }
  .wp-aside { top: auto; bottom: 12px; left: 16px; }
  .wp-texture { width: 130vw; height: 55%; opacity: .5; }
  .wp-fig { display: none; }
  .sysinfo { position: relative; left: auto; bottom: auto; margin: 0 16px 18px; }
  .icons {
    position: relative; inset: auto; display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 4px; margin: 0 8px 18px;
  }
  .icon { width: auto; }
  .windows { position: relative; inset: auto; display: flex; flex-direction: column; gap: 18px; padding: 0 16px; pointer-events: auto; }
  .win { position: relative; left: auto !important; top: auto !important; width: auto !important; }
  .win-bar { cursor: default; }
  .pane { min-height: 0; }
  .question-box { margin-left: 0; }
  .statusbar { position: fixed; }
}

@media (prefers-reduced-motion: reduce) {
  .wp-daniel { animation: none; }
}
