@font-face {
  font-family: "Fusion Pixel ZH";
  src:
    local("Fusion Pixel 12px Monospaced zh_hans"),
    local("Fusion Pixel 12px Proportional zh_hans"),
    local("Fusion Pixel 10px Monospaced zh_hans"),
    url("assets/fonts/fusion-pixel-12px-monospaced-zh_hans.otf.woff2") format("woff2");
  font-display: swap;
  unicode-range:
    U+3000-303F,
    U+3400-4DBF,
    U+4E00-9FFF,
    U+F900-FAFF,
    U+FF00-FFEF;
}

@font-face {
  font-family: "PxPlus IBM VGA8";
  src:
    local("PxPlus IBM VGA8"),
    url("assets/fonts/PxPlus_IBM_VGA8.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "WenQuanYi Bitmap Song";
  src:
    local("WenQuanYi Bitmap Song"),
    url("assets/fonts/WenQuanYi_Bitmap_Song_16px.ttf") format("truetype");
  font-display: swap;
}

:root {
  --page-width: min(900px, calc(100% - 24px));
  --font-main: "PxPlus IBM VGA8", "Perfect DOS VGA 437", "Courier New", monospace;
  --font-code: "WenQuanYi Bitmap Song", "Fusion Pixel ZH", monospace;
  --font-zh: "Fusion Pixel ZH", "Fusion Pixel 12px Monospaced zh_hans", "Fusion Pixel 12px Proportional zh_hans", "Fusion Pixel 10px Monospaced zh_hans", "Fusion Pixel", "Zpix", "Ark Pixel 12px Monospaced zh_cn", "WenQuanYi Bitmap Song", monospace;

  --bar-light: #585d61;
  --bar-dark: #37393b;
  --button-shadow: #2b2b2b;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  padding-top: 10px;

  color: white;
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.2;

  -webkit-font-smoothing: none;
  image-rendering: pixelated;

  background-color: rgb(123, 123, 123);
  background-image:
    linear-gradient(45deg, #595959 25%, transparent 25%),
    linear-gradient(-45deg, #595959 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #595959 75%),
    linear-gradient(-45deg, transparent 75%, #595959 75%);
  background-position:
    0 0,
    0 16px,
    16px -16px,
    -16px 0;
  background-size: 32px 32px;

  animation: bg-scroll 15s linear infinite;
}

@keyframes bg-scroll {
  from {
    background-position:
      0 0,
      0 16px,
      16px -16px,
      -16px 0;
  }

  to {
    background-position:
      -512px 512px,
      -512px 528px,
      -496px 496px,
      -528px 512px;
  }
}

.winbar,
.title-box,
.bar,
.main-content {
  width: var(--page-width);
  margin-right: auto;
  margin-left: auto;
}

/* WINBAR */

.winbar {
  height: 29px;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 2px 5px;

  color: #111;
  background: linear-gradient(to bottom, #d1d1d1, #8d8d8d);
  border-top: 3px solid #f8f8f8;
  border-right: 3px solid #3a3a3a;
  border-bottom: 3px solid #3a3a3a;
  border-left: 3px solid #f2f2f2;
}

.winbar .bar-text {
  flex: 1;
  min-width: 0;
  margin-right: auto;
  padding: 1px 4px 0;
  overflow: hidden;

  color: #111;
  font-size: 88%;
  line-height: 1;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.35);
}

.winbar-icon,
.winbar img {
  width: 32px !important;
  height: 32px !important;
  flex: 0 0 auto;
  margin: 0 3px 0 1px;
  object-fit: contain;
  image-rendering: pixelated;
}

.winbar-item,
.bar-item {
  height: 63%;
  min-height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;

  padding: 3px 10px;
  border: 1px solid #000;

  font-size: 86%;
  line-height: 1;

  background: linear-gradient(to bottom, var(--bar-light), var(--bar-dark));
  box-shadow: 0 2px 0 var(--button-shadow);
  cursor: pointer;
  transform: translate(0, 0);
  transition: transform 0.02s, box-shadow 0.02s;

  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}

.winbar-item {
  width: 26px;
  height: 16px;
  min-height: 16px;
  padding: 0 0 1px;
  margin-left: 1px;

  color: #fff;
  font-size: 95%;
  line-height: 1;
}

.winbar-minimize {
  color: rgb(13, 201, 3);
}

.winbar-maximize {
  color: rgb(226, 223, 0);
}

.winbar-close {
  color: rgb(255, 0, 0);
}

.winbar-item:active,
.bar-item:active {
  box-shadow: 0 0 0 #000;
  transform: translate(0, 3px);
}

.winbar-item:active {
  transform: translate(0, 2px);
}

/* TITLE / STARFIELD */

.title-box {
  height: 250px;
  position: relative;
  overflow: hidden;

  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;

  border: 4px solid transparent;
  border-image: linear-gradient(to bottom, #242424, #373737) 1;
  background: #050510;
}

#starfield {
  position: absolute;
  inset: 0;

  width: 100%;
  height: 100%;
  display: block;

  pointer-events: none;
  image-rendering: pixelated;
}

.title-inner {
  width: 97%;
  height: 89%;
  position: relative;
  z-index: 1;

  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.site-logo {
  width: 90%;
  height: auto;
  image-rendering: pixelated;
}

.site-button {
  position: absolute;
  left: 91.5%;
  top: 91%;

  display: block;
  line-height: 0;
  cursor: pointer;
  transform: scale(0.86);
  transform-origin: center;

  background: transparent;
}

.site-button img {
  display: block;
  image-rendering: pixelated;
}

.garfieldpeek {
  position: absolute;
  left: 128px;
  top: 310px;
  width: 145px;
  height: 30px;

  cursor: pointer;
  background: transparent;
}

/* TOP BAR */

.bar {
  height: 32px;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 0 6px;

  background: linear-gradient(to bottom, #171717, #262626);
}

.bar-item {
  margin-right: 2px;
  margin-left: 2px;
}

.bar-text {
  padding: 1px 0 0;
  font-size: 85%;

  background: none;
  border: 0;
  box-shadow: none;
  cursor: default;
  transform: none;

  -webkit-user-select: text;
  -moz-user-select: text;
  user-select: text;
}

#current-time {
  padding-left: 10px;
  font-size: 85%;
  text-align: center;
}

/* MAIN CONTENT */

.main-content {
  display: flex;
  border: 1px solid #999999;
}

.nav-column,
.content-box {
  border: 1px solid #999999;
}

.nav-column {
  width: 24%;
  min-width: 170px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 10px 0;

  background: linear-gradient(to bottom, #171717, #262626);
}

.nav-box {
  width: 90%;
  margin-right: auto;
  margin-left: auto;
  padding: 10px 0;
  text-align: center;

  border: 1px solid rgba(255, 255, 255, 0.25);
  background-color: rgba(130, 130, 124, 0.23);
}

.nav-text {
  display: flex;
  align-items: center;
  justify-content: center;

  color: white;
  font-size: 107%;
  text-decoration: none;

  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}

.nav-item {
  width: 95%;
  height: 19px;
  display: flex;
  align-items: center;
  justify-content: center;

  padding: 3px 8px;
  border: 1px solid #000;

  color: white;
  font-size: 83%;
  text-decoration: none;

  background: linear-gradient(to bottom, var(--bar-light), var(--bar-dark));
  box-shadow: 0 2px 0 var(--button-shadow);
  cursor: pointer;
  transform: translate(0, 0);
  transition: transform 0.02s, box-shadow 0.02s;

  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}

/* Keep navigation links styled as buttons in every link state. */
.nav-item:link,
.nav-item:visited,
.nav-item:hover,
.nav-item:focus,
.nav-item:active {
  color: white;
  text-decoration: none;
}

.nav-item:focus-visible {
  outline: 1px dotted white;
  outline-offset: -3px;
}

.nav-box .nav-item {
  margin: 0 auto 3px;
}

.nav-box .nav-item:last-child {
  margin-bottom: 0;
}

.nav-item:active {
  box-shadow: 0 0 0 #000;
  transform: translate(0, 3px);
}

.nav-recent {
  display: flex;
  align-items: stretch;
  justify-content: flex-start;

  color: white;
  font-size: 85%;
  text-decoration: none;

  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}

.nav-box p {
  margin: 6px 8px;
  font-size: 83%;
}

.content-box {
  flex: 1;
  min-width: 0;

  /* Normal block flow lets pages use headings, paragraphs, lists,
     tables, images, forms, and custom layouts without fighting flex. */
  display: block;
  text-align: left;

  background: linear-gradient(to bottom, #464646, #313131);
}

.content-inner {
  width: 100%;
  min-height: 100%;
  position: relative;
  z-index: 1;

  display: block;
  padding: 18px;
  text-align: inherit;
}

.content-table-inner {
  display: flex;
  align-items: stretch;
  justify-content: flex-start;

  color: white;
  font-size: 85%;
  text-decoration: none;

  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}

.content-text {
  /* A centered document-like column with left-aligned text. */
  width: min(100%, 620px);
  height: auto;
  position: static;

  display: block;
  margin-right: auto;
  margin-left: auto;
  text-align: left;
  overflow-wrap: anywhere;
}

/* Alignment utilities change the text, not the centered content column. */
.text-left {
  text-align: left;
}

.text-center {
  text-align: center;
}

/* Markdown-like heading levels. The title-* classes are optional aliases. */
.content-text :is(h1, .title-1),
.content-text :is(h2, .title-2),
.content-text :is(h3, .title-3),
.content-text :is(h4, .title-4),
.content-text :is(h5, .title-5),
.content-text :is(h6, .title-6) {
  margin-top: 1.25em;
  margin-bottom: 0.55em;
  color: white;
  font-family: inherit;
  font-weight: normal;
  line-height: 1.15;
}

.content-text :is(h1, .title-1) {
  padding-bottom: 5px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.45);
  font-size: 2em;
}

.content-text :is(h2, .title-2) {
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
  font-size: 1.65em;
}

.content-text :is(h3, .title-3) {
  font-size: 1.4em;
}

.content-text :is(h4, .title-4) {
  font-size: 1.2em;
}

.content-text :is(h5, .title-5) {
  font-size: 1em;
}

.content-text :is(h6, .title-6) {
  color: #d0d0d0;
  font-size: 0.85em;
}

/* Paragraph spacing similar to rendered Markdown. */
.content-text p {
  margin: 0 0 0.9em;
}


/* FREE-FORM TEXT */

/*
  Preserves typed spaces, tabs, and line breaks while still wrapping long text.

  Example:
  <div class="freeform-text">Text    with spaces
      and indentation.</div>
*/
.freeform-text {
  display: block;
  white-space: pre-wrap;
  tab-size: 4;
  overflow-wrap: anywhere;
}

/* Optional predictable indentation without typing literal spaces. */
.indent-1 {
  margin-left: 2ch;
}

.indent-2 {
  margin-left: 4ch;
}

.indent-3 {
  margin-left: 6ch;
}

.indent-4 {
  margin-left: 8ch;
}

/* MARKDOWN-LIKE LISTS */

.content-text ul,
.content-text ol {
  margin: 0.7em 0 0.9em;
  padding-left: 2em;
  text-align: left;
}

.content-text ul {
  list-style-type: square;
}

.content-text ul ul {
  list-style-type: circle;
}

.content-text ul ul ul {
  list-style-type: disc;
}

.content-text ol {
  list-style-type: decimal;
}

.content-text ol ol {
  list-style-type: lower-alpha;
}

.content-text ol ol ol {
  list-style-type: lower-roman;
}

.content-text li {
  margin: 0.3em 0;
  padding-left: 0.2em;
}

.content-text li::marker {
  color: #d9ffd9;
}

.content-text li > ul,
.content-text li > ol {
  margin-top: 0.3em;
  margin-bottom: 0.3em;
}

/* Optional list variants. */
.content-text .list-compact > li {
  margin-top: 0;
  margin-bottom: 0;
}

.content-text .list-no-marker {
  padding-left: 0;
  list-style: none;
}

/* Markdown-like quote and divider styling. */
.content-text blockquote {
  margin: 0.9em 0;
  padding: 0.45em 0.8em;

  color: #dddddd;
  text-align: left;

  border-left: 4px solid #929292;
  background: rgba(0, 0, 0, 0.18);
}

.content-text blockquote > :first-child {
  margin-top: 0;
}

.content-text blockquote > :last-child {
  margin-bottom: 0;
}

.content-text hr {
  margin: 1.2em 0;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.4);
}

/* Inline code. */
.content-text code {
  padding: 1px 4px;
  font-family: var(--font-code);
  font-size: 18px;
  font-synthesis: none;
  color: #d9ffd9;
  white-space: break-spaces;
}

.code-bg {
  padding: 1px 4px;
  font-family: var(--font-code);
  font-size: 18px;
  font-synthesis: none;
  border: 1px solid #777;
  color: #d9ffd9;
  background: #202020;
  white-space: break-spaces;
}

/* Fenced code-block box: <pre><code>...</code></pre> */
.content-text pre {
  max-width: 100%;
  margin: 0.9em 0;
  padding: 12px 14px;
  overflow-x: auto;

  color: #d9ffd9;
  font-family: var(--font-code);
  font-size: 16px;
  font-style: normal;
  font-weight: normal;
  font-synthesis: none;
  line-height: 1.35;
  text-align: left;
  tab-size: 4;
  white-space: pre;
  overflow-wrap: normal;
  word-break: normal;

  background: #151515;
  border-top: 2px solid #858585;
  border-left: 2px solid #858585;
  border-right: 2px solid #090909;
  border-bottom: 2px solid #090909;
  box-shadow: inset 1px 1px 0 #2d2d2d;
}

.content-text pre code {
  padding: 0;
  border: 0;
  color: inherit;
  font: inherit;
  background: transparent;
  white-space: inherit;
}

/* Make common free-form content behave safely inside the box. */
.content-text > :first-child {
  margin-top: 0;
}

.content-text > :last-child {
  margin-bottom: 0;
}

.content-text img,
.content-text video,
.content-text canvas,
.content-text svg {
  max-width: 100%;
  height: auto;
}

.content-text table {
  max-width: 100%;
  overflow-x: auto;
}

/* FOOTER */

.footer {
  width: var(--page-width);
  margin-right: auto;
  margin-left: auto;
  padding-top: 5px;

  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;

  font-size: small;
}

/* CHINESE PIXEL FONT */

:lang(zh),
:lang(zh-CN),
[lang|="zh"],
.zh-text {
  font-family: var(--font-zh);
  font-synthesis: none;
}

/* Keep emoji from being drawn by the CJK pixel font. */
.emoji {
  margin-right: 4px;

  font-family:
    "Noto Color Emoji",
    "Twemoji Mozilla",
    "Twitter Color Emoji",
    "EmojiOne Color",
    "Apple Color Emoji",
    "Segoe UI Emoji",
    "Noto Emoji",
    sans-serif !important;
  font-size: 95%;
  line-height: 1;
}

/* LANGUAGE DROPDOWN */

.lang-dropdown {
  position: relative;
  height: 76%;
  min-width: 165px;
  margin-right: 10px;
  margin-left: auto;

  font-size: 86%;
}

.lang-dropdown summary {
  height: 100%;
  min-width: 165px;
  display: flex;
  align-items: center;
  justify-content: center;

  padding: 3px 10px;
  border: 1px solid #000;

  list-style: none;
  background: linear-gradient(to bottom, var(--bar-light), var(--bar-dark));
  box-shadow: 0 2px 0 var(--button-shadow);
  cursor: pointer;
  transform: translate(0, 0);
  transition: transform 0.02s, box-shadow 0.02s;

  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}

.lang-dropdown summary::-webkit-details-marker {
  display: none;
}

.lang-dropdown[open] summary {
  box-shadow: 0 0 0 #000;
  transform: translate(0, 3px);
}

.lang-menu {
  min-width: 175px;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 10;

  padding: 3px;
  border: 1px solid #000;

  background: linear-gradient(to bottom, #171717, #262626);
  box-shadow: 2px 2px 0 #000;
}

.lang-menu a {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;

  color: white;
  text-decoration: none;
  white-space: nowrap;
}

.lang-menu a:hover {
  background: linear-gradient(to bottom, var(--bar-light), var(--bar-dark));
}

@media (max-width: 700px) {
  .main-content {
    flex-direction: column;
  }

  .nav-column {
    width: 100%;
    min-width: 0;
  }

  .content-box {
    min-height: 160px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body {
    animation: none;
  }
}

/* SYNCHRONIZED SITE COMPONENTS */

.site-button {
  background: transparent;
}

.language-switch-slot {
  height: 76%;
  margin-left: auto;
}

.language-switch-slot .lang-dropdown {
  height: 100%;
  margin: 0 10px 0 0;
}

.nav-text-spaced {
  padding-bottom: 10px;
}

.nav-item[aria-current="page"] {
  color: #fff7a8;
  background: linear-gradient(to bottom, #686d71, #454749);
}

.nav-recent {
  display: block;
  padding: 4px 7px 0;
  text-align: left;
}

.nav-recent-link {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  color: #fff;
  line-height: 1.25;
  text-decoration: none;
}

.nav-recent-link:hover,
.nav-recent-link:focus-visible {
  color: #d9ffd9;
  text-decoration: underline;
}

.recent-icon {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  margin-top: 2px;
  image-rendering: pixelated;
}

.button-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.friend-button {
  display: block;
  width: fit-content;
  line-height: 0;
}

.friend-button img {
  display: block;
  max-width: 100%;
  image-rendering: pixelated;
}

/* CONTENT HELPERS */


.visually-hidden {
  width: 1px;
  height: 1px;
  position: absolute;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  border: 0;
  white-space: nowrap;
}


.content-text section + section {
  margin-top: 1.5em;
}

.title-center {
  text-align: center;
}

.title-left {
  text-align: left;
}

.content-text a {
  color: #b9e7ff;
}

.content-text a:visited {
  color: #e0c6ff;
}

.content-text a:hover,
.content-text a:focus-visible {
  color: #fff;
}

.home-intro {
  padding: 18px 0;
}

.muted-note,
.post-date {
  color: #d0d0d0;
}

.about-banner,
.page-banner,
.post-image {
  display: block;
  width: 100%;
  margin: 0 auto 0.8em;
}

.post-image {
  margin-top: 1.2em;
}

.skill-block {
  width: fit-content;
  max-width: 100%;
  margin: 1em auto;
}

.icon-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.skill-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.inline-icon {
  width: 1.15em;
  height: 1.15em;
  object-fit: contain;
  vertical-align: -0.2em;
}

.key-icon {
  width: 1.6em;
  height: 1.2em;
}

.friend-list > li {
  margin-bottom: 1em;
}

.friend-list p {
  margin: 0.35em 0;
}

.profile-links,
.contact-list {
  text-align: left;
}

.contact-note {
  padding: 0.6em 0.75em;
  border-left: 3px solid #aaa;
  background: rgba(0, 0, 0, 0.15);
}

.month-heading {
  margin-left: 2ch;
  text-align: left;
}

.empty-message {
  margin-top: 2em;
}

.blog-post {
  line-height: 1.35;
}

@media (max-width: 700px) {
  .language-switch-slot {
    min-width: 0;
  }

  .lang-dropdown,
  .lang-dropdown summary {
    min-width: 145px;
  }
}
