/* =====================================================================
   BetaDoctor desktop.
   Retro Mac OS "Platinum" shapes, 2026 glass, shades of blue only.
   ===================================================================== */

:root {
  --ink: #04123a;                         /* deep navy instead of black */
  --accent: oklch(0.62 0.2 255);          /* royal blue */
  --accent-hi: oklch(0.88 0.09 225);      /* ice blue */
  --glow: oklch(0.84 0.14 215);           /* cyan light */
  --face: rgb(214 232 255 / .26);         /* window glass */
  --pane: rgb(236 245 255 / .5);          /* inner panel */
  --paper: rgb(248 252 255 / .86);        /* solid enough to read long text */
  --btn-face: rgb(230 241 255 / .62);
  --light: rgb(255 255 255 / .9);
  --shade: rgb(10 40 110 / .42);
  --pressed: #1d3c8f;
  --radius: 16px;
  --blur: blur(26px) saturate(1.6) brightness(1.1);
  --bar: 26px;                            /* menu bar height */
  --task: 30px;                           /* bottom bar height */
  --ui: "Charcoal", "Chicago", "ChicagoFLF", "Tahoma", "Verdana", sans-serif;
  --text: "Geneva", "Verdana", "Tahoma", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body { color: var(--ink); font: 13px/1.55 var(--text); background: #1746b8; }
button { font: inherit; color: inherit; }

/* ---------- Desktop background: drifting blues under a 1998 dither ---------- */
.bg { position: fixed; inset: 0; overflow: hidden; background: oklch(0.5 0.16 258); }
.bg i {
  position: absolute; width: 58vmax; height: 58vmax; border-radius: 50%;
  filter: blur(70px); animation: drift 28s ease-in-out infinite alternate;
}
.bg i:nth-child(1) { background: oklch(0.86 0.12 215); left: -14vmax; top: -18vmax; }
.bg i:nth-child(2) { background: oklch(0.68 0.2 250); right: -16vmax; top: 2vmax; animation-duration: 35s; animation-direction: alternate-reverse; }
.bg i:nth-child(3) { background: oklch(0.78 0.15 232); left: 18vmax; bottom: -30vmax; animation-duration: 41s; }
.bg i:nth-child(4) { background: oklch(0.36 0.16 268); right: 8vmax; bottom: -22vmax; width: 40vmax; height: 40vmax; animation-duration: 47s; }
.bg::after {
  content: ""; position: absolute; inset: 0;
  background: repeating-conic-gradient(rgb(0 10 60 / .08) 0% 25%, transparent 0% 50%) 0 0 / 4px 4px;
}
@keyframes drift { to { transform: translate(16vmax, 11vmax) scale(1.25); } }

/* ---------- Menu bar ---------- */
.menubar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100000;
  display: flex; align-items: stretch; height: var(--bar); padding: 0 8px;
  background: var(--face);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--ink);
  box-shadow: inset 0 1px 0 var(--light), 0 6px 24px rgb(0 20 80 / .25);
  font: bold 13px/1 var(--ui); user-select: none;
}
.menu { position: relative; display: flex; }
.menu > button {
  display: flex; align-items: center; gap: 7px; padding: 0 10px;
  border: 0; background: none; font: inherit; cursor: default;
}
.menu > button:hover, .menu.open > button { background: var(--ink); color: #fff; }
.menu > button:focus-visible { outline: 1px dotted var(--ink); outline-offset: -3px; }
.menu img { width: 16px; height: 16px; border: 1px solid var(--ink); image-rendering: pixelated; }
.menu ul {
  display: none; position: absolute; top: calc(var(--bar) - 1px); left: 0; min-width: 190px;
  margin: 0; padding: 5px; list-style: none;
  background: rgb(226 238 255 / .78);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--ink); border-radius: 0 0 12px 12px;
  box-shadow: 0 18px 40px rgb(0 20 80 / .35), inset 0 1px 0 var(--light);
}
.menu.open ul { display: block; }
.menu li button {
  display: block; width: 100%; padding: 5px 12px; text-align: left; white-space: nowrap;
  border: 0; border-radius: 6px; background: none; font: inherit; cursor: default;
}
.menu li a { display: block; padding: 5px 12px; white-space: nowrap; border-radius: 6px; color: inherit; text-decoration: none; cursor: default; }
.menu li button:hover, .menu li button:focus-visible,
.menu li a:hover, .menu li a:focus-visible { background: var(--accent); color: #fff; outline: 0; box-shadow: 0 0 14px var(--glow); }
.menu li.sep { height: 1px; margin: 4px 6px; background: var(--shade); }
.clock { margin-left: auto; flex: none; display: flex; align-items: center; padding: 0 6px; white-space: nowrap; }

/* ---------- Bottom bar: one button per open window, clock on the right ---------- */
.taskbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100000;
  display: flex; align-items: stretch; height: var(--task); padding: 0 8px;
  background: var(--face);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border-top: 1px solid var(--ink);
  box-shadow: inset 0 1px 0 var(--light), 0 -6px 24px rgb(0 20 80 / .25);
  font: bold 13px/1 var(--ui); user-select: none;
}
.tasks { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; }
.task {
  flex: 0 1 170px; min-width: 0; height: 22px; padding: 0 10px;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-align: left;
  border: 1px solid var(--ink); border-radius: 7px;
  background: var(--btn-face);
  box-shadow: inset 1px 1px 0 var(--light), inset -1px -1px 0 var(--shade);
  font: inherit; cursor: default;
  transition: box-shadow .2s, background .2s, opacity .2s;
  animation: task-in .3s cubic-bezier(.2, .9, .3, 1.15);
}
.task:hover { box-shadow: inset 1px 1px 0 var(--light), inset -1px -1px 0 var(--shade), 0 0 12px var(--glow); }
.task.active { background: var(--accent); color: #fff; box-shadow: inset 1px 1px 0 var(--pressed), 0 0 14px var(--glow); }
.task.min { opacity: .6; font-style: italic; }
.task.min:hover { opacity: 1; }
.task:focus-visible { outline: 1px dotted var(--ink); outline-offset: 2px; }
@keyframes task-in { from { opacity: 0; transform: translateY(10px) scale(.8); } }

/* ---------- Desktop ---------- */
#desk { position: fixed; inset: var(--bar) 0 var(--task) 0; overflow: hidden; }

/* ---------- Window ---------- */
.window {
  position: absolute; display: flex; flex-direction: column;
  min-width: 240px; min-height: 0;
  background: var(--face);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--ink); border-radius: var(--radius);
  box-shadow: 0 24px 60px rgb(0 20 80 / .35),
              inset 0 1px 0 rgb(255 255 255 / .9), inset 0 0 0 1px rgb(255 255 255 / .3),
              inset 0 -10px 18px rgb(255 255 255 / .12);
  overflow: hidden;
  transition: box-shadow .3s;
}
.window.opening { animation: open .32s cubic-bezier(.2, .9, .3, 1.15); }
.window.active {
  box-shadow: 0 28px 70px rgb(0 20 80 / .45), 0 0 34px oklch(0.84 0.14 215 / .55),
              inset 0 1px 0 rgb(255 255 255 / .9), inset 0 0 0 1px rgb(255 255 255 / .3),
              inset 0 -10px 18px rgb(255 255 255 / .12);
}
/* asked to open a window that is already open: it blinks twice to say "here I am" */
.window.flash { animation: flash .34s ease-in-out 2; }
@keyframes flash {
  50% { transform: scale(1.025); box-shadow: 0 0 0 3px var(--glow), 0 0 70px 14px var(--glow); }
}
.window.closing { animation: shut .45s cubic-bezier(.5, 0, .9, .4) forwards; pointer-events: none; }
/* zoom box: the window glides between its own size and full size (set by desktop.js
   only for the length of the glide, so dragging and resizing stay instant) */
.window.zooming { transition: left .5s, top .5s, width .5s, height .5s, box-shadow .5s; transition-timing-function: cubic-bezier(.4, 0, .2, 1); }
@keyframes open { from { opacity: 0; transform: scale(.88) translateY(14px); } }
/* minimize: the window is squeezed down into its button in the bottom bar.
   desktop.js works out where that is and passes it in as --mx, --my, --msx, --msy.
   Restoring plays the same animation backwards. */
.window.minimizing, .window.restoring { transform-origin: 0 0; pointer-events: none; }
.window.minimizing { animation: tobar .45s cubic-bezier(.5, 0, .8, .5) forwards; }
.window.restoring { animation: tobar .45s cubic-bezier(.5, 0, .8, .5) reverse both; }
.window.minimized { display: none; }
@keyframes tobar {
  to { transform: translate(var(--mx), var(--my)) scale(var(--msx), var(--msy)); opacity: .15; }
}
@keyframes shut { to { opacity: 0; transform: scale(.6) translateY(30px); } }

.titlebar {
  flex: none; display: flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px;
  border-bottom: 1px solid var(--ink);
  box-shadow: inset 0 1px 0 var(--light);
  font: bold 13px/1 var(--ui); user-select: none; touch-action: none; cursor: default;
}
.stripes { flex: 1; height: 12px; background: repeating-linear-gradient(to bottom, var(--shade) 0 1px, var(--light) 1px 2px); }
.title { padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* like the real thing, a window in the background loses its pinstripes */
.window:not(.active) .stripes { visibility: hidden; }
.window:not(.active) .title { opacity: .6; }

.wbox {
  position: relative; flex: none; width: 14px; height: 14px; padding: 0;
  border: 1px solid var(--ink); border-radius: 3px;
  background: linear-gradient(135deg, #7fa3e6, #fff);
  box-shadow: inset 1px 1px 0 var(--pressed), inset -1px -1px 0 #fff;
  cursor: default; transition: box-shadow .2s;
}
.wbox:hover { box-shadow: inset 1px 1px 0 var(--pressed), inset -1px -1px 0 #fff, 0 0 10px var(--glow); }
.wbox:active { background: var(--accent); }
.wbox:focus-visible { outline: 1px dotted var(--ink); outline-offset: 2px; }
/* close box: a small blue X, drawn as two crossed diagonal bands */
.wbox.close::after {
  --x: #55607a;                           /* dark grey with a hint of blue: softer than the ink colour */
  content: ""; position: absolute; inset: 3px;
  background: linear-gradient(45deg, transparent 41%, var(--x) 41% 59%, transparent 59%),
              linear-gradient(135deg, transparent 41%, var(--x) 41% 59%, transparent 59%);
}
.wbox.close:hover::after { --x: var(--accent); }
.wbox.close:active::after { --x: #fff; }
.wbox.zoom::after { content: ""; position: absolute; inset: 2px; border: 1px solid var(--ink); }
/* zoom and roll-up symbols change colour the same way the close X does */
.wbox.zoom:hover::after, .wbox.mini:hover::after { border-color: var(--accent); }
.wbox.zoom:active::after, .wbox.mini:active::after { border-color: #fff; }
.wbox.mini::after { content: ""; position: absolute; left: 2px; right: 2px; bottom: 2px; border-top: 2px solid var(--ink); }

.frame { flex: 1; min-height: 0; display: flex; padding: 0 5px 5px; }
.content {
  flex: 1; min-width: 0; overflow: auto; padding: 16px 18px 18px;
  background: var(--pane);
  border: 1px solid; border-color: var(--ink) var(--light) var(--light) var(--ink);
  /* window radius minus its border (1px) and the frame padding (5px), so the
     inner and outer curves share one centre */
  border-radius: calc(var(--radius) - 6px);
}
.content.paper { background: var(--paper); }
.content.flush { padding: 0; overflow: hidden; background: #999; }
.content iframe { display: block; width: 100%; height: 100%; border: 0; }
body.dragging iframe { pointer-events: none; }
body.dragging { user-select: none; }

/* resize grip: the grabbable area is the whole 28px corner, the drawing is three
   embossed ridges set inside the pane, clear of the rounded corner */
.grip {
  position: absolute; right: 0; bottom: 0; width: 28px; height: 28px;
  cursor: nwse-resize; touch-action: none;
  border-bottom-right-radius: var(--radius);
}
.grip::before {
  content: ""; position: absolute; right: 9px; bottom: 9px; width: 15px; height: 15px;
  background: linear-gradient(135deg, transparent 50%,
    #fff 50% 56%, var(--ink) 56% 62%, transparent 62% 68%,
    #fff 68% 74%, var(--ink) 74% 80%, transparent 80% 86%,
    #fff 86% 92%, var(--ink) 92% 98%, transparent 98%);
  opacity: .6; transition: opacity .2s, filter .2s;
}
.grip:hover::before, body.dragging .window.active .grip::before {
  opacity: 1; filter: drop-shadow(0 0 5px var(--glow)) drop-shadow(0 0 2px var(--glow));
}

/* ---------- Things inside windows ---------- */
h1 { margin: 0 0 6px; font: bold 22px/1.15 var(--ui); }
h2 { margin: 18px 0 6px; font: bold 14px/1.2 var(--ui); padding-bottom: 3px; border-bottom: 1px solid var(--shade); }
p { margin: 0 0 10px; }
.muted { font-size: 11px; opacity: .75; }
.about { display: flex; gap: 16px; align-items: flex-start; }
.about img {
  flex: none; width: 96px; height: 96px; border: 1px solid var(--ink); border-radius: 14px;
  image-rendering: pixelated; box-shadow: 0 0 24px var(--glow);
}
/* social links: a glass tile with the logo, and a label under it like a desktop icon */
.socials { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.social {
  display: grid; justify-items: center; gap: 5px; width: 64px; padding: 0; border: 0; background: none;
  color: var(--ink); text-decoration: none; font: 11px/1.2 var(--text); cursor: default;
}
.social .tile {
  display: grid; place-items: center; width: 46px; height: 46px;
  border: 1px solid var(--ink); border-radius: 13px;
  background: linear-gradient(145deg, #fff, var(--accent-hi) 55%, #8fc0ff);
  box-shadow: inset 1px 1px 0 var(--light), inset -2px -2px 0 var(--shade);
  transition: transform .2s, box-shadow .25s;
}
.social svg { width: 30px; height: 30px; fill: var(--ink); }
.social b { font-weight: normal; padding: 2px 6px; border-radius: 8px; background: rgb(240 247 255 / .7); }
.social:hover .tile, .social:focus-visible .tile {
  transform: translateY(-3px);
  box-shadow: inset 1px 1px 0 var(--light), inset -2px -2px 0 var(--shade), 0 0 20px var(--glow);
}
.social:hover b, .social:focus-visible b { background: var(--accent); color: #fff; box-shadow: 0 0 12px var(--glow); }
.social:focus-visible { outline: 0; }
.social:active .tile { background: var(--pressed); transform: none; }
.social:active svg { fill: #fff; }

/* label / value list, used by the PC spec window */
.specs { display: grid; grid-template-columns: max-content 1fr; margin: 14px 0 0; border-top: 1px solid var(--shade); }
.specs dt, .specs dd { margin: 0; padding: 7px 0; border-bottom: 1px solid rgb(10 40 110 / .18); }
.specs dt { padding-right: 18px; font: bold 12px/1.55 var(--ui); }
.specs dd .muted { display: block; }

/* status strip at the top of a window, like a Finder window's "3 items" line */
.infobar { display: flex; justify-content: space-between; gap: 12px; margin: -6px 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--shade); font-size: 11px; }
.infobar a { color: var(--ink); }

/* GitHub repository list */
.gh-list { display: grid; gap: 7px; }
.repo {
  display: grid; gap: 2px; padding: 8px 11px;
  border: 1px solid rgb(10 40 110 / .3); border-radius: 10px;
  background: rgb(255 255 255 / .5);
  color: var(--ink); text-decoration: none; cursor: default;
  transition: background .15s, box-shadow .25s;
}
.repo b { font: bold 13px/1.3 var(--ui); }
.repo .meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 11px; opacity: .75; }
.repo:hover, .repo:focus-visible { background: var(--accent); color: #fff; outline: 0; box-shadow: 0 0 16px var(--glow); }

.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.row.end { justify-content: flex-end; margin-top: 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 72px; height: 26px; padding: 0 14px;
  border: 1px solid var(--ink); border-radius: 12px;
  background: var(--btn-face);
  box-shadow: inset 1px 1px 0 var(--light), inset -2px -2px 0 var(--shade);
  font: bold 13px/1 var(--ui); cursor: default; transition: box-shadow .25s;
}
.btn:hover { box-shadow: inset 1px 1px 0 var(--light), inset -2px -2px 0 var(--shade), 0 0 18px var(--glow); }
.btn:active { color: #fff; background: var(--pressed); box-shadow: inset 1px 1px 0 var(--ink); }
.btn:focus-visible { outline: 1px dotted var(--ink); outline-offset: 3px; }
.btn.default { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ---------- Phones: one full-screen window at a time, no dragging ---------- */
@media (max-width: 640px) {
  .window {
    left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important;
    border-radius: 0; border-width: 0;
  }
  .grip, .wbox.zoom { display: none; }
  .task { flex-basis: 120px; }
  .content { border-radius: 6px; }
}
/* Visitors whose system has animations switched off: the endlessly drifting
   background stops. Window animations (open, close, zoom, flash) are short and
   only happen on a click, so they stay on for everyone. */
@media (prefers-reduced-motion: reduce) {
  .bg, .bg *, .bg::before, .bg::after { animation: none !important; }
}
