@font-face {
  font-family: "KenPixel";
  src: url("./assets/fonts/kenpixel.ttf") format("truetype");
  font-display: swap;
}

:root {
  color-scheme: dark;
  --paper: #f5f2e9;
  --ink: #162034;
  --muted: #687387;
  --navy: #07152d;
  --accent: #7346df;
  --line: rgba(22, 32, 52, 0.16);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.95;
}

.reading-progress {
  position: fixed;
  z-index: 20;
  inset: 0 auto auto 0;
  width: 0;
  height: 4px;
  background: var(--accent);
  box-shadow: 0 0 14px rgba(115, 70, 223, 0.55);
}

.article-nav {
  position: sticky;
  z-index: 10;
  top: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 58px;
  padding: 0 clamp(18px, 4vw, 58px);
  border-bottom: 3px solid #111;
  background: rgba(7, 21, 45, 0.96);
  color: #ecf4ff;
  backdrop-filter: blur(12px);
}

.article-nav a {
  color: inherit;
  font-family: "KenPixel", "Microsoft YaHei", sans-serif;
  font-size: 11px;
  font-weight: 750;
  text-decoration: none;
}

.article-nav a:hover { color: #fff33d; }

.article-nav__brand {
  font: 400 10px/1 "KenPixel", ui-monospace, Menlo, monospace;
  letter-spacing: 0.15em;
}

.article-nav__next { text-align: right; }

.article-hero {
  padding: clamp(68px, 10vw, 140px) 20px clamp(48px, 7vw, 88px);
  overflow: hidden;
  background:
    linear-gradient(rgba(7, 21, 45, 0.44), rgba(7, 21, 45, 0.86)),
    url("./assets/voxel-hero.jpg") center 45% / cover;
  color: #f3f7ff;
}

.article-hero__inner {
  width: min(900px, 100%);
  margin: 0 auto;
}

.article-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.article-hero__meta span {
  padding: 6px 9px 4px;
  border: 2px solid #111;
  background: #c9c9c9;
  box-shadow: inset 2px 2px 0 #f4f4f4, inset -2px -2px 0 #707070, 3px 3px 0 rgba(0, 0, 0, .55);
  color: #444;
  font: 400 9px/1.2 "KenPixel", ui-monospace, Menlo, monospace;
  letter-spacing: 0.08em;
}

.article-hero h1 {
  max-width: 880px;
  margin: 0;
  font-size: clamp(38px, 6vw, 78px);
  line-height: 1.08;
  letter-spacing: -0.045em;
  text-shadow: 3px 4px 0 #111, 7px 9px 18px rgba(0, 0, 0, .46);
}

.article-hero p {
  margin: 22px 0 0;
  color: #aebdd3;
  font: 400 11px/1.5 "KenPixel", ui-monospace, Menlo, monospace;
  letter-spacing: 0.08em;
}

.article-layout {
  width: min(920px, calc(100% - 36px));
  margin: 0 auto;
  padding: clamp(54px, 8vw, 104px) 0 100px;
}

.article-body > :first-child { margin-top: 0; }

.article-body h2,
.article-body h3,
.article-body h4 {
  scroll-margin-top: 90px;
  font-weight: 850;
  line-height: 1.35;
  letter-spacing: -0.025em;
}

.article-body h2 {
  margin: 3.7em 0 1.2em;
  padding-top: 0.55em;
  border-top: 4px solid var(--ink);
  font-size: clamp(28px, 4vw, 42px);
}

.article-body h3 {
  margin: 2.5em 0 0.8em;
  font-size: 25px;
}

.article-body h4 {
  margin: 2.1em 0 0.7em;
  font-size: 20px;
}

.article-body p { margin: 1.3em 0; }

.article-body strong { font-weight: 850; }

.article-body a {
  color: #087c9b;
  text-underline-offset: 3px;
}

.article-body img {
  display: block;
  width: calc(100% + 10vw);
  max-width: none;
  height: auto;
  margin: 3em -5vw;
  border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(12, 26, 48, 0.16);
}

.article-body blockquote {
  margin: 2em 0;
  padding: 5px 0 5px 22px;
  border-left: 6px solid var(--accent);
  color: #43526b;
  font-size: 1.06em;
}

.article-body ul,
.article-body ol {
  padding-left: 1.5em;
}

.article-body li { margin: 0.55em 0; }

.article-body code {
  padding: 0.15em 0.35em;
  border-radius: 3px;
  background: #e6e9eb;
  font: 0.9em/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.article-body pre {
  padding: 22px;
  overflow-x: auto;
  border-radius: 5px;
  background: var(--navy);
  color: #deebff;
  line-height: 1.65;
}

.article-body pre code { padding: 0; background: transparent; }

.article-body table {
  display: block;
  width: 100%;
  margin: 2.4em 0;
  overflow-x: auto;
  border-spacing: 0;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.55;
}

.article-body th,
.article-body td {
  min-width: 130px;
  padding: 12px 14px;
  border: 1px solid #ccd2d8;
  text-align: left;
  vertical-align: top;
}

.article-body th { background: #e6e9eb; font-weight: 800; }

.article-end {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
  margin-top: 80px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.article-end p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.article-end a {
  padding: 14px 18px 12px;
  border: 3px solid #111;
  background: #c9c9c9;
  box-shadow: inset 3px 3px 0 #f4f4f4, inset -3px -3px 0 #707070, 4px 5px 0 #111;
  color: #444;
  font-family: "KenPixel", "Microsoft YaHei", sans-serif;
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
}

.article-end a:hover,
.article-end a:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
  background: #7346df;
  box-shadow: inset 3px 3px 0 #a888ff, inset -3px -3px 0 #42209b, 4px 5px 0 #111;
  color: #fff;
}

@media (max-width: 700px) {
  body { font-size: 16px; line-height: 1.85; }
  .article-nav { grid-template-columns: 1fr auto; }
  .article-nav__brand { display: none; }
  .article-body img { width: 100%; margin: 2em 0; }
  .article-end { grid-template-columns: 1fr; }
  .article-end a { text-align: center; }
}
