/* Windows 95, drawn with its own rules: 1px bevels from four fixed grays,
   solid navy title bars, no blur, no rounding. */
@font-face {
  font-family: "W95FA";
  src: url("fonts/w95fa.woff2") format("woff2");
  font-display: swap;
}

:root {
  --desktop: #008080;
  --face: #c0c0c0;
  --light: #dfdfdf;
  --white: #fff;
  --shadow: #808080;
  --black: #0a0a0a;
  --title: #000080;
  --title-off: #808080;
  --link: #0000a8;
  --tip: #ffff9c;
  --taskbar-h: 40px;
  --raised: inset -1px -1px var(--black), inset 1px 1px var(--white),
            inset -2px -2px var(--shadow), inset 2px 2px var(--light);
  --pressed: inset -1px -1px var(--white), inset 1px 1px var(--black),
             inset -2px -2px var(--light), inset 2px 2px var(--shadow);
  --sunken: inset -1px -1px var(--white), inset 1px 1px var(--shadow),
            inset -2px -2px var(--light), inset 2px 2px var(--black);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  background: var(--desktop);
  color: var(--black);
  font: 20px/1.3 "W95FA", "Tahoma", sans-serif; /* W95FA is crisp at 15, 20, 30 and 40px; 16-19px doubles its stems */
  -webkit-font-smoothing: none;
  font-smooth: never;
}
img { image-rendering: pixelated; }
p { margin: 0; }
a { color: var(--link); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 1px dotted var(--black); outline-offset: -4px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.sunken { background: var(--white); box-shadow: var(--sunken); padding: 2px; }

/* ---------- desktop ---------- */
.desktop {
  position: relative;
  height: calc(100dvh - var(--taskbar-h));
  overflow: hidden;
}
.icons {
  list-style: none;
  margin: 0;
  padding: 8px 4px;
  height: 100%;
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(auto-fill, 104px);
  grid-auto-columns: 104px;
  align-content: start;
}
.icon {
  user-select: none;
  -webkit-user-select: none;
  touch-action: none; /* the page never scrolls; a press may become a drag */
  width: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 4px 2px;
  border: 0;
  background: none;
  cursor: default;
  color: var(--white);
}
.icon img { width: 64px; height: 64px; -webkit-user-drag: none; pointer-events: none; }
.icon span {
  padding: 0 3px;
  font-size: 15px;
  text-align: center;
  line-height: 1.15;
  text-shadow: none;
}
.icons.is-free > li { position: absolute; }
.icons.is-free > li.is-dragging { z-index: 5; }
.icon:focus-visible { outline: none; }
.icon:focus-visible span { outline: 1px dotted var(--white); }
.icon[aria-pressed="true"] span { background: var(--title); }
.icon[aria-pressed="true"] img { filter: brightness(.55) sepia(1) hue-rotate(185deg) saturate(4); }

/* ---------- windows ---------- */
.window {
  position: absolute;
  left: 140px;
  top: 32px;
  width: min(680px, calc(100vw - 16px));
  max-height: calc(100% - 16px);
  display: flex;
  flex-direction: column;
  background: var(--face);
  box-shadow: var(--raised);
  padding: 3px;
}
.window[hidden] { display: none; }
.window--wide { width: min(820px, calc(100vw - 16px)); }
.window:focus { outline: none; }

.titlebar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 3px 0 8px;
  background: var(--title-off);
  color: var(--face);
  touch-action: none;
  user-select: none;
  flex: none;
}
.window.is-active .titlebar { background: var(--title); color: var(--white); }
.titlebar h2 {
  flex: 1;
  margin: 0;
  font-size: 20px;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.close {
  width: 24px;
  height: 21px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: var(--face);
  box-shadow: var(--raised);
  color: var(--black);
}
.close svg { width: 8px; height: 7px; fill: currentColor; shape-rendering: crispEdges; }
.close:active { box-shadow: var(--pressed); }
.close:active svg { transform: translate(1px, 1px); }

.window-body {
  padding: 14px 12px 12px;
  overflow: auto;
  display: grid;
  gap: 14px;
}

.btn {
  min-width: 96px;
  min-height: 36px;
  padding: 4px 14px;
  border: 0;
  background: var(--face);
  box-shadow: var(--raised);
  color: var(--black);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: default;
}
.btn--default {
  box-shadow: inset 0 0 0 1px var(--black), inset -2px -2px var(--black),
              inset 2px 2px var(--white), inset -3px -3px var(--shadow), inset 3px 3px var(--light);
}
.btn:active { box-shadow: inset 0 0 0 1px var(--black), inset 1px 1px var(--shadow); padding: 5px 13px 3px 15px; }
.btn:focus-visible { outline-offset: -5px; }

.actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }

/* app windows */
.app-head { display: flex; align-items: center; gap: 12px; }
.app-head img { width: 64px; height: 64px; }
.app-name { font-size: 30px; line-height: 1.1; }
.app-kind { color: #404040; }
.app-text { max-width: 60ch; }
.shot { margin: 0; line-height: 0; }
.shot img { width: 100%; height: auto; image-rendering: auto; }

/* welcome */
.welcome-title { font-size: 40px; line-height: 1.1; }
.welcome-title b { font-weight: 400; color: var(--title); }
.welcome-grid { display: grid; grid-template-columns: 1fr 190px; gap: 16px; }
.tip {
  display: flex;
  gap: 14px;
  padding: 18px 16px;
  min-height: 200px;
  background:
    repeating-conic-gradient(var(--tip) 0 25%, #fff 0 50%) 0 0 / 2px 2px;
}
.tip img { width: 64px; height: 64px; flex: none; }
.tip-head { font-size: 30px; margin-bottom: 10px; }
.welcome-actions { display: flex; flex-direction: column; gap: 8px; }
.welcome-actions .btn { width: 100%; }
.welcome-actions hr {
  width: 100%; margin: 10px 0; border: 0;
  border-top: 1px solid var(--shadow); border-bottom: 1px solid var(--white);
}
.welcome-actions .btn--default { margin-top: auto; }

/* about guido */
.about { display: grid; grid-template-columns: 292px 1fr; gap: 18px; align-items: start; }
.portrait { margin: 0; line-height: 0; width: 292px; }
/* 96px source at exactly 3x, so every pixel stays square. */
.portrait img { width: 288px; height: 288px; }
.about-text { display: grid; gap: 12px; max-width: 42ch; }

/* notepad */
.notepad { padding: 12px 14px; display: grid; gap: 10px; }
.notepad ul { margin: 0; padding-left: 20px; }

/* ---------- taskbar ---------- */
.taskbar {
  position: fixed;
  inset: auto 0 0 0;
  height: var(--taskbar-h);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 3px 3px;
  background: var(--face);
  box-shadow: inset 0 1px var(--light), inset 0 2px var(--white);
  z-index: 1000;
}
.start {
  height: 32px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px 0 6px;
  border: 0;
  background: var(--face);
  box-shadow: var(--raised);
  flex: none;
}
.start[aria-expanded="true"] { box-shadow: var(--pressed); }
.start img { width: 16px; height: 16px; }

.tasks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.tasks li { flex: 0 1 180px; min-width: 0; }
.task {
  width: 100%;
  height: 32px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  border: 0;
  background: var(--face);
  box-shadow: var(--raised);
  text-align: left;
}
.task span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.task img { width: 16px; height: 16px; flex: none; }
.task[aria-pressed="true"] {
  box-shadow: var(--pressed);
  background: repeating-conic-gradient(var(--face) 0 25%, var(--white) 0 50%) 0 0 / 2px 2px;
}

.tray {
  height: 32px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: var(--face);
  flex: none;
}

/* start menu */
.start-menu {
  position: absolute;
  left: 3px;
  bottom: calc(var(--taskbar-h) - 3px);
  display: flex;
  min-width: 270px;
  background: var(--face);
  box-shadow: var(--raised);
  padding: 3px;
}
.start-menu[hidden] { display: none; }
.start-menu ul { list-style: none; margin: 0; padding: 0; flex: 1; }
.start-menu [role="menuitem"] {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 36px;
  padding: 2px 16px 2px 10px;
  border: 0;
  background: none;
  text-align: left;
  cursor: default;
}
.start-menu [role="menuitem"] img { width: 16px; height: 16px; }
.start-menu [role="menuitem"]:hover,
.start-menu [role="menuitem"]:focus { background: var(--title); color: var(--white); outline: none; }
.start-menu [role="separator"] {
  height: 0; margin: 4px 2px;
  border-top: 1px solid var(--shadow); border-bottom: 1px solid var(--white);
}

/* ---------- phones ---------- */
@media (max-width: 640px) {
  .icons {
    grid-auto-flow: row;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: none;
    grid-auto-rows: 104px;
    grid-auto-columns: auto;
    padding: 8px 0;
  }
  .icon { width: 100%; }
  .window, .window--wide { left: 8px !important; top: 8px !important; width: calc(100vw - 16px); }
  .welcome-title { font-size: 30px; }
  .welcome-grid, .about { grid-template-columns: 1fr; }
  .tip { min-height: 0; }
  .welcome-actions hr { display: none; }
  .tasks li { flex-basis: 120px; }
}
