/* TheSolderBench — lab notebook: graph paper, blue and red ink, taped figures */
:root{
  --paper:#FBFBF4; --sheet:#FFFFFB; --ink:#1B2530; --muted:#5B6570; --rule:#D5DEE7;
  --grid:#E1E9F1; --margin:#E8A5A0;
  --blue-ink:#1D4E9E; --red-ink:#C0392B; --tape:rgba(242,214,120,.55); --sticky:#FFF1A8; --sticky-ink:#3B3413;
  --code-bg:#EEF1F4; --resistor:#D9C7A3;
  --c1:#7A4B2A; --c2:#C62828; --c3:#E8710A; --c4:#E0B400; --c5:#2E7D32; --c6:#1F5FAD; --c7:#6A3FA0; --c8:#6B7280;
  --head:"Bitter", Rockwell, "Roboto Slab", Georgia, serif;
  --body:"Source Serif 4", Georgia, "Times New Roman", serif;
  --hand:"Caveat", "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive;
  --mono:"JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  color-scheme:light;
}
@media (prefers-color-scheme: dark){
  :root{
    --paper:#121A21; --sheet:#16202A; --ink:#E4E9EE; --muted:#9AA6B1; --rule:#2A3743;
    --grid:#1B2631; --margin:#6B3A38;
    --blue-ink:#7FB0F0; --red-ink:#F08A7E; --tape:rgba(242,214,120,.25); --sticky:#4A4424; --sticky-ink:#F6EBC0;
    --code-bg:#1D2833; --resistor:#8C7B5C;
    --c1:#A8704A; --c6:#4F8FDB; --c7:#9A74CF; --c8:#9CA3AF;
    color-scheme:dark;
  }
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;color:var(--ink);font-family:var(--body);font-size:18px;line-height:1.65;
  background-color:var(--paper);
  background-image:linear-gradient(var(--grid) 1px,transparent 1px),linear-gradient(90deg,var(--grid) 1px,transparent 1px);
  background-size:24px 24px;padding-inline:16px}
img{max-width:100%;height:auto}
a{color:var(--blue-ink);text-underline-offset:3px;text-decoration-thickness:1px}
a:hover{text-decoration-thickness:2px}
:focus-visible{outline:3px solid var(--c4);outline-offset:2px}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.skip{position:absolute;left:-999px;top:8px;background:var(--ink);color:var(--paper);padding:8px 12px;z-index:10}
.skip:focus{left:8px}
h1,h2,h3{font-family:var(--head);line-height:1.15;text-wrap:balance;margin:0}
.pen{font-family:var(--hand);font-size:1.3rem;line-height:1.2;color:var(--red-ink);margin:0}
.pen.blue{color:var(--blue-ink)}
.pen.small{font-size:1.15rem}

/* header: notebook cover strip + index tabs */
.top{max-width:1100px;margin:0 auto;padding-top:22px}
.top-inner{display:flex;gap:16px;align-items:center;justify-content:space-between;flex-wrap:wrap}
.brand{display:flex;align-items:center;gap:12px;text-decoration:none;color:var(--ink)}
.brand-text{display:flex;flex-direction:column}
.brand-name{font-family:var(--head);font-weight:800;font-size:1.45rem;letter-spacing:-.01em;line-height:1.1}
.brand-tag{font-family:var(--hand);font-size:1.2rem;color:var(--blue-ink);line-height:1}
.top-search input{font:inherit;font-size:15px;padding:8px 12px;border:1.5px solid var(--rule);border-radius:4px;background:var(--sheet);color:var(--ink);width:230px;max-width:100%}
.tabs{display:flex;gap:6px;margin-top:18px;overflow-x:auto;scrollbar-width:thin;padding-top:4px}
.tabs a{flex:none;font-family:var(--head);font-size:14px;font-weight:700;color:var(--ink);text-decoration:none;padding:7px 12px 6px;
  background:var(--sheet);border:1px solid var(--rule);border-bottom:0;border-top:4px solid var(--band);border-radius:5px 5px 0 0;transition:transform .15s}
.tabs a:hover{transform:translateY(-3px)}

/* the sheet of paper */
.sheet{max-width:1100px;margin:0 auto 28px;background:var(--sheet);border:1px solid var(--rule);
  box-shadow:0 1px 0 var(--rule),0 3px 0 -1px var(--sheet),0 4px 0 -1px var(--rule);padding:28px 36px 36px}
main > .sheet:first-child{border-top-left-radius:0}
@media (max-width:700px){.sheet{padding:20px 18px 26px}}

/* resistor mark */
.bands{display:inline-flex;align-items:center;justify-content:center;position:relative;flex:none;vertical-align:middle}
.bands::before{content:"";position:absolute;left:0;right:0;top:50%;height:2px;margin-top:-1px;background:var(--muted);opacity:.6}
.bands i{position:relative;display:block;background:var(--resistor);border-radius:5px}
.bands i::after{content:"";position:absolute;top:0;bottom:0;background:var(--b)}
.bands-sm{width:24px;height:10px;margin-right:6px}.bands-sm i{width:14px;height:9px}.bands-sm i::after{left:3px;width:4px}
.bands-md{width:34px;height:14px;margin-right:9px}.bands-md i{width:21px;height:12px;border-radius:6px}.bands-md i::after{left:4px;width:6px}
.bands-lg{width:70px;height:26px;margin-right:12px}.bands-lg i{width:44px;height:24px;border-radius:12px}.bands-lg i::after{left:9px;width:10px}

/* home */
.home-grid{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:44px}
@media (max-width:900px){.home-grid{grid-template-columns:1fr}}
.home-intro{border-bottom:2px solid var(--ink);padding-bottom:14px;margin-bottom:8px}
.home-intro h1{font-size:clamp(2rem,4.5vw,2.8rem);font-weight:800}
.dek{font-size:1.1rem;color:var(--muted);margin:8px 0 0;max-width:62ch}
.more-link{margin-top:18px;font-size:1rem}
.index-card{border-top:2px solid var(--ink);padding-top:10px;margin-bottom:28px}
.index-card h2{font-size:1.2rem;font-weight:800;margin-bottom:8px}
.index-card p{font-size:.98rem;margin:6px 0 0}
.idx{list-style:none;margin:0;padding:0}
.idx a{display:flex;align-items:center;padding:6px 0;text-decoration:none;color:var(--ink);font-family:var(--head);font-weight:500;font-size:1rem}
.idx a:hover .idx-name{text-decoration:underline}
.idx-dots{flex:1;border-bottom:2px dotted var(--rule);margin:0 8px;transform:translateY(4px)}
.idx-count{font-variant-numeric:tabular-nums;color:var(--muted);font-size:.95rem}

/* sticky note */
.sticky{background:var(--sticky);color:var(--sticky-ink);font-family:var(--hand);font-size:1.35rem;line-height:1.25;
  padding:14px 16px 16px;transform:rotate(-1.2deg);box-shadow:0 6px 10px -6px rgba(0,0,0,.35);position:relative;max-width:340px}
.sticky::before{content:"";position:absolute;top:-10px;left:50%;width:70px;height:20px;margin-left:-35px;background:var(--tape);transform:rotate(2deg)}
.sticky span{display:block;font-family:var(--head);font-size:12px;font-weight:700;letter-spacing:.04em;opacity:.7;margin-bottom:2px}
.sticky.big h2{font-family:var(--hand);font-size:1.6rem;font-weight:700;margin-bottom:6px}
.sticky ol{margin:0;padding-left:22px}
.sticky ol a{color:var(--sticky-ink)}
.home-side .sticky{margin:6px 0 34px 6px}

/* bench log entries */
.log{display:grid}
.entry{display:grid;grid-template-columns:150px minmax(0,1fr);gap:22px;padding:22px 0;border-bottom:1px dashed var(--rule);align-items:start}
.entry:last-child{border-bottom:0}
@media (max-width:560px){.entry{grid-template-columns:96px minmax(0,1fr);gap:14px}}
.polaroid{display:block;background:#fff;padding:6px 6px 18px;border:1px solid #d9d9d2;transform:rotate(var(--tilt));box-shadow:0 5px 10px -6px rgba(0,0,0,.4);transition:transform .2s}
.polaroid:hover{transform:rotate(0) scale(1.04)}
.polaroid img{display:block;width:100%;aspect-ratio:5/3;object-fit:cover;background:#fff}
.entry-meta{font-family:var(--head);font-size:13px;color:var(--muted);margin:0 0 4px}
.entry-meta a{color:var(--muted);text-decoration:none}
.entry h3{font-size:1.28rem;font-weight:700}
.entry h3 a{color:var(--ink);text-decoration:none}
.entry h3 a:hover{text-decoration:underline;text-decoration-color:var(--blue-ink)}
.entry-desc{margin:6px 0 4px;color:var(--muted);font-size:1rem;line-height:1.5}

/* category */
.cat-head{border-bottom:2px solid var(--ink);padding-bottom:16px;margin-bottom:8px}
.cat-code{display:flex;align-items:center;margin:0 0 6px}
.cat-head h1{font-size:clamp(2.1rem,5vw,3rem);font-weight:800}

/* article */
.crumbs{font-family:var(--head);font-size:14px;color:var(--muted);margin-bottom:18px}
.crumbs a{color:var(--muted)}
.post{position:relative;max-width:820px;padding-left:64px}
.post::before{content:"";position:absolute;left:40px;top:-8px;bottom:0;width:2px;background:var(--margin)}
@media (max-width:700px){.post{padding-left:22px}.post::before{left:6px}}
.post.page{max-width:780px}
.post-head{margin-bottom:26px}
.post-log{font-family:var(--hand);font-size:1.35rem;color:var(--blue-ink);margin:0 0 4px}
.post h1{font-size:clamp(2rem,4.6vw,2.8rem);font-weight:800;margin-bottom:10px}
.meta{font-family:var(--head);font-size:14px;color:var(--muted);margin:12px 0 0;display:flex;align-items:center;flex-wrap:wrap;gap:0 6px}
.post-cat{display:inline-flex;align-items:center;color:var(--ink);text-decoration:none;font-weight:700}
.post-head .sticky{margin-top:22px}
.toc{border:1px solid var(--rule);background:var(--paper);padding:12px 18px;margin-bottom:28px}
.toc p{font-family:var(--hand);font-size:1.35rem;color:var(--blue-ink);margin:0 0 4px}
.toc ol{margin:0;padding-left:22px;font-size:.96rem;columns:2;column-gap:28px}
@media (max-width:600px){.toc ol{columns:1}}
.prose{max-width:68ch}
.prose h2{font-size:1.55rem;font-weight:800;margin:2.2rem 0 .7rem;scroll-margin-top:20px}
.prose h3{font-size:1.2rem;font-weight:700;margin:1.6rem 0 .5rem}
.prose p,.prose ul,.prose ol{margin:0 0 1.1rem}
.prose li{margin-bottom:.35rem}
.prose figure{position:relative;margin:2.2rem 0 2rem;background:#fff;border:1px solid #d9d9d2;padding:14px 14px 10px;box-shadow:0 8px 14px -10px rgba(0,0,0,.45);transform:rotate(-.4deg)}
.prose figure:nth-of-type(even){transform:rotate(.5deg)}
.prose figure::before,.prose figure::after{content:"";position:absolute;top:-11px;width:84px;height:22px;background:var(--tape)}
.prose figure::before{left:18px;transform:rotate(-4deg)}
.prose figure::after{right:18px;transform:rotate(3deg)}
.prose figure img{display:block;margin:0 auto}
.prose figcaption{font-family:var(--hand);font-size:1.3rem;line-height:1.25;color:#1D4E9E;margin-top:8px}
.prose code{font-family:var(--mono);font-size:.84em;background:var(--code-bg);padding:1px 5px;border-radius:3px}
.prose pre{background:#17222C;color:#E4ECF2;padding:16px 18px;border-radius:4px;overflow-x:auto;font-size:14.5px;line-height:1.55;margin:0 0 1.3rem}
.prose pre code{background:none;padding:0;font-size:inherit;color:inherit}
.prose table{display:block;overflow-x:auto;border-collapse:collapse;margin:0 0 1.3rem;font-size:.95rem;font-variant-numeric:tabular-nums}
.prose th,.prose td{border-bottom:1px solid var(--rule);padding:8px 12px;text-align:left;vertical-align:top}
.prose th{font-family:var(--head);font-size:14px;border-bottom:2px solid var(--ink)}
.prose blockquote{margin:0 0 1.2rem;padding:10px 16px;border:1.5px solid var(--blue-ink);border-radius:2px;font-family:var(--mono);font-size:.95rem;background:var(--paper)}
.prose blockquote p:last-child{margin:0}
.signoff{font-family:var(--hand);font-size:1.35rem;color:var(--blue-ink);margin:2rem 0 0}
.more h2{font-size:1.5rem;font-weight:800;border-bottom:2px solid var(--ink);padding-bottom:10px}
.prevnext{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-top:22px}
.pn{display:flex;flex-direction:column;gap:2px;padding:12px 14px;border:1px solid var(--rule);background:var(--paper);text-decoration:none;color:var(--ink);font-family:var(--head);font-weight:700;font-size:15px}
.pn span{font-family:var(--hand);font-size:1.2rem;color:var(--blue-ink);font-weight:500}
.pn.next{text-align:right;grid-column:2}
@media (max-width:600px){.prevnext{grid-template-columns:1fr}.pn.next{grid-column:1;text-align:left}}

/* search / 404 */
.search-page h1,.notfound h1{font-size:clamp(2rem,4.5vw,2.6rem);font-weight:800;margin-bottom:16px}
.big-search{display:flex;gap:8px;max-width:560px}
.big-search input{flex:1;min-width:0;font:inherit;font-size:16px;padding:11px 14px;border:1.5px solid var(--rule);border-radius:4px;background:var(--paper);color:var(--ink)}
.big-search button{font-family:var(--head);font-weight:700;font-size:15px;padding:0 18px;border:0;border-radius:4px;background:var(--blue-ink);color:#fff;cursor:pointer}
@media (prefers-color-scheme: dark){.big-search button{color:#121A21}}
.note{color:var(--muted);font-size:.98rem}
.results{display:grid;margin-top:8px}
.result{padding:14px 0;border-bottom:1px dashed var(--rule)}
.result small{font-family:var(--head);color:var(--muted);font-size:13px}
.result a{font-family:var(--head);font-weight:700;font-size:1.15rem}
.result p{margin:4px 0 0;color:var(--muted);font-size:.98rem}
.notfound{max-width:1100px}

/* footer */
.foot{max-width:1100px;margin:0 auto;padding:10px 0 30px;color:var(--muted);font-size:.95rem}
.foot-inner{display:flex;justify-content:space-between;gap:20px;flex-wrap:wrap}
.foot-inner p{margin:0 0 6px;max-width:52ch}
.foot-brand{font-family:var(--head);font-weight:800;color:var(--ink)}
.foot-inner nav{display:flex;gap:6px 18px;flex-wrap:wrap;font-family:var(--head);font-size:15px}
.copy{font-family:var(--head);font-size:13px;margin:10px 0 0}
@media (prefers-reduced-motion:reduce){*{transition:none!important}}
