/* ============================================================
   NomuOS — core styling
   Theme: "Aurora" — deep indigo/violet base, teal + pink accents,
   glassmorphism panels, rounded corners, soft shadows.
   ============================================================ */

:root {
  --accent: #7c5cff;
  --accent-2: #21d4fd;
  --accent-3: #ff5c9d;
  --bg-0: #0b0d1a;
  --bg-1: #141833;
  --text: #eef1ff;
  --text-dim: #a9b0d6;
  --glass: rgba(28, 32, 64, 0.55);
  --glass-strong: rgba(20, 24, 51, 0.85);
  --stroke: rgba(255, 255, 255, 0.10);
  --stroke-strong: rgba(255, 255, 255, 0.18);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --radius: 16px;
  --radius-sm: 10px;
  --taskbar-h: 58px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --mono: "Cascadia Code", "Consolas", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg-0);
  user-select: none;
}

.hidden { display: none !important; }

button { font-family: inherit; cursor: pointer; color: inherit; }

/* ---------- Wallpaper ---------- */
body {
  background:
    radial-gradient(1200px 800px at 15% 10%, rgba(124, 92, 255, 0.35), transparent 60%),
    radial-gradient(1000px 700px at 85% 20%, rgba(33, 212, 253, 0.25), transparent 55%),
    radial-gradient(900px 700px at 60% 90%, rgba(255, 92, 157, 0.22), transparent 55%),
    linear-gradient(160deg, var(--bg-0), var(--bg-1));
  background-attachment: fixed;
}

/* ============================================================
   Boot screen
   ============================================================ */
.boot-screen {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 28px;
  z-index: 9999;
  background:
    radial-gradient(900px 700px at 50% 40%, rgba(124, 92, 255, 0.30), transparent 60%),
    linear-gradient(160deg, var(--bg-0), var(--bg-1));
  animation: bootFadeIn 0.6s ease;
}
.boot-screen.boot-out { animation: bootFadeOut 0.6s ease forwards; }

.boot-logo { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.boot-mark {
  width: 108px; height: 108px; border-radius: 28px;
  display: grid; place-items: center;
  font-size: 64px; font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 20px 60px rgba(124, 92, 255, 0.55);
  animation: floaty 3s ease-in-out infinite;
}
.boot-name { font-size: 34px; font-weight: 700; letter-spacing: 0.5px; }
.boot-tagline { font-size: 14px; color: var(--text-dim); }

.boot-progress {
  width: 240px; height: 6px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.10); overflow: hidden;
}
.boot-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 999px;
  animation: bootLoad 2.4s ease forwards;
}
.boot-hint { font-size: 12px; color: var(--text-dim); letter-spacing: 2px; text-transform: uppercase; }

@keyframes bootLoad { from { width: 0%; } to { width: 100%; } }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes bootFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes bootFadeOut { from { opacity: 1; } to { opacity: 0; visibility: hidden; } }

/* ============================================================
   Desktop
   ============================================================ */
.desktop { position: fixed; inset: 0; }

.desktop-icons {
  position: absolute; top: 16px; left: 16px;
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(auto-fill, 96px);
  grid-auto-columns: 90px;
  gap: 6px 8px;
  height: calc(100% - var(--taskbar-h) - 36px);
  align-content: start;
}
.desktop-icon {
  width: 90px; height: 96px;
  padding: 8px 4px; border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 8px;
  text-align: center; background: transparent; border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}
.desktop-icon:hover { background: rgba(255,255,255,0.06); border-color: var(--stroke); }
.desktop-icon .glyph {
  width: 52px; height: 52px; flex: 0 0 52px;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; line-height: 1;
}
.desktop-icon .label {
  font-size: 12px; color: var(--text); line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; max-height: 2.5em; width: 100%;
}

.window-layer { position: absolute; inset: 0; pointer-events: none; }
.window-layer .window { pointer-events: auto; }

/* ============================================================
   Windows
   ============================================================ */
.window {
  position: absolute;
  min-width: 280px; min-height: 180px;
  display: flex; flex-direction: column;
  background: var(--glass-strong);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  border: 1px solid var(--stroke-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: windowIn 0.18s ease;
}
.window.minimized { display: none; }
.window.maximized {
  border-radius: 0;
  top: 0 !important; left: 0 !important;
  width: 100% !important;
  height: calc(100% - var(--taskbar-h)) !important;
}
/* When an app is maximized (fullscreen), tuck the always-on-top gravity
   toggle and coffee pin out of the way so they don't overlap the app. */
body.wm-maximized #gravity-toggle,
body.wm-maximized #kofi-pin {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

/* ---- Buy-me-a-coffee pin: icon only, text on hover, QR on click ---- */
.kofi-pin {
  position: fixed; top: 60px; right: 16px; z-index: 5990;
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
  font-family: var(--font, "Segoe UI", sans-serif); color: #fff;
}
.kfp-row { display: flex; align-items: center; gap: 8px; }
.kfp-text {
  opacity: 0; transform: translateX(8px); pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  background: rgba(20,24,51,.65); backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.18);
  padding: 8px 12px; border-radius: 12px; font-size: 13px; font-weight: 600;
  white-space: nowrap; box-shadow: 0 6px 16px rgba(0,0,0,.28);
}
.kofi-pin:hover .kfp-text { opacity: 1; transform: none; }
.kfp-icon {
  width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(255,255,255,.18);
  background: rgba(20,24,51,.55); backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px); box-shadow: 0 8px 22px rgba(0,0,0,.3);
  font-size: 24px; line-height: 1; cursor: pointer; display: grid; place-items: center;
  transition: transform 0.12s ease, background 0.12s ease;
}
.kfp-icon:hover { transform: translateY(-2px) scale(1.05); background: rgba(114,164,242,.35); }
.kfp-qr {
  background: #fff; border-radius: 12px; padding: 10px; text-align: center;
  width: 200px; box-shadow: 0 8px 22px rgba(0,0,0,.3); animation: windowIn 0.15s ease;
}
.kfp-qr.hidden { display: none; }
.kfp-qr-img { width: 100%; max-width: 180px; height: auto; display: block; margin: 0 auto; border-radius: 6px; }
.kfp-qr-fallback { color: #333; font-size: 11px; line-height: 1.5; padding: 24px 6px; }
.kfp-thanks { color: #333; font-size: 12px; font-weight: 600; margin-top: 6px; }
@keyframes windowIn { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: scale(1); } }

.window-titlebar {
  height: 42px; flex: 0 0 42px;
  display: flex; align-items: center; gap: 10px;
  padding: 0 10px 0 14px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid var(--stroke);
  cursor: grab;
}
.window-titlebar:active { cursor: grabbing; }
.window-titlebar .w-icon { font-size: 16px; }
.window-titlebar .w-title { font-size: 13px; font-weight: 600; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.window-controls { display: flex; gap: 8px; }
.win-btn {
  width: 14px; height: 14px; border-radius: 50%;
  border: none; padding: 0; position: relative;
}
.win-btn.min { background: #ffd23f; }
.win-btn.max { background: #2fd671; }
.win-btn.close { background: #ff5c6c; }
.win-btn:hover { filter: brightness(1.15); }

.window-body {
  flex: 1; overflow: auto; position: relative;
  user-select: text;
}

.window-resizer {
  position: absolute; width: 16px; height: 16px;
  right: 0; bottom: 0; cursor: nwse-resize;
}

/* ============================================================
   Taskbar / dock
   ============================================================ */
.taskbar {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: 10px;
  height: var(--taskbar-h);
  min-width: 420px; max-width: calc(100% - 24px);
  display: flex; align-items: center; gap: 8px;
  padding: 0 10px;
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  border: 1px solid var(--stroke-strong);
  border-radius: 18px;
  box-shadow: var(--shadow);
  z-index: 5000;
}
.start-button {
  width: 42px; height: 42px; border-radius: 12px; border: none;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 20px rgba(124, 92, 255, 0.45);
  transition: transform 0.12s;
}
.start-button:hover { transform: translateY(-2px); }
.start-button-mark { font-weight: 800; font-size: 20px; color: #fff; }

.task-list { flex: 1; display: flex; align-items: center; gap: 6px; padding: 0 6px; overflow: hidden; }
.task-item {
  height: 42px; padding: 0 12px; border: 1px solid transparent; border-radius: 12px;
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.05); color: var(--text);
  font-size: 12px; max-width: 180px;
}
.task-item .t-glyph { font-size: 15px; }
.task-item .t-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-item:hover { background: rgba(255,255,255,0.10); }
.task-item.active { border-color: var(--accent); background: rgba(124,92,255,0.20); }

.tray { display: flex; align-items: center; gap: 10px; padding-right: 6px; }
.clock { font-size: 12px; color: var(--text-dim); text-align: right; line-height: 1.2; }

/* ============================================================
   Start menu
   ============================================================ */
.start-menu {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--taskbar-h) + 18px);
  width: 380px; max-width: calc(100% - 24px);
  padding: 16px;
  background: var(--glass-strong);
  backdrop-filter: blur(26px) saturate(150%);
  -webkit-backdrop-filter: blur(26px) saturate(150%);
  border: 1px solid var(--stroke-strong);
  border-radius: 18px; box-shadow: var(--shadow);
  z-index: 5001;
  animation: windowIn 0.15s ease;
}
.start-header { display: flex; align-items: center; gap: 12px; padding: 4px 4px 14px; }
.start-mark {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  font-weight: 800; font-size: 22px; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.start-title { font-weight: 700; }
.start-sub { font-size: 12px; color: var(--text-dim); }

.start-apps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.start-app {
  padding: 14px 8px; border-radius: 12px; border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.04);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-size: 12px; transition: transform 0.12s, background 0.12s;
}
.start-app:hover { transform: translateY(-2px); background: rgba(124,92,255,0.18); }
.start-app .glyph { font-size: 26px; }

.start-footer { display: flex; gap: 8px; margin-top: 14px; }
.start-action {
  flex: 1; padding: 10px; border-radius: 10px; border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.04); font-size: 12px;
}
.start-action:hover { background: rgba(255,255,255,0.10); }

/* ============================================================
   Generic app UI helpers
   ============================================================ */
.app { height: 100%; display: flex; flex-direction: column; color: var(--text); }
.app-pad { padding: 16px; }

.btn {
  padding: 8px 14px; border-radius: 10px; border: 1px solid var(--stroke-strong);
  background: rgba(255,255,255,0.06); color: var(--text); font-size: 13px;
}
.btn:hover { background: rgba(255,255,255,0.12); }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border: none; }

.row { display: flex; align-items: center; gap: 8px; }

/* ---------- Terminal ---------- */
.term { height: 100%; display: flex; flex-direction: column; background: rgba(6,8,20,0.65); }
.term-output { flex: 1; overflow: auto; padding: 12px 14px; font-family: var(--mono); font-size: 13px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.term-line { white-space: pre-wrap; }
.term-line .prompt { color: var(--accent-2); }
.term-line .err { color: var(--accent-3); }
.term-inputline { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-top: 1px solid var(--stroke); font-family: var(--mono); }
.term-inputline .prompt { color: var(--accent-2); }
.term-input { flex: 1; background: transparent; border: none; outline: none; color: var(--text); font-family: var(--mono); font-size: 13px; }

/* ---------- File Explorer ---------- */
.fx { height: 100%; display: flex; flex-direction: column; }
.fx-bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--stroke); }
.fx-path { flex: 1; font-family: var(--mono); font-size: 12px; color: var(--text-dim); background: rgba(0,0,0,0.25); padding: 6px 10px; border-radius: 8px; }
.fx-list { flex: 1; overflow: auto; padding: 10px; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; align-content: start; }
.fx-item { padding: 12px 6px; border-radius: 10px; border: 1px solid transparent; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.fx-item:hover { background: rgba(255,255,255,0.06); border-color: var(--stroke); }
.fx-item .glyph { font-size: 30px; }
.fx-item .name { font-size: 12px; word-break: break-word; }
.fx-empty { color: var(--text-dim); font-size: 13px; padding: 20px; }

/* ---------- Text Editor ---------- */
.ed { height: 100%; display: flex; flex-direction: column; }
.ed-bar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--stroke); }
.ed-name { flex: 1; font-size: 12px; color: var(--text-dim); }
.ed-area { flex: 1; width: 100%; resize: none; border: none; outline: none; padding: 14px; background: rgba(0,0,0,0.25); color: var(--text); font-family: var(--mono); font-size: 13px; line-height: 1.6; }

/* ---------- Settings ---------- */
.set { padding: 18px; display: flex; flex-direction: column; gap: 20px; overflow: auto; }
.set-group { display: flex; flex-direction: column; gap: 10px; }
.set-title { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-dim); }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 40px; height: 40px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.swatch.active { border-color: #fff; }
.wallpapers { display: flex; gap: 10px; flex-wrap: wrap; }
.wall-opt { width: 84px; height: 54px; border-radius: 10px; border: 2px solid transparent; cursor: pointer; }
.wall-opt.active { border-color: #fff; }

/* ============================================================
   Portfolio apps (About Me / Skills / Projects / Contact)
   ============================================================ */

/* shared bits */
.pill {
  display: inline-block; padding: 6px 12px; border-radius: 999px;
  background: rgba(124,92,255,0.16); border: 1px solid var(--stroke);
  font-size: 12px; color: var(--text);
}
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  display: inline-block; padding: 3px 9px; border-radius: 8px;
  background: rgba(33,212,253,0.14); border: 1px solid var(--stroke);
  font-size: 11px; color: var(--text-dim);
}

/* section kickers */
.me-kicker, .sk-kicker, .proj-kicker, .ct-kicker {
  font-size: 12px; text-transform: uppercase; letter-spacing: 2px;
  color: var(--accent-2); font-weight: 700; margin-bottom: 4px;
}

/* ---------- About Me ---------- */
.me { padding: 24px; display: flex; flex-direction: column; gap: 22px; }
.me-hero { display: flex; align-items: center; gap: 16px; }
.me-avatar {
  width: 76px; height: 76px; border-radius: 20px; flex: 0 0 76px;
  display: grid; place-items: center; font-size: 42px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 12px 30px rgba(124,92,255,0.45);
}
.me-id h1 { font-size: 22px; line-height: 1.2; }
.me-role { color: var(--accent-2); font-size: 12px; font-weight: 600; margin-top: 4px; }
.me-sep { color: var(--text-dim); margin: 0 6px; }
.me-tagline { color: var(--text-dim); font-size: 12px; margin-top: 6px; line-height: 1.5; font-style: italic; }
.me-section { display: flex; flex-direction: column; gap: 8px; }
.me-body p { color: var(--text-dim); font-size: 13px; line-height: 1.7; margin-bottom: 10px; }
.me-hobbies { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.me-hobby {
  padding: 12px 14px; border-radius: 12px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--stroke);
  display: flex; flex-direction: column; gap: 4px;
}
.me-hobby-head { display: flex; align-items: center; gap: 8px; color: var(--accent-2); }
.me-hobby-head strong { color: var(--text); font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.me-hobby-desc { font-size: 12px; color: var(--text-dim); }

/* ---------- Skills ---------- */
.skills { padding: 24px; display: flex; flex-direction: column; gap: 22px; }
.sk-group { display: flex; flex-direction: column; gap: 12px; }
.sk-title { font-size: 14px; font-weight: 700; }
.tech-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tech-card {
  padding: 12px 14px; border-radius: 12px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--stroke);
  transition: border-color 0.12s;
}
.tech-card:hover { border-color: var(--accent); }
.tech-cat { color: var(--accent-2); font-weight: 800; font-size: 12px; letter-spacing: 0.5px; margin-bottom: 4px; }
.tech-skills { font-family: var(--mono); font-size: 11px; color: var(--text-dim); }
.str-list { display: flex; flex-direction: column; gap: 14px; }
.str-head { display: flex; justify-content: space-between; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.str-pct { color: var(--accent-2); }
.str-track { height: 6px; border-radius: 999px; background: rgba(255,255,255,0.08); overflow: hidden; }
.str-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 1s ease; }
.dev-ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.dev-ul li { display: flex; gap: 10px; font-size: 13px; color: var(--text-dim); line-height: 1.5; }
.dev-ul li i { color: var(--accent-2); margin-top: 3px; font-size: 11px; }

/* ---------- Projects ---------- */
.proj { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.proj-grid { display: flex; flex-direction: column; gap: 12px; }
.proj-more-title { font-size: 13px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; margin-top: 10px; }
.proj-card {
  display: flex; gap: 14px; padding: 16px; border-radius: 14px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--stroke);
  transition: transform 0.12s, border-color 0.12s, background 0.12s;
}
.proj-card:hover { transform: translateY(-2px); border-color: var(--accent); background: rgba(124,92,255,0.10); }
.proj-icon {
  width: 40px; height: 40px; flex: 0 0 40px; border-radius: 10px;
  display: grid; place-items: center; font-size: 18px; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.proj-main { flex: 1; min-width: 0; }
.proj-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.proj-name { font-size: 15px; font-weight: 700; }
.proj-link { font-size: 12px; color: var(--accent-2); text-decoration: none; white-space: nowrap; }
.proj-link:hover { text-decoration: underline; }
.proj-link.disabled { color: var(--text-dim); cursor: default; }
.proj-desc { font-size: 13px; color: var(--text-dim); line-height: 1.6; margin-bottom: 10px; }
.proj-tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Contact ---------- */
.contact { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.ct-intro h2 { font-size: 18px; margin-bottom: 6px; }
.ct-intro p { font-size: 13px; color: var(--text-dim); line-height: 1.6; }
.ct-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: 14px; text-decoration: none;
  background: rgba(255,255,255,0.04); border: 1px solid var(--stroke); color: var(--text);
}
a.ct-card:hover { border-color: var(--accent); background: rgba(124,92,255,0.10); }
.ct-icon { font-size: 20px; color: var(--accent-2); width: 24px; text-align: center; }
.ct-info { display: flex; flex-direction: column; min-width: 0; }
.ct-label { font-size: 12px; color: var(--text-dim); }
.ct-value { font-size: 14px; font-weight: 600; word-break: break-word; }
.ct-group { display: flex; flex-direction: column; gap: 10px; }
.ct-title { font-size: 14px; font-weight: 700; }
.ct-socials { display: flex; flex-direction: column; gap: 8px; }
.social {
  display: flex; align-items: center; gap: 12px; text-decoration: none;
  padding: 10px 14px; border-radius: 12px; color: var(--text);
  background: rgba(255,255,255,0.04); border: 1px solid var(--stroke);
}
.social:hover { border-color: var(--accent-2); background: rgba(33,212,253,0.10); }
.social i { font-size: 18px; color: var(--accent-2); width: 22px; text-align: center; }
.social-label { flex: 1; font-size: 13px; }
.social-go { color: var(--accent-2); font-size: 13px; }


/* ============================================================
   Desktop widgets
   ============================================================ */
.widget-layer { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.widget-layer .widget { pointer-events: auto; }

.widget {
  position: absolute;
  display: flex; flex-direction: column;
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--stroke-strong);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: windowIn 0.16s ease;
}
.widget.dragging { opacity: 0.92; box-shadow: 0 24px 70px rgba(0,0,0,0.55); }

.widget-drag {
  display: flex; align-items: center; gap: 8px;
  height: 30px; flex: 0 0 30px; padding: 0 8px 0 10px;
  cursor: grab; background: rgba(255,255,255,0.05);
  border-bottom: 1px solid var(--stroke);
}
.widget-drag:active { cursor: grabbing; }
.wd-grip { color: var(--text-dim); font-size: 13px; letter-spacing: -1px; }
.wd-title { flex: 1; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wd-close {
  width: 18px; height: 18px; border-radius: 50%; border: none; padding: 0;
  background: rgba(255,255,255,0.08); color: var(--text-dim);
  font-size: 14px; line-height: 1; display: grid; place-items: center;
}
.wd-close:hover { background: var(--accent-3); color: #fff; }

.widget-body { flex: 1; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
.wg-head { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--accent-2); }
.wg-empty { color: var(--text-dim); font-size: 12px; }
.wg-btn {
  align-self: flex-start; margin-top: auto;
  padding: 6px 10px; border-radius: 8px; border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.05); color: var(--text); font-size: 11px;
}
.wg-btn:hover { background: rgba(124,92,255,0.20); border-color: var(--accent); }

/* clock */
.wg-clock { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.wg-time { font-size: 40px; font-weight: 800; line-height: 1; letter-spacing: 1px; }
.wg-date { font-size: 12px; color: var(--text-dim); margin-top: 8px; }

/* profile */
.wg-profile { display: flex; align-items: center; gap: 12px; height: 100%; }
.wg-avatar {
  width: 52px; height: 52px; flex: 0 0 52px; border-radius: 14px;
  display: grid; place-items: center; font-size: 30px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.wg-pinfo { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wg-pname { font-size: 14px; font-weight: 700; }
.wg-prole { font-size: 11px; color: var(--accent-2); margin-bottom: 4px; }

/* socials */
.wg-socials { display: flex; flex-direction: column; gap: 6px; }
.wg-social {
  display: flex; align-items: center; gap: 10px; text-decoration: none;
  padding: 7px 10px; border-radius: 9px; color: var(--text);
  background: rgba(255,255,255,0.04); border: 1px solid var(--stroke); font-size: 12px;
}
.wg-social:hover { border-color: var(--accent-2); background: rgba(33,212,253,0.10); }
.wg-social i { color: var(--accent-2); width: 18px; text-align: center; }

/* featured projects */
.wg-projs { display: flex; flex-direction: column; gap: 6px; }
.wg-proj {
  display: flex; align-items: center; gap: 10px; text-decoration: none;
  padding: 6px 8px; border-radius: 9px; color: var(--text);
  background: rgba(255,255,255,0.04); border: 1px solid var(--stroke); font-size: 12px;
}
a.wg-proj:hover { border-color: var(--accent); background: rgba(124,92,255,0.12); }
.wg-picon {
  width: 26px; height: 26px; flex: 0 0 26px; border-radius: 7px; color: #fff;
  display: grid; place-items: center; font-size: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.wg-pname2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* skills */
.wg-skills { display: flex; flex-direction: column; gap: 9px; }
.wg-skill { display: flex; flex-direction: column; gap: 4px; }
.wg-skhead { display: flex; justify-content: space-between; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-dim); }
.wg-sktrack { height: 5px; border-radius: 999px; background: rgba(255,255,255,0.08); overflow: hidden; }
.wg-skfill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

/* sticky note */
.wg-note {
  flex: 1; width: 100%; resize: none; border: none; outline: none;
  background: rgba(0,0,0,0.22); color: var(--text);
  border-radius: 10px; padding: 10px; font-family: var(--font); font-size: 13px; line-height: 1.5;
}

/* taskbar widgets button */
.tray-btn {
  width: 34px; height: 34px; border-radius: 10px;
  border: 1px solid var(--stroke); background: rgba(255,255,255,0.05);
  font-size: 16px; display: grid; place-items: center;
  transition: transform 0.2s ease, background 0.12s, border-color 0.12s;
}
.tray-btn:hover { background: rgba(124,92,255,0.20); border-color: var(--accent); }
/* up-arrow flips to point down while its panel is open */
.tray-btn.open { transform: rotate(180deg); background: rgba(124,92,255,0.20); border-color: var(--accent); }

/* ============================================================
   Widget picker / gallery
   ============================================================ */
.widget-picker {
  position: absolute; right: 12px;
  bottom: calc(var(--taskbar-h) + 18px);
  width: 320px; max-width: calc(100% - 24px);
  padding: 16px;
  background: var(--glass-strong);
  backdrop-filter: blur(26px) saturate(150%);
  -webkit-backdrop-filter: blur(26px) saturate(150%);
  border: 1px solid var(--stroke-strong);
  border-radius: 18px; box-shadow: var(--shadow);
  z-index: 5001;
  animation: windowIn 0.15s ease;
}
.wp-header { padding: 2px 2px 14px; }
.wp-title { font-weight: 700; font-size: 15px; }
.wp-sub { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.wp-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wp-item {
  padding: 12px 8px; border-radius: 12px; border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.04);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 12px; transition: transform 0.12s, background 0.12s;
}
.wp-item:hover { transform: translateY(-2px); background: rgba(124,92,255,0.18); border-color: var(--accent); }
.wp-item.active { border-color: var(--accent-2); background: rgba(33,212,253,0.12); }
.wp-item.active .wp-add { color: var(--accent-3); }
.wp-item.active:hover { background: rgba(255,92,108,0.16); border-color: var(--accent-3); }
.wp-glyph { font-size: 24px; }
.wp-name { font-weight: 600; }
.wp-add { font-size: 10px; color: var(--accent-2); text-transform: uppercase; letter-spacing: 1px; }

/* section headings inside the widgets + tasks panel */
.wp-section-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-dim); margin: 14px 2px 8px;
}
.wp-section-title:first-of-type { margin-top: 2px; }

/* task manager (running apps) list */
.tm-wrap { padding: 0; height: 100%; box-sizing: border-box; display: flex; flex-direction: column; }
.tm-tabs {
  display: flex; gap: 4px; padding: 10px 12px 0; flex: 0 0 auto;
  border-bottom: 1px solid var(--stroke);
}
.tm-tab {
  padding: 8px 12px; border: none; background: transparent; cursor: pointer;
  color: var(--text-dim); font-size: 12px; font-weight: 600;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color 0.12s, border-color 0.12s;
}
.tm-tab:hover { color: var(--text); }
.tm-tab.active { color: var(--text); border-bottom-color: var(--accent); }
.tm-panels { flex: 1; overflow-y: auto; padding: 12px; }
.tm-panel.hidden { display: none; }
.tm-list { display: flex; flex-direction: column; gap: 6px; }
.tm-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 10px;
  border: 1px solid var(--stroke); background: rgba(255,255,255,0.04);
  cursor: pointer; transition: background 0.12s, border-color 0.12s;
}
.tm-item:hover { background: rgba(124,92,255,0.18); border-color: var(--accent); }
.tm-item.active { border-color: var(--accent); background: rgba(124,92,255,0.16); }
.tm-item.minimized { opacity: 0.6; }
.tm-glyph { font-size: 16px; flex: 0 0 auto; }
.tm-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.tm-state { font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; }
.tm-close {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 7px; border: none;
  background: rgba(255,255,255,0.08); color: var(--text);
  font-size: 15px; line-height: 1; cursor: pointer; display: grid; place-items: center;
  transition: background 0.12s, color 0.12s;
}
.tm-close:hover { background: var(--accent-3); color: #fff; }
.tm-empty { font-size: 12px; color: var(--text-dim); padding: 10px 4px; text-align: center; }

/* task manager metric panels (performance / memory / network) */
.tm-metric { display: flex; flex-direction: column; gap: 10px; }
.tm-mrow { display: flex; align-items: baseline; justify-content: space-between; }
.tm-mrow > span:first-child { font-size: 12px; color: var(--text-dim); }
.tm-big { font-size: 30px; font-weight: 700; line-height: 1; }
.tm-big small { font-size: 13px; font-weight: 600; color: var(--text-dim); }
.tm-track { height: 8px; border-radius: 6px; background: rgba(255,255,255,0.08); overflow: hidden; }
.tm-fill {
  height: 100%; border-radius: 6px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.4s ease;
}
.tm-spark {
  display: flex; align-items: flex-end; gap: 2px;
  height: 48px; padding: 4px; border-radius: 8px;
  background: rgba(0,0,0,0.22);
}
.tm-bar { flex: 1; min-width: 2px; border-radius: 2px 2px 0 0; background: var(--accent-2); opacity: 0.85; }
.tm-kv {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; padding: 6px 0; border-bottom: 1px solid var(--stroke);
}
.tm-kv:last-of-type { border-bottom: none; }
.tm-kv span { color: var(--text-dim); }
.tm-kv b { font-weight: 600; }
.tm-note { font-size: 11px; color: var(--text-dim); line-height: 1.5; margin-top: 2px; }

/* tray flyout — the small box the arrow reveals, with two buttons */
.tray-flyout {
  position: absolute; right: 12px;
  bottom: calc(var(--taskbar-h) + 18px);
  display: flex; flex-direction: column; gap: 6px;
  padding: 8px;
  background: var(--glass-strong);
  backdrop-filter: blur(26px) saturate(150%);
  -webkit-backdrop-filter: blur(26px) saturate(150%);
  border: 1px solid var(--stroke-strong);
  border-radius: 14px; box-shadow: var(--shadow);
  z-index: 5001;
  animation: windowIn 0.15s ease;
}
.tf-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px 10px 10px; border-radius: 10px;
  border: 1px solid var(--stroke); background: rgba(255,255,255,0.04);
  color: var(--text); font-size: 13px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  transition: background 0.12s, border-color 0.12s;
}
.tf-btn:hover { background: rgba(124,92,255,0.18); border-color: var(--accent); }
.tf-glyph { font-size: 18px; }

/* ============================================================
   Projects as desktop apps
   ============================================================ */
/* single-project app window */
.proj-app {
  padding: 26px; height: 100%;
  display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 12px;
}
.proj-app-icon {
  width: 72px; height: 72px; border-radius: 20px;
  display: grid; place-items: center; font-size: 34px; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 12px 30px rgba(124, 92, 255, 0.45);
}
.proj-app-name { font-size: 20px; }
.proj-app-tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.proj-app-desc { font-size: 13px; color: var(--text-dim); line-height: 1.7; }
.proj-app-open { margin-top: auto; text-decoration: none; }
.proj-app-private { margin-top: auto; font-size: 12px; color: var(--text-dim); }

/* ============================================================
   Start menu: divider + View All Apps + All Apps drawer
   ============================================================ */
.start-divider { height: 1px; background: var(--stroke); margin: 14px 2px 12px; }
.start-viewall {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: 12px; border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.04); color: var(--text); font-size: 13px;
}
.start-viewall:hover { background: rgba(124,92,255,0.18); border-color: var(--accent); }
.va-glyph { font-size: 16px; }
.va-text { flex: 1; text-align: left; font-weight: 600; }
.va-arrow { color: var(--text-dim); font-size: 18px; }

.all-apps {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--taskbar-h) + 18px);
  width: 560px; max-width: calc(100% - 24px);
  max-height: calc(100% - var(--taskbar-h) - 60px);
  display: flex; flex-direction: column;
  background: var(--glass-strong);
  backdrop-filter: blur(26px) saturate(150%);
  -webkit-backdrop-filter: blur(26px) saturate(150%);
  border: 1px solid var(--stroke-strong);
  border-radius: 18px; box-shadow: var(--shadow);
  z-index: 5002; overflow: hidden; animation: windowIn 0.15s ease;
}
.aa-header { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--stroke); }
.aa-title { flex: 1; font-weight: 700; font-size: 15px; }
.aa-back, .aa-close {
  width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.05); color: var(--text);
  font-size: 18px; line-height: 1; display: grid; place-items: center;
}
.aa-back:hover, .aa-close:hover { background: rgba(255,255,255,0.12); }
.aa-scroll { padding: 14px 16px; overflow: auto; }
.aa-section-title { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-dim); margin: 6px 2px 10px; }
.aa-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; margin-bottom: 18px; }
.aa-item {
  padding: 12px 6px; border-radius: 12px; border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.04);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-size: 12px; transition: transform 0.12s, background 0.12s;
}
.aa-item:hover { transform: translateY(-2px); background: rgba(124,92,255,0.18); border-color: var(--accent); }
.aa-item .glyph { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; font-size: 28px; }
.aa-item .glyph.proj-tile {
  border-radius: 12px; color: #fff; font-size: 20px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 16px rgba(124,92,255,0.35);
}
.aa-item .label {
  font-size: 12px; text-align: center; line-height: 1.2; width: 100%;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}


/* ============================================================
   Browie — in-OS browser
   ============================================================ */
.browie { height: 100%; display: flex; flex-direction: column; background: rgba(6,8,20,0.55); }
.bw-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px; border-bottom: 1px solid var(--stroke);
  background: rgba(255,255,255,0.04);
}
.bw-nav {
  width: 32px; height: 32px; flex: 0 0 32px; border-radius: 9px;
  border: 1px solid var(--stroke); background: rgba(255,255,255,0.05);
  color: var(--text); font-size: 13px; display: grid; place-items: center;
}
.bw-nav:hover { background: rgba(255,255,255,0.12); }
.bw-nav:disabled { opacity: 0.35; cursor: default; }
.bw-addr {
  flex: 1; height: 32px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--stroke); background: rgba(0,0,0,0.30);
  color: var(--text); font-size: 13px; outline: none;
}
.bw-addr:focus { border-color: var(--accent); }
.bw-go {
  height: 32px; padding: 0 14px; border-radius: 9px; border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-size: 13px; font-weight: 600;
}

.bw-view { flex: 1; position: relative; background: #fff; }
.bw-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: none; background: #fff; }

/* home page */
.bw-home {
  position: absolute; inset: 0; overflow: hidden;
  background:
    radial-gradient(800px 500px at 50% 0%, rgba(124,92,255,0.25), transparent 60%),
    linear-gradient(160deg, var(--bg-0), var(--bg-1));
  display: flex; flex-direction: column;
}
.bw-home-inner { padding: 48px 24px; text-align: center; max-width: 640px; }
.bw-home-logo {
  font-size: 40px; font-weight: 800; letter-spacing: 0.5px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.bw-home-sub { color: var(--text-dim); font-size: 14px; margin: 6px 0 22px; }
.bw-home-search { display: flex; gap: 8px; margin: 0 auto 28px; max-width: 460px; }
.bw-home-search input {
  flex: 1; height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--stroke-strong); background: rgba(0,0,0,0.30);
  color: var(--text); font-size: 14px; outline: none;
}
.bw-home-search input:focus { border-color: var(--accent); }
.bw-home-search button {
  height: 40px; padding: 0 18px; border-radius: 999px; border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-size: 14px; font-weight: 600;
}
.bw-home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 14px; }
.bw-tile {
  padding: 14px 8px; border-radius: 14px; border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.05); color: var(--text);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-size: 12px; transition: transform 0.12s, background 0.12s;
}
.bw-tile:hover { transform: translateY(-3px); background: rgba(124,92,255,0.18); border-color: var(--accent); }
.bw-tile.disabled { opacity: 0.4; cursor: default; }
.bw-tile.disabled:hover { transform: none; background: rgba(255,255,255,0.05); border-color: var(--stroke); }
.bw-tile-icon {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  font-size: 20px; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.bw-tile-name { line-height: 1.2; }

/* news home */
.bw-news { display: flex; flex-direction: column; width: 100%; height: 100%; }
.bw-news-head { padding: 12px 16px 10px; flex: 0 0 auto; }
.bw-news-top { display: flex; align-items: center; gap: 14px; }
.bw-news-logo {
  font-size: 22px; font-weight: 800; letter-spacing: 0.4px; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.bw-news-search { display: flex; gap: 8px; flex: 1; }
.bw-news-search input {
  flex: 1; height: 36px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--stroke-strong); background: rgba(0,0,0,0.30);
  color: var(--text); font-size: 14px; outline: none;
}
.bw-news-search input:focus { border-color: var(--accent); }
.bw-news-search button {
  height: 36px; padding: 0 18px; border-radius: 999px; border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-size: 14px; font-weight: 600;
}
.bw-news-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.bw-chip {
  padding: 6px 14px; border-radius: 999px; border: 1px solid var(--stroke-strong);
  background: rgba(255,255,255,0.05); color: var(--text); font-size: 13px; cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.bw-chip:hover { background: rgba(124,92,255,0.18); border-color: var(--accent); }
.bw-chip.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent; color: #fff; font-weight: 600;
}
.bw-news-frame { flex: 1; width: 100%; border: none; background: #fff; }

/* refuse-to-connect page (shown when a site blocks embedding) — hosts the game */
.bw-card {
  position: absolute; inset: 0; overflow: auto;
  display: flex; align-items: flex-start; justify-content: center;
  background:
    radial-gradient(700px 460px at 50% 0%, rgba(124,92,255,0.18), transparent 60%),
    linear-gradient(160deg, var(--bg-0), var(--bg-1));
}
.bw-refuse { width: 100%; max-width: 660px; margin: 0 auto; padding: 26px 24px 30px; }
.bw-refuse-head { display: flex; align-items: flex-start; gap: 14px; }
.bw-refuse-icon { font-size: 42px; line-height: 1; }
.bw-refuse-title { font-size: 18px; font-weight: 700; }
.bw-refuse-sub { font-size: 13px; color: var(--text-dim); line-height: 1.6; margin-top: 6px; }
.bw-refuse-url { font-size: 12px; color: var(--accent-2); margin-top: 6px; word-break: break-all; }
.bw-refuse-actions { display: flex; gap: 10px; margin: 20px 0 6px; flex-wrap: wrap; }
.bw-refuse-actions .btn { text-decoration: none; }
.bw-refuse-gamewrap { margin-top: 18px; }
.bw-refuse-gametitle { font-size: 12px; color: var(--text-dim); margin-bottom: 8px; }

/* cat runner mini-game */
.bw-game { margin-top: 18px; }
.catgame {
  width: 100%; height: auto; display: block; border-radius: 12px;
  border: 1px solid var(--stroke); background: rgba(0,0,0,0.28);
  cursor: pointer; outline: none;
}
.catgame:focus { border-color: var(--accent); }
.catgame-hint { margin-top: 8px; font-size: 11px; color: var(--text-dim); }

/* ============================================================
   Mobile shell (iOS-style)
   ============================================================ */
#mobile.mobile { display: none; }
html.is-mobile #mobile.mobile { display: block; }
html.is-mobile #desktop,
html.is-mobile #boot-screen { display: none !important; }

/* iOS-style mobile boot */
.m-boot { display: none; position: fixed; inset: 0; z-index: 100000; background: #000; }
html.is-mobile #m-boot {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
html.is-mobile #m-boot.gone { display: none !important; }
.m-boot.out { animation: mBootFade 0.45s ease forwards; }
.m-boot-logo {
  color: #fff; font-size: 76px; font-weight: 800; line-height: 1; letter-spacing: 1px;
  text-shadow: 0 0 40px rgba(255,255,255,0.25);
}
.m-boot-name {
  margin-top: 16px; color: #fff; font-size: 20px; font-weight: 700; letter-spacing: 0.5px;
}
.m-boot-name span { font-weight: 400; color: rgba(255,255,255,0.6); font-size: 14px; }
.m-boot-progress {
  position: absolute; bottom: 13%; left: 50%; transform: translateX(-50%);
  width: 160px; height: 4px; border-radius: 999px;
  background: rgba(255,255,255,0.22); overflow: hidden;
}
.m-boot-bar { height: 100%; width: 0; background: #fff; border-radius: 999px; }
html.is-mobile #m-boot .m-boot-bar { animation: mBootLoad 2.5s ease forwards; }
@keyframes mBootLoad { from { width: 0; } to { width: 100%; } }
@keyframes mBootFade { to { opacity: 0; visibility: hidden; } }

.mobile {
  position: fixed; inset: 0; overflow: hidden;
  color: #fff;
  background:
    radial-gradient(900px 700px at 20% 0%, rgba(124,92,255,0.55), transparent 60%),
    radial-gradient(800px 700px at 90% 20%, rgba(33,212,253,0.40), transparent 55%),
    radial-gradient(700px 700px at 60% 100%, rgba(255,92,157,0.40), transparent 55%),
    linear-gradient(160deg, #0b0d1a, #141833);
  font-family: var(--font);
}

/* status bar */
.m-statusbar {
  height: 44px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px; font-size: 14px; font-weight: 600;
}
.m-status-right { display: flex; align-items: center; gap: 6px; }
.m-sig { letter-spacing: 1px; font-size: 11px; }
.m-wifi { font-size: 12px; }
.m-batt {
  width: 24px; height: 12px; border-radius: 3px; border: 1px solid rgba(255,255,255,0.7);
  padding: 1px; display: inline-flex; position: relative;
}
.m-batt::after { content: ""; position: absolute; right: -3px; top: 3px; width: 2px; height: 6px; background: rgba(255,255,255,0.7); border-radius: 0 1px 1px 0; }
.m-batt-fill { flex: 1; background: #fff; border-radius: 1px; }

/* home */
.m-home { position: absolute; top: 44px; left: 0; right: 0; bottom: 104px; overflow-y: auto; padding: 10px 18px 20px; }
.m-home-head { text-align: center; margin: 6px 0 22px; }
.m-home-mark {
  width: 58px; height: 58px; border-radius: 16px; margin: 0 auto 8px;
  display: grid; place-items: center; font-size: 30px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 12px 30px rgba(124,92,255,0.5);
}
.m-home-name { font-size: 20px; font-weight: 700; }
.m-home-sub { font-size: 12px; color: rgba(255,255,255,0.7); margin-top: 2px; }

.m-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px 12px; }
.m-icon {
  border: none; background: transparent; padding: 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.m-icon-tile {
  width: 60px; height: 60px; border-radius: 15px; /* iOS squircle-ish */
  display: grid; place-items: center; font-size: 30px; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 16px rgba(0,0,0,0.35);
  transition: transform 0.12s;
}
.m-icon:active .m-icon-tile { transform: scale(0.92); }
.m-icon-folder .m-icon-tile { background: rgba(255,255,255,0.18); backdrop-filter: blur(8px); }
.m-icon-glyph { line-height: 1; }
.m-icon-glyph i { font-size: 26px; }
.m-icon-label { font-size: 11px; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.4); max-width: 72px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* dock */
.m-dock {
  position: absolute; left: 12px; right: 12px; bottom: 26px;
  display: flex; justify-content: space-around; gap: 10px;
  padding: 12px; border-radius: 26px;
  background: rgba(255,255,255,0.14);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  border: 1px solid rgba(255,255,255,0.18);
}
.m-dock .m-icon-label { display: none; }
.m-dock .m-icon-tile { width: 56px; height: 56px; }

/* home indicator */
.m-homebar {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 8px;
  width: 134px; height: 5px; border-radius: 999px; background: rgba(255,255,255,0.6);
  z-index: 60; cursor: pointer;
}

/* app sheets */
.m-sheets { position: absolute; inset: 0; pointer-events: none; z-index: 50; }
.m-sheet {
  position: absolute; inset: 0; pointer-events: auto;
  display: flex; flex-direction: column;
  background: var(--glass-strong);
  backdrop-filter: blur(26px) saturate(150%);
  -webkit-backdrop-filter: blur(26px) saturate(150%);
  transform: translateY(100%); transition: transform 0.28s cubic-bezier(.22,1,.36,1);
}
.m-sheet.in { transform: translateY(0); }
.m-nav {
  height: 52px; flex: 0 0 52px; display: flex; align-items: center; gap: 8px;
  padding: 0 12px; border-bottom: 1px solid var(--stroke);
  background: rgba(255,255,255,0.05);
}
.m-back { border: none; background: transparent; color: var(--accent-2); font-size: 16px; font-weight: 600; padding: 6px 4px; }
.m-nav-title { flex: 1; text-align: center; font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-nav-icon { width: 40px; text-align: right; font-size: 18px; }
.m-appbody { flex: 1; overflow: auto; position: relative; }
.m-appbody .app { height: auto; }

/* projects folder overlay */
.m-folder {
  position: absolute; inset: 0; z-index: 70;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: rgba(0,0,0,0.45); backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  opacity: 0; transition: opacity 0.2s;
}
.m-folder.in { opacity: 1; }
.m-folder-inner {
  width: 100%; max-width: 420px; max-height: 78%; overflow-y: auto;
  background: rgba(255,255,255,0.10); border: 1px solid rgba(255,255,255,0.18);
  border-radius: 26px; padding: 20px 16px;
}
.m-folder-title { text-align: center; font-size: 15px; font-weight: 700; margin-bottom: 16px; }
.m-folder-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px 10px; }

/* ============================================================
   Screensaver (desktop + mobile)
   ============================================================ */
.screensaver {
  position: fixed; inset: 0; z-index: 100000;
  overflow: hidden;
  background:
    radial-gradient(1000px 800px at 30% 20%, rgba(124, 92, 255, 0.30), transparent 60%),
    radial-gradient(900px 700px at 80% 80%, rgba(33, 212, 253, 0.22), transparent 60%),
    linear-gradient(160deg, #05060f, #0b0d1a);
  opacity: 0;
  transition: opacity 0.4s ease;
  cursor: none;
}
.screensaver.in { opacity: 1; }

/* starfield */
.ss-stars { position: absolute; inset: 0; }
.ss-star {
  position: absolute; border-radius: 50%;
  background: #fff; opacity: 0.4;
  animation-name: ssTwinkle; animation-iteration-count: infinite;
  animation-timing-function: ease-in-out;
}
@keyframes ssTwinkle {
  0%, 100% { opacity: 0.12; transform: scale(0.8); }
  50% { opacity: 0.85; transform: scale(1.25); }
}

/* centered clock */
.ss-clock {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; text-align: center; pointer-events: none;
  animation: ssBreathe 6s ease-in-out infinite;
}
.ss-time {
  font-size: clamp(48px, 12vw, 130px); font-weight: 200; letter-spacing: 2px;
  color: var(--text);
  text-shadow: 0 8px 40px rgba(124, 92, 255, 0.45);
}
.ss-date {
  font-size: clamp(14px, 2.4vw, 22px); font-weight: 500;
  color: var(--text-dim); letter-spacing: 1px;
}
@keyframes ssBreathe {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; }
}

/* bouncing DVD-style logo */
.ss-logo {
  position: absolute; top: 0; left: 0; will-change: transform;
  display: inline-flex; align-items: center; gap: 12px;
  padding: 12px 22px 12px 14px; border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 12px 40px rgba(124, 92, 255, 0.5);
  transition: filter 0.3s ease;
}
.ss-logo-mark {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center;
  font-size: 26px; font-weight: 800; color: #fff;
  background: rgba(255, 255, 255, 0.18);
}
.ss-logo-name { font-size: 22px; font-weight: 700; color: #fff; letter-spacing: 0.5px; }

/* wake hint */
.ss-hint {
  position: absolute; left: 0; right: 0; bottom: 40px;
  text-align: center; font-size: 13px; letter-spacing: 1px;
  color: var(--text-dim); text-transform: uppercase; pointer-events: none;
  animation: ssBreathe 3s ease-in-out infinite;
}

/* Settings — screensaver options */
.ss-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.ss-opt {
  border: 1px solid var(--stroke-strong);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  padding: 7px 14px; border-radius: 999px; font-size: 13px;
  transition: transform 0.1s, border-color 0.15s, background 0.15s;
}
.ss-opt:hover { transform: translateY(-1px); background: rgba(255, 255, 255, 0.10); }
.ss-opt.active {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-weight: 600;
}


/* ============================================================
   Desktop lock screen (password protected)
   ============================================================ */
.lockscreen {
  position: fixed; inset: 0; z-index: 99000;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(1000px 800px at 30% 15%, rgba(124, 92, 255, 0.32), transparent 60%),
    radial-gradient(900px 700px at 80% 85%, rgba(33, 212, 253, 0.22), transparent 60%),
    linear-gradient(160deg, #06070f, #0d1024);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0; transition: opacity 0.35s ease;
}
.lockscreen.in { opacity: 1; }

.lock-inner {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 40px 48px; border-radius: 24px;
  background: var(--glass-strong);
  border: 1px solid var(--stroke-strong);
  box-shadow: var(--shadow);
}
.lock-inner.shake { animation: lockShake 0.4s ease; }
@keyframes lockShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(10px); }
  60% { transform: translateX(-7px); }
  80% { transform: translateX(7px); }
}

.lock-avatar {
  width: 84px; height: 84px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 40px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 14px 40px rgba(124, 92, 255, 0.5);
}
.lock-user { font-size: 20px; font-weight: 700; }
.lock-clock { text-align: center; margin: -4px 0 6px; }
.lock-time { display: block; font-size: 30px; font-weight: 300; letter-spacing: 1px; }
.lock-date { display: block; font-size: 13px; color: var(--text-dim); margin-top: 2px; }

.lock-form { display: flex; align-items: center; gap: 8px; }
.lock-input {
  width: 220px; height: 42px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--stroke-strong);
  background: rgba(255, 255, 255, 0.08); color: var(--text);
  font-size: 15px; font-family: inherit; outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.lock-input::placeholder { color: var(--text-dim); }
.lock-input:focus { border-color: var(--accent); background: rgba(255, 255, 255, 0.12); }
.lock-submit {
  width: 42px; height: 42px; flex: 0 0 42px;
  border: none; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-size: 18px; line-height: 1;
  display: grid; place-items: center;
  transition: transform 0.1s;
}
.lock-submit:hover { transform: scale(1.06); }
.lock-submit:active { transform: scale(0.94); }

.lock-error { min-height: 16px; font-size: 12px; color: #ff8a9c; }
.lock-hint {
  font-size: 13px; color: var(--text-dim); letter-spacing: 0.5px;
  margin-top: 2px;
}


/* ============================================================
   Mobile lock screen (6-digit PIN, iOS-style)
   ============================================================ */
.m-lock {
  position: absolute; inset: 0; z-index: 90;
  display: flex; flex-direction: column; align-items: center;
  padding: 40px 24px 24px;
  overflow-y: auto;
  background:
    radial-gradient(700px 600px at 30% 12%, rgba(124, 92, 255, 0.30), transparent 60%),
    radial-gradient(600px 500px at 80% 88%, rgba(33, 212, 253, 0.20), transparent 60%),
    linear-gradient(160deg, #06070f, #0d1024);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0; transition: opacity 0.35s ease;
}
.m-lock.in { opacity: 1; }

.m-lock-clock { text-align: center; margin-bottom: 8px; }
.m-lock-time { display: block; font-size: 40px; font-weight: 300; letter-spacing: 1px; }
.m-lock-date { display: block; font-size: 13px; color: var(--text-dim); margin-top: 2px; }

.m-lock-avatar {
  display: none;
}
.m-lock-title { font-size: 16px; font-weight: 600; margin: 12px 0 6px; }
.m-lock-hint {
  font-size: 13px; color: var(--accent-2); font-weight: 600;
  letter-spacing: 0.5px; margin-bottom: 20px;
}

/* PIN dots */
.m-pin { display: flex; gap: 18px; margin-bottom: 34px; }
.m-pin-dot {
  width: 14px; height: 14px; border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  background: transparent; transition: background 0.12s, transform 0.12s;
}
.m-pin-dot.filled { background: #fff; transform: scale(1.05); }
.m-pin.shake { animation: mPinShake 0.4s ease; }
@keyframes mPinShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(10px); }
  60% { transform: translateX(-7px); }
  80% { transform: translateX(7px); }
}

/* Round keypad */
.m-keys {
  display: grid; grid-template-columns: repeat(3, 72px);
  gap: 22px 26px; justify-content: center; align-items: center;
}
.m-key {
  width: 72px; height: 72px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.10);
  color: var(--text);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  line-height: 1; gap: 2px;
  transition: transform 0.08s, background 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.m-key:active { transform: scale(0.92); background: rgba(255, 255, 255, 0.22); }
.m-key-n { font-size: 28px; font-weight: 400; }
.m-key-s { font-size: 9px; letter-spacing: 1px; color: var(--text-dim); min-height: 10px; }
.m-key-spacer { width: 72px; height: 72px; }
.m-key-del {
  border: none; background: transparent; font-size: 24px;
}
.m-key-del:active { transform: scale(0.92); background: transparent; }

/* ============================================================
   Calculator app
   ============================================================ */
.calc {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 12px;
  gap: 12px;
  outline: none;
}

.calc-display {
  background: var(--glass-strong);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  text-align: right;
  min-height: 84px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
}

.calc-history {
  color: var(--text-dim);
  font-size: 13px;
  min-height: 18px;
  font-family: var(--mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calc-current {
  color: var(--text);
  font-size: 34px;
  font-weight: 600;
  font-family: var(--mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calc-pad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 1fr;
  gap: 8px;
  flex: 1;
}

.calc-btn {
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  background: var(--glass);
  color: var(--text);
  font-size: 18px;
  font-weight: 500;
  transition: transform 0.05s ease, background 0.15s ease, filter 0.15s ease;
}

.calc-btn:hover { background: rgba(255, 255, 255, 0.08); }
.calc-btn:active { transform: scale(0.95); }

.calc-action { color: var(--accent-3); }

.calc-op {
  background: rgba(124, 92, 255, 0.18);
  color: var(--accent-2);
  font-size: 20px;
}
.calc-op:hover { background: rgba(124, 92, 255, 0.3); }

.calc-equals {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 700;
}
.calc-equals:hover { filter: brightness(1.1); }

.calc-zero { grid-column: span 2; }

/* ============================================================
   Paint app
   ============================================================ */
.pnt {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.pnt-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--stroke);
  background: var(--glass);
  flex-wrap: wrap;
}

.pnt-tool { display: inline-flex; align-items: center; }

.pnt-bar input[type="color"] {
  width: 34px;
  height: 28px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  background: transparent;
  padding: 2px;
  cursor: pointer;
}

.pnt-bar input[type="range"] { width: 90px; cursor: pointer; }

.pnt-bar .btn.active {
  background: var(--accent);
  color: #fff;
}

.pnt-spacer { flex: 1; }

.pnt-stage {
  flex: 1;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: repeating-conic-gradient(rgba(255,255,255,0.03) 0% 25%, transparent 0% 50%) 50% / 20px 20px;
}

#pnt-canvas {
  background: #ffffff;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  cursor: crosshair;
  max-width: 100%;
  touch-action: none;
}

.pnt-status {
  padding: 6px 12px;
  font-size: 12px;
  color: var(--text-dim);
  border-top: 1px solid var(--stroke);
  min-height: 26px;
}


/* ============================================================
   Start menu search bar
   ============================================================ */
.start-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  margin: 4px 0 12px;
}

.start-search-icon {
  position: absolute;
  left: 12px;
  font-size: 13px;
  opacity: 0.7;
  pointer-events: none;
}

.start-search {
  width: 100%;
  padding: 10px 12px 10px 34px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  background: var(--glass-strong);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.start-search::placeholder { color: var(--text-dim); }

.start-search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(124, 92, 255, 0.25);
}

.start-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  padding: 18px 0;
}


/* ============================================================
   Calendar app
   ============================================================ */
.cal {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 12px;
  gap: 10px;
}

.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.cal-nav {
  width: 32px;
  height: 32px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  background: var(--glass);
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  transition: background 0.15s ease;
}
.cal-nav:hover { background: rgba(255, 255, 255, 0.08); }

.cal-weekdays,
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-wd {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  padding: 4px 0;
}

.cal-grid { flex: 1; }

.cal-day {
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--glass);
  color: var(--text);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.05s ease;
}
.cal-day:hover:not(:disabled) { background: rgba(255, 255, 255, 0.1); }
.cal-day:active:not(:disabled) { transform: scale(0.94); }

.cal-day.muted {
  color: var(--text-dim);
  opacity: 0.35;
  background: transparent;
}

.cal-day.today {
  border-color: var(--accent-2);
  color: var(--accent-2);
  font-weight: 700;
}

.cal-day.selected {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 700;
}

.cal-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--stroke);
  padding-top: 8px;
}

.cal-selected {
  font-size: 12px;
  color: var(--text-dim);
}


/* Clickable taskbar clock (opens Calendar) */
.clock.clickable {
  cursor: pointer;
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  transition: background 0.15s ease;
}
.clock.clickable:hover { background: rgba(255, 255, 255, 0.1); }
