/* Blog shared styles — serif, compact (Karpathy / Eric Jang feel) */

:root {
  --text: #1f2937;
  --text-strong: #000;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --code-bg: #f5f5f0;
  --pre-bg: #faf8f2;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: 'Charter', 'Iowan Old Style', 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: #fff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 3rem 0 2rem;
  text-align: center;
}
.site-title {
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--text-strong);
  text-decoration: none;
  letter-spacing: -0.005em;
  margin: 0;
  display: inline-block;
  transition: opacity 0.2s;
}
a.site-title:hover { opacity: 0.6; }
.site-subtitle {
  margin: 0.375rem 0 0;
  font-size: 0.9375rem;
  font-style: italic;
  color: var(--text-muted);
}
.site-subtitle a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}
.site-subtitle a:hover { color: var(--text-strong); }

/* ---------- Main ---------- */
main.container {
  padding-top: 2.5rem;
  padding-bottom: 3rem;
  flex: 1;
}

/* ---------- Post list ---------- */
.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.post-list-item {
  margin-bottom: 2rem;
}
.post-list-item:last-child { margin-bottom: 0; }
.post-list-item a {
  text-decoration: none;
  color: inherit;
  display: block;
}
.post-list-item h2 {
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--text-strong);
  margin: 0 0 0.375rem;
  line-height: 1.25;
  letter-spacing: -0.005em;
  display: inline-block;
}
.post-list-item a:hover h2 {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

/* ---------- Post meta (date + tags) ---------- */
.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.875rem;
  font-style: italic;
  color: var(--text-muted);
  margin-bottom: 0;
}
.tag { color: var(--text-muted); font-style: italic; }

/* ---------- Back link ---------- */
.back-link {
  display: inline-block;
  margin-bottom: 2rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-style: italic;
  transition: color 0.2s;
}
.back-link:hover { color: var(--text-strong); }

/* ---------- Article ---------- */
.post-article h1 {
  font-size: 2rem;
  font-weight: 400;
  color: var(--text-strong);
  margin: 0 0 0.75rem;
  line-height: 1.15;
  letter-spacing: -0.015em;
}
.post-article .post-meta {
  margin-bottom: 2rem;
}
.post-article h2 {
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--text-strong);
  margin: 2rem 0 0.625rem;
  line-height: 1.3;
  letter-spacing: -0.005em;
}
.post-article h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-strong);
  margin: 1.5rem 0 0.5rem;
  line-height: 1.35;
}
.post-article p {
  margin: 1rem 0;
  line-height: 1.6;
}
.post-article a {
  color: var(--text-strong);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-thickness 0.15s;
}
.post-article a:hover { text-decoration-thickness: 2px; }
.post-article strong { color: var(--text-strong); font-weight: 600; }
.post-article em { font-style: italic; }
.post-article code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--code-bg);
  color: var(--text-strong);
  padding: 0.05rem 0.35rem;
  border-radius: 3px;
}
.post-article pre {
  background: var(--pre-bg);
  border: 1px solid var(--border);
  padding: 0.875rem 1.125rem;
  overflow-x: auto;
  margin: 1.25rem 0;
  border-radius: 4px;
  font-size: 0.875rem;
  line-height: 1.5;
}
.post-article pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
}
.post-article ul, .post-article ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
}
.post-article li {
  margin: 0.25rem 0;
  line-height: 1.6;
}
.post-article img,
.post-article video {
  max-width: 100%;
  height: auto;
  margin: 1.5rem 0;
  display: block;
}
.post-article hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}
.post-article blockquote {
  font-style: italic;
  color: #374151;
  border-left: 2px solid var(--border);
  margin: 1.25rem 0;
  padding: 0.125rem 0 0.125rem 1rem;
}
.post-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.875rem;
}
.post-article th, .post-article td {
  border: 1px solid var(--border);
  padding: 0.4rem 0.65rem;
  text-align: left;
}
.post-article th {
  background: var(--pre-bg);
  font-weight: 600;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  text-align: center;
  font-size: 0.75rem;
  font-style: italic;
  color: var(--text-muted);
}
.site-footer p { margin: 0; }

/* ---------- Arm comparison gallery (real-robot photos) ---------- */
.arm-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  justify-content: center;
  align-items: flex-end;
  margin: 0.5rem 0 0.5rem;
}
.arm-cell {
  flex: 1 1 200px;
  max-width: 260px;
  text-align: center;
}
.arm-cell img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  object-fit: contain;
  max-height: 240px;
}
.arm-cell .arm-name {
  font-size: 0.875rem;
  color: var(--text-strong);
  margin: 0.375rem 0 0.125rem;
  line-height: 1.3;
}
.arm-cell .arm-tag {
  font-size: 0.75rem;
  font-style: italic;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.3;
}
.attribution {
  display: block;
  margin-top: 0.375rem;
  font-size: 0.6875rem;
  color: var(--text-muted);
}

/* ---------- Heavier inline arrow (for titles using ⟷) ---------- */
.arrow {
  -webkit-text-stroke: 0.5px currentColor;
  text-stroke: 0.5px currentColor;
}

/* ---------- Article subtitle (under h1) ---------- */
.post-article .subtitle {
  font-size: 1rem;
  font-style: italic;
  color: var(--text-muted);
  margin: -0.375rem 0 1.5rem;
  line-height: 1.45;
}

/* ---------- Language switcher (top of bilingual posts) ---------- */
.lang-switch {
  text-align: right;
  font-size: 0.85rem;
  font-style: italic;
  margin: 0 0 -0.25rem;
}
.lang-switch a {
  color: var(--text-muted);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.lang-switch a:hover { color: var(--text-strong); }

/* ---------- Thesis / pull-quote ---------- */
.thesis {
  margin: 1.75rem 0;
  padding: 1.125rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-size: 1rem;
  font-style: italic;
  text-align: center;
  color: var(--text-strong);
  line-height: 1.55;
}
.thesis strong { font-style: normal; }

/* ---------- Sidebar callout ---------- */
.callout {
  background: var(--pre-bg);
  border-left: 3px solid var(--text-muted);
  padding: 0.875rem 1.125rem;
  margin: 1.25rem 0;
  font-size: 0.875rem;
  line-height: 1.6;
}
.callout strong { color: var(--text-strong); }

/* ---------- Figures (SVG diagrams) ---------- */
.post-article figure {
  margin: 1.75rem auto;
  text-align: center;
}
.post-article figcaption {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.5rem;
  line-height: 1.45;
}
.post-article svg.figure {
  max-width: 100%;
  height: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px;
  box-sizing: border-box;
}

/* ---------- References ---------- */
.refs {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.55;
}
.refs li {
  margin: 0.375rem 0;
}
.refs a {
  color: var(--text-muted);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.refs a:hover { color: var(--text-strong); }

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  body { font-size: 15.5px; }
  .container { padding: 0 1rem; }
  .site-header { padding: 2.25rem 0 1.75rem; }
  .site-title { font-size: 1.25rem; }
  main.container { padding-top: 2rem; padding-bottom: 2.25rem; }
  .post-article h1 { font-size: 1.625rem; }
  .post-article h2 { font-size: 1.25rem; }
  .post-article h3 { font-size: 1.0625rem; }
  .post-list-item h2 { font-size: 1.125rem; }
}
