:root {
  --ink: #edf0e8;
  --muted: #8f9993;
  --dim: #66706b;
  --night: #0b1112;
  --night-soft: #101819;
  --card: #131d1e;
  --line: rgba(220, 227, 218, .13);
  --accent: #d6a96d;
  --accent-soft: #f0d2a7;
  --teal: #83b6ab;
  --serif: "Noto Serif SC", "Songti SC", serif;
  --sans: "Noto Sans SC", -apple-system, BlinkMacSystemFont, sans-serif;
  --shadow: 0 24px 70px rgba(0, 0, 0, .26);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 5%, rgba(131, 182, 171, .1), transparent 26rem),
    radial-gradient(circle at 88% 26%, rgba(214, 169, 109, .075), transparent 30rem),
    var(--night);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, black, transparent 70%);
  z-index: -1;
}

a { color: inherit; }
button, input { font: inherit; }
[hidden] { display: none !important; }
.shell { width: min(1120px, calc(100% - 48px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid transparent;
  background: rgba(11, 17, 18, .78);
  backdrop-filter: blur(18px);
  transition: border-color .25s ease;
}
.site-header.scrolled { border-color: var(--line); }
.header-inner { height: 86px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; gap: 12px; align-items: center; text-decoration: none; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(214, 169, 109, .58);
  color: var(--accent-soft);
  border-radius: 50% 50% 46% 54%;
  font-family: var(--serif);
  transform: rotate(-4deg);
}
.brand-copy { display: grid; gap: 1px; }
.brand-copy strong { font-family: var(--serif); letter-spacing: .16em; font-size: 1rem; }
.brand-copy small { color: var(--dim); font-size: .57rem; letter-spacing: .18em; }
.nav { display: flex; gap: 8px; }
.nav a { padding: 9px 15px; border-radius: 999px; color: var(--muted); text-decoration: none; font-size: .88rem; transition: .2s ease; }
.nav a:hover, .nav a.active { background: rgba(255,255,255,.055); color: var(--ink); }

.hero { min-height: 560px; padding: 112px 0 88px; display: grid; grid-template-columns: 1.5fr .7fr; align-items: end; gap: 80px; }
.eyebrow { display: flex; align-items: center; gap: 10px; margin: 0 0 24px; color: var(--teal); font-size: .72rem; font-weight: 600; letter-spacing: .16em; }
.eyebrow span { width: 30px; height: 1px; background: currentColor; }
.hero h1, .about-view h1 { margin: 0; font-family: var(--serif); font-size: clamp(2.9rem, 6vw, 5.2rem); font-weight: 600; line-height: 1.25; letter-spacing: -.035em; }
.hero h1 em { color: var(--accent-soft); font-style: normal; }
.hero-description { max-width: 620px; margin: 30px 0 0; color: var(--muted); font-size: 1.02rem; line-height: 2; }
.hero-note { position: relative; margin-bottom: 6px; padding: 28px; border: 1px solid var(--line); background: rgba(19,29,30,.7); box-shadow: var(--shadow); }
.hero-note::before { content: ""; position: absolute; inset: 8px; border: 1px solid rgba(255,255,255,.045); pointer-events: none; }
.note-index { color: var(--dim); font-size: .65rem; letter-spacing: .2em; }
.hero-note > p { margin: 40px 0; font-family: var(--serif); font-size: 1.08rem; line-height: 2; }
.note-meta { display: flex; justify-content: space-between; color: var(--dim); font-size: .72rem; }

.archive { padding: 82px 0 120px; border-top: 1px solid var(--line); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 32px; margin-bottom: 38px; }
.section-heading .eyebrow { margin-bottom: 12px; }
.section-heading h2 { margin: 0; font-family: var(--serif); font-size: clamp(2rem, 3vw, 2.75rem); font-weight: 600; }
.search-box { width: min(320px, 38vw); display: flex; gap: 10px; align-items: center; padding: 0 4px 11px; border-bottom: 1px solid var(--line); color: var(--dim); transition: border-color .2s; }
.search-box:focus-within { border-color: var(--accent); }
.search-box svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.search-box input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; }
.search-box input::placeholder { color: var(--dim); }
.filter-row { min-height: 36px; display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 30px; }
.filter-button { border: 1px solid var(--line); border-radius: 999px; padding: 7px 13px; color: var(--muted); background: transparent; cursor: pointer; font-size: .77rem; transition: .2s ease; }
.filter-button:hover, .filter-button.active { border-color: rgba(214,169,109,.55); color: var(--accent-soft); background: rgba(214,169,109,.07); }
.article-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); border-top: 1px solid var(--line); }
.article-card { position: relative; min-height: 330px; padding: 40px 38px; border-bottom: 1px solid var(--line); text-decoration: none; overflow: hidden; transition: background .25s ease; }
.article-card:nth-child(odd) { border-right: 1px solid var(--line); }
.article-card::after { content: "↗"; position: absolute; right: 36px; bottom: 35px; color: var(--accent); font-size: 1.3rem; transform: translate(-7px,7px); opacity: 0; transition: .25s ease; }
.article-card:hover { background: rgba(255,255,255,.025); }
.article-card:hover::after { transform: translate(0,0); opacity: 1; }
.card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 50px; color: var(--dim); font-size: .72rem; letter-spacing: .08em; }
.category-label { color: var(--teal); }
.article-card h3 { max-width: 460px; margin: 0 0 16px; font-family: var(--serif); font-size: 1.55rem; font-weight: 600; line-height: 1.55; transition: color .2s; }
.article-card:hover h3 { color: var(--accent-soft); }
.article-card .excerpt { max-width: 470px; margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.85; }
.card-number { position: absolute; right: 38px; top: 93px; color: rgba(255,255,255,.045); font-family: var(--serif); font-size: 4.8rem; line-height: 1; }
.empty-state, .error-state { grid-column: 1 / -1; padding: 80px 24px; text-align: center; color: var(--muted); border-bottom: 1px solid var(--line); }
.empty-state strong, .error-state strong { display: block; margin-bottom: 9px; color: var(--ink); font-family: var(--serif); font-size: 1.3rem; }
.error-state button { margin-top: 18px; border: 1px solid var(--line); padding: 8px 16px; color: var(--accent-soft); background: transparent; cursor: pointer; }
.skeleton-card span { display: block; height: 12px; margin-bottom: 24px; border-radius: 4px; background: linear-gradient(90deg, rgba(255,255,255,.03), rgba(255,255,255,.08), rgba(255,255,255,.03)); background-size: 200% 100%; animation: shimmer 1.5s infinite; }
.skeleton-card span:nth-child(2) { width: 70%; height: 30px; margin-top: 45px; }
.skeleton-card span:nth-child(3) { width: 88%; }
@keyframes shimmer { to { background-position: -200% 0; } }

.reading-view { max-width: 820px; padding: 76px 0 120px; }
.back-link { display: inline-block; margin-bottom: 70px; color: var(--muted); text-decoration: none; font-size: .85rem; transition: color .2s; }
.back-link:hover { color: var(--accent-soft); }
.reading-meta { display: flex; gap: 20px; align-items: center; margin-bottom: 26px; color: var(--dim); font-size: .8rem; }
.reading-meta span { color: var(--teal); }
.reading-meta span::after { content: ""; display: inline-block; width: 28px; height: 1px; margin-left: 20px; vertical-align: middle; background: var(--line); }
.reading-header h1 { margin: 0; font-family: var(--serif); font-size: clamp(2.45rem, 6vw, 4.45rem); line-height: 1.28; font-weight: 600; letter-spacing: -.025em; }
.reading-header > p { max-width: 650px; margin: 30px 0 0; color: var(--muted); font-size: 1.05rem; line-height: 1.9; }
.reading-rule { display: flex; align-items: center; margin: 56px 0; }
.reading-rule::before { content: "✦"; margin-right: 14px; color: var(--accent); font-size: .75rem; }
.reading-rule span { height: 1px; flex: 1; background: var(--line); }
.prose { color: #d5dad3; font-family: var(--serif); font-size: 1.08rem; line-height: 2.15; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose pre { margin: 0 0 1.6em; }
.prose h2, .prose h3 { margin: 2.2em 0 .85em; color: var(--ink); line-height: 1.5; }
.prose h2 { font-size: 1.65rem; }
.prose h3 { font-size: 1.3rem; }
.prose a { color: var(--accent-soft); text-underline-offset: 4px; }
.prose blockquote { padding: 4px 0 4px 24px; border-left: 2px solid var(--accent); color: var(--muted); }
.prose code { border: 1px solid var(--line); border-radius: 4px; padding: .12em .36em; background: rgba(255,255,255,.04); font-family: ui-monospace, monospace; font-size: .88em; }
.prose pre { overflow-x: auto; border: 1px solid var(--line); padding: 20px; background: #080d0e; line-height: 1.7; }
.prose pre code { border: 0; padding: 0; background: none; }
.article-end { display: flex; align-items: center; justify-content: space-between; margin-top: 76px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--dim); font-size: .75rem; letter-spacing: .12em; }
.article-end a { color: var(--accent-soft); text-decoration: none; letter-spacing: 0; }

.about-view { min-height: 680px; padding: 76px 0 130px; }
.about-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 100px; align-items: start; }
.about-layout .eyebrow { margin-bottom: 24px; }
.about-copy { padding-top: 70px; color: var(--muted); font-family: var(--serif); font-size: 1.05rem; line-height: 2.15; }
.about-copy .lead { color: var(--ink); font-size: 1.35rem; }
.about-copy p { margin: 0 0 1.5em; }

.site-footer { border-top: 1px solid var(--line); background: rgba(5,9,10,.28); }
.footer-inner { min-height: 190px; display: flex; align-items: center; justify-content: space-between; gap: 40px; }
.footer-inner strong { font-family: var(--serif); letter-spacing: .14em; }
.footer-inner p { margin: 8px 0 0; color: var(--dim); font-size: .76rem; }
.footer-links { max-width: 580px; display: flex; flex-wrap: wrap; justify-content: end; gap: 14px 22px; }
.footer-links a { display: inline-flex; align-items: center; gap: 6px; color: var(--dim); text-decoration: none; font-size: .7rem; }
.footer-links a:hover { color: var(--muted); }

@media (max-width: 820px) {
  .shell { width: min(100% - 32px, 680px); }
  .header-inner { height: 74px; }
  .hero { min-height: auto; padding: 80px 0 72px; grid-template-columns: 1fr; gap: 54px; }
  .hero-note { max-width: 390px; }
  .section-heading { align-items: start; flex-direction: column; }
  .search-box { width: 100%; }
  .article-grid { grid-template-columns: 1fr; }
  .article-card:nth-child(odd) { border-right: 0; }
  .article-card { min-height: 300px; padding-inline: 25px; }
  .card-number { right: 25px; }
  .about-layout { grid-template-columns: 1fr; gap: 10px; }
  .about-copy { padding-top: 20px; }
  .footer-inner { padding: 45px 0; align-items: start; flex-direction: column; }
  .footer-links { justify-content: start; }
}

@media (max-width: 520px) {
  .brand-copy small { display: none; }
  .nav a { padding-inline: 11px; }
  .hero { padding-top: 64px; }
  .hero h1, .about-view h1 { font-size: 2.55rem; }
  .hero-description { font-size: .94rem; }
  .hero-note { margin-inline: -4px; }
  .archive { padding-top: 64px; }
  .article-card h3 { font-size: 1.35rem; }
  .reading-view { padding-top: 48px; }
  .back-link { margin-bottom: 48px; }
  .reading-header h1 { font-size: 2.25rem; }
}

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