/* ============================================================================
 * SpecEnvoy — The Cello Makers — styles
 * Vertical river of SCHOOLS (Cremona → Venice → …); desktop gets a sticky
 * school rail; mobile is a single column with bottom-sheet placards and a
 * full-screen instrument view. Mobile-first; @media (min-width:820px) adds
 * desktop. Uses the site palette from /style.css (:root vars).
 * ========================================================================== */

.makers-wide { max-width: 1080px; }

.makers-intro { color: var(--muted); margin: -6px 0 14px; max-width: 660px; }

/* cross-link band to the composers timeline (shared time axis) */
.mk-crosslink {
  display: block; font-size: 13.5px; color: var(--muted); text-decoration: none;
  border: 1px dashed var(--border); border-radius: 12px; padding: 10px 14px; margin: 0 0 22px;
  max-width: 660px;
}
.mk-crosslink b { color: var(--ink); }
.mk-crosslink:hover { border-color: rgba(91,134,236,.55); color: var(--ink); }

/* legend / how-to chip row */
.mk-legend {
  display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center;
  font-size: 13px; color: var(--muted); margin-bottom: 22px;
}
.mk-legend .chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 11px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--card);
}
.mk-legend .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.mk-legend .dot.personal { background: var(--heart); }
.mk-legend .school-allbtn {
  margin-left: auto; font-size: 13px; color: var(--ink); background: var(--card);
  border: 1px solid var(--border); border-radius: 999px; padding: 5px 14px; cursor: pointer;
}
.mk-legend .school-allbtn:hover { background: rgba(255,255,255,.08); border-color: rgba(91,134,236,.45); }

/* ============================================================== timeline === */
/* spine painted as a background (see cello.css note: FF won't stretch a
   top+bottom-anchored absolute pseudo-element inside an auto-height box) */
.timeline {
  position: relative;
  background-image: linear-gradient(180deg, transparent, var(--border) 8px, var(--border) calc(100% - 8px), transparent);
  background-repeat: no-repeat;
  background-size: 2px 100%;
  background-position: 13px 0;
}

/* --- school lane --- */
.school { position: relative; padding: 0 0 10px 40px; margin-bottom: 26px; }
.school-head { position: relative; margin: 0 0 6px; cursor: pointer; user-select: none; border-radius: 8px; }
.school-head:hover { background: rgba(255,255,255,.03); }
.school-node {
  position: absolute; left: -33px; top: 7px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--bg-top); border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px rgba(59,111,224,.12); cursor: pointer; transition: transform .15s ease, background .15s ease;
}
.school-head:hover .school-node { transform: scale(1.18); background: var(--accent); }
.school-name { font-size: clamp(20px, 4.5vw, 26px); font-weight: 700; letter-spacing: -.01em; display: inline; }
.school-span { font-size: 13px; color: var(--muted); margin-left: 10px; white-space: nowrap; }
.school-blurb { color: var(--muted); font-size: 14.5px; margin: 4px 0 16px; max-width: 620px; }
.school-toggle { float: right; color: var(--muted); font-size: 13px; border: 1px solid var(--border);
  border-radius: 999px; padding: 3px 10px; background: var(--card); }

/* --- maker cards --- */
.maker-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }

.maker {
  display: flex; gap: 14px; align-items: center; text-align: left;
  width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 14px;
  background: var(--card); color: inherit; cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.maker:hover { transform: translateY(-2px); border-color: rgba(91,134,236,.45); background: rgba(255,255,255,.06); }
.maker:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.maker.personal { border-color: rgba(255,93,143,.45); }
.maker.personal:hover { border-color: var(--heart); }

.maker .avatar {
  flex: 0 0 auto; width: 58px; height: 58px; border-radius: 50%; overflow: hidden;
  background: linear-gradient(150deg, #24315c, #161f3d); display: grid; place-items: center;
  border: 1px solid var(--border);
}
.maker .avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.maker .avatar .monogram { font-size: 22px; font-weight: 700; color: #9fb2e8; letter-spacing: .02em; }

.maker .who { min-width: 0; }
.maker .mname { font-weight: 650; font-size: 16.5px; }
.maker .mlife { font-size: 13px; color: var(--muted); margin-top: 1px; }
.maker .mwhy { font-size: 13.5px; color: var(--muted); margin-top: 5px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.school.collapsed .maker-grid, .school.collapsed .school-blurb { display: none; }

/* ============================================ desktop: sticky school rail == */
@media (min-width: 820px) {
  .mk-stage { display: grid; grid-template-columns: 190px 1fr; gap: 36px; align-items: start; }
  .school-rail { position: sticky; top: 20px; display: block; }
  .school-rail .rail-title { font-size: 12px; text-transform: uppercase; letter-spacing: .08em;
    color: var(--muted); margin-bottom: 12px; }
  .school-rail a { display: block; padding: 8px 12px; border-radius: 10px; color: var(--muted);
    text-decoration: none; font-size: 14.5px; border: 1px solid transparent; transition: .15s; }
  .school-rail a:hover { color: var(--ink); background: var(--card); }
  .school-rail a.active { color: var(--ink); background: var(--accent-soft); border-color: rgba(59,111,224,.35); }
  .school-rail a .yrs { display: block; font-size: 12px; color: var(--muted); }
  .maker-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 819px) { .school-rail { display: none; } }

/* ================================================= placard (maker card) === */
.scrim {
  position: fixed; inset: 0; background: rgba(4,7,16,.66); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 60;
  opacity: 0; pointer-events: none; transition: opacity .22s ease;
}
.scrim.open { opacity: 1; pointer-events: auto; }

.placard {
  position: relative; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto;
  background: linear-gradient(180deg, #141d3a, #0d142b);
  border: 1px solid var(--border); border-radius: 18px; padding: 26px 26px 30px;
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
  transform: translateY(16px) scale(.985); transition: transform .26s cubic-bezier(.2,.8,.2,1);
}
.scrim.open .placard { transform: none; }
.placard .close, .instview .close {
  position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--card); color: var(--ink); font-size: 18px;
  cursor: pointer; line-height: 1; z-index: 3;
}
.placard .close:hover, .instview .close:hover { background: rgba(255,255,255,.08); }

.placard .p-head { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; padding-right: 30px; }
.placard .p-portrait {
  flex: 0 0 auto; width: 92px; height: 92px; border-radius: 12px; overflow: hidden;
  background: linear-gradient(150deg, #24315c, #161f3d); display: grid; place-items: center;
  border: 1px solid var(--border);
}
.placard .p-portrait img { width: 100%; height: 100%; object-fit: cover; }
.placard .p-portrait .monogram { font-size: 34px; font-weight: 700; color: #9fb2e8; }
.placard .p-name { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.placard .p-life { color: var(--muted); font-size: 14px; margin-top: 2px; }
.placard .p-school { display: inline-block; margin-top: 8px; font-size: 12px; color: var(--accent);
  border: 1px solid rgba(59,111,224,.4); border-radius: 999px; padding: 2px 10px; }

.placard .p-bio { font-size: 15px; line-height: 1.62; margin: 4px 0 6px; }
.placard .p-why { font-size: 14px; color: var(--muted); border-left: 2px solid var(--heart);
  padding-left: 12px; margin: 14px 0 18px; }

.placard .cellos-title { font-size: 13px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); margin: 18px 0 10px; }
.cellowork {
  border: 1px solid var(--border); border-radius: 12px; padding: 13px 14px; margin-bottom: 10px;
  background: var(--card);
}
.cellowork .w-top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.cellowork .w-title { font-weight: 600; font-size: 15px; }
.cellowork .w-year { color: var(--muted); font-size: 13px; white-space: nowrap; }
.cellowork .w-blurb { color: var(--muted); font-size: 13.5px; margin-top: 5px; }

/* photo strip + explore button */
.p-gallery { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; margin-top: 14px;
  -webkit-overflow-scrolling: touch; }
.p-thumb { flex: 0 0 auto; width: 74px; height: 74px; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--border); background: #0a0f1f; padding: 0; cursor: pointer; }
.p-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.p-thumb:hover { border-color: rgba(91,134,236,.55); }
.p-explore {
  display: block; width: 100%; margin-top: 8px; font-size: 14px; font-weight: 600;
  color: #fff; background: var(--accent); border: 1px solid var(--accent);
  border-radius: 999px; padding: 10px 16px; cursor: pointer;
}
.p-explore:hover { background: #4f7ce6; }

/* meanwhile chips */
.p-meanwhile { display: flex; flex-wrap: wrap; gap: 8px; }
.mw-chip { font-size: 12.5px; color: var(--accent); text-decoration: none;
  border: 1px solid rgba(59,111,224,.3); border-radius: 999px; padding: 4px 11px; }
.mw-chip:hover { background: var(--accent-soft); }
.mw-chip .mw-yrs { color: var(--muted); font-size: 11.5px; }
.p-mwnote { font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.p-mwnote a { color: var(--accent); }

.placard .p-source { font-size: 12px; color: var(--muted); margin-top: 16px; }
.placard .p-source a { color: var(--muted); }

/* mobile: placard becomes a bottom sheet */
@media (max-width: 560px) {
  .scrim { align-items: flex-end; padding: 0; }
  .placard { max-width: 100%; max-height: 90vh; border-radius: 20px 20px 0 0;
    transform: translateY(100%); }
  .scrim.open .placard { transform: none; }
}

/* ====================================================== instrument view === */
.iv-scrim { z-index: 80; }
.instview {
  position: relative; width: 100%; max-width: 860px; max-height: 94vh; overflow-y: auto;
  background: #0f1730; border: 1px solid var(--border); border-radius: 18px;
  padding: 20px 20px 22px; box-shadow: 0 30px 80px rgba(0,0,0,.55);
  transform: translateY(16px) scale(.985); transition: transform .26s cubic-bezier(.2,.8,.2,1);
}
.iv-scrim.open .instview { transform: none; }
.iv-head { padding-right: 40px; margin-bottom: 12px; }
.iv-title { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.iv-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.iv-stage {
  position: relative; height: 58vh; min-height: 300px; border-radius: 12px; overflow: hidden;
  background: #0a0f1f; border: 1px solid var(--border);
  touch-action: none; cursor: grab;                   /* we own all gestures */
}
.iv-stage:active { cursor: grabbing; }
.iv-layer { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.iv-img { width: 100%; height: 100%; display: block; user-select: none; -webkit-user-select: none; }

/* numbered hotspot dots — counter-scaled in JS so they stay finger-sized */
.iv-dot {
  position: absolute; width: 26px; height: 26px; border-radius: 50%;
  transform: translate(-50%,-50%);
  background: rgba(14,23,48,.85); color: #fff; border: 2px solid var(--accent);
  font-size: 13px; font-weight: 700; line-height: 1; cursor: pointer;
  display: grid; place-items: center; padding: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.5);
}
.iv-dot:hover { background: var(--accent); }
.iv-dot.active { background: var(--heart); border-color: var(--heart); }

/* zoom controls */
.iv-ctrls { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 6px; z-index: 2; }
.iv-btn {
  width: 40px; height: 40px; border-radius: 10px; font-size: 20px; line-height: 1;
  color: var(--ink); background: rgba(14,23,48,.9); border: 1px solid var(--border);
  cursor: pointer; display: grid; place-items: center;
}
.iv-btn:hover { background: var(--accent); color: #fff; }
.iv-fit { font-size: 16px; }

.iv-caption { font-size: 13px; color: var(--muted); margin: 10px 2px 0; line-height: 1.5; }
.iv-caption .iv-credit { display: block; font-size: 11.5px; opacity: .8; margin-top: 2px; }
.iv-caption .iv-err { color: #ff8aa8; }

/* hotspot legend list */
.iv-spots { margin-top: 12px; }
.iv-hint { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.iv-spot {
  display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left;
  border: 1px solid var(--border); border-radius: 10px; background: var(--card);
  color: var(--ink); padding: 9px 11px; margin-bottom: 6px; cursor: pointer; font-size: 13px;
  line-height: 1.5;
}
.iv-spot .n {
  flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%; font-size: 11.5px; font-weight: 700;
  display: grid; place-items: center; background: rgba(59,111,224,.25); color: #b9c9f5;
  border: 1px solid rgba(59,111,224,.45);
}
.iv-spot .t { color: var(--muted); }
.iv-spot .t b { color: var(--ink); font-weight: 650; }
.iv-spot.active { border-color: var(--heart); }
.iv-spot.active .n { background: rgba(255,93,143,.25); color: #ffb3c8; border-color: rgba(255,93,143,.5); }

/* photo thumbnails */
.iv-thumbs { display: flex; gap: 8px; overflow-x: auto; margin-top: 12px;
  -webkit-overflow-scrolling: touch; }
.iv-th { flex: 0 0 auto; width: 64px; height: 64px; border-radius: 10px; overflow: hidden;
  border: 2px solid var(--border); background: #0a0f1f; padding: 0; cursor: pointer; }
.iv-th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.iv-th.active { border-color: var(--accent); }

/* mobile: instrument view is a full-height bottom sheet; stage stays big */
@media (max-width: 560px) {
  .iv-scrim { align-items: flex-end; padding: 0; }
  .instview { max-width: 100%; max-height: 96vh; border-radius: 20px 20px 0 0;
    transform: translateY(100%); padding: 16px 14px 18px; }
  .iv-scrim.open .instview { transform: none; }
  .iv-stage { height: 52vh; min-height: 260px; }
}

/* respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .maker, .placard, .scrim, .instview { transition: none; }
}

/* maker-museum switcher (Cello / Piano / …) */
.mk-museums { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 16px; }
.mk-museums a { font-size: 14px; font-weight: 600; padding: 7px 15px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); color: inherit; text-decoration: none; transition: .15s; }
.mk-museums a:hover { border-color: rgba(91,134,236,.55); }
.mk-museums a.on { background: linear-gradient(92deg, #b5683a, #cf7f52); color: #fff; border-color: transparent; }
.mk-museums a.on.piano { background: linear-gradient(92deg, #6b57c9, #8a76e0); }

/* photo prev/next arrows + counter in the instrument viewer */
.iv-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255,255,255,.28);
  background: rgba(15,23,48,.62); color: #fff; font-size: 26px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px); transition: background .15s; }
.iv-nav:hover { background: rgba(15,23,48,.9); }
.iv-prev { left: 10px; } .iv-next { right: 10px; }
.iv-count { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 5;
  font-size: 12.5px; font-weight: 600; color: #fff; background: rgba(15,23,48,.6); border-radius: 999px; padding: 3px 11px; }
@media (max-width: 520px) { .iv-nav { width: 38px; height: 38px; font-size: 22px; } }
