/* Architectural broadsheet: bone paper, one indigo, a grotesque at poster size
   and a mono for annotations. Flat. No shadows, no radius, no cards. */

:root {
  --indigo: #1925aa;
  --bone: #e8e6e0;
  --ink: #000;
  --paper: #fff;
  --deep: #0d1355;

  --sans: 'Inter', 'Helvetica Neue', ui-sans-serif, system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --rule: rgba(0, 0, 0, 0.14);
  --gap: 80px;
}

* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 56px; }
body {
  background: var(--bone);
  color: var(--ink);
  font: 400 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
img, svg, canvas { display: block; }
code, pre { font-family: var(--mono); }
b { font-weight: 500; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ---------------------------------------------------------------- bands */
.band { position: relative; padding: var(--gap) 0; }
.band.bone { background: var(--bone); }
.band.indigo {
  background: var(--indigo);
  color: var(--bone);
  --rule: rgba(232, 230, 224, 0.28);
}

/* ---------------------------------------------------------------- type */
.m {
  font: 400 10px/1.5 var(--mono);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.m.lg { font-size: 12px; }
.display {
  font-weight: 400;
  font-size: clamp(52px, 13.3vw, 160px);
  line-height: 0.94;
  letter-spacing: -0.005em;
}
h2, h3 { font-weight: 400; }
.h-lg { font-size: clamp(30px, 4.4vw, 46px); line-height: 1.05; max-width: 22ch; }
.lede { font-size: 18px; line-height: 1.5; max-width: 52ch; }
.note { font: 400 12px/1.6 var(--mono); max-width: 70ch; }
.indigo-text { color: var(--indigo); }

.band.bone .display { color: var(--indigo); }
.hero .display { color: var(--ink); }

/* annotation printed in the right margin */
.side {
  position: absolute;
  right: 14px; top: var(--gap);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 18px;
  line-height: 1;
  opacity: 0.9;
}
.band.bone .side { color: var(--indigo); }

.section-head { margin-bottom: 40px; }
.section-head .m { margin-bottom: 20px; display: block; }
.section-head .display { margin-bottom: 28px; }

/* ---------------------------------------------------------------- header */
.top {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  height: 56px; padding: 0 24px;
  background: var(--bone);
  border-bottom: 1px solid var(--rule);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--deep); text-decoration: none;
  font: 400 10px/1 var(--mono); letter-spacing: 0.02em; text-transform: uppercase;
}
.brand .sq { width: 14px; height: 14px; background: var(--deep); }
.top nav { display: flex; gap: 26px; }
.top nav a {
  font: 400 10px/1 var(--mono); letter-spacing: 0.02em; text-transform: uppercase;
  text-decoration: none;
}
.top nav a:hover { color: var(--indigo); }
.top .btn.menu { display: none; }

/* paper button with a flush indigo square: indigo is a mark here, never a fill for the action */
.btn {
  display: inline-flex; align-items: stretch;
  height: 40px; padding: 0; border: 0;
  background: var(--paper); color: var(--ink);
  font: 400 10px/1 var(--mono); letter-spacing: 0.02em; text-transform: uppercase;
  text-decoration: none; cursor: pointer;
}
.btn span { display: flex; align-items: center; padding: 0 16px; }
.btn i {
  display: grid; place-items: center;
  width: 40px; background: var(--indigo); color: #fff;
  font: 400 14px/1 var(--mono); font-style: normal;
}
.btn:hover span { text-decoration: underline; text-underline-offset: 3px; }

/* ---------------------------------------------------------------- hero */
.hero { padding: 56px 0 0; }
.hero-meta {
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px;
  padding: 40px 0 56px;
}
.hero-meta .lede { grid-column: 1; margin-top: 16px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; align-self: end; justify-self: end; }

/* ---------------------------------------------------------------- 3d stages */
.stage { position: relative; overflow: hidden; }
.stage canvas { width: 100%; height: 100%; touch-action: pan-y; }
.stage .tags { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.hero-stage {
  height: clamp(420px, 66vh, 640px);
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  --tagbg: var(--ink); --tagfg: var(--bone);
}
.explore-stage { --tagbg: var(--bone); --tagfg: var(--indigo); }
.explore-stage { height: clamp(420px, 70vh, 640px); }
.wire-sheet { background: #fff; overflow-x: auto; }
.wire-svg { width: 100%; min-width: 820px; height: auto; }
.wire-svg .wire { transition: stroke-width 0.15s; }
.stage .fig { position: absolute; left: 24px; bottom: 16px; }
.stage .fallback {
  display: none; position: absolute; inset: 0; padding: 40px 24px;
  font: 400 12px/1.6 var(--mono); text-transform: uppercase;
}
.stage.no-webgl .fallback { display: block; }
.stage.no-webgl canvas, .stage.no-webgl .tags { display: none; }

/* labels pinned to points in a scene */
.tag3d {
  position: absolute; left: 0; top: 0; width: 0; height: 0;
  padding: 0; border: 0; background: none; color: inherit;
  font: 400 10px/1 var(--mono); letter-spacing: -0.02em; text-transform: uppercase;
  pointer-events: auto; will-change: transform;
}
button.tag3d { cursor: pointer; }
.tag3d::before {
  content: ''; position: absolute; left: -2px; top: -2px; width: 5px; height: 5px; background: currentColor;
}
.tag3d b { position: absolute; top: 0; height: 1px; width: var(--len); background: currentColor; opacity: 0.75; }
.tag3d.r b { left: 0; }
.tag3d.l b { right: 0; }
.tag3d > span { position: absolute; top: -6px; padding: 3px 5px; white-space: nowrap; }
.tag3d.r > span { left: calc(var(--len) + 1px); }
.tag3d.l > span { right: calc(var(--len) + 1px); }
.tag3d.on > span, button.tag3d:hover > span { background: var(--tagbg); color: var(--tagfg); }
.tag3d.quiet b, .tag3d.quiet::before { display: none; }
.tag3d.quiet > span { left: 0; top: -16px; padding: 0; opacity: 0.85; }
.tag3d.pin > span { padding: 2px 4px; }

/* ---------------------------------------------------------------- accordion */
.acc { border-top: 1px solid var(--rule); }
.acc details { border-bottom: 1px solid var(--rule); }
.acc summary {
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  padding: 22px 0; cursor: pointer; list-style: none;
  font-size: 24px; font-weight: 500; line-height: 1.3; color: var(--indigo);
}
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after { content: '+'; font-weight: 400; }
.acc details[open] summary::after { content: '×'; }
.acc .body { padding: 0 0 28px 40px; max-width: 78ch; }
.acc .body p { font: 400 12px/1.7 var(--mono); letter-spacing: 0.01em; color: var(--indigo); text-transform: uppercase; }
.acc .body a { display: inline-block; margin-top: 14px; font: 400 10px/1 var(--mono); text-decoration: none; color: var(--indigo); }
.acc .body a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- pipeline */
.pipeline {
  display: grid; grid-template-columns: repeat(5, 1fr);
  list-style: none; padding: 0; margin-top: 64px;
  border-top: 1px solid var(--rule);
}
.pipeline li { padding: 20px 20px 0 0; border-right: 1px solid var(--rule); margin-right: 20px; }
.pipeline li:last-child { border-right: 0; margin-right: 0; }
.pipeline .m { display: block; margin-bottom: 40px; }
.pipeline b { display: block; font-size: 24px; font-weight: 500; line-height: 1.2; margin-bottom: 8px; color: var(--indigo); }
.pipeline span:not(.m) { font-size: 14px; line-height: 1.5; display: block; }

/* line diagrams */
.diagram { margin-top: 56px; overflow-x: auto; }
.diagram svg { min-width: 720px; width: 100%; height: auto; }
.diagram rect { fill: none; stroke: currentColor; stroke-width: 1; }
.diagram path, .diagram line { fill: none; stroke: currentColor; stroke-width: 1; }
.diagram text { font: 400 11px var(--mono); letter-spacing: 0.02em; text-transform: uppercase; fill: currentColor; }
.diagram text.dim { opacity: 0.6; }
.diagram figcaption { margin-top: 14px; }
.band.bone .diagram { color: var(--ink); }

/* ---------------------------------------------------------------- explorer */
.explorer { display: grid; grid-template-columns: 2fr 1fr; gap: 40px; align-items: start; }
.panel h3 { font-size: 36px; line-height: 1.1; margin: 12px 0 6px; }
.panel .size { display: block; margin-bottom: 18px; opacity: 0.8; }
.panel p.text { font-size: 16px; min-height: 7.5em; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 20px; }
.chip {
  border: 0; background: var(--paper); color: var(--ink);
  padding: 11px 12px; cursor: pointer;
  font: 400 10px/1 var(--mono); letter-spacing: 0.02em; text-transform: uppercase;
}
.chip:hover { text-decoration: underline; text-underline-offset: 3px; }
.chip[aria-pressed='true'] { background: var(--ink); color: var(--bone); }
.slider { display: flex; align-items: center; gap: 16px; margin-top: 28px; }
.slider input { flex: 1; accent-color: var(--paper); }

/* ---------------------------------------------------------------- parts list */
.rows { border-top: 1px solid var(--rule); }
.part {
  display: grid; grid-template-columns: 1.3fr 56px 1.3fr 2fr; gap: 16px; align-items: baseline;
  padding: 18px 0; border-bottom: 1px solid var(--rule);
}
.part-name { font-size: 24px; font-weight: 500; line-height: 1.2; color: var(--indigo); }
.part-qty, .part-spec { font: 400 12px/1.5 var(--mono); text-transform: uppercase; }
.part-why { font-size: 16px; }
input:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--indigo); outline-offset: 3px; }
.band.indigo :focus-visible { outline-color: var(--bone); }
.notes { margin-top: 28px; display: grid; gap: 10px; }

/* ---------------------------------------------------------------- wiring */
.wire-info { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 32px; }
.wire-info h3 { font-size: 30px; line-height: 1.2; margin-bottom: 14px; }
.wire-info p { max-width: 60ch; }
.wire-card.warn h3::before { content: '! '; }
.legend { list-style: none; padding: 0; margin-top: 18px; display: grid; gap: 6px; }
.legend li { display: flex; align-items: center; gap: 12px; font: 400 12px/1.4 var(--mono); }
.swatch { width: 24px; height: 3px; display: inline-block; }
table { width: 100%; border-collapse: collapse; font: 400 12px/1.5 var(--mono); }
th, td { text-align: left; font-weight: 400; padding: 9px 12px 9px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
thead th { text-transform: uppercase; font-size: 10px; opacity: 0.8; }
tbody th { white-space: nowrap; }
.rules { margin-top: 64px; border-top: 1px solid var(--rule); padding-top: 24px; }
.rules ol { margin: 18px 0 18px 22px; display: grid; gap: 10px; font-size: 18px; max-width: 60ch; }
.rules ::marker { font-family: var(--mono); }

/* ---------------------------------------------------------------- build phases */
.phases { list-style: none; padding: 0; border-top: 1px solid var(--rule); }
.phase {
  display: grid; grid-template-columns: 56px 1fr; gap: 16px; align-items: baseline;
  padding: 22px 0; border-bottom: 1px solid var(--rule);
}
.phase-num { font: 400 12px/1.5 var(--mono); }
.phase-title { display: block; font-size: 24px; font-weight: 500; line-height: 1.2; color: var(--indigo); margin-bottom: 6px; }
.phase-text { display: block; max-width: 70ch; }

/* ---------------------------------------------------------------- firmware */
.fw { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.fw p { margin-bottom: 16px; max-width: 56ch; }
pre {
  background: var(--paper); color: var(--ink);
  padding: 20px; margin: 20px 0; overflow-x: auto;
  font: 400 14px/1.7 var(--mono); letter-spacing: 0.02em;
}
.sub { font-size: 30px; line-height: 1.2; margin: 72px 0 24px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--rule); }
.stat { padding: 20px 20px 24px 0; border-right: 1px solid var(--rule); margin-right: 20px; }
.stat:last-child { border-right: 0; margin-right: 0; }
.stat strong { display: block; font-size: clamp(30px, 3.6vw, 46px); font-weight: 400; line-height: 1.05; margin-bottom: 8px; }
.stat .m { display: block; }
.stat .m + .m { margin-top: 18px; opacity: 0.75; }

/* ---------------------------------------------------------------- footer */
.foot { margin-top: 96px; border-top: 1px solid var(--rule); padding-top: 40px; }
.foot .display { margin-bottom: 28px; }
.foot-links { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 24px; }
.foot-links a { font: 400 12px/1 var(--mono); text-transform: uppercase; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1320px) { .side { display: none; } }
@media (max-width: 900px) {
  :root { --gap: 56px; }
  .side { display: none; }
  .top nav { display: none; position: absolute; top: 56px; left: 0; right: 0; flex-direction: column; gap: 0; background: var(--bone); border-bottom: 1px solid var(--rule); }
  .top nav.open { display: flex; }
  .top nav a { padding: 16px 24px; border-top: 1px solid var(--rule); }
  .top .btn.menu { display: inline-flex; }
  .hero-meta, .explorer, .wire-info, .fw { grid-template-columns: 1fr; gap: 32px; }
  .actions { justify-self: start; }
  .pipeline { grid-template-columns: 1fr; }
  .pipeline li { border-right: 0; margin-right: 0; border-bottom: 1px solid var(--rule); padding: 20px 0; }
  .pipeline .m { margin-bottom: 12px; }
  .part { grid-template-columns: 1fr 48px; }
  .part-spec, .part-why { grid-column: 1 / -1; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(2) { border-right: 0; margin-right: 0; }
  .stat { border-bottom: 1px solid var(--rule); }
  .acc .body { padding-left: 0; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .top { padding: 0 16px; }
  .brand .long { display: none; }
  .phase { grid-template-columns: 32px 1fr; gap: 12px; }
  .hero-stage .tag3d, .explore-stage .tag3d { display: none !important; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
