/* HOUSE OF CLAVE — v1 prototype styles */

:root {
  --bg: #060507;
  --bg-2: #0c0a10;
  --ink: #ece6dc;
  --ink-dim: #9b948a;
  --ink-faint: #5d5750;
  --line: rgba(236, 230, 220, 0.10);
  --line-hot: rgba(236, 230, 220, 0.55);
  --gold: #e0b24a;
  --hot: #d8453b;
  --serif: "Hoefler Text", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --ui: "Helvetica Neue", "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--ui);
  -webkit-font-smoothing: antialiased;
}

#app { position: fixed; inset: 0; }

canvas { display: block; }

/* ---------- shared chrome ---------- */
.label-caps {
  font-family: var(--ui);
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-dim);
  font-weight: 500;
}

.title-lockup {
  position: absolute;
  top: 30px;
  left: 38px;
  z-index: 20;
  pointer-events: none;
  max-width: 60%;
}
.title-lockup h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 30px;
  letter-spacing: 0.06em;
  margin: 0;
  color: var(--ink);
  text-shadow: 0 2px 30px rgba(0,0,0,0.8);
}
.title-lockup .sub {
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  color: var(--ink-dim);
  margin-top: 4px;
}
.title-lockup .credit {
  margin-top: 10px;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.hud-hint {
  position: absolute;
  top: 40px;
  right: 40px;
  z-index: 20;
  text-align: right;
  pointer-events: none;
}

/* ---------- view toggle ---------- */
.view-toggle {
  position: absolute;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  gap: 2px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(12, 10, 16, 0.7);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.view-toggle button {
  font-family: var(--ui);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-dim);
  background: transparent;
  border: none;
  padding: 9px 20px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.25s, color 0.25s;
}
.view-toggle button:hover { color: var(--ink); }
.view-toggle button.active {
  color: var(--bg);
  background: var(--ink);
}
.view-toggle button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ---------- filter control ---------- */
.filters {
  position: absolute;
  bottom: 36px;
  left: 38px;
  z-index: 30;
  display: flex;
  gap: 18px;
  align-items: center;
}
.filters .filter-label { margin-right: 2px; }
.filters button {
  font-family: var(--ui);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  background: transparent;
  border: none;
  border-bottom: 1px solid transparent;
  padding: 4px 0;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.filters button:hover { color: var(--ink-dim); }
.filters button.active { color: var(--ink); border-bottom-color: var(--gold); }

/* ---------- preview card ---------- */
.card {
  position: absolute;
  top: 50%;
  right: 48px;
  transform: translateY(-50%) translateX(30px);
  width: 340px;
  z-index: 50;
  background: linear-gradient(180deg, rgba(18,15,22,0.96), rgba(8,7,10,0.97));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px 28px 26px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.7);
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
  backdrop-filter: blur(10px);
}
.card.show { opacity: 1; transform: translateY(-50%) translateX(0); pointer-events: auto; }

.card .portrait {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  margin-bottom: 18px;
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 0 0 6px rgba(255,255,255,0.03), 0 0 40px -8px var(--card-glow, #888);
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,0.25), var(--card-glow, #555) 70%);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 30px; color: rgba(255,255,255,0.85);
}
.card .genre-tag {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--card-glow, var(--gold));
  margin-bottom: 8px;
}
.card h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 27px;
  margin: 0 0 4px;
  letter-spacing: 0.02em;
  line-height: 1.05;
}
.card .dates {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-dim);
  margin-bottom: 14px;
}
.card .descriptor {
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  margin-bottom: 14px;
}
.card .bio {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-dim);
  margin-bottom: 18px;
}
.card .onview {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 20px;
}
/* relationship sections (derived from connections + band memberIds) */
.card .rels { margin-bottom: 20px; }
.card .rel-sec { margin-bottom: 14px; }
.card .rel-sec:last-child { margin-bottom: 0; }
.card .rel-label { display: block; margin-bottom: 9px; color: var(--ink-faint); }
.card .rel-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.card .rel-chip {
  display: inline-flex; align-items: baseline;
  font-family: var(--serif); font-size: 13px; line-height: 1.2;
  color: var(--ink-dim); background: rgba(255,255,255,0.03);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 12px; cursor: pointer;
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}
.card .rel-chip:hover { color: var(--ink); border-color: var(--card-glow, var(--gold)); background: rgba(255,255,255,0.06); }
.card .rel-chip.is-leader { border-color: rgba(224,178,74,0.42); }
.card .rel-chip-static { cursor: default; opacity: 0.82; }
.card .rel-chip-static:hover { color: var(--ink-dim); border-color: var(--line); background: rgba(255,255,255,0.03); }
.card .rel-chip .rel-sub {
  margin-left: 7px; font-family: var(--ui); font-size: 8.5px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-faint);
}

.card .enter-btn {
  width: 100%;
  font-family: var(--ui);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--ink);
  border: none;
  border-radius: 8px;
  padding: 14px;
  cursor: pointer;
  transition: transform 0.15s, background 0.2s;
}
.card .enter-btn:hover { background: #fff; transform: translateY(-1px); }
.card .close {
  position: absolute;
  top: 14px; right: 16px;
  background: none; border: none;
  color: var(--ink-faint);
  font-size: 20px; cursor: pointer; line-height: 1;
}
.card .close:hover { color: var(--ink); }

/* ---------- venue overlay ---------- */
#venue-layer {
  position: absolute; inset: 0; z-index: 60;
  display: none;
}
#venue-layer.show { display: block; }

.venue-canvas { position: absolute; inset: 0; }

.venue-back {
  position: absolute; top: 34px; left: 38px; z-index: 70;
  font-family: var(--ui); font-size: 10px; letter-spacing: 0.24em;
  text-transform: uppercase; color: var(--ink-dim);
  background: rgba(12,10,16,0.6); border: 1px solid var(--line);
  border-radius: 999px; padding: 11px 20px; cursor: pointer;
  backdrop-filter: blur(10px); transition: color 0.2s, border-color 0.2s;
}
.venue-back:hover { color: var(--ink); border-color: var(--line-hot); }

.venue-title {
  position: absolute; top: 32px; right: 40px; z-index: 70; text-align: right;
  pointer-events: none;
}
.venue-title .vt-name { font-family: var(--serif); font-size: 24px; letter-spacing: 0.04em; }
.venue-title .vt-venue { margin-top: 4px; }

/* in-scene jukebox panel (Spotify embed) */
.jukebox-panel {
  position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
  z-index: 72; width: 420px; max-width: 90vw;
  background: rgba(10,8,12,0.82); border: 1px solid var(--line);
  border-radius: 16px; padding: 14px 14px 10px;
  backdrop-filter: blur(14px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.7);
}
.jukebox-panel .jb-head {
  display: flex; justify-content: space-between; align-items: baseline; margin: 2px 6px 10px;
}
.jukebox-panel .jb-note { font-family: var(--serif); font-style: italic; font-size: 12px; color: var(--ink-dim); }
.jukebox-panel iframe { display: block; border: 0; border-radius: 12px; width: 100%; height: 152px; }

/* bio side panel in venue */
.venue-bio {
  position: absolute; top: 50%; left: 38px; transform: translateY(-50%);
  z-index: 71; width: 280px;
  background: rgba(10,8,12,0.55); border-left: 2px solid var(--card-glow, var(--gold));
  padding: 18px 22px; border-radius: 4px; backdrop-filter: blur(6px);
}
.venue-bio h3 { font-family: var(--serif); font-weight: 500; font-size: 18px; margin: 0 0 6px; }
.venue-bio p { font-size: 12px; line-height: 1.6; color: var(--ink-dim); margin: 0 0 10px; }
.venue-bio .meta { font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-faint); }

/* doors / connections list */
.venue-doors {
  position: absolute; top: 50%; right: 40px; transform: translateY(-50%);
  z-index: 71; width: 220px; text-align: right;
}
.venue-doors .doors-label { margin-bottom: 12px; }
.venue-doors button {
  display: block; width: 100%; text-align: right;
  font-family: var(--serif); font-size: 15px; color: var(--ink-dim);
  background: none; border: none; border-right: 1px solid transparent;
  padding: 6px 12px 6px 0; cursor: pointer; transition: color 0.2s, border-color 0.2s;
}
.venue-doors button:hover { color: var(--ink); border-right-color: var(--card-glow, var(--gold)); }
.venue-doors button .door-rel { display:block; font-family: var(--ui); font-size: 9px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-faint); }

/* loading + tooltip */
#loading {
  position: absolute; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); color: var(--ink-dim);
  font-family: var(--serif); font-style: italic; font-size: 18px;
  transition: opacity 0.6s;
}
#loading.hide { opacity: 0; pointer-events: none; }

#tooltip {
  position: absolute; z-index: 40; pointer-events: none;
  font-family: var(--serif); font-size: 14px; color: var(--ink);
  background: rgba(8,7,10,0.85); border: 1px solid var(--line);
  padding: 5px 11px; border-radius: 6px; opacity: 0; transition: opacity 0.15s;
  white-space: nowrap; transform: translate(-50%, -140%);
}
#tooltip.show { opacity: 1; }

.stub-note {
  position: absolute; bottom: 90px; left: 50%; transform: translateX(-50%);
  z-index: 25; font-family: var(--serif); font-style: italic;
  font-size: 13px; color: var(--ink-faint); text-align: center;
}

/* ============================================================
   DETAIL OVERLAY — full-screen artist/band experience.
   Sits above everything (venue layer is parked at z 60). Two
   modes — Immersive Venue + Full Profile — share the photo
   backdrop, scrim, mode switch, back button and Spotify jukebox.
   Aesthetic: dark serif, gold/hot accents, frosted-glass panels.
   ============================================================ */
#detail-overlay {
  position: absolute; inset: 0; z-index: 80;
  display: none;
  font-family: var(--serif);
  color: var(--ink);
  overflow: hidden;
}
#detail-overlay.show { display: block; }
#detail-overlay.show .detail-content,
#detail-overlay.show .detail-modeswitch,
#detail-overlay.show .detail-back { animation: detailFade .5s ease both; }
@keyframes detailFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.detail-bg {
  position: absolute; inset: 0; z-index: 0;
  background-position: center; background-size: cover; background-repeat: no-repeat;
  transform: scale(1.05);
  transition: background-image .4s ease;
}
.detail-scrim {
  position: absolute; inset: 0; z-index: 1;
  background:
    radial-gradient(120% 90% at 50% 28%, transparent, rgba(8,5,6,.55) 78%),
    linear-gradient(90deg, rgba(8,5,6,.74), transparent 30%, transparent 70%, rgba(8,5,6,.74)),
    linear-gradient(180deg, rgba(8,5,6,.55), transparent 24%, rgba(8,5,6,.88));
}

/* chrome: back + mode switch */
.detail-back {
  position: absolute; top: 28px; left: 30px; z-index: 40;
  font-family: var(--ui); font-size: 10px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--ink); background: rgba(0,0,0,.42); border: 1px solid var(--line);
  border-radius: 30px; padding: 10px 18px; cursor: pointer; backdrop-filter: blur(8px);
  transition: color .2s, border-color .2s, background .2s;
}
.detail-back:hover { border-color: var(--line-hot); background: rgba(0,0,0,.6); }

.detail-modeswitch {
  /* centre via auto margins (NOT translateX) so the detailFade animation, which
     animates `transform`, can't knock the tab bar off-centre. */
  position: absolute; top: 24px; left: 0; right: 0; margin-inline: auto; width: max-content; z-index: 40;
  display: flex; gap: 2px; padding: 5px;
  background: rgba(0,0,0,.5); border: 1px solid var(--line);
  border-radius: 999px; backdrop-filter: blur(10px);
}
.detail-modeswitch button {
  font-family: var(--ui); font-size: 9.5px; letter-spacing: .26em; text-transform: uppercase;
  color: var(--ink-dim); background: transparent; border: none;
  padding: 8px 20px; border-radius: 999px; cursor: pointer; transition: color .25s, background .25s;
}
.detail-modeswitch button:hover { color: var(--ink); }
.detail-modeswitch button.active { color: var(--bg); background: var(--gold); }

/* Eras are "chapter" pages, not people — no Venue/Profile switch, no portrait. */
#detail-overlay.is-era .detail-modeswitch { display: none; }

/* ---- era drawer extras ---- */
.dz-med.dz-era { width: 48px; height: 48px; border-radius: 14px; flex: 0 0 48px; }
.dz-blurb { font-family: var(--serif); font-size: 14.5px; line-height: 1.55; color: var(--ink); margin: 2px 0 14px; }
.dz-hook { font-family: var(--serif); font-style: italic; font-size: 13px; color: var(--gold); margin: 6px 0 1px; }

/* ---- detail meta: clickable era + genre/instrument tooltips ---- */
.meta .meta-eralink { color: var(--gold); cursor: pointer; text-decoration: none; border-bottom: 1px dotted rgba(224, 178, 74, 0.5); }
.meta .meta-eralink:hover { border-bottom-color: var(--gold); }
.meta .meta-inst, .meta .meta-genre { cursor: help; border-bottom: 1px dotted var(--line-hot); }
.p-bio .d-era-hook { font-family: var(--serif); font-style: italic; color: var(--ink-dim); margin: 4px 0 8px; }

/* ---- era detail (chapter) ---- */
.era-detail { overflow-y: auto; max-height: 100%; padding: 92px 40px 64px; max-width: 760px; margin: 0 auto; position: relative; z-index: 5; }
.era-hero { border-left: 3px solid var(--eraglow, var(--gold)); padding-left: 20px; margin-bottom: 30px; }
.era-hero .d-kicker { font-family: var(--ui); font-size: 10px; letter-spacing: .3em; text-transform: uppercase; color: var(--eraglow, var(--gold)); }
.era-hero .d-name { font-family: var(--serif); font-weight: 400; font-size: 46px; line-height: 1.02; margin: 10px 0 0; }
.era-lead { font-family: var(--serif); font-size: 18px; line-height: 1.55; color: var(--ink); margin: 14px 0 0; max-width: 60ch; }
.era-sec { margin-top: 30px; }
.era-seclabel { font-family: var(--ui); font-size: 10px; letter-spacing: .26em; text-transform: uppercase; color: var(--eraglow, var(--gold)); margin-bottom: 14px; }
.era-chips { display: flex; flex-wrap: wrap; gap: 9px; }
.era-chip { font-family: var(--ui); font-size: 12px; letter-spacing: .04em; color: var(--ink); padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; background: color-mix(in srgb, var(--eraglow,#888) 10%, transparent); text-decoration: none; }
.era-chip[data-genre-go] { cursor: pointer; transition: border-color .2s, background .2s, color .2s; }
.era-chip[data-genre-go]:hover { border-color: var(--eraglow, var(--gold)); color: #fff; background: color-mix(in srgb, var(--eraglow,#888) 20%, transparent); }
.era-roster { display: block; }
.era-detail .d-jb iframe { border-radius: 14px; }
.era-nav { display: flex; gap: 14px; margin-top: 40px; border-top: 1px solid var(--line); padding-top: 22px; }
.era-navbtn { flex: 1; text-align: left; background: rgba(30,21,28,.4); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; cursor: pointer; transition: border-color .2s, background .2s, transform .2s; }
.era-navbtn.next { text-align: right; }
.era-navbtn:hover { border-color: var(--eraglow, var(--gold)); background: rgba(30,21,28,.7); transform: translateY(-2px); }
.era-navbtn span { display: block; font-family: var(--ui); font-size: 9px; letter-spacing: .24em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 5px; }
.era-navbtn b { font-family: var(--serif); font-weight: 400; font-size: 17px; color: var(--ink); }
.era-navbtn.ghost { background: none; border: none; cursor: default; pointer-events: none; }
/* Playlist tab — tappable era anthology rows */
.era-tracks { display: flex; flex-direction: column; gap: 6px; max-width: 820px; margin: 0 auto; }
.era-track { display: flex; align-items: baseline; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(18,13,17,.42); color: inherit; font: inherit; cursor: pointer; transition: border-color .15s, background .15s; }
.era-track:hover { border-color: var(--eraglow, var(--gold)); background: rgba(30,21,28,.6); }
.era-track.active { border-color: var(--eraglow, var(--gold)); background: color-mix(in srgb, var(--eraglow,#888) 14%, transparent); }
.era-track .et-t { font-family: var(--serif); font-size: 15px; color: var(--ink); }
.era-track .et-a { font-family: var(--ui); font-size: 10px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-dim); margin-left: auto; text-align: right; }
/* "Now playing" card on the era Playlist tab — matches the bandstand player. */
.era-np .np-k { font-family: var(--ui); font-size: 9.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-faint); }
.era-np .np-t { font-family: var(--serif); font-size: 17px; color: var(--ink); margin-top: 5px; }
.era-np .np-a { font-family: var(--ui); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-dim); margin: 2px 0 14px; }
.era-np iframe { height: 175px; }   /* compact song widget, not the 352px album height */
@media (max-width: 700px) {
  .era-detail { padding: 86px 22px 56px; }
  .era-hero .d-name { font-size: 34px; }
  .era-lead { font-size: 16px; }
}

.detail-content { position: absolute; inset: 0; z-index: 5; }

/* shared bits */
.d-panel {
  background: rgba(14,9,11,.56); backdrop-filter: blur(16px);
  border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
}
.d-kick { font-family: var(--ui); font-size: 9.5px; letter-spacing: .28em; text-transform: uppercase; color: var(--gold); }
.d-medallion {
  border-radius: 50%; overflow: hidden; position: relative;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.62); font-family: var(--ui);
  box-shadow: 0 8px 22px rgba(0,0,0,.55);
}
.d-medallion img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 22%; opacity: 0; transition: opacity .5s; }
.d-medallion img.in { opacity: 1; }
.d-rel { display: flex; align-items: center; gap: 13px; width: 100%; padding: 8px 10px; margin-bottom: 7px; border-radius: 12px; cursor: pointer;
  background: rgba(18,13,17,.42); border: 1px solid var(--line); color: inherit; font: inherit; text-align: left;
  -webkit-appearance: none; appearance: none;
  transition: transform .16s ease, background .16s, border-color .16s; }
.d-rel:hover { background: rgba(30,21,28,.6); border-color: var(--card-glow, var(--gold)); transform: translateX(4px); }
.d-rel:last-child { margin-bottom: 0; }
.d-rel .f { width: 46px; height: 46px; border-radius: 50%; flex: 0 0 46px; overflow: hidden; position: relative; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 16px; font-family: var(--ui); box-shadow: 0 6px 16px rgba(0,0,0,.5); }
.d-rel .f img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .5s; }
.d-rel .f img.in { opacity: 1; }
.d-rel .n { font-size: 14.5px; }
.d-rel .r { font-family: var(--ui); font-size: 9.5px; letter-spacing: .05em; color: var(--ink-dim); margin-top: 2px; text-transform: uppercase; }
.d-rel .empty, .d-rel.empty { font-family: var(--ui); font-size: 12px; color: var(--ink-faint); padding: 4px 8px; display: block; }
.d-rel.empty { cursor: default; }
.d-rel.empty:hover { background: none; }
.d-album { text-align: center; }
.d-album .c {
  border-radius: 7px; box-shadow: 0 10px 22px rgba(0,0,0,.5);
  display: flex; align-items: flex-end; padding: 7px; position: relative; overflow: hidden;
}
.d-album .c img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .4s; }
.d-album .c img.in { opacity: 1; }
.d-album .yr { font-family: var(--ui); font-size: 20px; color: rgba(255,255,255,.28); font-weight: 700; line-height: 1; position: relative; }
.d-album .borrowed { position: absolute; top: 5px; right: 6px; font-family: var(--ui); font-size: 8px; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.55); }
.d-album .t { font-size: 11.5px; margin-top: 6px; line-height: 1.2; color: var(--ink); }
.d-album .ll { font-family: var(--ui); font-size: 9px; color: var(--ink-faint); margin-top: 2px; }
/* Apple-linked tiles: clickable (swap jukebox), with an ↗ to open Apple Music */
.d-album.is-playable { cursor: pointer; }
.d-album.is-playable .c { transition: box-shadow .2s, transform .2s; }
.d-album.is-playable:hover .c, .d-album.is-playable:focus-visible .c { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(0,0,0,.6); }
.d-album.is-playing .c { outline: 2px solid var(--gold); outline-offset: 2px; }
.d-album .d-album-ext {
  position: absolute; top: 5px; left: 6px; z-index: 2;
  width: 17px; height: 17px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 11px; line-height: 1; text-decoration: none; color: var(--ink);
  background: rgba(0,0,0,.5); opacity: 0; transition: opacity .18s;
}
.d-album.is-playable:hover .d-album-ext, .d-album .d-album-ext:focus-visible { opacity: 1; }
.d-jb iframe { width: 100%; border: 0; border-radius: 14px; background: rgba(0,0,0,.3); display: block; }
.d-jb .sp-embed { width: 100%; min-height: 152px; border-radius: 14px; background: rgba(0,0,0,.3); }
.d-jb .sp-embed iframe { border-radius: 14px; }
.jb-empty { font-family: var(--ui); font-size: 12px; color: var(--ink-faint); padding: 18px 4px; text-align: center; }

/* ---------- VENUE MODE (immersive, option-6) ---------- */
.detail-content.is-venue .d-head { position: absolute; top: 22px; right: 28px; text-align: right; max-width: 46vw; }
.detail-content.is-venue .d-head h1 { font-family: var(--serif); font-weight: 400; font-size: 38px; line-height: 1; text-shadow: 0 3px 24px rgba(0,0,0,.7); }
.detail-content.is-venue .d-head .k { font-family: var(--ui); font-size: 10px; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); margin-top: 8px; }

.detail-content.is-venue .v-bio { position: absolute; left: 34px; top: 50%; transform: translateY(-50%); width: 380px; max-height: 76vh; overflow-y: auto; padding: 26px 28px; }
.detail-content.is-venue .v-bio .d-medallion { width: 84px; height: 84px; font-size: 30px; margin-bottom: 16px; }
.detail-content.is-venue .v-bio h2 { font-family: var(--serif); font-weight: 400; font-size: 26px; margin: 8px 0 4px; }
.detail-content.is-venue .v-bio .sub { font-family: var(--ui); font-size: 11px; color: var(--ink-dim); margin-bottom: 16px; line-height: 1.6; }
.detail-content.is-venue .v-bio p { font-size: 14px; line-height: 1.62; margin-bottom: 11px; color: var(--ink); }
.detail-content.is-venue .v-bio .meta { font-family: var(--ui); font-size: 11px; line-height: 1.95; color: var(--ink-dim); border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
.detail-content.is-venue .v-bio .meta b { color: var(--ink); font-weight: 400; }

.detail-content.is-venue .v-related { position: absolute; right: 34px; top: 50%; transform: translateY(-50%); width: 300px; max-height: 70vh; overflow-y: auto; padding: 22px; }
.detail-content.is-venue .v-related .h { font-family: var(--ui); font-size: 10px; letter-spacing: .26em; text-transform: uppercase; color: var(--gold); margin-bottom: 14px; }

.detail-content.is-venue .v-deck { position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); width: 600px; max-width: 92vw; padding: 15px 18px; }
/* one scrollable line of albums (like Standards) so the player never drops below the fold */
.detail-content.is-venue .v-deck .albums { display: flex; gap: 10px; margin-bottom: 13px; justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
.detail-content.is-venue .v-deck .albums::-webkit-scrollbar { display: none; }
.detail-content.is-venue .v-deck .d-album { width: 70px; flex: 0 0 auto; }
.detail-content.is-venue .v-deck .d-album .c { width: 70px; height: 70px; }
.detail-content.is-venue .v-deck .d-album .yr { font-size: 16px; }
.detail-content.is-venue .v-deck .jb { display: flex; align-items: center; gap: 14px; }
.detail-content.is-venue .v-deck .jb .lab { font-family: var(--ui); font-size: 9px; letter-spacing: .24em; text-transform: uppercase; color: var(--gold); writing-mode: vertical-rl; transform: rotate(180deg); }
.detail-content.is-venue .v-deck .d-jb { flex: 1; }
.detail-content.is-venue .v-deck .d-jb iframe { height: 152px; }

/* ---------- PROFILE MODE (full, detail-live) ---------- */
.detail-content.is-profile,
.detail-content.is-connections,
.detail-content.is-venue { overflow-y: auto; padding: 86px 34px 56px; }
.p-solo { max-width: 820px; margin: 0 auto; }
/* Desktop: the Connections/Figures tab fills the width as a multi-column roster,
   so a deep band lineup (e.g. Fania All-Stars, 37 ties) doesn't scroll forever in
   one narrow column. Profile/Venue keep their readable single-column width. */
@media (min-width: 861px) {
  .detail-content.is-connections .p-solo { max-width: 1120px; }
  .detail-content.is-connections .p-rels { column-count: 2; column-gap: 22px; }
  .detail-content.is-connections .p-rels .h { column-span: all; }
  .detail-content.is-connections .p-rels .cx-row,
  .detail-content.is-connections .p-rels .d-rel { break-inside: avoid; margin-bottom: 8px; }
}
@media (min-width: 1280px) {
  .detail-content.is-connections .p-solo { max-width: 1280px; }
  .detail-content.is-connections .p-rels { column-count: 3; }
}
.p-head { text-align: center; margin-bottom: 28px; }
.p-head h1 { font-family: var(--serif); font-weight: 400; font-size: 50px; line-height: 1; text-shadow: 0 3px 28px rgba(0,0,0,.75); }
.p-head .k { font-family: var(--ui); font-size: 10.5px; letter-spacing: .32em; text-transform: uppercase; color: var(--gold); margin-top: 12px; }
.p-grid { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(0,1fr); gap: 22px; max-width: 1160px; margin: 0 auto; }
.p-bio { padding: 28px 30px; }
.p-bio .top { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 18px; }
.p-bio .d-medallion { width: 96px; height: 96px; flex: 0 0 96px; font-size: 34px; }
.p-bio h2 { font-family: var(--serif); font-weight: 400; font-size: 30px; margin: 6px 0; }
.p-bio .sub { font-family: var(--ui); font-size: 11.5px; color: var(--ink-dim); line-height: 1.6; }
.p-bio p { font-size: 15px; line-height: 1.68; margin-bottom: 12px; color: var(--ink); }
.p-bio .meta { font-family: var(--ui); font-size: 11.5px; line-height: 2; color: var(--ink-dim); border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; }
.p-bio .meta b { color: var(--ink); font-weight: 400; letter-spacing: .04em; }
.p-rels { padding: 24px 22px; }
.p-rels .h { font-family: var(--ui); font-size: 10px; letter-spacing: .26em; text-transform: uppercase; color: var(--gold); margin-bottom: 14px; }
.p-rels .d-rel .f { width: 48px; height: 48px; flex: 0 0 48px; font-size: 17px; }
.p-rels .d-rel .n { font-size: 15px; }
.p-section { max-width: 1160px; margin: 24px auto 0; }
.p-section .lab { font-family: var(--ui); font-size: 10px; letter-spacing: .26em; text-transform: uppercase; color: var(--gold); margin-bottom: 14px; text-align: center; }
/* Discography: a fixed 2-row grid that scrolls horizontally (like the Standards
   shelf) so a deep catalogue never pushes the jukebox off-screen. */
.p-albums {
  display: grid; grid-auto-flow: column; grid-template-rows: repeat(2, auto);
  grid-auto-columns: 118px; gap: 14px 16px; justify-content: start;
  overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 8px;
  scrollbar-width: thin;
}
.p-albums .d-album { scroll-snap-align: start; }
.p-albums::-webkit-scrollbar { height: 6px; }
.p-albums::-webkit-scrollbar-thumb { background: rgba(241,232,218,.16); border-radius: 3px; }
.p-albums .d-album { width: 118px; }
.p-albums .d-album .c { width: 118px; height: 118px; }
/* venue tab: a single scrollable line of albums (profile/History keeps two rows) */
.detail-content.is-venue .p-albums { grid-template-rows: auto; }
.p-tl { padding: 22px 26px 16px; }
.p-tl .note { font-family: var(--ui); font-size: 11px; letter-spacing: .04em; color: var(--ink-dim); margin-bottom: 16px; font-style: italic; }
.p-tlrow { position: relative; height: 36px; margin-bottom: 8px; }
.p-tlbar { position: absolute; height: 26px; border-radius: 6px; display: flex; align-items: center; padding: 0 10px; font-family: var(--ui); font-size: 11px; font-weight: 500; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.75); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border: 1px solid rgba(255,255,255,.18); box-shadow: 0 4px 12px rgba(0,0,0,.4); }
.p-tlaxis { position: relative; height: 18px; margin-top: 6px; border-top: 1px solid var(--line); }
.p-tlaxis span { position: absolute; transform: translateX(-50%); font-family: var(--ui); font-size: 10px; color: var(--ink-dim); top: 4px; }
.p-jb { padding: 22px 26px; }
.p-jb .lab { margin-bottom: 14px; }
.p-jb iframe { height: 352px; }
.p-jb .d-jb .sp-embed { min-height: 352px; }
.p-rels .d-rel .f img, .v-related .d-rel .f img { object-position: center 18%; }

/* ---------- newly-populated bio fields (signature / key tracks / legacy) ---------- */
/* signature sound: small-caps gold label above an italic serif line */
.d-signature { margin: 4px 0 2px; }
.d-signature .lab { display: block; font-family: var(--ui); font-size: 9px; letter-spacing: .26em; text-transform: uppercase; color: var(--gold); margin-bottom: 3px; }
.d-signature .txt { font-family: var(--serif); font-style: italic; color: var(--ink); }
.p-bio .d-signature .txt { font-size: 15px; line-height: 1.5; }
.detail-content.is-venue .v-bio .d-signature { margin-bottom: 14px; }
.detail-content.is-venue .v-bio .d-signature .txt { font-size: 13.5px; line-height: 1.5; color: var(--ink-dim); }

/* legacy: short pull-quote with a left gold border */
.d-legacy { font-family: var(--serif); font-style: italic; color: var(--ink); border-left: 2px solid var(--gold); padding: 2px 0 2px 14px; margin: 4px 0 12px; line-height: 1.55; }
.p-bio .d-legacy { font-size: 15px; }
.v-legacy { font-family: var(--serif); font-style: italic; font-size: 13px; line-height: 1.5; color: var(--ink-dim); border-left: 2px solid var(--gold); padding-left: 12px; margin: 2px 0 12px; }

/* key tracks: chip row (profile) + compact inline form (venue) */
.d-tracks { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.d-track { font-family: var(--ui); font-size: 12px; letter-spacing: .02em; color: var(--ink); background: rgba(224,178,74,.10); border: 1px solid rgba(224,178,74,.32); border-radius: 999px; padding: 6px 14px; }
/* a key track we could resolve to a streaming id → playable chip */
.d-track.is-playable { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; transition: background .15s, border-color .15s; }
.d-track.is-playable:hover { background: rgba(224,178,74,.2); border-color: var(--gold); }
.d-track.is-playable .kt-play { font-size: 8px; color: var(--gold); }
.d-track.is-playing { background: var(--gold); color: #160f0c; border-color: var(--gold); }
.d-track.is-playing .kt-play { color: #160f0c; }
.d-tracks-inline { font-family: var(--ui); font-size: 11px; line-height: 1.6; color: var(--ink-dim); margin-bottom: 12px; }
.d-tracks-inline .lab { display: block; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); font-size: 9.5px; margin-bottom: 8px; }
.d-tracks-inline .kt-wrap { justify-content: flex-start; }
.d-story-list { display: grid; gap: 10px; max-width: 760px; margin: 0 auto; }
.d-story-cta { width: 100%; display: flex; align-items: center; gap: 11px; padding: 13px 16px; border: 1px solid var(--gold); border-radius: 10px; background: var(--gold); color: #160f0c; font: 700 13px/1.25 var(--ui); text-align: left; cursor: pointer; }
.d-story-cta:hover { filter: brightness(1.08); transform: translateY(-1px); }

@media (max-width: 860px) {
  .p-grid { grid-template-columns: 1fr; }
  .p-head h1 { font-size: 36px; }
  /* Extra bottom padding clears the shell's fixed bottom nav, which overlaps the
     embedded app — otherwise the last section (e.g. Stories) hides behind it. */
  .detail-content.is-profile,
  .detail-content.is-connections,
  .detail-content.is-venue { padding: 76px 16px calc(92px + env(safe-area-inset-bottom, 0px)); }
  /* Mobile panels are transparent, so text sits on the venue photo. Replace the
     light-centred desktop scrim with a near-solid dark wash for legibility. */
  .detail-scrim { background: linear-gradient(180deg, rgba(8,5,6,.82), rgba(8,5,6,.94)); }
  /* Align the back button's left edge with the tab strip below it. */
  .detail-back { top: 16px; left: 12px; padding: 9px 16px; }
  /* 3 tabs don't fit the centered pill on a phone — make it a full-width
     segmented row below the back button (entities only; eras hide the switch). */
  #detail-overlay:not(.is-era) .detail-modeswitch {
    top: 56px; left: 12px; right: 12px; transform: none; gap: 2px; justify-content: stretch;
  }
  #detail-overlay:not(.is-era) .detail-modeswitch button {
    flex: 1; padding: 8px 4px; font-size: 9px; letter-spacing: .06em; text-align: center;
  }
  #detail-overlay:not(.is-era) .detail-content.is-profile,
  #detail-overlay:not(.is-era) .detail-content.is-connections,
  #detail-overlay:not(.is-era) .detail-content.is-venue { padding-top: 106px; }
  .p-head { text-align: left; margin: 0 4px 20px; }
  .p-bio,.p-rels,.p-tl,.p-jb { padding: 20px 18px; }
  .p-section { margin-top: 16px; }
  .d-panel { border-radius: 14px; box-shadow: none; }
  .detail-content.is-profile .p-bio,
  .detail-content.is-connections .p-rels,
  .detail-content.is-connections .p-tl,
  .detail-content.is-venue .p-albums,
  .detail-content.is-venue .p-jb { background: transparent; border: 0; backdrop-filter: none; }
  .detail-content.is-venue .v-bio { left: 16px; width: min(380px, calc(100vw - 32px)); }
  .detail-content.is-venue .v-related { display: none; }
  .detail-content.is-venue .v-deck { width: calc(100vw - 24px); }
}

/* ============================================================
   LENS LAYER — DOM/SVG overlay for Focus + Streams views.
   Sits above the (hidden) Three.js timeline canvas; the venue
   layer is a separate overlay at a higher z-index and unaffected.
   ============================================================ */
#lens-layer {
  position: absolute; inset: 0; z-index: 15;
  display: none;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
#lens-layer.show { display: block; }
#lens-layer.is-dragging { cursor: grabbing; }

/* On touch / small screens the on-canvas search + zoom controls and the legend
   float over the graph and get in the way (pinch-zoom + the shell's own search
   cover the controls), so hide them all for Focus/Streams. */
@media (pointer: coarse), (max-width: 900px) {
  .lens-controls,
  .lens-legend { display: none !important; }
}

/* shared lens legend (top-right, under the hud-hint) */
.lens-legend {
  position: absolute; top: 74px; right: 40px; z-index: 18;
  display: flex; gap: 14px; flex-wrap: wrap; justify-content: flex-end;
  max-width: 46%;
  font-family: var(--ui); font-size: 9.5px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-dim); pointer-events: none;
}
.lens-legend span { display: inline-flex; align-items: center; }
.lens-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }

/* ---------- FOCUS view (center-axis per era) ---------- */
/* Focus is a free pan/zoom MAP: the stage is a fixed-size "world" that the
   camera scales + translates via a CSS transform (transform-origin: 0 0). */
/* No will-change here: we WANT the browser to re-rasterise the labels crisply at
   each zoom level rather than GPU-scaling a cached (blurry) layer. */
#focus-stage { position: absolute; top: 0; left: 0; transform-origin: 0 0; }
.focus-links { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 10; overflow: visible; }
/* Map-style LOD: zoomed out, drop the meta line and the lesser labels so the
   overview reads as dots + a few anchors; everything returns as you zoom in. */
#lens-layer[data-zoom="overview"] .f-node .meta,
#lens-layer[data-zoom="mid"] .f-node .meta { display: none; }
#lens-layer[data-zoom="overview"] .f-node:not(.hero):not(.band) .f-card { opacity: 0; }
#lens-layer[data-zoom="overview"] .f-node:not(.hero):not(.band):hover .f-card { opacity: 1; }
.lens-link {
  fill: none; stroke: rgba(236,230,220,0.13); stroke-width: 1;
  vector-effect: non-scaling-stroke; transition: opacity .2s, stroke .2s, stroke-width .2s;
}
.lens-link.is-hot { opacity: 1; stroke: #ffe5a0; stroke-width: 1.8; }
.lens-link.is-dim { opacity: 0.035; }
.erapanel {
  position: absolute;
  border: 1px solid rgba(236,230,220,0.12);
  border-radius: 16px;
  background: rgba(18,13,17,0.42);
  overflow: hidden; cursor: pointer;
  transition: left 0.55s cubic-bezier(.6,.05,.2,1), width 0.55s cubic-bezier(.6,.05,.2,1), background 0.4s, border-color 0.4s;
}
.erapanel:hover { border-color: rgba(236,230,220,0.3); }
.erapanel.active { cursor: default; background: rgba(22,15,20,0.5); border-color: rgba(236,230,220,0.22); }
.erapanel .glow {
  position: absolute; top: 50%; left: 50%; width: 88%; height: 60%;
  transform: translate(-50%,-50%); border-radius: 50%; filter: blur(70px); opacity: 0.4;
  pointer-events: none;
}
.panel-title { position: absolute; top: 20px; left: 0; right: 0; text-align: center; white-space: nowrap; z-index: 3; pointer-events: none; }
.panel-title b { font-family: var(--serif); font-weight: 500; font-size: 21px; letter-spacing: 0.03em; }
.panel-title span { display: block; font-family: var(--ui); font-size: 9px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--ink-faint); margin-top: 5px; }
.tab-title {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  writing-mode: vertical-rl; text-orientation: mixed; text-align: center; pointer-events: none;
}
.tab-title b { font-family: var(--serif); font-weight: 500; font-size: 14px; letter-spacing: 0.04em; color: var(--ink-dim); }
.tab-title span { font-family: var(--ui); font-size: 8.5px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-faint); margin-top: 8px; }
.erapanel:hover .tab-title b { color: #fff; }

/* Continuous-timeline era bands (background context behind the axis) */
.eraband { position: absolute; pointer-events: auto; cursor: pointer; z-index: 2; }
.eraband-fill {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--eraglow,#888) 9%, transparent), transparent 60%);
  border-left: 1px solid color-mix(in srgb, var(--eraglow,#888) 36%, transparent);
  transition: background .3s;
}
.eraband.current .eraband-fill { background: linear-gradient(180deg, color-mix(in srgb, var(--eraglow,#888) 17%, transparent), transparent 68%); }
.eraband:hover .eraband-fill { background: linear-gradient(180deg, color-mix(in srgb, var(--eraglow,#888) 20%, transparent), transparent 72%); }
.eraband-lab {
  position: absolute; top: 8px; white-space: nowrap; text-align: left;
  pointer-events: auto; cursor: pointer; background: none; border: 0;
  padding: 6px 8px; margin: 0; border-radius: 8px;
  transition: background .2s;
}
.eraband-lab:hover { background: color-mix(in srgb, var(--eraglow,#888) 16%, transparent); }
.eraband-lab:focus-visible { outline: 1px solid color-mix(in srgb, var(--eraglow,#888) 60%, transparent); outline-offset: 1px; }
.eraband-lab b { display: block; font-family: var(--serif); font-weight: 500; font-size: 17px; letter-spacing: .02em; color: var(--ink); transition: color .2s; }
.eraband-lab:hover b { color: #fff; }
.eraband-lab span { display: block; font-family: var(--ui); font-size: 8.5px; letter-spacing: .26em; text-transform: uppercase; color: var(--ink-faint); margin-top: 4px; }
.eraband-lab:hover span { color: var(--ink-dim); }
@media (max-width: 700px) { .eraband-lab b { font-size: 14px; } }

.axisline {
  position: absolute; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(236,230,220,0.34) 5%, rgba(236,230,220,0.34) 95%, transparent);
  z-index: 9; pointer-events: none;
}
.f-tick { position: absolute; transform: translateX(-50%); font-family: var(--ui); font-size: 10px; letter-spacing: 0.12em; color: var(--ink-faint); z-index: 9; pointer-events: none; }
.f-stem { position: absolute; width: 1px; background: rgba(236,230,220,0.2); z-index: 9; transform: translateX(-0.5px); pointer-events: none; }

.f-node { position: absolute; width: 0; height: 0; z-index: 12; }
.f-node .dot {
  position: absolute; left: -6px; top: -6px; width: 12px; height: 12px; border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(10,6,8,0.7), 0 0 14px 1px currentColor; cursor: pointer;
  transition: transform .2s, filter .2s, opacity .2s;
}
.f-node .f-card {
  position: absolute; left: 50%; transform: translateX(-50%); white-space: nowrap;
  text-align: center; cursor: pointer; transition: opacity .2s, filter .2s, transform .2s;
}
/* Label size: a readable base, an importance hierarchy (heroes > bands > rank&file,
   the Google-Maps "capital vs town" idea), and a gentle zoom-up via --fscale
   (set per-render in renderFocus) since there's more room when zoomed in. */
.f-node .nm { font-family: var(--serif); font-size: calc(15.5px * var(--fscale, 1)); font-weight: 500; line-height: 1.15; color: var(--ink); transition: color 0.15s; }
.f-node.band .nm { font-style: italic; font-size: calc(16px * var(--fscale, 1)); }
.f-node.hero .nm { font-size: calc(17.5px * var(--fscale, 1)); }
.f-node .meta { font-family: var(--ui); font-size: calc(9px * var(--fscale, 1)); letter-spacing: 0.13em; text-transform: uppercase; color: var(--ink-dim); margin-top: 3px; }
/* opaque, stream-coloured pill with the project's box rounding — legible over the graph */
.f-node .pillwrap { display: inline-block; padding: 8px 14px;
  border: 1px solid color-mix(in srgb, var(--nc, #9b948a) 50%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--nc, #9b948a) 15%, rgba(11,8,10,0.96));
  box-shadow: 0 8px 22px -10px rgba(0,0,0,0.75); }
.f-node:hover .nm, .f-node:focus .nm, .f-node.is-focus .nm { color: #fff; }
.f-node:hover .pillwrap, .f-node:focus .pillwrap, .f-node.is-focus .pillwrap {
  border-color: var(--nc, var(--gold));
  background: color-mix(in srgb, var(--nc, #9b948a) 24%, rgba(11,8,10,0.96)); }
.f-node:hover .dot, .f-node:focus .dot, .f-node.is-focus .dot { transform: scale(1.45); filter: brightness(1.3); }
.f-node:focus { outline: none; }
.f-node.is-related .dot { transform: scale(1.18); }
.f-node.is-dim { opacity: .14; }
.f-node.is-focus .f-card { transform: translateX(-50%) scale(1.04); }
/* LOD: only nodes that won a tier slot (.is-labeled) show a card; everything else
   is a bare dot whose card appears only on hover / focus / highlight. */
.f-node:not(.is-labeled) .f-card { opacity: 0; }
.f-node:not(.is-labeled):hover .f-card,
.f-node:not(.is-labeled):focus .f-card,
.f-node.is-focus .f-card,
.f-node.is-related .f-card { opacity: 1; }
/* a hovered bare dot lifts its card just above the axis so it reads cleanly */
.f-node:not(.is-labeled):hover .f-card,
.f-node:not(.is-labeled):focus .f-card { z-index: 30; background: rgba(12,8,11,.82); padding: 4px 9px; border-radius: 8px; backdrop-filter: blur(3px); }

/* ---------- STREAMS view (flowing ribbons → salsa) ---------- */
#streams-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
#streams-svg .s-eralab { font-family: var(--serif); fill: rgba(236,230,220,0.8); font-size: 19px; }
#streams-svg .s-erayrs { font-family: var(--ui); fill: var(--ink-faint); font-size: 9px; letter-spacing: 0.28em; }
#streams-svg .s-yr { font-family: var(--ui); fill: var(--ink-faint); font-size: 11px; letter-spacing: 0.18em; }
#streams-svg .s-streamlab { font-family: var(--ui); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; opacity: 0.85; }
/* dark halo (paint-order: stroke) keeps the serif labels legible over the busy
   stream of dots. vector-effect: non-scaling-stroke pins the halo to a constant
   screen width so it can't balloon into a blob as the SVG viewBox zooms in. */
#streams-svg .s-nm { font-family: var(--serif); fill: var(--ink); font-size: 14px; font-weight: 500;
  paint-order: stroke; stroke: rgba(8,5,8,0.92); stroke-width: 3px; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
#streams-svg .s-nm.band { font-style: italic; }
#streams-svg .s-meta { font-family: var(--ui); fill: var(--ink-dim); font-size: 8.5px; letter-spacing: 0.12em; text-transform: uppercase;
  paint-order: stroke; stroke: rgba(8,5,8,0.85); stroke-width: 2.4px; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
#streams-svg .s-node circle { filter: drop-shadow(0 0 6px currentColor); cursor: pointer; }
#streams-svg .s-node { cursor: pointer; transition: opacity 0.2s; outline: none; }
#streams-svg .s-node circle { transform-box: fill-box; transform-origin: center; transition: transform .2s, filter .2s; }
#streams-svg .s-node:hover .s-nm { fill: #fff; }
#streams-svg .s-salsa { font-family: var(--serif); fill: #fff; font-size: 30px; text-anchor: middle; }
#streams-svg .s-node:hover circle, #streams-svg .s-node:focus circle, #streams-svg .s-node.is-focus circle {
  transform: scale(1.7); filter: drop-shadow(0 0 12px currentColor) brightness(1.35);
}
#streams-svg .s-node.is-related circle { transform: scale(1.28); }
#streams-svg .s-node.is-dim { opacity: .11; }
#streams-svg .s-link { opacity: .18; }
#streams-svg .s-ribbon { animation: ribbon-breathe 7s ease-in-out infinite alternate; }
#streams-svg .s-ribbon:nth-of-type(even) { animation-delay: -3.5s; }
#streams-svg .s-convergence { transform-box: fill-box; transform-origin: center; animation: clave-pulse 2.8s ease-in-out infinite; }
/* Label visibility is decided in JS (the .has-label / .has-meta classes encode the
   per-zoom minimum + collision pass). CSS only hides the rest and ALWAYS reveals on
   hover / focus / selection. No inline opacity is written, so hover can't be blocked. */
#streams-svg .s-nm, #streams-svg .s-meta { opacity: 0; }
#streams-svg .s-node.has-label .s-nm { opacity: 1; }
#streams-svg .s-node.has-meta .s-meta { opacity: 1; }
#streams-svg .s-node:hover .s-nm,
#streams-svg .s-node:focus .s-nm,
#streams-svg .s-node.is-focus .s-nm,
#streams-svg .s-node.is-related .s-nm { opacity: 1; }

@keyframes ribbon-breathe { from { opacity: .10; } to { opacity: .18; } }
@keyframes clave-pulse { 0%,100% { transform: scale(.94); opacity: .13; } 50% { transform: scale(1.08); opacity: .24; } }

/* navigation + search */
.lens-controls {
  position: absolute; left: 38px; bottom: 32px; z-index: 25;
  display: flex; align-items: flex-end; gap: 12px;
}
.lens-search-wrap { position: relative; }
#lens-search {
  width: 232px; height: 40px; padding: 0 15px 0 36px;
  color: var(--ink); background: rgba(12,10,16,.78);
  border: 1px solid var(--line); border-radius: 999px; outline: none;
  font-family: var(--ui); font-size: 11px; letter-spacing: .04em;
  backdrop-filter: blur(14px); transition: width .25s, border-color .2s, background .2s;
}
#lens-search::placeholder { color: var(--ink-faint); }
#lens-search:focus { width: 290px; border-color: rgba(236,230,220,.42); background: rgba(16,13,20,.95); }
.lens-search-wrap::before {
  content: "⌕"; position: absolute; left: 14px; top: 8px; z-index: 2;
  font-family: var(--serif); font-size: 20px; color: var(--ink-dim); pointer-events: none;
}
.lens-search-results {
  position: absolute; left: 0; bottom: 48px; width: 330px; display: none;
  padding: 7px; border-radius: 14px; background: rgba(12,10,16,.97);
  border: 1px solid var(--line); box-shadow: 0 22px 70px rgba(0,0,0,.72);
  backdrop-filter: blur(18px);
}
.lens-search-results.show { display: block; }
.lens-search-results button {
  display: block; width: 100%; padding: 9px 10px; text-align: left;
  color: var(--ink-dim); background: transparent; border: 0; border-radius: 9px; cursor: pointer;
}
.lens-search-results button:hover, .lens-search-results button:focus { color: var(--ink); background: rgba(255,255,255,.06); outline: none; }
.lens-search-results b { display: block; font: 500 14px/1.2 var(--serif); }
.lens-search-results span { display: block; margin-top: 3px; font-size: 8.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); }
.lens-zoom-controls {
  height: 40px; display: flex; align-items: center; gap: 1px; padding: 4px;
  border: 1px solid var(--line); border-radius: 999px; background: rgba(12,10,16,.78);
  backdrop-filter: blur(14px);
}
.lens-zoom-controls button {
  height: 30px; min-width: 32px; padding: 0 9px; color: var(--ink-dim); background: transparent;
  border: 0; border-radius: 999px; cursor: pointer; font: 16px var(--ui);
}
.lens-zoom-controls button:hover { color: var(--ink); background: rgba(255,255,255,.07); }
.lens-zoom-controls .lens-reset { font-size: 8px; letter-spacing: .16em; text-transform: uppercase; padding: 0 12px; }
#lens-zoom-readout { width: 42px; text-align: center; font-size: 9px; letter-spacing: .08em; color: var(--ink-faint); }
.lens-status {
  position: absolute; left: 50%; bottom: 89px; z-index: 25; transform: translate(-50%,8px);
  padding: 7px 12px; border-radius: 999px; opacity: 0; pointer-events: none;
  color: var(--ink-dim); background: rgba(12,10,16,.78); border: 1px solid var(--line);
  font: italic 12px var(--serif); transition: opacity .2s, transform .2s;
}
.lens-status.show { opacity: 1; transform: translate(-50%,0); }

@media (max-width: 900px) {
  .title-lockup { top: 22px; left: 22px; max-width: 72%; }
  .title-lockup h1 { font-size: 22px; }
  .title-lockup .credit { display: none; }
  .hud-hint { display: none; }
  .lens-legend { top: 76px; left: 22px; right: 22px; max-width: none; justify-content: flex-start; gap: 9px; }
  .lens-controls { left: 18px; right: 18px; bottom: 82px; }
  #lens-search { width: min(210px, 48vw); }
  #lens-search:focus { width: min(260px, 60vw); }
  .view-toggle { bottom: 20px; }
  .view-toggle button { padding: 9px 13px; letter-spacing: .16em; }
  .erapanel { border-radius: 12px; }
  .panel-title b { font-size: 18px; }
  .card { right: 16px; width: min(340px, calc(100vw - 32px)); }
}

@media (max-width: 600px) {
  .panel-title { white-space: normal; padding: 0 8px; line-height: 1.05; }
  .panel-title b { font-size: 16px; }
  .panel-title span { margin-top: 7px; }
  #streams-svg .s-eralab, #streams-svg .s-erayrs { display: none; }
  #streams-svg .s-salsa { font-size: 24px; }
}

/* ============================================================
   Portrait-mobile rotate prompt. The Focus/Streams constellation
   is unusable in a tall narrow viewport, so in portrait we cover
   the graph with a "turn your phone" card. It sits at z 56 — above
   the graph + its chrome, but below the Venue (60) and Detail (80)
   reading overlays, which read fine in portrait.
   ============================================================ */
#rotate-cta { display: none; }
@media (orientation: portrait) and (max-width: 820px) {
  #rotate-cta {
    display: flex; position: fixed; inset: 0; z-index: 56;
    align-items: center; justify-content: center; text-align: center; padding: 34px;
    background: radial-gradient(125% 90% at 50% 32%, #130d12 0%, var(--bg) 72%);
  }
  .rc-inner { max-width: 320px; }
  .rc-phone { color: var(--gold); margin-bottom: 26px; display: inline-flex; }
  .rc-phone svg { transform-origin: 50% 50%; animation: rcTilt 2.8s ease-in-out infinite; }
  .rc-title { font-family: var(--serif); font-size: 27px; line-height: 1.15; color: var(--ink); margin-bottom: 13px; }
  .rc-sub { font-family: var(--ui); font-size: 14px; line-height: 1.6; color: var(--ink-dim); }
}
@keyframes rcTilt {
  0%, 26% { transform: rotate(0deg); }
  62%, 88% { transform: rotate(-90deg); }
  100% { transform: rotate(0deg); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* Embed mode: hide the app's own chrome when the App Shell iframes this view
   (?embed=1). The shell's rail/dock provides navigation instead. */
.is-embed .title-lockup,
.is-embed .view-toggle,
.is-embed .filters,
.is-embed .stub-note,
.is-embed .hud-hint { display: none !important; }

/* ============================================================
   Lens drawer — click a Focus/Streams node to see what the
   connections MEAN (type + curator note + source).
   ============================================================ */
#lens-drawer-scrim { position: fixed; inset: 0; background: rgba(6,4,6,.45); z-index: 58; opacity: 0; pointer-events: none; transition: opacity .2s; }
#lens-drawer-scrim.on { opacity: 1; pointer-events: auto; }
#lens-drawer { position: fixed; top: 0; right: 0; height: 100vh; height: 100dvh; width: 372px; max-width: 88vw; z-index: 59;
  background: rgba(14,9,11,.94); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-left: 1px solid var(--line); box-shadow: -30px 0 70px rgba(0,0,0,.55);
  transform: translateX(102%); transition: transform .26s cubic-bezier(.3,0,.2,1); overflow-y: auto; padding: 22px 20px 34px; }
#lens-drawer.open { transform: none; }
.dz-head { display: flex; align-items: flex-start; gap: 14px; }
.dz-med { width: 54px; height: 54px; flex: 0 0 54px; font-size: 18px; }
.dz-id { flex: 1; min-width: 0; padding-top: 2px; }
.dz-kicker { font-family: var(--ui); font-size: 9.5px; letter-spacing: .26em; text-transform: uppercase; color: var(--gold); }
.dz-id h2 { font-family: var(--serif); font-weight: 400; font-size: 23px; line-height: 1.1; margin: 3px 0 2px; }
.dz-sub { font-family: var(--ui); font-size: 11.5px; color: var(--ink-dim); }
.dz-close { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--ink-dim); font-size: 18px; cursor: pointer; transition: .15s; }
.dz-close:hover { color: var(--ink); border-color: var(--gold); }
.dz-open { width: 100%; margin: 16px 0 6px; padding: 11px; border-radius: 11px; border: 1px solid var(--gold); background: rgba(224,178,74,.12); color: var(--gold); font-family: var(--ui); font-size: 13px; font-weight: 600; letter-spacing: .02em; cursor: pointer; transition: .15s; }
.dz-open:hover { background: rgba(224,178,74,.2); }
.dz-seclabel { font-family: var(--ui); font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: var(--ink-faint); margin: 20px 2px 10px; }
.dz-empty { color: var(--ink-faint); font-size: 13px; font-style: italic; padding: 6px 2px; }
.cx-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; margin-bottom: 7px; border-radius: 12px;
  background: rgba(18,13,17,.5); border: 1px solid var(--line); cursor: pointer; text-align: left; position: relative;
  transition: transform .14s, background .14s, border-color .14s; }
.cx-row:hover { background: rgba(30,21,28,.7); border-color: var(--gold); transform: translateX(-3px); }
.cx-row .f { width: 42px; height: 42px; border-radius: 50%; flex: 0 0 42px; overflow: hidden; position: relative; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 14px; font-family: var(--ui); box-shadow: 0 6px 16px rgba(0,0,0,.5); }
.cx-row .f img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 18%; opacity: 0; transition: opacity .5s; }
.cx-row .f img.in { opacity: 1; }
.cx-body { flex: 1; min-width: 0; }
.cx-name { font-family: var(--serif); font-size: 14.5px; color: var(--ink); line-height: 1.15; }
.cx-rel { margin-top: 4px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.cx-type { font-family: var(--ui); font-size: 8.5px; letter-spacing: .1em; text-transform: uppercase; padding: 2px 7px; border-radius: 20px; background: rgba(236,230,220,.1); color: var(--ink-dim); white-space: nowrap; }
.cx-type.out { color: #e8c068; background: rgba(224,178,74,.14); }
.cx-conf { font-family: var(--ui); font-size: 8.5px; letter-spacing: .08em; text-transform: uppercase; padding: 2px 7px; border-radius: 20px; white-space: nowrap; }
.cx-conf.high { color: #8fcf9b; background: rgba(110,174,106,.16); }
.cx-conf.medium { color: #c9b07a; background: rgba(201,176,122,.14); }
.cx-type.in { color: #8fc6cf; background: rgba(121,184,192,.14); }
.cx-note { font-family: var(--ui); font-size: 11px; color: var(--ink-dim); line-height: 1.35; }
.cx-src { flex: 0 0 auto; color: var(--ink-faint); text-decoration: none; font-size: 14px; padding: 2px 4px; align-self: flex-start; }
.cx-src:hover { color: var(--gold); }
/* Mobile: the connection drawer becomes a bottom sheet (slides up, not in from the
   side), and the preview card docks to the bottom too. Tap-first, big targets. */
@media (max-width: 720px) {
  #lens-drawer {
    top: auto; bottom: 0; right: 0; left: 0; width: 100%; max-width: 100%;
    height: 100vh; height: 100dvh; max-height: 100dvh;
    border-left: 0; border-top: 1px solid var(--line);
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -26px 60px rgba(0,0,0,.6);
    transform: translateY(102%);
    padding: 58px 20px calc(28px + env(safe-area-inset-bottom));
  }
  #lens-drawer.open { transform: translateY(0); }
  /* grab handle */
  #lens-drawer::before { content: ""; position: absolute; top: 13px; left: 50%; display: block; width: 42px; height: 4px;
    border-radius: 2px; background: rgba(241,232,218,.22); transform: translateX(-50%); }
  .dz-close { width: 38px; height: 38px; font-size: 20px; }
  .cx-row { padding: 11px 10px; }            /* bigger touch targets */
  .cx-row .f { width: 46px; height: 46px; flex: 0 0 46px; }

  /* preview card → bottom sheet */
  .card {
    top: auto; bottom: 0; left: 0; right: 0; width: 100%; max-width: 100%;
    transform: translateY(102%); border-radius: 18px 18px 0 0;
    max-height: 82vh; max-height: 82dvh;
    padding: 22px 20px calc(22px + env(safe-area-inset-bottom));
  }
  .card.show { transform: translateY(0) !important; }
}
