:root {
  --taskbar-height: 42px;
  --luna-blue: #0757e8;
  --luna-blue-dark: #0037a7;
  --luna-blue-light: #2c91ff;
  --window-face: #ece9d8;
  --window-edge: #0054e3;
  --text: #111;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  color: var(--text);
  font-family: Tahoma, "Segoe UI", Arial, sans-serif;
  font-size: 12px;
  background:
    radial-gradient(ellipse at 15% 56%, rgba(255, 255, 255, 0.75) 0 24px, transparent 25px),
    radial-gradient(ellipse at 20% 55%, rgba(255, 255, 255, 0.66) 0 42px, transparent 43px),
    radial-gradient(ellipse at 88% 38%, rgba(255, 255, 255, 0.65) 0 29px, transparent 30px),
    radial-gradient(ellipse at 95% 40%, rgba(255, 255, 255, 0.58) 0 48px, transparent 49px),
    linear-gradient(172deg, #0066db 0%, #1689ed 45%, #66bdf2 61%, #86cd47 61.2%, #3e9d26 77%, #12640f 100%);
}

body::before {
  position: fixed;
  right: 0;
  bottom: var(--taskbar-height);
  left: 0;
  height: 30vh;
  content: "";
  pointer-events: none;
  background:
    repeating-linear-gradient(78deg, rgba(255, 255, 255, 0.16) 0 1px, transparent 1px 8px),
    linear-gradient(8deg, #1f7216 0%, #4dad28 48%, #8bd744 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.35);
}

button,
a {
  font: inherit;
}

.desktop {
  position: relative;
  width: 100%;
  height: calc(100vh - var(--taskbar-height));
  min-height: 620px;
  overflow: hidden;
}

.desktop-header {
  position: absolute;
  top: 32px;
  right: 34px;
  z-index: 1;
  width: min(310px, calc(100vw - 930px));
  min-width: 250px;
  padding: 12px 16px 14px;
  color: #fff;
  background: rgba(0, 49, 146, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 2px 7px rgba(0, 0, 0, 0.18);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(1px);
}

.desktop-header h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0;
}

.desktop-header p {
  margin: 6px 0 0;
  color: #eaf8ff;
  font-size: 16px;
  letter-spacing: 0;
}

.desktop-icons {
  position: absolute;
  top: 24px;
  left: 18px;
  z-index: 3;
  display: grid;
  grid-template-columns: 82px;
  grid-auto-rows: 112px;
  gap: 14px;
}

.desktop-icon {
  display: grid;
  grid-template-rows: 64px auto;
  justify-items: center;
  align-items: start;
  width: 82px;
  min-height: 96px;
  padding: 4px 2px;
  color: #fff;
  text-align: center;
  text-decoration: none;
  user-select: none;
  border: 1px solid transparent;
}

.desktop-icon:focus-visible,
.desktop-icon.is-selected {
  background: rgba(49, 106, 197, 0.38);
  border-color: rgba(255, 255, 255, 0.42);
  outline: 1px dotted rgba(255, 255, 255, 0.92);
  outline-offset: -3px;
}

.desktop-icon.is-selected .icon-label,
.desktop-icon:focus-visible .icon-label {
  background: rgba(10, 72, 171, 0.72);
}

.icon-label {
  display: inline-block;
  max-width: 78px;
  padding: 1px 3px 2px;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.15;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.82);
  overflow-wrap: anywhere;
}

.desktop-icon-image {
  display: block;
  object-fit: contain;
  filter: drop-shadow(3px 4px 2px rgba(0, 0, 0, 0.32));
}

.work-icon {
  width: 70px;
  height: 64px;
}

.blog-icon {
  width: 66px;
  height: 60px;
  margin-top: 2px;
}

.consulting-icon {
  width: 74px;
  height: 62px;
}

.mini-work-icon {
  display: block;
  width: 70px;
  height: 64px;
  object-fit: contain;
  filter: drop-shadow(3px 4px 2px rgba(0, 0, 0, 0.22));
  transform: scale(0.92);
  transform-origin: top center;
}

.xp-window {
  position: absolute;
  z-index: 4;
  overflow: hidden;
  background: var(--window-face);
  border: 3px solid var(--window-edge);
  border-radius: 8px 8px 0 0;
  box-shadow:
    inset 1px 1px 0 #5aa5ff,
    inset -1px -1px 0 #002d8f,
    3px 5px 12px rgba(0, 0, 0, 0.35);
}

.xp-window.is-active {
  z-index: 8;
}

.title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 30px;
  padding: 3px 4px 3px 10px;
  color: #fff;
  cursor: move;
  background:
    linear-gradient(180deg, #2f9bff 0%, #0867ee 18%, #034edb 58%, #003bb5 100%);
  border-bottom: 1px solid #00308e;
  user-select: none;
}

.title-bar h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  text-shadow: 1px 1px 1px #062777;
}

.title-button {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  color: #fff;
  font-family: Tahoma, Arial, sans-serif;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  background: linear-gradient(135deg, #ffae85, #e94425 50%, #b91f12);
  border: 1px solid #fff3d5;
  border-right-color: #8d160d;
  border-bottom-color: #8d160d;
  border-radius: 3px;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.72);
}

.title-button:active,
.start-button:active {
  transform: translate(1px, 1px);
}

.profile-window {
  top: 112px;
  left: 190px;
  width: min(680px, calc(100vw - 230px));
}

.profile-content {
  display: grid;
  grid-template-columns: 244px 1fr;
  gap: 18px;
  padding: 16px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 54%),
    var(--window-face);
}

.portrait-frame {
  padding: 8px;
  background: #fff;
  border: 2px inset #fff;
  box-shadow: 1px 1px 0 #a39f91;
}

.portrait {
  display: block;
  width: 224px;
  height: 206px;
  object-fit: cover;
}

.profile-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.profile-copy h3 {
  margin: 0 0 8px;
  color: #003399;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1;
  font-weight: 700;
}

.profile-copy p {
  margin: 0 0 18px;
  font-size: 17px;
  line-height: 1.35;
}

.status-panel {
  display: grid;
  gap: 4px;
  padding: 10px;
  background: #fff;
  border: 2px inset #fff;
  font-size: 13px;
}

.status-panel span {
  color: #555;
}

.bio-window {
  left: 340px;
  bottom: 64px;
  width: min(650px, calc(100vw - 380px));
}

.dialog-body {
  display: grid;
  grid-template-columns: 92px 2px 1fr;
  gap: 22px;
  min-height: 232px;
  padding: 22px 28px 10px;
}

.dialog-icon {
  display: flex;
  justify-content: center;
  padding-top: 8px;
}

.dialog-divider {
  background: #9f9b91;
  border-left: 1px solid #fff;
}

.bio-copy {
  max-height: 238px;
  padding: 2px 8px 2px 0;
  overflow: auto;
  font-family: "Lucida Console", "Courier New", monospace;
  font-size: 16px;
  line-height: 1.35;
  scrollbar-color: #c7c2b8 #ebe7d7;
}

.bio-copy::-webkit-scrollbar {
  width: 17px;
  height: 17px;
}

.bio-copy::-webkit-scrollbar-track {
  background: #d4d0c8;
  border: 2px inset #fff;
}

.bio-copy::-webkit-scrollbar-thumb {
  background: #d4d0c8;
  border: 2px outset #fff;
}

.bio-copy p {
  margin: 0;
}

.bio-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.bio-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 5px 14px 6px;
  color: #111;
  font-family: Tahoma, "Segoe UI", Arial, sans-serif;
  font-size: 12px;
  line-height: 1.1;
  text-decoration: none;
  background: #ece9d8;
  border: 2px outset #fff;
  box-shadow: 0 0 0 1px #404040;
}

.bio-action:focus-visible {
  outline: 1px dotted #111;
  outline-offset: -5px;
}

.bio-action:active {
  transform: translate(1px, 1px);
}

.taskbar {
  position: fixed;
  z-index: 20;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: stretch;
  height: var(--taskbar-height);
  background: linear-gradient(180deg, #2e95ff 0%, #0b63e7 12%, #0752d6 48%, #0646bf 100%);
  border-top: 1px solid #54b0ff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.start-button {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 106px;
  height: 100%;
  padding: 0 13px 0 12px;
  color: #fff;
  font-size: 22px;
  font-style: italic;
  font-weight: 700;
  text-transform: lowercase;
  cursor: pointer;
  background: radial-gradient(circle at 14% 15%, #8bf579 0%, #36b232 42%, #168519 72%, #0b650e 100%);
  border: 0;
  border-radius: 0 14px 14px 0;
  box-shadow: inset 0 2px 2px rgba(255, 255, 255, 0.58), inset -5px -5px 6px rgba(0, 64, 8, 0.5);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.windows-mark {
  display: grid;
  grid-template-columns: repeat(2, 8px);
  grid-template-rows: repeat(2, 8px);
  gap: 1px;
  transform: rotate(7deg);
  filter: drop-shadow(1px 1px 0 rgba(0, 0, 0, 0.45));
}

.windows-mark span:nth-child(1) {
  background: #f04134;
}

.windows-mark span:nth-child(2) {
  background: #47a7f5;
}

.windows-mark span:nth-child(3) {
  background: #21b236;
}

.windows-mark span:nth-child(4) {
  background: #ffd42d;
}

.task-buttons {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 1;
  min-width: 0;
  padding: 5px 7px;
}

.task-button {
  display: flex;
  align-items: center;
  width: min(180px, 24vw);
  height: 30px;
  padding: 0 10px;
  color: #fff;
  background: linear-gradient(180deg, #3d91f6, #155dd8);
  border: 1px solid #4ea0ff;
  border-right-color: #063799;
  border-bottom-color: #063799;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.26);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-button.active {
  background: linear-gradient(180deg, #1d53bd, #0d3a9f);
  border-color: #092e85 #5ba3ff #5ba3ff #092e85;
}

.tray {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 170px;
  padding: 0 12px 0 8px;
  color: #fff;
  background: linear-gradient(180deg, #18a8ff 0%, #0d86e8 48%, #0a6ec8 100%);
  border-left: 1px solid #0a409e;
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.28);
}

.tray-arrow {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  padding: 0;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(180deg, #6cc7ff, #1377ca);
  border: 1px solid #94d8ff;
  border-right-color: #07508e;
  border-bottom-color: #07508e;
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
}

.tray-icon {
  display: inline-block;
  width: 17px;
  height: 17px;
  background: #ece9d8;
  border: 1px outset #fff;
}

.tray-mail {
  background:
    linear-gradient(35deg, transparent 46%, #93631c 47% 53%, transparent 54%),
    linear-gradient(-35deg, transparent 46%, #93631c 47% 53%, transparent 54%),
    #efe6bf;
}

.tray-network {
  background:
    linear-gradient(135deg, transparent 0 42%, #2b4dca 43% 57%, transparent 58%),
    radial-gradient(circle at 73% 28%, #fff 0 10%, transparent 11%),
    #417bff;
}

#clock {
  margin-left: 6px;
  font-size: 12px;
  white-space: nowrap;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.42);
}

@media (max-width: 1120px) and (min-width: 821px) {
  .desktop-header {
    display: none;
  }
}

@media (max-width: 820px) {
  body {
    overflow: auto;
  }

  .desktop {
    min-height: 980px;
    height: auto;
    padding-bottom: 70px;
    overflow: visible;
  }

  .desktop-header {
    top: 20px;
    left: 112px;
    right: 14px;
    width: auto;
    min-width: 0;
    max-width: none;
    padding: 10px 14px;
  }

  .desktop-icons {
    top: 16px;
    left: 14px;
    grid-auto-rows: 104px;
    gap: 8px;
  }

  .profile-window,
  .bio-window {
    position: relative;
    top: auto;
    left: auto;
    bottom: auto;
    width: calc(100% - 28px);
    margin: 302px 14px 0;
  }

  .bio-window {
    margin-top: 16px;
  }

  .profile-content {
    grid-template-columns: 1fr;
  }

  .portrait-frame {
    width: max-content;
    max-width: 100%;
  }

  .dialog-body {
    grid-template-columns: 70px 2px 1fr;
    gap: 14px;
    padding: 18px 15px 8px;
  }

  .bio-copy {
    font-size: 14px;
  }

  .task-button {
    display: none;
  }

  .tray {
    min-width: 132px;
  }

  .tray-icon,
  .tray-arrow {
    display: none;
  }
}

@media (max-width: 480px) {
  :root {
    --taskbar-height: 40px;
  }

  .desktop {
    min-height: 1040px;
  }

  .desktop-header {
    left: 104px;
    padding: 8px 10px;
  }

  .desktop-header h1 {
    font-size: 32px;
  }

  .desktop-header p {
    font-size: 16px;
  }

  .profile-window,
  .bio-window {
    width: calc(100% - 20px);
    margin-inline: 10px;
  }

  .portrait {
    width: 100%;
    max-width: 224px;
  }

  .dialog-body {
    grid-template-columns: 1fr;
  }

  .dialog-icon,
  .dialog-divider {
    display: none;
  }

  .start-button {
    width: 96px;
    font-size: 20px;
  }

  .tray {
    min-width: 102px;
    padding-right: 8px;
  }
}
