* {
  box-sizing: border-box;
}

:root {
  --win98-teal: #008080;
  --win98-bg: #c0c0c0;
  --win98-dark: #808080;
  --win98-darkest: #0a0a0a;
  --win98-light: #dfdfdf;
  --win98-white: #ffffff;
  --win98-blue: #000080;
  --taskbar-height: 36px;
}

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

body {
  overflow: hidden;
  color: #000;
  font-family: "MS Sans Serif", "Tahoma", "Arial", sans-serif;
  font-size: 13px;
  background-color: var(--win98-teal);
  cursor: url("../media/Jeelh-Cursor-Light/Normal Select Light.cur"), default;
}

button {
  font: inherit;
  cursor: url("../media/Jeelh-Cursor-Light/Select Light.cur"), pointer;
}

.desktop {
  position: relative;
  width: 100%;
  height: calc(100% - var(--taskbar-height));
  padding: 10px 10px 48px;
  background-color: var(--win98-teal);
  background-image: url("../media/images/Wallpaper.jpg");
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
}

.desktop-icon {
  position: absolute;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 86px;
  border: 1px solid transparent;
  padding: 4px;
  color: #fff;
  background: transparent;
  text-align: center;
  user-select: none;
}

.desktop-icon:focus-visible,
.desktop-icon:hover {
  border: 1px dotted #fff;
  outline: none;
  background: rgba(0, 0, 128, 0.2);
}

.desktop-icon-image {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
}

.desktop-icon-label {
  max-width: 100%;
  text-shadow: 1px 1px 0 #000;
}

.window-layer {
  position: fixed;
  inset: 0 0 var(--taskbar-height) 0;
  pointer-events: none;
}

.win98-window {
  position: absolute;
  display: flex;
  flex-direction: column;
  min-width: 280px;
  min-height: 220px;
  border-top: 2px solid var(--win98-white);
  border-left: 2px solid var(--win98-white);
  border-right: 2px solid var(--win98-darkest);
  border-bottom: 2px solid var(--win98-darkest);
  background: var(--win98-bg);
  box-shadow: 1px 1px 0 0 var(--win98-dark), inset -1px -1px 0 0 var(--win98-dark);
  pointer-events: auto;
  overflow: hidden;
}

.win98-window[hidden] {
  display: none;
}

.title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 24px;
  padding: 2px 2px 2px 4px;
  background: linear-gradient(90deg, #0a246a, #a6caf0);
  color: #fff;
  user-select: none;
}

.win98-window.inactive .title-bar {
  background: linear-gradient(90deg, #808080, #c0c0c0);
}

.title-bar-left {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.title-bar-icon {
  width: 16px;
  height: 16px;
  image-rendering: pixelated;
}

.title-bar-text {
  margin: 0;
  font-size: 12px;
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.title-bar-buttons {
  display: flex;
  gap: 2px;
}

.win-button {
  width: 18px;
  height: 18px;
  border-top: 1px solid var(--win98-white);
  border-left: 1px solid var(--win98-white);
  border-right: 1px solid var(--win98-darkest);
  border-bottom: 1px solid var(--win98-darkest);
  padding: 0;
  background: var(--win98-bg);
  font-size: 10px;
  line-height: 1;
}

.win-button:active {
  border-top: 1px solid var(--win98-darkest);
  border-left: 1px solid var(--win98-darkest);
  border-right: 1px solid var(--win98-white);
  border-bottom: 1px solid var(--win98-white);
}

.window-body {
  flex: 1;
  margin: 3px;
  border-top: 2px solid var(--win98-dark);
  border-left: 2px solid var(--win98-dark);
  border-right: 2px solid var(--win98-white);
  border-bottom: 2px solid var(--win98-white);
  padding: 10px;
  overflow: auto;
  background: #fff;
}

.resize-handle {
  position: absolute;
  right: 1px;
  bottom: 1px;
  width: 15px;
  height: 15px;
  border: 0;
  background:
    linear-gradient(135deg, transparent 0 52%, #8b8b8b 52% 60%, transparent 60% 100%),
    linear-gradient(135deg, transparent 0 64%, #8b8b8b 64% 72%, transparent 72% 100%),
    linear-gradient(135deg, transparent 0 76%, #8b8b8b 76% 84%, transparent 84% 100%);
  cursor: url("../media/Jeelh-Cursor-Light/Diagonal Resize 2 Light.cur"), se-resize;
}

.window-body p {
  margin-top: 0;
  line-height: 1.35;
}

.window-body h3 {
  margin: 0 0 8px;
  font-size: 13px;
}

.window-body hr {
  border: 0;
  border-top: 1px solid #b5b5b5;
  margin: 10px 0;
}

.blog-list {
  margin: 0;
  padding-left: 16px;
}

.blog-list li + li {
  margin-top: 6px;
}

.about-profile {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  align-items: start;
}

.about-profile img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border: 2px solid #7c7c7c;
}

.blog-explorer {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 10px;
  height: 100%;
}

.blog-sidebar {
  border: 1px solid #9a9a9a;
  background: #f3f3f3;
  padding: 6px;
}

.blog-entry-button {
  display: block;
  width: 100%;
  margin-bottom: 4px;
  border: 1px solid #9a9a9a;
  background: #fff;
  padding: 4px 6px;
  text-align: left;
}

.blog-entry-button.active {
  color: #fff;
  border-color: #001f78;
  background: #0a246a;
}

.blog-viewer {
  border: 1px solid #9a9a9a;
  background: #fff;
  padding: 8px;
  overflow: auto;
}

.music-list {
  display: grid;
  gap: 8px;
}

.music-item {
  padding: 6px;
  border: 1px solid #8d8d8d;
  background: #f3f3f3;
}

.gallery {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gallery-item {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gallery-item img {
  width: auto;
  max-width: 100%;
  max-height: 520px;
  height: auto;
  border: 1px solid #7c7c7c;
  object-fit: contain;
  background: #f6f6f6;
}

.gallery-item figcaption {
  margin-top: 4px;
  font-size: 12px;
}

.taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  height: var(--taskbar-height);
  border-top: 2px solid var(--win98-light);
  padding: 4px;
  background: var(--win98-bg);
}

.start-menu {
  position: fixed;
  left: 4px;
  bottom: calc(var(--taskbar-height) + 4px);
  width: 240px;
  display: block;
  border-top: 2px solid var(--win98-white);
  border-left: 2px solid var(--win98-white);
  border-right: 2px solid var(--win98-darkest);
  border-bottom: 2px solid var(--win98-darkest);
  background: var(--win98-bg);
  z-index: 9999;
}

.start-menu-items {
  padding: 4px;
}

.start-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 1px solid transparent;
  padding: 4px;
  background: transparent;
  text-align: left;
}

.start-menu-item img {
  width: 16px;
  height: 16px;
  image-rendering: pixelated;
}

.start-menu-item:hover,
.start-menu-item:focus-visible {
  color: #fff;
  border: 1px dotted #fff;
  outline: none;
  background: #0a246a;
}

.desktop-context-menu {
  position: fixed;
  min-width: 170px;
  margin: 0;
  border-top: 2px solid var(--win98-white);
  border-left: 2px solid var(--win98-white);
  border-right: 2px solid var(--win98-darkest);
  border-bottom: 2px solid var(--win98-darkest);
  padding: 4px;
  background: var(--win98-bg);
  list-style: none;
  z-index: 9999;
}

.desktop-context-item {
  display: block;
  width: 100%;
  border: 1px solid transparent;
  padding: 4px 6px;
  background: transparent;
  text-align: left;
}

.desktop-context-item:hover,
.desktop-context-item:focus-visible {
  color: #fff;
  border: 1px dotted #fff;
  outline: none;
  background: #0a246a;
}

.start-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  min-width: 78px;
  border-top: 2px solid var(--win98-white);
  border-left: 2px solid var(--win98-white);
  border-right: 2px solid var(--win98-darkest);
  border-bottom: 2px solid var(--win98-darkest);
  padding: 0 8px;
  background: var(--win98-bg);
  font-weight: 700;
}

.start-button img {
  width: 16px;
  height: 16px;
  image-rendering: pixelated;
}

.start-button:active {
  border-top: 2px solid var(--win98-darkest);
  border-left: 2px solid var(--win98-darkest);
  border-right: 2px solid var(--win98-white);
  border-bottom: 2px solid var(--win98-white);
}

.start-button.active {
  border-top: 2px solid var(--win98-darkest);
  border-left: 2px solid var(--win98-darkest);
  border-right: 2px solid var(--win98-white);
  border-bottom: 2px solid var(--win98-white);
}

.start-menu[hidden],
.desktop-context-menu[hidden] {
  display: none;
}

.taskbar-items {
  display: flex;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.task-button {
  max-width: 220px;
  min-width: 140px;
  height: 28px;
  border-top: 2px solid var(--win98-white);
  border-left: 2px solid var(--win98-white);
  border-right: 2px solid var(--win98-darkest);
  border-bottom: 2px solid var(--win98-darkest);
  padding: 0 8px;
  overflow: hidden;
  background: var(--win98-bg);
  text-align: left;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.task-button.active {
  border-top: 2px solid var(--win98-darkest);
  border-left: 2px solid var(--win98-darkest);
  border-right: 2px solid var(--win98-white);
  border-bottom: 2px solid var(--win98-white);
  background: #d8d8d8;
}

.tray {
  display: flex;
  align-items: center;
  height: 28px;
  border-top: 1px solid var(--win98-dark);
  border-left: 1px solid var(--win98-dark);
  border-right: 1px solid var(--win98-white);
  border-bottom: 1px solid var(--win98-white);
  padding: 0 8px;
  background: #bdbdbd;
}

.clock {
  font-size: 12px;
}

@media (max-width: 700px) {
  :root {
    --taskbar-height: 46px;
  }

  body {
    font-size: 14px;
  }

  .desktop {
    height: calc(100dvh - var(--taskbar-height));
    padding: 8px 8px 56px;
    background-position: center bottom;
  }

  .desktop-icon {
    width: 76px;
    padding: 6px 2px;
  }

  .desktop-icon-image {
    width: 34px;
    height: 34px;
  }

  .window-layer {
    inset: 0 0 var(--taskbar-height) 0;
  }

  .win98-window {
    min-width: min(260px, calc(100vw - 16px));
    min-height: 220px;
    max-width: calc(100vw - 16px);
    max-height: calc(100dvh - var(--taskbar-height) - 16px);
  }

  .title-bar {
    height: 32px;
  }

  .title-bar-text {
    font-size: 13px;
  }

  .win-button {
    width: 28px;
    height: 26px;
    font-size: 12px;
  }

  .window-body {
    padding: 8px;
  }

  .resize-handle {
    width: 24px;
    height: 24px;
  }

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

  .about-profile img {
    width: 112px;
    height: 112px;
  }

  .blog-explorer {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .blog-sidebar {
    max-height: 110px;
    overflow: auto;
  }

  .gallery-item img {
    max-width: 100%;
    max-height: none;
  }

  .taskbar {
    height: var(--taskbar-height);
    gap: 3px;
    padding: 5px;
  }

  .start-button {
    min-width: 70px;
    height: 34px;
    padding: 0 6px;
  }

  .taskbar-items {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .taskbar-items::-webkit-scrollbar {
    display: none;
  }

  .task-button {
    min-width: 96px;
    max-width: 130px;
    height: 34px;
    padding: 0 6px;
  }

  .tray {
    height: 34px;
    padding: 0 6px;
  }

  .start-menu {
    left: 6px;
    right: 6px;
    bottom: calc(var(--taskbar-height) + 6px);
    width: auto;
  }

  .start-menu-item,
  .desktop-context-item {
    min-height: 36px;
  }

  .desktop-context-menu {
    max-width: calc(100vw - 16px);
  }
}
