/* true-space: a System 7 desktop inside a Pravetz 82 monitor.
   Two layers: the Pravetz shell (yellow plastic, red accents) and the
   1-bit desktop on the glass. On narrow screens the shell is dropped
   and the windows stack in flow. */

:root {
  --plastic-hi: #efe3b0;
  --plastic: #d9c885;
  --plastic-lo: #a89550;
  --red: #c8102e;
  --key: #141414;
  --font-ui: "Geneva", "Verdana", "Tahoma", sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; background: #1a1a1a; color: #000; }
body { font: 13px/1.35 var(--font-ui); -webkit-font-smoothing: none; min-height: 100vh; display: flex; justify-content: center; align-items: center; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

/* ---------- Pravetz shell ---------- */

/* The shell has a fixed logical size (1000px wide) and app.js zooms it to fit
   the viewport, so the whole machine scales like an emulator window. */
.pravetz { width: 1000px; padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 14px; }

.monitor {
  width: 100%;
  background: linear-gradient(var(--plastic-hi), var(--plastic));
  border-radius: 18px 18px 10px 10px;
  padding: 22px 22px 14px;
  box-shadow: inset 0 2px 0 #fff8dc, inset 0 -3px 0 var(--plastic-lo), 0 10px 20px rgba(0,0,0,.6);
}

.glass { background: #000; border-radius: 10px; padding: 10px; box-shadow: inset 0 0 0 3px #2a2a2a, inset 0 0 30px #000; }

.strip { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font: 700 12px/1 "Arial Black", "Helvetica Neue", Arial, sans-serif; letter-spacing: 1.5px; color: #3b3b3b; }
.brand .red { background: var(--red); color: #fff; padding: 5px 9px; border-radius: 2px; }
.led { width: 9px; height: 9px; border-radius: 50%; background: #ff3b3b; box-shadow: 0 0 6px #ff3b3b; margin-left: 4px; }
.reset {
  margin-left: auto; background: var(--red); color: #fff;
  font: 700 11px/1 Arial, sans-serif; letter-spacing: 1px; padding: 9px 12px; border-radius: 3px;
  box-shadow: inset 0 -3px 0 #8a0b20, 0 2px 0 #7a5a30;
}
.reset:active { transform: translateY(2px); box-shadow: inset 0 -1px 0 #8a0b20; }

/* Keyboard nav */
.keys { width: 100%; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.key {
  min-width: 96px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  background: var(--key); color: #eee; border-radius: 4px; padding: 7px 10px 6px;
  font: 700 11px/1.2 Arial, sans-serif; letter-spacing: .5px;
  box-shadow: inset 0 1px 0 #444, inset 0 -3px 0 #000, 0 3px 0 #0a0a0a;
  transition: transform .06s, box-shadow .06s;
}
.key .cy { color: #ff4b4b; }
.key.red { background: var(--red); color: #fff; box-shadow: inset 0 1px 0 #ff8a8a, inset 0 -3px 0 #7a0b1d, 0 3px 0 #0a0a0a; }
.key.red .cy { color: #ffd0d0; }
.key:active, .key.on { background: #eee; color: #000; transform: translateY(2px); box-shadow: inset 0 1px 0 #fff, inset 0 -1px 0 #999, 0 1px 0 #0a0a0a; }
.key:active .cy, .key.on .cy { color: var(--red); }
.key.red:active { background: #ff8a8a; color: #000; }

/* ---------- Desktop ---------- */

.desktop {
  position: relative; height: 600px; overflow: hidden; border-radius: 6px;
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #000 25%, transparent 25%, transparent 75%, #000 75%),
    linear-gradient(45deg, #000 25%, transparent 25%, transparent 75%, #000 75%);
  background-size: 4px 4px; background-position: 0 0, 2px 2px;
  user-select: none;
}

.menubar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 1000; height: 20px;
  background: #fff; border-bottom: 1px solid #000;
  display: flex; align-items: center; gap: 18px; padding: 0 12px; font-weight: 700;
}
.menu-logo { font-family: "Arial Black", Arial, sans-serif; font-weight: 900; color: var(--red); }
.clock { margin-left: auto; font-weight: 400; }

.desk-icon { position: absolute; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; }
.desk-icon > span:last-child { background: #fff; padding: 0 3px; }
.desk-icon.hd { right: 26px; top: 34px; }
.desk-icon.trash { right: 26px; bottom: 22px; }
.disk { width: 34px; height: 20px; border: 1px solid #000; background: #fff; }
.can { width: 26px; height: 32px; border: 1px solid #000; border-radius: 0 0 3px 3px; background: repeating-linear-gradient(90deg, #fff 0 2px, #000 2px 3px); }

/* Windows */
.win { position: absolute; background: #fff; border: 1px solid #000; box-shadow: 2px 2px 0 #000; }
.win[hidden] { display: none; }
.title {
  height: 19px; border-bottom: 1px solid #000; position: relative; cursor: grab;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px;
  background: repeating-linear-gradient(0deg, #000 0 1px, #fff 1px 2px);
}
.title span { background: #fff; padding: 0 8px; }
.win.blur .title { background: #fff; }
.win.blur .title .close, .win.blur .title .zoom { visibility: hidden; }
.title .close, .title .zoom { position: absolute; top: 3px; width: 11px; height: 11px; border: 1px solid #000; background: #fff; padding: 0; }
.title .close { left: 8px; } .title .zoom { right: 8px; }
.title .close:hover { background: repeating-linear-gradient(45deg, #000 0 1px, #fff 1px 3px); }

.body { padding: 12px 14px; user-select: text; }
.body h1, .body h2 { margin: 0 0 6px; font-size: 18px; font-weight: 700; letter-spacing: -.2px; }
.body p { margin: 0 0 8px; font-size: 12px; }
.body a { color: #000; }
.btn {
  display: inline-block; border: 1px solid #000; border-radius: 8px; padding: 3px 14px; margin: 6px 6px 4px 2px;
  font-size: 12px; font-weight: 700; background: #fff; color: #000; text-decoration: none;
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px #000;
}
.btn.default { box-shadow: 0 0 0 2px #fff, 0 0 0 3px #000, 0 0 0 4px #fff, 0 0 0 5px #000; }
.btn:active { background: #000; color: #fff; }

.status { border-bottom: 1px solid #000; font-size: 10px; padding: 2px 10px; display: flex; justify-content: space-between; }
.icons { display: grid; grid-template-columns: repeat(auto-fill, 100px); gap: 10px 6px; padding: 12px 8px; }
.icon { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; }
.pic { width: 32px; height: 32px; border: 1px solid #000; background: #fff; position: relative; }
.pic.app { background: repeating-linear-gradient(45deg, #000 0 1px, #fff 1px 3px); }
.pic.folder { border-radius: 2px 2px 0 0; }
.pic.folder::before { content: ""; position: absolute; top: -5px; left: -1px; width: 14px; height: 5px; border: 1px solid #000; border-bottom: 0; background: #fff; }
.icon.sel .pic { background: #000; }
.icon.sel .name { background: #000; color: #fff; padding: 0 3px; }

/* ---------- Narrow screens: no shell, windows in flow ---------- */

@media (max-width: 720px) {
  body { display: block; }
  .pravetz { width: auto; padding: 0 0 96px; gap: 0; }
  .monitor { max-width: none; border-radius: 0; padding: 0; background: none; box-shadow: none; }
  .glass { padding: 0; border-radius: 0; box-shadow: none; }
  .strip { display: none; }
  .desktop { height: auto; min-height: 100vh; border-radius: 0; padding: 32px 12px 12px; }
  .desk-icon { display: none; }
  .win { position: static !important; width: auto !important; margin: 0 0 14px; }
  .win.blur .title { background: repeating-linear-gradient(0deg, #000 0 1px, #fff 1px 2px); }
  .win.blur .title .close { visibility: visible; }
  .title { cursor: default; }
  .keys {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 2000;
    background: #1a1a1a; padding: 8px; gap: 6px;
  }
  .key { min-width: 0; flex: 1 1 auto; padding: 8px 8px 7px; gap: 8px; }
  .menubar span:not(.clock) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .key { transition: none; }
}
