:root {
  --xp-blue: #245edb;
  --xp-blue-dark: #0b3ca9;
  --xp-blue-light: #5c9eff;
  --xp-green: #38a020;
  --xp-green-dark: #16710d;
  --xp-silver: #ece9d8;
  --xp-border: #0a246a;
  --xp-title: #fff;
  --taskbar-height: 40px;
  --font: Tahoma, "Trebuchet MS", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  font-family: var(--font);
  color: #111;
  user-select: none;
}

button,
input,
textarea {
  font: inherit;
}

.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 22px;
  background: #050505;
  color: white;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.boot-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none !important;
  display: none !important;
}

.crt-line {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.05),
    rgba(255, 255, 255, 0.05) 1px,
    transparent 1px,
    transparent 4px
  );
  animation: crtFade 1.6s ease-out forwards;
}

.boot-logo {
  display: grid;
  gap: 2px;
  text-align: center;
}

.boot-logo span {
  color: #bbb;
  font-size: 1.1rem;
}

.boot-logo strong {
  font-size: clamp(2.8rem, 8vw, 5.2rem);
  font-weight: 500;
  letter-spacing: -2px;
}

.boot-logo em {
  color: #f15a24;
  font-style: normal;
  font-size: 1.1rem;
  text-align: right;
}

.boot-edition {
  margin: 0;
  color: #d8e8ff;
  font-size: 1rem;
}

.boot-loader {
  width: 220px;
  height: 18px;
  padding: 2px;
  border: 1px solid #777;
  background: #111;
}

.boot-loader span {
  display: block;
  width: 44px;
  height: 100%;
  background: linear-gradient(90deg, #123fbe, #5fa8ff, #123fbe);
  animation: bootLoad 1.1s infinite linear;
}

@keyframes bootLoad {
  from { transform: translateX(0); }
  to { transform: translateX(170px); }
}

@keyframes crtFade {
  from { opacity: 1; }
  to { opacity: 0.32; }
}

.desktop {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 18% 20%, rgba(255, 255, 255, 0.9), transparent 8%),
    radial-gradient(ellipse at 38% 18%, rgba(255, 255, 255, 0.55), transparent 14%),
    linear-gradient(180deg, #4aa7ff 0%, #2d83df 42%, #61a635 43%, #3f8f28 62%, #21761c 100%);
}

.desktop::before {
  position: absolute;
  inset: auto -10% var(--taskbar-height) -10%;
  height: 44%;
  content: "";
  pointer-events: none !important;
  background:
    radial-gradient(ellipse at 52% 100%, rgba(180, 230, 95, 0.9), transparent 42%),
    linear-gradient(11deg, #2d7d1d 0%, #63b534 38%, #b7d85c 55%, #3b8d28 85%);
  clip-path: polygon(0 38%, 24% 28%, 50% 18%, 76% 36%, 100% 24%, 100% 100%, 0 100%);
}

.desktop::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.22), transparent 36%);
}

.desktop-icons {
  position: absolute;
  inset: 18px 0 var(--taskbar-height) 18px;
  z-index: 2;
}

.desktop-icon {
  position: absolute;
  display: grid;
  width: 92px;
  justify-items: center;
  gap: 5px;
  padding: 4px;
  border: 1px solid transparent;
  background: transparent;
  color: white;
  text-align: center;
  text-shadow: 1px 1px 2px #000;
  cursor: default;
}

.desktop-icon:hover,
.desktop-icon.selected {
  border-color: rgba(255, 255, 255, 0.65);
  background: rgba(49, 106, 197, 0.42);
}

.xp-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 7px;
  background: linear-gradient(145deg, #fff, #8fb9ff 48%, #1251c7);
  box-shadow: inset 1px 1px 0 rgba(255,255,255,0.8), 1px 2px 2px rgba(0,0,0,0.35);
  font-size: 1.45rem;
}

.desktop-icon span {
  font-size: 0.76rem;
  line-height: 1.15;
}

.xp-command-hint {
  position: absolute;
  right: 24px;
  bottom: 64px;
  z-index: 2;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.36);
  color: #e8fff1;
  cursor: pointer;
}

.window-layer {
  position: absolute;
  inset: 0 0 var(--taskbar-height) 0;
  z-index: 5;
  pointer-events: none;
}

.xp-window {
  position: absolute;
  display: grid;
  grid-template-rows: 30px minmax(0, 1fr);
  min-width: 320px;
  min-height: 220px;
  border: 3px solid #1053d6;
  border-radius: 8px 8px 0 0;
  background: var(--xp-silver);
  box-shadow: 4px 7px 16px rgba(0, 0, 0, 0.38);
  pointer-events: auto;
  animation: windowOpen 0.18s ease-out;
}

.xp-window.minimized {
  display: none;
}

.xp-window.maximized {
  border-radius: 0;
  border-width: 1px;
  box-shadow: none;
}

@keyframes windowOpen {
  from { opacity: 0; transform: scale(0.94) translateY(16px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 30px;
  padding: 0 4px 0 8px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(#65a9ff 0%, #2f75e8 38%, #0a45c0 100%);
  color: var(--xp-title);
  font-size: 0.84rem;
  font-weight: 700;
  text-shadow: 1px 1px 0 #063185;
  cursor: move;
}

.title-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

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

.window-buttons button {
  width: 22px;
  height: 22px;
  border: 1px solid #fff;
  border-radius: 3px;
  background: linear-gradient(#fff, #78aef5 45%, #1f5ed7);
  color: white;
  font-weight: 700;
  line-height: 1;
  text-shadow: 1px 1px 0 #003483;
  cursor: pointer;
}

.window-buttons button:hover {
  filter: brightness(1.2);
}

.window-buttons .close:hover {
  background: linear-gradient(#ff8c6b, #f05b2d 50%, #b91d08);
}

.window-buttons button:active {
  filter: brightness(0.8);
}

.window-body {
  overflow: auto;
  padding: 12px;
  border: 2px solid #fff;
  border-top: 0;
  background: #f3f1e5;
}

.xp-toolbar {
  display: flex;
  gap: 6px;
  margin: -4px -4px 12px;
  padding: 6px;
  border-bottom: 1px solid #aca899;
  background: linear-gradient(#fff, #dedbcf);
}

.xp-button {
  padding: 5px 12px;
  border: 1px solid #777;
  border-radius: 3px;
  background: linear-gradient(#fff, #ece9d8 45%, #c9c5b5);
  box-shadow: inset 1px 1px 0 #fff;
  cursor: pointer;
}

.xp-button:active {
  box-shadow: inset 1px 1px 3px #777;
}

.file-path {
  margin: 0 0 12px;
  padding: 6px 8px;
  border: 1px inset #fff;
  background: white;
  color: #333;
  font-family: "Courier New", monospace;
  font-size: 0.82rem;
}

.xp-panel {
  padding: 12px;
  border: 1px solid #b8b4a4;
  background: white;
}

.xp-panel h2,
.xp-panel h3 {
  margin: 0 0 10px;
  color: #0a45a8;
}

.summary-box {
  background: #f0f4fd;
  border: 1px inset #c5d4f5;
  padding: 12px 14px;
  border-radius: 4px;
  margin-bottom: 12px;
}

.summary-box h3 {
  margin: 0 0 8px;
  color: #0b4cab;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
}

.summary-box p {
  margin: 0 0 8px;
  line-height: 1.5;
}

.summary-box p:last-child {
  margin-bottom: 0;
}

.xp-highlights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.highlight-card {
  background: #fcfdfe;
  border: 1px solid #c7c2af;
  padding: 8px 10px;
  border-radius: 3px;
  font-size: 0.82rem;
}

.resume-preview-container {
  overflow-y: auto;
  height: calc(100% - 38px);
  padding-right: 4px;
}

.resume-header {
  border-bottom: 2px solid #0b4cab;
  padding-bottom: 8px;
  margin-bottom: 14px;
}

.resume-header h2 {
  margin: 0 0 4px;
  color: #0b4cab;
  font-size: 1.5rem;
  letter-spacing: 0.5px;
}

.resume-contacts {
  margin: 0;
  font-size: 0.84rem;
  color: #444;
}

.resume-section {
  margin-bottom: 16px;
}

.resume-section h3 {
  margin: 0 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid #d0d7e5;
  color: #0b4cab;
  font-size: 1.02rem;
  letter-spacing: 0.5px;
}

.job-item {
  margin-bottom: 10px;
}

.job-date {
  float: right;
  color: #555;
  font-weight: 600;
  font-size: 0.8rem;
}

.xp-list {
  display: grid;
  gap: 7px;
  margin: 10px 0 0;
  padding-left: 18px;
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px;
}

.control-card {
  padding: 10px;
  border: 1px solid #c7c2af;
  background: #fff;
}

.control-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: #0b4cab;
  font-weight: 700;
}

.skill-row {
  display: grid;
  grid-template-columns: 98px 1fr;
  gap: 8px;
  align-items: center;
  margin: 7px 0;
  font-size: 0.82rem;
}

.progress {
  height: 15px;
  border: 1px inset #fff;
  background: white;
}

.progress span {
  display: block;
  height: 100%;
  background: repeating-linear-gradient(
    90deg,
    #2b78e4,
    #2b78e4 9px,
    #5ca5ff 9px,
    #5ca5ff 13px
  );
}

.explorer {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  min-height: 380px;
  border: 1px solid #aca899;
  background: white;
}

.explorer-left {
  padding: 12px;
  border-right: 1px solid #aca899;
  background: linear-gradient(#dfeaff, #fff);
}

.explorer-left h3 {
  margin: 0 0 10px;
  color: #174aa3;
}

.folder-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  padding: 6px;
  border: 1px solid transparent;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.folder-item:hover,
.folder-item.active {
  border-color: #7da2ce;
  background: #dbeaff;
}

.project-view {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.project-header h2 {
  margin: 0 0 15px;
  padding-bottom: 8px;
  border-bottom: 2px solid #0a45a8;
  color: #0a45a8;
  font-size: 1.4rem;
}

.project-content {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  align-items: start;
}

.project-preview-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.preview-image-container,
.modal-image-container {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #aca899;
  background: #15181e;
  overflow: hidden;
  border-radius: 2px;
}

.preview-image-container {
  height: 190px;
}

.modal-image-container {
  max-height: 320px;
  min-height: 200px;
  margin-bottom: 8px;
}

.preview-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border: none;
  background: transparent;
}

.screenshot-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 2px;
}

.prev-shot-btn,
.next-shot-btn {
  padding: 2px 8px;
  font-size: 0.75rem;
}

.shot-counter {
  font-size: 0.78rem;
  font-weight: 700;
  color: #0b4cab;
}

.shot-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: #333;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: #f0f4fd;
  padding: 3px 6px;
  border: 1px inset #d0d7e5;
  border-radius: 2px;
}

.shot-thumbs-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 2px;
  max-width: 100%;
}

.shot-thumbs-strip::-webkit-scrollbar {
  height: 6px;
}

.shot-thumbs-strip::-webkit-scrollbar-thumb {
  background: #aca899;
  border-radius: 3px;
}

.shot-thumb {
  width: 52px;
  height: 36px;
  object-fit: cover;
  border: 1px solid #777;
  border-radius: 2px;
  cursor: pointer;
  opacity: 0.65;
  transition: all 0.15s ease;
  flex-shrink: 0;
  background: #111;
}

.shot-thumb:hover {
  opacity: 1;
  border-color: #0b4cab;
}

.shot-thumb.active {
  opacity: 1;
  border: 2px solid #0055d4;
  box-shadow: 0 0 5px rgba(0, 85, 212, 0.6);
}

.shot-info-badge {
  font-size: 0.8rem;
  font-weight: 600;
  color: #0a45a8;
  margin-left: auto;
  align-self: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

.modal-thumbs {
  margin-bottom: 10px;
  background: #ece9d8;
  padding: 4px;
  border: 1px inset #d0d7e5;
}

.full-width {
  width: 100%;
}

.project-info-side {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.project-body {
  margin: 0 0 12px;
  line-height: 1.5;
  color: #333;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.tag-row span {
  padding: 3px 8px;
  border: 1px solid #0055d4;
  border-radius: 4px;
  background: #f0f7ff;
  color: #003380;
  font-size: 0.72rem;
  font-weight: 600;
}

@media (max-width: 820px) {
  .project-content {
    grid-template-columns: 1fr;
  }
  
  .preview-image {
    max-height: 180px;
  }
}

/* Retro Snake Game Styles */
.snake-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px;
  background: #050e05;
  height: 100%;
  box-sizing: border-box;
  font-family: Consolas, "Courier New", monospace;
}
.snake-header {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 400px;
  color: #00ff66;
  font-weight: bold;
  font-size: 0.95rem;
}
#snakeCanvas {
  border: 2px solid #00ff66;
  border-radius: 4px;
  background: #0c180c;
  max-width: 100%;
  height: auto;
  box-shadow: 0 0 12px rgba(0, 255, 102, 0.2);
}
.snake-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 400px;
}
.dpad {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.dpad-row {
  display: flex;
  gap: 2px;
}
.dpad button {
  width: 36px;
  height: 30px;
  border: 1px solid #005500;
  border-radius: 3px;
  background: #113311;
  color: #00ff66;
  font-size: 0.9rem;
  font-weight: bold;
  cursor: pointer;
}
.dpad button:active {
  background: #00ff66;
  color: #000;
}

/* Pixelated Icon Style */
.pixel-icon .xp-icon {
  font-size: 32px;
  filter: contrast(200%) grayscale(100%);
  image-rendering: pixelated;
  transform: scale(1.1);
}

.terminal {
  min-height: 230px;
  padding: 12px;
  background: #000;
  color: #9cff9c;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.9rem;
}

.terminal input {
  width: 70%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #9cff9c;
  font: inherit;
}

.address-grid {
  display: grid;
  gap: 10px;
}

.xp-field {
  display: grid;
  gap: 4px;
}

.xp-field input,
.xp-field textarea {
  width: 100%;
  padding: 6px;
  border: 2px inset #fff;
  background: white;
}

.start-menu {
  position: fixed;
  left: 0;
  bottom: var(--taskbar-height);
  z-index: 1000;
  display: none;
  width: 410px;
  overflow: hidden;
  border: 2px solid #1455d9;
  border-radius: 8px 8px 0 0;
  background: #fff;
  box-shadow: 5px 0 18px rgba(0, 0, 0, 0.38);
}

.start-menu.open {
  display: block;
}

.start-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: linear-gradient(#66a8ff, #0b55d9);
  color: white;
  text-shadow: 1px 1px 0 #073783;
}

.user-avatar {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 2px solid white;
  border-radius: 6px;
  background: linear-gradient(#fff, #8fc4ff);
  color: #1455d9;
  font-weight: 700;
  text-shadow: none;
}

.start-user span {
  display: block;
  font-size: 0.78rem;
  opacity: 0.9;
}

.start-columns {
  display: grid;
  grid-template-columns: 1fr 150px;
}

.start-left,
.start-right {
  display: grid;
  gap: 2px;
  padding: 8px;
}

.start-right {
  background: #d3e5fb;
}

.start-menu button {
  padding: 9px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.start-menu button:hover {
  background: #316ac5;
  color: white;
}

.start-bottom {
  padding: 6px 8px;
  border-top: 1px solid #9ebbe8;
  background: linear-gradient(#d8e8ff, #b5d3ff);
  text-align: right;
}

.taskbar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1100;
  display: grid;
  grid-template-columns: auto 1fr auto;
  height: var(--taskbar-height);
  background: linear-gradient(#4f9cff 0%, #245edb 36%, #0b43bc 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.65);
}

.start-button {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 102px;
  padding: 0 14px;
  border: 0;
  border-radius: 0 14px 14px 0;
  background: linear-gradient(#6ed24d, #2aa323 45%, #13740e);
  color: white;
  font-size: 1.05rem;
  font-style: italic;
  font-weight: 700;
  text-shadow: 1px 1px 1px #064806;
  cursor: pointer;
}

.start-orb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #ffcf4d 24%, #e34a2b 50%, #1c8b31 70%, #1b57d6);
}

.taskbar-apps {
  display: flex;
  gap: 4px;
  align-items: center;
  min-width: 0;
  padding: 4px;
}

.task-tab {
  width: 160px;
  min-width: 80px;
  overflow: hidden;
  padding: 6px 8px;
  border: 1px solid #0b3ca9;
  border-radius: 3px;
  background: linear-gradient(#6aa6ff, #1958c9);
  color: white;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.task-tab.active {
  background: linear-gradient(#1545a8, #0d3893);
}

.system-tray {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.4);
  background: linear-gradient(#20a6f4, #0b83d0);
  color: white;
  font-size: 0.82rem;
  box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.2);
}

.system-tray button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  color: white;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.1s;
}

.system-tray button:hover {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.1);
}

.tray-icon {
  font-size: 0.9rem;
  opacity: 0.9;
  cursor: default;
}

#clock {
  margin-left: 4px;
  font-family: Tahoma, sans-serif;
  font-weight: 500;
}

.system-tray button.tray-btn {
  width: 22px;
  height: 22px;
  border-radius: 2px;
  border: 1px solid rgba(255,255,255,0.4);
  font-size: 0.75rem;
  font-weight: 800;
  color: white;
}

.tray-btn.gh { background: #333; }
.tray-btn.li { background: #0077b5; }
.tray-btn.mail { background: #d44638; }

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

  .desktop-icons {
    left: 10px;
    top: 10px;
    display: grid;
    grid-template-columns: repeat(auto-fill, 85px);
    width: calc(100% - 20px);
    gap: 15px;
  }

  .desktop-icon {
    position: static !important;
    margin: 0 auto;
  }

  .xp-window {
    left: 0 !important;
    top: 0 !important;
    width: 100vw !important;
    height: calc(100vh - var(--taskbar-height)) !important;
    border-radius: 0;
  }

  .window-body {
    height: calc(100% - 30px);
  }

  .explorer,
  .control-grid {
    grid-template-columns: 1fr;
  }

  .explorer-left {
    display: none; /* Hide sidebar on mobile for more space */
  }

  .start-menu {
    width: 100vw;
    border-radius: 0;
  }

  .taskbar {
    grid-template-columns: auto 1fr auto;
  }

  .task-tab {
    width: 60px;
    min-width: 40px;
    font-size: 0.7rem;
    padding: 4px;
  }

  .system-tray {
    gap: 4px;
    padding: 0 6px;
  }

  .system-tray .tray-icon {
    display: none; /* Hide non-essential icons on small screens */
  }

  #clock {
    font-size: 0.75rem;
  }
}
