:root {
  --teal: #008080;
  --panel: #c0c0c0;
  --panel-dark: #808080;
  --panel-light: #ffffff;
  --ink: #111111;
  --blue: #000080;
  --green: #0b5f35;
}

* {
  box-sizing: border-box;
}

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

body {
  color: var(--ink);
  font-family: "MS Sans Serif", Tahoma, Arial, sans-serif;
  background: #101010;
  image-rendering: pixelated;
}

button,
a {
  font: inherit;
}

.desktop {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-height: 520px;
  overflow: hidden;
  background: url("windowsxp.jpg") center / cover no-repeat;
}

.crt {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.04) 0,
      rgba(255, 255, 255, 0.04) 1px,
      transparent 1px,
      transparent 4px
    );
  mix-blend-mode: soft-light;
}

.boot-screen {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  color: #19ff69;
  background: #020402;
  transition: opacity 420ms ease, visibility 420ms ease;
}

.boot-screen.hidden {
  opacity: 0;
  visibility: hidden;
}

.bios-box {
  width: min(620px, calc(100vw - 36px));
  min-height: 230px;
  padding: 22px;
  border: 2px solid #19ff69;
  font-family: "Courier New", monospace;
  font-size: clamp(0.85rem, 2.2vw, 1.05rem);
  line-height: 1.7;
  box-shadow: 0 0 28px rgba(25, 255, 105, 0.18);
}

.icons {
  position: absolute;
  left: 18px;
  top: 18px;
  display: grid;
  grid-template-columns: 82px;
  gap: 8px;
  z-index: 2;
}

.desktop-icon {
  display: grid;
  justify-items: center;
  gap: 8px;
  width: 82px;
  min-height: 68px;
  padding: 4px;
  color: white;
  background: transparent;
  border: 1px solid transparent;
  text-shadow: 1px 1px #000;
  cursor: pointer;
}

.desktop-icon:focus,
.desktop-icon:hover {
  border-color: rgba(255, 255, 255, 0.65);
  background: rgba(0, 0, 128, 0.28);
  outline: none;
}

.desktop-icon span:last-child {
  width: 100%;
  font-size: 0.82rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.icon {
  position: relative;
  width: 40px;
  height: 36px;
  display: block;
  filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.4));
}

.art-folder {
  background: #f5c344;
  border: 2px solid #6e5215;
}

.art-folder::before {
  content: "";
  position: absolute;
  left: -2px;
  top: -10px;
  width: 22px;
  height: 12px;
  background: #ffe07a;
  border: 2px solid #6e5215;
  border-bottom: 0;
}

.art-user {
  border-radius: 0;
  background:
    linear-gradient(#ffd7a8 0 34%, transparent 34%),
    linear-gradient(90deg, transparent 0 22%, #3158b6 22% 78%, transparent 78%);
  border: 2px solid #202020;
}

.art-chip {
  background: #1b7040;
  border: 2px solid #101010;
}

.art-chip::before,
.art-chip::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 2px solid #bdffca;
}

.art-mail {
  background: #eeeeee;
  border: 2px solid #303030;
}

.art-mail::before {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  top: 7px;
  height: 18px;
  border-left: 2px solid #303030;
  border-bottom: 2px solid #303030;
  transform: rotate(-45deg);
}

.art-terminal {
  background: #050505;
  border: 3px solid #d6d6d6;
}

.art-terminal::before {
  content: ">";
  position: absolute;
  left: 7px;
  top: 5px;
  color: #19ff69;
  font-family: "Courier New", monospace;
  font-weight: bold;
}

.art-status {
  background: #eeeeee;
  border: 2px solid #303030;
}

.art-status::before {
  content: "✓";
  position: absolute;
  inset: 2px;
  display: grid;
  place-items: center;
  color: #0b5f35;
  font-size: 1.5rem;
  font-weight: 700;
}

.window {
  position: absolute;
  z-index: 4;
  width: min(520px, calc(100vw - 128px));
  min-height: 230px;
  background: var(--panel);
  border: 2px solid;
  border-color: var(--panel-light) #404040 #404040 var(--panel-light);
  box-shadow: 2px 2px 0 #000;
}

.window.active {
  z-index: 10;
}

.titlebar {
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 4px 3px 8px;
  color: white;
  background: linear-gradient(90deg, #0b56b6, #3e9cf0 55%, #0b56b6);
  font-weight: 700;
  cursor: move;
  user-select: none;
}

.window-buttons {
  display: flex;
  gap: 3px;
}

.window-buttons span,
.btn-close {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  background: var(--panel);
  border: 2px solid;
  border-color: var(--panel-light) #404040 #404040 var(--panel-light);
  color: #000;
}

.btn-close {
  cursor: pointer;
  line-height: 1;
}

.window-body {
  padding: 16px;
  border-top: 2px solid var(--panel-dark);
  font-size: 0.95rem;
  line-height: 1.45;
}

.window h1,
.window h2,
.window h3,
.window p {
  margin-top: 0;
}

.profile-logo {
  display: block;
  width: 132px;
  height: 132px;
  margin: 14px 0;
  object-fit: contain;
  background: #000000;
  border: 2px solid;
  border-color: #808080 #ffffff #ffffff #808080;
}

.welcome h1 {
  font-size: clamp(2rem, 6vw, 3.6rem);
  line-height: 0.95;
  margin-bottom: 14px;
  color: #1f1f1f;
}

.retro-button,
.start-button,
.start-menu button,
.task-items button {
  min-height: 30px;
  padding: 4px 12px;
  background: var(--panel);
  border: 2px solid;
  border-color: var(--panel-light) #404040 #404040 var(--panel-light);
  cursor: pointer;
}

.retro-button:active,
.start-button:active,
.start-menu button:active,
.task-items button:active {
  border-color: #404040 var(--panel-light) var(--panel-light) #404040;
}

.project-list {
  display: grid;
  gap: 10px;
}

.project-list article,
.notice,
.contact-card,
.skill-grid li {
  background: #eeeeee;
  border: 2px solid;
  border-color: #808080 #ffffff #ffffff #808080;
  padding: 10px;
}

.project-list h3 {
  margin-bottom: 4px;
}

.project-list span {
  display: inline-block;
  margin-top: 4px;
  color: var(--green);
  font-family: "Courier New", monospace;
  font-size: 0.82rem;
}

.skill-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.contact-card {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.contact-card a {
  color: var(--blue);
  overflow-wrap: anywhere;
}

.terminal {
  min-height: 250px;
  color: #19ff69;
  background: #040404;
  font-family: "Courier New", monospace;
  border-top: 0;
}

.terminal p {
  margin-bottom: 10px;
}

.status-panel {
  min-height: 250px;
}

.status-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid #808080;
}

.status-row span {
  text-align: right;
}

.status-ok {
  color: var(--green);
  font-weight: 700;
}

.status-note {
  margin-top: 16px;
  font-family: "Courier New", monospace;
}

.blink {
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.taskbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  height: 42px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  background: linear-gradient(#3d96e8, #286bd1 48%, #1550ad 52%, #2467ca);
  border-top: 2px solid var(--panel-light);
}

.start-button {
  min-width: 82px;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(#78c94d, #39941d 48%, #237410);
  border-color: #b9eea0 #15510a #15510a #b9eea0;
  border-radius: 0 12px 12px 0;
  text-shadow: 1px 1px #23600f;
}

.task-items button {
  color: #111111;
  background: #6fa8e8;
  border-color: #a5d3ff #17478d #17478d #a5d3ff;
}

#clock {
  color: #ffffff;
  border-color: #17478d #8ec4f5 #8ec4f5 #17478d;
}

.task-items {
  display: flex;
  gap: 5px;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.task-items button {
  min-width: 92px;
  max-width: 150px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-align: left;
}

#clock {
  min-width: 72px;
  padding: 6px 8px;
  text-align: center;
  border: 2px solid;
  border-color: #808080 #ffffff #ffffff #808080;
}

.start-menu {
  position: absolute;
  left: 4px;
  bottom: 42px;
  z-index: 35;
  width: 210px;
  display: none;
  padding: 6px;
  background: var(--panel);
  border: 2px solid;
  border-color: var(--panel-light) #404040 #404040 var(--panel-light);
  box-shadow: 2px 2px 0 #000;
}

.start-menu.open {
  display: grid;
  gap: 4px;
}

.start-menu button {
  width: 100%;
  text-align: left;
}

@media (max-width: 640px) {
  .desktop {
    min-height: 620px;
  }

  .icons {
    grid-template-columns: repeat(3, 78px);
    left: 10px;
    top: 10px;
    gap: 10px;
  }

  .desktop-icon {
    width: 78px;
  }

  .window {
    width: calc(100vw - 20px);
    left: 10px !important;
    top: 250px !important;
  }

  .welcome h1 {
    font-size: 2.1rem;
  }

  .skill-grid,
  .contact-card {
    grid-template-columns: 1fr;
  }

  .status-row {
    display: grid;
    gap: 2px;
  }

  .status-row span {
    text-align: left;
  }

  .contact-card {
    display: grid;
  }

  .task-items button {
    min-width: 78px;
  }
}
