:root {
  --teal: #008080;
  --face: #c0c0c0;
  --bevel-light: #ffffff;
  --bevel-dark: #808080;
  --bevel-black: #000000;
  --navy: #000080;
  --cyber-cyan: #00ffff;
  --cyber-magenta: #ff00ff;
  --font-sys: "MS Sans Serif", Tahoma, Geneva, sans-serif;
}

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

html, body { height: 100%; overflow: hidden; }

body {
  background-color: var(--teal);
  background-image: url("/static/img/background/avatar.jpg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  font-family: var(--font-sys);
  font-size: 12px;
  cursor: default;
  user-select: none;
}


body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,0.045) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, rgba(0,128,128,0.13), rgba(0,40,72,0.05) 55%, rgba(0,0,0,0.10));
}


#boot {
  position: fixed; inset: 0; z-index: 9999;
  background: #000; color: var(--cyber-cyan);
  font-family: "Courier New", monospace; font-size: 14px;
  padding: 24px; transition: opacity 0.4s;
}
#boot.off { opacity: 0; }


#desktop { position: absolute; inset: 0 0 30px 0; }

#icons { list-style: none; position: absolute; inset: 0; }

.icon {
  position: absolute; width: 96px; text-align: center; outline: none;
  touch-action: none; cursor: default;
}
.icon .img {
  display: block; width: 44px; height: 44px; margin: 0 auto 4px;
  background-color: transparent;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  image-rendering: pixelated;
  border: 2px solid transparent;
  filter: drop-shadow(0 0 4px rgba(0, 255, 255, 0.35));
  pointer-events: none;
}
.icon:hover .img, .icon.sel .img {
  filter: drop-shadow(0 0 8px var(--cyber-cyan));
}
.icon.dragging { z-index: 5; cursor: move; }
.icon.dragging .img { filter: drop-shadow(0 0 12px var(--cyber-magenta)); }


.blog-ico  { background-image: url("/static/img/icons/blog.png"); }
.music-ico { background-image: url("/static/img/icons/music.png"); }
.term-ico  { background-image: url("/static/img/icons/terminal.png"); }
.about-ico { background-image: url("/static/img/icons/readme.png"); }
.icon .label {
  color: #fff; text-shadow: 1px 1px 0 #000; padding: 1px 3px;
  display: inline-block;
}
.icon.sel .label { background: var(--navy); }
.icon.sel .img { filter: drop-shadow(0 0 10px var(--cyber-cyan)); }


.win {
  position: absolute; min-width: 340px; max-width: 90vw;
  background: var(--face);
  border: 2px outset var(--face);
  box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.6);
}
.win.active { box-shadow: 0 0 0 1px rgba(0,255,255,.35), 4px 4px 16px rgba(0, 255, 255, 0.25), 4px 4px 12px rgba(0,0,0,.6); }

.titlebar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 2px 4px; color: #fff; font-weight: bold;
  background: linear-gradient(90deg, #000040, #808080);
}
.win.active .titlebar { background: linear-gradient(90deg, var(--navy), #1084d0 60%, var(--cyber-cyan)); }
.titlebar.drag { cursor: move; }

.close {
  width: 18px; height: 16px; font: bold 11px/1 var(--font-sys);
  background: var(--face); border: 1px outset #fff; cursor: pointer;
}
.close:active { border-style: inset; }

.win.hidden { display: none; }
#win-terminal { left: 8%; top: 10%; }
#win-about { left: 30%; top: 22%; }

.win .body { border: 2px inset var(--face); margin: 4px; background: #fff; }
.win .body.pad { padding: 10px 12px; background:#fff; font-size:12px; line-height:1.5; }
.win .body .dim { color:#777; }
.win .body code { font-family: "Courier New", monospace; background:#eee; padding:0 3px; }

.term {
  background: #000 !important; color: var(--cyber-cyan);
  font-family: "Courier New", monospace; font-size: 13px;
  height: 260px; width: 480px; max-width: 80vw;
  padding: 0 8px 6px 8px; overflow-y: auto; 
  cursor: text; 
}
.term b { color: #fff; }

#term-out { white-space: pre-wrap; }
.term-line { display: flex; align-items: center; }
#term-in {
  flex: 1; background: transparent; border: 0; outline: none;
  color: var(--cyber-cyan); font: inherit; caret-color: var(--cyber-magenta);
}
.prompt { margin-right: 0; color: var(--cyber-magenta); }


#taskbar {
  position: fixed; left: 0; right: 0; bottom: 0; height: 30px;
  background: var(--face); border-top: 2px outset #fff;
  display: flex; align-items: center; gap: 6px; padding: 2px 4px;
  z-index: 5000;
}
#start {
  font: bold 12px var(--font-sys); padding: 3px 10px 3px 6px;
  background: var(--face); border: 2px outset #fff; cursor: pointer;
  display: flex; align-items: center; gap: 5px;
}
#start:active, #start[aria-expanded="true"] { border-style: inset; }
.flag {
  width: 14px; height: 14px;
  background: conic-gradient(from 90deg,
    var(--cyber-magenta) 0 25%, var(--cyber-cyan) 0 50%,
    #fff 0 75%, #000 0 100%);
  border: 1px solid #000;
}
#task-items { display: flex; gap: 4px; flex: 1; overflow: hidden; }
.task-btn {
  font: 11px var(--font-sys); padding: 4px 10px; max-width: 160px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: var(--face); border: 2px outset #fff; cursor: pointer;
}
.task-btn.on { border-style: inset; background: #d8d8d8; }
#clock {
  border: 1px inset #888; padding: 3px 10px; font-size: 11px;
}

#start-menu {
  position: absolute; bottom: 30px; left: 2px; width: 190px;
  background: var(--face); border: 2px outset #fff;
  box-shadow: 3px 3px 10px rgba(0,0,0,.5);
  display: flex; flex-direction: column; padding: 4px;
}
#start-menu[hidden] { display: none; } 
#start-menu a, #start-menu button {
  font: 12px var(--font-sys); text-decoration: none; color: #000;
  background: none; border: 0; text-align: left; padding: 7px 10px; cursor: pointer;
}
#start-menu a:hover, #start-menu button:hover { background: var(--navy); color: #fff; }
#start-menu hr { border: 0; border-top: 1px solid #888; border-bottom: 1px solid #fff; margin: 3px 0; }


#scanlines {
  position: fixed; inset: 0; pointer-events: none; z-index: 9000;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.16) 0 1px,
    transparent 1px 3px
  );
  mix-blend-mode: multiply;
}

body.glitch #desktop { filter: hue-rotate(120deg) saturate(2) contrast(1.2); }
body.glitch #scanlines { transform: translateX(2px); }

#trails { position: fixed; inset: 0; pointer-events: none; z-index: 3999; }
#trails .dot {
  position: absolute; width: 6px; height: 6px; border-radius: 50%;
  background: var(--cyber-cyan);
  box-shadow: 0 0 8px var(--cyber-cyan);
  transform: translate(-50px, -50px);
}

@media (prefers-reduced-motion: reduce) {
  #scanlines, #trails { display: none; }
}

@media (max-width: 640px) {
  body { overflow: auto; height: auto; }
  #desktop { position: relative; inset: auto; min-height: calc(100vh - 30px); }
  .term { width: 86vw; height: 220px; }
  .win { left: 4% !important; min-width: 300px; }
}
