/* not online book — the visitor's 2007 desktop.
   layout: wallpaper fills the screen; IE on the left, buddy list on the right, taskbar along the bottom.
   phones: IE fills the screen, the buddy list opens from the taskbar. one deliberate look, no dark mode. */
:root {
  color-scheme: light;
  --face: #d4d0c8;          /* classic window grey */
  --hi: #ffffff;
  --shade: #808080;
  --dark: #404040;
  --title-a: #0a246a;       /* active title bar */
  --title-b: #a6caf0;
  --idle-a: #808080;        /* inactive title bar */
  --idle-b: #c0c0c0;
  --ink: #000;
  --muted: #555;
  --site: #3b5280;          /* the book's header blue */
  --site-line: #c3cbd9;
  --site-tint: #eceff5;
  --link: #2b4a8a;
  --tip: #ffffe1;
  --ui: Tahoma, "MS Sans Serif", Verdana, Geneva, sans-serif;
  --web: "Lucida Grande", Tahoma, Verdana, sans-serif;
  --msg: Arial, Helvetica, sans-serif;
  --task-h: 32px;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: #3a6ea5 url(assets/wallpaper.png) center / cover no-repeat;
  image-rendering: pixelated;
  color: var(--ink);
  font: 11px/1.35 var(--ui);
  overflow: hidden;
}
img, .prof-pic { image-rendering: pixelated; }
button { font: inherit; color: inherit; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.desk {
  position: relative;
  height: 100%;
  padding-top: env(safe-area-inset-top, 0px);
}

/* ---------- windows ---------- */
.win {
  position: absolute;
  background: var(--face);
  border: 2px solid;
  border-color: var(--hi) var(--dark) var(--dark) var(--hi);
  box-shadow: inset -1px -1px 0 var(--shade), inset 1px 1px 0 #e8e6e0;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.tb {
  display: flex; align-items: center; gap: 3px;
  margin: 2px; padding: 2px 3px;
  background: linear-gradient(90deg, var(--idle-a), var(--idle-b));
  color: #d8d6d0; font-weight: bold;
  user-select: none;
}
.tb.active { background: linear-gradient(90deg, var(--title-a), var(--title-b)); color: #fff; }
.tb-t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-ico { width: 14px; height: 14px; flex: none; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #9cf 0 30%, #26c 31% 100%); box-shadow: inset 0 0 0 1px #034; }
.tb-b {
  width: 16px; height: 14px; flex: none; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--face); color: #000; font-size: 9px; font-weight: bold; line-height: 1;
  border: 1px solid; border-color: var(--hi) var(--dark) var(--dark) var(--hi);
}
button.tb-b { cursor: pointer; }
.menu { display: flex; gap: 12px; padding: 1px 8px 2px; }
.tools { display: flex; gap: 12px; padding: 3px 8px; border-top: 1px solid var(--hi); border-bottom: 1px solid var(--shade); color: #333; }
.tools .off { color: #999; }
.addr { display: flex; align-items: center; gap: 6px; padding: 3px 6px; border-top: 1px solid var(--hi); }
.addr-l { color: #444; }
.addr-f { flex: 1; min-width: 0; background: #fff; padding: 2px 4px; border: 2px solid; border-color: var(--shade) var(--hi) var(--hi) var(--shade); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.addr-go { padding: 1px 8px; border: 1px solid; border-color: var(--hi) var(--dark) var(--dark) var(--hi); }
.sb { display: flex; justify-content: space-between; gap: 8px; padding: 2px 6px; margin: 0 2px 2px; border: 1px solid; border-color: var(--shade) var(--hi) var(--hi) var(--shade); color: #333; }
.sb > span:first-child { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- IE ---------- */
.ie { left: 16px; top: calc(16px + env(safe-area-inset-top, 0px)); bottom: calc(var(--task-h) + 16px); width: min(720px, calc(100% - 260px)); }
.pane {
  flex: 1; min-height: 0; margin: 0 2px 2px;
  background: #fff; overflow: auto; -webkit-overflow-scrolling: touch;
  border: 2px solid; border-color: var(--shade) var(--hi) var(--hi) var(--shade);
}

/* the book (a 2007 profile page) */
.site { font: 11px/1.4 var(--web); min-height: 100%; }
.site-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 12px; background: var(--site); color: #fff; }
.site-h h1 { margin: 0; font-size: 15px; letter-spacing: .02em; }
.site-nav { font-size: 10px; color: #d8def0; white-space: nowrap; }
.site-b { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 14px; padding: 12px; }
.prof { display: flex; flex-direction: column; gap: 8px; }
.prof-pic { width: 150px; height: 150px; display: block; background: var(--site-tint); border: 1px solid var(--site-line); padding: 18px; }
.info { border-top: 1px solid var(--site-line); padding-top: 6px; }
.info h2, .wall-h h3 { margin: 0; font-size: 11px; color: var(--site); }
.info dl { margin: 4px 0 0; display: grid; gap: 1px; }
.info dt { color: #777; }
.info dd { margin: 0 0 4px; }
.mainc { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.who { display: flex; flex-direction: column; gap: 2px; }
.who-n { margin: 0; font-size: 17px; }
.who-s { margin: 0; font-size: 13px; }
.who-u { margin: 0; font-size: 10px; color: #888; min-height: 1em; }
.wall { border: 1px solid var(--site-line); }
.wall-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 4px 7px; background: var(--site-tint); border-bottom: 1px solid var(--site-line); }
.wall-h span { color: #777; }
.wall-f { display: flex; flex-direction: column; gap: 5px; padding: 7px; border-bottom: 1px solid #e5e5e5; }
.wall-f input, .wall-f textarea {
  width: 100%; font: 12px/1.4 var(--msg); padding: 4px 6px; color: #000; background: #fff;
  border: 1px solid #bdc7d8; border-radius: 0;
}
.wall-f textarea { resize: vertical; min-height: 52px; }
.wall-f input:focus, .wall-f textarea:focus { outline: 1px solid var(--site); outline-offset: 0; border-color: var(--site); }
.wall-fr { display: flex; align-items: center; gap: 8px; }
#f-msg { flex: 1; min-width: 0; color: #a33; }
#f-msg.ok { color: #2a6a2a; }
.count { color: #999; font-variant-numeric: tabular-nums; }
.count.near { color: #a33; }
#f-post {
  padding: 3px 14px; min-height: 24px; background: var(--site); color: #fff; font-weight: bold;
  border: 1px solid #29447e; cursor: pointer;
}
#f-post:disabled { opacity: .6; cursor: default; }
#f-post:focus-visible, .bud:focus-visible, .tk:focus-visible, .tb-b:focus-visible { outline: 1px dotted #000; outline-offset: 2px; }
.closed { margin: 0; padding: 10px 8px; color: #555; border-bottom: 1px solid #e5e5e5; background: #fafafa; }
.posts { list-style: none; margin: 0; padding: 0; }
.post { padding: 7px; display: flex; flex-direction: column; gap: 2px; border-bottom: 1px solid #e5e5e5; }
.post:last-child { border-bottom: none; }
.post-h b { color: var(--link); }
.post-h span { color: #888; }
.post-t { font: 12px/1.4 var(--msg); white-space: pre-wrap; overflow-wrap: anywhere; }
.post.mine { background: #fbfaf3; }
.post.new { animation: in .4s ease-out; }
@keyframes in { from { background: #fff6cc; } to { background: #fff; } }

/* ---------- Buddy List ---------- */
.buddy { right: 16px; top: calc(16px + env(safe-area-inset-top, 0px)); width: 196px; height: 440px; max-height: calc(100% - var(--task-h) - 32px); }
.ban { margin: 2px 4px; height: 54px; flex: none; display: flex; align-items: flex-end; padding: 4px;
  background: linear-gradient(180deg, #8fb7e8, #cfe2f7 55%, #6fae4a 56%, #4f8f34);
  border: 1px solid; border-color: var(--shade) var(--hi) var(--hi) var(--shade);
  color: #fff; font-style: italic; font-weight: bold; text-shadow: 1px 1px 0 #2a4a1a; }
.tabs { display: flex; gap: 2px; padding: 2px 4px 0; }
.tabs span { padding: 2px 8px; color: #333; }
.tabs .on { font-weight: bold; color: #000; border: 1px solid; border-color: var(--hi) var(--dark) transparent var(--hi); }
.blist { flex: 1; min-height: 0; overflow: auto; margin: 0 4px 4px; padding: 4px; background: #fff; display: flex; flex-direction: column; gap: 3px;
  border: 2px solid; border-color: var(--shade) var(--hi) var(--hi) var(--shade); }
.blist .off { color: #888; }
.bud { display: flex; align-items: center; gap: 4px; margin-left: 12px; padding: 0; background: none; border: 0; text-align: left; cursor: default; }
.bud-n { padding: 0 3px; }
.bud:hover .bud-n, .bud:focus .bud-n, .bud.sel .bud-n { background: var(--title-a); color: #fff; }
.bud-i { width: 13px; height: 13px; flex: none; }
.bud.away .bud-i { background: no-repeat center / 13px 13px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 13 13'%3E%3Crect x='1.5' y='1.5' width='10' height='10' fill='%23fff6a8' stroke='%236b5a00'/%3E%3Cpath d='M3.5 4.5h6M3.5 6.5h6M3.5 8.5h4' stroke='%236b5a00'/%3E%3C/svg%3E"); }
.bud.away .bud-n { font-style: italic; }
.bud.on .bud-n { font-weight: bold; }
.bbar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 4px; border-top: 1px solid var(--hi); text-align: center; color: #222; }
.tip { position: absolute; right: calc(100% + 4px); top: 140px; width: 176px; z-index: 5;
  background: var(--tip); border: 1px solid #000; padding: 5px 6px; display: flex; flex-direction: column; gap: 2px;
  box-shadow: 2px 2px 0 rgba(0,0,0,.25); }
.tip[hidden] { display: none; }
.tip i { color: #555; overflow-wrap: anywhere; }
#buddy-x { display: none; }

/* ---------- taskbar ---------- */
.task {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  min-height: var(--task-h);
  display: flex; align-items: center; gap: 4px;
  padding: 3px max(3px, env(safe-area-inset-right, 0px)) calc(3px + env(safe-area-inset-bottom, 0px)) max(3px, env(safe-area-inset-left, 0px));
  background: var(--face); border-top: 1px solid var(--hi); box-shadow: inset 0 1px 0 #e8e6e0;
}
.start, .tk { padding: 3px 8px; border: 2px solid; border-color: var(--hi) var(--dark) var(--dark) var(--hi); background: var(--face); white-space: nowrap; }
.start b::before { content: ""; display: inline-block; width: 12px; height: 10px; margin-right: 4px; vertical-align: -1px;
  background: linear-gradient(90deg, #e33 0 50%, #3a3 50%) top / 100% 50% no-repeat, linear-gradient(90deg, #35d 0 50%, #ec2 50%) bottom / 100% 50% no-repeat; }
.tk { width: 160px; min-width: 0; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.tk.on, .tk[aria-expanded="true"] { border-color: var(--dark) var(--hi) var(--hi) var(--dark); background: #e8e6e0; font-weight: bold; }
button.tk { cursor: pointer; }
.clock { margin-left: auto; padding: 3px 10px; border: 1px solid; border-color: var(--shade) var(--hi) var(--hi) var(--shade); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- phones and narrow windows ---------- */
@media (max-width: 760px) {
  body { font-size: 12px; }
  .ie { left: max(0px, env(safe-area-inset-left, 0px)); right: max(0px, env(safe-area-inset-right, 0px)); top: env(safe-area-inset-top, 0px); bottom: calc(var(--task-h) + env(safe-area-inset-bottom, 0px)); width: auto; }
  .menu, .tools .hide-sm, .site-nav { display: none; }
  .tools { gap: 10px; }
  .site { font-size: 12px; }
  .site-b { grid-template-columns: 1fr; gap: 10px; padding: 10px 12px; }
  .prof { flex-direction: row; align-items: center; gap: 12px; }
  .prof-pic { width: 72px; height: 72px; padding: 8px; }
  .info { border-top: 0; padding-top: 0; }
  .info h2 { display: none; }
  .info dl { margin: 0; grid-template-columns: auto 1fr; column-gap: 6px; }
  .info dd { margin: 0; }
  .wall-f input, .wall-f textarea { font-size: 16px; } /* no iOS zoom on focus */
  #f-post { min-height: 32px; padding: 4px 18px; }
  .buddy { display: none; right: max(6px, env(safe-area-inset-right, 0px)); top: auto; bottom: calc(var(--task-h) + env(safe-area-inset-bottom, 0px) + 6px); width: 220px; height: 360px; z-index: 8; box-shadow: 3px 3px 0 rgba(0,0,0,.3); }
  .buddy.open { display: flex; }
  #buddy-x { display: inline-flex; }
  .tip { right: 8px; left: 8px; top: 120px; width: auto; }
  .tk { width: auto; flex: 0 1 auto; }
  .start { display: none; }
}
@media (prefers-reduced-motion: reduce) { .post.new { animation: none; } }
