/* DataLab — the computer screen when sitting at a desk (pcdesk.js): three looks, Windows / Linux / macOS.
   The apps' own windows (.overlay, z-index 10) open on top of it. */

.pcd {
  position: absolute; inset: 0; z-index: 9;
  display: grid; place-items: center;
  background: rgba(3, 5, 10, 0.72);
  backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
  opacity: 0; visibility: hidden;
  transition: opacity 0.25s, visibility 0s 0.25s;
}
.pcd.is-open { opacity: 1; visibility: visible; transition: opacity 0.3s; }
.pcd[hidden] { display: none; }

/* the monitor: a dark bezel around the screen */
.pcd-screen {
  position: relative; overflow: hidden;
  width: min(96vw, calc((100dvh - 64px) * 1.6)); aspect-ratio: 16 / 10; max-height: calc(100dvh - 64px);
  border: 9px solid #0a0b0e; border-bottom-width: 14px; border-radius: 14px !important;
  box-shadow: 0 0 0 1px #2a2d36, 0 24px 80px rgba(0, 0, 0, 0.7), 0 0 60px var(--pcd-glow, rgba(61, 255, 162, 0.12));
  transform: scale(0.96); transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.25, 1.05);
  font-family: var(--pcd-font); color: var(--pcd-fg, #fff);
  -webkit-user-select: none; user-select: none;
}
.pcd.is-open .pcd-screen { transform: none; }
.pcd-screen button { font-family: inherit; cursor: pointer; }
.pcd-wp, .pcd-wins { position: absolute; inset: 0; }
.pcd-wins { pointer-events: none; }
.pcd-win { pointer-events: auto; }

/* ---------- shortcuts on the desktop ---------- */
.pcd-icons {
  position: absolute; left: 10px; top: 38px; bottom: 58px; z-index: 1;
  display: grid; grid-auto-flow: column; grid-template-rows: repeat(auto-fill, 78px); grid-auto-columns: 84px;
  align-content: start; gap: 4px;
}
.pcd-ico {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 5px 2px;
  border: 1px solid transparent; border-radius: 6px !important; background: none; color: #fff;
  font-size: 11px; line-height: 1.15; text-align: center; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}
.pcd-ico:hover, .pcd-ico:focus-visible { background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.28); outline: none; }
.pcd-ico .pcd-lbl { max-width: 80px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pcd-tile {
  position: relative; display: grid; place-items: center; flex: none;
  width: 38px; height: 38px; border-radius: 10px !important;
  background: linear-gradient(160deg, color-mix(in srgb, var(--app-c) 82%, #fff 18%), var(--app-c)); color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.pcd-tile svg { width: 64%; height: 64%; }
.pcd-badge {
  position: absolute; top: -5px; right: -5px; min-width: 15px; height: 15px; padding: 0 4px;
  border-radius: 8px !important; background: #ff3b5c; color: #fff; font: 700 9px/15px system-ui, sans-serif; text-align: center; text-shadow: none;
}
.pcd-badge[hidden] { display: none; }
.is-launch .pcd-tile { animation: pcd-bounce 0.4s ease; }
@keyframes pcd-bounce { 40% { transform: translateY(-9px); } }

/* ---------- start menu / app grid (shared bones) ---------- */
.pcd-menu {
  position: absolute; z-index: 6; display: flex; flex-direction: column; gap: 10px; padding: 14px;
  background: rgba(32, 33, 38, 0.94); color: #fff; border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55); animation: pcd-pop 0.18s ease;
}
.pcd-menu[hidden] { display: none; }
@keyframes pcd-pop { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
.pcd-menu__head { display: flex; align-items: baseline; justify-content: space-between; font-size: 12px; }
.pcd-menu__head span { opacity: 0.6; font-size: 11px; }
.pcd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; overflow-y: auto; min-height: 0; }
.pcd-gapp { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px 2px; border: 0; border-radius: 8px !important; background: none; color: inherit; font-size: 11px; text-align: center; }
.pcd-gapp:hover, .pcd-gapp:focus-visible { background: rgba(255, 255, 255, 0.12); outline: none; }
.pcd-menu__foot { display: flex; flex-wrap: wrap; gap: 4px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, 0.12); }
.pcd-sys { display: flex; align-items: center; gap: 7px; padding: 6px 10px; border: 0; border-radius: 6px !important; background: none; color: inherit; font-size: 12px; text-align: left; }
.pcd-sys:hover, .pcd-sys:focus-visible { background: rgba(255, 255, 255, 0.14); outline: none; }
.pcd-sysico { width: 14px; height: 14px; flex: none; }
.pcd-menu hr { width: 100%; border: 0; border-top: 1px solid rgba(255, 255, 255, 0.14); margin: 2px 0; }
.pcd-tray { display: flex; align-items: center; gap: 12px; }
.pcd-tray__ico { display: inline-flex; gap: 8px; }
.pcd-tray__ico svg { width: 14px; height: 14px; }
.pcd-clock { display: grid; text-align: right; line-height: 1.1; }
.pcd-clock small { font-size: 9px; opacity: 0.75; }

/* ---------- small windows ---------- */
.pcd-win { position: absolute; left: 50%; top: 22%; width: min(330px, 80%); transform: translateX(-50%); border-radius: 10px !important; overflow: hidden; box-shadow: 0 16px 44px rgba(0, 0, 0, 0.55); background: #fff; color: #1b1c20; font-size: 12px; }
.pcd-win__bar { display: flex; align-items: center; gap: 10px; padding: 8px 10px; cursor: grab; font-size: 12px; background: #e9eaee; }
.pcd-win__bar b { font-weight: 600; }
.pcd-win__dots { display: flex; gap: 6px; }
.pcd-win__dots i, .pcd-win__x { width: 12px; height: 12px; border-radius: 50% !important; border: 0; padding: 0; background: #c9ccd3; display: block; }
.pcd-win__body { padding: 16px 18px 18px; display: grid; gap: 10px; }
.pcd-win__logo svg { width: 38px; height: 38px; }
.pcd-win h3 { margin: 0; font-size: 18px; font-weight: 600; }
.pcd-win dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; }
.pcd-win dt { opacity: 0.6; } .pcd-win dd { margin: 0; }
.pcd-win p { margin: 0; opacity: 0.65; font-size: 11px; line-height: 1.4; }

/* =================================================== Windows =================================================== */
.pcd--win { --pcd-font: 'Segoe UI', 'Segoe UI Variable', system-ui, -apple-system, sans-serif; --pcd-glow: rgba(56, 130, 246, 0.25); }
.pcd--win .pcd-wp {
  background:
    radial-gradient(50% 70% at 72% 62%, rgba(96, 165, 250, 0.85), transparent 70%),
    radial-gradient(40% 60% at 28% 72%, rgba(139, 92, 246, 0.7), transparent 70%),
    radial-gradient(60% 50% at 55% 20%, rgba(14, 165, 233, 0.5), transparent 70%),
    linear-gradient(135deg, #07123a, #1741b8 60%, #0a8ed6);
}
.pcd-bar--win {
  position: absolute; left: 0; right: 0; bottom: 0; height: 44px; z-index: 5;
  display: flex; align-items: center; justify-content: center; padding: 0 12px;
  background: rgba(28, 29, 34, 0.82); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.pcd-bar--win .pcd-bar__mid { display: flex; align-items: center; gap: 4px; }
.pcd-bar--win .pcd-tray { position: absolute; right: 14px; font-size: 11px; }
.pcd-start { display: grid; place-items: center; width: 38px; height: 36px; border: 0; border-radius: 6px !important; background: none; color: #4cc2ff; }
.pcd-start svg { width: 19px; height: 19px; }
.pcd-start:hover, .pcd-pin:hover, .pcd-start:focus-visible, .pcd-pin:focus-visible { background: rgba(255, 255, 255, 0.12); outline: none; }
.pcd-pin { position: relative; display: grid; place-items: center; width: 38px; height: 36px; padding: 0; border: 0; border-radius: 6px !important; background: none; color: #fff; }
.pcd-pin .pcd-tile { width: 26px; height: 26px; border-radius: 7px !important; }
.pcd-pin .pcd-badge { top: -3px; right: -1px; }
.pcd-menu--start { left: 50%; bottom: 54px; transform: translateX(-50%); width: min(440px, 92%); max-height: 70%; border-radius: 12px !important; }
.pcd--win .pcd-win__bar { flex-direction: row-reverse; justify-content: space-between; background: #f3f3f3; }
.pcd--win .pcd-win__dots { flex-direction: row-reverse; }
.pcd--win .pcd-win__dots i, .pcd--win .pcd-win__x { border-radius: 2px !important; background: #d8d8dc; width: 14px; height: 10px; }
.pcd--win .pcd-win__x { background: #e5484d; }
.pcd--win .pcd-win { border-radius: 8px !important; }

/* =================================================== Linux (GNOME-like) =================================================== */
.pcd--linux { --pcd-font: 'Ubuntu', 'Cantarell', 'Noto Sans', system-ui, sans-serif; --pcd-glow: rgba(233, 84, 32, 0.22); }
.pcd--linux .pcd-wp {
  background:
    radial-gradient(60% 70% at 85% 90%, rgba(233, 84, 32, 0.95), transparent 65%),
    radial-gradient(50% 60% at 15% 15%, rgba(119, 33, 111, 0.9), transparent 70%),
    linear-gradient(160deg, #2c001e, #5e2750 55%, #a8330f);
}
.pcd--linux .pcd-icons { left: 78px; top: 36px; bottom: 12px; }
.pcd-bar--top {
  position: absolute; left: 0; right: 0; top: 0; height: 26px; z-index: 5; display: flex; align-items: center; justify-content: space-between; padding: 0 8px;
  background: #000; font-size: 12px;
}
.pcd-act { border: 0; background: none; color: #fff; padding: 2px 10px; border-radius: 12px !important; font-size: 12px; font-weight: 500; }
.pcd-act:hover, .pcd-act:focus-visible { background: rgba(255, 255, 255, 0.16); outline: none; }
.pcd-clock--mid { position: absolute; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; align-items: baseline; text-align: center; }
.pcd-bar--top .pcd-tray { font-size: 11px; }
.pcd-user { opacity: 0.85; }
.pcd-dock--side {
  position: absolute; left: 8px; top: 34px; bottom: 8px; z-index: 5; width: 54px; padding: 8px 0;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: rgba(30, 20, 30, 0.55); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-radius: 14px !important; overflow-y: auto;
}
.pcd-dock--side .pcd-pin { width: 42px; height: 42px; flex: none; border-radius: 9px !important; }
.pcd-dock--side .pcd-pin .pcd-tile { width: 32px; height: 32px; }
.pcd-dock--side .pcd-pin--grid { margin-top: auto; }
.pcd-dock--side .pcd-pin--grid svg { width: 22px; height: 22px; }
.pcd-menu--grid { inset: 26px 0 0 0; border-radius: 0 !important; background: rgba(40, 20, 40, 0.9); padding: 20px 6%; }
.pcd--linux .pcd-menu--grid .pcd-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.pcd--linux .pcd-win__bar { background: #3c3c3c; color: #fff; flex-direction: row-reverse; justify-content: space-between; }
.pcd--linux .pcd-win__dots { flex-direction: row-reverse; }
.pcd--linux .pcd-win__x { background: #e95420; }
.pcd--linux .pcd-win { border-radius: 10px 10px 6px 6px !important; }

/* =================================================== macOS =================================================== */
.pcd--mac { --pcd-font: -apple-system, 'SF Pro Text', 'Helvetica Neue', system-ui, sans-serif; --pcd-glow: rgba(190, 120, 255, 0.25); }
.pcd--mac .pcd-wp {
  background:
    radial-gradient(60% 80% at 20% 90%, rgba(255, 94, 138, 0.9), transparent 65%),
    radial-gradient(60% 70% at 85% 25%, rgba(94, 197, 255, 0.85), transparent 65%),
    radial-gradient(50% 60% at 55% 60%, rgba(168, 85, 247, 0.75), transparent 70%),
    linear-gradient(150deg, #1e1b4b, #5b21b6 55%, #f472b6);
}
.pcd-bar--mac {
  position: absolute; left: 0; right: 0; top: 0; height: 26px; z-index: 5; display: flex; align-items: center; gap: 14px; padding: 0 12px;
  background: rgba(255, 255, 255, 0.28); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); color: #fff; font-size: 12px; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.pcd-apple { display: grid; place-items: center; border: 0; background: none; color: #fff; padding: 2px 4px; border-radius: 4px !important; }
.pcd-apple svg { width: 15px; height: 15px; }
.pcd-apple:hover, .pcd-apple:focus-visible { background: rgba(255, 255, 255, 0.25); outline: none; }
.pcd-appname { font-weight: 700; }
.pcd-mmenus { display: flex; gap: 14px; }
.pcd-bar--mac .pcd-tray { margin-left: auto; font-size: 11px; }
.pcd-bar--mac .pcd-clock { display: flex; gap: 6px; align-items: baseline; }
.pcd-menu--apple { left: 8px; top: 28px; width: 220px; padding: 6px; border-radius: 8px !important; gap: 0; background: rgba(60, 60, 66, 0.85); }
.pcd-menu--launch { inset: 26px 0 0 0; border-radius: 0 !important; background: rgba(30, 20, 60, 0.6); padding: 28px 8%; }
.pcd-dock--bottom {
  position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); z-index: 5; max-width: 96%;
  display: flex; align-items: flex-end; gap: 6px; padding: 6px 10px;
  background: rgba(255, 255, 255, 0.22); border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 18px !important; backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
}
.pcd-dock--bottom .pcd-pin { width: 44px; height: 44px; border-radius: 10px !important; transition: transform 0.15s; transform-origin: bottom; }
.pcd-dock--bottom .pcd-pin .pcd-tile { width: 40px; height: 40px; border-radius: 10px !important; }
.pcd-dock--bottom .pcd-pin:hover { transform: scale(1.35) translateY(-4px); background: none; z-index: 2; }
.pcd-dock--bottom .pcd-pin--grid svg { width: 26px; height: 26px; color: #fff; }
.pcd-sep { width: 1px; align-self: stretch; margin: 4px 2px; background: rgba(255, 255, 255, 0.4); }
.pcd--mac .pcd-win__bar { background: linear-gradient(#ececec, #d6d6d6); }
.pcd--mac .pcd-win__bar b { margin: 0 auto; padding-right: 48px; }
.pcd--mac .pcd-win__dots i { background: #febc2e; } .pcd--mac .pcd-win__dots i + i { background: #28c840; } .pcd--mac .pcd-win__x { background: #ff5f57; }
.pcd--mac .pcd-win { border-radius: 10px !important; }
.pcd--mac .pcd-icons { top: 36px; bottom: 80px; left: auto; right: 10px; grid-auto-flow: column; direction: rtl; }
.pcd--mac .pcd-icons > * { direction: ltr; }

/* ---------- the chip that brings the screen back ---------- */
.pcd-chip {
  position: absolute; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 8;
  display: flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid #3dffa2; border-radius: 999px !important;
  background: rgba(8, 20, 16, 0.88); color: #3dffa2; font: 12px 'Silkscreen', monospace; cursor: pointer;
}
.pcd-chip[hidden] { display: none; }
.pcd-chip:hover, .pcd-chip:focus-visible { background: rgba(61, 255, 162, 0.16); outline: none; }
.pcd-chip__ico { width: 14px; height: 10px; border: 2px solid currentColor; border-radius: 2px !important; position: relative; }
.pcd-chip__ico::after { content: ''; position: absolute; left: 2px; right: 2px; bottom: -5px; height: 2px; background: currentColor; }

/* small screens: the computer fills the whole window */
@media (max-width: 760px), (max-height: 520px) {
  .pcd-screen { width: 100vw; height: 100dvh; max-height: none; aspect-ratio: auto; border: 0; border-radius: 0 !important; }
  .pcd-mmenus { display: none; }
  .pcd-icons { grid-auto-columns: 72px; }
}
@media (prefers-reduced-motion: reduce) { .pcd, .pcd-screen { transition: none; } .pcd-menu { animation: none; } }
