:root {
  color-scheme: light;
  --paper: #f7f4ec;
  --ink: #20211f;
  --muted: #67645c;
  --line: #d8d1c2;
  --panel: #fffdf7;
  --green: #235c4b;
  --red: #a34134;
  --amber: #d99a2b;
  --shadow: 0 24px 70px rgba(32, 33, 31, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(rgba(32, 33, 31, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(32, 33, 31, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
  color: var(--ink);
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 5vw, 64px);
  border-bottom: 1px solid rgba(32, 33, 31, 0.1);
  background: rgba(247, 244, 236, 0.86);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 2px solid var(--ink);
  background: var(--amber);
  box-shadow: 4px 4px 0 var(--ink);
}

.nav {
  display: flex;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
}

.nav a {
  padding: 8px 10px;
  border-bottom: 2px solid transparent;
}

.nav a:hover,
.nav a:focus-visible {
  color: var(--ink);
  border-color: var(--red);
}

main {
  width: min(1120px, calc(100% - 36px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: clamp(24px, 5vw, 56px);
  align-items: center;
  min-height: 72vh;
  padding: 56px 0 42px;
}

.hero-copy {
  max-width: 740px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 9em;
  margin-bottom: 18px;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(48px, 8vw, 104px);
  line-height: 0.95;
  font-weight: 900;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 14px;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.08;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 12px;
  font-size: 22px;
  line-height: 1.25;
}

.lede {
  max-width: 660px;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.9;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 2px solid var(--ink);
  background: var(--green);
  color: #fffdf7;
  font-weight: 800;
  box-shadow: 5px 5px 0 var(--ink);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translate(2px, 2px);
  box-shadow: 3px 3px 0 var(--ink);
}

.button-ghost {
  background: var(--panel);
  color: var(--ink);
}

.terminal-card,
.post-card,
.about-panel,
.markdown-preview {
  border: 2px solid var(--ink);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.terminal-card {
  overflow: hidden;
  transform: rotate(1deg);
}

.terminal-bar {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-bottom: 2px solid var(--ink);
  background: #eee4d0;
}

.terminal-bar span {
  width: 11px;
  height: 11px;
  border: 1px solid var(--ink);
  border-radius: 999px;
}

.terminal-bar span:nth-child(1) {
  background: var(--red);
}

.terminal-bar span:nth-child(2) {
  background: var(--amber);
}

.terminal-bar span:nth-child(3) {
  background: var(--green);
}

pre {
  margin: 0;
  padding: 24px;
  overflow: auto;
  color: #f5f0e6;
  background: #20211f;
  font: 15px/1.75 "SFMono-Regular", Consolas, monospace;
}

.section {
  padding: 46px 0;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 20px;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.post-card {
  display: flex;
  min-height: 270px;
  flex-direction: column;
  padding: 22px;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 8px 10px 0 rgba(32, 33, 31, 0.16);
}

.post-card p {
  color: var(--muted);
  line-height: 1.8;
}

.post-card a {
  width: fit-content;
  margin-top: auto;
  border-bottom: 2px solid var(--red);
  font-weight: 800;
}

.post-meta {
  margin-bottom: 16px;
  font-size: 13px;
}

.notes-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 22px;
  align-items: start;
}

.markdown-preview,
.about-panel {
  padding: 24px;
}

.markdown-preview p,
.markdown-preview li,
.markdown-preview a,
.about-panel p {
  color: var(--muted);
  line-height: 1.9;
}

.markdown-preview ul {
  margin: 16px 0 0;
  padding-left: 20px;
}

.excerpt-stack {
  display: grid;
  gap: 16px;
}

.excerpt-stack .markdown-preview {
  box-shadow: 8px 10px 0 rgba(32, 33, 31, 0.08);
}

.markdown-preview pre {
  margin-top: 16px;
  border: 1px solid rgba(255, 253, 247, 0.16);
  font-size: 14px;
  white-space: pre-wrap;
}

.markdown-preview code:not(pre code),
.article-page code:not(pre code) {
  padding: 2px 5px;
  border: 1px solid var(--line);
  background: #f4ead5;
  color: var(--green);
  font-size: 0.92em;
}

.markdown-preview a {
  display: inline-block;
  margin-top: 12px;
  border-bottom: 2px solid var(--red);
  color: var(--green);
  font-weight: 800;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.tag-list span {
  padding: 7px 10px;
  border: 1px solid var(--line);
  background: #f4ead5;
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 18px;
  margin-top: 42px;
  padding: 26px 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.site-footer a {
  color: var(--green);
  font-weight: 800;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.article-main {
  width: min(860px, calc(100% - 36px));
}

.article-page {
  margin: 54px 0 34px;
  padding: clamp(24px, 5vw, 48px);
  border: 2px solid var(--ink);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.article-page h1 {
  max-width: 100%;
  margin-bottom: 24px;
  font-size: clamp(36px, 6vw, 70px);
}

.article-page h2 {
  margin-top: 34px;
  font-size: clamp(24px, 4vw, 34px);
}

.article-page p,
.article-page li {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.95;
}

.article-page ul {
  margin: 0 0 22px;
  padding-left: 22px;
}

.article-page a {
  border-bottom: 2px solid var(--red);
  color: var(--green);
  font-weight: 800;
}

.not-found-main {
  display: grid;
  width: min(920px, calc(100% - 36px));
  min-height: calc(100vh - 172px);
  place-items: center;
}

.not-found-panel {
  width: 100%;
  padding: clamp(28px, 6vw, 58px);
  border: 2px solid var(--ink);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.not-found-panel h1 {
  max-width: 100%;
  margin-bottom: 18px;
  font-size: clamp(42px, 7vw, 86px);
}

.not-found-log {
  margin-top: 34px;
}

.not-found-log pre {
  border: 2px solid var(--ink);
  box-shadow: 7px 7px 0 rgba(32, 33, 31, 0.12);
}

@media (max-width: 860px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero,
  .notes-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .terminal-card {
    transform: none;
  }

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

@media (max-width: 520px) {
  main {
    width: min(100% - 24px, 1120px);
  }

  .nav {
    width: 100%;
    justify-content: space-between;
  }

  .hero {
    padding-top: 38px;
  }

  .button {
    width: 100%;
  }
}
