:root {
  --paper: #eeeae1;
  --paper-deep: #e4dfd4;
  --ink: #1b1b18;
  --muted: #706d65;
  --faint: #969188;
  --line: rgba(27, 27, 24, 0.2);
  --soft-line: rgba(27, 27, 24, 0.09);
  --accent: #8c3f2b;
  --serif: "Iowan Old Style", "Baskerville", "Times New Roman", "Songti SC", "STSong", serif;
  --sans: "Avenir Next", "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", "Roboto Mono", "Liberation Mono", monospace;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --paper: #1b1b18;
  --paper-deep: #141412;
  --ink: #e8e3d8;
  --muted: #aaa49a;
  --faint: #77736b;
  --line: rgba(232, 227, 216, 0.2);
  --soft-line: rgba(232, 227, 216, 0.09);
  --accent: #c1745d;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 180ms ease, color 180ms ease;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 20;
  opacity: 0.022;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 140 140' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.45'/%3E%3C/svg%3E");
}
a { color: inherit; }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
::selection { background: color-mix(in srgb, var(--accent) 24%, transparent); }

.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 100;
  padding: 0.7rem 1rem;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.75rem;
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }
.page-shell { width: min(1040px, calc(100% - 4rem)); margin-inline: auto; }

.site-header { border-bottom: 1px solid var(--line); }
.header-inner {
  min-height: 84px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 2rem;
}
.brand { display: flex; width: max-content; align-items: baseline; gap: 1rem; text-decoration: none; }
.brand-name { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; letter-spacing: -0.025em; }
.brand-note { color: var(--muted); font-family: var(--mono); font-size: 0.55rem; letter-spacing: 0.06em; text-transform: uppercase; }
.main-nav { display: flex; gap: 2rem; }
.main-nav a,
.theme-toggle {
  padding: 0.3rem 0;
  border: 0;
  border-bottom: 1px solid transparent;
  background: none;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.07em;
  text-decoration: none;
  text-transform: uppercase;
}
.main-nav a:hover,
.main-nav a.is-active,
.theme-toggle:hover { border-color: currentColor; color: var(--ink); }
.theme-toggle { justify-self: end; cursor: pointer; }
.theme-dark-label { display: none; }
[data-theme="dark"] .theme-light-label { display: none; }
[data-theme="dark"] .theme-dark-label { display: inline; }

.hero {
  min-height: 660px;
  display: grid;
  grid-template-columns: 70px 1fr;
  border-left: 1px solid var(--soft-line);
  border-right: 1px solid var(--soft-line);
}
.hero-rail {
  padding: 6.5rem 0 3.3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  border-right: 1px solid var(--line);
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.53rem;
  writing-mode: vertical-rl;
}
.hero-rail i { width: 1px; flex: 1; background: var(--line); }
.hero-copy { padding: 6.5rem 4.5rem 3.3rem; display: flex; flex-direction: column; }
.eyebrow,
.section-number {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.eyebrow span { padding-inline: 0.4rem; color: var(--accent); }
.hero h1,
.section-heading h2,
.page-intro h1,
.article-header h1 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.055em;
}
.hero h1 {
  margin: 1.9rem 0 4rem;
  max-width: 850px;
  font-size: clamp(4.7rem, 8.6vw, 8.2rem);
  line-height: 0.87;
}
.hero h1 em,
.page-intro h1 em { color: var(--accent); font-weight: 400; }
.hero-foot {
  margin-top: auto;
  display: grid;
  grid-template-columns: minmax(0, 430px) auto;
  justify-content: space-between;
  align-items: end;
  gap: 3rem;
}
.hero-deck { margin: 0; color: var(--muted); font-family: var(--serif); font-size: 1.34rem; line-height: 1.55; }
.hero-foot a { padding-bottom: 0.35rem; border-bottom: 1px solid var(--ink); font-family: var(--mono); font-size: 0.58rem; letter-spacing: 0.05em; text-decoration: none; text-transform: uppercase; }
.hero-foot a span { margin-left: 1rem; color: var(--accent); }

.selected-wrap,
.latest-wrap { padding: 8rem 0; border-top: 1px solid var(--line); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 3rem; margin-bottom: 3.8rem; }
.section-heading h2 { margin: 0.5rem 0 0; font-size: clamp(3.2rem, 6vw, 5.4rem); line-height: 0.92; }
.section-note { max-width: 210px; margin: 0; color: var(--muted); font-family: var(--serif); font-size: 1rem; line-height: 1.45; }
.selected-list { border-top: 1px solid var(--ink); }
.selected-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 180px 28px;
  gap: 2rem;
  align-items: start;
  padding: 3rem 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.selected-card:hover h3 { color: var(--accent); }
.selected-card:hover .card-arrow { transform: translate(3px, -3px); }
.card-number { padding-top: 0.35rem; color: var(--accent); font-family: var(--mono); font-size: 0.58rem; }
.card-content { display: contents; }
.card-title h3 { max-width: 590px; margin: 0; font-family: var(--serif); font-size: clamp(2rem, 3.7vw, 3.3rem); font-weight: 400; line-height: 1.05; letter-spacing: -0.04em; }
.card-title p { max-width: 620px; margin: 1rem 0 0; color: var(--muted); font-family: var(--serif); font-size: 1rem; line-height: 1.6; }
.card-meta { display: flex; flex-direction: column; gap: 0.8rem; padding-top: 0.35rem; color: var(--muted); font-family: var(--mono); font-size: 0.55rem; letter-spacing: 0.04em; text-transform: uppercase; }
.card-arrow { padding-top: 0.15rem; color: var(--accent); transition: transform 160ms ease; }

.latest-wrap { padding-bottom: 10rem; }
.search-box { width: 230px; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 1rem; padding-bottom: 0.55rem; border-bottom: 1px solid var(--ink); }
.search-box span { color: var(--accent); font-family: var(--mono); font-size: 0.55rem; letter-spacing: 0.08em; text-transform: uppercase; }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; font-family: var(--serif); font-size: 0.95rem; }
.search-box input::placeholder { color: var(--faint); }
.tag-filters { display: flex; flex-wrap: wrap; gap: 0 1.4rem; margin: -1rem 0 2.6rem; }
.filter-chip { padding: 0.4rem 0; border: 0; border-bottom: 1px solid transparent; background: none; color: var(--muted); font-family: var(--mono); font-size: 0.55rem; cursor: pointer; }
.filter-chip:hover,
.filter-chip.is-active { border-color: var(--accent); color: var(--ink); }
.post-list { border-top: 1px solid var(--ink); counter-reset: notes; }
.post-row {
  counter-increment: notes;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 110px 28px;
  gap: 2rem;
  align-items: start;
  padding: 2.7rem 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.post-row::before { content: counter(notes, decimal-leading-zero); padding-top: 0.35rem; color: var(--faint); font-family: var(--mono); font-size: 0.55rem; }
.post-row:hover h3 { color: var(--accent); }
.post-row:hover .row-arrow { transform: translate(3px, -3px); }
.post-summary h3 { margin: 0.45rem 0 0.65rem; font-family: var(--serif); font-size: 1.85rem; font-weight: 400; line-height: 1.15; letter-spacing: -0.035em; }
.post-summary p { max-width: 660px; margin: 0; color: var(--muted); font-family: var(--serif); font-size: 0.92rem; line-height: 1.62; }
.post-tag { color: var(--muted); font-family: var(--mono); font-size: 0.53rem; letter-spacing: 0.03em; }
.tag-row { display: flex; flex-wrap: wrap; gap: 0.45rem 0.75rem; }
.post-row time { padding-top: 0.3rem; display: flex; flex-direction: column; gap: 0.35rem; color: var(--muted); font-family: var(--mono); font-size: 0.55rem; text-transform: uppercase; }
.post-row time strong { color: var(--ink); font-size: 0.68rem; font-weight: 400; }
.reading-time { display: none; }
.row-arrow { color: var(--accent); transition: transform 160ms ease; }
.empty-state { padding: 5rem 0; border-bottom: 1px solid var(--line); color: var(--muted); font-family: var(--serif); font-size: 1.3rem; text-align: center; }

.inner-page { min-height: 75vh; padding: 8rem 0 11rem; }
.page-intro { display: grid; grid-template-columns: 1fr 2fr; gap: 4rem; padding-bottom: 7rem; border-bottom: 1px solid var(--ink); }
.page-intro .section-number { padding-top: 0.8rem; }
.page-intro h1 { grid-column: 2; margin: 0; font-size: clamp(4.7rem, 9vw, 8rem); line-height: 0.86; }
.page-intro > p:last-child { grid-column: 2; max-width: 380px; margin: 0; color: var(--muted); font-family: var(--serif); font-size: 1.1rem; line-height: 1.6; }
.timeline-year { display: grid; grid-template-columns: 1fr 2fr; gap: 4rem; border-bottom: 1px solid var(--ink); }
.year-marker { padding: 3.2rem 0; color: var(--accent); font-family: var(--serif); font-size: 3rem; letter-spacing: -0.04em; }
.year-posts { border-left: 1px solid var(--line); }
.timeline-entry { min-height: 130px; display: grid; grid-template-columns: 82px 1fr 24px; gap: 1.5rem; align-items: center; padding: 1.6rem 0 1.6rem 2rem; border-bottom: 1px solid var(--line); text-decoration: none; }
.timeline-entry:last-child { border-bottom: 0; }
.timeline-entry time { color: var(--muted); font-family: var(--mono); font-size: 0.53rem; text-transform: uppercase; }
.timeline-entry h2 { margin: 0 0 0.7rem; font-family: var(--serif); font-size: 1.55rem; font-weight: 400; letter-spacing: -0.025em; }
.timeline-entry:hover h2 { color: var(--accent); }
.timeline-entry > span { color: var(--accent); }

.about-intro { border-bottom-color: var(--line); }
.about-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 4rem; padding-top: 6rem; }
.about-aside { max-width: 220px; margin: 0; color: var(--muted); font-family: var(--mono); font-size: 0.6rem; line-height: 1.7; text-transform: uppercase; }
.about-copy { max-width: 690px; }
.about-copy > p { color: var(--muted); font-family: var(--serif); font-size: 1.15rem; line-height: 1.75; }
.about-copy .about-lead { margin-top: 0; color: var(--ink); font-size: clamp(2.2rem, 4vw, 3.7rem); line-height: 1.12; letter-spacing: -0.04em; }
.about-copy blockquote { margin: 3rem 0; padding: 2rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--ink); font-family: var(--serif); font-size: 1.35rem; line-height: 1.65; }
.contact-link { margin-top: 4rem; padding: 1.6rem 0; display: flex; justify-content: space-between; gap: 2rem; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); text-decoration: none; }
.contact-link span { color: var(--muted); font-family: var(--mono); font-size: 0.55rem; letter-spacing: 0.07em; text-transform: uppercase; }
.contact-link strong { font-family: var(--serif); font-size: 1rem; font-weight: 400; }
.contact-link:hover strong { color: var(--accent); }

.article-view { padding: 4rem 0 11rem; }
.article-shell { width: min(760px, calc(100% - 4rem)); margin-inline: auto; }
.back-link { display: inline-flex; gap: 0.65rem; color: var(--muted); font-family: var(--mono); font-size: 0.56rem; letter-spacing: 0.07em; text-decoration: none; text-transform: uppercase; }
.back-link:hover { color: var(--accent); }
.article-header { padding: 7rem 0 4.5rem; border-bottom: 1px solid var(--ink); }
.article-tags { display: flex; flex-wrap: wrap; gap: 0.5rem 0.8rem; }
.article-header h1 { margin: 1.7rem 0 2rem; font-size: clamp(3.4rem, 7vw, 6rem); line-height: 0.98; }
.article-excerpt { max-width: 650px; margin: 0; color: var(--muted); font-family: var(--serif); font-size: 1.3rem; line-height: 1.6; }
.article-meta { display: flex; gap: 0.65rem; margin-top: 2.4rem; color: var(--muted); font-family: var(--mono); font-size: 0.55rem; letter-spacing: 0.06em; text-transform: uppercase; }
.article-body { padding: 4.7rem 0; font-family: var(--serif); font-size: 1.23rem; line-height: 1.9; }
.article-body p { margin: 0 0 1.7em; }
.article-body h2 { margin: 2.8em 0 0.8em; padding-top: 0.8em; border-top: 1px solid var(--line); font-size: 2rem; font-weight: 400; line-height: 1.25; letter-spacing: -0.03em; }
.article-body blockquote { margin: 2.7rem 0; padding: 0.5rem 0 0.5rem 1.7rem; border-left: 2px solid var(--accent); color: var(--muted); font-size: 1.42rem; line-height: 1.65; }
.article-body ul,
.article-body ol { margin: 2rem 0; padding-left: 1.25rem; }
.article-body li { margin: 0.8rem 0; padding-left: 0.5rem; }
.article-body li::marker { color: var(--accent); }
.article-body strong { font-weight: 600; }
.article-footer { padding-top: 1.5rem; display: flex; justify-content: space-between; border-top: 1px solid var(--ink); }
.article-footer p,
.article-footer a { margin: 0; color: var(--muted); font-family: var(--mono); font-size: 0.55rem; letter-spacing: 0.06em; text-decoration: none; text-transform: uppercase; }
.article-footer a:hover { color: var(--accent); }

.site-footer { padding: 3.5rem 0; border-top: 1px solid var(--ink); background: var(--paper-deep); }
.footer-inner { display: grid; grid-template-columns: 1fr 1fr auto; gap: 2rem; align-items: center; }
.footer-inner p { margin: 0; color: var(--muted); font-family: var(--mono); font-size: 0.53rem; letter-spacing: 0.05em; text-transform: uppercase; }
.footer-inner > p:first-child { color: var(--ink); font-family: var(--serif); font-size: 0.95rem; letter-spacing: 0; text-transform: none; }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { color: var(--muted); font-family: var(--mono); font-size: 0.53rem; text-decoration: none; text-transform: uppercase; }
.footer-links a:hover { color: var(--accent); }
.copyright { grid-column: 1 / -1; padding-top: 2.5rem; border-top: 1px solid var(--line); }

@media (max-width: 760px) {
  .page-shell { width: min(100% - 2rem, 1040px); }
  .header-inner { min-height: 72px; grid-template-columns: 1fr auto; gap: 1rem; }
  .brand-note { display: none; }
  .main-nav { grid-column: 1 / -1; grid-row: 2; padding: 0.65rem 0 0.85rem; justify-content: space-between; border-top: 1px solid var(--soft-line); }
  .theme-toggle { grid-column: 2; grid-row: 1; }
  .hero { min-height: 610px; grid-template-columns: 40px 1fr; }
  .hero-rail { padding-block: 4rem 2rem; }
  .hero-copy { padding: 4rem 1.25rem 2.3rem; }
  .hero h1 { margin-top: 1.4rem; font-size: clamp(3.65rem, 16vw, 5.8rem); line-height: 0.9; }
  .hero-foot { grid-template-columns: 1fr; gap: 2rem; }
  .hero-deck { font-size: 1.1rem; }
  .hero-foot a { width: max-content; }
  .selected-wrap,
  .latest-wrap { padding: 5.5rem 0; }
  .section-heading { align-items: start; flex-direction: column; margin-bottom: 2.7rem; }
  .section-heading h2 { font-size: 3.4rem; }
  .section-note { max-width: none; }
  .selected-card { grid-template-columns: 36px 1fr 20px; gap: 1rem; padding: 2.3rem 0; }
  .card-meta { grid-column: 2; flex-direction: row; flex-wrap: wrap; }
  .card-arrow { grid-column: 3; grid-row: 1; }
  .card-title h3 { font-size: 2rem; }
  .latest-heading { gap: 2.5rem; }
  .search-box { width: 100%; }
  .tag-filters { gap: 0 1rem; margin-top: -0.5rem; }
  .post-row { grid-template-columns: 36px 1fr 20px; gap: 1rem; padding: 2.2rem 0; }
  .post-row time { grid-column: 2; flex-direction: row; }
  .row-arrow { grid-column: 3; grid-row: 1; }
  .post-summary h3 { font-size: 1.55rem; }
  .post-summary p { font-size: 0.88rem; }
  .inner-page { padding: 5.5rem 0 8rem; }
  .page-intro { grid-template-columns: 1fr; gap: 2rem; padding-bottom: 4.5rem; }
  .page-intro h1,
  .page-intro > p:last-child { grid-column: 1; }
  .page-intro h1 { font-size: 4.4rem; }
  .timeline-year { grid-template-columns: 1fr; gap: 0; }
  .year-marker { padding: 2.4rem 0 1.2rem; font-size: 2.3rem; }
  .year-posts { border-left: 0; border-top: 1px solid var(--line); }
  .timeline-entry { grid-template-columns: 62px 1fr 18px; padding-left: 0; gap: 0.8rem; }
  .timeline-entry h2 { font-size: 1.25rem; }
  .about-grid { grid-template-columns: 1fr; gap: 3rem; padding-top: 4rem; }
  .about-aside { max-width: 310px; }
  .about-copy .about-lead { font-size: 2.35rem; }
  .contact-link { align-items: flex-start; flex-direction: column; }
  .article-view { padding-top: 3rem; }
  .article-shell { width: min(100% - 2rem, 760px); }
  .article-header { padding: 4.5rem 0 3rem; }
  .article-header h1 { font-size: 3.25rem; }
  .article-excerpt { font-size: 1.1rem; }
  .article-body { padding: 3.5rem 0; font-size: 1.08rem; line-height: 1.85; }
  .article-body h2 { font-size: 1.7rem; }
  .article-body blockquote { padding-left: 1.2rem; font-size: 1.2rem; }
  .footer-inner { grid-template-columns: 1fr auto; }
  .footer-inner > p:nth-child(2) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
