/* Breadboard Home — shared styles */
:root {
  --paper: #f3f5f2;
  --paper-2: #e6ebe7;
  --ink: #1c2b36;
  --ink-soft: #4a5a66;
  --rule: #c9d2cf;
  --copper: #a8662a;
  --copper-ink: #8a521f;
  --safe: #2f6b55;
  --caution: #a87b12;
  --avoid: #a8382f;
  --code-bg: #e9eeea;
  --focus: #1f6fb2;
  --radius-sm: 3px;
  --radius-lg: 10px;
  --measure: 70ch;
  --sans: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #15212a;
    --paper-2: #1c2b36;
    --ink: #e4eaee;
    --ink-soft: #a9b6bf;
    --rule: #2f404c;
    --copper: #d79352;
    --copper-ink: #e6a96c;
    --safe: #5fb08f;
    --caution: #d9ab3c;
    --avoid: #e06a5f;
    --code-bg: #0f1920;
    --focus: #6fb3ec;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
}
a { color: var(--copper-ink); text-underline-offset: 2px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
img { max-width: 100%; height: auto; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.prose { max-width: var(--measure); }

/* Header */
.site-head { border-bottom: 1px solid var(--rule); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.brand svg { flex: none; }
.site-nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-nav a { color: var(--ink-soft); text-decoration: none; font-size: 0.97rem; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; }

/* Type scale */
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.015em; }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); margin: 0.2em 0 0.35em; }
h2 { font-size: 1.6rem; margin: 2em 0 0.5em; }
h3 { font-size: 1.22rem; margin: 1.6em 0 0.4em; }
p, ul, ol { margin: 0 0 1em; }
li { margin-bottom: 0.35em; }
.lede { font-size: 1.22rem; color: var(--ink-soft); max-width: 60ch; }
.meta { color: var(--ink-soft); font-size: 0.92rem; }

main { padding: 28px 0 56px; }

/* Hero */
.hero { padding: 40px 0 28px; }
.hero h1 { max-width: 18ch; font-size: clamp(2.3rem, 6vw, 3.8rem); }
.header-strip { margin: 28px 0 8px; display: flex; gap: 6px; flex-wrap: wrap; align-items: flex-end; }
.header-strip .pin { width: 26px; text-align: center; font-size: 0.68rem; color: var(--ink-soft); }
.header-strip .pin i { display: block; width: 18px; height: 18px; margin: 0 auto 4px; border-radius: 50%; border: 3px solid var(--copper); background: var(--paper); }
.header-strip .pin.safe i { background: var(--safe); }
.header-strip .pin.caution i { background: var(--caution); }
.header-strip .pin.avoid i { background: var(--avoid); }
.legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 0.9rem; color: var(--ink-soft); margin: 6px 0 0; padding: 0; list-style: none; }
.legend li::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.legend .safe::before { background: var(--safe); }
.legend .caution::before { background: var(--caution); }
.legend .avoid::before { background: var(--avoid); }

/* Index lists */
.section-title { font-size: 1.35rem; margin: 2.2em 0 0.6em; padding-bottom: 8px; border-bottom: 2px solid var(--ink); }
.entry-list { list-style: none; margin: 0; padding: 0; }
.entry-list li { padding: 18px 0; border-bottom: 1px solid var(--rule); margin: 0; }
.entry-list a.title { font-size: 1.25rem; font-weight: 700; color: var(--ink); text-decoration: none; }
.entry-list a.title:hover { color: var(--copper-ink); text-decoration: underline; }
.entry-list p { margin: 4px 0 0; color: var(--ink-soft); max-width: 66ch; }

/* Code */
code, pre, kbd { font-family: var(--mono); font-size: 0.9em; }
:not(pre) > code { background: var(--code-bg); padding: 1px 5px; border-radius: var(--radius-sm); }
pre { background: var(--code-bg); border: 1px solid var(--rule); border-radius: var(--radius-sm); padding: 14px 16px; overflow-x: auto; line-height: 1.5; font-size: 0.86rem; }

/* Callouts */
.note { border-left: 4px solid var(--copper); padding: 10px 16px; background: var(--paper-2); margin: 1.4em 0; }
.note.warn { border-left-color: var(--avoid); }
.note p:last-child { margin-bottom: 0; }

/* Tables */
.table-scroll { overflow-x: auto; margin: 1em 0 1.4em; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { border-bottom: 2px solid var(--ink); font-weight: 700; }

/* Forms / tools */
.tool { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 28px; align-items: start; margin-top: 18px; }
@media (max-width: 820px) { .tool { grid-template-columns: 1fr; } }
fieldset { min-width: 0; border: 1px solid var(--rule); border-radius: var(--radius-sm); padding: 12px 14px 6px; margin: 0 0 16px; }
legend { font-weight: 700; padding: 0 6px; }
label { display: block; font-size: 0.95rem; margin-bottom: 10px; }
input[type="text"], select {
  display: block; width: 100%; margin-top: 4px; padding: 8px 10px;
  font: inherit; font-size: 0.97rem; color: var(--ink); background: var(--paper);
  border: 1px solid var(--ink-soft); border-radius: var(--radius-sm);
}
.check { display: flex; gap: 8px; align-items: flex-start; }
.check input { margin-top: 5px; accent-color: var(--copper); }
.pins { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; padding-left: 26px; }
.pins[hidden] { display: none; }
.btn {
  font: inherit; font-weight: 700; cursor: pointer; padding: 9px 16px;
  border-radius: var(--radius-sm); border: 2px solid var(--ink); background: var(--ink); color: var(--paper);
}
.btn.secondary { background: transparent; color: var(--ink); }
.btn:hover { background: var(--copper-ink); border-color: var(--copper-ink); color: #fff; }
.output-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.output-head h2 { margin: 0; font-size: 1.2rem; }
.output pre { max-height: 640px; margin: 0; }
.warnings { list-style: none; padding: 0; margin: 10px 0 0; }
.warnings li { border-left: 4px solid var(--caution); padding: 6px 12px; background: var(--paper-2); margin-bottom: 6px; font-size: 0.93rem; }
.status { font-size: 0.9rem; color: var(--safe); min-height: 1.4em; }

/* Pin table states */
.tag { display: inline-block; font-weight: 700; font-size: 0.85rem; padding: 1px 8px; border-radius: 999px; color: #fff; white-space: nowrap; }
.tag.safe { background: var(--safe); }
.tag.caution { background: var(--caution); }
.tag.avoid { background: var(--avoid); }
@media (prefers-color-scheme: dark) { .tag { color: #10181e; } }
.filters { display: flex; gap: 14px; flex-wrap: wrap; align-items: end; margin: 14px 0; }
.filters label { margin: 0; min-width: 180px; }
tr.dim { opacity: 0.35; }

/* Ads */
.ad-slot { margin: 2em 0; min-height: 90px; }

/* Footer */
.site-foot { border-top: 1px solid var(--rule); padding: 24px 0 40px; color: var(--ink-soft); font-size: 0.92rem; }
.site-foot nav { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.site-foot a { color: var(--ink-soft); }

@media (prefers-reduced-motion: no-preference) {
  .header-strip .pin i { animation: pinIn 0.5s ease-out both; animation-delay: calc(var(--i) * 35ms); }
  @keyframes pinIn { from { transform: scale(0.4); opacity: 0; } to { transform: none; opacity: 1; } }
}
.tool > * { min-width: 0; }
.calc { margin: 1.4em 0; }
.calc fieldset { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 14px; }
.calc legend { grid-column: 1 / -1; }
#pw-out { border-left: 4px solid var(--safe); background: var(--paper-2); padding: 10px 16px; }
#pw-out p { margin: 0 0 0.4em; }

/* Parts gallery */
.parts { list-style: none; padding: 0; margin: 1.2em 0 1.6em; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.part { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.part-media { aspect-ratio: 4 / 3; max-width: 100%; background: #fff; border: 1px solid var(--rule); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.part-media img { width: 100%; height: 100%; object-fit: contain; }
.part-ph { color: var(--ink-soft); background: var(--paper-2); width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.part-name { font-weight: 700; font-size: 0.92rem; line-height: 1.3; }
.part-buy { font-size: 0.88rem; font-weight: 700; }
.part-credit { font-size: 0.72rem; color: var(--ink-soft); line-height: 1.3; }
.part-credit a { color: var(--ink-soft); }
