/* Circuit Schematic — antjanus.com redesign #041
   Light = "SCH" (drawn schematic on drafting paper, KiCad-style inks).
   Dark  = "PCB" (populated board: solder mask, copper traces, silkscreen). */

:root {
  --paper: #f6f4ec;
  --paper-2: #eeeadd;
  --surface: #fcfbf6;
  --grid-dot: rgba(54, 79, 106, 0.16);
  --ink: #18222d;
  --body: #2b3744;
  --muted: #535e6a;
  --line: #364f6a;
  --line-soft: rgba(54, 79, 106, 0.42);
  --wire: #17703a;
  --wire-tint: rgba(23, 112, 58, 0.11);
  --ref: #8f1d1d;
  --link: #2f4c6e;
  --link-hover: #17703a;
  --btn-bg: #364f6a;
  --btn-ink: #ffffff;
  --btn-bg-hover: #243a52;
  --code-bg: #161e27;
  --code-head: #212b36;
  --code-ink: #e3e9ef;
  --focus: #c2410c;
  --shadow: 4px 4px 0 rgba(54, 79, 106, 0.16);

  --font-display: "B612", "IBM Plex Sans", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --font-mono: "B612 Mono", "IBM Plex Mono", ui-monospace, monospace;

  --bus-x: 22px;
  --bus-gap: 64px;
  --radius: 3px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0a1611;
    --paper-2: #0f2119;
    --surface: #10251b;
    --grid-dot: rgba(212, 137, 74, 0.13);
    --ink: #f1f5ef;
    --body: #d3ded6;
    --muted: #a3b8aa;
    --line: #c4d3c8;
    --line-soft: rgba(196, 211, 200, 0.35);
    --wire: #dd9352;
    --wire-tint: rgba(221, 147, 82, 0.14);
    --ref: #f0c36a;
    --link: #f0c36a;
    --link-hover: #ffdca0;
    --btn-bg: #dd9352;
    --btn-ink: #0a1611;
    --btn-bg-hover: #f0b27a;
    --code-bg: #07100c;
    --code-head: #11231a;
    --focus: #7dd3fc;
    --shadow: 0 0 0 1px rgba(221, 147, 82, 0.25), 0 8px 24px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0a1611;
  --paper-2: #0f2119;
  --surface: #10251b;
  --grid-dot: rgba(212, 137, 74, 0.13);
  --ink: #f1f5ef;
  --body: #d3ded6;
  --muted: #a3b8aa;
  --line: #c4d3c8;
  --line-soft: rgba(196, 211, 200, 0.35);
  --wire: #dd9352;
  --wire-tint: rgba(221, 147, 82, 0.14);
  --ref: #f0c36a;
  --link: #f0c36a;
  --link-hover: #ffdca0;
  --btn-bg: #dd9352;
  --btn-ink: #0a1611;
  --btn-bg-hover: #f0b27a;
  --code-bg: #07100c;
  --code-head: #11231a;
  --focus: #7dd3fc;
  --shadow: 0 0 0 1px rgba(221, 147, 82, 0.25), 0 8px 24px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 90px; }
body {
  margin: 0;
  background-color: var(--paper);
  background-image: radial-gradient(var(--grid-dot) 1.1px, transparent 1.4px);
  background-size: 20px 20px;
  color: var(--body);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
figure { margin: 0; }
a { color: var(--link); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink); line-height: 1.2; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.2rem, 4.6vw, 3.6rem); line-height: 1.08; }
h2 { font-size: clamp(1.55rem, 2.6vw, 2.1rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
code, kbd, .mono { font-family: var(--font-mono); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--btn-bg); color: var(--btn-ink); padding: 10px 14px; z-index: 100; }
.skip:focus { top: 12px; }

/* ---------- labels ---------- */
.ref { font-family: var(--font-mono); color: var(--ref); font-size: 0.875rem; letter-spacing: 0.04em; font-weight: 700; }
.eyebrow { font-family: var(--font-mono); font-size: 0.875rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); display: flex; flex-wrap: wrap; gap: 0.35rem 0.9rem; align-items: center; margin-bottom: 1rem; }
.eyebrow .ref { letter-spacing: 0.12em; }
.net {
  display: inline-flex; align-items: center;
  font-family: var(--font-mono); font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--wire); background: var(--wire-tint);
  padding: 3px 16px 3px 9px; line-height: 1.35;
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%);
  text-decoration: none; white-space: nowrap;
}
a.net:hover { background: var(--wire); color: var(--paper); }
.nets { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0; }
.dnp { font-family: var(--font-mono); font-size: 0.875rem; color: var(--ref); border: 1.5px solid var(--ref); padding: 1px 7px; letter-spacing: 0.08em; }
.badge { font-family: var(--font-mono); font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.08em; padding: 2px 8px; border: 1.5px solid currentColor; color: var(--ref); }
.badge.new { color: var(--wire); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem; min-height: 46px;
  padding: 0.6rem 1.15rem; font-family: var(--font-mono); font-size: 0.9375rem; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase; text-decoration: none; cursor: pointer;
  background: var(--btn-bg); color: var(--btn-ink); border: 2px solid var(--btn-bg); border-radius: var(--radius);
  transition: background-color 150ms, transform 150ms, box-shadow 150ms;
  box-shadow: 3px 3px 0 var(--wire);
}
.btn:hover { background: var(--btn-bg-hover); border-color: var(--btn-bg-hover); color: var(--btn-ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--wire); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); box-shadow: none; }
.btn.ghost:hover { background: var(--wire-tint); color: var(--ink); }
.link-tertiary { font-family: var(--font-mono); font-size: 0.9375rem; color: var(--muted); text-decoration: none; border-bottom: 1.5px dashed var(--line-soft); padding: 0.6rem 0; }
.link-tertiary:hover { color: var(--wire); border-bottom-color: var(--wire); }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.4rem; }

/* ---------- drawing frame + header ---------- */
.frame { max-width: 1320px; margin: 0 auto; padding: 0 20px; }
.ruler { display: flex; justify-content: space-around; font-family: var(--font-mono); font-size: 0.8125rem; color: var(--muted); border: 1.5px solid var(--line); border-top: 0; border-bottom-style: dashed; padding: 2px 0; }
.ruler span { flex: 1; text-align: center; border-left: 1px solid var(--line-soft); }
.ruler span:first-child { border-left: 0; }

.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(6px); border-bottom: 1.5px solid var(--line); }
.header-inner { max-width: 1320px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 1.25rem; }
.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.brand svg { width: 52px; height: 40px; color: var(--line); }
.brand-words { display: flex; flex-direction: column; line-height: 1.05; }
.brand-words small { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--ref); letter-spacing: 0.1em; }
.brand-words strong { font-family: var(--font-display); font-size: 1.05rem; letter-spacing: 0.06em; }

.nav { margin-left: auto; display: flex; align-items: center; gap: 1rem; }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; align-items: stretch; gap: 2px; }
.nav-list a {
  position: relative; display: flex; align-items: center; gap: 0.45rem; min-height: 44px;
  padding: 0 0.8rem; font-family: var(--font-mono); font-size: 0.9375rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--ink); text-decoration: none;
}
.nav-list a .pin-no { font-size: 0.8125rem; color: var(--muted); }
.nav-list a::after { content: ""; position: absolute; left: 0.8rem; right: 0.8rem; bottom: 4px; height: 2px; background: var(--wire); transform: scaleX(0); transform-origin: left; transition: transform 150ms; }
.nav-list a:hover::after, .nav-list a[aria-current="page"]::after { transform: scaleX(1); }
.nav-list a[aria-current="page"] .pin-no { color: var(--wire); }
.nav-list a[aria-current="page"] .pin-no::before { content: "●"; margin-right: 3px; }
.nav-list a.ai-pin { color: var(--wire); font-weight: 700; }
.nav-list a.ai-pin .pin-no { color: var(--wire); }

.search { display: flex; align-items: center; border: 1.5px solid var(--line); background: var(--surface); border-radius: var(--radius); }
.search label { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--muted); padding-left: 8px; }
.search input { width: 9.5rem; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 0.9375rem; padding: 8px; min-height: 42px; }
.search input::placeholder { color: var(--muted); }
.search button { border: 0; border-left: 1.5px solid var(--line); background: transparent; color: var(--ink); font-family: var(--font-mono); font-size: 0.875rem; min-height: 42px; padding: 0 10px; cursor: pointer; }
.search button:hover { background: var(--wire-tint); }

.theme-switch { display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 8px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); border-radius: var(--radius); cursor: pointer; font-family: var(--font-mono); font-size: 0.8125rem; }
.theme-switch svg { width: 40px; height: 24px; }
.theme-switch .blade { transition: transform 200ms; transform-origin: 6px 19px; transform-box: view-box; }
:root[data-theme="dark"] .theme-switch .blade { transform: rotate(-30deg); }
.theme-switch .lbl-sch, .theme-switch .lbl-pcb { opacity: 0.55; }
.theme-switch .lbl-sch { opacity: 1; color: var(--wire); }
:root[data-theme="dark"] .theme-switch .lbl-sch { opacity: 0.55; color: inherit; }
:root[data-theme="dark"] .theme-switch .lbl-pcb { opacity: 1; color: var(--wire); }
.menu-btn { display: none; }

/* ---------- sheet: the bus trace ---------- */
.sheet { position: relative; max-width: 1320px; margin: 0 auto; padding: 2.5rem 20px 3rem calc(20px + var(--bus-gap)); }
.sheet::before { content: ""; position: absolute; left: calc(20px + var(--bus-x)); top: 3.4rem; bottom: 2.6rem; width: 2px; background: var(--wire); }
.vcc, .gnd { position: absolute; left: calc(20px + var(--bus-x) - 22px); width: 46px; font-family: var(--font-mono); font-size: 0.8125rem; color: var(--wire); text-align: center; }
.vcc { top: 1.3rem; }
.vcc::after { content: ""; display: block; width: 26px; height: 2px; margin: 3px auto 0; background: var(--wire); }
.gnd { bottom: 0.4rem; }
.gnd::before { content: ""; display: block; height: 14px; margin: 0 auto 3px; width: 26px;
  background: linear-gradient(var(--wire), var(--wire)) top center/26px 2px no-repeat,
              linear-gradient(var(--wire), var(--wire)) center center/16px 2px no-repeat,
              linear-gradient(var(--wire), var(--wire)) bottom center/6px 2px no-repeat; }

.zone { position: relative; margin: 0 0 4rem; }
.zone > .zone-head { position: relative; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem 1.5rem; border-bottom: 1.5px solid var(--line); padding-bottom: 0.8rem; margin-bottom: 1.6rem; }
.zone > .zone-head::before { content: ""; position: absolute; left: calc(-1 * var(--bus-gap) + var(--bus-x)); width: calc(var(--bus-gap) - var(--bus-x) - 8px); top: 1.05rem; height: 2px; background: var(--wire); }
.zone > .zone-head::after { content: ""; position: absolute; left: calc(-1 * var(--bus-gap) + var(--bus-x) - 6px); top: calc(1.05rem - 6px); width: 14px; height: 14px; border-radius: 50%; background: var(--wire); box-shadow: 0 0 0 3px var(--paper); }
.zone-head h2 { margin: 0; display: flex; align-items: baseline; gap: 0.8rem; flex-wrap: wrap; }
.zone-head h2 .ref { font-size: 0.9375rem; }
.zone-head p { margin: 0.25rem 0 0; color: var(--muted); flex-basis: 100%; }
.zone-head .more { font-family: var(--font-mono); font-size: 0.9375rem; text-transform: uppercase; letter-spacing: 0.05em; }
.zone.boxed { border: 1.5px dashed var(--line-soft); padding: 1.6rem; background: color-mix(in srgb, var(--surface) 55%, transparent); }
.zone.boxed > .zone-head::before { left: calc(-1 * var(--bus-gap) + var(--bus-x) - 1.6rem - 1.5px); width: calc(var(--bus-gap) - var(--bus-x) + 1.6rem - 8px); }
.zone.boxed > .zone-head::after { left: calc(-1 * var(--bus-gap) + var(--bus-x) - 6px - 1.6rem - 1.5px); }

/* ---------- page title block (header of inner pages) ---------- */
.titleblock { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); border: 2px solid var(--line); background: var(--surface); margin-bottom: 3.5rem; position: relative; }
.titleblock::before { content: ""; position: absolute; left: calc(-1 * var(--bus-gap) + var(--bus-x)); width: calc(var(--bus-gap) - var(--bus-x)); top: 2.2rem; height: 2px; background: var(--wire); }
.titleblock::after { content: ""; position: absolute; left: calc(-1 * var(--bus-gap) + var(--bus-x) - 6px); top: calc(2.2rem - 6px); width: 14px; height: 14px; border-radius: 50%; background: var(--wire); box-shadow: 0 0 0 3px var(--paper); }
.tb-main { padding: 1.8rem 2rem 2rem; border-right: 2px solid var(--line); }
.tb-main h1 { margin-bottom: 0.6rem; }
.tb-main .lede { font-size: 1.25rem; color: var(--body); max-width: 60ch; margin: 0; }
.tb-cells { margin: 0; display: grid; grid-template-columns: 1fr 1fr; align-content: stretch; }
.tb-cell { border-bottom: 1.5px solid var(--line); border-left: 1.5px solid var(--line); padding: 0.6rem 0.9rem; min-width: 0; }
.tb-cell:nth-child(odd) { border-left: 0; }
.tb-cell.wide { grid-column: 1 / -1; border-left: 0; }
.tb-cell:last-child, .tb-cell.last { border-bottom: 0; }
.tb-cell dt, .tb-cell .k { font-family: var(--font-mono); font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.tb-cell dd, .tb-cell .v { margin: 0; font-family: var(--font-mono); color: var(--ink); font-size: 1rem; overflow-wrap: anywhere; }
.tb-figure { grid-column: 1 / -1; border-top: 2px solid var(--line); position: relative; background: var(--paper-2); }
.tb-figure img { width: 100%; height: clamp(180px, 26vw, 340px); object-fit: cover; }
.tb-figure figcaption { position: absolute; left: 12px; bottom: 10px; background: var(--surface); padding: 2px 8px; font-family: var(--font-mono); font-size: 0.8125rem; color: var(--muted); border: 1px solid var(--line); }

/* ---------- component cards (DIP chip) ---------- */
.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 2.2rem 2.4rem; padding: 0 12px; list-style: none; margin: 0; }
.chip {
  position: relative; isolation: isolate; display: flex; flex-direction: column;
  border: 2px solid var(--line); background: var(--surface); border-radius: 2px; min-width: 0;
  transition: transform 150ms, box-shadow 150ms;
}
.chip::before { content: ""; position: absolute; z-index: 2; top: -2px; left: 50%; width: 24px; height: 12px; transform: translateX(-50%); border: 2px solid var(--line); border-top: 0; border-radius: 0 0 12px 12px; background: var(--paper); }
.chip::after {
  content: ""; position: absolute; z-index: -1; top: 22px; bottom: 22px; left: -12px; right: -12px;
  background:
    repeating-linear-gradient(to bottom, var(--line) 0 3px, transparent 3px 26px) left top / 12px 100% no-repeat,
    repeating-linear-gradient(to bottom, var(--line) 0 3px, transparent 3px 26px) right top / 12px 100% no-repeat;
}
.chip:hover, .chip:focus-within { transform: translate(-2px, -2px); box-shadow: var(--shadow); }
.chip:hover::after, .chip:focus-within::after {
  background:
    repeating-linear-gradient(to bottom, var(--wire) 0 3px, transparent 3px 26px) left top / 12px 100% no-repeat,
    repeating-linear-gradient(to bottom, var(--wire) 0 3px, transparent 3px 26px) right top / 12px 100% no-repeat;
}
.chip-media { border-bottom: 2px solid var(--line); background: var(--paper-2); aspect-ratio: 16 / 9; overflow: hidden; }
.chip-media img { width: 100%; height: 100%; object-fit: cover; }
.chip-body { padding: 1.1rem 1.2rem 1.2rem; display: flex; flex-direction: column; gap: 0.55rem; flex: 1; }
.chip-top { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.chip-top time, .meta { font-family: var(--font-mono); font-size: 0.875rem; color: var(--muted); }
.chip h3 { font-size: 1.2rem; margin: 0; }
.chip h3 a { color: var(--ink); text-decoration: none; }
.chip h3 a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.chip h3 a:hover { color: var(--wire); }
.chip p { margin: 0; color: var(--body); }
.chip .nets { margin-top: auto; padding-top: 0.4rem; position: relative; z-index: 3; }
.chip .ext { position: relative; z-index: 3; }
.chip-stat { display: flex; gap: 1.2rem; font-family: var(--font-mono); font-size: 0.9375rem; color: var(--ink); flex-wrap: wrap; }
.chip-stat b { color: var(--wire); }

/* compact chip: no media */
.chips.compact { grid-template-columns: repeat(auto-fill, minmax(min(100%, 235px), 1fr)); }

/* ---------- BOM table ---------- */
.bom-controls { display: flex; flex-wrap: wrap; gap: 0.6rem 1rem; align-items: center; margin-bottom: 1.2rem; }
.bom-controls .k { font-family: var(--font-mono); font-size: 0.875rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.seg { display: inline-flex; flex-wrap: wrap; border: 1.5px solid var(--line); }
.seg button { font-family: var(--font-mono); font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.05em; min-height: 44px; padding: 0 0.9rem; background: var(--surface); color: var(--ink); border: 0; border-left: 1.5px solid var(--line); cursor: pointer; }
.seg button:first-child { border-left: 0; }
.seg button[aria-pressed="true"] { background: var(--btn-bg); color: var(--btn-ink); }
.seg button:hover:not([aria-pressed="true"]) { background: var(--wire-tint); }
.bom { width: 100%; border-collapse: collapse; background: var(--surface); border: 2px solid var(--line); }
.bom caption { text-align: left; font-family: var(--font-mono); font-size: 0.875rem; color: var(--muted); padding: 0 0 0.5rem; caption-side: top; }
.bom th { font-family: var(--font-mono); font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); text-align: left; padding: 0.6rem 0.9rem; border-bottom: 2px solid var(--line); background: var(--paper-2); }
.bom td { padding: 0.95rem 0.9rem; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.bom tr:last-child td { border-bottom: 0; }
.bom tbody tr:hover { background: var(--wire-tint); }
.bom td.r { width: 4.5rem; }
.bom td.d { width: 8.5rem; font-family: var(--font-mono); font-size: 0.9375rem; color: var(--muted); white-space: nowrap; }
.bom td.c { width: 11rem; font-family: var(--font-mono); font-size: 0.9375rem; }
.bom .t a { font-family: var(--font-display); font-size: 1.1rem; color: var(--ink); text-decoration: none; font-weight: 700; }
.bom .t a:hover { color: var(--wire); text-decoration: underline; }
.bom .t p { margin: 0.3rem 0 0.5rem; color: var(--body); max-width: 72ch; }
.bom-empty { padding: 1.4rem; border: 2px dashed var(--line); font-family: var(--font-mono); }

/* ---------- test point stat strip ---------- */
.tps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 2px; background: var(--line); border: 2px solid var(--line); }
.tp { background: var(--surface); padding: 1rem 1.2rem; display: flex; flex-direction: column; gap: 0.2rem; }
.tp .k { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; display: flex; align-items: center; gap: 0.5rem; }
.tp .k::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--wire); background: radial-gradient(var(--wire) 30%, transparent 34%); }
.tp .v { font-family: var(--font-display); font-weight: 700; font-size: 2.2rem; color: var(--ink); line-height: 1.1; font-variant-numeric: tabular-nums; }
.tp .s { font-size: 1rem; color: var(--body); }

/* ---------- home hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 3rem; align-items: start; margin-bottom: 3rem; position: relative; }
.hero::before { content: ""; position: absolute; left: calc(-1 * var(--bus-gap) + var(--bus-x)); width: calc(var(--bus-gap) - var(--bus-x) - 8px); top: 1.1rem; height: 2px; background: var(--wire); }
.hero::after { content: ""; position: absolute; left: calc(-1 * var(--bus-gap) + var(--bus-x) - 6px); top: calc(1.1rem - 6px); width: 14px; height: 14px; border-radius: 50%; background: var(--wire); box-shadow: 0 0 0 3px var(--paper); }
.hero > div { padding-top: 0.2rem; }
.hero h1 { font-size: clamp(2.4rem, 5.2vw, 4.3rem); margin-bottom: 1.2rem; }
.hero h1 em { font-style: normal; color: var(--wire); }
.hero .sub { font-size: 1.25rem; max-width: 42ch; margin-bottom: 1.8rem; }
.photo-part { position: relative; border: 2px solid var(--line); background: var(--surface); padding: 12px; }
.photo-part img { width: 100%; aspect-ratio: 4 / 4.2; object-fit: cover; object-position: 30% 30%; }
.photo-part .pp-label { display: flex; justify-content: space-between; gap: 1rem; font-family: var(--font-mono); font-size: 0.875rem; color: var(--muted); padding-top: 10px; flex-wrap: wrap; }
.corner { position: absolute; width: 18px; height: 18px; border-color: var(--wire); border-style: solid; border-width: 0; }
.corner.tl { top: -8px; left: -8px; border-top-width: 2px; border-left-width: 2px; }
.corner.tr { top: -8px; right: -8px; border-top-width: 2px; border-right-width: 2px; }
.corner.bl { bottom: -8px; left: -8px; border-bottom-width: 2px; border-left-width: 2px; }
.corner.br { bottom: -8px; right: -8px; border-bottom-width: 2px; border-right-width: 2px; }

/* ---------- IC block symbol (U1) ---------- */
.ic { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) minmax(0, 1fr); align-items: center; margin: 0 0 4rem; }
.ic-pins { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.ic-pins li { display: flex; align-items: center; gap: 0.6rem; font-family: var(--font-mono); font-size: 0.9375rem; min-height: 44px; }
.ic-pins.left li { justify-content: flex-end; text-align: right; }
.ic-pins .stub { flex: 1; height: 2px; background: var(--wire); position: relative; min-width: 28px; }
.ic-pins.left .stub::before, .ic-pins.right .stub::after { content: ""; position: absolute; top: -4px; width: 10px; height: 10px; border: 2px solid var(--wire); border-radius: 50%; background: var(--paper); }
.ic-pins.left .stub::before { left: -4px; }
.ic-pins.right .stub::after { right: -4px; }
.ic-pins .pn { color: var(--muted); font-size: 0.8125rem; min-width: 1.4rem; }
.ic-pins.right a { color: var(--ink); text-decoration: none; font-weight: 700; display: inline-flex; min-height: 44px; align-items: center; }
.ic-pins.right a:hover { color: var(--wire); text-decoration: underline; }
.ic-pins .sig { color: var(--ink); }
.ic-body { position: relative; border: 2.5px solid var(--line); background: var(--surface); padding: 2rem 1.4rem; text-align: center; min-height: 100%; display: flex; flex-direction: column; justify-content: center; gap: 0.3rem; }
.ic-body::before { content: ""; position: absolute; top: -2.5px; left: 50%; transform: translateX(-50%); width: 30px; height: 15px; border: 2.5px solid var(--line); border-top: 0; border-radius: 0 0 15px 15px; background: var(--paper); }
.ic-body strong { font-family: var(--font-display); font-size: 1.5rem; color: var(--ink); letter-spacing: 0.04em; }
.ic-body span { color: var(--muted); }
.ic-caption { grid-column: 1 / -1; margin-top: 1rem; text-align: center; font-family: var(--font-mono); font-size: 0.875rem; color: var(--muted); }

/* ---------- series circuit ---------- */
.series { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0 1.5rem; position: relative; }
.series::before { content: ""; position: absolute; left: 0; right: 0; top: 34px; height: 2px; background: var(--wire); }
.series li { position: relative; display: flex; flex-direction: column; gap: 0.6rem; }
.series .node { width: 68px; height: 68px; border: 2px solid var(--line); background: var(--surface); display: grid; place-items: center; font-family: var(--font-mono); font-weight: 700; color: var(--ref); position: relative; z-index: 1; }
.series li.unpop .node { border-style: dashed; color: var(--muted); }
.series li.unpop .node::after { content: ""; position: absolute; inset: 8px; background: linear-gradient(45deg, transparent 47%, var(--muted) 48% 52%, transparent 53%); }
.series h3 { font-size: 1.1rem; margin: 0.3rem 0 0; }
.series h3 a { color: var(--ink); }
.series img { aspect-ratio: 4 / 3; object-fit: cover; border: 2px solid var(--line); }
.series p { margin: 0; font-size: 1rem; }
.note-box { border: 2px solid var(--line); border-left-width: 8px; border-left-color: var(--ref); padding: 1rem 1.2rem; background: var(--surface); margin: 1.5rem 0 0; }

/* ---------- strip: consulting / power input ---------- */
.power { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; border: 2px solid var(--line); background: var(--surface); padding: 1.2rem 1.4rem; margin-bottom: 3.5rem; position: relative; }
.power p { margin: 0; font-size: 1.15rem; color: var(--ink); max-width: 60ch; }
.power .k { font-family: var(--font-mono); font-size: 0.875rem; color: var(--wire); display: block; letter-spacing: 0.1em; }

/* ---------- three-up bottom row ---------- */
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.panel { border: 2px solid var(--line); background: var(--surface); padding: 1.4rem; }
.panel h3 { display: flex; gap: 0.6rem; align-items: baseline; }
.panel ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.panel li a { display: flex; justify-content: space-between; gap: 1rem; padding: 0.7rem 0; border-bottom: 1px dashed var(--line-soft); color: var(--ink); text-decoration: none; min-height: 44px; align-items: center; }
.panel li:last-child a { border-bottom: 0; }
.panel li a:hover { color: var(--wire); }
.panel li a span { font-family: var(--font-mono); font-size: 0.875rem; color: var(--muted); }
.panel.inverse { background: var(--btn-bg); border-color: var(--btn-bg); color: var(--btn-ink); background-image: url("assets/pcb-macro.jpg"), linear-gradient(135deg, transparent 0 60%, rgba(255,255,255,0.06) 60% 62%, transparent 62%); background-size: cover; background-blend-mode: soft-light; }
.panel.inverse h3, .panel.inverse p { color: var(--btn-ink); }
.panel.inverse .ref { color: var(--btn-ink); opacity: 0.85; }
.panel.inverse .btn { background: var(--paper); color: var(--ink); border-color: var(--paper); box-shadow: 3px 3px 0 rgba(0,0,0,0.3); }

/* ---------- split / lists ---------- */
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; }
.plain-list { list-style: none; padding: 0; margin: 0; }
.plain-list li { border-bottom: 1.5px solid var(--line-soft); padding: 1rem 0; display: grid; grid-template-columns: 3.2rem minmax(0, 1fr); gap: 0.2rem 0.8rem; }
.plain-list li .ref { padding-top: 0.2rem; }
.plain-list a.title { font-family: var(--font-display); font-weight: 700; font-size: 1.12rem; color: var(--ink); text-decoration: none; }
.plain-list a.title:hover { color: var(--wire); text-decoration: underline; }
.plain-list p { margin: 0.2rem 0 0; }
.plain-list .meta { grid-column: 2; }

/* ---------- featured project ---------- */
.feature { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); border: 2.5px solid var(--line); background: var(--surface); }
.feature img { width: 100%; height: 100%; object-fit: cover; min-height: 280px; border-right: 2.5px solid var(--line); }
.feature .fbody { padding: 1.8rem; display: flex; flex-direction: column; gap: 1rem; }
.feature .tps { margin-top: 0.5rem; }

/* ---------- timing diagram (career) ---------- */
.timing { border: 2px solid var(--line); background: var(--surface); padding: 1.2rem 1.2rem 0.8rem; overflow: hidden; }
.timing-row { display: grid; grid-template-columns: 7rem minmax(0, 1fr); align-items: center; gap: 1rem; }
.timing-row .k { font-family: var(--font-mono); font-size: 0.875rem; color: var(--muted); text-transform: uppercase; }
.wave { position: relative; height: 64px; }
.seg-bar { position: absolute; top: 10px; height: 44px; border: 2px solid var(--wire); background: var(--wire-tint); clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 8px 100%, 0 50%); display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 0.8125rem; color: var(--ink); overflow: hidden; white-space: nowrap; padding: 0 10px; }
.seg-bar.tiny { font-size: 0; padding: 0; }
@media (min-width: 961px) { .split > .zone + .zone > .zone-head::before, .split > .zone + .zone > .zone-head::after { display: none; } .split > .zone { margin-bottom: 0; } }
.seg-bar.now { background: var(--wire); color: var(--paper); }
.axis { position: relative; height: 26px; margin-left: 8rem; font-family: var(--font-mono); font-size: 0.8125rem; color: var(--muted); border-top: 1.5px solid var(--line); }
.axis span { position: absolute; top: 4px; transform: translateX(-50%); }
.wave-wrap { overflow-x: auto; }
.mb-4 { margin-bottom: 4rem; }
.career-list { list-style: none; padding: 0; margin: 1.2rem 0 0; display: none; }
.career-legend { display: none; }
details.history { margin-top: 1.5rem; border: 2px solid var(--line); background: var(--surface); }
details.history > summary { cursor: pointer; list-style: none; padding: 1rem 1.2rem; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink); display: flex; justify-content: space-between; align-items: center; min-height: 44px; }
details.history > summary::-webkit-details-marker { display: none; }
details.history > summary::after { content: "[+]"; color: var(--wire); }
details.history[open] > summary::after { content: "[−]"; }
.phases { list-style: none; margin: 0; padding: 0 1.2rem 1.2rem; display: grid; gap: 1rem; }
.phase { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 1rem; border-top: 1.5px dashed var(--line-soft); padding-top: 1rem; }
.phase .when { font-family: var(--font-mono); color: var(--wire); font-size: 0.9375rem; }
.phase h3 { margin-bottom: 0.3rem; }
.phase ul { margin: 0.5rem 0 0; padding-left: 1.2rem; }
.phase li { margin-bottom: 0.3rem; }

/* ---------- notes (principles) ---------- */
.notes { counter-reset: note; list-style: none; padding: 0; margin: 0; border: 2px solid var(--line); background: var(--surface); }
.notes li { counter-increment: note; display: grid; grid-template-columns: 5rem minmax(0, 1fr); border-bottom: 1.5px solid var(--line-soft); }
.notes li:last-child { border-bottom: 0; }
.notes li::before { content: "N" counter(note); font-family: var(--font-mono); font-weight: 700; color: var(--ref); padding: 1rem; border-right: 1.5px solid var(--line-soft); }
.notes li span { padding: 1rem 1.2rem; font-family: var(--font-display); font-size: 1.15rem; color: var(--ink); }

/* ---------- subsystem blocks (capabilities) ---------- */
.subsys { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.block { border: 2px dashed var(--line); padding: 1.3rem 1.4rem; position: relative; background: color-mix(in srgb, var(--surface) 70%, transparent); }
.block .ref { position: absolute; top: -0.75rem; left: 1rem; background: var(--paper); padding: 0 0.5rem; }
.block h3 { margin-top: 0.3rem; }

/* ---------- about hero ---------- */
.about-hero { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 2.5rem; align-items: center; margin-bottom: 3rem; position: relative; }
.about-hero::before { content: ""; position: absolute; left: calc(-1 * var(--bus-gap) + var(--bus-x)); width: calc(var(--bus-gap) - var(--bus-x) - 8px); top: 2rem; height: 2px; background: var(--wire); }
.about-hero::after { content: ""; position: absolute; left: calc(-1 * var(--bus-gap) + var(--bus-x) - 6px); top: calc(2rem - 6px); width: 14px; height: 14px; border-radius: 50%; background: var(--wire); box-shadow: 0 0 0 3px var(--paper); }
.about-hero .lede { font-size: 1.3rem; color: var(--ink); }

/* ---------- article ---------- */
.progress { position: fixed; left: 0; right: 0; top: 0; height: 4px; z-index: 60; background: transparent; }
.progress span { display: block; height: 100%; width: 0; background: var(--wire); box-shadow: 0 0 8px var(--wire); }
.progress-pct { position: fixed; right: 10px; top: 6px; z-index: 61; font-family: var(--font-mono); font-size: 0.8125rem; color: var(--wire); background: var(--paper); padding: 0 6px; border: 1px solid var(--wire); }
.article-layout { display: grid; grid-template-columns: 250px minmax(0, 720px); gap: 3.5rem; justify-content: start; }
.toc { position: sticky; top: 96px; align-self: start; font-family: var(--font-mono); font-size: 0.9375rem; }
.toc .k { font-size: 0.8125rem; letter-spacing: 0.12em; color: var(--muted); text-transform: uppercase; margin-bottom: 0.6rem; display: block; }
.toc ol { list-style: none; padding: 0 0 0 20px; margin: 0; position: relative; }
.toc ol::before { content: ""; position: absolute; left: 5px; top: 12px; bottom: 12px; width: 2px; background: var(--line-soft); }
.toc li { position: relative; }
.toc li::before { content: ""; position: absolute; left: -20px; top: 15px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line); background: var(--paper); }
.toc li.active::before { background: var(--wire); border-color: var(--wire); }
.toc a { display: block; padding: 0.45rem 0; color: var(--body); text-decoration: none; line-height: 1.35; }
.toc a:hover, .toc li.active a { color: var(--wire); }
.toc .toc-actions { margin-top: 1.4rem; display: flex; flex-direction: column; gap: 0.3rem; }
.toc .toc-actions a { color: var(--link); text-decoration: underline; }
details.toc-mobile { display: none; border: 2px solid var(--line); background: var(--surface); margin-bottom: 2rem; }
details.toc-mobile summary { padding: 0.8rem 1rem; font-family: var(--font-mono); text-transform: uppercase; cursor: pointer; min-height: 44px; }
details.toc-mobile ol { margin: 0 1rem 1rem; padding-left: 1.4rem; }
details.toc-mobile li { padding: 0.25rem 0; }

.prose { font-size: 1.125rem; line-height: 1.72; color: var(--body); min-width: 0; }
.prose > * { margin-top: 0; margin-bottom: 0; }
.prose > * + * { margin-top: 1.2em; }
.prose h2 { font-size: 1.75rem; margin: 2.6em 0 0.2em; position: relative; padding-top: 1rem; border-top: 1.5px solid var(--line); scroll-margin-top: 90px; }
.prose h2 .hnum { font-family: var(--font-mono); font-size: 0.875rem; color: var(--ref); display: block; letter-spacing: 0.1em; margin-bottom: 0.3rem; }
.prose ol, .prose ul { padding-left: 1.5rem; }
.prose li { margin: 0.35em 0; padding-left: 0.3rem; }
.prose ol li::marker { font-family: var(--font-mono); color: var(--wire); font-weight: 700; }
.prose :not(pre) > code { font-size: 0.92em; background: var(--wire-tint); color: var(--ink); padding: 0.1em 0.35em; border-radius: 2px; }
.prose a { color: var(--link); }
.callout { border: 2px solid var(--line); background: var(--surface); padding: 1rem 1.2rem 1rem 1.2rem; position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.2rem 1rem; }
.callout .tag { font-family: var(--font-mono); font-size: 0.8125rem; letter-spacing: 0.1em; text-transform: uppercase; grid-column: 1 / -1; display: flex; align-items: center; gap: 0.5rem; font-weight: 700; }
.callout .tag svg { width: 22px; height: 22px; flex-shrink: 0; }
.callout > div { grid-column: 1 / -1; }
.callout.why { border-left: 8px solid var(--wire); }
.callout.why .tag { color: var(--wire); }
.callout.probe { border-style: dashed; border-color: var(--ref); }
.callout.probe .tag { color: var(--ref); }
.callout.skill { border-left: 8px solid var(--line); background: var(--paper-2); }
.callout.skill .tag { color: var(--line); }
.callout.note { border-left: 8px solid var(--ref); }
.callout.note .tag { color: var(--ref); }

.codeblock { margin-left: -1.5rem; margin-right: -1.5rem; border: 2px solid var(--line); background: var(--code-bg); color: var(--code-ink); }
.codeblock .code-head { display: flex; justify-content: space-between; align-items: center; background: var(--code-head); border-bottom: 1.5px solid rgba(255,255,255,0.12); padding: 0 0 0 1rem; font-family: var(--font-mono); font-size: 0.8125rem; color: #b8c4cf; letter-spacing: 0.08em; }
.codeblock .code-head .ref { color: #f0c36a; }
.copy-btn { min-height: 40px; padding: 0 1rem; background: transparent; color: #e3e9ef; border: 0; border-left: 1.5px solid rgba(255,255,255,0.18); font-family: var(--font-mono); font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.08em; cursor: pointer; }
.copy-btn:hover { background: rgba(255,255,255,0.08); }
.codeblock pre { margin: 0; padding: 1.1rem 1.2rem; overflow-x: auto; font-size: 0.9375rem; line-height: 1.6; tab-size: 2; }
.codeblock code { font-family: "IBM Plex Mono", var(--font-mono); background: none; color: inherit; padding: 0; }
.token.comment { color: #8fa3a0; font-style: italic; }
.token.keyword, .token.boolean { color: #f0a868; }
.token.string, .token.template-string { color: #9fd58b; }
.token.function { color: #8cc6ff; }
.token.class-name, .token.builtin { color: #f3d27a; }
.token.tag, .token.operator { color: #e6a3c9; }
.token.punctuation { color: #b8c4cf; }
.token.attr-name, .token.property { color: #9ddfe0; }
.token.number { color: #f3d27a; }

.article-foot { margin-top: 3rem; display: flex; flex-direction: column; gap: 2rem; }
.filed { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; font-family: var(--font-mono); font-size: 0.875rem; color: var(--muted); }
.share { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: center; }
.share .k { font-family: var(--font-mono); font-size: 0.875rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin-right: 0.4rem; }

/* ---------- newsletter / forms ---------- */
.newsletter { border: 2px solid var(--line); background: var(--surface); padding: 1.6rem; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.2rem 2rem; align-items: center; }
.newsletter h3 { margin: 0 0 0.3rem; }
.newsletter p { margin: 0; }
.form-row { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.form-row input[type="email"] { flex: 1 1 200px; min-height: 46px; padding: 0 0.8rem; border: 2px solid var(--line); background: var(--paper); color: var(--ink); font: inherit; border-radius: var(--radius); }
.form-row input::placeholder { color: var(--muted); }
.form-msg { flex-basis: 100%; min-height: 1.5em; margin: 0; font-family: var(--font-mono); font-size: 0.9375rem; }
.form-msg.ok { color: var(--wire); }
.form-msg.err { color: var(--ref); }
.consent { display: flex; gap: 0.5rem; align-items: flex-start; font-size: 0.9375rem; flex-basis: 100%; }
.consent input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--wire); }

/* ---------- footer title block ---------- */
.site-footer { max-width: 1320px; margin: 2rem auto 0; padding: 0 20px 2.5rem; }
.fblock { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.6fr; border: 2.5px solid var(--line); background: var(--surface); }
.fcell { padding: 1.3rem 1.4rem; border-left: 1.5px solid var(--line); min-width: 0; }
.fcell:first-child { border-left: 0; }
.fcell .k { display: block; font-family: var(--font-mono); font-size: 0.8125rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.7rem; }
.fcell ul { list-style: none; margin: 0; padding: 0; }
.fcell ul.two { columns: 2; column-gap: 1rem; }
.fcell li a { display: inline-flex; align-items: center; min-height: 36px; color: var(--ink); text-decoration: none; }
.fcell li a:hover { color: var(--wire); text-decoration: underline; }
.fcell .brand { margin-bottom: 0.8rem; }
.fstrip { display: grid; grid-template-columns: repeat(4, auto) 1fr; border: 2.5px solid var(--line); border-top: 0; background: var(--surface); font-family: var(--font-mono); font-size: 0.875rem; }
.fstrip > div { padding: 0.55rem 1rem; border-left: 1.5px solid var(--line); color: var(--ink); }
.fstrip > div:first-child { border-left: 0; }
.fstrip .k { color: var(--muted); margin-right: 0.5rem; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8125rem; }
.fstrip > div:last-child { text-align: right; }

/* ---------- patterns ---------- */
.three-ways { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border: 2px solid var(--line); background: var(--surface); }
.three-ways > div { padding: 1.3rem 1.4rem; border-left: 1.5px solid var(--line); }
.three-ways > div:first-child { border-left: 0; }
.three-ways h3 { display: flex; gap: 0.6rem; align-items: baseline; }
.three-ways p { margin: 0; }
.three-ways .foot { grid-column: 1 / -1; border-left: 0; border-top: 1.5px solid var(--line); background: var(--paper-2); }
.pfilter { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1.8rem; }
.pfilter .row { display: flex; flex-wrap: wrap; gap: 0.8rem 1.2rem; align-items: center; }
.psearch { display: flex; border: 2px solid var(--line); background: var(--surface); flex: 1 1 100%; }
.psearch label { font-family: var(--font-mono); font-size: 0.875rem; color: var(--wire); padding: 0 0.9rem; display: flex; align-items: center; border-right: 1.5px solid var(--line); white-space: nowrap; }
.psearch input { flex: 1; min-width: 0; min-height: 50px; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 1.0625rem; padding: 0 0.9rem; }
.psearch input::placeholder { color: var(--muted); }
select { min-height: 44px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); font-family: var(--font-mono); font-size: 0.9375rem; padding: 0 0.6rem; border-radius: var(--radius); }
.pcount { font-family: var(--font-mono); color: var(--ink); }
.clear-btn { background: none; border: 0; color: var(--link); text-decoration: underline; font: inherit; font-family: var(--font-mono); cursor: pointer; min-height: 44px; padding: 0 0.3rem; }
.pgrid .chip-media { aspect-ratio: 16 / 7; display: grid; place-items: center; color: var(--line); background-color: var(--paper-2); background-image: radial-gradient(var(--grid-dot) 1.1px, transparent 1.4px); background-size: 14px 14px; }
.pgrid .chip-media svg { width: 72%; height: 78%; }
.good-for { font-size: 1rem; color: var(--body); }
.good-for b { font-family: var(--font-mono); font-size: 0.875rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 400; }
.empty { border: 2px dashed var(--line); padding: 2rem; text-align: center; background: var(--surface); }
.empty h3 { margin-bottom: 0.3rem; }

.back { font-family: var(--font-mono); font-size: 0.9375rem; display: inline-flex; min-height: 44px; align-items: center; margin-bottom: 1rem; }
.usecases { columns: 2; column-gap: 2rem; padding-left: 1.2rem; margin: 0.4rem 0 0; }
.usecases li { margin-bottom: 0.4rem; break-inside: avoid; }
.panes { border: 2.5px solid var(--line); background: var(--surface); margin-top: 2rem; }
.pane-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: stretch; border-bottom: 2px solid var(--line); background: var(--paper-2); }
.tabs { display: flex; flex-wrap: wrap; }
.tabs [role="tab"] { min-height: 48px; padding: 0 1.1rem; border: 0; border-right: 1.5px solid var(--line); background: transparent; color: var(--ink); font-family: var(--font-mono); font-size: 0.9375rem; text-transform: uppercase; letter-spacing: 0.05em; cursor: pointer; position: relative; }
.tabs [role="tab"][aria-selected="true"] { background: var(--surface); color: var(--wire); font-weight: 700; }
.tabs [role="tab"][aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 3px; background: var(--wire); }
.tabs [role="tab"]:hover { background: var(--wire-tint); }
.pane-actions { display: flex; }
.pane-actions button { min-height: 48px; border: 0; border-left: 1.5px solid var(--line); background: transparent; color: var(--ink); font-family: var(--font-mono); font-size: 0.875rem; padding: 0 1rem; cursor: pointer; text-transform: uppercase; letter-spacing: 0.05em; }
.pane-actions button:hover { background: var(--wire-tint); }
.pane-actions button[hidden] { display: none; }
[role="tabpanel"] { padding: 1.6rem; }
[role="tabpanel"] pre { margin: 0; background: var(--code-bg); color: var(--code-ink); padding: 1.1rem 1.2rem; overflow-x: auto; font-size: 0.9375rem; line-height: 1.6; border: 2px solid var(--line); }
[role="tabpanel"] pre code { font-family: "IBM Plex Mono", var(--font-mono); }
.pane-note { font-size: 1rem; background: var(--paper-2); border-left: 6px solid var(--wire); padding: 0.8rem 1rem; margin: 0 0 1rem; }
.prompt-text { max-width: 70ch; font-size: 1.0625rem; }
.prompt-text p { margin: 0 0 1em; }

/* hairline stat strip demo */
.stage { background: var(--paper-2); border: 1.5px dashed var(--line-soft); padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.stage .cap { font-size: 1rem; color: var(--muted); margin: 0; }
.hss-strip { display: grid; gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: 6px; overflow: hidden; grid-template-columns: 1fr; }
@container (min-width: 21rem) { .hss-strip { grid-template-columns: repeat(2, 1fr); } }
@container (min-width: 42rem) { .hss-strip { grid-template-columns: repeat(4, 1fr); } .hss-strip.five { grid-template-columns: repeat(5, 1fr); } }
.stage-inner { container-type: inline-size; display: flex; flex-direction: column; gap: 1rem; }
.hss-tile { background: var(--surface); padding: 0.9rem 1rem; display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; text-align: left; border: 0; color: var(--ink); font: inherit; }
button.hss-tile { cursor: pointer; min-height: 44px; }
button.hss-tile:hover { background: color-mix(in srgb, var(--wire) 7%, var(--surface)); }
button.hss-tile[aria-pressed="true"] { background: color-mix(in srgb, var(--wire) 16%, var(--surface)); box-shadow: inset 0 -3px 0 var(--wire); }
.hss-label { font-family: var(--font-mono); font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.hss-fig { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.hss-fig.missing { color: var(--muted); }
.hss-sub { font-size: 0.875rem; color: var(--muted); }
.dl-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line-soft); background: var(--surface); }
.dl-list li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.7rem 1rem; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.dl-list li:last-child { border-bottom: 0; }
.dl-list li[hidden] { display: none; }
.dl-list .st { font-family: var(--font-mono); font-size: 0.875rem; }
.dl-status { font-family: var(--font-mono); font-size: 0.9375rem; margin: 0; color: var(--ink); }

/* ---------- motion ---------- */
.trace-draw path, .trace-draw line, .trace-draw polyline { stroke-dasharray: 600; stroke-dashoffset: 600; animation: draw 1.6s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.signal { position: absolute; left: calc(20px + var(--bus-x) - 4px); width: 10px; height: 10px; border-radius: 50%; background: var(--wire); box-shadow: 0 0 10px var(--wire); top: 3.4rem; animation: pulse-down 9s linear infinite; pointer-events: none; }
@keyframes pulse-down { from { top: 3.4rem; opacity: 0; } 5% { opacity: 1; } 95% { opacity: 1; } to { top: calc(100% - 3rem); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .trace-draw path, .trace-draw line, .trace-draw polyline { stroke-dashoffset: 0; }
  .signal { display: none; }
  html { scroll-behavior: auto; }
}

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .search input { width: 7rem; }
  .nav-list a { padding: 0 0.55rem; }
}
@media (max-width: 1040px) {
  .article-layout { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
  details.toc-mobile { display: block; }
  .codeblock { margin-left: 0; margin-right: 0; }
  .fblock { grid-template-columns: 1fr 1fr; }
  .fcell:nth-child(3) { border-left: 0; }
  .fcell:nth-child(n+3) { border-top: 1.5px solid var(--line); }
}
@media (max-width: 960px) {
  .ruler { display: none; }
  .menu-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; min-width: 44px; padding: 0 10px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font-family: var(--font-mono); font-size: 0.875rem; cursor: pointer; border-radius: var(--radius); }
  .header-inner { flex-wrap: wrap; }
  .theme-switch { margin-left: auto; }
  .js .nav { display: none; }
  .nav { order: 5; flex-basis: 100%; flex-direction: column; align-items: stretch; gap: 0.8rem; padding: 0.4rem 0 0.8rem; margin: 0; }
  .js .nav-open .nav { display: flex; }
  .nav-list { flex-direction: column; }
  .nav-list a { border-bottom: 1px dashed var(--line-soft); }
  .search input { width: auto; flex: 1; }
  .hero, .about-hero { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .photo-part { max-width: 520px; }
  .titleblock { grid-template-columns: minmax(0, 1fr); }
  .tb-main { border-right: 0; border-bottom: 2px solid var(--line); }
  .ic { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .ic-pins.left li { justify-content: flex-start; text-align: left; flex-direction: row-reverse; }
  .ic-pins.left .stub::before { left: auto; right: -4px; }
  .ic-pins { padding: 0.8rem 0; }
  .trio, .split, .subsys { grid-template-columns: minmax(0, 1fr); }
  .feature { grid-template-columns: minmax(0, 1fr); }
  .feature img { border-right: 0; border-bottom: 2.5px solid var(--line); min-height: 200px; max-height: 280px; }
  .series { grid-template-columns: minmax(0, 1fr); gap: 1.6rem; padding-left: 0; }
  .series::before { left: 33px; right: auto; top: 0; bottom: 0; width: 2px; height: auto; }
  .series li { display: grid; grid-template-columns: 68px minmax(0, 1fr); gap: 0.4rem 1rem; }
  .series li > *:not(.node) { grid-column: 2; }
  .series .node { grid-row: 1 / span 4; }
  .three-ways { grid-template-columns: minmax(0, 1fr); }
  .three-ways > div { border-left: 0; border-top: 1.5px solid var(--line); }
  .three-ways > div:first-child { border-top: 0; }
  .newsletter { grid-template-columns: minmax(0, 1fr); }
  .timing .wave-wrap { overflow-x: auto; }
}
@media (max-width: 720px) {
  :root { --bus-x: 6px; --bus-gap: 28px; }
  body { font-size: 1.0625rem; }
  .frame, .header-inner, .site-footer { padding-left: 16px; padding-right: 16px; }
  .sheet { padding: 2.2rem 16px 3rem calc(16px + var(--bus-gap)); }
  .sheet::before { left: calc(16px + var(--bus-x)); }
  .signal { left: calc(16px + var(--bus-x) - 4px); }
  .vcc, .gnd { left: calc(16px + var(--bus-x) - 22px); }
  .zone > .zone-head::before, .hero::before, .about-hero::before, .titleblock::before { width: calc(var(--bus-gap) - var(--bus-x) - 4px); }
  .zone > .zone-head::after, .hero::after, .about-hero::after, .titleblock::after { width: 12px; height: 12px; left: calc(-1 * var(--bus-gap) + var(--bus-x) - 5px); }
  .zone.boxed { padding: 1.1rem; }
  .zone.boxed > .zone-head::before { left: calc(-1 * var(--bus-gap) + var(--bus-x) - 1.1rem - 1.5px); width: calc(var(--bus-gap) - var(--bus-x) + 1.1rem - 4px); }
  .zone.boxed > .zone-head::after { left: calc(-1 * var(--bus-gap) + var(--bus-x) - 5px - 1.1rem - 1.5px); }
  .brand-words small { display: none; }
  .progress-pct { display: none; }
  .theme-switch .lbl-sch, .theme-switch .lbl-pcb { display: none; }
  .tb-main { padding: 1.3rem 1.2rem 1.4rem; }
  .tb-main .lede { font-size: 1.125rem; }
  .chips { padding: 0 10px; gap: 2rem; }
  .bom thead { display: none; }
  .bom, .bom tbody, .bom tr, .bom td { display: block; width: auto !important; }
  .bom tr { padding: 0.9rem 1rem; border-bottom: 1.5px solid var(--line-soft); display: grid; grid-template-columns: auto 1fr; gap: 0.2rem 0.8rem; }
  .bom td { padding: 0; border: 0; }
  .bom td.t { grid-column: 1 / -1; order: 3; }
  .bom td.c { order: 2; text-align: right; }
  .bom td.d { order: 4; grid-column: 1 / -1; }
  .timing-row { grid-template-columns: minmax(0, 1fr); gap: 0.3rem; }
  .axis { margin-left: 0; }
  .wave { min-width: 640px; }
  .axis { min-width: 640px; }
  .phase { grid-template-columns: minmax(0, 1fr); gap: 0.3rem; }
  .notes li { grid-template-columns: 3.4rem minmax(0, 1fr); }
  .notes li::before { padding: 1rem 0.7rem; }
  .fblock { grid-template-columns: minmax(0, 1fr); }
  .fcell { border-left: 0 !important; border-top: 1.5px solid var(--line); }
  .fcell:first-child { border-top: 0; }
  .fstrip { grid-template-columns: 1fr 1fr; }
  .fstrip > div { border-top: 1.5px solid var(--line); }
  .fstrip > div:nth-child(odd) { border-left: 0; }
  .fstrip > div:last-child { grid-column: 1 / -1; text-align: left; border-left: 0; }
  .usecases { columns: 1; }
  .psearch { flex-direction: column; }
  .psearch label { border-right: 0; border-bottom: 1.5px solid var(--line); min-height: 36px; }
  .pane-bar { flex-direction: column; }
  .pane-actions { border-top: 1.5px solid var(--line); }
  .pane-actions button:first-child { border-left: 0; }
  [role="tabpanel"] { padding: 1rem; }
  .stage { padding: 1rem; }
  .ic-body { padding: 1.4rem 1rem; }
}
