@font-face { font-family: "Geist"; src: url("/fonts/geist-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Libre Baskerville"; src: url("/fonts/libre-baskerville-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Libre Baskerville"; src: url("/fonts/libre-baskerville-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Libre Baskerville"; src: url("/fonts/libre-baskerville-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --soft: #f4f4f2;
  --ink: #111318;
  --text: rgba(17, 19, 24, 0.82);
  --muted: rgba(17, 19, 24, 0.56);
  --line: rgba(17, 19, 24, 0.09);
  --accent: #1d4ed8;
  --accent-hover: #1e40af;
  --serif: "Libre Baskerville", Georgia, serif;
  --sans: "Geist", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0e11;
    --surface: #131519;
    --soft: #1a1c21;
    --ink: #f1f1ef;
    --text: rgba(241, 241, 239, 0.82);
    --muted: rgba(241, 241, 239, 0.55);
    --line: rgba(241, 241, 239, 0.1);
    --accent: #6d8ff5;
    --accent-hover: #8ea9ff;
  }
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 17px; line-height: 1.75; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { color: var(--ink); font-family: var(--serif); font-weight: 700; }

.page { max-width: 1232px; margin: 0 auto; background: var(--surface); min-height: 100vh; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.inner { max-width: 1080px; margin: 0 auto; padding: 0 40px; }

/* Header */
.site-header .inner { display: flex; align-items: center; justify-content: space-between; height: 92px; gap: 24px; }
.logo { font-family: var(--serif); font-weight: 700; font-size: 21px; color: var(--ink); letter-spacing: -0.3px; white-space: nowrap; }
.nav { display: flex; gap: 2px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,0.03); }
.nav a { font-size: 14px; font-weight: 500; color: var(--ink); padding: 6px 13px; border-radius: 999px; }
.nav a:hover, .nav a.on { background: var(--soft); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 14.5px; font-weight: 600; border: 0; font-family: var(--sans); white-space: nowrap; }
.btn:hover { background: var(--accent-hover); }
.btn svg { width: 15px; height: 15px; }
.site-header .btn { gap: 0; }
.btn-outline { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--line); font-size: 14.5px; font-weight: 600; color: var(--ink); background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,0.04); white-space: nowrap; }
.btn-outline:hover { background: var(--soft); }

/* Hero */
.hero { padding: 72px 0 64px; max-width: 700px; }
.hero h1 { font-size: 34px; line-height: 1.38; letter-spacing: -0.6px; margin-bottom: 26px; }
.hero p { margin-bottom: 16px; max-width: 640px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }

/* Section titles */
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 28px; gap: 16px; }
.section-title h2 { font-size: 21px; letter-spacing: -0.3px; }
.section-title a { font-size: 14px; color: var(--muted); white-space: nowrap; }
.section-title a:hover { color: var(--ink); }

/* Topics */
.topics { padding: 8px 0 72px; }
.topic-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.topic svg { width: 30px; height: 30px; margin-bottom: 16px; color: var(--ink); }
.topic h3 { font-size: 17px; line-height: 1.4; margin-bottom: 8px; letter-spacing: -0.2px; }
.topic p { font-size: 15px; line-height: 1.6; color: var(--muted); }

/* Lists */
.main-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 44px; padding-bottom: 88px; border-top: 1px solid var(--line); padding-top: 64px; }
.tabs { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 4px 20px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.tabs a { white-space: nowrap; font-size: 14.5px; font-weight: 500; color: var(--muted); padding: 0 0 12px; margin-bottom: -1px; border-bottom: 2px solid transparent; }
.tabs a.on { color: var(--ink); border-color: var(--ink); }
.tabs a:hover { color: var(--ink); }
.post-row { display: grid; grid-template-columns: 172px minmax(0, 1fr); gap: 24px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.post-row .thumb { aspect-ratio: 16 / 10; border-radius: 6px; overflow: hidden; background: var(--soft); }
.post-row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-row h3 { font-family: var(--sans); font-weight: 600; font-size: 18.5px; line-height: 1.35; letter-spacing: -0.2px; margin-bottom: 6px; }
.post-row:hover h3 { color: var(--accent); }
.post-row p { font-size: 15px; line-height: 1.6; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { font-size: 13.5px; color: var(--muted); margin-top: 10px; }
.meta span + span::before { content: "·"; margin: 0 7px; }
.more-wrap { text-align: center; margin-top: 36px; }

/* Sidebar */
aside { display: flex; flex-direction: column; gap: 20px; }
.card { border: 1px solid var(--line); border-radius: 14px; padding: 22px; background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,0.03); }
.card h2 { font-size: 17px; line-height: 1.4; letter-spacing: -0.2px; margin-bottom: 10px; }
.card p { font-size: 14.5px; line-height: 1.6; color: var(--text); }
.card .btn { width: 100%; margin-top: 16px; }
.tag-list { list-style: none; margin-top: 4px; }
.tag-list li a { display: flex; justify-content: space-between; font-size: 14.5px; padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--ink); }
.tag-list li:last-child a { border-bottom: 0; padding-bottom: 0; }
.tag-list li a span { color: var(--muted); font-variant-numeric: tabular-nums; }
.tag-list li a:hover { color: var(--accent); }
.card .link { display: inline-block; margin-top: 12px; font-size: 14px; font-weight: 600; color: var(--accent); }

/* Page header (writing, tags, about) */
.page-head { padding: 64px 0 40px; max-width: 700px; }
.page-head h1 { font-size: 36px; line-height: 1.25; letter-spacing: -0.7px; margin-bottom: 14px; }
.page-head p { color: var(--muted); }
.list-wrap { padding-bottom: 88px; }
.year { font-family: var(--serif); font-weight: 700; font-size: 17px; color: var(--ink); padding: 36px 0 4px; }

/* Article */
.article { padding: 56px 0 24px; }
.article-head { max-width: 720px; margin: 0 auto; }
.article-head .tag { display: inline-block; font-size: 14px; font-weight: 600; color: var(--accent); margin-bottom: 16px; }
.article-head h1 { font-size: 38px; line-height: 1.28; letter-spacing: -0.8px; margin-bottom: 18px; }
.article-head .standfirst { font-size: 19px; line-height: 1.6; color: var(--muted); margin-bottom: 20px; }
.byline { display: flex; align-items: center; gap: 12px; font-size: 14.5px; color: var(--muted); padding-bottom: 28px; }
.byline .avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: var(--surface); display: grid; place-items: center; font-family: var(--serif); font-weight: 700; font-size: 15px; }
.byline b { color: var(--ink); font-weight: 600; }
.feature { max-width: 960px; margin: 8px auto 48px; border-radius: 12px; overflow: hidden; background: var(--soft); }
.feature img { width: 100%; }
.prose { max-width: 720px; margin: 0 auto; font-size: 18px; line-height: 1.8; }
.prose > * + * { margin-top: 1.15em; }
.prose h2, .prose h3, .prose h4 { line-height: 1.35; letter-spacing: -0.3px; margin-top: 1.9em; }
.prose h2 { font-size: 26px; }
.prose h3 { font-size: 21px; }
.prose h4 { font-size: 18px; font-family: var(--sans); font-weight: 600; color: var(--ink); }
.prose h2 strong, .prose h3 strong { font-weight: inherit; }
.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 { padding-left: 1.3em; }
.prose li + li { margin-top: 0.5em; }
.prose li::marker { color: var(--muted); }
.prose blockquote { border-left: 3px solid var(--accent); padding: 4px 0 4px 22px; font-family: var(--serif); font-style: italic; font-size: 20px; line-height: 1.6; color: var(--ink); }
.prose img { border-radius: 10px; margin: 1.8em auto; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15.5px; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 10px 8px; text-align: left; vertical-align: top; }
.prose code { font-size: 0.9em; background: var(--soft); padding: 2px 5px; border-radius: 4px; }
.author-box { max-width: 720px; margin: 64px auto 0; padding: 26px; border: 1px solid var(--line); border-radius: 14px; display: grid; grid-template-columns: 52px 1fr; gap: 18px; }
.author-box .avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--ink); color: var(--surface); display: grid; place-items: center; font-family: var(--serif); font-weight: 700; font-size: 20px; }
.author-box h2 { font-size: 17px; margin-bottom: 6px; }
.author-box p { font-size: 15px; line-height: 1.65; }
.author-box .links { display: flex; gap: 18px; margin-top: 10px; font-size: 14.5px; font-weight: 600; }
.author-box .links a { color: var(--accent); }
.related { max-width: 720px; margin: 64px auto 0; padding-bottom: 88px; }

/* About */
.about-body { max-width: 720px; padding-bottom: 32px; }
.about-body p { font-size: 18px; line-height: 1.8; margin-bottom: 1.1em; }
.about-body p strong { color: var(--ink); font-weight: 600; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 40px 0 8px; }
.facts .card h2 { font-size: 16px; }
.facts .card p { font-size: 14.5px; }
.gallery { columns: 3 280px; column-gap: 16px; padding: 24px 0 88px; }
.gallery img { width: 100%; border-radius: 10px; margin-bottom: 16px; break-inside: avoid; background: var(--soft); }
.note { font-size: 14px; color: var(--muted); margin-top: 8px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 56px 0 40px; }
.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
.foot-grid .about-col p { font-size: 14.5px; color: var(--muted); max-width: 300px; margin-top: 10px; line-height: 1.6; }
.foot-grid h4 { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 10px; }
.foot-grid ul { list-style: none; }
.foot-grid li a { font-size: 14.5px; color: var(--muted); line-height: 2; }
.foot-grid li a:hover { color: var(--ink); }
.copy { margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--muted); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }

@media (max-width: 980px) {
  .nav { display: none; }
  .topic-grid { grid-template-columns: repeat(2, 1fr); }
  .main-grid { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .facts { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .page { border: 0; }
  .inner { padding: 0 16px; }
  .site-header .inner { height: 72px; }
  .logo { font-size: 19px; }
  .site-header .btn { height: 36px; padding: 0 14px; font-size: 14px; }
  .site-header .btn .long { display: none; }
  .hero { padding: 40px 0 48px; }
  .hero h1 { font-size: 26px; }
  .actions a { flex: 1; }
  .topic-grid { grid-template-columns: 1fr; gap: 26px; }
  .main-grid { padding-top: 48px; }
  .post-row { grid-template-columns: 1fr; gap: 14px; }
  .page-head { padding: 40px 0 24px; }
  .page-head h1 { font-size: 28px; }
  .article { padding-top: 36px; }
  .article-head h1 { font-size: 28px; }
  .article-head .standfirst { font-size: 17px; }
  .feature { margin: 0 -16px 32px; border-radius: 0; }
  .prose { font-size: 17px; }
  .prose h2 { font-size: 22px; }
  .prose h3 { font-size: 19px; }
  .author-box { grid-template-columns: 1fr; padding: 22px; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-grid .about-col { grid-column: 1 / -1; }
}
