:root {
  --bg: #fafafa;
  --text: #18181b;
  --muted: #71717a;
  --border: #e4e4e7;
  --card: #ffffff;
  --accent: #2563eb;
  --accent-soft: #eff6ff;
  --code-bg: #f4f4f5;
  --math-bg: #fbfcff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.page {
  max-width: 820px;
  margin: 0 auto;
  padding: 44px 24px 80px;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 56px;
  font-size: 15px;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
}

.nav a:hover {
  color: var(--text);
}

.hero {
  margin-bottom: 64px;
}

h1 {
  font-size: 44px;
  line-height: 1.1;
  margin: 0 0 16px;
}

h2 {
  font-size: 24px;
  margin-top: 40px;
  margin-bottom: 16px;
}

h3 {
  margin-top: 0;
  margin-bottom: 8px;
}

.subtitle {
  font-size: 20px;
  color: var(--muted);
  max-width: 680px;
}

.actions,
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.button {
  display: inline-block;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  padding: 9px 14px;
  text-decoration: none;
}

.button:hover {
  background: #1d4ed8;
}

.button.secondary {
  background: transparent;
  color: var(--accent);
}

.button.secondary:hover {
  background: var(--accent-soft);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  margin: 16px 0;
}

.card p {
  margin-bottom: 8px;
}

.card h2,
.card h3 {
  margin-top: 0;
}

.post-card h3 a {
  color: var(--text);
  text-decoration: none;
}

.post-card h3 a:hover {
  color: var(--accent);
}

a {
  color: var(--accent);
}

.links a {
  font-weight: 600;
}

.eyebrow {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  margin-top: 0;
  text-transform: uppercase;
}

.section-link {
  margin-top: 24px;
}

.section-intro {
  color: var(--muted);
  margin-top: -4px;
  max-width: 680px;
}

.muted {
  color: var(--muted);
  font-size: 14px;
}

.focus-list {
  padding-left: 20px;
}

.focus-list li {
  margin-bottom: 10px;
}

.writing-section {
  margin-top: 40px;
}

.series-list {
  padding-left: 28px;
}

.series-list > li {
  padding: 0 0 24px 8px;
}

.series-list > li + li {
  border-top: 1px solid var(--border);
  padding-top: 24px;
}

.series-list > li::marker {
  color: var(--muted);
  font-weight: 600;
}

.series-list p:last-child {
  margin-bottom: 0;
}

.post-header {
  border-bottom: 1px solid var(--border);
  margin-bottom: 40px;
  padding-bottom: 28px;
}

.post-meta {
  color: var(--muted);
  font-size: 14px;
  margin-top: -4px;
}

.post-page {
  max-width: 880px;
}

.post-nav-top {
  margin-bottom: 48px;
}

.post-content {
  margin-inline: auto;
  max-width: 740px;
}

.post-content p {
  font-size: 17px;
}

.post-content section {
  margin-top: 40px;
}

.post-content h2 {
  margin-top: 0;
}

.post-section {
  border-top: 1px solid var(--border);
  padding-top: 28px;
}

.post-header + .post-section {
  border-top: 0;
  padding-top: 0;
}

.post-content ul {
  padding-left: 20px;
}

.post-content li {
  margin-bottom: 8px;
}

.question-list {
  margin-top: 12px;
}

.table-wrap {
  margin: 18px 0;
  overflow-x: auto;
}

.post-content table {
  border-collapse: collapse;
  font-size: 15px;
  min-width: 560px;
  width: 100%;
}

.post-content th,
.post-content td {
  border: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.post-content th {
  background: var(--accent-soft);
  color: #1f2937;
  font-weight: 700;
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.55;
  overflow-x: auto;
  padding: 16px;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.post-content p code,
.post-content li code {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: #27272a;
  font-size: 0.92em;
  padding: 1px 5px;
}

.code-sample {
  background: #18181b;
  border: 1px solid #3f3f46;
  border-radius: 8px;
  margin: 18px 0;
  overflow: hidden;
}

.code-sample-header {
  align-items: center;
  background: #27272a;
  color: #d4d4d8;
  display: flex;
  flex-wrap: wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  gap: 4px 16px;
  justify-content: space-between;
  padding: 8px 14px;
}

.code-sample pre {
  background: #18181b;
  border: 0;
  border-radius: 0;
  color: #f4f4f5;
  margin: 0;
}

.math-block {
  background: var(--math-bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  color: #111827;
  margin: 18px 0;
  overflow-x: auto;
  padding: 18px 20px;
}

.math-block mjx-container[jax="SVG"][display="true"] {
  margin: 0;
}

.math-block.equation-numbered {
  align-items: center;
  column-gap: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  overflow-x: visible;
}

.equation-numbered .equation-content {
  min-width: 0;
  overflow-x: auto;
}

.equation-numbered .equation-number {
  white-space: nowrap;
}

.post-figure {
  margin: 24px 0;
}

.post-figure img {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: block;
  height: auto;
  max-width: 100%;
}

.post-figure figcaption {
  color: var(--muted);
  font-size: 14px;
  margin-top: 8px;
}

.interactive-breakout {
  margin: 24px 0 0 50%;
  transform: translateX(-50%);
  width: min(1180px, calc(100vw - 48px));
}

.score-playground-frame {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: block;
  min-height: 920px;
  width: 100%;
}

.posterior-score-playground-frame {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: block;
  min-height: 1040px;
  width: 100%;
}

.references {
  padding-left: 20px;
}

.post-nav {
  margin-top: 40px;
}

.footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
  margin-top: 64px;
  padding-top: 24px;
}

.footer p {
  margin: 0 0 12px;
}

.footer .links {
  margin-top: 0;
}

.footer .links a {
  color: var(--muted);
  font-weight: 500;
  text-decoration: none;
}

.footer .links a:hover {
  color: var(--accent);
}

@media (max-width: 560px) {
  .page {
    padding: 32px 18px 64px;
  }

  .nav {
    gap: 14px;
    margin-bottom: 40px;
  }

  h1 {
    font-size: 36px;
  }

  .subtitle {
    font-size: 18px;
  }

  .card {
    padding: 18px;
  }

  .interactive-breakout {
    width: calc(100vw - 36px);
  }

  .score-playground-frame {
    min-height: 1600px;
  }

  .posterior-score-playground-frame {
    min-height: 1460px;
  }

  .footer {
    margin-top: 48px;
  }
}
