:root {
  color-scheme: light dark;
  --paper: #f4efe5;
  --paper-deep: #e9e0cf;
  --ink: #183a3a;
  --muted: #65736f;
  --accent: #bd6848;
  --line: rgba(24, 58, 58, 0.16);
  --card: rgba(255, 252, 245, 0.58);
  font-family: ui-serif, "Songti SC", "STSong", Georgia, serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 10%, rgba(255, 255, 255, 0.72), transparent 30rem),
    linear-gradient(180deg, var(--paper), var(--paper-deep));
  min-height: 100vh;
  line-height: 1.8;
}

a { color: inherit; text-underline-offset: 0.28em; }

.site-header,
main,
footer {
  width: min(1120px, calc(100% - 3rem));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2rem 0;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.65rem;
  aspect-ratio: 1;
  color: var(--paper);
  background: var(--ink);
  border-radius: 50% 48% 52% 46%;
}

.brand strong,
.brand small { display: block; }
.brand strong { letter-spacing: 0.12em; }
.brand small { color: var(--muted); font: 0.68rem/1.2 ui-sans-serif, system-ui, sans-serif; letter-spacing: 0.16em; text-transform: uppercase; }

nav { display: flex; gap: 1.6rem; font: 0.9rem/1.5 ui-sans-serif, system-ui, sans-serif; }
nav a { text-decoration: none; padding: 0.4rem 0; border-bottom: 1px solid transparent; }
nav a:hover,
nav a[aria-current="page"] { color: var(--accent); border-color: currentColor; }

.intro { padding: clamp(5rem, 11vw, 9rem) 0; max-width: 48rem; }
.eyebrow { margin: 0 0 1rem; color: var(--accent); font: 700 0.74rem/1.5 ui-sans-serif, system-ui, sans-serif; letter-spacing: 0.24em; text-transform: uppercase; }
.intro h1,
.page-title h1 { margin: 0; line-height: 1.28; letter-spacing: 0.04em; }
.intro h1 { font-size: clamp(2.8rem, 8vw, 6.4rem); font-weight: 500; }
.intro > p:last-child { max-width: 36rem; margin: 2rem 0 0; color: var(--muted); font-size: 1.05rem; }

.entries { padding-bottom: 4rem; }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.section-heading h2 { margin: 0; font-size: 1rem; letter-spacing: 0.18em; }
.section-heading span { color: var(--muted); font-size: 0.82rem; }

.entry {
  display: grid;
  grid-template-columns: 9rem minmax(12rem, 1fr) minmax(14rem, 1.25fr) auto;
  align-items: start;
  gap: 2rem;
  padding: 2.1rem 0;
  border-bottom: 1px solid var(--line);
}

.entry-meta { display: flex; flex-direction: column; color: var(--muted); font: 0.76rem/1.7 ui-sans-serif, system-ui, sans-serif; }
.entry-meta span { color: var(--accent); }
.entry h3 { margin: 0; font-size: 1.42rem; font-weight: 500; }
.entry p { margin: 0; color: var(--muted); }
.entry > a { font-size: 0.85rem; text-decoration: none; white-space: nowrap; }
.entry > a:hover { color: var(--accent); }

.narrow { max-width: 830px; min-height: calc(100vh - 18rem); }
.page-title { padding: clamp(4rem, 10vw, 7rem) 0 3rem; border-bottom: 1px solid var(--line); }
.page-title h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); font-weight: 500; }
.page-title > p:last-child { color: var(--muted); }
.archive-list article { display: grid; grid-template-columns: 8rem 1fr; gap: 2rem; padding: 2rem 0; border-bottom: 1px solid var(--line); scroll-margin-top: 2rem; }
.archive-list time { color: var(--accent); font-size: 0.82rem; }
.archive-list h2 { margin: 0 0 0.5rem; font-size: 1.35rem; font-weight: 500; }
.archive-list p { margin: 0; color: var(--muted); }
.about-card { padding: 3rem 0; font-size: 1.08rem; }
.about-card p { margin: 0 0 1.5rem; }
.dropcap::first-letter { float: left; margin: 0.18em 0.12em 0 0; color: var(--accent); font-size: 3.6em; line-height: 0.72; }
blockquote { margin: 2.5rem 0; padding: 1.2rem 1.5rem; color: var(--muted); border-left: 2px solid var(--accent); background: var(--card); }

footer { display: flex; justify-content: space-between; margin-top: 3rem; padding: 2rem 0 3rem; color: var(--muted); border-top: 1px solid var(--line); font-size: 0.78rem; }
footer p { margin: 0; }

.error-page { display: grid; place-items: center; text-align: center; }
.error-page main { width: min(34rem, calc(100% - 3rem)); }
.error-code { margin: 0; color: var(--accent); font: 700 0.8rem/1 ui-sans-serif, system-ui, sans-serif; letter-spacing: 0.3em; }
.error-page h1 { margin: 1.2rem 0 0.8rem; font-size: clamp(2rem, 7vw, 3.5rem); font-weight: 500; }
.error-page main > p:not(.error-code) { color: var(--muted); }
.home-link { display: inline-block; margin-top: 1.2rem; padding: 0.65rem 1.2rem; text-decoration: none; border: 1px solid var(--ink); border-radius: 999px; }
.home-link:hover { color: var(--paper); background: var(--ink); }

@media (max-width: 760px) {
  .site-header { align-items: flex-start; gap: 1rem; }
  .brand small { display: none; }
  nav { gap: 1rem; font-size: 0.82rem; }
  .intro { padding: 4.5rem 0; }
  .entry { grid-template-columns: 1fr auto; gap: 0.7rem 1rem; }
  .entry-meta,
  .entry p { grid-column: 1 / -1; }
  .entry h3 { grid-column: 1; }
  .entry > a { grid-column: 2; }
}

@media (max-width: 480px) {
  .site-header,
  main,
  footer { width: min(100% - 2rem, 1120px); }
  .site-header { flex-direction: column; padding: 1.2rem 0; }
  .brand-mark { width: 2.2rem; }
  .intro h1 { font-size: 2.65rem; }
  .archive-list article { grid-template-columns: 1fr; gap: 0.4rem; }
  footer { gap: 1rem; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #102424;
    --paper-deep: #091a1a;
    --ink: #e8e1d3;
    --muted: #a9b5ae;
    --accent: #e09270;
    --line: rgba(232, 225, 211, 0.16);
    --card: rgba(255, 255, 255, 0.045);
  }
  body { background: radial-gradient(circle at 15% 10%, rgba(52, 91, 85, 0.28), transparent 30rem), linear-gradient(180deg, var(--paper), var(--paper-deep)); }
  .brand-mark { color: #102424; background: var(--ink); }
  .home-link:hover { color: #102424; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
