:root {
  --ink: #202739;
  --body: #535b70;
  --muted: #81879a;
  --faint: #a0a6b7;
  --accent: #6261de;
  --accent-soft: #f1f0ff;
  --teal: #20a69b;
  --line: #e8eaf0;
  --line-strong: #dfe2ea;
  --paper: #f7f8fb;
  --white: #fff;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 16px/1.5 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button { font: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 3px solid #b5b1ff; outline-offset: 3px; }
.shell { width: min(100%, 1200px); margin-inline: auto; padding-inline: clamp(1.5rem, 4vw, 3rem); }
.site-header .shell, .site-footer .shell { width: min(100%, 1440px); padding-inline: clamp(1.5rem, 3.2vw, 3rem); }

.site-header { position: sticky; top: 0; z-index: 20; height: 76px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(14px); }
.nav-shell { height: 100%; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: .7rem; font-size: .94rem; font-weight: 750; letter-spacing: .11em; }
.brand > span:last-child { white-space: nowrap; }
.brand small { margin-left: .55rem; color: var(--muted); font-size: .75rem; font-weight: 400; letter-spacing: 0; }
.brand-icon { width: 2rem; height: 2rem; display: inline-flex; align-items: center; justify-content: center; border-radius: .56rem; background: var(--ink); color: #fff; font: italic 400 1.65rem Georgia, serif; letter-spacing: 0; }
.brand-icon span { color: #a6a0ff; }
.site-nav { display: flex; align-items: center; gap: clamp(1rem, 2vw, 1.65rem); color: #626579; font-size: .75rem; }
.site-nav a { transition: color 160ms ease; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--accent); }
.menu-button { display: none; }

.blog-header { padding-block: clamp(2.5rem, 3.5vw, 4rem) 2rem; }
.eyebrow { margin: 0 0 1rem; color: var(--accent); font-size: .75rem; font-weight: 650; letter-spacing: .16em; text-transform: uppercase; }
.blog-header h1 { margin: 0; font-size: clamp(3rem, 5vw, 4.25rem); font-weight: 650; letter-spacing: -.065em; line-height: .92; }
.blog-header > p:last-child { max-width: 36rem; margin: 2rem 0 0; color: var(--muted); font-size: 1rem; line-height: 1.75; }
.post-list { padding-bottom: 8rem; }
.post-list::before { display: block; border-top: 1px solid var(--line-strong); content: ""; }
.post-row { display: grid; grid-template-columns: 9rem minmax(0, 1fr) 2rem; gap: clamp(1rem, 4vw, 4rem); align-items: start; padding-block: clamp(2rem, 5vw, 4.5rem); border-bottom: 1px solid var(--line); }
.post-row time { color: var(--faint); font: .75rem ui-monospace, SFMono-Regular, Menlo, monospace; }
.post-row h2 { margin: 0; max-width: 48rem; font-size: clamp(1.45rem, 2vw, 2.25rem); font-weight: 650; letter-spacing: -.04em; line-height: 1.08; }
.post-row p { max-width: 44rem; margin: 1rem 0 0; color: var(--muted); font-size: .95rem; line-height: 1.7; }
.post-row .arrow { color: var(--accent); font-size: 1rem; text-align: right; }
.post-row:hover h2 { color: var(--accent); }
.empty-state { padding: 5rem 0; border-bottom: 1px solid var(--line); color: var(--muted); }

.article-header { max-width: 1080px; padding-block: clamp(3rem, 5vw, 5rem) 2.5rem; }
.back-link { display: inline-flex; gap: .55rem; margin-bottom: 2.25rem; color: var(--muted); font-size: .8rem; }
.back-link:hover { color: var(--accent); }
.article-header h1 { max-width: 900px; margin: 0; font-size: clamp(2.15rem, 3.2vw, 3.35rem); font-weight: 650; letter-spacing: -.05em; line-height: 1.02; }
.article-summary { max-width: 760px; margin: 1.6rem 0 0; color: var(--muted); font-size: 1.08rem; line-height: 1.75; }
.article-meta { display: flex; flex-wrap: wrap; gap: 1rem 2rem; margin-top: 2rem; color: var(--faint); font-size: .78rem; }
.article-meta strong { color: var(--ink); font-weight: 600; }
.page-rule { margin: 0; border: 0; border-top: 1px solid var(--line-strong); }
.article-body { max-width: 790px; padding-block: 4rem 8rem; }
.article-body h2 { margin: 4.2rem 0 1.2rem; font-size: clamp(1.9rem, 4vw, 2.7rem); font-weight: 650; letter-spacing: -.045em; line-height: 1.08; }
.article-body h2:first-child { margin-top: 0; }
.article-body h3 { margin: 2.7rem 0 1rem; font-size: 1.3rem; letter-spacing: -.02em; }
.article-body p, .article-body li { color: var(--body); font: 1.08rem/1.9 Georgia, "Times New Roman", serif; }
.article-body p { margin: 1.25rem 0; }
.article-body ul, .article-body ol { padding-left: 1.5rem; }
.article-body li + li { margin-top: .5rem; }
.article-body strong { color: var(--ink); }
.article-body a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.article-body blockquote { margin: 2.4rem 0; border-left: 3px solid var(--accent); padding: 1.2rem 1.5rem; background: var(--accent-soft); }
.article-body blockquote p { margin: 0; color: #4c4b82; font-family: inherit; font-size: 1rem; line-height: 1.7; }
.article-body img { width: 100%; height: auto; display: block; margin-top: 2.5rem; border: 1px solid var(--line); border-radius: .55rem; background: #fff; }
.article-body figure { margin: 2.5rem 0; }
.article-body figure img { margin-top: 0; }
.article-body figcaption { margin-top: .7rem; color: var(--faint); font-size: .78rem; line-height: 1.55; }
.table-wrap { width: 100%; margin: 2rem 0; overflow-x: auto; border: 1px solid var(--line); border-radius: .5rem; }
.article-body table { width: 100%; min-width: 34rem; border-collapse: collapse; font-size: .82rem; }
.article-body th, .article-body td { padding: .85rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.article-body th { background: #f3f4f8; color: #62697b; font-weight: 600; }
.article-body td { background: #fff; color: #62697b; }
.article-body tr:last-child td { border-bottom: 0; }
.article-body th:last-child, .article-body td:last-child { border-right: 0; }
.code-wrap { position: relative; margin: 2rem 0; overflow: hidden; border: 1px solid #30384d; border-radius: .55rem; background: #202739; }
.code-language { position: absolute; top: .65rem; right: .8rem; color: #a9b0c4; font: .7rem ui-monospace, monospace; text-transform: uppercase; }
.article-body pre { margin: 0; overflow-x: auto; padding: 2.4rem 1.2rem 1.2rem; }
.article-body pre code { color: #edf0f8; font: .84rem/1.7 ui-monospace, SFMono-Regular, Menlo, monospace; }
.tok-keyword { color: #b9b3ff; }
.tok-string { color: #83d8c9; }
.tok-comment { color: #929aaf; }
.tok-number { color: #f3b779; }
.article-body :not(pre) > code { overflow-wrap: anywhere; border-radius: .25rem; padding: .12rem .35rem; background: #eaeaf3; color: #4d4c83; font: .88em ui-monospace, monospace; }
.math-inline { white-space: nowrap; color: #454b60; font-family: "Times New Roman", serif; font-style: italic; }
.math-block { max-width: 100%; margin: 2rem 0; overflow-x: auto; padding: 1rem 1.2rem; border-block: 1px solid var(--line); color: #454b60; font: italic 1.1rem/1.7 "Times New Roman", serif; text-align: center; white-space: nowrap; }

.site-footer { border-top: 1px solid var(--line); background: #fff; }
.footer-grid { min-height: 10rem; display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.footer-grid p, .footer-note { color: var(--muted); font-size: .75rem; }
.footer-grid p { margin: .8rem 0 0; }
.footer-note { display: flex; flex-direction: column; gap: .35rem; text-align: right; }
.footer-note a { color: var(--accent); }

@media (max-width: 700px) {
  .site-header { height: 62px; }
  .brand { font-size: .78rem; }
  .brand small { display: none; }
  .menu-button { display: inline-flex; align-items: center; gap: .5rem; border: 0; background: transparent; color: #626579; font-size: .75rem; }
  .menu-button i, .menu-button i::before, .menu-button i::after { width: .9rem; height: 1px; display: block; background: currentColor; }
  .menu-button i { position: relative; }
  .menu-button i::before, .menu-button i::after { position: absolute; left: 0; content: ""; }
  .menu-button i::before { top: -4px; }
  .menu-button i::after { top: 4px; }
  .site-nav { position: absolute; top: 62px; right: 0; left: 0; display: none; flex-direction: column; align-items: flex-start; gap: 0; padding: .7rem 1.5rem 1rem; border-bottom: 1px solid var(--line); background: #fff; }
  .site-nav.is-open { display: flex; }
  .site-nav a { width: 100%; padding: .7rem 0; }
  .post-row { grid-template-columns: 1fr 1.5rem; gap: .8rem; }
  .post-row time { grid-column: 1 / -1; }
  .post-row .arrow { grid-column: 2; grid-row: 2; }
  .article-header { padding-top: 3.5rem; }
  .back-link { margin-bottom: 2.5rem; }
  .article-body { padding-block: 3rem 6rem; }
  .article-body p, .article-body li { font-size: 1rem; }
  .footer-grid { align-items: flex-start; flex-direction: column; justify-content: center; padding-block: 2.2rem; }
  .footer-note { text-align: left; }
}

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