/* Paper editorial: warm surfaces, serif display, quiet rules, one accent. */

:root {
  color-scheme: light dark;
  --paper: #fcf8ee;
  --paper-raised: #f4eddd;
  --paper-deep: #efe5d1;
  --rule: #dbd0bd;
  --rule-strong: #c8b99f;
  --ink: #26231f;
  --body: #413a32;
  --meta: #6a5d4e;
  --accent: #804027;
  --accent-hover: #65321f;
  --font-serif: Georgia, "Iowan Old Style", "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --wrap: 1120px;
  --measure: 700px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #171512;
    --paper-raised: #1f1c17;
    --paper-deep: #25211b;
    --rule: #3a332a;
    --rule-strong: #4c4336;
    --ink: #f2ead9;
    --body: #d8cdba;
    --meta: #a6977f;
    --accent: #e0a17b;
    --accent-hover: #f0b68f;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

::selection {
  background: var(--accent);
  color: var(--paper);
}

a {
  color: inherit;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding-left: 28px;
  padding-right: 28px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 8px 12px;
  z-index: 20;
}

.skip-link:focus {
  left: 16px;
  top: 16px;
}

/* Header */

.site-header {
  border-bottom: 1px solid var(--rule);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 20px;
  padding-bottom: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--rule-strong);
  background: var(--paper-raised);
  color: var(--accent);
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1;
}

.brand-text {
  font-family: var(--font-serif);
  font-size: 17px;
  letter-spacing: 0.01em;
}

.site-nav {
  display: flex;
  gap: 26px;
  font-size: 14px;
}

.site-nav a {
  color: var(--meta);
  text-decoration: none;
  padding-bottom: 4px;
  border-bottom: 1px solid transparent;
}

.site-nav a:hover {
  color: var(--ink);
}

.site-nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

/* Shared type */

.eyebrow {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4 {
  color: var(--ink);
  font-family: var(--font-serif);
  font-weight: 500;
}

.muted {
  color: var(--meta);
}

/* Home hero */

.hero {
  padding-top: 88px;
  padding-bottom: 56px;
}

.hero h1 {
  margin: 0 0 20px;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
}

.hero-lead {
  max-width: 44rem;
  margin: 0 0 28px;
  color: var(--body);
  font-size: 20px;
  line-height: 1.75;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  color: var(--meta);
  font-size: 14px;
}

.inline-arrow {
  margin-left: auto;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  white-space: nowrap;
}

.inline-arrow:hover,
.text-link:hover,
.prose a:hover,
.footer-meta a:hover {
  color: var(--accent-hover);
}

.dot {
  color: var(--rule-strong);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  white-space: nowrap;
}

.text-link.quiet {
  color: var(--meta);
  font-weight: 500;
}

/* Featured story */

.feature {
  padding-bottom: 8px;
}

.feature-card {
  padding: 36px 40px 40px;
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--accent);
}

.meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: var(--meta);
  font-size: 13px;
}

.kicker {
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.feature-card h2 {
  margin: 12px 0 14px;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  line-height: 1.3;
}

.feature-card h2 a {
  color: var(--ink);
  text-decoration: none;
}

.feature-card h2 a:hover {
  color: var(--accent);
}

.feature-summary {
  max-width: 52rem;
  margin: 0 0 18px;
  color: var(--body);
  font-size: 17px;
  line-height: 1.8;
}

.feature-card .text-link {
  margin-top: 22px;
}

.tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag {
  color: var(--meta);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.tag::before {
  content: "#";
  margin-right: 2px;
  color: var(--rule-strong);
}

.sample-tag {
  color: var(--accent);
}

.sample-tag::before {
  content: "";
}

/* Section + post list */

.section {
  padding-top: 56px;
  padding-bottom: 56px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--ink);
}

.section-head h2 {
  margin: 0;
  font-size: 24px;
}

.post-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.post-list li {
  border-bottom: 1px solid var(--rule);
}

.post-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) auto 24px;
  gap: 24px;
  align-items: baseline;
  padding: 22px 4px;
  color: inherit;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.post-row:hover {
  background: var(--paper-raised);
}

.post-date {
  color: var(--meta);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
}

.post-title {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 19px;
  line-height: 1.45;
}

.post-summary {
  display: block;
  max-width: 52rem;
  color: var(--meta);
  font-size: 14px;
  line-height: 1.65;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.post-arrow {
  justify-self: end;
  color: var(--accent);
  font-size: 16px;
}

.empty-card {
  padding: 40px;
  background: var(--paper-raised);
  border: 1px solid var(--rule);
}

.empty-card h2 {
  margin: 0 0 8px;
}

.empty-note {
  color: var(--meta);
  font-size: 14px;
}

/* About */

.about {
  margin-top: 16px;
  border-top: 1px solid var(--rule);
}

.about-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 72px;
}

.about h2 {
  margin: 0 0 16px;
  font-size: 28px;
}

.about p {
  max-width: 38rem;
  margin: 0 0 12px;
  font-size: 16px;
  line-height: 1.85;
}

.about-facts {
  margin: 0;
  border-top: 1px solid var(--rule);
}

.about-facts div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
}

.about-facts dt {
  color: var(--meta);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.about-facts dd {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  text-align: right;
}

/* Archive */

.page-head {
  padding-top: 72px;
  padding-bottom: 40px;
}

.page-head h1 {
  margin: 0 0 14px;
  font-size: clamp(2rem, 4.5vw, 3rem);
  line-height: 1.15;
}

.page-lead {
  max-width: 42rem;
  margin: 0;
  color: var(--body);
  font-size: 17px;
  line-height: 1.8;
}

.archive {
  padding-bottom: 72px;
}

.year-group {
  margin-top: 40px;
}

.year-heading {
  margin: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
  color: var(--meta);
  font-size: 16px;
  letter-spacing: 0.08em;
}

/* Article */

.article {
  max-width: 860px;
  padding-top: 64px;
  padding-bottom: 72px;
}

.article-header {
  max-width: var(--measure);
  margin: 0 auto 40px;
}

.back-link {
  display: inline-block;
  margin-bottom: 28px;
  color: var(--meta);
  font-size: 13px;
  text-decoration: none;
}

.back-link:hover {
  color: var(--accent);
}

.article-meta {
  margin-bottom: 18px;
}

.article-header h1 {
  margin: 0 0 18px;
  font-size: clamp(2rem, 4.5vw, 3rem);
  line-height: 1.2;
}

.article-summary {
  margin: 0;
  color: var(--meta);
  font-size: 18px;
  line-height: 1.8;
}

.sample-notice {
  margin: 24px 0 0;
  padding: 12px 16px;
  border-left: 3px solid var(--accent);
  background: var(--paper-raised);
  color: var(--meta);
  font-size: 13px;
}

.prose {
  max-width: var(--measure);
  margin: 0 auto;
  color: var(--body);
  font-size: 18px;
  line-height: 1.95;
}

.prose > * + * {
  margin-top: 1.2em;
}

.prose h2 {
  margin: 2em 0 0;
  font-size: 28px;
  line-height: 1.35;
}

.prose h3 {
  margin: 1.8em 0 0;
  font-size: 22px;
  line-height: 1.4;
}

.prose h4 {
  margin: 1.6em 0 0;
  font-size: 19px;
  line-height: 1.45;
}

.prose p {
  margin: 0;
}

.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.prose strong {
  color: var(--ink);
  font-weight: 600;
}

.prose ul,
.prose ol {
  margin: 0;
  padding-left: 1.4em;
}

.prose li + li {
  margin-top: 0.45em;
}

.prose blockquote {
  margin: 1.6em 0;
  padding: 0.2em 0 0.2em 20px;
  border-left: 3px solid var(--accent);
  color: var(--meta);
}

.prose blockquote p {
  margin: 0;
}

.prose hr {
  margin: 2.4em 0;
  border: 0;
  border-top: 1px solid var(--rule);
}

.prose code {
  padding: 0.1em 0.35em;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--paper-deep);
  font-family: var(--font-mono);
  font-size: 0.86em;
}

.prose pre {
  padding: 16px 18px;
  overflow-x: auto;
  border: 1px solid var(--rule);
  background: var(--paper-raised);
  line-height: 1.7;
}

.prose pre code {
  padding: 0;
  border: 0;
  background: none;
  font-size: 14px;
}

.prose .table-wrap {
  overflow-x: auto;
  border: 1px solid var(--rule);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.prose th,
.prose td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--rule);
  text-align: left;
}

.prose th {
  border-bottom: 2px solid var(--rule-strong);
  color: var(--ink);
  font-weight: 600;
}

.prose tr:last-child td {
  border-bottom: 0;
}

.prose img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--rule);
}

.article-footer {
  max-width: var(--measure);
  margin: 56px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}

.article-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--rule);
}

.article-footer > .text-link {
  margin-top: 18px;
}

.pager-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-decoration: none;
}

.pager-next {
  text-align: right;
}

.pager-label {
  color: var(--meta);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.pager-title {
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.45;
}

.notfound {
  padding-bottom: 120px;
}

/* Footer */

.site-footer {
  margin-top: 40px;
  padding: 40px 0 56px;
  border-top: 1px solid var(--rule);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: start;
}

.footer-brand {
  margin: 0 0 6px;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 16px;
}

.footer-note {
  margin: 0;
  color: var(--meta);
  font-size: 13px;
  line-height: 1.7;
}

.footer-meta {
  color: var(--meta);
  font-size: 12px;
  line-height: 1.9;
  text-align: right;
}

.footer-meta p {
  margin: 0;
}

.footer-meta a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Responsive */

@media (max-width: 900px) {
  .post-row {
    grid-template-columns: 92px minmax(0, 1fr) 20px;
  }

  .post-tags {
    display: none;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .footer-meta {
    text-align: left;
  }
}

@media (max-width: 640px) {
  .wrap,
  .hero,
  .section,
  .page-head {
    padding-left: 20px;
    padding-right: 20px;
  }

  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .brand-text {
    font-size: 16px;
  }

  .site-nav {
    gap: 20px;
  }

  .hero {
    padding-top: 56px;
    padding-bottom: 40px;
  }

  .hero-lead {
    font-size: 18px;
  }

  .inline-arrow {
    margin-left: 0;
  }

  .feature-card {
    padding: 24px 22px 28px;
  }

  .post-row {
    grid-template-columns: minmax(0, 1fr) 20px;
    gap: 6px 16px;
    padding: 18px 2px;
  }

  .post-date {
    grid-column: 1 / -1;
    font-size: 11px;
  }

  .post-main {
    grid-column: 1;
  }

  .post-arrow {
    grid-column: 2;
  }

  .post-title {
    font-size: 17px;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .article {
    padding-top: 40px;
  }

  .article-header h1 {
    font-size: 1.9rem;
  }

  .article-pager {
    width: 100%;
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .pager-next {
    text-align: left;
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

@media print {
  .site-header,
  .site-footer,
  .article-pager,
  .back-link {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }

  .prose a::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
  }
}