:root {
  color-scheme: light;
  --paper: #f7f6f2;
  --ink: #242421;
  --muted: #77736b;
  --line: #dcd9d1;
  --accent: #9c3f35;
  --sans: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  --serif: "Noto Serif SC", "Songti SC", SimSun, serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .24em; }
a:hover { color: var(--accent); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
img { display: block; max-width: 100%; height: auto; background: var(--line); }

.shell { width: min(100% - 48px, 1040px); margin-inline: auto; }
.shell-wide { width: min(100% - 48px, 1240px); margin-inline: auto; }
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 10; padding: 8px 12px; background: var(--ink); color: var(--paper); transform: translateY(-180%); }
.skip-link:focus { transform: none; }

.site-header { padding: 28px 0; border-bottom: 1px solid var(--line); }
.header-inner, .footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.site-name { font-family: var(--serif); font-size: 1.28rem; font-weight: 700; text-decoration: none; letter-spacing: .08em; }
nav { display: flex; gap: clamp(16px, 3vw, 32px); }
nav a { color: var(--muted); font-size: .86rem; text-decoration: none; }
nav a.active { color: var(--accent); }

.home { padding-block: clamp(72px, 11vw, 132px); }
.home-intro { max-width: 670px; margin-bottom: 112px; }
.home-intro p { margin: 0; font-family: var(--serif); font-size: clamp(1.85rem, 4.4vw, 3.7rem); line-height: 1.45; letter-spacing: -.03em; }
.recent > h1, .section-heading h2 { margin: 0; font: 500 .76rem/1 var(--mono); letter-spacing: .16em; color: var(--accent); text-transform: uppercase; }
.journal-list { margin-top: 28px; border-top: 1px solid var(--ink); }
.post-item { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 38%); gap: clamp(32px, 7vw, 88px); padding: 58px 0; border-bottom: 1px solid var(--line); }
.post-item:not(.has-cover) { grid-template-columns: minmax(0, 700px); }
.post-copy time, .kind, .article-header time { font: .75rem/1.5 var(--mono); letter-spacing: .08em; color: var(--muted); }
.post-copy h2 { max-width: 650px; margin: 14px 0 12px; font-family: var(--serif); font-size: clamp(1.65rem, 3.2vw, 2.6rem); line-height: 1.28; font-weight: 600; letter-spacing: -.02em; }
.post-copy h2 a { text-decoration: none; }
.post-copy p { max-width: 600px; margin: 0 0 20px; color: var(--muted); }
.kind { color: var(--accent); }
.post-cover { align-self: center; text-decoration: none; overflow: hidden; border-radius: 2px; }
.post-cover img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; animation: image-in .45s ease-out both; }

.archive-preview { margin-top: 120px; }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 18px; border-bottom: 1px solid var(--ink); }
.section-heading a { font-size: .84rem; color: var(--muted); }
.year-group { display: grid; grid-template-columns: 150px 1fr; padding: 42px 0; border-bottom: 1px solid var(--line); }
.year-group > h2, .year-group > h3 { margin: 0; font: 400 clamp(2rem, 4vw, 3.5rem)/1 var(--mono); color: var(--accent); }
.archive-row { display: grid; grid-template-columns: 72px 1fr auto; gap: 20px; padding: 13px 0; text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--line), transparent 42%); }
.archive-row:last-child { border-bottom: 0; }
.archive-row time, .archive-row small { font: .72rem/1.8 var(--mono); color: var(--muted); }
.archive-row small { align-self: center; }

.page-shell { padding-block: clamp(64px, 10vw, 120px); }
.page-header { max-width: 720px; margin-bottom: 90px; }
.page-header h1 { margin: 0; font: 600 clamp(3rem, 8vw, 6.5rem)/.95 var(--serif); letter-spacing: -.055em; }
.page-description { max-width: 580px; margin-top: 30px; color: var(--muted); }
.page-description p { margin: 0; }
.full-archive .year-group { grid-template-columns: 170px 1fr; }
.month-group { display: grid; grid-template-columns: 90px 1fr; padding-bottom: 38px; }
.month-group:last-child { padding-bottom: 0; }
.month-group h3 { margin: 13px 0 0; font: .72rem/1.5 var(--mono); color: var(--muted); }

.article { padding-block: clamp(60px, 9vw, 110px); }
.article-header { width: min(100% - 48px, 820px); margin-bottom: 64px; }
.article-header h1 { max-width: 800px; margin: 18px 0; font: 600 clamp(2.5rem, 6.5vw, 5.6rem)/1.12 var(--serif); letter-spacing: -.045em; }
.article-header p { max-width: 610px; margin: 24px 0 0; color: var(--muted); font-size: 1.08rem; }
.article-cover { margin-bottom: 72px; }
.article-cover img { width: 100%; max-height: 78vh; object-fit: cover; border-radius: 2px; animation: image-in .45s ease-out both; }
.prose { width: min(100% - 48px, 680px); margin-inline: auto; font-family: var(--serif); font-size: 1.08rem; line-height: 2; }
.prose h2, .prose h3 { margin: 2.3em 0 .8em; line-height: 1.35; }
.prose h2 { font-size: 1.65rem; }
.prose a { color: var(--accent); }
.prose blockquote { margin: 2em 0; padding-left: 1.4em; border-left: 2px solid var(--accent); color: var(--muted); }
.prose pre { margin: 2em 0; padding: 22px; overflow-x: auto; background: #eceae4; font: .88rem/1.7 var(--mono); }
.prose code { font-family: var(--mono); font-size: .88em; }
.prose :not(pre) > code { padding: .14em .35em; background: #eceae4; }
.article-footer { width: min(100% - 48px, 820px); margin-top: 100px; padding-top: 28px; border-top: 1px solid var(--line); }
.article-nav { display: flex; justify-content: space-between; gap: 48px; }
.article-nav a { display: grid; max-width: 44%; text-decoration: none; }
.article-nav a:last-child { margin-left: auto; text-align: right; }
.article-nav small { color: var(--muted); }

.photo-month { margin-top: 100px; }
.photo-month > header { display: grid; grid-template-columns: 190px 1fr; align-items: baseline; margin-bottom: 32px; border-bottom: 1px solid var(--ink); }
.photo-month h2 { margin: 0 0 16px; font: 400 1.4rem/1 var(--mono); }
.photo-month header p { margin: 0 0 16px; color: var(--muted); }
.photo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 52px 22px; align-items: start; }
.photo-grid figure { margin: 0; }
.photo-grid figure:nth-child(3n + 1) { grid-column: span 2; }
.photo-grid img { width: 100%; max-height: 78vh; object-fit: cover; border-radius: 2px; animation: image-in .45s ease-out both; }
.photo-grid figcaption { margin-top: 9px; color: var(--muted); font-size: .78rem; }

.about-layout { display: grid; grid-template-columns: minmax(240px, 390px) 1fr; gap: clamp(48px, 9vw, 120px); align-items: start; }
.about-layout .prose { width: auto; margin: 0; }
.portrait-placeholder { display: grid; place-items: center; aspect-ratio: 4 / 5; padding: 28px; border: 1px solid var(--line); color: var(--muted); font: .76rem/1.5 var(--mono); text-align: center; }

.site-footer { padding: 34px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .76rem; }
.site-footer p { margin: 0; }

@keyframes image-in { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 700px) {
  .shell, .shell-wide, .prose, .article-header, .article-footer { width: min(100% - 32px, 1040px); }
  .site-header { padding: 20px 0 16px; }
  .header-inner { align-items: flex-start; flex-direction: column; gap: 11px; }
  nav { width: 100%; justify-content: space-between; gap: 10px; }
  .home { padding-block: 62px 90px; }
  .home-intro { margin-bottom: 82px; }
  .home-intro p { font-size: clamp(1.65rem, 8vw, 2.45rem); }
  .post-item { grid-template-columns: 1fr; gap: 28px; padding: 42px 0; }
  .post-cover { grid-row: 1; }
  .post-copy h2 { font-size: 1.65rem; }
  .archive-preview { margin-top: 90px; }
  .year-group, .full-archive .year-group { grid-template-columns: 1fr; gap: 34px; }
  .year-group > h2, .year-group > h3 { font-size: 2.3rem; }
  .month-group { grid-template-columns: 1fr; gap: 4px; }
  .archive-row { grid-template-columns: 50px 1fr; gap: 12px; }
  .archive-row small { display: none; }
  .page-header { margin-bottom: 68px; }
  .page-header h1 { font-size: 3.4rem; }
  .article-header h1 { font-size: 2.65rem; }
  .article-cover { margin-bottom: 52px; }
  .article-nav { flex-direction: column; }
  .article-nav a { max-width: 100%; }
  .article-nav a:last-child { margin: 0; text-align: left; }
  .photo-month { margin-top: 76px; }
  .photo-month > header { grid-template-columns: 1fr; }
  .photo-grid { gap: 32px 12px; }
  .photo-grid figure { grid-column: span 2; }
  .photo-grid figure:nth-child(n + 2) { grid-column: span 1; }
  .about-layout { grid-template-columns: 1fr; gap: 52px; }
  .portrait-placeholder { width: min(100%, 390px); }
  .footer-inner { align-items: flex-start; flex-direction: column; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

