html, body.desk-page { height: 100%; }
body.desk-page { overflow: hidden; }

.room {
  --deskh: clamp(120px, 17.5vh, 190px);
  --guyw: calc(var(--deskh) * 3.05);
  --edge: clamp(10px, 5vw, 96px);
  position: relative;
  height: 100vh; height: 100dvh;
  display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) var(--deskh);
  overflow: hidden;
  background: linear-gradient(var(--wall), var(--room) 78%);
}
.spill {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(62% 58% at 50% 36%, rgba(141, 180, 255, .075), transparent 72%);
}
.warm {
  position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background:
    radial-gradient(34% 44% at 9% 88%, rgba(245, 167, 66, .2), transparent 70%),
    radial-gradient(60% 50% at 12% 100%, rgba(245, 167, 66, .1), transparent 75%);
  transition: opacity .5s;
}
.room.lamp-on .warm { opacity: 1; }

.rig {
  grid-row: 1;
  display: flex; flex-direction: column; align-items: center;
  min-width: 0; min-height: 0; padding: 16px 16px 0;
}
.monitor {
  position: relative; flex: 1; min-height: 0;
  width: min(1480px, 100%);
  padding: 9px;
  background: #0b0e13;
  border: 1px solid #1a212c; border-radius: 14px;
  box-shadow: 0 0 0 1px #040508, 0 30px 80px rgba(0, 0, 0, .6);
}
.screen {
  position: relative; height: 100%;
  display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden; border-radius: 7px;
  background: var(--screen);
}
.neck { width: 120px; height: calc(var(--deskh) * .2); background: linear-gradient(#0d1117, #090c11); border-inline: 1px solid #171d27; }
.foot { width: 300px; height: 7px; background: #0e1218; border: 1px solid #1a212c; border-bottom: 0; border-radius: 4px 4px 0 0; }

.bar {
  display: flex; align-items: center; gap: 14px;
  height: 38px; padding: 0 10px;
  border-bottom: 1px solid var(--line);
  background: #0c1017;
  font-size: 12px;
}
.brand { display: inline-flex; align-items: center; gap: 7px; flex: none; color: var(--text); text-decoration: none; font-weight: 500; }
.brand svg { width: 13px; height: 13px; fill: var(--amber); }
.tags { display: flex; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.tags::-webkit-scrollbar { display: none; }
.tags button {
  display: inline-flex; align-items: baseline; gap: 6px; flex: none;
  padding: 4px 9px; border-radius: 5px;
  font: 500 12px/1.4 var(--mono); color: var(--dim);
  transition: color .15s, background .15s;
}
.tags button kbd { font: 400 10px/1 var(--mono); color: var(--faint); }
.tags button:hover { color: var(--text); }
.tags button.on { color: var(--text); background: var(--panel-2); }
.tags button.on kbd { color: var(--amber); }
.bar-day { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex: 1; min-width: 0; }
.bar-line { color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-strip { --strip-h: 7px; flex: none; width: 190px; }
.bar-strip .strip-cells { gap: 1px; }
.bar-r { display: flex; align-items: center; gap: 10px; flex: none; }
.bar-clock { color: var(--dim); white-space: nowrap; }
.bar-clock b { font: 700 16px/1 var(--led); color: var(--text); letter-spacing: .02em; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px; border: 1px solid var(--line-2); border-radius: 5px;
  font: 500 11.5px/1.4 var(--mono); color: var(--dim); text-decoration: none; white-space: nowrap;
  transition: color .15s, border-color .15s, background .15s;
}
.chip:hover { color: var(--text); border-color: var(--dim); }
.chip[aria-pressed="true"] { color: var(--amber); border-color: rgba(245, 167, 66, .5); }
.chip.hot { background: var(--amber); border-color: var(--amber); color: #0a0e14; }
.chip.hot:hover { background: #ffbd66; border-color: #ffbd66; color: #0a0e14; }

.space {
  position: relative;
  display: grid; gap: 8px; padding: 8px;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  grid-auto-rows: minmax(0, 1fr);
  min-height: 0;
  background-image: radial-gradient(rgba(141, 180, 255, .07) 1px, transparent 1.4px);
  background-size: 18px 18px;
}
.space[data-n="0"], .space[data-n="1"] { grid-template-columns: minmax(0, 1fr); }
.space[data-n="3"] > .win:first-child { grid-row: span 2; }
.space[data-n="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.space[data-n="0"]::after {
  content: "nothing open. pick something from the bar up top.";
  place-self: center; font-size: 12.5px; color: var(--dim);
}

.win {
  display: grid; grid-template-rows: auto minmax(0, 1fr);
  min-width: 0; min-height: 0; overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line); border-radius: 9px;
  animation: win-in .2s ease-out;
}
.win.focus { border-color: #3b4b63; }
@keyframes win-in {
  from { transform: translateY(5px); }
  to { transform: none; }
}
.win-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 6px 5px 12px;
  border-bottom: 1px solid var(--line);
  font: 500 11.5px/1.4 var(--mono); color: var(--dim);
  user-select: none; -webkit-user-select: none;
}
.win-title { color: var(--text); }
.win.focus .win-title { color: var(--amber); }
.win-sub { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win-btns { display: flex; gap: 2px; }
.win-btns button { display: grid; place-items: center; width: 24px; height: 22px; border-radius: 4px; color: var(--faint); }
.win-btns button:hover { background: var(--panel-2); color: var(--text); }
.win-btns svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; }
.space[data-n="1"] .win-btns [data-act="main"], .win:first-child .win-btns [data-act="main"] { display: none; }
.win-body { min-height: 0; overflow: auto; container-type: inline-size; }

.status {
  display: grid; grid-template-columns: minmax(0, 1fr) calc(var(--guyw) * .34) minmax(0, 1fr);
  align-items: center;
  height: 34px; padding: 0 12px;
  border-top: 1px solid var(--line);
  background: #0c1017;
  font-size: 11.5px; color: var(--dim);
}
.mutter { justify-self: start; max-width: 100%; text-align: left; font: italic 400 11.5px/1.4 var(--mono); color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mutter::before { content: "> "; font-style: normal; color: var(--amber); }
.mutter:hover { color: var(--text); }
.status-feed { grid-column: 3; justify-self: end; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.boot {
  position: absolute; inset: 0; z-index: 30;
  display: grid; align-content: center; justify-content: center; gap: 4px;
  background: var(--screen);
  font-size: 12.5px; color: var(--dim);
}
.boot p { margin: 0; min-width: min(360px, 76vw); display: flex; justify-content: space-between; gap: 24px; visibility: hidden; }
.boot p.on { visibility: visible; }
.boot p:first-child { color: var(--text); }
.boot span { color: var(--amber); }

.tonight, .tape-app, .chart, .token, .term { grid-template-columns: minmax(0, 1fr); }
.tonight { display: grid; align-content: start; gap: clamp(14px, 2.6cqw, 26px); padding: clamp(18px, 4cqw, 40px); min-height: 100%; }
.title {
  margin: -6px 0 0;
  font: 900 clamp(46px, min(13cqw, 15vh), 132px)/.84 var(--led);
  letter-spacing: -.035em;
  color: var(--text);
}
.lede { margin: 0; max-width: 46ch; font: 400 clamp(14px, 1.9cqw, 17px)/1.5 var(--sans); color: #a9b3c2; }
.cta { display: flex; flex-wrap: wrap; gap: 8px; }

.tape-app { display: grid; grid-template-rows: minmax(0, 1fr) auto; height: 100%; }
.tape-more { display: block; padding: 9px 12px; border-top: 1px solid var(--line); font-size: 12px; color: var(--moon); text-decoration: none; }
.tape-more::after { content: " ->"; }
.tape-more:hover { color: var(--text); }

.chart { display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100%; }
.chart-top { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-bottom: 1px solid var(--line); }
.chips { display: flex; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex: none; padding: 4px 8px; border-radius: 5px; font: 500 11.5px/1.4 var(--mono); color: var(--dim); }
.chips button:hover { color: var(--text); }
.chips button.on { background: var(--panel-2); color: var(--text); }
.chart-find { display: flex; flex: none; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.chart-find input { width: 96px; padding: 4px 8px; background: transparent; border: 0; font-size: 11.5px; text-transform: uppercase; }
.chart-find input::placeholder { color: var(--faint); text-transform: none; }
.chart-find input:focus { outline: none; background: var(--panel-2); }
.chart-find button { padding: 4px 9px; border-left: 1px solid var(--line); font-size: 11.5px; color: var(--dim); }
.chart-find button:hover { color: var(--text); }
.chart-box { min-height: 220px; background: var(--screen); }

.lore { display: grid; grid-template-columns: minmax(170px, 230px) minmax(0, 1fr); height: 100%; }
.lore-list { list-style: none; margin: 0; padding: 6px; overflow: auto; border-right: 1px solid var(--line); }
.lore-list button { display: block; width: 100%; padding: 6px 8px; border-radius: 5px; text-align: left; font: 400 11.5px/1.4 var(--mono); color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lore-list button:hover { color: var(--text); }
.lore-list button.on { background: var(--panel-2); color: var(--text); }
.lore-read { overflow: auto; padding: clamp(16px, 4cqw, 34px); }
.lore-read h2 { margin: 6px 0 16px; font: 600 clamp(22px, 4.4cqw, 34px)/1.1 var(--sans); letter-spacing: -.015em; color: var(--text); }
.lore-read p { margin: 0 0 12px; max-width: 58ch; font: 400 15px/1.6 var(--sans); color: #b3bccb; }
.lore-read dl { margin: 0 0 12px; display: grid; gap: 10px; max-width: 62ch; }
.lore-read dt { font: 500 12px/1.4 var(--mono); color: var(--moon); }
.lore-read dd { margin: 2px 0 0; font: 400 14.5px/1.5 var(--sans); color: #b3bccb; }
.lore-read ul { margin: 0 0 12px; padding: 0; list-style: none; display: grid; gap: 8px; }
.lore-read li a { font: 400 14px/1.4 var(--sans); color: var(--moon); text-underline-offset: 3px; }
.lore-read li a:hover { color: var(--text); }
.lore-read .aside { margin-top: 20px; padding-top: 12px; border-top: 1px solid var(--line); font: italic 400 12.5px/1.5 var(--mono); color: var(--amber); }
.lore-read .aside::before { content: "> "; font-style: normal; }
@container (max-width: 520px) {
  .lore { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .lore-list { display: flex; gap: 2px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .lore-list button { width: auto; }
}

.token { display: grid; align-content: start; gap: 16px; padding: clamp(16px, 4cqw, 34px); }
.tk { margin: -4px 0 0; font: 900 clamp(34px, 9cqw, 64px)/.9 var(--led); letter-spacing: -.02em; color: var(--amber); }
.tk-line { margin: 0; font: 400 15px/1.5 var(--sans); color: #a9b3c2; }
.ca { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--screen); }
.ca-label { flex: none; font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--faint); }
.ca code { flex: 1; min-width: 0; font: 400 12.5px/1.4 var(--mono); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ca.unset code { color: var(--dim); }
.tk-links { display: flex; flex-wrap: wrap; gap: 8px; }
.tk-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.tk-facts div { padding: 9px 11px; border: 1px solid var(--line); border-radius: 7px; }
.tk-facts dt { font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--faint); }
.tk-facts dd { margin: 3px 0 0; font-size: 12.5px; color: var(--text); }
.fine { margin: 0; max-width: 62ch; font: 400 12px/1.5 var(--sans); color: var(--faint); }
@container (max-width: 420px) {
  .tk-facts { grid-template-columns: minmax(0, 1fr); }
}

.term { display: grid; grid-template-rows: minmax(0, 1fr) auto; height: 100%; font-size: 12.5px; }
.term-out { overflow: auto; padding: 12px 12px 4px; }
.term-out p { margin: 0 0 3px; white-space: pre-wrap; color: #a9b3c2; }
.term-out p.cmd { color: var(--text); }
.term-out p.cmd::before { content: "$ "; color: var(--amber); }
.term-in { display: flex; align-items: center; gap: 8px; padding: 8px 12px 10px; }
.term-in label { flex: none; color: var(--amber); }
.term-in input { flex: 1; min-width: 0; background: transparent; border: 0; padding: 0; caret-color: var(--amber); }
.term-in input:focus { outline: none; }

.desk {
  grid-row: 2; position: relative;
  border-top: 1px solid #1c2430;
  background:
    radial-gradient(50% 120% at 50% 0%, rgba(141, 180, 255, .07), transparent 70%),
    linear-gradient(#0c1016, #07090d 72%);
}
.desk > * { position: absolute; }

.keys {
  left: 50%; top: calc(var(--deskh) * .1);
  width: calc(var(--guyw) * .84); height: calc(var(--deskh) * .13);
  transform: translateX(-50%) perspective(420px) rotateX(40deg);
  border: 1px solid #1f2936; border-radius: 4px;
  background-color: #0c1017;
  background-image: radial-gradient(rgba(141, 180, 255, .55) 1px, transparent 1.7px);
  background-size: 10px 6px; background-position: 3px 2px;
}
.mouse {
  left: calc(50% + var(--guyw) * .47); top: calc(var(--deskh) * .11);
  width: 20px; height: 13px;
  background: #10151d; border: 1px solid #263142; border-radius: 9px 9px 6px 6px;
}

.lamp { left: var(--edge); bottom: calc(var(--deskh) * .22); width: calc(var(--deskh) * .72); }
.lamp svg { display: block; width: 100%; overflow: visible; }
.l-base, .l-shade { fill: #121821; stroke: #2b3748; stroke-width: 1; }
.l-arm { fill: none; stroke: #232d3b; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.l-bulb { fill: #1a212c; transition: fill .3s; }
.lamp::after {
  content: ""; position: absolute; left: 28%; top: 32%; width: 180%; height: 110%;
  background: radial-gradient(50% 50% at 50% 60%, rgba(245, 167, 66, .32), transparent 72%);
  opacity: 0; pointer-events: none; transition: opacity .4s;
}
.lamp:hover .l-shade { stroke: #4a5c77; }
.room.lamp-on .l-bulb { fill: #ffd08a; }
.room.lamp-on .l-shade { fill: #1d1a14; stroke: #5b4526; }
.room.lamp-on .lamp::after { opacity: 1; }

.memo {
  left: calc(var(--edge) + var(--deskh) * 1.05); bottom: calc(var(--deskh) * .17);
  width: 104px; padding: 9px 10px 11px;
  background: #2c2817; color: #a8995c;
  font: italic 500 12px/1.35 var(--mono); text-align: left;
  transform: rotate(-5deg) skewX(-6deg);
  box-shadow: 0 6px 14px rgba(0, 0, 0, .5);
  transition: background .4s, color .4s, transform .2s;
}
.memo u { text-decoration-thickness: 1px; text-underline-offset: 3px; }
.memo:hover { transform: rotate(-3deg) skewX(-6deg) translateY(-3px); color: #d6c57a; }
.room.lamp-on .memo { background: #5a4d22; color: #f0dc8c; }

.mug { right: calc(var(--edge) + 190px); bottom: calc(var(--deskh) * .25); width: calc(var(--deskh) * .35); }
.mug svg { display: block; width: 100%; overflow: visible; }
.m-cup { fill: #121821; stroke: #263142; stroke-width: 1; }
.m-top { fill: #06080b; stroke: #263142; stroke-width: 1; }
.m-handle { fill: none; stroke: #263142; stroke-width: 4; }
.m-steam { fill: none; stroke: rgba(205, 213, 224, .22); stroke-width: 1.6; stroke-linecap: round; animation: steam 4.5s ease-in-out infinite; }
.m-steam + .m-steam { animation-delay: -2.2s; }
.mug:hover .m-cup { stroke: #3b4b63; }
.mug.sip .m-steam { stroke: rgba(245, 167, 66, .6); }
@keyframes steam {
  0% { opacity: 0; transform: translateY(5px); }
  40% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-9px); }
}

.cans { right: calc(var(--edge) + 112px); bottom: calc(var(--deskh) * .22); width: calc(var(--deskh) * .38); }
.cans svg { display: block; width: 100%; }
.cans rect { fill: #0f141c; stroke: #222c3a; stroke-width: 1; }

.phone {
  right: var(--edge); bottom: calc(var(--deskh) * .2);
  width: 92px; height: 52px; padding: 4px;
  background: #0e1219; border: 1px solid #263142; border-radius: 9px;
  transform: perspective(300px) rotateX(50deg) rotateZ(-10deg);
  box-shadow: 0 10px 16px rgba(0, 0, 0, .55);
  transition: border-color .2s;
}
.phone:hover { border-color: #3b4b63; }
.phone-screen { display: grid; align-content: center; justify-items: center; gap: 1px; height: 100%; border-radius: 5px; background: #070a0e; transition: background .5s; }
.phone-screen b { font: 700 15px/1 var(--led); color: var(--dim); transition: color .5s; }
.phone-screen i { font: normal 500 8.5px/1.2 var(--mono); color: var(--faint); white-space: nowrap; transition: color .5s; }
.phone.buzz .phone-screen { background: #101a2c; }
.phone.buzz .phone-screen b { color: var(--text); }
.phone.buzz .phone-screen i { color: var(--moon); }

.guy {
  position: absolute; left: 50%; bottom: -2px; z-index: 5;
  width: var(--guyw); transform: translateX(-50%);
  pointer-events: none;
  --look: 0;
}
.guy svg { display: block; width: 100%; overflow: visible; }
.g-skull { fill: #0a0d12; }
.g-hair { fill: #06080b; }
.g-band-lit { fill: none; stroke: rgba(141, 180, 255, .5); stroke-width: 11.5; stroke-linecap: round; }
.g-band { fill: none; stroke: #121821; stroke-width: 9; stroke-linecap: round; }
.g-cup { fill: #121821; stroke: rgba(141, 180, 255, .45); stroke-width: 1.2; }
.g-dot { fill: var(--amber); animation: blink 3.2s steps(1) infinite; }
.g-rim { fill: none; stroke: rgba(141, 180, 255, .72); stroke-width: 1.7; stroke-linecap: round; transition: stroke .5s; }
.g-glow { fill: none; stroke: rgba(141, 180, 255, .16); stroke-width: 9; stroke-linecap: round; filter: blur(4px); transition: stroke .5s; }
.g-chair { stroke: #232d3b; stroke-width: 1; }
.g-seam { fill: none; stroke: #161d28; stroke-width: 1.5; }
.g-edge { fill: none; stroke: rgba(141, 180, 255, .5); stroke-width: 1.5; stroke-linecap: round; }
.room.lamp-on .guy-body .g-rim:not(.g-rim-r) { stroke: rgba(245, 167, 66, .7); }
.room.lamp-on .guy-body .g-glow:not(.g-rim-r) { stroke: rgba(245, 167, 66, .2); }
.guy-head {
  transform-box: fill-box; transform-origin: 50% 100%;
  transform: translateX(calc(var(--look) * 9px)) rotate(calc(var(--look) * 5deg));
  transition: transform .8s cubic-bezier(.2, .7, .2, 1);
}
.guy-body { animation: breathe 5.5s ease-in-out infinite; }
@keyframes breathe {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-1.6px); }
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: .25; }
}

@media (max-width: 1180px) {
  .bar-strip { display: none; }
  .memo, .cans { display: none; }
}
@media (max-width: 820px) {
  .room { --deskh: 100px; --guyw: 250px; }
  .rig { padding: 6px 6px 0; }
  .monitor { padding: 5px; border-radius: 10px; }
  .neck { width: 80px; }
  .foot { width: 180px; height: 5px; }
  .lamp, .mug, .phone, .mouse { display: none; }
  .bar { gap: 8px; padding: 0 6px; }
  .brand span, .bar-day, .bar-clock, #radio { display: none; }
  .tags button kbd { display: none; }
  .space { display: block; padding: 5px; }
  .space .win { display: none; height: 100%; }
  .space .win.focus { display: grid; }
  .win-btns [data-act="main"] { display: none; }
  .status { grid-template-columns: minmax(0, 1fr); height: 28px; align-items: start; padding-top: 5px; }
  .status-gap, .mutter { display: none; }
  .status-feed { grid-column: 1; justify-self: center; }
  .lore { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .lore-list { display: flex; gap: 2px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .lore-list button { width: auto; }
}
