:root {
  --desktop: #6f7d8b;
  --speck: #b7c0cb;
  --chrome: #a1a1a1;
  --chrome-mid: #868686;
  --chrome-dark: #565656;
  --chrome-light: #ededed;
  --active: #eda05e;
  --terminal: #505868;
  --terminal-light: #fff7df;
  --ink: #101010;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "Courier New", Courier, monospace;
  color: var(--ink);
  background: #1d252f;
}

button {
  font: inherit;
}

.desktop {
  position: relative;
  width: 100%;
  min-width: 320px;
  max-width: 100vw;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  padding: 8px;
  background-color: var(--desktop);
  background-image:
    radial-gradient(#d4dbe4 0.7px, transparent 0.8px),
    radial-gradient(#515f70 0.7px, transparent 0.8px);
  background-size: 4px 4px;
  background-position: 0 0, 2px 2px;
}

.window {
  position: absolute;
  max-width: calc(100vw - 16px);
  border: 2px solid var(--chrome-light);
  border-right-color: var(--chrome-dark);
  border-bottom-color: var(--chrome-dark);
  background: var(--chrome);
  box-shadow:
    inset 1px 1px 0 #d7d7d7,
    inset -1px -1px 0 #686868,
    2px 2px 0 #303030;
}

.titlebar {
  display: grid;
  grid-template-columns: 18px 1fr 40px;
  align-items: center;
  height: 22px;
  padding: 0 4px;
  color: white;
  text-shadow: 1px 1px 0 #6b6b6b;
  text-align: center;
  background: var(--chrome);
  border: 2px solid var(--chrome-dark);
  border-top-color: var(--chrome-light);
  border-left-color: var(--chrome-light);
  font-size: 14px;
  line-height: 1;
  min-width: 0;
}

.titlebar span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.titlebar.active {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.22), transparent 12px, transparent calc(100% - 12px), rgba(255, 255, 255, 0.18)),
    var(--active);
}

.window-control,
.window-actions i {
  display: block;
  width: 13px;
  height: 13px;
  border: 1px solid var(--chrome-dark);
  border-top-color: var(--chrome-light);
  border-left-color: var(--chrome-light);
  background: var(--chrome);
  box-shadow: inset -1px -1px 0 #757575;
}

.window-actions {
  display: flex;
  justify-content: end;
  gap: 4px;
}

.menubar {
  display: flex;
  gap: 20px;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  color: white;
  text-shadow: 1px 1px 0 #6b6b6b;
  text-decoration: underline;
  background: var(--chrome);
  border-top: 1px solid #d8d8d8;
  border-bottom: 2px solid var(--chrome-dark);
  overflow: hidden;
  white-space: nowrap;
}

.menu-link {
  display: inline-block;
  padding: 0;
  color: white;
  text-shadow: 1px 1px 0 #6b6b6b;
  text-decoration: underline;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.menu-link:hover,
.menu-link:focus-visible,
.menu-link.active {
  color: #fff7c9;
  outline: none;
}

.terminal {
  margin: 8px;
  padding: 10px 14px;
  overflow: auto;
  color: var(--terminal-light);
  background: var(--terminal);
  border: 2px solid #2f3440;
  border-top-color: var(--active);
  border-left-color: var(--active);
  scrollbar-color: #8d8d8d #b9b9b9;
  scrollbar-width: auto;
  white-space: pre-wrap;
}

.blog-window {
  z-index: 4;
  display: grid;
  grid-template-rows: 22px 30px minmax(0, 1fr);
  top: 8px;
  left: 8px;
  right: 8px;
  bottom: 8px;
  padding: 0;
}

.blog-terminal {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 17px;
  height: auto;
  min-height: 0;
  max-height: none;
  padding: 0;
  border-color: var(--active);
  line-height: 1.15;
  font-size: clamp(14px, 1.05vw, 16px);
  white-space: normal;
  overflow: hidden;
  overflow-wrap: break-word;
  word-break: normal;
}

.terminal-content {
  min-width: 0;
  min-height: 0;
  padding: 10px 14px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
}

.terminal-content::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.blog-terminal *,
.terminal-content * {
  max-width: 100%;
}

.markdown-body pre::-webkit-scrollbar {
  width: 17px;
  height: 17px;
}

.markdown-body pre::-webkit-scrollbar-track {
  background:
    linear-gradient(90deg, #5e5e5e 0 1px, #d5d5d5 1px 2px, transparent 2px),
    #b8b8b8;
  border-left: 1px solid #595959;
  box-shadow: inset 1px 0 0 #d9d9d9, inset -1px 0 0 #737373;
}

.markdown-body pre::-webkit-scrollbar-thumb {
  min-height: 34px;
  min-width: 34px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.35), transparent 5px),
    #929292;
  border: 2px solid #dedede;
  border-right-color: #585858;
  border-bottom-color: #585858;
  box-shadow: inset -1px -1px 0 #707070;
}

.markdown-body pre::-webkit-scrollbar-button {
  display: block;
  width: 17px;
  height: 17px;
  background-color: #a8a8a8;
  border: 2px solid #dedede;
  border-right-color: #565656;
  border-bottom-color: #565656;
}

.markdown-body pre::-webkit-scrollbar-button:vertical:decrement {
  background:
    linear-gradient(135deg, transparent 0 42%, #343434 43% 57%, transparent 58%) 4px 5px / 8px 8px no-repeat,
    linear-gradient(45deg, transparent 0 42%, #343434 43% 57%, transparent 58%) 5px 5px / 8px 8px no-repeat,
    #a8a8a8;
}

.markdown-body pre::-webkit-scrollbar-button:vertical:increment {
  background:
    linear-gradient(45deg, transparent 0 42%, #343434 43% 57%, transparent 58%) 4px 3px / 8px 8px no-repeat,
    linear-gradient(135deg, transparent 0 42%, #343434 43% 57%, transparent 58%) 5px 3px / 8px 8px no-repeat,
    #a8a8a8;
}

.markdown-body pre::-webkit-scrollbar-button:horizontal:decrement {
  background:
    linear-gradient(45deg, transparent 0 42%, #343434 43% 57%, transparent 58%) 6px 4px / 8px 8px no-repeat,
    linear-gradient(135deg, transparent 0 42%, #343434 43% 57%, transparent 58%) 6px 5px / 8px 8px no-repeat,
    #a8a8a8;
}

.markdown-body pre::-webkit-scrollbar-button:horizontal:increment {
  background:
    linear-gradient(135deg, transparent 0 42%, #343434 43% 57%, transparent 58%) 3px 4px / 8px 8px no-repeat,
    linear-gradient(45deg, transparent 0 42%, #343434 43% 57%, transparent 58%) 3px 5px / 8px 8px no-repeat,
    #a8a8a8;
}

.markdown-body pre::-webkit-scrollbar-corner {
  background: #a8a8a8;
  border: 2px solid #dedede;
  border-right-color: #565656;
  border-bottom-color: #565656;
}

.cde-scrollbar {
  display: grid;
  grid-template-rows: 17px minmax(0, 1fr) 17px;
  min-width: 17px;
  background: #b8b8b8;
  border-left: 1px solid #585858;
  box-shadow: inset 1px 0 0 #d8d8d8;
}

.scroll-arrow {
  position: relative;
  width: 17px;
  height: 17px;
  padding: 0;
  background: #a7a7a7;
  border: 2px solid #dedede;
  border-right-color: #585858;
  border-bottom-color: #585858;
  box-shadow: inset -1px -1px 0 #777;
}

.scroll-arrow::before {
  position: absolute;
  top: 5px;
  left: 4px;
  width: 0;
  height: 0;
  content: "";
}

.scroll-up::before {
  border-right: 4px solid transparent;
  border-bottom: 6px solid #343434;
  border-left: 4px solid transparent;
}

.scroll-down::before {
  top: 6px;
  border-top: 6px solid #343434;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
}

.scroll-track {
  position: relative;
  min-height: 0;
  background:
    linear-gradient(90deg, #5e5e5e 0 1px, #d8d8d8 1px 2px, transparent 2px),
    #b8b8b8;
  box-shadow: inset -1px 0 0 #727272;
  cursor: default;
}

.scroll-thumb {
  position: absolute;
  top: 0;
  right: 1px;
  left: 1px;
  min-height: 34px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.35), transparent 5px),
    #929292;
  border: 2px solid #dedede;
  border-right-color: #585858;
  border-bottom-color: #585858;
  box-shadow: inset -1px -1px 0 #707070;
  cursor: grab;
  touch-action: none;
}

.scroll-thumb.dragging {
  cursor: grabbing;
}

.blog-terminal h1,
.blog-terminal p {
  margin: 0;
}

.blog-terminal h1 {
  color: #fff7c9;
  font-size: clamp(17px, 1.45vw, 22px);
  font-weight: 400;
  line-height: 1.15;
}

.blog-terminal .meta {
  color: #d8e2ec;
  margin: 2px 0 12px;
}

.blog-terminal p + p {
  margin-top: 10px;
}

.post-index {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.entry-link {
  display: grid;
  grid-template-columns: minmax(96px, 140px) 1fr;
  gap: 12px;
  align-items: baseline;
  width: 100%;
  padding: 8px 10px;
  color: var(--terminal-light);
  text-align: left;
  text-decoration: none;
  background: transparent;
  border: 1px solid #8e98a9;
  box-shadow: inset 1px 1px 0 #687080, inset -1px -1px 0 #333946;
  cursor: pointer;
}

.entry-link:hover,
.entry-link:focus-visible {
  color: #101010;
  background: #fff7c9;
  outline: none;
}

.entry-link span {
  color: inherit;
}

.entry-link strong {
  font-weight: 400;
}

.entry-link small {
  grid-column: 2;
  color: inherit;
  line-height: 1.25;
  opacity: 0.85;
}

.markdown-body {
  margin-top: 12px;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  margin: 16px 0 8px;
  color: #fff7c9;
  font-size: 1em;
}

.markdown-body ul,
.markdown-body ol {
  margin: 10px 0 10px 24px;
  padding: 0;
}

.markdown-body li + li {
  margin-top: 4px;
}

.markdown-body blockquote {
  margin: 12px 0;
  padding: 4px 0 4px 12px;
  color: #ffffff;
  border-left: 2px solid #fff7c9;
}

.markdown-body pre {
  margin: 12px 0;
  padding: 8px;
  overflow: auto;
  color: #f7f1dc;
  background: #303643;
  border: 1px solid #8992a3;
  white-space: pre;
  max-width: 100%;
}

.markdown-body code {
  color: #fff7c9;
}

.markdown-body a {
  color: #fff7c9;
}

.markdown-body img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: min(70vh, 720px);
  margin: 14px 0;
  border: 2px solid var(--chrome-light);
  border-right-color: var(--chrome-dark);
  border-bottom-color: var(--chrome-dark);
  background: var(--chrome);
  box-shadow: 2px 2px 0 #303030;
  object-fit: contain;
}

.prompt {
  display: block;
  color: white;
  overflow-wrap: anywhere;
}

.tile > span {
  display: block;
}

.front-panel {
  position: absolute;
  right: 28px;
  bottom: 2px;
  left: 35px;
  z-index: 10;
  display: grid;
  grid-template-columns: 22px 56px 56px 56px 56px 64px 1fr 32px repeat(4, 56px) 54px;
  gap: 3px;
  align-items: stretch;
  height: 80px;
  max-width: calc(100vw - 16px);
  padding: 4px;
  background:
    linear-gradient(90deg, #d9d9d9 0 1px, transparent 1px),
    var(--chrome);
  border: 2px solid var(--chrome-light);
  border-right-color: var(--chrome-dark);
  border-bottom-color: var(--chrome-dark);
  box-shadow: inset 1px 1px 0 #d7d7d7, inset -1px -1px 0 #646464;
}

.panel-grip {
  border: 2px solid #707070;
  border-top-color: #dcdcdc;
  border-left-color: #dcdcdc;
  background:
    repeating-linear-gradient(0deg, #5f5f5f 0 1px, #e0e0e0 1px 3px),
    #a7a7a7;
}

.tile,
.workspace,
.exit {
  color: #202020;
  background: var(--chrome);
  border: 2px solid var(--chrome-light);
  border-right-color: var(--chrome-dark);
  border-bottom-color: var(--chrome-dark);
  box-shadow: inset 1px 1px 0 #d9d9d9, inset -1px -1px 0 #777;
  cursor: pointer;
}

.tile {
  cursor: default;
}

.tile:focus-visible,
.workspace:focus-visible {
  outline: 2px dotted #111;
  outline-offset: -5px;
}

.tile:hover,
.workspace:hover,
.workspace.active {
  background: #aebfce;
}

.clock,
.date,
.tool,
.printer,
.utility {
  display: grid;
  place-items: center;
  min-width: 0;
}

.analog {
  width: 43px;
  height: 43px;
  border: 2px solid white;
  border-radius: 50%;
  background:
    linear-gradient(45deg, transparent 48%, #f5f5f5 49% 51%, transparent 52%),
    linear-gradient(135deg, transparent 48%, #f5f5f5 49% 51%, transparent 52%),
    #8c8c8c;
  box-shadow: inset -2px -2px #575757;
}

.date span,
.date strong {
  display: block;
  padding: 0 4px;
  background: white;
  box-shadow: 2px 2px 0 #5b5b5b;
}

.date strong {
  font-size: 22px;
}

.folder-icon {
  width: 38px;
  height: 26px;
  margin-top: 8px;
  background:
    linear-gradient(150deg, transparent 0 28%, #e879d5 29% 46%, transparent 47%),
    linear-gradient(#2c57af 0 0) 5px 7px / 28px 14px no-repeat,
    #f2f2f2;
  border: 1px solid #555;
}

.memo-icon {
  width: 34px;
  height: 42px;
  background:
    repeating-linear-gradient(0deg, #efefef 0 5px, #3d4a6e 5px 6px),
    #f9f9f9;
  border: 1px solid #555;
  transform: rotate(-8deg);
}

.printer span,
.printer-icon {
  width: 40px;
  height: 26px;
  background:
    linear-gradient(#f8f8f8 0 0) 8px -5px / 24px 15px no-repeat,
    linear-gradient(#ffffff 0 0) 6px 15px / 28px 8px no-repeat,
    #b8b8b8;
  border: 1px solid #555;
}

.workspace-switcher {
  display: grid;
  grid-template-columns: repeat(2, minmax(72px, 1fr));
  gap: 5px;
  padding: 3px 6px;
  border-left: 1px solid #6d6d6d;
  border-right: 1px solid #dfdfdf;
}

.workspace {
  min-width: 0;
  padding: 0 8px;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  color: white;
  text-shadow: 1px 1px 0 #5b6670;
  background: #8fa0af;
  font-size: 16px;
  white-space: nowrap;
}

.exit {
  align-self: center;
  height: 36px;
  padding: 0;
  font-size: 14px;
}

.drawer-icon,
.palette-icon,
.book-icon,
.panel-bin {
  width: 34px;
  height: 38px;
  border: 1px solid #555;
  background: #cfcfcf;
}

.drawer-icon {
  background:
    linear-gradient(#f3f3f3 0 0) 4px 7px / 26px 7px no-repeat,
    linear-gradient(#9e9e9e 0 0) 6px 19px / 22px 5px no-repeat,
    #cfcfcf;
}

.palette-icon {
  background:
    radial-gradient(circle at 24px 10px, #e13d3d 0 4px, transparent 5px),
    radial-gradient(circle at 13px 17px, #275ce8 0 4px, transparent 5px),
    radial-gradient(circle at 26px 24px, #28a945 0 4px, transparent 5px),
    #e9e9e9;
}

.book-icon {
  background:
    repeating-linear-gradient(90deg, #315a89 0 6px, #111 6px 8px, #d93636 8px 14px, #111 14px 16px),
    #cfcfcf;
}

.panel-bin {
  align-self: center;
  justify-self: center;
  height: 48px;
  background:
    linear-gradient(#efefef 0 0) 7px 5px / 20px 3px no-repeat,
    linear-gradient(90deg, #949494, #dedede);
}

@media (max-width: 900px) {
  .desktop {
    padding: 8px;
  }

  .blog-window {
    left: 8px;
    right: 8px;
    top: 8px;
    bottom: 8px;
  }
}

@media (max-width: 640px) {
  .desktop {
    padding: 6px;
  }

  .window,
  .front-panel {
    max-width: calc(100vw - 12px);
  }

  .blog-window {
    top: 6px;
    right: 6px;
    bottom: 6px;
    left: 6px;
  }

  .titlebar {
    grid-template-columns: 16px minmax(0, 1fr) 34px;
    height: 24px;
    padding: 0 4px;
    font-size: 13px;
  }

  .blog-window {
    grid-template-rows: 24px 28px minmax(0, 1fr);
  }

  .menubar {
    gap: 12px;
    min-height: 26px;
    padding: 4px 8px;
    font-size: 13px;
  }

  .terminal {
    margin: 6px;
  }

  .blog-terminal {
    font-size: 14px;
  }

  .entry-link {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 8px;
  }

  .entry-link small {
    grid-column: 1;
  }

  .blog-terminal p,
  .entry-link,
  .entry-link span,
  .entry-link strong,
  .entry-link small,
  .markdown-body {
    overflow-wrap: anywhere;
  }
}

@media (max-width: 420px) {
  .window,
  .front-panel {
    max-width: calc(100vw - 8px);
  }

  .desktop {
    padding: 4px;
  }

  .blog-window {
    top: 4px;
    right: 4px;
    bottom: 4px;
    left: 4px;
  }

  .menubar {
    gap: 10px;
    font-size: 12px;
  }

  .blog-terminal h1 {
    font-size: 18px;
  }
}
