/* 2000.css - Windows 2000 chrome + shell.
   Bevel geometry adapted from 98.css (MIT, jdan). Retoned to the Win2K
   "Windows Standard" scheme: 3D face is #D4D0C8, not 98's #C0C0C0, and the
   active caption is a real gradient from #0A246A to #A6CAF0. Those two
   changes are most of what separates 2000 from 98 at a glance. */

@font-face {
  font-family: "Pixelated MS Sans Serif";
  font-style: normal; font-weight: 400;
  src: url(fonts/ms_sans_serif.woff2) format("woff2"),
       url(fonts/ms_sans_serif.woff) format("woff");
}
@font-face {
  font-family: "Pixelated MS Sans Serif";
  font-style: normal; font-weight: 700;
  src: url(fonts/ms_sans_serif_bold.woff2) format("woff2"),
       url(fonts/ms_sans_serif_bold.woff) format("woff");
}

:root {
  --face:      #d4d0c8;
  --hilight:   #ffffff;
  --light:     #e8e4dc;
  --shadow:    #808080;
  --dkshadow:  #404040;
  --cap-a1:    #0a246a;
  --cap-a2:    #a6caf0;
  --cap-i1:    #808080;
  --cap-i2:    #c0c0c0;
  --sel:       #0a246a;
  --field:     #ffffff;
  --text:      #000000;
  --taskbar-h: 28px;

  --raised: inset -1px -1px var(--dkshadow), inset 1px 1px var(--hilight),
            inset -2px -2px var(--shadow),   inset 2px 2px var(--light);
  --pressed: inset -1px -1px var(--hilight), inset 1px 1px var(--dkshadow),
             inset -2px -2px var(--light),   inset 2px 2px var(--shadow);
  --sunken: inset -1px -1px var(--hilight), inset 1px 1px var(--shadow),
            inset -2px -2px var(--light),   inset 2px 2px var(--dkshadow);
  --thin-raised: inset -1px -1px var(--shadow), inset 1px 1px var(--hilight);
  --thin-sunken: inset -1px -1px var(--hilight), inset 1px 1px var(--shadow);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  height: 100%; margin: 0; padding: 0; overflow: hidden;
  font-family: "Pixelated MS Sans Serif", Tahoma, sans-serif;
  font-size: 11px; -webkit-font-smoothing: none;
  color: var(--text);
  user-select: none; -webkit-user-select: none;
}

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

#desktop {
  position: fixed; inset: 0 0 var(--taskbar-h) 0;
  background: #3a6ea5 url(../assets/bliss.png) center / cover no-repeat;
  overflow: hidden;
}

.icon {
  position: absolute; width: 76px; padding: 4px 2px 2px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  cursor: default; text-align: center;
}
.icon img { width: 32px; height: 32px; image-rendering: pixelated; pointer-events: none; }
.icon span {
  color: #fff; padding: 1px 3px; line-height: 13px;
  text-shadow: 1px 1px 1px rgba(0,0,0,.9);
  word-break: break-word;
}
.icon.selected img { filter: brightness(.65) saturate(1.6) hue-rotate(-15deg); }
.icon.selected span { background: var(--sel); text-shadow: none; outline: 1px dotted #fff; }
.icon.dragging { opacity: .7; }

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

#windows { position: fixed; inset: 0 0 var(--taskbar-h) 0; pointer-events: none; }

.window {
  position: absolute; pointer-events: auto;
  display: flex; flex-direction: column;
  background: var(--face); box-shadow: var(--raised);
  padding: 3px; min-width: 160px; min-height: 80px;
}
.window.minimized { display: none; }
.window.maximized { inset: 0 !important; width: auto !important; height: auto !important; }

.title-bar {
  flex: 0 0 18px; display: flex; align-items: center; gap: 3px;
  padding: 0 2px 0 3px; cursor: default;
  background: linear-gradient(90deg, var(--cap-a1), var(--cap-a2));
}
.window.inactive .title-bar { background: linear-gradient(90deg, var(--cap-i1), var(--cap-i2)); }
.title-bar img { width: 16px; height: 16px; image-rendering: pixelated; }
.title-bar-text {
  flex: 1 1 auto; color: #fff; font-weight: 700; letter-spacing: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.title-bar-controls { display: flex; gap: 2px; }
.title-bar-controls button {
  width: 16px; height: 14px; min-width: 0; padding: 0;
  display: grid; place-items: center;
}
.title-bar-controls button:last-child { margin-left: 2px; }
.title-bar-controls svg { display: block; shape-rendering: crispEdges; }

.window-body {
  flex: 1 1 auto; margin: 2px 0 0; overflow: auto;
  background: var(--face);
}
.window-body.field { background: var(--field); box-shadow: var(--sunken); }

.resize-grip {
  position: absolute; right: 0; bottom: 0; width: 16px; height: 16px;
  cursor: nwse-resize;
}
.window.maximized .resize-grip { display: none; }

.status-bar { flex: 0 0 auto; display: flex; gap: 1px; margin-top: 2px; }
.status-bar-field { flex: 1 1 auto; box-shadow: var(--thin-sunken); padding: 2px 4px; }

/* --------------------------------------------------------------- controls */

button {
  font: inherit; -webkit-font-smoothing: none; color: var(--text);
  background: var(--face); border: none; border-radius: 0;
  box-shadow: var(--raised); min-width: 75px; min-height: 23px;
  padding: 0 12px; cursor: default;
}
button:active:not(:disabled) { box-shadow: var(--pressed); }
button:focus { outline: 1px dotted #000; outline-offset: -4px; }
button:disabled { color: var(--shadow); text-shadow: 1px 1px 0 var(--hilight); }
button.default { box-shadow: var(--raised), inset 0 0 0 1px var(--dkshadow); }

input[type=text], textarea, select {
  font: inherit; background: var(--field); border: none; border-radius: 0;
  box-shadow: var(--sunken); padding: 3px 4px; outline: none;
}

a { color: #0000ee; }
a:focus { outline: 1px dotted #0000ee; }

/* Scrollbars. Chromium takes the ::-webkit- rules and gets real Win2K
   scrollbars; Firefox only has the two standard properties, so it gets the
   right colours and its own shape. Do not let anything here become the only
   way something is legible. */
* { scrollbar-width: auto; scrollbar-color: var(--face) var(--light); }
::-webkit-scrollbar { width: 16px; height: 16px; }
::-webkit-scrollbar-corner { background: var(--face); }
::-webkit-scrollbar-track {
  background-color: var(--light);
  background-image: linear-gradient(45deg, var(--face) 25%, transparent 25%,
    transparent 75%, var(--face) 75%), linear-gradient(45deg, var(--face) 25%,
    transparent 25%, transparent 75%, var(--face) 75%);
  background-size: 2px 2px; background-position: 0 0, 1px 1px;
}
::-webkit-scrollbar-thumb { background: var(--face); box-shadow: var(--raised); }
::-webkit-scrollbar-button:vertical:start   { height: 16px; background: var(--face); box-shadow: var(--raised); }
::-webkit-scrollbar-button:vertical:end     { height: 16px; background: var(--face); box-shadow: var(--raised); }
::-webkit-scrollbar-button:horizontal:start { width: 16px; background: var(--face); box-shadow: var(--raised); }
::-webkit-scrollbar-button:horizontal:end   { width: 16px; background: var(--face); box-shadow: var(--raised); }

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

#taskbar {
  position: fixed; left: 0; right: 0; bottom: 0; height: var(--taskbar-h);
  display: flex; align-items: center; gap: 3px; padding: 2px;
  background: var(--face); box-shadow: inset 0 1px var(--hilight);
  z-index: 9000;
}

#start-button {
  flex: 0 0 auto; min-width: 0; height: 22px; padding: 0 6px 0 4px;
  display: flex; align-items: center; gap: 4px; font-weight: 700;
}
#start-button.open { box-shadow: var(--pressed); }
#start-button img { width: 16px; height: 16px; image-rendering: pixelated; }

#taskbar-sep { flex: 0 0 4px; height: 20px; box-shadow: var(--thin-sunken); }

#tasks { flex: 1 1 auto; display: flex; gap: 3px; overflow: hidden; }
.task-button {
  flex: 0 1 160px; min-width: 40px; height: 22px; padding: 0 6px;
  display: flex; align-items: center; gap: 4px;
  text-align: left; overflow: hidden;
}
.task-button img { width: 16px; height: 16px; flex: 0 0 16px; image-rendering: pixelated; }
.task-button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-button.active { box-shadow: var(--pressed); font-weight: 700; }

#tray {
  flex: 0 0 auto; height: 22px; padding: 0 6px; display: flex;
  align-items: center; gap: 6px; box-shadow: var(--thin-sunken);
}
#tray img { width: 16px; height: 16px; cursor: default; image-rendering: pixelated; }
#clock { min-width: 50px; text-align: center; }

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

#start-menu {
  position: fixed; left: 2px; bottom: var(--taskbar-h); z-index: 9500;
  display: none; background: var(--face); box-shadow: var(--raised);
  padding: 3px; padding-left: 24px; min-width: 180px;
}
#start-menu.open { display: block; }
#start-menu::before {
  content: ""; position: absolute; left: 3px; top: 3px; bottom: 3px; width: 21px;
  background: linear-gradient(0deg, var(--cap-a2), var(--cap-a1));
}
#start-menu .banner {
  position: absolute; left: 3px; bottom: 6px; width: 21px;
  color: #fff; font-weight: 700; font-size: 15px; letter-spacing: 1px;
  writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap;
}

.menu { list-style: none; margin: 0; padding: 0; }
.menu li { position: relative; }
.menu-item {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 20px 4px 4px; white-space: nowrap; cursor: default;
}
.menu-item img { width: 16px; height: 16px; flex: 0 0 16px; image-rendering: pixelated; }
.menu-item:hover, .menu li.open > .menu-item { background: var(--sel); color: #fff; }
.menu-item.has-sub::after {
  content: ""; position: absolute; right: 5px; top: 50%;
  border: 4px solid transparent; border-left-color: currentColor;
  margin-top: -4px;
}
.menu-sep { height: 0; margin: 3px 2px; box-shadow: var(--thin-sunken); }
.submenu {
  display: none; position: absolute; left: 100%; top: -3px; z-index: 1;
  background: var(--face); box-shadow: var(--raised); padding: 3px; min-width: 150px;
}
.menu li:hover > .submenu,
.menu li.open > .submenu { display: block; }

/* ---------------------------------------------------------------- dialogs */

#modal-layer {
  position: fixed; inset: 0; z-index: 9800; display: none;
}
#modal-layer.open { display: block; }
.dialog { min-width: 300px; max-width: 420px; }
.dialog .window-body { display: flex; gap: 12px; padding: 14px 12px 8px; overflow: visible; }
.dialog .dialog-icon { width: 32px; height: 32px; flex: 0 0 32px; image-rendering: pixelated; }
.dialog .dialog-text { line-height: 15px; white-space: pre-wrap; }
.dialog .dialog-buttons {
  display: flex; justify-content: center; gap: 8px; padding: 4px 12px 12px;
}

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

#boot {
  position: fixed; inset: 0; z-index: 10000; background: #000;
  color: #c0c0c0; font-family: "Courier New", monospace; font-size: 15px;
  line-height: 1.35; padding: 24px 32px; white-space: pre; overflow: hidden;
  cursor: default;
}
#boot .amber { color: #d8b400; }
#boot .bright { color: #fff; }

#splash {
  position: fixed; inset: 0; z-index: 10000; background: #000;
  display: grid; place-items: center; gap: 0;
}
#splash .splash-inner { display: flex; flex-direction: column; align-items: center; gap: 28px; }
#splash img { width: min(46vw, 420px); }
#splash .bar {
  width: min(46vw, 420px); height: 14px; background: #000;
  box-shadow: var(--sunken); overflow: hidden;
}
#splash .bar i {
  display: block; height: 100%; width: 100%;
  background: repeating-linear-gradient(90deg,
    var(--cap-a2) 0 14px, transparent 14px 18px);
  background-size: 90px 100%;
  animation: splashbar 1.1s linear infinite;
}
@keyframes splashbar { from { background-position: -90px 0; } to { background-position: 0 0; } }
#splash .legend { color: #fff; font-size: 12px; letter-spacing: 1px; }

#shutdown {
  position: fixed; inset: 0; z-index: 10000; background: #000;
  display: grid; place-items: center; cursor: default;
}
#shutdown p {
  color: #d8b400; font-family: "Courier New", monospace;
  font-size: clamp(16px, 3.4vw, 34px); text-align: center; margin: 0;
}

/* ----------------------------------------------------------------- apps */

.doc {
  padding: 16px 20px; background: var(--field); min-height: 100%;
  font-family: Tahoma, Verdana, sans-serif; font-size: 13px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; color: #111; user-select: text;
}
.doc h1 { font-size: 20px; margin: 0 0 4px; }
.doc h2 { font-size: 15px; margin: 20px 0 4px; border-bottom: 1px solid #ccc; }
.doc h3 { font-size: 13px; margin: 14px 0 2px; }
.doc p, .doc li { margin: 4px 0; }
.doc hr { border: none; border-top: 1px solid #ccc; margin: 14px 0; }
.doc .actions { margin: 0 0 14px; padding: 0 0 12px; border-bottom: 1px solid #ccc; }

.listing { padding: 6px; display: flex; flex-wrap: wrap; gap: 4px; align-content: flex-start; }
.listing .icon { position: static; }
.listing .icon span { color: var(--text); text-shadow: none; }
.listing .icon.selected span { color: #fff; }
