*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: Georgia, "Times New Roman", serif;
  background: #fff;
  color: #000;
  line-height: 1.8;
  font-size: 16px;
}

/* ── Nav ── */
nav {
  background: #fff;
  border-bottom: 1px solid #000;
  padding: 0 32px;
  display: flex;
  align-items: center;
  gap: 28px;
  height: 52px;
  position: sticky;
  top: 0;
  z-index: 100;
}

nav a {
  color: #000;
  text-decoration: none;
  font-size: 0.85rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}

nav a:first-child {
  font-weight: 700;
  margin-right: 8px;
}

nav a:hover {
  border-bottom-color: #000;
}

/* ── Article wrapper ── */
article {
  max-width: 720px;
  margin: 56px auto;
  padding: 0 24px 80px;
}

/* ── Headings ── */
h1 { font-size: 2rem;    font-weight: normal; line-height: 1.2; margin-bottom: 24px; letter-spacing: -0.3px; }
h2 { font-size: 1.35rem; font-weight: normal; line-height: 1.3; margin-top: 52px; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px solid #000; }
h3 { font-size: 1.1rem;  font-weight: bold;   margin-top: 36px; margin-bottom: 10px; }
h4 { font-size: 1rem;    font-weight: bold;   margin-top: 28px; margin-bottom: 8px;  }

/* ── Body text ── */
p { margin-bottom: 18px; }

strong { font-weight: bold; }

a { color: #000; text-decoration: underline; }
a:hover { color: #444; }

/* ── Lists ── */
ul, ol {
  margin: 0 0 18px 1.5rem;
}
li { margin-bottom: 6px; }

/* ── Horizontal rule ── */
hr {
  border: none;
  border-top: 1px solid #000;
  margin: 40px 0;
}

/* ── Inline code ── */
code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.875em;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 2px;
  padding: 2px 5px;
  color: #000;
}

/* ── Code blocks ── */
pre {
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 2px;
  padding: 20px;
  overflow-x: auto;
  margin-bottom: 24px;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.875rem;
  line-height: 1.6;
}

/* ── Tables ── */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.9rem;
}

thead {
  background: #f5f5f5;
}

th {
  text-align: left;
  padding: 10px 16px;
  font-weight: normal;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 2px solid #000;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

td {
  padding: 10px 16px;
  border-bottom: 1px solid #ddd;
  vertical-align: top;
}

tr:last-child td { border-bottom: none; }

td code { font-size: 0.82em; }

/* ── Block quotes ── */
blockquote {
  border-left: 3px solid #000;
  margin: 24px 0;
  padding: 4px 20px;
  color: #555;
  font-style: italic;
}

/* ── Images ── */
img {
  max-width: 100%;
  border: 1px solid #ddd;
  display: block;
  margin: 28px auto;
}

/* ── Math display blocks ── */
.MathJax_Display, mjx-container[display="true"] {
  overflow-x: auto;
  padding: 8px 0;
}
