@font-face {
  font-family: "Ethnocentric";
  src: local("Ethnocentric"), local("Ethnocentric Regular"),
       url("../fonts/Ethnocentric-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #191b1d;
  --bg-elev: #1e2124;
  --bg-side: #141618;
  --bg-card: #22262b;
  --line: #2c3136;
  --text: #e8eaed;
  --muted: #8b949e;
  --blue: #2aa4e0;
  --blue-hover: #5bbcEa;
  --warn-bg: #2a2418;
  --warn-text: #d4a84b;
  --note-bg: #17262c;
  --note-text: #8fcfe8;
  --draft-bg: #2a1b1b;
  --draft-text: #d98989;
  --head: #145d84;
  --code-bg: #101214;
  --radius: 8px;
  --side-w: 320px;
  --toc-w: 280px;
  --main-w: 980px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-hover); text-decoration: underline; }
code, pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Cascadia Code", monospace;
  font-size: 15px;
}
code {
  background: #101214;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 6px;
  color: #d7e4ec;
}
pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
}

.code-panel {
  margin: 18px 0 26px;
  background: #161a1e;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.code-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 12px 0 16px;
  border-bottom: 1px solid var(--line);
  background: #121518;
}
.code-tab {
  display: inline-block;
  padding: 12px 14px 10px;
  margin-bottom: -1px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--muted);
  font: 650 14px/1 system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}
.code-tab.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}
.code-copy {
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #1a1e22;
  color: var(--muted);
  font: 650 12px/1 system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  letter-spacing: 0.04em;
  padding: 6px 10px;
  cursor: pointer;
}
.code-copy:hover {
  color: var(--text);
  border-color: var(--blue);
}
.code-copy.copied {
  color: var(--blue);
  border-color: var(--blue);
}
.code-panel pre,
pre.lang-java {
  margin: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 18px 20px 20px;
  overflow-x: auto;
  line-height: 1.55;
  color: #d7e4ec;
  font-size: 14.5px;
}
.tok-kw { color: #c792ea; }
.tok-lit { color: #89d185; }
.tok-com { color: #7dce82; }
.tok-str { color: #c3e88d; }
.tok-num { color: #82aaff; }
.tok-type { color: #e8eaed; }
.tok-ann { color: #82aaff; }

.layout {
  display: grid;
  grid-template-columns: calc(50vw - var(--main-w) / 2) var(--main-w) minmax(0, 1fr);
  width: 100%;
  min-height: 100vh;
}

.side {
  position: sticky;
  top: 0;
  background: var(--bg-side);
  border-right: 1px solid var(--line);
  padding: 32px 24px 48px max(28px, calc(100% - var(--side-w)));
  height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  min-width: 0;
}
.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  margin: 0 0 36px 10px;
  text-decoration: none;
  line-height: 1;
}
.brand:hover { text-decoration: none; }
.brand-swyft {
  font-family: "Ethnocentric", sans-serif;
  font-size: 42px;
  font-weight: 400;
  color: var(--blue);
  letter-spacing: 0.02em;
  line-height: 1.05;
}
.brand-robotics {
  font-family: "Ethnocentric", sans-serif;
  font-size: 18px;
  font-weight: 400;
  color: var(--text);
  letter-spacing: 0.08em;
  margin-top: 6px;
  line-height: 1.1;
}

.side h2 {
  margin: 26px 8px 10px;
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 650;
}
.side a.nav {
  display: block;
  padding: 8px 12px;
  margin: 2px 4px;
  border-radius: 4px;
  color: var(--blue);
  font-size: 16.5px;
  font-weight: 500;
}
.side a.nav:hover {
  background: #1b242c;
  color: var(--blue-hover);
  text-decoration: none;
}
.side a.nav.active {
  background: #1a2c38;
  color: var(--blue);
  font-weight: 650;
}

.main {
  min-width: 0;
  padding: 44px 36px 96px;
}
.alpha-banner {
  margin: 0 0 22px;
  padding: 14px 16px;
  border: 2px solid #d98989;
  background: #2a1b1b;
  color: var(--text);
  font-size: 16.5px;
  font-weight: 600;
  line-height: 1.45;
}
.alpha-banner strong {
  display: inline-block;
  margin-right: 10px;
  color: #d98989;
  letter-spacing: 0.12em;
  font-size: 18px;
}
.crumb {
  color: var(--muted);
  font-size: 13.5px;
  margin-bottom: 14px;
}
.crumb a { color: var(--muted); }
h1 {
  font-size: 40px;
  font-weight: 700;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}
.lead {
  color: var(--muted);
  font-size: 19px;
  margin: 0 0 26px;
}
h2 {
  font-size: 28px;
  margin: 40px 0 14px;
  font-weight: 700;
}
h3 {
  font-size: 18px;
  margin: 24px 0 8px;
  font-weight: 700;
}
p { margin: 0 0 14px; }
ul, ol { margin: 0 0 16px; padding-left: 22px; }
li { margin: 5px 0; }

.rule {
  height: 1px;
  background: var(--line);
  border: 0;
  margin: 28px 0;
}

.jump {
  margin: 36px 0 0;
}
.jump a + a {
  margin-left: 28px;
}
.next {
  margin: 48px 0 0;
  text-align: right;
  font-size: 13px;
  letter-spacing: 0.1em;
  font-weight: 650;
  color: var(--muted);
}
.next a {
  letter-spacing: 0;
  font-size: 16.5px;
  font-weight: 500;
  margin-left: 14px;
}
.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 20px 0 28px;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  color: inherit;
}
a.card:hover { text-decoration: none; border-color: var(--blue); }
.card h3 { margin: 0 0 6px; font-size: 15px; color: var(--text); }
.card p { margin: 0; color: var(--muted); font-size: 13.5px; }

.note, .warn, .draft {
  background: none;
  border: 0;
  border-radius: 0;
  border-top: 2px solid #6a727c;
  border-bottom: 2px solid #6a727c;
  padding: 16px 0;
  margin: 22px 0;
  color: var(--text);
}
.note strong, .warn strong, .draft strong {
  display: block;
  font-size: inherit;
  letter-spacing: 0.02em;
  margin: 0 0 0.55em;
  font-weight: 700;
}
.note strong, .draft strong { color: var(--text); }
.warn strong { color: var(--warn-text); }
.note p, .warn p, .draft p {
  margin: 0;
  padding-left: 1.2em;
  position: relative;
}
.note p::before,
.warn p::before,
.draft p::before {
  content: "•";
  position: absolute;
  left: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 22px;
  font-size: 15.5px;
}
th, td {
  text-align: left;
  vertical-align: top;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
}
th {
  background: var(--head);
  color: #fff;
  font-weight: 650;
}
tr:nth-child(even) td { background: #1b1e21; }
td { background: var(--bg-elev); }

figure {
  margin: 16px 0 24px;
  padding: 0;
  background: none;
  border: 0;
}
figure img {
  display: block;
  max-width: 100%;
  height: auto;
  max-height: 360px;
  margin: 0 auto;
  object-fit: contain;
  background: #fff;
}
.drawing {
  margin: 16px 0 24px;
}
.drawing > a {
  display: block;
  width: 88%;
  margin: 0 auto;
}
.drawing figcaption {
  text-align: center;
}
.drawing img {
  width: 100%;
  max-width: 100%;
  max-height: none;
  margin: 0;
  cursor: zoom-in;
}
.drawing-zoom {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 80;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #191b1d;
}
.drawing-zoom.is-open {
  display: flex;
}
.drawing-zoom a {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
}
.drawing-zoom img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100vw;
  max-height: 100vh;
  object-fit: contain;
  cursor: zoom-out;
  background: #fff;
}
.install-step {
  margin: 12px 0 20px;
}
.install-callout {
  position: relative;
  background: #111;
}
.install-callout img {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  margin: 0;
  background: #111;
}
figcaption {
  color: var(--muted);
  font-size: 14.5px;
  margin-top: 10px;
}

.orient {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 16px 0 24px;
}
.orient .frame {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px 16px;
}
.orient h3 { margin: 0 0 8px; font-size: 14px; }
.orient figure { margin: 0; }
/* Same display height, native aspect. Revert: unwrap .mount-cad in mounting.html. */
.mount-cad {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  justify-content: center;
  gap: 16px;
}
.mount-cad figure {
  margin: 0;
}
.mount-cad figure img {
  height: 350px;
  width: auto;
  max-height: none;
}

.toc {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
  justify-self: center;
  width: var(--toc-w);
  padding: 48px 8px 40px;
  color: var(--muted);
  font-size: 15.5px;
}
.toc:empty {
  padding: 0;
  pointer-events: none;
}
.toc-inner {
  border-left: 1px solid var(--line);
  padding: 0 0 14px 20px;
}
.toc h2 {
  font-size: 13px;
  letter-spacing: 0.1em;
  margin: 0 0 14px;
  color: var(--muted);
}
.toc a {
  display: block;
  color: var(--muted);
  padding: 6px 0;
}
.toc a:hover { color: var(--blue); text-decoration: none; }

.footer {
  margin-top: 48px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.led-locate {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 12px 0 20px;
  width: 100%;
}
.led-locate figure {
  margin: 0;
}
.led-callout {
  position: relative;
  background: #fff;
  aspect-ratio: 1272 / 751;
}
.led-callout img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  max-height: none;
  margin: 0;
  background: #fff;
}
.led-arrow {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.led-locate figcaption {
  margin-top: 6px;
  font-size: 13.5px;
}
.led-hint {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 15px;
}
.led-chart {
  margin: 8px 0 24px;
  border: 1px solid var(--line);
}
.led-head,
.led-row {
  display: grid;
  grid-template-columns: 1.2fr 1.1fr 1.35fr;
  gap: 20px;
  padding: 12px 16px;
  align-items: center;
}
.led-head {
  background: var(--head);
  color: #fff;
  font-weight: 650;
  font-size: 15px;
}
.led-row {
  cursor: pointer;
  border-top: 1px solid var(--line);
  background: var(--bg-elev);
}
.led-row:nth-child(odd) {
  background: #1b1e21;
}
.led-row:hover {
  background: #23282d;
}
.led-row.led-active {
  background: #1a2a33;
}
.led-state {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  font-weight: 650;
  line-height: 1.3;
}
.led-pair {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.led {
  --led: #1a1d20;
  --led-b: #2c3136;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #1a1d20;
  border: 1px solid #2c3136;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.5);
  flex-shrink: 0;
}
.led-cause,
.led-fix {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.45;
}

@keyframes led-blink {
  0%, 46% {
    background: var(--led);
    border-color: var(--led-b);
  }
  50%, 100% {
    background: #1a1d20;
    border-color: #2c3136;
  }
}
@keyframes led-flash {
  0%, 10% {
    background: var(--led);
    border-color: var(--led-b);
  }
  14%, 100% {
    background: #1a1d20;
    border-color: #2c3136;
  }
}
@keyframes led-fault-a {
  0%, 46% { background: #e32d24; border-color: #9e1e18; }
  50%, 100% { background: #e8891c; border-color: #a05e12; }
}
@keyframes led-fault-b {
  0%, 46% { background: #e8891c; border-color: #a05e12; }
  50%, 100% { background: #e32d24; border-color: #9e1e18; }
}

.led-row.led-active[data-state="off"] .led {
  background: #1a1d20;
  border-color: #2c3136;
}

.led-row.led-active[data-state="red-alt"] .led {
  --led: #e32d24;
  --led-b: #9e1e18;
  animation: led-blink .9s infinite;
}
.led-row.led-active[data-state="red-alt"] .led-r { animation-delay: .45s; }

.led-row.led-active[data-state="orange-alt"] .led {
  --led: #e8891c;
  --led-b: #a05e12;
  animation: led-blink .9s infinite;
}
.led-row.led-active[data-state="orange-alt"] .led-r { animation-delay: .45s; }

.led-row.led-active[data-state="orange-together"] .led {
  --led: #e8891c;
  --led-b: #a05e12;
  animation: led-blink 1s infinite;
}

.led-row.led-active[data-state="orange-solid"] .led {
  background: #e8891c;
  border-color: #a05e12;
}

.led-row.led-active[data-state="green-solid"] .led {
  background: #2bb86a;
  border-color: #1d7a46;
}

.led-row.led-active[data-state="red-solid"] .led {
  background: #e32d24;
  border-color: #9e1e18;
}

.led-row.led-active[data-state="orange-offset"] .led {
  --led: #e8891c;
  --led-b: #a05e12;
  animation: led-flash 1.1s infinite;
}
.led-row.led-active[data-state="orange-offset"] .led-r { animation-delay: .14s; }

.led-row.led-active[data-state="fault"] .led-l {
  animation: led-fault-a .9s infinite;
}
.led-row.led-active[data-state="fault"] .led-r {
  animation: led-fault-b .9s infinite;
}

.led-row.led-active[data-state="blue-together"] .led {
  --led: #2aa4e0;
  --led-b: #1a6f99;
  animation: led-blink 1s infinite;
}

.led-row.led-active[data-state="white-flash"] .led {
  --led: #d8dce0;
  --led-b: #9aa0a6;
  animation: led-blink .5s infinite;
}

.led-row.led-active[data-state="white-solid"] .led {
  background: #d8dce0;
  border-color: #9aa0a6;
}

.feat-hint {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 15px;
}
.feat-chart {
  margin: 8px 0 24px;
  border: 1px solid var(--line);
}
.feat-head,
.feat-row summary {
  display: grid;
  grid-template-columns: 1.1fr 0.95fr 1.5fr 22px;
  gap: 16px;
  padding: 12px 16px;
  align-items: center;
}
.feat-row summary {
  align-items: center;
}
.feat-head {
  background: var(--head);
  color: #fff;
  font-weight: 650;
  font-size: 15px;
}
.feat-group {
  padding: 10px 16px 8px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: #16181a;
  border-top: 1px solid var(--line);
}
.feat-row {
  border-top: 1px solid var(--line);
  background: var(--bg-elev);
}
.feat-row summary {
  cursor: pointer;
  list-style: none;
}
.feat-row summary::-webkit-details-marker {
  display: none;
}
.feat-row summary::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  justify-self: end;
  margin-top: -2px;
}
.feat-row:hover {
  background: #23282d;
}
.feat-row[open],
.feat-row[open]:hover {
  background: #1a2a33;
}
.feat-row[open] summary::after {
  transform: rotate(45deg);
  border-color: var(--blue);
}
.feat-name {
  font-weight: 650;
}
.feat-where {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.3;
}
.feat-plat {
  display: inline-flex;
  align-items: center;
}
.feat-plat + .feat-plat::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff;
  display: inline-block;
  margin: 0 8px;
  flex-shrink: 0;
}
.feat-what {
  font-size: 15.5px;
  line-height: 1.45;
}
.feat-body {
  padding: 16px;
  font-size: 15.5px;
  line-height: 1.55;
}
.feat-body p {
  margin: 0 0 8px;
}
.feat-body p:last-child {
  margin: 0;
}

@media (max-width: 980px) {
  .layout { grid-template-columns: var(--side-w) minmax(0, 1fr); }
  .side { padding-left: 24px; }
  .main { padding: 32px 28px 64px; }
  .toc { display: none; }
  .cards, .orient { grid-template-columns: 1fr; }
}
