/* The Light Brothers - shared styles for every page.
   "Workbench" style: light, graph paper, PCB green. The earlier dark style is in site-clean.css. */
:root {
  --bg: #f4f1e8;
  --panel: #fff;
  --line: #d5cfbf;
  --text: #22241f;
  --muted: #5f6258;
  --accent: #0b6b3a;   /* PCB green: links, buttons, header */
  --gold: #c9a227;     /* solder pad gold */
  --red: #d93a2b;
  --green: #1f9d4c;
  --yellow: #e0a800;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* graph paper */
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(11, 107, 58, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11, 107, 58, .07) 1px, transparent 1px);
  background-size: 24px 24px;
}
a { color: var(--accent); }
img { max-width: 100%; height: auto; display: block; border-radius: 6px; border: 1px solid var(--line); }

main, footer { max-width: 960px; margin: 0 auto; padding: 0 16px; }
/* Full-width green bar, with its contents lined up to the 960px column */
header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px 24px; padding: 16px max(16px, calc(50% - 464px));
  background: var(--accent); border-bottom: 4px solid var(--gold);
}
.brand { font: 700 1.2rem Georgia, "Times New Roman", serif; color: #fff; text-decoration: none; }
nav a { margin-right: 18px; text-decoration: none; color: #d9f0e1; }
nav a:hover { text-decoration: underline; }
nav a[aria-current="page"] { color: #fff; font-weight: 600; text-decoration: underline; text-underline-offset: 6px; }
footer {
  margin-top: 48px; padding-top: 16px; padding-bottom: 32px;
  border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem;
}

h1, h2 { font-family: Georgia, "Times New Roman", serif; }
h1 { font-size: 2.4rem; line-height: 1.2; margin: 28px 0 8px; }
h2 { line-height: 1.25; margin: 40px 0 12px; border-bottom: 2px solid var(--text); padding-bottom: 4px; }
.lead { color: var(--muted); font-size: 1.1rem; margin-top: 0; }

/* The three display colours as a divider */
.rows { display: flex; gap: 6px; margin: 12px 0 24px; }
.rows span { height: 4px; width: 56px; border-radius: 2px; }
.rows span:nth-child(1) { background: var(--red); }
.rows span:nth-child(2) { background: var(--green); }
.rows span:nth-child(3) { background: var(--yellow); }

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 16px;
  box-shadow: 0 2px 0 var(--line), 0 8px 18px rgba(0, 0, 0, .06);
}
.card h3 { margin: 12px 0 4px; }
.card p { margin: 4px 0 8px; }
.card.soon { border-style: dashed; color: var(--muted); background: transparent; box-shadow: none; }
.tag {
  display: inline-block; font-size: .75rem; letter-spacing: .06em; text-transform: uppercase;
  border: 1px solid var(--line); border-radius: 99px; padding: 1px 10px; color: var(--muted);
}

.button {
  display: inline-block; background: var(--accent); color: #fff; font-weight: 700;
  text-decoration: none; padding: 11px 22px; border-radius: 6px; margin: 0 10px 10px 0;
  border: 2px solid var(--accent); cursor: pointer; font-size: 1rem; font-family: inherit;
}
.button.alt { background: #fff; color: var(--accent); }

.video { position: relative; aspect-ratio: 16 / 9; margin: 16px 0; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.note {
  border-left: 4px solid var(--yellow); background: #fff8d6;
  padding: 10px 14px; border-radius: 0 6px 6px 0; margin: 14px 0;
}
.note.warn { border-left-color: var(--red); background: #fdecea; }

/* Assembly steps */
.steps { counter-reset: step; list-style: none; padding: 0; }
.steps > li {
  counter-increment: step; background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; padding: 16px; margin-bottom: 16px;
  box-shadow: 0 2px 0 var(--line), 0 8px 18px rgba(0, 0, 0, .06);
}
.steps > li > h3 { margin: 0 0 8px; }
.steps > li > h3::before { content: "Step " counter(step) ". "; color: var(--accent); }
.photos {
  display: grid; gap: 10px; margin-top: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); align-items: start;
}
.photos img { max-height: 420px; width: auto; margin: 0 auto; }

table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }

/* Code pages */
pre.code {
  background: #0d0f12; color: #e8e9ec; border: 1px solid var(--line); border-radius: 8px; padding: 14px;
  overflow: auto; max-height: 70vh; font: 13px/1.5 Consolas, "SF Mono", Menlo, monospace;
  tab-size: 2;
}
code { font-family: Consolas, "SF Mono", Menlo, monospace; font-size: .92em; }
h2.file { font-size: 1.1rem; word-break: break-all; border-bottom: 0; }

.hero { max-height: 65vh; width: auto; margin: 0 auto; }

/* The three circuits, labelled like the tape strips on the movie dashboard */
.circuit { border-top: 4px solid var(--line); }
.circuit.red { border-top-color: var(--red); }
.circuit.green { border-top-color: var(--green); }
.circuit.yellow { border-top-color: var(--yellow); }
.tape {
  display: inline-block; background: #050505; color: #fff; padding: 2px 10px; border-radius: 2px;
  font: 700 .85rem/1.6 Consolas, "SF Mono", Menlo, monospace; letter-spacing: .1em; text-transform: uppercase;
}

/* "Print / save as PDF" on the assembly page */
@media print {
  body { background: #fff; }
  header { background: none; border: 0; }
  .brand { color: #000; }
  header nav, .no-print { display: none; }
  .card, .steps > li { box-shadow: none; }
  .steps > li, .photos img { break-inside: avoid; }
  .photos img { max-height: 220px; }
}
