:root {
  color-scheme: dark;
  --bg: #111418;
  --surface: #1b2025;
  --text: #e7e9e7;
  --muted: #abb3b6;
  --line: #30383b;
  --accent: #b8d8cc;
  --ui: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --reading: "Source Serif 4", Georgia, serif;
  --code: "IBM Plex Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15.5px/1.72 var(--ui); -webkit-font-smoothing: antialiased; }
::selection { background: #35584d; color: #fff; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #e3f0e9; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 2px; }

.site-shell { max-width: 824px; margin: 0 auto; padding: 0 30px; }
.site-header, .site-footer { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.site-header { min-height: 82px; border-bottom: 1px solid var(--line); }
.wordmark { color: var(--text); font-size: 18px; font-weight: 600; letter-spacing: -.035em; text-decoration: none; }
.wordmark-dot { color: var(--accent); }
nav { display: flex; flex-wrap: wrap; gap: 27px; }
nav a { color: var(--muted); font-size: 13px; font-weight: 500; text-decoration: none; }
nav a:hover { color: var(--text); }

.hero { display: flex; align-items: center; justify-content: space-between; gap: 36px; padding: 65px 0 40px; }
.eyebrow { margin: 0 0 8px; color: var(--accent); font: 500 11px/1.5 var(--ui); letter-spacing: .12em; text-transform: uppercase; }
h1 { margin: 0; font: 600 clamp(31px, 4vw, 38px)/1.17 var(--ui); letter-spacing: -.045em; }
.role { margin: 12px 0 0; color: var(--muted); font-size: 14px; }
.portrait { flex: 0 0 126px; width: 126px; height: 126px; object-fit: cover; object-position: center 35%; border: 1px solid var(--line); border-radius: 50%; filter: saturate(.82); }

.content { max-width: 700px; padding-bottom: 67px; }
.content p { margin: 0 0 18px; color: var(--muted); }
.content > p:first-child { color: var(--text); font-size: 16px; }
.content strong { color: var(--text); font-weight: 600; }
.content h2 { margin: 56px 0 19px; padding-top: 20px; border-top: 1px solid var(--line); font: 600 19px/1.35 var(--ui); letter-spacing: -.025em; scroll-margin-top: 24px; }
.content ol, .content ul { margin: 0 0 22px; padding-left: 24px; }
.content li { margin-bottom: 18px; padding-left: 7px; color: var(--muted); }
.content li::marker { color: var(--accent); }
.content > p:last-child { margin-top: 32px; }

.post-list { list-style: none; padding: 0 !important; margin: 0 0 20px !important; }
.post-list li { display: grid; grid-template-columns: 1fr auto; column-gap: 16px; margin: 0 !important; padding: 15px 0 !important; border-bottom: 1px solid var(--line); }
.post-list li:first-child { border-top: 1px solid var(--line); }
.post-title { color: var(--text); font-weight: 500; text-decoration: none; }
.post-title:hover { color: var(--accent); }
.post-date { color: var(--muted); font-size: 12px; white-space: nowrap; }
.post-list p { grid-column: 1 / -1; margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.empty-note { color: var(--muted); font-style: italic; }

.blog-index, .reading-page { max-width: 720px; margin: 0 auto; padding: 56px 0 90px; }
.blog-index h1 { font-size: 34px; }
.blog-intro { margin: 12px 0 30px; color: var(--muted); }
.back-link, .article-end a { color: var(--muted); font-size: 13px; text-decoration: none; }
.back-link:hover, .article-end a:hover { color: var(--accent); }
.article-header { margin: 39px 0 36px; padding-bottom: 30px; border-bottom: 1px solid var(--line); }
.article-header h1 { max-width: 690px; font-size: clamp(28px, 3.8vw, 35px); }
.article-summary { max-width: 610px; margin: 14px 0 0; color: var(--muted); font-size: 15px; }
.article-end { margin-top: 58px; padding-top: 20px; border-top: 1px solid var(--line); }

.prose { max-width: 690px; color: #d7dad9; font: 16px/1.8 var(--reading); }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.15em; }
.prose h2, .prose h3, .prose h4 { margin: 2em 0 .65em; color: var(--text); font-family: var(--ui); font-weight: 600; letter-spacing: -.025em; line-height: 1.35; scroll-margin-top: 25px; }
.prose h2 { font-size: 21px; }
.prose h3 { font-size: 18px; }
.prose h4 { font-size: 16px; }
.prose strong { color: var(--text); }
.prose li { padding-left: 3px; margin: .32em 0; }
.prose li::marker { color: var(--accent); }
.prose blockquote { margin: 1.7em 0; padding: .1em 0 .1em 18px; border-left: 2px solid var(--accent); color: var(--muted); }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose hr { height: 1px; margin: 2.5em 0; border: 0; background: var(--line); }
.prose img, .prose svg, .prose video { display: block; max-width: 100%; height: auto; margin: 1.7em auto .55em; border-radius: 4px; }
.prose figcaption, .prose img + em, .prose p:has(> img) + p > em { color: var(--muted); font: italic 13px/1.5 var(--ui); }
.prose figure { margin: 1.8em 0; }
.prose figure img { margin-bottom: 8px; }
.prose iframe { display: block; width: 100%; min-height: 400px; margin: 1.8em 0; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.prose table { display: block; width: max-content; max-width: 100%; margin: 1.8em 0; overflow-x: auto; border-collapse: collapse; font: 13px/1.5 var(--ui); }
.prose th, .prose td { padding: 9px 13px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.prose th { color: var(--text); font-weight: 600; }
.prose tr:nth-child(even) { background: #181d20; }
.prose code { padding: .12em .3em; border: 1px solid var(--line); border-radius: 3px; background: var(--surface); color: #dae9df; font: .83em/1.4 var(--code); overflow-wrap: anywhere; }
.prose pre { max-width: 100%; margin: 1.6em 0; padding: 17px 19px; overflow-x: auto; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: #dde4e1; font: 12.5px/1.65 var(--code); tab-size: 2; }
.prose pre code { padding: 0; border: 0; background: none; color: inherit; font: inherit; overflow-wrap: normal; }
.prose .highlight { background: transparent; }
.highlight .k, .highlight .kd, .highlight .kn { color: #b8d8cc; }
.highlight .s, .highlight .s1, .highlight .s2 { color: #d8bf9d; }
.highlight .c, .highlight .c1, .highlight .cm { color: #87969a; font-style: italic; }
.highlight .nf, .highlight .nb { color: #b9cafa; }
.prose .footnotes { margin-top: 3em; padding-top: 1em; border-top: 1px solid var(--line); font-size: 13px; }
.prose mjx-container[display="true"] { max-width: 100%; overflow-x: auto; overflow-y: hidden; padding: .2em 0; }

.site-footer { min-height: 82px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.site-footer a { color: var(--muted); text-decoration: none; }

@media (max-width: 600px) {
  .site-shell { padding: 0 22px; }
  .site-header { min-height: 95px; align-items: flex-start; flex-direction: column; justify-content: center; gap: 6px; }
  nav { gap: 20px; }
  .hero { align-items: flex-start; flex-direction: column-reverse; gap: 23px; padding: 42px 0 29px; }
  .portrait { flex-basis: 94px; width: 94px; height: 94px; }
  .content h2 { margin-top: 44px; }
  .post-list li { display: block; }
  .post-date { display: block; margin-top: 3px; }
  .blog-index, .reading-page { padding: 42px 0 70px; }
  .article-header { margin-top: 28px; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
