:root {
  color-scheme: light;
  --paper: #f7f6f2;
  --ink: #353630;
  --secondary: #6c6d65;
  --muted: #76776e;
  --line: #e2e2da;
  --serif: "Newsreader", "Noto Serif SC", Georgia, serif;
  --ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { min-width: 320px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--ui);
  -webkit-font-smoothing: antialiased;
}
::selection { background: #dce0d5; color: var(--ink); }
a { color: inherit; }
a:focus-visible, pre:focus-visible {
  outline: 2px solid #737a65;
  outline-offset: 4px;
}

/* The shared top toolbar is the only glass surface on article pages. */
.site-header {
  display: flex;
  justify-content: center;
  flex: none;
  padding-top: 20px;
  z-index: 10;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  border: 1px solid rgba(210, 211, 201, .8);
  border-radius: 12px;
  background: #f1f1eb;
  box-shadow: inset 0 1px 0 rgba(255, 255, 250, .85),
    0 4px 8px rgba(57, 59, 45, .025),
    0 12px 30px rgba(57, 59, 45, .035);
  font-family: var(--ui);
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 15px;
  border-radius: 8px;
  color: var(--secondary);
  font-size: 12px;
  line-height: 1;
  text-decoration: none;
  transition: background-color 160ms ease, color 160ms ease;
}
.site-nav a[aria-current="page"] {
  color: var(--ink);
  background: #eeeee7;
  font-weight: 500;
}
@supports ((backdrop-filter: blur(12px)) or (-webkit-backdrop-filter: blur(12px))) {
  .site-nav {
    background: rgba(247, 247, 243, .82);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
  }
}

.editorial-page {
  width: min(100% - 96px, 850px);
  min-height: 100vh;
  min-height: 100svh;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
}
.editorial-page .site-header { position: sticky; top: 0; }
.editorial-page main { flex: 1; min-width: 0; }
.editorial-page .articles-content { padding-block: 52px 64px; }
.articles-heading {
  margin: 0 0 26px;
  font-family: var(--serif);
  font-size: clamp(40px, 4vw, 52px);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -.035em;
}
/* Subtle reading-page typography for the article index. */
.article-index { font-family: var(--serif); }
.article-index .articles-heading { margin-bottom: 32px; }
.article-index .article-date { font-family: var(--serif); font-size: 14px; }

.article-list { margin: 0; padding: 0; list-style: none; }
.article-list li + li { border-top: 1px solid var(--line); }
.article-link {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  align-items: baseline;
  gap: 24px;
  padding-block: 24px;
  color: var(--ink);
  text-decoration: none;
}
.article-date {
  color: var(--muted);
  font-family: var(--ui);
  font-size: 11px;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
}
.article-title {
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 400;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.reading-content {
  width: min(100%, 700px);
  margin-inline: auto;
  padding-block: 42px 64px;
}
.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--secondary);
  font-size: 12px;
  text-decoration: none;
}
.article-header { margin: 20px 0 40px; }
.post-title {
  margin: 0 0 16px;
  font-family: var(--serif);
  font-size: clamp(27px, 3.5vw, 36px);
  font-weight: 400;
  line-height: 1.55;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
.article-header .article-date { font-size: 12px; }
.post-content {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.95;
  overflow-wrap: anywhere;
}
.post-content > :first-child { margin-top: 0; }
.post-content p, .post-content ul, .post-content ol { margin-block: 0 1.4em; }
.post-content ul, .post-content ol { padding-inline-start: 1.5em; }
.post-content li + li { margin-top: .5em; }
.post-content li > p:last-child { margin-bottom: 0; }
.post-content h2, .post-content h3, .post-content h4 {
  margin: 2em 0 .75em;
  font-weight: 500;
  line-height: 1.6;
  scroll-margin-top: 100px;
}
.post-content h2 { font-size: 27px; }
.post-content h3 { font-size: 22px; }
.post-content h4 { font-size: 19px; }
.post-content strong { font-weight: 600; }
.post-content a {
  text-decoration-color: #b9bcb0;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.post-content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 28px auto;
  border: 1px solid var(--line);
  border-radius: 4px;
}
.post-content blockquote {
  margin: 1.5em 0;
  padding-inline-start: 20px;
  border-inline-start: 2px solid #cfd0c5;
  color: var(--secondary);
}
.post-content blockquote > :last-child { margin-bottom: 0; }
.post-content code {
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: .8em;
  background: #efeee8;
  border-radius: 4px;
  padding: .15em .3em;
}
.post-content pre {
  max-width: 100%;
  margin: 24px 0 30px;
  padding: 20px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #efeee8;
  color: var(--ink);
  line-height: 1.8;
  tab-size: 4;
}
.post-content pre code {
  display: block;
  padding: 0;
  border-radius: 0;
  background: none;
  font-size: 13px;
  white-space: pre;
  overflow-wrap: normal;
}
.post-content hr { margin-block: 40px; border: 0; border-top: 1px solid var(--line); }
.editorial-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 48px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
  letter-spacing: .015em;
}
@media (hover: hover) {
  .site-nav a:hover { color: var(--ink); background: #eeeee7; }
  .article-link:hover .article-title, .back-link:hover {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 5px;
  }
}
@media (max-width: 640px) {
  .editorial-page { width: calc(100% - 48px); }
  .site-header { padding-top: 12px; }
  .editorial-page .articles-content { padding-block: 36px 44px; }
  .article-link { grid-template-columns: minmax(0, 1fr); gap: 8px; padding-block: 20px; }
  .article-title { font-size: 21px; }
  .reading-content { padding-block: 24px 44px; }
  .article-header { margin-block: 16px 32px; }
  .post-content { font-size: 17px; line-height: 1.9; }
  .post-content h2 { font-size: 24px; }
  .post-content h3 { font-size: 20px; }
  .post-content pre { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .site-nav a { transition: none; }
}
