/* The old office PC: a 3D maze screensaver, and the Windows chrome around it. */
:root {
  --face: #c0c0c0; --hi: #ffffff; --lite: #dfdfdf; --shade: #808080; --dark: #0a0a0a;
  --navy: #000080; --ui: 13px/1.35 Tahoma, "MS Sans Serif", Geneva, Verdana, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #000; overflow: hidden; overscroll-behavior: none; }
body { font: var(--ui); color: #000; -webkit-tap-highlight-color: transparent; }
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
#gl.point { cursor: pointer; }
#gl.grab { cursor: grabbing; }
#fade { position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity .45s linear; }
#fade.on { opacity: 1; }
#map { position: fixed; left: max(10px, env(safe-area-inset-left)); top: max(10px, env(safe-area-inset-top)); pointer-events: none; display: none; image-rendering: pixelated; }
#map.on { display: block; }

/* Windows 95 parts */
.w95-btn { font: var(--ui); color: #000; background: var(--face); border: 0; border-radius: 0; padding: 4px 14px; min-height: 26px; cursor: pointer;
  box-shadow: inset -1px -1px var(--dark), inset 1px 1px var(--hi), inset -2px -2px var(--shade), inset 2px 2px var(--lite); }
.w95-btn:active, .w95-btn.down { box-shadow: inset -1px -1px var(--hi), inset 1px 1px var(--dark), inset -2px -2px var(--lite), inset 2px 2px var(--shade); padding: 5px 13px 3px 15px; }
.w95-btn:focus-visible { outline: 1px dotted #000; outline-offset: -5px; }
.w95-sunken { background: #fff; box-shadow: inset -1px -1px var(--hi), inset 1px 1px var(--shade), inset -2px -2px var(--lite), inset 2px 2px var(--dark); }
.w95-win { background: var(--face); padding: 3px; box-shadow: inset -1px -1px var(--dark), inset 1px 1px var(--lite), inset -2px -2px var(--shade), inset 2px 2px var(--hi); }
.w95-title { display: flex; align-items: center; gap: 6px; height: 24px; padding: 0 3px 0 6px; background: var(--navy); color: #fff; font-weight: 700; user-select: none; }
.w95-title span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w95-title .x { width: 20px; min-height: 18px; height: 18px; padding: 0; font: 700 15px/16px Tahoma, Verdana, sans-serif; }
.w95-title .x:active { padding: 1px 0 0 1px; }
.w95-group { border: 0; margin: 0; padding: 14px 10px 10px; position: relative; min-width: 0;
  box-shadow: inset -1px -1px var(--hi), inset 1px 1px var(--shade), inset -2px -2px var(--shade), inset 2px 2px var(--hi); }
.w95-group legend { position: absolute; top: -8px; left: 8px; padding: 0 3px; background: var(--face); }
.w95-veil { position: fixed; inset: 0; display: grid; place-items: center; padding: max(8px, env(safe-area-inset-top)) 8px max(8px, env(safe-area-inset-bottom)); z-index: 20; }
.w95-veil[hidden] { display: none; }

/* corner button and the arrow keys */
.corner { position: fixed; top: max(10px, env(safe-area-inset-top)); right: max(10px, env(safe-area-inset-right)); z-index: 5; }
#pad { position: fixed; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 5;
  display: grid; grid-template: 44px 44px / 44px 44px 44px; gap: 3px; opacity: 0; pointer-events: none; transition: opacity .35s; }
#pad.on { opacity: 1; pointer-events: auto; }
#pad .key { padding: 0; min-height: 0; width: 44px; height: 44px; display: grid; place-items: center; touch-action: manipulation; }
#pad .key:active, #pad .key.down { padding: 1px 0 0 1px; }
#pad .up { grid-area: 1 / 2; } #pad .left { grid-area: 2 / 1; } #pad .down { grid-area: 2 / 2; } #pad .right { grid-area: 2 / 3; }
#pad i { width: 0; height: 0; border: 7px solid transparent; }
#pad .up i { border-bottom: 9px solid #000; border-top: 0; margin-top: -4px; }
#pad .down i { border-top: 9px solid #000; border-bottom: 0; margin-top: 4px; }
#pad .left i { border-right: 9px solid #000; border-left: 0; margin-left: -4px; }
#pad .right i { border-left: 9px solid #000; border-right: 0; margin-left: 4px; }

/* loading: the maze being drawn on a black screen */
#loader { position: fixed; inset: 0; z-index: 40; background: #000; display: grid; place-content: center; justify-items: center; gap: 22px; transition: opacity .5s; }
#loader.gone { opacity: 0; pointer-events: none; }
#ld-maze { width: min(56vw, 46vh, 300px); height: min(56vw, 46vh, 300px); }
.ld-bar { width: min(56vw, 46vh, 300px); height: 20px; padding: 4px; }
.ld-fill { height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--navy) 0 9px, transparent 9px 11px); transition: width .25s; }

/* settings */
.dlg { width: min(620px, 100%); max-height: 100%; display: flex; flex-direction: column; }
.dlg-body { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 12px; padding: 16px 10px 10px; min-height: 0; }
.walls { display: flex; flex-direction: column; min-height: 0; }
.list { list-style: none; margin: 0; padding: 2px; height: min(330px, 52vh); overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.list li { display: flex; align-items: center; gap: 8px; padding: 3px 4px; cursor: pointer; user-select: none; }
.list li img { width: 56px; height: 32px; object-fit: contain; background: #000; flex: none; }
.list li .nm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list li .cl { color: var(--shade); font-size: 11px; white-space: nowrap; }
.list li:hover, .list li:focus-visible, .list li[aria-selected="true"] { background: var(--navy); color: #fff; outline: none; }
.list li:hover .cl, .list li:focus-visible .cl, .list li[aria-selected="true"] .cl { color: #c8c8ff; }
.dlg-side { display: flex; flex-direction: column; gap: 14px; }
.opts { display: grid; gap: 8px; }
.opts label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.opts input { margin: 0; width: 14px; height: 14px; accent-color: #000; }
.dlg-btns { display: grid; gap: 6px; }
.dlg-btns .w95-btn { min-width: 84px; }
.dlg-btns.end { display: flex; justify-content: flex-end; padding: 6px 10px 10px; }
@media (max-width: 560px) {
  .dlg-body { grid-template-columns: minmax(0, 1fr); }
  .list { height: min(300px, 46svh); }
  .dlg-side { flex-direction: row; align-items: flex-start; justify-content: space-between; }
  .opts { grid-template-columns: auto; }
}

/* about */
.about { width: min(440px, 100%); }
.about-body { display: flex; gap: 14px; padding: 16px 14px 6px; }
.about-icon { flex: none; width: 34px; height: 34px; margin-top: 2px; background:
  linear-gradient(#000080, #000080) 4px 4px / 26px 18px no-repeat, linear-gradient(var(--shade), var(--shade)) 0 0 / 34px 26px no-repeat, linear-gradient(var(--shade), var(--shade)) 10px 28px / 14px 6px no-repeat; }
.about-text h2 { margin: 0 0 2px; font: 700 15px/1.3 Tahoma, Verdana, sans-serif; }
.about-text p { margin: 0 0 10px; }
.about-text a { color: var(--navy); }

/* case study window */
.study { width: min(980px, 100%); height: 100%; max-height: calc(100svh - 16px); display: flex; flex-direction: column; }
.study-scroll { flex: 1; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; margin-top: 3px; padding: 16px 18px 26px; }
.study-client { margin: 0 0 8px; font-size: 11px; letter-spacing: .08em; color: var(--shade); }
#study-box { --ab-fg: #000; --ab-muted: #555; --ab-accent: var(--navy); --ab-chrome: 96px; }
#study-box .ab-lede { font-size: 15px; }
#study-box .ab-heading { font-weight: 700; border-bottom: 1px solid var(--shade); padding-bottom: 3px; }
#study-box .ab-text { max-width: 70ch; }
@media (max-width: 560px) { .w95-veil { padding: max(6px, env(safe-area-inset-top)) 4px max(6px, env(safe-area-inset-bottom)); } .study-scroll { padding: 12px 10px 22px; } .study { max-height: calc(100svh - 12px); } }
