/* Bob's Guitars — rebuilt 2026
   Fixed index rail on the left, one scrolling reading pane on the right.
   No frameworks, no CDN, no build step. */

:root {
  --paper:      #f6f1e6;
  --rail:       #ece2ce;
  --paper-warm: #efe7d6;
  --card:       #fffdf8;
  --ink:        #1a1712;
  --ink-soft:   #4a4438;
  --muted:      #7b7261;
  --line:       #d6cab2;
  --accent:     #a34d22;
  --deep:       #16302b;
  --cream:      #efe8d8;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans:  "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;

  --rail-w: 272px;
  --ease: cubic-bezier(.2,.7,.3,1);
}

* { box-sizing: border-box; }

html, body { height: 100%; }
body {
  margin: 0;
  overflow: hidden;                 /* the window never scrolls — the pane does */
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }

.wrap { width: min(100% - 3rem, 1120px); margin-inline: auto; }
@media (max-width: 640px) { .wrap { width: min(100% - 2rem, 1120px); } }

/* ---------- the shell ---------- */

.shell {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
}

/* ---------- the rail: fixed, never moves ---------- */

.side {
  background: var(--rail);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 1.1rem 1rem .9rem;
  overflow: hidden;
}

.brand-thumb {
  width: 100%;
  height: 104px;
  object-fit: cover;
  object-position: center 22%;
  border: 1px solid var(--line);
  margin-bottom: 1rem;
  filter: saturate(.95);
}

.side h1 {
  font-size: 1.5rem;
  line-height: 1;
  letter-spacing: -.01em;
  font-weight: 500;
  margin: 0 0 .4rem;
}
.side h1 em { font-style: italic; color: var(--accent); }

.brand-lede {
  font-size: .8rem;
  line-height: 1.45;
  color: var(--muted);
  margin: 0 0 1.15rem;
}

.index {
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow-y: auto;
  flex: 1 1 auto;
  margin: 0 -.35rem;
  padding: 0;
}
.index::-webkit-scrollbar { width: 6px; }
.index::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }

.index button {
  appearance: none;
  background: none;
  border: 0;
  border-left: 2px solid transparent;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem;
  width: 100%;
  text-align: left;
  padding: .46rem .55rem .46rem .65rem;
  font-family: var(--sans);
  font-size: .775rem;
  letter-spacing: .085em;
  text-transform: uppercase;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.index button:hover { background: rgba(255,253,248,.65); color: var(--ink); }
.index button[aria-selected="true"] {
  color: var(--accent);
  border-left-color: var(--accent);
  background: rgba(255,253,248,.9);
  font-weight: 600;
}
.index button .n {
  font-size: .68rem;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--muted);
  opacity: .8;
}
.index button[aria-selected="true"] .n { color: var(--accent); opacity: .75; }

.side-foot {
  font-family: var(--sans);
  font-size: .67rem;
  line-height: 1.55;
  color: var(--muted);
  margin: 1rem 0 0;
  padding-top: .75rem;
  border-top: 1px solid var(--line);
}

/* ---------- the reading pane: the only thing that scrolls ---------- */

.content {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  background: var(--paper);
  position: relative;
}
.content::-webkit-scrollbar { width: 11px; }
.content::-webkit-scrollbar-track { background: var(--paper); }
.content::-webkit-scrollbar-thumb { background: #cfc3a9; border-radius: 6px; border: 3px solid var(--paper); }
.content::-webkit-scrollbar-thumb:hover { background: #b8a98b; }

.panel { display: none; padding-block: clamp(1.8rem, 3.5vw, 2.6rem) 3rem; }
.panel.active { display: block; animation: fade .3s var(--ease); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.panel-head { max-width: 66ch; margin-bottom: clamp(1.4rem, 3vw, 2.2rem); }
.panel-head h2 {
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  line-height: 1.08;
  letter-spacing: -.01em;
  font-weight: 500;
  margin: 0 0 .7rem;
}
.panel-head p { color: var(--ink-soft); margin: 0 0 .7rem; }
.panel-head p:last-child { margin-bottom: 0; }

.kicker {
  font-family: var(--sans);
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 .7rem;
}

/* ---------- jump row inside a long section ---------- */

.jumprow {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin: 0 0 1.6rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--line);
}
.jumprow a {
  font-family: var(--sans);
  font-size: .7rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: none;
  background: var(--card);
  border: 1px solid var(--line);
  padding: .35rem .72rem;
  border-radius: 999px;
  transition: border-color .15s, color .15s;
}
.jumprow a:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- finds ---------- */

.find {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.4rem, 3.5vw, 3rem);
  align-items: start;
  padding-block: clamp(1.5rem, 3vw, 2.2rem);
}
.find + .find { border-top: 1px solid var(--line); }
.find:nth-child(even) .find-photo { order: 2; }
@media (max-width: 780px) {
  .find { grid-template-columns: 1fr; gap: 1.3rem; }
  .find:nth-child(even) .find-photo { order: 0; }
}

.find-photo { display: grid; gap: .6rem; }
.find-photo img {
  width: 100%;
  cursor: zoom-in;
  border: 1px solid var(--line);
  transition: opacity .3s var(--ease);
  background: var(--paper-warm);
}
.find-photo img:hover { opacity: .88; }
.find-photo.pair { grid-template-columns: 1fr 1fr; }

.find-meta {
  font-family: var(--sans);
  font-size: .71rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .9rem;
  margin-bottom: .7rem;
}
.find-meta b { color: var(--accent); font-weight: 600; }

.find h3 {
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  line-height: 1.16;
  font-weight: 500;
  margin: 0 0 .8rem;
  letter-spacing: -.01em;
}
.find p { margin: 0 0 .9rem; color: var(--ink-soft); max-width: 62ch; }
.find p:last-child { margin-bottom: 0; }
.whisper { font-size: .93rem; color: var(--muted); font-style: italic; }

/* ---------- link shelves ---------- */

.shelf { columns: 2 300px; column-gap: 1rem; }
@media (max-width: 700px) { .shelf { columns: 1; } }

.shelf a {
  display: block;
  break-inside: avoid;
  margin-bottom: .5rem;
  padding: .7rem .9rem;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  font-size: .93rem;
  line-height: 1.42;
  transition: border-color .18s, transform .18s var(--ease);
}
.shelf a:hover { border-color: var(--accent); transform: translateY(-1px); color: var(--ink); }
.shelf a small {
  display: block;
  font-family: var(--sans);
  font-size: .69rem;
  letter-spacing: .04em;
  color: var(--muted);
  margin-top: .2rem;
  word-break: break-all;
}

.shelf-title {
  font-family: var(--sans);
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 2.2rem 0 .9rem;
  padding-bottom: .4rem;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 1rem;
}
.shelf-title:first-of-type { margin-top: 0; }

/* ---------- gallery ---------- */

.gallery { columns: 4 210px; column-gap: .9rem; }
.gallery figure {
  margin: 0 0 .9rem;
  break-inside: avoid;
  cursor: zoom-in;
  border: 1px solid var(--line);
  background: var(--paper-warm);
  overflow: hidden;
}
.gallery img { width: 100%; height: auto; transition: transform .5s var(--ease), opacity .3s; }
.gallery figure:hover img { transform: scale(1.02); opacity: .94; }
.gallery-note { font-family: var(--sans); font-size: .8rem; color: var(--muted); margin-top: 1.2rem; }

/* ---------- reference ---------- */

.ref {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.4rem, 3.5vw, 3rem);
  align-items: start;
  padding-block: clamp(1.5rem, 3vw, 2.2rem);
}
.ref + .ref { border-top: 1px solid var(--line); }
@media (max-width: 820px) { .ref { grid-template-columns: 1fr; } }
.ref img { border: 1px solid var(--line); cursor: zoom-in; background: #fff; }
.ref h3 { font-size: 1.4rem; font-weight: 500; margin: 0 0 .8rem; }
.ref p { color: var(--ink-soft); margin: 0 0 .9rem; max-width: 62ch; }
.ref .whisper { font-size: .9rem; }

.table-scroll { overflow-x: auto; border: 1px solid var(--line); background: var(--card); }
table.serials { border-collapse: collapse; width: 100%; font-family: var(--sans); font-size: .85rem; }
table.serials caption {
  text-align: left; padding: .85rem 1rem;
  font-family: var(--sans); font-size: .72rem;
  letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}
table.serials th, table.serials td { padding: .45rem 1rem; text-align: left; border-top: 1px solid var(--line); }
table.serials th { font-weight: 600; color: var(--ink); }
table.serials td { color: var(--ink-soft); font-variant-numeric: tabular-nums; }

/* ---------- blog / friends ---------- */

.post {
  background: var(--card);
  border: 1px solid var(--line);
  padding: clamp(1.3rem, 2.8vw, 2rem);
  max-width: 68ch;
}
.post .post-meta {
  font-family: var(--sans); font-size: .71rem;
  letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  margin-bottom: .9rem;
}
.post h3 { font-size: 1.45rem; font-weight: 500; margin: 0 0 .9rem; }
.post p { color: var(--ink-soft); }

.friend {
  border-top: 1px solid var(--line);
  padding-block: clamp(1.4rem, 3vw, 2.2rem);
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: clamp(1.2rem, 3vw, 2.6rem);
  align-items: start;
}
@media (max-width: 720px) { .friend { grid-template-columns: 1fr; } }
.friend img { border: 1px solid var(--line); }
.friend h3 { font-size: 1.3rem; font-weight: 500; margin: 0 0 .6rem; }
.friend p { margin: 0 0 .7rem; color: var(--ink-soft); max-width: 62ch; }
.friend p:last-child { margin-bottom: 0; }

/* ---------- audio ---------- */

.audio { display: grid; gap: .9rem; max-width: 620px; margin-bottom: 1rem; }
.audio .track {
  background: var(--card); border: 1px solid var(--line);
  padding: .9rem 1.1rem;
  font-family: var(--sans); font-size: .9rem;
}
.audio .track b { display: block; color: var(--ink); margin-bottom: .5rem; letter-spacing: .04em; }
.audio audio { width: 100%; margin-top: .4rem; }

/* ---------- footer inside the pane ---------- */

.foot {
  border-top: 1px solid var(--line);
  background: var(--paper-warm);
  padding-block: 2rem 2.6rem;
  margin-top: 2rem;
}
.foot .wrap { display: grid; grid-template-columns: 1.5fr 1fr; gap: 2rem; }
@media (max-width: 720px) { .foot .wrap { grid-template-columns: 1fr; } }
.foot h4 {
  font-family: var(--sans); font-size: .7rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 .6rem;
}
.foot p { margin: 0; color: var(--ink-soft); font-size: .9rem; max-width: 62ch; }

/* ---------- back to top ---------- */

.to-top {
  position: fixed;
  right: 1.6rem;
  bottom: 1.6rem;
  z-index: 40;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-soft);
  font-size: 1rem;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, background .2s, color .2s;
  box-shadow: 0 6px 18px rgba(26,23,18,.12);
}
.to-top.show { opacity: 1; pointer-events: auto; }
.to-top:hover { background: var(--accent); color: var(--paper); border-color: var(--accent); }

/* ---------- lightbox ---------- */

.lb {
  position: fixed; inset: 0; z-index: 100;
  display: none; padding: clamp(1rem, 4vw, 3rem);
  background: rgba(14,13,10,.95);
  align-items: center; justify-content: center;
}
.lb.open { display: flex; }
.lb img { max-width: 100%; max-height: 88vh; width: auto; object-fit: contain; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.lb button {
  position: absolute;
  background: rgba(246,241,230,.09);
  color: var(--cream);
  border: 1px solid rgba(246,241,230,.25);
  font-size: 1.4rem; line-height: 1;
  width: 48px; height: 48px; border-radius: 50%;
  cursor: pointer; font-family: var(--sans);
  transition: background .2s;
}
.lb button:hover { background: rgba(246,241,230,.2); }
.lb .prev { left: clamp(.5rem, 3vw, 2rem); }
.lb .next { right: clamp(.5rem, 3vw, 2rem); }
.lb .close { top: clamp(.5rem, 3vw, 1.5rem); right: clamp(.5rem, 3vw, 1.5rem); }
.lb .count {
  position: absolute; bottom: 1.2rem; left: 0; right: 0;
  text-align: center; font-family: var(--sans); font-size: .75rem;
  letter-spacing: .14em; color: #b9b1a0;
}

/* ---------- reveal ---------- */

.reveal { opacity: 0; transform: translateY(12px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .content { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}

::selection { background: var(--accent); color: var(--paper); }

/* ---------- narrow: the rail folds into a top strip ---------- */

@media (max-width: 920px) {
  html, body { height: auto; overflow: auto; }
  .shell { display: block; height: auto; }

  .side {
    position: sticky; top: 0; z-index: 60;
    display: block;
    padding: .55rem .8rem .5rem;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: var(--rail);
  }
  .brand-thumb, .brand-lede, .side-foot { display: none; }
  .side h1 { font-size: 1rem; margin: 0 0 .45rem; }

  .index { flex-direction: row; overflow-x: auto; gap: 0; margin: 0 -.8rem; padding: 0 .8rem; }
  .index::-webkit-scrollbar { display: none; }
  .index button {
    border-left: 0;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    width: auto;
    padding: .4rem .6rem .5rem;
  }
  .index button[aria-selected="true"] { border-bottom-color: var(--accent); background: none; }

  .content { height: auto; overflow: visible; }
  .to-top { display: none; }
}

/* ---------- "The House Lab" shelf (added 2026-11-19) ----------
   Two doors out of the archive and into the home lab, plus one quiet link to the page that
   explains what the lab is. Deliberately the same paper, rule and rust as the rest of the site,
   so the lab reads as part of the same address rather than a different site bolted on. */

.labcards { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: stretch; }
@media (max-width: 720px) { .labcards { grid-template-columns: 1fr; } }

a.labcard {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.3rem 1.4rem;
  text-decoration: none;
  color: inherit;
  transition: border-color .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease);
}
a.labcard:hover, a.labcard:focus-visible {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(26,23,18,.08);
  outline: none;
}
a.labcard .lab-eyebrow {
  font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); font-weight: 700; margin-bottom: .5rem;
}
a.labcard h3 { font-family: var(--serif); font-weight: 400; font-size: 1.4rem; margin: 0 0 .45rem; }
a.labcard p { margin: 0; font-size: .95rem; color: var(--ink-soft); }
a.labcard .go { display: inline-block; margin-top: .8rem; font-size: .9rem; font-weight: 600; color: var(--accent); }

.lababout { margin: 1.4rem 0 0; font-size: .95rem; color: var(--muted); }
.lababout a { color: var(--accent); }

@media (prefers-reduced-motion: reduce) { a.labcard { transition: none; } }
