:root {
  --paper: #f3f0e8;
  --ink: #111820;
  --muted: #697078;
  --line: rgba(17, 24, 32, 0.18);
  --accent: #175cff;
  --white: #fffdf7;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: "Iowan Old Style", "Noto Serif SC", "Songti SC", Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }

.site-header {
  position: relative; z-index: 10; width: 100%; height: 76px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(22px, 5vw, 76px); color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.wordmark { font-size: .84rem; font-weight: 800; letter-spacing: .14em; text-decoration: none; }
.wordmark span { color: var(--accent); }
.site-header nav { display: flex; gap: clamp(16px, 3vw, 36px); }
.site-header nav a { font-size: .78rem; font-weight: 650; text-decoration: none; opacity: .82; transition: opacity 180ms ease, transform 180ms ease; }
.site-header nav a:hover { opacity: 1; transform: translateY(-2px); }

.hero { position: relative; min-height: min(720px, calc(100svh - 76px)); display: flex; align-items: flex-end; padding: clamp(70px, 12vh, 140px) clamp(22px, 8vw, 126px); border-bottom: 1px solid var(--line); }
.hero-copy { width: min(1000px, 90vw); animation: hero-in 700ms 80ms cubic-bezier(.2,.7,.2,1) both; }
.eyebrow { margin: 0 0 18px; font-size: .72rem; font-weight: 750; letter-spacing: .15em; text-transform: uppercase; }
.hero h1 { margin: 0; font-family: var(--serif); font-size: clamp(3.2rem, 8.7vw, 8.2rem); font-weight: 500; line-height: .88; letter-spacing: -.055em; }
.lede { width: min(520px, 100%); margin: 30px 0 0; color: var(--muted); font-family: var(--serif); font-size: clamp(1rem, 1.7vw, 1.2rem); line-height: 1.7; }
.edition { position: absolute; right: clamp(22px, 5vw, 76px); bottom: clamp(24px, 4vw, 52px); margin: 0; color: var(--muted); font-size: .68rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }

.post-list { padding: clamp(80px, 11vw, 160px) clamp(22px, 8vw, 126px); }
.section-heading { display: grid; grid-template-columns: 1fr 2fr auto; align-items: end; padding-bottom: 24px; border-bottom: 2px solid var(--ink); }
.section-heading p, .section-heading h2 { margin: 0; }
.section-heading p { color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .12em; }
.section-heading h2 { font-family: var(--serif); font-size: clamp(2rem, 4vw, 4.4rem); font-weight: 500; }
.section-heading span { color: var(--accent); font-size: 1.1rem; font-weight: 800; }
.post-row { display: grid; grid-template-columns: 1fr 2fr auto; gap: 26px; padding: clamp(30px, 4vw, 54px) 0; border-bottom: 1px solid var(--line); transition: padding-left 220ms ease; }
.post-row:hover { padding-left: 10px; }
.post-row time { color: var(--muted); font-size: .76rem; letter-spacing: .08em; }
.post-row h2 { margin: 0; font-family: var(--serif); font-size: clamp(1.65rem, 3vw, 3rem); font-weight: 500; line-height: 1.14; }
.post-row h2 a { text-decoration: none; }
.post-row p { max-width: 680px; margin: 14px 0; color: var(--muted); line-height: 1.75; }
.row-arrow { align-self: center; color: var(--accent); font-size: 1.55rem; text-decoration: none; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags span { color: var(--muted); font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; }
.tags span::before { content: "#"; color: var(--accent); }
.legacy-band { display: grid; grid-template-columns: 1fr auto; gap: 42px; align-items: end; padding: clamp(60px, 9vw, 120px) clamp(22px, 8vw, 126px); border-bottom: 1px solid var(--line); }
.legacy-band h2 { margin: 0; font-family: var(--serif); font-size: clamp(2.3rem, 5vw, 5.4rem); font-weight: 500; line-height: .95; }
.legacy-band > a { font-weight: 700; text-decoration: none; white-space: nowrap; }
.legacy-band > a span { color: var(--accent); }

.article-main { width: min(840px, calc(100% - 44px)); margin: 0 auto; padding: clamp(72px, 9vw, 128px) 0 90px; }
.article-main.has-outline { width: min(1120px, calc(100% - 44px)); display: grid; grid-template-columns: 180px minmax(0, 840px); gap: clamp(42px, 5vw, 72px); align-items: start; justify-content: center; }
.article-column { min-width: 0; }
.article-outline { position: sticky; top: 32px; width: 180px; max-height: calc(100svh - 64px); overflow-y: auto; color: var(--muted); scrollbar-width: thin; }
.article-outline summary { display: flex; align-items: center; justify-content: space-between; padding: 0 0 13px; border-bottom: 1px solid var(--line); color: var(--ink); font-size: .72rem; font-weight: 750; letter-spacing: .12em; list-style: none; text-transform: uppercase; cursor: pointer; }
.article-outline summary::-webkit-details-marker { display: none; }
.article-outline summary::after { content: "−"; color: var(--accent); font-size: 1rem; font-weight: 500; }
.article-outline:not([open]) summary::after { content: "+"; }
.article-outline ol { margin: 17px 0 0; padding: 0; list-style: none; }
.article-outline li { margin: 0 0 11px; line-height: 1.45; }
.article-outline .outline-level-3 { padding-left: 13px; }
.article-outline a { display: block; font-size: .76rem; text-decoration: none; transition: color 160ms ease, transform 160ms ease; }
.article-outline a:hover { color: var(--ink); transform: translateX(3px); }
.article-outline summary:focus-visible, .article-outline a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.article-header { margin-bottom: clamp(54px, 7vw, 84px); padding-bottom: clamp(42px, 5vw, 64px); border-bottom: 1px solid var(--line); }
.back-link { display: inline-block; margin-bottom: clamp(44px, 6vw, 72px); color: var(--muted); font-size: .78rem; text-decoration: none; }
.article-header h1 { margin: 0 0 28px; overflow-wrap: anywhere; font-family: var(--serif); font-size: clamp(2.6rem, 4.2vw, 4rem); font-weight: 500; line-height: 1.08; letter-spacing: -.035em; }
.article-description { max-width: 680px; color: var(--muted); font-size: 1.05rem; line-height: 1.75; }
.article-body { min-width: 0; overflow-wrap: break-word; font-family: var(--serif); font-size: clamp(1.04rem, 1.5vw, 1.18rem); line-height: 1.92; }
.article-body > :first-child { margin-top: 0; }
.article-body h2, .article-body h3 { scroll-margin-top: 30px; line-height: 1.25; }
.article-body h2 { margin: 2.5em 0 .7em; font-size: 1.9em; }
.article-body h3 { margin: 2em 0 .6em; font-size: 1.35em; }
.article-body a { color: var(--accent); text-underline-offset: 3px; }
.article-body img { display: block; max-width: 100%; height: auto; margin: 2.4em auto; }
.article-body blockquote { margin: 2em 0; padding: .2em 0 .2em 1.5em; border-left: 3px solid var(--accent); color: var(--muted); }
.article-body pre { max-width: 100%; overflow-x: auto; padding: 24px; color: #e8edf2; background: #111820; font-family: "SFMono-Regular", Consolas, monospace; font-size: .84em; line-height: 1.65; -webkit-overflow-scrolling: touch; }
.article-body code:not(pre code) { padding: .12em .35em; background: rgba(17,24,32,.08); font-family: "SFMono-Regular", Consolas, monospace; font-size: .88em; }
.article-body table { display: block; max-width: 100%; overflow-x: auto; width: 100%; border-collapse: collapse; -webkit-overflow-scrolling: touch; }
.article-body th, .article-body td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; }
.article-body .math.display, .article-body mjx-container[display="true"] { display: block; max-width: 100%; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
.article-end { display: flex; justify-content: space-between; margin: 100px 0 0; padding-top: 25px; border-top: 2px solid var(--ink); }
.article-end p { margin: 0; color: var(--muted); text-transform: uppercase; font-size: .7rem; letter-spacing: .12em; }
.article-end a { color: var(--accent); font-weight: 700; text-decoration: none; }

.site-footer { display: flex; justify-content: space-between; padding: 30px clamp(22px, 5vw, 76px); border-top: 1px solid var(--line); color: var(--muted); font-size: .76rem; }
.site-footer p { margin: 0; }
.site-footer div { display: flex; gap: 24px; }
.site-footer a { text-decoration: none; }
.reading-progress { position: fixed; z-index: 30; top: 0; left: 0; width: 0; height: 3px; background: var(--accent); }
.reveal { opacity: 1; transform: none; }

@keyframes hero-in { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }
@media (max-width: 1100px) {
  .article-main.has-outline { width: min(840px, calc(100% - 44px)); grid-template-columns: minmax(0, 1fr); gap: 38px; }
  .article-outline { position: static; width: 100%; max-height: none; }
  .article-outline ol { columns: 2; column-gap: 32px; }
  .article-outline li { break-inside: avoid; }
}

@media (max-width: 760px) {
  .site-header { height: 64px; padding-inline: 18px; }
  .site-header nav { gap: 14px; }
  .hero { min-height: calc(100svh - 64px); align-items: center; }
  .edition { bottom: 24px; }
  .section-heading, .post-row { grid-template-columns: 1fr auto; }
  .section-heading p, .post-row time { grid-column: 1 / -1; }
  .post-row > div { grid-column: 1; }
  .row-arrow { grid-column: 2; }
  .legacy-band { grid-template-columns: 1fr; align-items: start; }
  .article-main { width: calc(100% - 32px); padding: 52px 0 64px; }
  .article-main.has-outline { width: calc(100% - 32px); gap: 34px; }
  .article-outline ol { columns: 1; }
  .article-header { margin-bottom: 46px; padding-bottom: 38px; }
  .back-link { margin-bottom: 38px; }
  .article-header h1 { font-size: clamp(2.2rem, 11vw, 3.35rem); line-height: 1.02; }
  .article-body { font-size: 1rem; line-height: 1.8; }
  .article-body h2 { font-size: 1.65em; }
  .article-body blockquote { margin: 1.6em 0; padding-left: 1em; }
  .article-body pre { margin-inline: 0; padding: 18px; font-size: .78em; }
  .article-body table { font-size: .88em; }
  .article-end { margin: 70px 0 0; gap: 30px; }
  .site-footer { flex-wrap: wrap; gap: 14px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
