/* bonzi.jimhasadhd.fyi: a Windows 95 desktop, hand-rolled. Nothing loads from anywhere else. */

:root {
  --desk: #008080;
  --face: #c0c0c0;
  --light: #ffffff;
  --lighter: #dfdfdf;
  --shadow: #808080;
  --dark: #000000;
  --title1: #000080;
  --title2: #1084d0;
  --title-inactive1: #808080;
  --title-inactive2: #b5b5b5;
  --ink: #000000;
  --paper: #ffffff;
  --buddy: #5f2fa0;
  --buddy-deep: #2e1357;
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
  background: var(--desk);
  color: var(--ink);
  font: 12px/1.4 "MS Sans Serif", "Microsoft Sans Serif", Tahoma, Arial, sans-serif;
  overflow: hidden;
}

#desktop {
  position: relative;
  height: calc(100% - 28px);
  overflow: auto;
  padding: 8px;
}

/* ----------------------------------------------------------------- bevels */

.btn {
  display: inline-block;
  min-width: 75px;
  padding: 4px 12px;
  background: var(--face);
  color: var(--ink);
  border: 2px solid;
  border-color: var(--light) var(--dark) var(--dark) var(--light);
  box-shadow: inset 1px 1px 0 var(--lighter), inset -1px -1px 0 var(--shadow);
  font: inherit;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
}
.btn:active {
  border-color: var(--dark) var(--light) var(--light) var(--dark);
  box-shadow: inset 1px 1px 0 var(--shadow), inset -1px -1px 0 var(--lighter);
  padding: 5px 11px 3px 13px;
}
.btn:focus-visible { outline: 1px dotted var(--dark); outline-offset: -5px; }
.btn[disabled] { color: var(--shadow); text-shadow: 1px 1px 0 var(--light); cursor: default; }
.btn[disabled]:active { border-color: var(--light) var(--dark) var(--dark) var(--light); padding: 4px 12px; }
.btn-big { padding: 10px 20px; font-size: 14px; font-weight: 700; }
.btn-big:active { padding: 11px 19px 9px 21px; }

.linkish {
  padding: 0;
  border: 0;
  background: none;
  color: var(--title1);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

/* ------------------------------------------------------------ desktop icons */

.icons {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  z-index: 1;
}
.icon {
  width: 84px;
  padding: 2px;
  border: 1px dotted transparent;
  background: none;
  color: #fff;
  font: inherit;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.icon svg { display: block; width: 32px; height: 32px; margin: 0 auto 4px; image-rendering: pixelated; }
.icon span { display: inline-block; padding: 0 2px; text-shadow: 1px 1px 0 #000; }
.icon:hover span, .icon:focus-visible span { background: var(--title1); }
.icon:focus-visible { outline: none; border-color: #fff; }

/* ----------------------------------------------------------------- windows */

.window {
  position: absolute;
  left: var(--x, 100px);
  top: var(--y, 100px);
  width: min(var(--w, 520px), calc(100% - 16px));
  padding: 3px;
  background: var(--face);
  border: 2px solid;
  border-color: var(--light) var(--dark) var(--dark) var(--light);
  box-shadow: inset 1px 1px 0 var(--lighter), inset -1px -1px 0 var(--shadow);
  z-index: 10;
}
.window[hidden] { display: none; }

.titlebar {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 18px;
  padding: 1px 2px 1px 4px;
  background: linear-gradient(90deg, var(--title-inactive1), var(--title-inactive2));
  color: var(--face);
  font-weight: 700;
  user-select: none;
  cursor: default;
  touch-action: none;
}
.window.front .titlebar { background: linear-gradient(90deg, var(--title1), var(--title2)); color: #fff; }
.titlebar .title { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tb-icon { width: 14px; height: 14px; background: var(--buddy); border: 1px solid #fff; border-radius: 50%; }
.tb-buttons { display: flex; gap: 2px; }
.tb {
  width: 16px;
  height: 14px;
  padding: 0;
  background: var(--face);
  color: var(--ink);
  border: 1px solid;
  border-color: var(--light) var(--dark) var(--dark) var(--light);
  box-shadow: inset 1px 1px 0 var(--lighter), inset -1px -1px 0 var(--shadow);
  font: 700 10px/1 "MS Sans Serif", "Microsoft Sans Serif", Tahoma, sans-serif;
  cursor: pointer;
}
.tb:active { border-color: var(--dark) var(--light) var(--light) var(--dark); }

.menubar { display: flex; gap: 12px; padding: 2px 6px; }
.menubar u { text-decoration: underline; }

.notepad {
  margin: 0;
  max-height: min(60vh, 520px);
  overflow: auto;
  padding: 6px 8px;
  background: var(--paper);
  border: 2px solid;
  border-color: var(--shadow) var(--light) var(--light) var(--shadow);
  box-shadow: inset 1px 1px 0 var(--dark), inset -1px -1px 0 var(--face);
  font: 13px/1.35 "Lucida Console", "Courier New", monospace;
  white-space: pre-wrap;
  user-select: text;
}

/* ------------------------------------------------------------------ wizard */

.wizard { display: flex; min-height: 300px; background: var(--paper); border: 1px solid var(--shadow); }
.wizard-art {
  flex: 0 0 200px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px 0 0;
  background: linear-gradient(180deg, var(--buddy) 0%, var(--buddy-deep) 100%);
}
.wizard-art img { display: block; width: 180px; height: auto; }
.wizard-body { flex: 1; padding: 14px 18px 10px; }
.wizard-body h1 { margin: 0 0 10px; font-size: 18px; font-weight: 700; line-height: 1.2; }
.wizard-body p { margin: 0 0 8px; }
.wizard-body .hint { color: #444; font-size: 11px; }
.dl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0 6px; }
.counter {
  padding: 6px 8px;
  background: #ffffe1;
  border: 1px solid var(--dark);
  font-weight: 700;
}
.wizard-footer {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding: 8px 4px 2px;
  border-top: 1px solid var(--shadow);
  box-shadow: 0 1px 0 var(--light) inset;
  margin-top: 6px;
}

/* ------------------------------------------------------------------ dialog */

.dialog { z-index: 30; }
.dialog-body { display: flex; gap: 14px; padding: 14px 12px 8px; }
.dialog-icon {
  flex: 0 0 32px;
  height: 32px;
  border-radius: 50%;
  background: #ffff00;
  border: 2px solid #000;
  color: #000;
  font: 700 22px/28px "Arial Black", Arial, sans-serif;
  text-align: center;
}
.dialog-body p { margin: 0 0 6px; }
.dialog .tag { font-size: 11px; font-style: italic; color: #3a1650; border-top: 1px dashed #999; padding-top: 4px; }
.dialog-buttons { display: flex; justify-content: center; gap: 8px; padding: 6px 0 8px; }

/* ----------------------------------------------------------------- taskbar */

#taskbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 28px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px;
  background: var(--face);
  border-top: 1px solid var(--light);
  box-shadow: 0 -1px 0 var(--lighter);
  z-index: 50;
}
#start { display: flex; align-items: center; gap: 4px; min-width: 0; padding: 2px 6px; font-weight: 700; }
#start[aria-expanded="true"] {
  border-color: var(--dark) var(--light) var(--light) var(--dark);
  box-shadow: inset 1px 1px 0 var(--shadow), inset -1px -1px 0 var(--lighter);
  background-image: repeating-conic-gradient(var(--light) 0 25%, var(--face) 0 50%);
  background-size: 2px 2px;
}
.tasks { flex: 1; display: flex; gap: 3px; overflow: hidden; }
.task { max-width: 170px; padding: 2px 6px; min-width: 0; text-align: left; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.task.active {
  border-color: var(--dark) var(--light) var(--light) var(--dark);
  box-shadow: inset 1px 1px 0 var(--shadow), inset -1px -1px 0 var(--lighter);
  background-image: repeating-conic-gradient(var(--light) 0 25%, var(--face) 0 50%);
  background-size: 2px 2px;
  font-weight: 700;
}
.tray {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 8px;
  border: 1px solid;
  border-color: var(--shadow) var(--light) var(--light) var(--shadow);
  white-space: nowrap;
}
.tray a { color: var(--ink); }
#clock { min-width: 38px; text-align: center; }

/* -------------------------------------------------------------- start menu */

.startmenu {
  position: fixed;
  left: 2px;
  bottom: 28px;
  display: flex;
  width: 240px;
  padding: 3px;
  background: var(--face);
  border: 2px solid;
  border-color: var(--light) var(--dark) var(--dark) var(--light);
  box-shadow: inset 1px 1px 0 var(--lighter), inset -1px -1px 0 var(--shadow);
  z-index: 60;
}
.startmenu[hidden] { display: none; }
.startmenu-band {
  flex: 0 0 24px;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  padding: 6px 0;
  background: linear-gradient(0deg, var(--title1), var(--shadow));
  color: #fff;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 16px;
  letter-spacing: 1px;
}
.startmenu-band b { font-size: 18px; }
.startmenu ul { flex: 1; margin: 0; padding: 0; list-style: none; }
.startmenu li.sep hr { margin: 3px 2px; border: 0; border-top: 1px solid var(--shadow); border-bottom: 1px solid var(--light); }
.startmenu [role="menuitem"] {
  display: block;
  width: 100%;
  padding: 6px 10px;
  background: none;
  border: 0;
  color: var(--ink);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.startmenu [role="menuitem"]:hover, .startmenu [role="menuitem"]:focus-visible { background: var(--title1); color: #fff; outline: none; }

/* --------------------------------------------------------------- shutdown */

#shutdown {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #000;
  color: #ff8c00;
  font: 700 clamp(18px, 4vw, 32px)/1.3 "Lucida Console", "Courier New", monospace;
  text-align: center;
  z-index: 100;
  cursor: pointer;
}
#shutdown[hidden] { display: none; }
#shutdown .small { font-size: 13px; font-weight: 400; color: #aaa; }

/* ---------------------------------------------------------------- narrow */

@media (max-width: 760px) {
  #desktop { padding: 8px 8px 16px; }
  .icons { position: static; flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 6px; margin-bottom: 10px; }
  .window { position: static; width: auto; margin: 0 0 12px; }
  .window.dialog { position: fixed; left: 8px; right: 8px; top: 20%; width: auto; }
  .wizard { flex-direction: column; }
  .wizard-art { flex-basis: auto; padding-top: 8px; }
  .wizard-art img { width: 140px; }
  #clock { display: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .window { transition: box-shadow 0.1s; }
}
