/* Actuator notes — shared stylesheet. No build step, no external assets (Archivo is self-hosted in /fonts, SIL OFL). */
@font-face {
  font-family: "Archivo"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/archivo-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Archivo"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/archivo-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Archivo"; font-style: italic; font-weight: 100 900; font-display: swap;
  src: url("fonts/archivo-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Archivo"; font-style: italic; font-weight: 100 900; font-display: swap;
  src: url("fonts/archivo-italic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f4f4f2;
  --ink: #111111;
  --ink-2: #3d3d3d;
  --muted: #7b7b78;
  --line: #111111;        /* structural hairlines, drawn in ink */
  --line-soft: #d6d6d2;   /* secondary rules */
  --accent: #e4551c;      /* the one signal colour */
  --accent-ink: #c2420f;
  --accent-soft: #fdebe3;
  --warn-soft: #fdebe3;
  --warn: #c2420f;
  --ok: #1f9a66;
  /* series: s1 blue (south), s8 red (north), s2 orange (phase A), s3 green (phase B), s7 violet (phase C) */
  --s1: #1b5fb4; --s2: #e4551c; --s3: #1f9a66; --s4: #c98a00;
  --s5: #d0588a; --s6: #2a7d2a; --s7: #6f5bd6; --s8: #d33a2f;
  --radius: 0px;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --serif: "STIX Two Text", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #131313; --surface: #131313; --surface-2: #1f1f1f;
    --ink: #ececea; --ink-2: #c6c6c2; --muted: #8d8d89;
    --line: #ececea; --line-soft: #353535;
    --accent: #ff7a45; --accent-ink: #ff9468; --accent-soft: #3a2218;
    --warn-soft: #3a2218; --warn: #ff9468; --ok: #3cc48f;
    --s1: #5a9bea; --s2: #ff7a45; --s3: #3cc48f; --s4: #e0a63a;
    --s5: #e07aa8; --s6: #4fc14f; --s7: #a497f0; --s8: #f0665b;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #131313; --surface: #131313; --surface-2: #1f1f1f;
  --ink: #ececea; --ink-2: #c6c6c2; --muted: #8d8d89;
  --line: #ececea; --line-soft: #353535;
  --accent: #ff7a45; --accent-ink: #ff9468; --accent-soft: #3a2218;
  --warn-soft: #3a2218; --warn: #ff9468; --ok: #3cc48f;
  --s1: #5a9bea; --s2: #ff7a45; --s3: #3cc48f; --s4: #e0a63a;
  --s5: #e07aa8; --s6: #4fc14f; --s7: #a497f0; --s8: #f0665b;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 16.5px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
code, .mono { font-family: var(--mono); font-size: 0.92em; }
h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 .5rem; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.2rem, 4.6vw, 3.4rem); font-weight: 500; letter-spacing: -0.025em; line-height: 1.04; }
h2 { font-size: 1.45rem; font-weight: 500; margin-top: 2.75rem; padding-top: 0; border-top: 0; }
h3 { font-size: 1.05rem; font-weight: 600; margin-top: 1.7rem; }
p, ul, ol { margin: 0 0 1rem; }
li { margin-bottom: .35rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
small, .small { font-size: .86rem; color: var(--ink-2); }
.muted { color: var(--muted); }
sub, sup { line-height: 0; }
b, strong { font-weight: 600; }

/* Layout: sidebar + content (reference pages) */
.layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  border-right: 1px solid var(--line); background: var(--surface);
  padding: 20px 16px 32px; font-size: .92rem;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 1rem; margin-bottom: 18px; color: var(--ink); text-decoration: none; }
.brand svg { width: 22px; height: 22px; }
.nav-group { margin: 14px 0 4px; font-size: .78rem; color: var(--muted); }
.nav a { display: block; padding: 6px 10px; color: var(--ink-2); text-decoration: none; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a.active { border-left: 2px solid var(--accent); padding-left: 8px; color: var(--ink); font-weight: 500; }
.nav .num { display: inline-block; width: 1.5em; color: var(--muted); font-variant-numeric: tabular-nums; }
.sidebar-foot { margin-top: 20px; padding-top: 12px; border-top: 1px solid var(--line-soft); display: flex; gap: 8px; align-items: center; }
.theme-btn { border: 1px solid var(--line); background: none; border-radius: 0; padding: 4px 10px; font-size: .84rem; }

.content { padding: 28px 16px 80px; }
.page { width: min(820px, 100%); margin: 0 auto; }
.page.wide { width: min(1040px, 100%); }
.eyebrow { font-size: .88rem; text-transform: none; letter-spacing: 0; color: var(--muted); font-weight: 400; margin-bottom: .5rem; }
.lede { font-size: 1.22rem; line-height: 1.42; color: var(--ink-2); margin-bottom: 1.6rem; }
.toc { font-size: .9rem; color: var(--ink-2); border: 1px solid var(--line); padding: 12px 18px; margin: 0 0 1.5rem; }
.toc ol { margin: 0; padding-left: 1.2rem; columns: 2; column-gap: 24px; }
.toc li { break-inside: avoid; }
@media (max-width: 560px) { .toc ol { columns: 1; } }

/* Mobile top bar (reference pages) */
.topbar { display: none; }
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); display: none; }
  .sidebar.open { display: block; }
  .topbar { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 20; }
  .topbar .brand { margin: 0; }
  .menu-btn { border: 1px solid var(--line); background: none; padding: 5px 10px; }
}

/* Components */
.card { background: var(--surface); border: 1px solid var(--line); padding: 18px 20px; margin: 1.2rem 0; }
.card h3 { margin-top: 0; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin: 1rem 0; }
.grid .card { margin: 0; }
.callout { border: 1px solid var(--line); background: none; padding: 16px 18px 10px; margin: 1.6rem 0; position: relative; }
.callout.warn { border-color: var(--line); }
.callout .lbl { position: absolute; top: -11px; left: 14px; background: var(--ink); color: var(--bg); font-size: .76rem; text-transform: none; letter-spacing: 0; font-weight: 500; padding: 3px 8px; line-height: 1.3; display: inline-block; margin: 0; }
.callout.warn .lbl { background: var(--accent); color: #fff; }
.formula { font-family: var(--serif); font-size: 1.3rem; text-align: center; padding: 14px 44px 14px 14px; margin: 1.1rem 0; background: none; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); overflow-x: auto; position: relative; }
.formula i { font-style: italic; }
.formula .eq-id { position: absolute; right: 0; top: 50%; transform: translateY(-50%); float: none; font-family: var(--sans); font-size: .8rem; color: var(--muted); }
.frac { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; line-height: 1.05; margin: 0 .15em; }
.frac > span:first-child { border-bottom: 1px solid currentColor; padding: 0 .2em; }
.frac > span:last-child { padding: 0 .2em; }

table { width: 100%; border-collapse: collapse; font-size: .9rem; margin: 1rem 0 1.4rem; background: none; border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums lining-nums; }
th, td { padding: 8px 10px 8px 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line-soft); }
th { font-size: .84rem; text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--ink); background: none; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: 0; }
td:first-child { color: var(--ink-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; margin: 1rem 0; }
.table-scroll table { margin: 0; min-width: 640px; }

figure { margin: 1.5rem 0 1.8rem; }
figure svg { max-width: 100%; height: auto; display: block; margin: 0 auto; }
figcaption { font-size: .88rem; color: var(--ink-2); margin-top: .6rem; text-align: left; }
figcaption b { font-weight: 500; color: var(--ink); margin-right: .35em; }
.diagram { color: var(--ink); background: var(--surface); border: 1px solid var(--line); padding: 12px; }

/* Interactive blocks */
.interactive { background: var(--surface); border: 1px solid var(--line); padding: 0; margin: 1.6rem 0 1.9rem; }
.interactive > .ititle { font-weight: 500; display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.interactive > .ititle::before { content: ""; width: 10px; height: 10px; background: var(--accent); font-size: 0; color: transparent; flex: none; }
.interactive > .ihelp { font-size: .92rem; color: var(--ink-2); margin: 14px 16px 12px; }
.interactive > :not(.ititle) { margin-left: 16px; margin-right: 16px; }
.interactive > :last-child { margin-bottom: 16px; }
.controls { display: grid; gap: 10px 18px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin: 10px 0 12px; }
.ctl label { display: block; font-size: .84rem; color: var(--ink-2); margin-bottom: 2px; }
.ctl output { float: right; color: var(--ink); font-size: .84rem; font-variant-numeric: tabular-nums; }
.ctl input[type=range] { width: 100%; accent-color: var(--accent); margin: 0; }
.ctl select { width: 100%; padding: 4px 6px; border: 1px solid var(--line-soft); background: var(--surface); border-radius: 0; }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.btn { border: 1px solid var(--line-soft); background: none; border-radius: 0; padding: 5px 12px; font-size: .86rem; color: var(--ink-2); }
.btn:hover { border-color: var(--line); color: var(--ink); }
.btn.on, .btn:active { background: none; border-color: var(--accent); color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.readout { display: grid; gap: 8px 14px; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.readout .stat { background: none; border-radius: 0; padding: 0; }
.readout .stat .k { font-size: .78rem; text-transform: none; letter-spacing: 0; color: var(--muted); }
.readout .stat .v { font-family: var(--sans); font-size: 1.25rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.readout .stat .u { font-size: .76rem; font-weight: 400; color: var(--muted); margin-left: 3px; }
.plot { width: 100%; height: auto; display: block; }
.plot .grid line { stroke: var(--line-soft); stroke-width: 1; }
.plot .axis line, .plot .axis path { stroke: var(--line-soft); stroke-width: 1; }
.plot text { fill: var(--ink-2); font-size: 11px; font-family: var(--sans); }
.plot .lbl { fill: var(--ink); font-size: 12px; }
.plot .series { fill: none; stroke-width: 2; stroke-linejoin: round; }
.plot .marker { stroke: var(--surface); stroke-width: 2; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .82rem; color: var(--ink-2); margin-top: 6px; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 0; background: var(--c); margin-right: 6px; vertical-align: -1px; }
.anim { color: var(--ink); }
.anim .stator { fill: var(--surface-2); stroke: var(--line-soft); }

/* Quiz */
.quiz { background: none; border: 1px solid var(--line); padding: 14px 18px; margin: 1.4rem 0; }
.quiz .q { font-weight: 500; margin-bottom: 8px; }
.quiz .opts button { display: block; width: 100%; text-align: left; margin: 4px 0; padding: 7px 10px; border: 1px solid var(--line-soft); background: none; border-radius: 0; }
.quiz .opts button.right { border-color: var(--ok); }
.quiz .opts button.wrong { border-color: var(--s8); }
.quiz .expl { font-size: .88rem; color: var(--ink-2); margin-top: 8px; display: none; }
.quiz .expl.show { display: block; }

/* Glossary term */
abbr.term, .term { text-decoration: underline dotted var(--muted); cursor: help; text-underline-offset: 3px; }

/* Pager */
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: .92rem; }
.pager a { display: block; padding: 10px 14px; border: 1px solid var(--line-soft); background: none; max-width: 48%; text-decoration: none; }
.pager a:hover { border-color: var(--line); }
.pager a small { display: block; color: var(--muted); font-size: .76rem; }
.pager a.next { margin-left: auto; text-align: right; }

/* Source footnotes */
.src { font-size: .8rem; color: var(--muted); }
.src a { color: var(--muted); text-decoration: underline dotted; }
.refs { font-size: .9rem; }
.refs li { margin-bottom: .5rem; }

/* Home hero */
.hero { padding: 24px 0 8px; }
.hero h1 { font-size: clamp(2.4rem, 5.2vw, 4rem); }
.pathcard { display: block; color: inherit; background: none; border: 1px solid var(--line-soft); padding: 16px 18px; height: 100%; text-decoration: none; }
.pathcard:hover { border-color: var(--line); }
.pathcard .n { color: var(--muted); font-size: .84rem; font-variant-numeric: tabular-nums; }
.pathcard h3 { margin: 4px 0 6px; font-size: 1.05rem; }
.pathcard p { font-size: .88rem; color: var(--ink-2); margin: 0; }
.tag { display: inline-block; font-size: .76rem; padding: 1px 8px; border-radius: 0; background: none; color: var(--ink-2); border: 1px solid var(--line-soft); margin-right: 4px; }
.tag.int { border-color: var(--accent); color: var(--ink); }
kbd { font-family: var(--mono); font-size: .8em; border: 1px solid var(--line-soft); border-bottom-width: 2px; border-radius: 0; padding: 0 5px; background: none; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
@media (max-width: 640px) { .two { grid-template-columns: 1fr !important; } }
