/* Shared style for robotics101 concept explainers. Matches the handout design. */
:root {
  --red: #C8102E; --red-dark: #9E0C24; --navy: #102A43; --ink: #1A1D21;
  --body: #3F4651; --muted: #6B7280; --rule: #DDE1E6; --panel: #F4F5F7;
  --sans: Arial, "Liberation Sans", Helvetica, sans-serif;
  --mono: "Liberation Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--sans); color: var(--body); line-height: 1.6; background: #fff; }
a { color: var(--red); }
:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }
.band { background: var(--red); color: #fff; font-size: .85rem; }
.band .wrap { display: flex; justify-content: space-between; align-items: center; min-height: 48px; gap: 1rem; }
.band a { color: #fff; text-decoration: none; font-weight: 700; letter-spacing: .04em; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 24px; }
h1 { color: var(--ink); font-size: clamp(1.8rem, 4vw, 2.5rem); line-height: 1.2; margin: 2.2rem 0 .4rem; }
h2 { color: var(--ink); font-size: 1.25rem; margin: 2rem 0 .5rem; }
.sub { font-size: 1.1rem; max-width: 62ch; margin: 0 0 1.6rem; }
.stage { display: grid; grid-template-columns: 1fr 300px; gap: 1.5rem; align-items: start; }
@media (max-width: 820px) { .stage { grid-template-columns: 1fr; } }
canvas { width: 100%; height: auto; display: block; background: var(--panel); border: 1px solid var(--rule); border-radius: 4px; }
.panel { background: var(--panel); border-left: 3px solid var(--navy); padding: 1rem 1.1rem; font-size: .92rem; }
.panel label { display: block; font-weight: 700; color: var(--ink); margin-top: .8rem; }
.panel label:first-child { margin-top: 0; }
.panel input[type=range] { width: 100%; accent-color: var(--red); }
.panel output { font-family: var(--mono); font-weight: 400; color: var(--body); float: right; }
.readout { font-family: var(--mono); font-size: .85rem; background: #fff; border: 1px solid var(--rule); padding: .6rem .7rem; margin-top: 1rem; white-space: pre; overflow-x: auto; }
.buttons { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
button { font: inherit; font-size: .88rem; font-weight: 700; padding: .45rem .8rem; border-radius: 4px; border: 2px solid var(--red); background: #fff; color: var(--red); cursor: pointer; }
button:hover { background: #FCEEF0; }
button.solid { background: var(--red); color: #fff; }
.notes { max-width: 70ch; margin-bottom: 3rem; }
.eq { background: var(--panel); border-left: 3px solid var(--red); padding: .2rem 1.2rem; margin: .6rem 0 1rem; overflow-x: auto; color: var(--ink); }
.eq .katex-display { margin: .8rem 0; text-align: left; }
.eq .katex-display > .katex { text-align: left; }
.katex { font-size: 1.12em; }
footer { border-top: 1px solid var(--rule); padding: 1.2rem 0; font-size: .85rem; color: var(--muted); }

/* Preview mode: used when the page is shown as a card on the home page (#preview) */
html.preview body { background: var(--panel); }
html.preview .band, html.preview h1, html.preview .sub, html.preview .panel,
html.preview .notes, html.preview footer { display: none; }
html.preview .wrap { max-width: none; padding: 0; }
html.preview .stage { display: block; }
html.preview canvas { border: 0; border-radius: 0; }
