:root {
  color-scheme: light;
  --ink: #171714;
  --soft-ink: rgba(23, 23, 20, 0.72);
  --paper: #f7f3e8;
  --surface: #fffdf5;
  --sand: #e5dccb;
  --wheat: #cdbf9f;
  --clay: #b8ab90;
  --line: rgba(23, 23, 20, 0.18);
  --shadow: 0 24px 70px rgba(23, 23, 20, 0.1);
  --topbar-height: 72px;
  --topbar-center-offset: -36px;
  --sans: "Inter", "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei",
    sans-serif;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Source Han Serif CN",
    "Noto Serif CJK SC", "Songti SC", "STSongti-SC", "SimSun", serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

.fonts-loading :is(.brand-name, .hero h1, .blog-hero h1, .post-list h2, .post-reader h1) {
  opacity: 0;
  transform: translateY(0.04em);
}

.fonts-loaded :is(.brand-name, .hero h1, .blog-hero h1, .post-list h2, .post-reader h1) {
  opacity: 1;
  transform: none;
  transition:
    opacity 360ms ease,
    transform 520ms ease;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
}

@media (prefers-reduced-motion: reduce) {
  .fonts-loaded :is(.brand-name, .hero h1, .blog-hero h1, .post-list h2, .post-reader h1) {
    transition: opacity 1ms linear;
  }
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 5vw, 72px);
  background: rgba(247, 243, 232, 0.9);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 400;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--surface);
  font-size: 19px;
  font-weight: 400;
  line-height: 1;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(14px, 3vw, 30px);
  color: var(--soft-ink);
  font-size: 14px;
}

.nav a {
  padding: 8px 0;
}

.nav a:hover,
.nav a.is-active {
  color: var(--ink);
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.hero {
  position: relative;
  display: grid;
  align-items: center;
  justify-items: start;
  min-height: calc(100vh - var(--topbar-height));
  min-height: calc(100svh - var(--topbar-height));
  padding: 0 clamp(18px, 5vw, 72px);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  text-align: left;
  transform: translateY(var(--topbar-center-offset));
}

.hero h1,
.blog-hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1;
}

.hero h1 {
  min-width: 0;
  max-width: 980px;
  font-size: clamp(42px, 6.2vw, 84px);
  font-stretch: 114%;
  font-variation-settings:
    "wght" 400,
    "wdth" 114;
  font-weight: 400;
  letter-spacing: 0.026em;
  text-wrap: balance;
}

.hero-footer {
  position: absolute;
  right: clamp(18px, 5vw, 72px);
  bottom: clamp(20px, 3vw, 36px);
  left: clamp(18px, 5vw, 72px);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--soft-ink);
  font-size: 13px;
}

.hero-footer p {
  margin: 0;
}

.blog-hero,
.blog-layout {
  width: min(100% - 36px, 1180px);
  margin: 0 auto;
}

.post-meta {
  color: var(--soft-ink);
  font-size: 13px;
}

.blog-hero {
  padding: clamp(46px, 7vw, 98px) 0 30px;
  border-bottom: 1px solid var(--ink);
}

.blog-hero h1 {
  font-size: clamp(66px, 12vw, 168px);
}

.blog-hero p:last-child {
  max-width: 720px;
  margin: 22px 0 0;
  color: var(--soft-ink);
  font-size: 18px;
  line-height: 1.8;
}

.blog-layout {
  display: grid;
  grid-template-columns: minmax(240px, 330px) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 72px);
  padding: 34px 0 90px;
}

.blog-footer {
  display: flex;
  width: min(100% - 36px, 1180px);
  justify-content: space-between;
  gap: 20px;
  margin: 0 auto;
  padding: 28px 0;
  border-top: 1px solid var(--line);
  color: var(--soft-ink);
  font-size: 13px;
}

.blog-footer p {
  margin: 0;
}

.post-list {
  position: sticky;
  top: 92px;
  align-self: start;
  border-top: 1px solid var(--ink);
}

.post-list a {
  display: block;
  padding: 18px 0;
  border-bottom: 1px solid rgba(23, 23, 20, 0.22);
}

.post-list a:hover,
.post-list a.is-active {
  color: var(--ink);
}

.post-list h2 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.25;
}

.post-reader {
  min-height: 420px;
  padding-bottom: 30px;
}

.post-reader header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--ink);
}

.post-reader h1 {
  margin: 0 0 18px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(42px, 7vw, 84px);
  line-height: 1.05;
}

.markdown {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.92;
}

.markdown h1,
.markdown h2,
.markdown h3 {
  margin: 1.6em 0 0.5em;
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.18;
}

.markdown h2 {
  font-size: 34px;
}

.markdown h3 {
  font-size: 25px;
}

.markdown p {
  margin: 0 0 1.15em;
}

.markdown blockquote {
  margin: 1.8em 0;
  padding: 4px 0 4px 22px;
  border-left: 4px solid var(--clay);
  color: var(--soft-ink);
  font-family: var(--serif);
  font-size: 22px;
}

.markdown ul,
.markdown ol {
  padding-left: 1.3em;
}

.markdown code {
  padding: 0.12em 0.35em;
  background: var(--sand);
  font-size: 0.88em;
}

.markdown pre {
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--ink);
  background: var(--surface);
  line-height: 1.6;
}

.markdown pre code {
  padding: 0;
  background: transparent;
}

.markdown a {
  border-bottom: 1px solid currentColor;
  color: var(--ink);
}

.empty-state {
  margin: 0;
  color: var(--soft-ink);
}

@media (max-width: 900px) {
  .blog-layout {
    grid-template-columns: 1fr;
  }

  .post-list {
    position: static;
  }
}

@media (max-width: 640px) {
  :root {
    --topbar-height: 132px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .hero h1 {
    font-size: clamp(34px, 10.5vw, 50px);
  }

  .hero-footer,
  .blog-footer {
    flex-direction: column;
  }
}
