@font-face {
  font-family: Inter;
  src: url('../fonts/inter-latin.woff2') format('woff2');
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: 'B612 Mono';
  src: url('../fonts/b612-mono-latin.woff2') format('woff2');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
.writing-page { --sans: Graphik, Inter, Arial, sans-serif; font-size: 16px; line-height: 1.8; }
.writing-page .site-main, .writing-page .header-inner, .writing-page .footer-inner { max-width: 840px; }
.writing-page .site-header { font-size: 14px; }
.writing-page .page-heading { margin-block: 8px 36px; }
.writing-page .page-heading h1 { max-width: 700px; font-size: clamp(1.8rem, 4vw, 2.4rem); font-weight: 500; letter-spacing: -.035em; line-height: 1.22; }
.writing-page .series-label { margin-top: 28px; color: var(--accent); font-size: .86rem; font-weight: 500; }
.writing-page .series-label + .post-date { margin-top: 8px; }
.writing-page .post-date { font-size: .8rem; }
.writing-page .page-heading .post-byline { color: var(--muted); font-size: .84rem; }
.writing-page .prose h2 { font-size: 1.3rem; font-weight: 600; margin-top: 2.6em; letter-spacing: -.02em; }
.writing-page .prose h3 { font-size: 1.05rem; }
.writing-page .prose code, .figure-readout dd, .chain-controls output { font-family: 'B612 Mono', ui-monospace, monospace; font-weight: 400; }
.writing-page .prose table { font-size: .86rem; }
.writing-page .prose th { font-weight: 600; background: #f8fafc; }
.writing-page .prose td, .writing-page .prose th { padding: 10px 12px; }
.writing-series { margin-top: 36px; }
.prose .writing-series h2 { margin-top: 8px; }
.prose .writing-series .writing-list { margin-top: 32px; }
.writing-series .writing-list h3 { font-size: 1.05rem; font-weight: 500; }
.prose .archive-note { margin-top: 32px; font-size: .88rem; }
.chapter-nav { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-block: 26px 40px; padding-block: 18px; border-block: 1px solid var(--line); font-size: .85rem; }
.prose .robotics-figure { margin: 28px 0 32px; padding: 22px; border: 1px solid #dce3eb; border-radius: 4px; background: #fff; }
.figure-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 12px; font-size: .92rem; line-height: 1.5; }
.figure-number { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.figure-heading strong { font-weight: 600; }
.figure-kind { margin-left: auto; color: var(--muted); font-size: .72rem; }
.robotics-figure svg { display: block; width: 100%; height: auto; overflow: visible; }
.robot-model-photo img { display: block; width: 100%; height: auto; margin-bottom: 16px; }
.response-figure img { display: block; width: 100%; height: auto; margin-block: 18px; }
.motion-controls { display: flex; flex-wrap: wrap; gap: 12px 22px; align-items: center; margin-bottom: 16px; font-size: .8rem; }
.model-mosaic { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 14px; margin-bottom: 24px; }
.prose .robot-model-card { display: flex; flex-direction: column; align-items: flex-start; padding: 12px; background: #f6f8fb; color: var(--ink); text-decoration: none; line-height: 1.45; }
.robot-model-card:hover .model-name { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.robot-model-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.robot-model-card img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; }
.model-category { margin-top: 8px; font-size: .68rem; color: #596779; }
.model-name { margin-top: 4px; font-size: .8rem; }
.model-collection { margin-bottom: 22px; font-size: .85rem; }
.model-collection summary { cursor: pointer; color: var(--accent); padding-block: 10px; }
.model-collection .model-mosaic { margin-top: 16px; }
.robotics-figure .anatomy-diagram { max-width: 620px; margin: 12px auto 0; }
.robotics-figure svg text { fill: #334155; font: 16px var(--sans); }
.robotics-figure svg .svg-note { fill: #596779; font-size: 13px; }
.robotics-figure svg .svg-target { fill: #9a5600; font-size: 14px; }
.diagram-guide { fill: none; stroke: #94a3b8; stroke-width: 1.3; }
.angle-arc { fill: none; stroke: #00356b; stroke-width: 1.3; }
.joint-mark circle { fill: #00356b; stroke: #fff; stroke-width: 2; }
.joint-mark .joint-halo { fill: transparent; stroke: transparent; }
.joint-mark.is-selected .joint-halo { fill: #d9e5f2; stroke: #00356b; stroke-width: 1; }
.joint-mark text { fill: white !important; text-anchor: middle; font-size: 14px !important; }
.prose .interaction-hint { font-size: .78rem; color: #596779; line-height: 1.6; margin-block: 10px; }
.joint-key { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-block: 12px 22px; }
.robotics-figure button { min-height: 44px; font: inherit; cursor: pointer; color: var(--ink); border: 1px solid #ccd5df; border-radius: 3px; background: white; }
.robotics-figure button:hover { background: #f1f5fa; }
.robotics-figure button[aria-pressed='true'] { background: #f1f5fa; border-color: var(--accent); }
.robotics-figure button:focus-visible, .robotics-figure input:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.joint-key button { display: block; width: 100%; padding: 10px 12px; text-align: left; line-height: 1.5; }
.joint-key button:disabled { cursor: default; opacity: 1; }
.joint-key-title { display: flex; align-items: center; gap: 10px; font-size: .86rem; }
.joint-key-title > span { color: var(--accent); font-size: .8rem; }
.joint-key code { padding: 0; background: none; font-size: .78rem; }
.joint-key button > span:last-child { display: block; margin-top: 3px; color: #596779; font-size: .77rem; }
.robotics-figure figcaption { padding-top: 16px; border-top: 1px solid var(--line); font-size: .8rem; line-height: 1.7; color: #596779; }
.robotics-figure figcaption strong { font-weight: 500; color: #334155; }
.chain-layout, .command-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 12px; align-items: center; margin-block: 18px; }
.chain-controls label { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 10px; font-size: .8rem; }
.chain-controls output { color: var(--accent); }
.chain-controls input { display: block; width: 100%; height: 44px; margin: 4px 0 14px; accent-color: var(--accent); cursor: pointer; }
.robotics-figure .text-button { padding: 2px 0; border: 0; color: var(--accent); font-size: .8rem; background: transparent; text-decoration: underline; text-underline-offset: 3px; }
.figure-readout { margin: 18px 0 0; font-size: .8rem; }
.figure-readout > div + div { margin-top: 10px; }
.figure-readout dt { color: #596779; }
.figure-readout dd { margin: 0; color: var(--accent); font-size: .82rem; }
.figure-readout dd.target-value { color: #9a5600; }
.command-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.command-buttons button { padding: 8px 12px; font-size: .78rem; }
.command-layout { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.command-layout .figure-readout dd { font-family: var(--sans); }
.figure-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: .75rem; }
.figure-legend span { display: inline-flex; align-items: center; gap: 8px; }
.figure-legend i { width: 24px; border-top: 3px solid var(--accent); }
.figure-legend .target-swatch { border-top: 3px dashed #9a5600; }
.prose .command-explanation { background: #f8fafc; margin-bottom: 18px; padding: 12px 14px; font-size: .85rem; line-height: 1.65; }
.concept-flow { display: flex; align-items: center; gap: 12px; margin-block: 28px; padding-block: 20px; border-block: 1px solid var(--line); }
.concept-flow > div { flex: 1; align-self: stretch; display: flex; flex-direction: column; }
.concept-flow strong { font-size: .87rem; font-weight: 600; }
.concept-flow > div > span:last-child { margin-top: 5px; color: #596779; font-size: .8rem; line-height: 1.6; }
.flow-arrow { color: #64748b; }
.understanding-check { margin-block: 28px; padding: 18px 20px; background: #f1f5fa; font-size: .9rem; }
.prose .understanding-check p { margin: 14px 0 0; }
[hidden] { display: none !important; }
@media (max-width: 600px) {
  .model-mosaic { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .prose .robot-model-card { padding: 8px; }
  .writing-page { font-size: 15px; }
  .prose .robotics-figure { padding: 16px; margin-inline: -4px; }
  .figure-kind { width: 100%; margin-left: 28px; }
  .chain-layout, .command-layout { grid-template-columns: 1fr; gap: 0; }
  .chain-layout svg, .command-layout svg { max-width: 440px; margin-inline: auto; }
  .chain-controls { padding: 0 6px 12px; }
  .chain-controls label { font-size: .88rem; }
  .figure-readout { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
  .figure-readout > div + div { margin-top: 0; }
  .concept-flow { flex-direction: column; align-items: stretch; gap: 12px; }
  .concept-flow > div { display: flex; flex-direction: column; }
  .flow-arrow { transform: rotate(90deg); align-self: center; }
}
@media (max-width: 390px) {
  .joint-key { grid-template-columns: 1fr; }
  .figure-readout dd { font-size: .77rem; }
}
@media print {
  .motion-controls { display: none !important; }
  .writing-page { font-size: 11pt; }
  [data-interactive-only], .chapter-nav { display: none !important; }
  .prose .robotics-figure { break-inside: avoid; }
  .chain-layout, .command-layout { grid-template-columns: 1.5fr 1fr; }
  .joint-key button { border-color: #ccc; }
}
