/* Article navigation follows the homepage, while article layout remains independent. */
body { --post-header-height: 80px; --paper-light: #fffdf0a6; --paper-rule: #8765362e; isolation: isolate; }
[data-theme="dark"] body { --paper-light: #e4bf7720; --paper-rule: #d2b27e26; }
.site-header { background: var(--bg); backdrop-filter: none; border-bottom: 1px solid var(--line); }
.site-header .wrap { width: min(1200px, calc(100% - 112px)); max-width: none; padding: 0; margin-inline: auto; }
.header-inner { min-height: var(--post-header-height); gap: 24px; }
.brand { gap: 12px; min-height: 44px; }
.brand-mark { width: 36px; height: 36px; border: 1px solid var(--fg); border-radius: 50%; background: transparent; color: var(--fg); font-family: var(--serif); font-size: 23px; font-weight: 400; }
.brand-text { font-size: 21px; font-weight: 700; letter-spacing: 0; }
.brand-sub { font-family: var(--sans); font-size: 15px; letter-spacing: 0; margin-top: 4px; }
.nav { display: flex; flex-direction: row; align-items: center; position: static; padding: 0; width: auto; height: auto; border: 0; background: transparent; backdrop-filter: none; box-shadow: none; margin-left: auto; gap: 24px; }
.nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 2px; border-radius: 0; background: none; font-size: 17px; font-weight: 600; }
.header-actions { gap: 16px; }
.menu-btn { display: none; }
.header-actions .theme-toggle, [data-theme="dark"] .header-actions .theme-toggle { position: relative; right: auto; bottom: auto; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--fg); box-shadow: none; z-index: auto; }

.post { max-width: 1040px; }
.post-back { min-height: 44px; font-size: 16px; color: var(--dim); }
.post-kicker { font-size: 14px; }
.post-meta { font-size: 14px; }
.post-body { font-size: 19px; line-height: 1.9; }
.post-body .lead { font-size: 20px; }
.post-body h2 { font-size: 1.5rem; }
.post-body pre { font-size: 15px; }
.post-body table { font-size: 16px; }
.callout p, .quote p { font-size: inherit; }
.quote cite, .post-related-label { font-size: 13px; }
.post-related a { font-size: 16px; }
.post-end .btn { font-size: 16px; min-height: 44px; }

@media (min-width: 1024px) {
  body::before, [data-theme="dark"] body::before {
    --paper-margin: max(24px, calc((100vw - 1280px) / 2));
    background:
      linear-gradient(to right, var(--paper-light), transparent) left / var(--paper-margin) 100% no-repeat,
      linear-gradient(to left, var(--paper-light), transparent) right / var(--paper-margin) 100% no-repeat;
  }
  body::after { opacity: .12; }
  [data-theme="dark"] body::after { opacity: .08; }
  .post-main::before {
    content: "";
    position: fixed;
    inset: calc(var(--post-header-height) + 32px) max(24px, calc((100% - 1280px) / 2)) 32px;
    border-inline: 1px solid var(--paper-rule);
    mask-image: linear-gradient(transparent, #000 12%, #000 88%, transparent);
    pointer-events: none;
    z-index: -1;
  }
}
@media (max-width: 1099px) { .site-header .wrap { width: calc(100% - 80px); } }
@media (max-width: 900px) {
  body { --post-header-height: 72px; }
  .site-header .wrap { width: calc(100% - 64px); }
  .nav { gap: 16px; }
  .nav a { font-size: 16px; }
  .brand-sub { display: none; }
}
@media (max-width: 700px) {
  body { --post-header-height: 68px; }
  .site-header .wrap { width: calc(100% - 48px); }
  .header-inner { gap: 16px; }
  .brand-mark { width: 32px; height: 32px; font-size: 21px; }
  .header-actions { gap: 8px; }
  .menu-btn { display: block; border-radius: 4px; }
  .nav { display: none; position: fixed; inset: var(--post-header-height) 0 0; width: 100%; height: calc(100dvh - var(--post-header-height)); padding: 32px 24px; margin: 0; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 0; background: var(--bg); border: 0; border-radius: 0; box-shadow: none; z-index: 50; overflow: auto; }
  body.nav-open { overflow: hidden; }
  body.nav-open .nav { display: flex; }
  .nav a { min-height: 60px; padding: 6px 0; font-family: var(--serif); font-size: 25px; border-bottom: 1px solid var(--line); }
  .nav a::after { display: none; }
  .post-body { font-size: 16px; line-height: 1.85; }
  .post-body .lead { font-size: 17px; }
  .post-body pre { font-size: 13px; }
  .post-body table { font-size: 14px; }
}
