/* ChaseOS: a simple dark desktop in the spirit of daedalOS. One icon, one thing. */
:root {
  color-scheme: dark;
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", "Noto Sans TC", sans-serif;
  --mono: "Cascadia Code", "Cascadia Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --text: #f2f4f8;
  --muted: #a9b1bf;
  --accent: #3b9cff;
  --accent-ink: #ffffff;
  --live: #4ade80;
  --win: #121419;
  --win-bar: #0c0e12;
  --win-line: rgba(255, 255, 255, 0.09);
  --card: rgba(255, 255, 255, 0.05);
  --hover: rgba(255, 255, 255, 0.08);
  --press: rgba(255, 255, 255, 0.04);
  --taskbar: rgba(4, 5, 8, 0.92);
  --taskbar-h: 40px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: clip; }
body { font: 14px/1.5 var(--font); color: var(--text); background: #08111f; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; color: inherit; }
button { cursor: default; }
a { color: var(--accent); }
svg { display: block; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
body.is-dragging, body.is-dragging * { user-select: none; }

/* Plain page without JavaScript (also what search engines read). */
.fallback { max-width: 680px; margin: 0 auto; padding: 48px 20px; background: #fff; color: #1a1a1a; min-height: 100%; overflow: auto; }
.fallback a { color: #0b5cad; }
.os { display: none; }
.js .fallback { display: none; }
.js .os { display: block; height: 100dvh; }

/* ---------- wallpaper: looping night-sky video (os/wallpaper.mp4) ---------- */
.wall { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: #000 url("./wallpaper.jpg") center / cover no-repeat; }
.wall__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }

/* ---------- desktop ---------- */
.desktop { position: absolute; inset: 0 0 var(--taskbar-h) 0; z-index: 1; }
.icons { list-style: none; margin: 0; padding: 8px 6px; display: grid; grid-auto-flow: column; grid-template-rows: repeat(auto-fill, 96px); grid-auto-columns: 86px; gap: 4px 2px; height: 100%; align-content: start; }
.dicon { width: 82px; padding: 6px 2px 4px; display: grid; justify-items: center; gap: 5px; border: 1px solid transparent; background: none; color: #fff; text-align: center; font-size: 12px; line-height: 1.25; }
.dicon__img { position: relative; width: 46px; height: 46px; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.45)); }
.dicon__img > svg, .dicon__img > img { width: 46px; height: 46px; display: block; }
.dicon__img > img { border-radius: 10px; object-fit: cover; }
.dicon__live { position: absolute; right: -8px; top: -4px; padding: 0 4px; border-radius: 3px; background: var(--live); color: #052e14; font: 700 9px/14px var(--font); letter-spacing: 0.02em; }
.dicon__label { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9), 0 0 4px rgba(0, 0, 0, 0.6); }
.dicon:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.14); }
.dicon.is-selected { background: rgba(59, 156, 255, 0.28); border-color: rgba(59, 156, 255, 0.55); }
.dicon.is-selected .dicon__label { -webkit-line-clamp: 4; }

/* ---------- windows ---------- */
.windows { position: absolute; inset: 0; pointer-events: none; }
.win { position: absolute; display: flex; flex-direction: column; min-width: 300px; min-height: 200px; pointer-events: auto; background: var(--win); border: 1px solid rgba(255, 255, 255, 0.12); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(0, 0, 0, 0.4); overflow: hidden; outline: none; resize: both; }
.win:not(.is-active) { box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4); }
.win:not(.is-active) .win__bar { color: var(--muted); }
.win.is-max { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; resize: none; border: 0; }
.win__bar { flex: none; display: flex; align-items: center; height: 32px; padding-left: 10px; gap: 8px; background: var(--win-bar); border-bottom: 1px solid var(--win-line); touch-action: none; }
.win.is-active .win__bar { background: #0f1218; }
.win__icon svg { width: 16px; height: 16px; }
.win__title { margin: 0; flex: 1; min-width: 0; font-size: 12px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win__btn { width: 44px; align-self: stretch; border: 0; background: none; display: grid; place-items: center; color: inherit; }
.win__btn svg { width: 10px; height: 10px; }
.win__btn:hover { background: var(--hover); }
.win__btn:active { background: var(--press); }
.win__btn--close:hover { background: #e81123; color: #fff; }
.win__body { flex: 1; min-height: 0; overflow: auto; }

/* window content */
.pad { padding: 22px 26px; }
.pad h3 { margin: 4px 0 8px; font-size: 24px; font-weight: 600; line-height: 1.2; }
.pad h4 { margin: 18px 0 4px; font-size: 15px; font-weight: 600; }
.pad p { margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.lede { font-size: 16px; }
.who { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.who h3 { margin: 0; }
.who p { margin: 0; }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #5aa2ff, #2557d6); color: #fff; font-weight: 700; font-size: 13px; flex: none; }
.avatar--l { width: 64px; height: 64px; font-size: 22px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.status { display: inline-flex; align-items: center; gap: 8px; padding: 2px 10px; border-radius: 999px; background: var(--card); font-size: 12px; font-weight: 600; color: var(--muted); }
.status--live { color: var(--live); background: rgba(74, 222, 128, 0.12); }
.status--live .dot, .rows .dot { background: var(--live); box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.2); }
.status--building { color: #fbbf24; background: rgba(251, 191, 36, 0.12); }
.status--building .dot { background: #fbbf24; }
.points { margin: 10px 0; padding-left: 20px; }
.points li { margin-bottom: 4px; }
.stack { margin-top: 12px !important; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.btn { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 14px; border: 1px solid rgba(255, 255, 255, 0.18); background: rgba(255, 255, 255, 0.06); color: var(--text); text-decoration: none; white-space: nowrap; }
.btn svg { width: 12px; height: 12px; }
.btn:hover { background: rgba(255, 255, 255, 0.12); }
.btn:active { background: rgba(255, 255, 255, 0.04); }
.btn--accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn--accent:hover { background: #5aaeff; }
.rows { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.rows li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px 8px 8px 12px; background: var(--card); border: 1px solid var(--win-line); }
.rows span:nth-child(2) { display: grid; min-width: 0; }
.rows small { color: var(--muted); font-size: 12px; }
.hint { margin-top: 16px !important; }
.timeline { list-style: none; margin: 10px 0 0; padding: 0 0 0 18px; border-left: 2px solid var(--win-line); }
.timeline > li { position: relative; padding: 0 0 16px 8px; }
.timeline > li::before { content: ""; position: absolute; left: -25px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--win); }
.timeline h4 { margin: 0; }
.timeline p { margin: 0; }
.timeline ul { margin: 6px 0 0; padding-left: 18px; }
.steps { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 8px; }
.steps li { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; padding: 12px 14px; background: var(--card); border: 1px solid var(--win-line); }
.steps li.is-now { border-color: rgba(59, 156, 255, 0.6); }
.steps h4 { margin: 0; }
.steps p { margin: 0; }
.steps__n { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--hover); font-weight: 600; }
.is-now .steps__n { background: var(--accent); }
.links { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.links li { display: grid; grid-template-columns: 84px minmax(0, 1fr); }
.links span { color: var(--muted); }


/* ---------- taskbar ---------- */
.taskbar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 100001; height: var(--taskbar-h); display: flex; align-items: stretch; justify-content: space-between; background: var(--taskbar); backdrop-filter: blur(24px) saturate(1.4); -webkit-backdrop-filter: blur(24px) saturate(1.4); border-top: 1px solid rgba(255, 255, 255, 0.06); }
.tasks { list-style: none; margin: 0; padding: 0; display: flex; flex: 1; min-width: 0; overflow: hidden; }
.task { position: relative; height: 100%; display: flex; align-items: center; gap: 8px; width: 170px; padding: 0 10px; border: 0; background: none; font-size: 12px; text-align: left; }
.task svg { width: 22px; height: 22px; flex: none; }
.task span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task::after { content: ""; position: absolute; left: 4px; right: 4px; bottom: 0; height: 2px; background: var(--accent); opacity: 0.55; }
.task:hover { background: var(--hover); }
.task.is-active { background: rgba(255, 255, 255, 0.12); }
.task.is-active::after { opacity: 1; }
.clock { display: grid; align-content: center; padding: 0 14px; font-size: 12px; }
/* pixel zoo walking along the taskbar (os/zoo.js) */
.zoo { position: fixed; left: 0; top: 0; z-index: 100002; pointer-events: none; image-rendering: pixelated; }
.zoo-hover, .zoo-hover * { cursor: grab !important; }
.zoo-grabbing, .zoo-grabbing * { cursor: grabbing !important; user-select: none; }

/* ---------- small screens ---------- */
@media (max-width: 720px) {
  .icons { grid-auto-flow: row; grid-template-rows: none; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-columns: auto; height: auto; }
  .dicon { width: 100%; }
  .win { resize: none; }
  .task { width: auto; max-width: 140px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* project images used as icons */
.win__icon img, .task img { width: 18px; height: 18px; border-radius: 4px; object-fit: cover; display: block; }
.task img { width: 22px; height: 22px; }
.who__pic { width: 64px; height: 64px; flex: none; }
.who__pic svg, .who__pic img { width: 64px; height: 64px; display: block; border-radius: 14px; object-fit: cover; }
.rows__pic { width: 32px; height: 32px; }
.rows__pic svg, .rows__pic img { width: 32px; height: 32px; display: block; border-radius: 8px; object-fit: cover; }
.dicon__img > img { border-radius: 0; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.45)); }
.dicon__img > img[src*="asc-"], .dicon__img > img[src*="wallpaper"], .dicon__img > img[src*="form-limiter"] { border-radius: 10px; }
.empty { display: grid; place-content: center; text-align: center; height: 100%; }
.links li > span:last-child { color: var(--text); }
.links li > span:first-child { color: var(--muted); }
/* pixel icons stay crisp at any size */
img[src*="/contact."], img[src*="/experience."], img[src*="/roadmap."], img[src*="/mbti."], img[src*="/easy-mcp."], img[src*="/it-ops-ai."], img[src*="/asc-"], img[src*="/wallpaper."], img[src*="/form-limiter."], img[src*="/folder."], img[src*="/stats."], img[src*="/duel."] { image-rendering: pixelated; border-radius: 0 !important; object-fit: contain !important; }

/* Projects folder and stats card */
.folder { list-style: none; margin: 0; padding: 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.dicon--dark .dicon__label { text-shadow: none; }
.dicon--dark:hover { background: var(--hover); }
.stats-card { margin-top: 8px; padding: 10px; border-radius: 6px; background: #f4f6f9; }
.stats-card img { display: block; width: 100%; height: auto; }

/* game windows: the page fills the window */
.win__body--frame { overflow: hidden; background: #000; }
.win__frame { display: block; width: 100%; height: 100%; border: 0; background: #000; }
body.is-dragging iframe { pointer-events: none; }
img[src*="/doom."] { object-fit: contain !important; border-radius: 0 !important; }

/* playable games: a small play badge on the desktop icon */
.dicon__play { position: absolute; right: -10px; top: -4px; display: flex; align-items: center; gap: 3px; padding: 0 5px 0 4px; border-radius: 3px; background: #1d5fd0; color: #fff; font: 700 9px/14px var(--font); letter-spacing: .04em; box-shadow: 0 0 8px rgba(42,118,210,.8); white-space: nowrap; }
.dicon__play::before { content: ""; border-left: 6px solid #fff; border-top: 3.5px solid transparent; border-bottom: 3.5px solid transparent; }
.dicon:hover .dicon__play { background: #2a76d2; box-shadow: 0 0 12px rgba(80,150,255,.95); }

/* game launcher shown before a game loads */
.launch { height: 100%; overflow: auto; padding: 22px 26px; display: flex; flex-direction: column; gap: 14px; background: radial-gradient(ellipse at 50% 0%, #0b1a33 0%, #05070b 70%); }
.launch__head { display: flex; align-items: center; gap: 14px; }
.launch__head h3 { margin: 0 0 2px; }
.launch__head p { margin: 0; }
.launch__pic img { width: 64px; height: 64px; object-fit: contain; display: block; }
.keys { border-collapse: collapse; font-size: 13px; }
.keys td { padding: 4px 12px 4px 0; vertical-align: middle; }
.keys td:first-child { white-space: nowrap; width: 1%; }
.keys kbd { display: inline-block; min-width: 22px; padding: 2px 7px; border: 1px solid #2a76d2; border-radius: 4px; background: #101a2a; color: #cfe3ff; font: 600 12px/18px "Cascadia Mono", ui-monospace, Menlo, monospace; text-align: center; }
.launch__mouse { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.launch__mouse input { flex: 0 1 220px; accent-color: #2a76d2; }
.launch__mouse output { font: 600 12px "Cascadia Mono", ui-monospace, Menlo, monospace; color: #cfe3ff; min-width: 46px; }
.launch__go { align-self: flex-start; padding: 8px 22px; font-size: 14px; }

/* taskbar name: opens This PC */
.tb-name { border: 0; background: none; padding: 0 16px; color: var(--text); font: 600 13px/1 "Cascadia Mono", ui-monospace, Menlo, Consolas, monospace; letter-spacing: .03em; }
.tb-name:hover, .tb-name:focus-visible { background: var(--hover); color: #6fb2ff; outline: none; }
