/* lockeout.com: an original Windows XP homage. No Microsoft assets.
   Without JS (or with ?plain) this is a plain document; desktop.js adds html.desktop. */

:root {
  --face: #ece9d8;
  --face-dark: #d4d0c8;
  --edge: #aca899;
  --select: #316ac5;
  --link: #1a4aa6;
  --title-hi: #3d95ff;
  --title: #0058ee;
  --title-lo: #003dd7;
  --frame: #0054e3;
  --task-pane: #6f8fdf;
  --task-head: #215dc6;
  --task-body: #d6dff7;
  --start: #3c9c34;
  --ui: Tahoma, Verdana, "Segoe UI", "DejaVu Sans", sans-serif;
  --display: "Trebuchet MS", "Lucida Grande", "Segoe UI", sans-serif;
  --mono: "Lucida Console", Monaco, "DejaVu Sans Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.55 var(--ui); color: #000; background: #fff; }
img { max-width: 100%; height: auto; }
a { color: var(--link); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 1px dotted #000; outline-offset: 2px;
}
h1, h2, h3 { font-family: var(--display); line-height: 1.2; }

/* ── Plain view ─────────────────────────────────────────────────────────── */
html:not(.desktop) body { background: var(--face); }
html:not(.desktop) .intro, html:not(.desktop) main, html:not(.desktop) .plain-footer {
  max-width: 820px; margin: 0 auto; padding: 0 20px;
}
html:not(.desktop) .intro { display: flex; gap: 16px; align-items: center; padding-top: 40px; padding-bottom: 8px; }
html:not(.desktop) .intro h1 { margin: 0; font-size: 34px; color: #0b3a9e; }
html:not(.desktop) .intro p { margin: 2px 0 0; }
html:not(.desktop) .tile { border-radius: 6px; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--edge); }
html:not(.desktop) .win {
  background: #fff; border: 1px solid var(--edge); border-top: 4px solid var(--title);
  margin: 24px 0; padding: 20px 24px; display: grid; gap: 0 28px;
}
html:not(.desktop) .win[data-kind="explorer"] { grid-template-columns: 1fr 230px; }
html:not(.desktop) .win[data-kind="explorer"] .content { grid-column: 1; grid-row: 1; }
html:not(.desktop) .win[data-kind="explorer"] .tasks { grid-column: 2; grid-row: 1; }
@media (max-width: 640px) { html:not(.desktop) .win[data-kind="explorer"] .content { grid-row: auto; } }
html:not(.desktop) .win[data-kind="explorer"] .status { grid-column: 1 / -1; }
html:not(.desktop) .win h2 { margin: 0 0 8px; font-size: 24px; color: #0b3a9e; }
html:not(.desktop) .status { display: flex; flex-wrap: wrap; gap: 4px 18px; list-style: none; margin: 12px 0 0; padding: 10px 0 0; border-top: 1px solid var(--face-dark); color: #444; font-size: 13px; }
html:not(.desktop) .plain-footer { padding-bottom: 40px; }
@media (max-width: 640px) {
  html:not(.desktop) .win[data-kind="explorer"] { grid-template-columns: 1fr; }
  html:not(.desktop) .win[data-kind="explorer"] .tasks { grid-column: 1; grid-row: auto; }
}

/* Shared content styles (both views) */
.lede { font-size: 17px; margin-top: 0; }
.content p, .note p { max-width: 62ch; }
.shots { display: flex; gap: 12px; flex-wrap: wrap; margin: 4px 0 16px; }
.shots img { width: 180px; border-radius: 14px; border: 1px solid #999; background: #000; }
.task-group { margin-bottom: 14px; }
.task-group h3 { margin: 0; font: bold 13px/1 var(--ui); color: var(--task-head); padding: 7px 10px; background: linear-gradient(90deg, #fff, #c6d3f7); border-radius: 4px 4px 0 0; }
.task-group ul, .task-group dl { margin: 0; padding: 8px 10px 10px; background: var(--task-body); font-size: 13px; }
.task-group ul { list-style: none; }
.task-group li + li { margin-top: 4px; }
.task-group dt { font-weight: bold; color: #1c2f5e; }
.task-group dd { margin: 0 0 6px; color: #1c2f5e; }
.files { list-style: none; margin: 0; padding: 0; }
.files li { display: flex; gap: 12px; align-items: flex-start; padding: 8px 6px; }
.files h3 { margin: 0; font: bold 14px/1.3 var(--ui); }
.files p { margin: 2px 0 0; font-size: 14px; max-width: 60ch; }
.mail .field { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.mail .field label { width: 64px; font-size: 13px; }
.mail input, .mail textarea { font: 14px/1.4 var(--ui); border: 1px solid #7f9db9; padding: 4px 6px; flex: 1; background: #fff; color: #000; }
.mail input[readonly] { background: #f4f3ee; }
.mail .field-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.mail textarea { width: 100%; resize: vertical; margin-top: 4px; }
.send-row { display: flex; gap: 12px; align-items: center; margin-top: 10px; }
.send-row p { margin: 0; font-size: 13px; }
.send-status.err { color: #a4000f; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.mail button:disabled { color: #8a8a8a; cursor: default; }
.xp-btn, .mail button {
  font: 13px var(--ui); min-width: 75px; padding: 4px 12px; color: #000; cursor: pointer;
  border: 1px solid #003c74; border-radius: 3px;
  background: linear-gradient(180deg, #fff 0%, #ecebe6 86%, #d6d0c5 100%);
}
.xp-btn:hover, .mail button:hover { box-shadow: inset 0 -1px 0 1px #fbca5b, inset 0 1px 0 1px #fde7a5; }
.xp-btn:active, .mail button:active { background: linear-gradient(180deg, #cdcac3, #e3e3db 60%, #e5e4de); }

/* ── Desktop ────────────────────────────────────────────────────────────── */
html.desktop, html.desktop body { height: 100%; overflow: hidden; }
html.desktop body {
  font-size: 12px; line-height: 1.4; user-select: none; -webkit-user-select: none;
  background: #5b97e3 url(../assets/wallpaper.svg) center / cover no-repeat;
}
html.desktop .plain-footer { display: none; }
html.desktop .intro { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
html.desktop main { position: absolute; inset: 0 0 30px 0; }

/* Desktop icons */
.icons { position: absolute; top: 12px; left: 8px; bottom: 42px; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; flex-wrap: wrap; gap: 14px 6px; align-content: flex-start; z-index: 1; }
.icon { display: flex; flex-direction: column; align-items: center; width: 84px; padding: 2px; border: 0; background: none; color: #fff; font: 12px/1.25 var(--ui); text-align: center; cursor: default; }
.icon img { width: 48px; height: 48px; max-width: none; margin-bottom: 4px; filter: drop-shadow(1px 2px 1px rgba(0, 0, 0, .35)); }
.icon span { padding: 1px 3px; text-shadow: 1px 1px 1px #000, 0 0 3px rgba(0, 0, 0, .6); }
.icon[aria-pressed="true"] img { filter: drop-shadow(1px 2px 1px rgba(0, 0, 0, .35)) brightness(.75) sepia(.6) hue-rotate(180deg) saturate(3); }
.icon[aria-pressed="true"] span { background: var(--select); text-shadow: none; }
.icon:focus-visible { outline: none; }
.icon:focus-visible span { outline: 1px dotted #fff; outline-offset: 0; }

/* Windows */
html.desktop .win {
  position: absolute; display: none; flex-direction: column;
  min-width: 300px; min-height: 160px; max-width: calc(100vw - 16px); max-height: calc(100% - 8px);
  background: var(--face); border: 3px solid var(--frame); border-top: 0; border-radius: 8px 8px 0 0;
  box-shadow: 2px 3px 10px rgba(0, 0, 0, .35); user-select: text; -webkit-user-select: text;
}
html.desktop .win.open { display: flex; }
html.desktop .win:focus { outline: none; }
html.desktop .win.min { display: none; }
html.desktop .win.max { inset: 0 !important; width: auto !important; height: auto !important; max-width: none; max-height: none; border-radius: 0; }
html.desktop .win:not(.active) { border-color: #7a96df; }
.titlebar {
  display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 5px 0 6px; flex: none;
  background: linear-gradient(180deg, var(--title-hi) 0%, var(--title) 12%, #0050ee 45%, #0066ff 88%, var(--title-lo) 100%);
  border-radius: 7px 7px 0 0; margin: 0 -3px; color: #fff; cursor: default; touch-action: none;
}
.win:not(.active) .titlebar { background: linear-gradient(180deg, #a8bef0 0%, #7c97e1 15%, #7a96df 85%, #6b86d4 100%); }
.titlebar img { width: 16px; height: 16px; flex: none; }
.titlebar .wtitle { flex: 1; font: bold 13px/1 var(--display); text-shadow: 1px 1px #0f1089; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.titlebar button {
  width: 21px; height: 21px; flex: none; padding: 0; border: 1px solid #fff; border-radius: 3px;
  background: linear-gradient(180deg, #3c8cff, #0a5fe0 60%, #1b62d8); color: #fff; cursor: pointer;
  display: grid; place-items: center;
}
.titlebar button svg { width: 11px; height: 11px; }
.titlebar button.close { background: linear-gradient(180deg, #f39a7c, #e0441c 55%, #c8360f); }
.titlebar button:hover { filter: brightness(1.15); }
.win:not(.active) .titlebar button { opacity: .75; }

.menubar { display: flex; gap: 2px; padding: 2px 4px; border-bottom: 1px solid var(--face-dark); font-size: 12px; flex: none; }
.menubar span { padding: 1px 6px; }
.addressbar { display: flex; align-items: center; gap: 6px; padding: 3px 6px; border-bottom: 1px solid var(--face-dark); font-size: 12px; flex: none; }
.addressbar .lbl { color: #555; }
.addressbar .addr { flex: 1; display: flex; align-items: center; gap: 4px; min-width: 0; background: #fff; border: 1px solid #7f9db9; padding: 1px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.addressbar .addr img { width: 14px; height: 14px; }
.addressbar .addr a { overflow: hidden; text-overflow: ellipsis; }

.body { flex: 1; min-height: 0; overflow: auto; background: #fff; display: flex; }
html.desktop .win h2 { font-size: 22px; margin: 0 0 6px; color: #0b3a9e; }
html.desktop .win[data-kind="explorer"] .tasks {
  order: -1; width: 210px; flex: none; padding: 12px 10px; background: linear-gradient(180deg, #7ba2e7, var(--task-pane));
  overflow: auto;
}
html.desktop .content { flex: 1; min-width: 0; padding: 16px 20px; font-size: 14px; line-height: 1.55; overflow: auto; }
html.desktop .content .lede { font-size: 16px; }
html.desktop .content .shots { float: right; flex-wrap: nowrap; margin: 4px 0 12px 20px; }
html.desktop .content .shots img { width: 160px; }
html.desktop .content .shots:has(img + img) img { width: 136px; }
html.desktop .win[data-kind="notepad"] .body { font: 14px/1.6 var(--mono); }
html.desktop .win[data-kind="notepad"] h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
html.desktop .note { padding: 6px 12px; }
html.desktop .note p { margin: 0 0 14px; max-width: 66ch; }
html.desktop .win[data-kind="folder"] .body, html.desktop .win[data-kind="mail"] .body { display: block; padding: 10px 14px; font-size: 14px; }
html.desktop .win[data-kind="folder"] h2, html.desktop .win[data-kind="mail"] h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
html.desktop .win[data-kind="mail"] .body { background: var(--face); }
html.desktop .files li:hover { background: #e8eefb; }

html.desktop .status { display: flex; gap: 2px; list-style: none; margin: 0; padding: 2px; border-top: 1px solid var(--face-dark); flex: none; font-size: 11px; overflow: hidden; }
html.desktop .status li { padding: 2px 8px; border: 1px solid; border-color: var(--edge) #fff #fff var(--edge); white-space: nowrap; }
html.desktop .status li:first-child { flex: 1; }

/* Taskbar */
.taskbar {
  position: fixed; left: 0; right: 0; bottom: 0; height: 30px; display: flex; align-items: stretch; z-index: 9000;
  background: linear-gradient(180deg, #3168d5 0%, #4993e6 6%, #2157d7 18%, #2663e0 50%, #245ddb 88%, #1941a5 100%);
  font: 12px var(--ui); color: #fff;
}
.start {
  display: flex; align-items: center; gap: 4px; padding: 0 18px 0 8px; margin-right: 8px; border: 0; cursor: pointer;
  border-radius: 0 10px 10px 0; color: #fff; font: italic bold 18px/1 var(--display); text-shadow: 1px 1px 2px rgba(0, 0, 0, .55);
  background: linear-gradient(180deg, #3fae3a 0%, #64c35f 10%, #3c9c34 45%, #2f8a29 90%, #25701f 100%);
  box-shadow: inset -1px -1px 2px rgba(0, 0, 0, .25), 2px 0 4px rgba(0, 0, 0, .3);
}
.start img { width: 22px; height: 22px; }
.start[aria-expanded="true"] { background: linear-gradient(180deg, #2a7f26, #3c9c34 50%, #2a7f26); }
.tasks-bar { flex: 1; display: flex; gap: 3px; align-items: center; min-width: 0; overflow: hidden; }
.taskbtn {
  display: flex; align-items: center; gap: 6px; height: 24px; width: 160px; min-width: 0; padding: 0 8px; cursor: pointer;
  border: 0; border-radius: 3px; color: #fff; font: 12px var(--ui); text-align: left;
  background: linear-gradient(180deg, #5a9bf5, #3c81f3 40%, #3779ea); box-shadow: inset -1px -1px rgba(0, 0, 0, .3), inset 1px 1px rgba(255, 255, 255, .3);
}
.taskbtn img { width: 16px; height: 16px; flex: none; }
.taskbtn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.taskbtn[aria-pressed="true"] { background: linear-gradient(180deg, #1e52b7, #2457c5); box-shadow: inset 1px 1px 2px rgba(0, 0, 0, .5); }
.tray {
  display: flex; align-items: center; gap: 8px; padding: 0 12px; margin-left: 6px; position: relative;
  background: linear-gradient(180deg, #0c59b9, #139ee9 8%, #18b5f2 12%, #139beb 40%, #1290e8 88%, #0d8dea 100%);
  border-left: 1px solid #092e83; box-shadow: inset 1px 0 1px #18bbff;
}
.tray time { font-size: 12px; }

/* Balloon tip */
.balloon {
  position: fixed; right: 12px; bottom: 40px; width: 280px; z-index: 9100; padding: 10px 28px 10px 12px;
  background: #ffffe1; color: #000; border: 1px solid #000; border-radius: 8px; box-shadow: 2px 3px 8px rgba(0, 0, 0, .3); font: 12px/1.4 var(--ui);
}
.balloon::after { content: ""; position: absolute; right: 52px; bottom: -11px; border: 11px solid transparent; border-top-color: #000; border-bottom: 0; }
.balloon::before { content: ""; position: absolute; right: 53px; bottom: -9px; border: 10px solid transparent; border-top-color: #ffffe1; border-bottom: 0; z-index: 1; }
.balloon strong { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.balloon strong img { width: 16px; height: 16px; }
.balloon button.x { position: absolute; top: 6px; right: 6px; width: 16px; height: 16px; padding: 0; border: 1px solid #999; border-radius: 2px; background: #fff; font: 10px/1 var(--ui); cursor: pointer; }
.balloon button.open { all: unset; cursor: pointer; color: var(--link); text-decoration: underline; }

/* Start menu */
.startmenu {
  position: fixed; left: 0; bottom: 30px; width: 380px; max-width: 100vw; z-index: 9200; display: none;
  border: 2px solid #1c4fc4; border-radius: 8px 8px 0 0; overflow: hidden; box-shadow: 3px 0 10px rgba(0, 0, 0, .4); font: 12px var(--ui);
}
.startmenu.open { display: block; }
.sm-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px; color: #fff; font: bold 15px var(--display); text-shadow: 1px 1px 2px rgba(0, 0, 0, .5); background: linear-gradient(180deg, #1868ce, #0e60cb 20%, #1a67cf 80%, #3a86e0); }
.sm-head img { width: 44px; height: 44px; border: 2px solid #fff; border-radius: 4px; }
.sm-cols { display: flex; background: #fff; border-top: 2px solid #f09b3a; }
.sm-cols ul { list-style: none; margin: 0; padding: 6px 0; }
.sm-left { flex: 1; }
.sm-right { width: 46%; background: #d3e5fa; border-left: 1px solid #95bdee; }
.sm-cols li > * { display: flex; align-items: center; gap: 8px; width: 100%; padding: 5px 10px; border: 0; background: none; color: #000; font: 12px var(--ui); text-align: left; text-decoration: none; cursor: pointer; }
.sm-left li > * { font-weight: bold; }
.sm-right li > * { color: #0a246a; }
.sm-cols img { width: 32px; height: 32px; }
.sm-right img { width: 22px; height: 22px; }
.sm-cols li > *:hover, .sm-cols li > *:focus-visible { background: var(--select); color: #fff; outline: none; }
.sm-foot { display: flex; justify-content: flex-end; padding: 6px 10px; background: linear-gradient(180deg, #3a7fe0, #1958c8); }
.sm-foot button { display: flex; align-items: center; gap: 6px; border: 0; background: none; color: #fff; font: 12px var(--ui); cursor: pointer; padding: 3px 6px; border-radius: 3px; }
.sm-foot button:hover, .sm-foot button:focus-visible { background: rgba(255, 255, 255, .18); outline: none; }
.sm-foot svg { width: 22px; height: 22px; }

/* Welcome screen */
.welcome {
  position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; gap: 0;
  background: #5a7edc; color: #fff; cursor: pointer;
}
.welcome::before, .welcome::after { content: ""; position: absolute; left: 0; right: 0; height: 12%; background: #00309c; }
.welcome::before { top: 0; border-bottom: 2px solid #8aa6e8; }
.welcome::after { bottom: 0; border-top: 2px solid #f09b3a; }
.welcome .w-left { padding: 0 48px; border-right: 1px solid rgba(255, 255, 255, .5); font: italic bold 64px/1 var(--display); letter-spacing: -1px; }
.welcome .w-right { display: flex; align-items: center; gap: 14px; padding: 0 48px; }
.welcome img { width: 64px; height: 64px; border: 2px solid #fff; border-radius: 6px; }
.welcome b { display: block; font: bold 20px var(--display); }
.welcome small { font-size: 13px; opacity: .9; }

/* Phone: no fake desktop. A home screen of icons, and each window opens full screen. */
@media (max-width: 700px) {
  .icons { position: static; flex-direction: row; flex-wrap: wrap; justify-content: space-around; gap: 22px 4px; padding: 28px 8px 0; }
  .icons li { width: 30%; display: flex; justify-content: center; }
  .icon { width: 100%; }
  .icon img { width: 56px; height: 56px; max-width: none; }
  html.desktop .win, html.desktop .win.max { inset: 0 !important; width: auto !important; height: auto !important; max-width: none; max-height: none; border-radius: 0; border-width: 0; }
  .titlebar { border-radius: 0; margin: 0; height: 40px; }
  .titlebar button.min-btn, .titlebar button.max-btn { display: none; }
  .titlebar button.close { width: 30px; height: 30px; }
  .body { flex-direction: column; }
  html.desktop .win[data-kind="explorer"] .tasks { width: auto; order: 2; }
  html.desktop .content { overflow: visible; }
  html.desktop .content .shots { float: none; margin: 4px 0 16px; }
  html.desktop .content .shots img, html.desktop .content .shots:has(img + img) img { width: 46%; max-width: 200px; }
  .menubar, .addressbar { display: none; }
  .taskbtn { display: none; }
  .tasks-bar { flex: 1; }
  .balloon { left: 12px; right: 12px; width: auto; }
  .welcome { flex-direction: column; gap: 24px; }
  .welcome .w-left { border-right: 0; font-size: 48px; }
}

@media (prefers-reduced-motion: no-preference) {
  .startmenu.open { animation: sm-in .12s ease-out; }
  @keyframes sm-in { from { transform: translateY(8px); opacity: .6; } }
}
