@font-face {
  font-family: "Unifont";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/unifont-17.0.04.woff2") format("woff2");
}

:root {
  --paper: #f7f7f4;
  --ink: #111;
  --muted: #565656;
  --line: #1d1d1d;
  --bar: #f1f1ee;
  --bar-edge: #d9d9d2;
  --shadow: rgba(0, 0, 0, 0.08);
  --shell-gap: clamp(10px, 1.6vw, 24px);
  --pixel-font: "Unifont", "Courier New", Courier, monospace;
  --mono-font: "Unifont", "Courier New", Courier, monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  width: 100%;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono-font);
  letter-spacing: 0;
}

body {
  min-height: 100vh;
  width: 100%;
  overflow: hidden;
  margin: 0;
  background:
    linear-gradient(var(--shadow) 1px, transparent 1px),
    linear-gradient(90deg, var(--shadow) 1px, transparent 1px),
    var(--paper);
  background-size: 4px 4px;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  color: inherit;
  font: inherit;
}

.desktop-shell {
  position: relative;
  width: calc(100vw - (var(--shell-gap) * 2));
  height: calc(100svh - (var(--shell-gap) * 2));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: var(--shell-gap);
  padding: clamp(28px, 5vw, 72px) clamp(22px, 5vw, 64px) 72px;
  background: rgba(247, 247, 244, 0.86);
}

.desktop-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.06);
}

.entry-panel {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  align-content: center;
  height: 100%;
  min-height: 0;
  text-align: center;
}

.inner-shell {
  display: grid;
  align-items: stretch;
  justify-items: stretch;
  min-height: 0;
  padding: clamp(18px, 3vw, 42px) clamp(18px, 3vw, 42px) 72px;
}

.window-panel {
  position: relative;
  z-index: 2;
  display: flex;
  height: 100%;
  max-height: 100%;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  border: 1px solid var(--line);
  background: rgba(247, 247, 244, 0.74);
  box-shadow: 6px 6px 0 var(--bar-edge);
}

.window-panel-wide {
  width: 100%;
  max-width: 100%;
}

.window-titlebar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.window-title {
  padding: 10px 14px;
  overflow: hidden;
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.window-tabs {
  display: flex;
  align-items: stretch;
  border-left: 1px solid var(--line);
}

.window-tabs a {
  display: inline-grid;
  min-width: 68px;
  min-height: 38px;
  place-items: center;
  border-right: 1px solid var(--line);
  font-size: 14px;
}

.window-tabs a:last-child {
  border-right: 0;
}

.window-tabs a:hover,
.window-tabs a:focus-visible,
.window-tabs a[aria-current="page"] {
  outline: 0;
  background: var(--ink);
  color: var(--paper);
}

.window-content {
  min-height: 0;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--ink) transparent;
}

.terminal-lines,
.content-body {
  padding: 18px 20px;
  font-size: clamp(14px, 1.6vw, 18px);
  font-weight: 700;
  line-height: 1.65;
  min-width: 0;
  overflow-wrap: anywhere;
}

.terminal-lines p,
.content-body p {
  margin: 0 0 10px;
}

.terminal-prompt {
  color: var(--muted);
}

.blog-list {
  display: grid;
  gap: 14px;
}

.post-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 18px;
  padding: 12px 0;
  border-top: 1px dashed var(--line);
}

.post-row:first-of-type {
  border-top: 0;
}

.post-row-title {
  overflow-wrap: anywhere;
  font-size: clamp(18px, 2vw, 24px);
}

.post-row-title::before {
  content: "./";
  color: var(--muted);
}

.post-row-title:hover,
.post-row-title:focus-visible,
.post-nav a:hover,
.post-nav a:focus-visible,
.prose-content a:hover,
.prose-content a:focus-visible {
  outline: 0;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.post-row time {
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.post-row-excerpt {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.project-list {
  gap: 16px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 14px;
}

.project-card {
  display: grid;
  min-height: 172px;
  grid-template-rows: minmax(0, 1fr) auto;
  border: 1px solid var(--line);
  background: rgba(247, 247, 244, 0.78);
  box-shadow: 4px 4px 0 var(--bar-edge);
}

.project-card-main {
  padding: 14px;
  min-width: 0;
}

.project-card h2 {
  margin: 0 0 10px;
  font-size: clamp(19px, 2vw, 25px);
  line-height: 1.15;
}

.project-card p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.project-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.project-actions a {
  display: grid;
  min-height: 38px;
  place-items: center;
  padding: 8px 10px;
  border-right: 1px solid var(--line);
  font-size: 14px;
}

.project-actions a:last-child {
  border-right: 0;
}

.project-actions a:hover,
.project-actions a:focus-visible {
  outline: 0;
  background: var(--ink);
  color: var(--paper);
}

.project-detail-summary {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
}

.post-header {
  padding: 18px 20px 0;
}

.post-heading-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.post-header h1 {
  margin: 0 0 8px;
  font-size: clamp(24px, 3vw, 38px);
  font-weight: 700;
  line-height: 1.1;
}

.lang-switch {
  flex: 0 0 auto;
  min-width: 42px;
  min-height: 28px;
  display: inline-grid;
  place-items: center;
  padding: 4px 8px;
  border: 1px solid var(--line);
  background: var(--paper);
  font-family: var(--pixel-font);
  font-size: 13px;
  line-height: 1;
}

.lang-switch:hover,
.lang-switch:focus-visible {
  outline: 0;
  background: var(--ink);
  color: var(--paper);
}

.post-date {
  display: block;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.post-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  padding: 0 20px 20px;
  font-size: 15px;
}

.prose-content h1,
.prose-content h2,
.prose-content h3 {
  margin: 18px 0 10px;
  line-height: 1.2;
}

.prose-content h1:first-child,
.prose-content h2:first-child,
.prose-content h3:first-child {
  margin-top: 0;
}

.prose-content ul,
.prose-content ol {
  margin: 0 0 14px;
  padding-left: 1.3em;
}

.prose-content li {
  margin: 4px 0;
}

.prose-content blockquote {
  position: relative;
  margin: 22px 0 4px;
  padding: 12px 14px 12px 18px;
  border: 1px solid var(--line);
  border-left-width: 6px;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(0, 0, 0, 0.035) 0,
      rgba(0, 0, 0, 0.035) 1px,
      transparent 1px,
      transparent 8px
    ),
    var(--paper);
  box-shadow: 4px 4px 0 var(--shadow);
}

.prose-content blockquote::before {
  content: ">";
  position: absolute;
  top: 10px;
  left: 6px;
  color: var(--muted);
  font-weight: 700;
}

.prose-content blockquote p {
  margin: 0 0 8px;
}

.prose-content blockquote p:last-child {
  margin-bottom: 0;
}

.prose-content blockquote strong {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid var(--line);
  background: var(--ink);
  color: var(--paper);
  line-height: 1.25;
}

.prose-content blockquote a {
  overflow-wrap: anywhere;
}

.prose-content code {
  display: inline-block;
  max-width: 100%;
  padding: 1px 5px;
  border: 1px solid var(--line);
  background: var(--bar);
  font-size: 0.88em;
  line-height: 1.25;
  overflow-wrap: anywhere;
  vertical-align: baseline;
}

.prose-content pre {
  max-width: 100%;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  line-height: 1.45;
}

.prose-content figure.highlight {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 0 0 14px;
  border: 1px solid var(--line);
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  line-height: 1.45;
  overflow: hidden;
}

.prose-content figure.highlight table {
  display: block;
  width: 100%;
  border-collapse: collapse;
}

.prose-content figure.highlight tbody,
.prose-content figure.highlight tr {
  display: block;
  width: 100%;
}

.prose-content figure.highlight td {
  padding: 0;
}

.prose-content figure.highlight .gutter {
  display: none;
}

.prose-content figure.highlight .code {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow: auto;
  padding: 12px;
  padding-top: 38px;
}

.prose-content figure.highlight .code pre,
.prose-content figure.highlight .gutter pre {
  width: max-content;
  min-width: 100%;
  margin: 0;
  color: inherit;
  background: transparent;
}

.code-copy-button {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  min-width: 54px;
  min-height: 26px;
  padding: 3px 8px;
  border: 1px solid var(--paper);
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  font-family: var(--pixel-font);
  font-size: 12px;
  line-height: 1;
}

.code-copy-button:hover,
.code-copy-button:focus-visible {
  outline: 0;
  background: var(--paper);
  color: var(--ink);
}

.site-title {
  margin: 0 0 16px;
  font-family: var(--pixel-font);
  font-size: clamp(34px, 4.6vw, 60px);
  font-weight: 400;
  line-height: 1;
}

.pixel-rule {
  color: var(--muted);
  font-size: clamp(15px, 2vw, 23px);
  font-weight: 700;
  line-height: 1;
}

.sleep-scene {
  position: relative;
  display: grid;
  width: min(82vw, 560px);
  min-height: clamp(128px, 20vw, 220px);
  place-items: center;
  margin: clamp(26px, 5vh, 48px) 0 clamp(20px, 3vh, 32px);
}

.kaomoji-sleeper {
  font-family: var(--mono-font);
  font-size: clamp(66px, 10vw, 128px);
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
}

.dream-bubble {
  position: absolute;
  z-index: 3;
  top: 8%;
  right: 18%;
  font-size: clamp(14px, 2.2vw, 26px);
  font-weight: 700;
  opacity: 0;
  animation: bubble-rise 2.8s steps(4, end) infinite;
}

.bubble-two {
  top: -3%;
  right: 9%;
  animation-delay: 0.6s;
}

.bubble-three {
  top: -14%;
  right: 0;
  animation-delay: 1.2s;
}

@keyframes bubble-rise {
  0% {
    transform: translate(0, 8px) scale(0.8);
    opacity: 0;
  }

  20%,
  70% {
    opacity: 1;
  }

  100% {
    transform: translate(8px, -20px) scale(1.2);
    opacity: 0;
  }
}

.enter-link {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  font-family: var(--pixel-font);
  font-size: clamp(16px, 2vw, 26px);
  font-weight: 400;
  line-height: 1;
}

.entry-loader {
  display: grid;
  justify-items: center;
  gap: 8px;
  width: min(72vw, 300px);
  margin-bottom: 14px;
  font-family: var(--pixel-font);
  font-size: clamp(13px, 1.4vw, 17px);
}

.entry-loader[hidden],
.enter-link[hidden] {
  display: none;
}

.entry-progress {
  width: 100%;
  height: 12px;
  padding: 2px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.entry-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--ink);
  transition: width 260ms steps(6, end);
}

.entry-loading-text {
  color: var(--muted);
  line-height: 1;
}

.enter-link:hover,
.enter-link:focus-visible {
  outline: 0;
  text-decoration: underline;
  text-underline-offset: 6px;
}

.system-bar {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 42px;
  min-width: 0;
  padding: 4px 24px 4px 34px;
  border-top: 1px solid var(--line);
  background: var(--bar);
}

.system-start,
.player-controls {
  display: flex;
  align-items: center;
}

.system-start {
  position: relative;
  min-width: 0;
  gap: 14px;
}

.task-icon {
  position: relative;
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid var(--ink);
  font-family: var(--pixel-font);
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
  flex: 0 0 auto;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.task-icon:hover,
.task-icon:focus-visible,
.music-player button:hover,
.music-player button:focus-visible {
  outline: 1px dashed var(--ink);
  outline-offset: 3px;
}

.start-menu {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  z-index: 5;
  width: 180px;
  border: 1px solid var(--line);
  background: var(--bar);
  box-shadow: 4px 4px 0 var(--bar-edge);
}

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

.start-menu a {
  display: block;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}

.start-menu a:last-child {
  border-bottom: 0;
}

.start-menu a::before {
  content: "> ";
  color: var(--muted);
}

.start-menu a:hover,
.start-menu a:focus-visible {
  outline: 0;
  background: var(--ink);
  color: var(--paper);
}

.windows-icon {
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  border: 0;
}

.windows-icon span {
  width: 100%;
  height: 100%;
  background: var(--ink);
}

.filing-text {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-family: var(--pixel-font);
  font-size: clamp(11px, 0.9vw, 14px);
  line-height: 1;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.filing-text:hover,
.filing-text:focus-visible {
  text-decoration: underline;
}

.music-player {
  justify-self: end;
  display: grid;
  grid-template-columns: minmax(0, 360px) 96px;
  align-items: center;
  gap: 12px;
  width: min(100%, 640px);
  min-width: 0;
}

.track-line {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-family: var(--pixel-font);
  font-size: clamp(12px, 1vw, 16px);
  font-weight: 400;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.player-controls {
  display: grid;
  grid-template-columns: repeat(3, 26px);
  justify-content: end;
  gap: 8px;
  width: 96px;
  min-width: 96px;
}

.music-player button {
  display: inline-grid;
  width: 26px;
  height: 26px;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: var(--pixel-font);
  font-size: 13px;
  font-weight: 400;
}

.clock {
  justify-self: end;
  min-width: 5ch;
  font-family: var(--pixel-font);
  font-size: 13px;
  font-weight: 400;
  text-align: right;
}

@media (max-width: 760px) {
  :root {
    --shell-gap: 8px;
  }

  .desktop-shell {
    height: calc(100svh - (var(--shell-gap) * 2));
    padding: 64px 16px 120px;
    border-radius: 6px;
  }

  .inner-shell {
    padding: 16px 16px 120px;
  }

  .entry-panel {
    height: 100%;
  }

  .site-title {
    font-size: 42px;
  }

  .sleep-scene {
    width: min(74vw, 360px);
    max-width: 100%;
    overflow: hidden;
  }

  .system-bar {
    grid-template-columns: 1fr auto;
    gap: 8px 12px;
    padding: 8px 14px;
  }

  .system-start {
    grid-column: 1;
    grid-row: 2;
    gap: 10px;
    min-width: 0;
  }

  .start-menu {
    width: min(220px, calc(100vw - 24px));
  }

  .music-player {
    grid-column: 1 / -1;
    grid-row: 1;
    justify-self: stretch;
    grid-template-columns: minmax(0, 1fr) 96px;
    gap: 8px;
    width: 100%;
  }

  .filing-text {
    font-size: 11px;
  }

  .clock {
    grid-column: 2;
    grid-row: 2;
    font-size: 12px;
  }

  .track-line {
    font-size: 12px;
  }

  .window-titlebar {
    grid-template-columns: 1fr;
  }

  .window-title {
    border-bottom: 1px solid var(--line);
  }

  .window-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-left: 0;
    width: 100%;
    min-width: 0;
  }

  .window-tabs a {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .post-row {
    grid-template-columns: 1fr;
  }

  .post-row time {
    white-space: normal;
  }

  .post-heading-row {
    align-items: start;
  }

  .lang-switch {
    min-width: 36px;
    font-size: 12px;
  }

  .project-card {
    min-height: 150px;
  }

  .project-actions a {
    min-height: 36px;
  }
}

@media (max-width: 430px) {
  .site-title {
    font-size: 38px;
  }

  .enter-link {
    font-size: 16px;
  }

  .music-player {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .player-controls {
    justify-content: flex-start;
  }

  .system-bar {
    padding-inline: 10px;
  }

  .system-start {
    gap: 8px;
  }
}
