/* ============================================================
   אקורדים — Akordim · shared design system
   Dark, bold, RTL-first. Heebo for Hebrew + Latin.
   ============================================================ */

:root {
  /* surfaces — cool near-black, lifted a touch + faint warmth */
  --bg:        oklch(0.175 0.018 288);
  --bg-2:      oklch(0.145 0.016 288);
  --surface:   oklch(0.225 0.022 288);
  --surface-2: oklch(0.265 0.026 288);
  --surface-3: oklch(0.305 0.028 288);
  --border:    oklch(0.32 0.022 285 / 0.7);
  --border-soft: oklch(0.32 0.022 285 / 0.35);

  /* text */
  --text:   oklch(0.97 0.004 285);
  --muted:  oklch(0.74 0.014 285);
  --faint:  oklch(0.58 0.016 285);

  /* accents — purple primary, electric blue secondary (same chroma family) */
  --accent:      oklch(0.64 0.205 300);
  --accent-bright: oklch(0.72 0.20 300);
  --accent-2:    oklch(0.70 0.165 248);
  --accent-ink:  oklch(0.16 0.04 300);

  --glow: oklch(0.64 0.205 300 / 0.45);

  /* type */
  --font: "Heebo", system-ui, -apple-system, sans-serif;
  --mono: "Space Mono", ui-monospace, "SF Mono", monospace;

  /* metrics */
  --r-sm: 8px;
  --r:    14px;
  --r-lg: 22px;
  --r-xl: 30px;
  --shadow: 0 14px 40px -16px rgba(0,0,0,0.7);
  --shadow-lg: 0 30px 80px -24px rgba(0,0,0,0.8);

  --maxw: 1240px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
}

body[dir="rtl"] { text-align: right; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }

::selection { background: var(--glow); color: #fff; }

/* ambient gradient wash behind everything */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 500px at 85% -8%, oklch(0.64 0.205 300 / 0.18), transparent 70%),
    radial-gradient(800px 480px at 5% 0%, oklch(0.70 0.165 248 / 0.12), transparent 65%);
  pointer-events: none;
}

/* ---------- layout helpers ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(18px, 4vw, 40px); }
.section { padding-block: clamp(40px, 6vw, 76px); }
.stack { display: flex; flex-direction: column; }

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-bright);
  margin: 0 0 10px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.section-head h2 {
  font-size: clamp(26px, 3.4vw, 40px);
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0;
}
.section-head .sub { color: var(--muted); margin: 6px 0 0; font-size: 15px; }

.link-more {
  font-weight: 600;
  color: var(--accent-bright);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.link-more:hover { color: var(--text); }

/* ---------- top navigation ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(18px) saturate(140%);
  background: oklch(0.15 0.012 285 / 0.78);
  border-bottom: 1px solid var(--border-soft);
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: 22px;
  height: 70px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.01em;
}
.brand .mark {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  display: grid; place-items: center;
  box-shadow: 0 6px 18px -6px var(--glow);
  flex: none;
}
.brand .mark span {
  width: 12px; height: 12px;
  background: #fff;
  border-radius: 50% 50% 50% 2px;
  box-shadow: 9px -5px 0 -3px #fff;
  transform: rotate(-8deg);
}
.brand small { color: var(--faint); font-family: var(--mono); font-size: 11px; font-weight: 400; letter-spacing: 0.12em; }

.nav-links { display: flex; gap: 4px; margin-inline-start: 8px; }
.nav-links a {
  padding: 9px 14px;
  border-radius: 99px;
  color: var(--muted);
  font-weight: 600;
  font-size: 15px;
  transition: background .18s, color .18s;
}
.nav-links a:hover { color: var(--text); background: var(--surface); }
.nav-links a.active { color: var(--text); background: var(--surface-2); }

.nav-search {
  margin-inline-start: auto;
  position: relative;
  display: flex;
  align-items: center;
  flex: 0 1 320px;
}
.nav-search input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  color: var(--text);
  border-radius: 99px;
  padding: 10px 42px 10px 16px;
  font-family: inherit;
  font-size: 14px;
  transition: border-color .18s, background .18s;
}
body[dir="rtl"] .nav-search input { padding: 10px 42px 10px 16px; }
.nav-search input::placeholder { color: var(--faint); }
.nav-search input:focus { outline: none; border-color: var(--accent); background: var(--surface-2); }
/* remove native search decorations (magnifier / clear-×) that overlap our .ico */
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration { -webkit-appearance: none; appearance: none; }
/* app-like feel: kill double-tap zoom + iOS text auto-resize */
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
.nav-search .ico {
  position: absolute;
  inset-inline-end: 15px;
  color: var(--faint);
  pointer-events: none;
  display: grid; place-items: center;
}
.nav-burger { display: none; }

/* mobile dropdown menu (hidden on desktop) */
.nav-mobile { display: none; }
.nav-mobile.open {
  display: flex; flex-direction: column; gap: 4px;
  padding: 8px clamp(18px, 4vw, 40px) 16px;
  border-top: 1px solid var(--border-soft);
  background: oklch(0.13 0.012 285 / 0.98);
  backdrop-filter: blur(18px) saturate(140%);
  animation: navDrop .2s ease both;
}
.nav-mobile a {
  padding: 13px 14px; border-radius: 12px;
  color: var(--text); font-weight: 600; font-size: 16px;
}
.nav-mobile a:hover, .nav-mobile a.active { background: var(--surface-2); }
@keyframes navDrop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (min-width: 821px) { .nav-mobile { display: none !important; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 99px;
  padding: 12px 22px;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--border-soft);
  transition: transform .15s, background .18s, border-color .18s, box-shadow .2s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-3); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 12px 30px -12px var(--glow);
}
.btn-primary:hover { box-shadow: 0 16px 38px -10px var(--glow); background: linear-gradient(140deg, var(--accent-bright), var(--accent-2)); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--surface); }
.btn-icon { padding: 12px; width: 46px; height: 46px; }
.btn-lg { padding: 15px 28px; font-size: 16px; }

/* ---------- chips / category bar ---------- */
.chips { display: flex; gap: 10px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  border-radius: 99px;
  padding: 9px 18px;
  font-weight: 600;
  font-size: 14px;
  transition: all .16s;
  display: inline-flex; align-items: center; gap: 8px;
}
.chip { --hue: 300; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: oklch(0.72 0.16 var(--hue)); box-shadow: 0 0 8px oklch(0.72 0.16 var(--hue) / 0.7); }
.chip:hover { color: var(--text); border-color: oklch(0.72 0.16 var(--hue)); }
.chip.active { background: oklch(0.72 0.16 var(--hue)); color: oklch(0.16 0.03 var(--hue)); border-color: transparent; }
.chip.active .dot { background: currentColor; box-shadow: none; }

/* ---------- tempo chips (compact pill toggles) ---------- */
.tempo-box { display: flex; align-items: center; gap: 8px; }
.tempo-box > .lbl { color: var(--muted); font-size: 14px; font-weight: 600; }
.chip-sm { padding: 7px 14px; font-size: 13px; }

/* ---------- Hebrew A–Z index ---------- */
.azindex {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 0 0 22px;
}
.az-letter {
  min-width: 30px; height: 30px;
  display: inline-grid; place-items: center;
  padding: 0 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  border-radius: 8px;
  font-weight: 700; font-size: 14px; line-height: 1;
  cursor: pointer;
  transition: all .14s;
}
.az-letter:hover:not(:disabled) { color: var(--text); border-color: var(--accent); }
.az-letter.active { background: var(--accent); color: #fff; border-color: transparent; }
.az-letter:disabled { opacity: .28; cursor: default; }
.az-all { font-weight: 800; }

@media (max-width: 640px) {
  .azindex {
    flex-wrap: nowrap; overflow-x: auto;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
    margin-inline: -16px; padding-inline: 16px;
  }
  .azindex::-webkit-scrollbar { display: none; }
  .az-letter { flex: 0 0 auto; }
}

/* ---------- song card ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}
.song-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  padding: 13px;
  transition: transform .2s, background .2s, border-color .2s;
  overflow: hidden;
}
.song-card:hover { background: var(--surface-2); transform: translateY(-4px); border-color: var(--border); }
.cover {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--r);
  overflow: hidden;
  display: grid; place-items: center;
  margin-bottom: 14px;
}
.cover .glyph {
  font-size: clamp(48px, 8vw, 74px);
  font-weight: 800;
  color: #fff;
  mix-blend-mode: overlay;
  opacity: 0.92;
  line-height: 1;
}
.cover .staff {
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(to bottom, transparent 0 13px, rgba(255,255,255,.16) 13px 14px);
  background-position: center;
  background-size: 100% 70px;
  background-repeat: no-repeat;
  opacity: .5;
  mix-blend-mode: soft-light;
}
.song-card .play-fab {
  position: absolute;
  inset-block-end: 24px;
  inset-inline-end: 24px;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid; place-items: center;
  border: none;
  box-shadow: 0 10px 24px -8px var(--glow);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s, transform .2s, background .15s;
}
.song-card:hover .play-fab { opacity: 1; transform: translateY(0); }
.play-fab:hover { background: var(--accent-bright); }

.song-card .title {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 3px;
  line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.song-card .composer { color: var(--muted); font-size: 13.5px; margin: 0; }
.song-card .card-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 11px; gap: 8px;
}
.song-card .foot-left { display: flex; align-items: center; gap: 6px; min-width: 0; }
.keypill {
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  color: var(--muted); background: var(--surface-2);
  border: 1px solid var(--border-soft); padding: 3px 8px; border-radius: 99px;
  flex: none;
}
.keypill.tuned { color: var(--accent-bright); border-color: oklch(0.64 0.205 300 / 0.4); background: oklch(0.64 0.205 300 / 0.12); }
.tag {
  font-size: 12px;
  font-weight: 600;
  color: oklch(0.80 0.13 var(--hue, 300));
  background: oklch(0.72 0.16 var(--hue, 300) / 0.14);
  border: 1px solid oklch(0.72 0.16 var(--hue, 300) / 0.28);
  padding: 4px 10px;
  border-radius: 99px;
}

/* favorite button */
.fav {
  background: transparent;
  border: none;
  color: var(--faint);
  display: grid; place-items: center;
  padding: 4px;
  transition: color .15s, transform .15s;
}
.fav:hover { color: var(--accent-bright); transform: scale(1.12); }
.fav.on { color: var(--accent); }
.fav.on svg { fill: var(--accent); }

/* ---------- character-anchored chord chart (chords_json) ---------- */
.chart-anchored { font-size: calc(16px * var(--cc-scale, 1)); line-height: 1.5; }
.chart-anchored .cl-section {
  color: var(--accent-bright); font-weight: 700; font-family: var(--mono);
  font-size: .85em; letter-spacing: .02em; margin: 1.3em 0 .25em;
}
.chart-anchored .cl-section:first-child { margin-top: 0; }
.chart-anchored .cl-line { display: flex; flex-wrap: wrap; align-items: flex-end; margin-bottom: .15em; min-height: 1.2em; }
.chart-anchored .cl-blank { height: 1.1em; }
.chart-anchored .cl-seg { display: inline-flex; flex-direction: column; align-items: flex-start; }
.chart-anchored .cl-ch {
  font-family: var(--mono); font-weight: 700; color: var(--accent-bright);
  font-size: .78em; line-height: 1.35; min-height: 1.35em; white-space: nowrap;
  padding-inline-end: 6px;
}
.chart-anchored .cl-ch.empty { padding: 0; }
.chart-anchored .cl-tx, .chart-anchored .ch { white-space: pre; }

/* editable variant (admin by-ear) */
.chart-anchored.editable .ch { cursor: pointer; border-radius: 3px; }
.chart-anchored.editable .ch:hover { background: oklch(0.72 0.16 300 / 0.25); }
.chart-anchored.editable .cl-ch { cursor: pointer; }
.chart-anchored.editable .cl-ch:hover { text-decoration: underline; }
.chart-anchored.editable .cl-ch.empty { min-width: 0; }

/* ---------- footer ---------- */
.footer {
  border-top: 1px solid var(--border-soft);
  margin-top: 40px;
  padding-block: 46px 60px;
  color: var(--muted);
}
.footer-grid { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.footer h4 { color: var(--text); font-size: 15px; margin: 0 0 14px; }
.footer a { display: block; color: var(--muted); padding: 5px 0; font-size: 14px; }
.footer a:hover { color: var(--text); }
.footer .copy { font-size: 13px; color: var(--faint); margin-top: 30px; font-family: var(--mono); }

/* ---------- utilities ---------- */
.muted { color: var(--muted); }
.center { text-align: center; }
.hidden { display: none !important; }
.divider { height: 1px; background: var(--border-soft); border: none; margin: 0; }

.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.empty .big { font-size: 40px; margin-bottom: 10px; }

/* mobile nav */
@media (max-width: 820px) {
  .nav-links { display: none; }
  .nav-search { flex-basis: auto; flex-grow: 1; }
  .nav-burger {
    display: grid; place-items: center;
    width: 44px; height: 44px; border-radius: 12px;
    background: var(--surface); border: 1px solid var(--border-soft); color: var(--text);
  }
  .brand small { display: none; }
}
@media (max-width: 540px) {
  .nav-inner { height: 62px; gap: 12px; }
  .brand { font-size: 19px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
}

/* ============================================================
   LIFE & MOTION — aurora, entrances, trending, now-playing
   ============================================================ */

/* drifting aurora behind the hero */
.aurora { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.hero .wrap { position: relative; z-index: 1; }
.aurora b {
  position: absolute; border-radius: 50%; filter: none; opacity: 0.85;
}
.aurora .a1 { width: 620px; height: 620px; inset-block-start: -200px; inset-inline-end: 0%; background: radial-gradient(circle at center, oklch(0.62 0.21 300 / 0.9), transparent 68%); animation: drift1 18s ease-in-out infinite alternate; }
.aurora .a2 { width: 540px; height: 540px; inset-block-start: -120px; inset-inline-start: 2%; background: radial-gradient(circle at center, oklch(0.64 0.18 248 / 0.8), transparent 68%); animation: drift2 22s ease-in-out infinite alternate; }
.aurora .a3 { width: 460px; height: 460px; inset-block-start: 40px; inset-inline-end: 32%; background: radial-gradient(circle at center, oklch(0.62 0.17 168 / 0.6), transparent 70%); animation: drift3 26s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(-70px, 60px) scale(1.15); } }
@keyframes drift2 { to { transform: translate(80px, 40px) scale(1.1); } }
@keyframes drift3 { to { transform: translate(40px, -50px) scale(1.2); } }
@media (prefers-reduced-motion: reduce) { .aurora b { animation: none !important; } }

/* card / tile entrance stagger */
@media (prefers-reduced-motion: no-preference) {
  .song-card, .cat-tile, .trend-row { animation: fadeUp .55s cubic-bezier(.22,.8,.3,1) both; }
  .grid .song-card:nth-child(1){animation-delay:.02s}
  .grid .song-card:nth-child(2){animation-delay:.06s}
  .grid .song-card:nth-child(3){animation-delay:.10s}
  .grid .song-card:nth-child(4){animation-delay:.14s}
  .grid .song-card:nth-child(5){animation-delay:.18s}
  .grid .song-card:nth-child(6){animation-delay:.22s}
  .grid .song-card:nth-child(7){animation-delay:.26s}
  .grid .song-card:nth-child(8){animation-delay:.30s}
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ---- Trending now (ranked) ---- */
.trend-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 30px; }
@media (max-width: 720px) { .trend-list { grid-template-columns: 1fr; } }
.trend-row {
  display: flex; align-items: center; gap: 16px; padding: 12px;
  border-radius: var(--r); transition: background .18s; cursor: pointer;
}
.trend-row:hover { background: var(--surface); }
.trend-row .rank {
  font-family: var(--mono); font-weight: 700; font-size: 26px; line-height: 1;
  width: 42px; text-align: center; flex: none;
  background: linear-gradient(180deg, var(--text), oklch(0.55 0.02 285));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.trend-row:nth-child(-n+3) .rank { background: linear-gradient(180deg, oklch(0.82 0.14 var(--hue,300)), oklch(0.55 0.16 var(--hue,300))); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.trend-row .mini {
  width: 52px; height: 52px; border-radius: 12px; flex: none; position: relative; overflow: hidden;
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 22px;
}
.trend-row .mini .staff { position:absolute; inset:0; background-image: repeating-linear-gradient(to bottom, transparent 0 9px, rgba(255,255,255,.18) 9px 10px); background-size:100% 44px; background-repeat:no-repeat; background-position:center; mix-blend-mode:soft-light; }
.trend-row .info { flex: 1; min-width: 0; }
.trend-row .info .t { font-weight: 700; font-size: 16px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trend-row .info .c { color: var(--muted); font-size: 13px; margin: 2px 0 0; }
.trend-row .pop { font-family: var(--mono); font-size: 12px; color: var(--faint); flex: none; }

/* ---- now-playing bar ---- */
.npbar {
  position: fixed; inset-inline: 0; inset-block-end: 0; z-index: 120;
  background: oklch(0.225 0.022 288 / 0.92); backdrop-filter: blur(20px) saturate(150%);
  border-top: 1px solid var(--border);
  transform: translateY(110%); transition: transform .35s cubic-bezier(.22,.9,.3,1);
  box-shadow: 0 -16px 50px -20px rgba(0,0,0,.7);
}
.npbar.show { transform: translateY(0); }
.npbar-inner { display: flex; align-items: center; gap: 16px; height: 76px; }
.npbar .np-art { width: 50px; height: 50px; border-radius: 10px; flex: none; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 22px; position: relative; overflow: hidden; }
.npbar .np-art .staff { position:absolute; inset:0; background-image: repeating-linear-gradient(to bottom, transparent 0 9px, rgba(255,255,255,.18) 9px 10px); background-size:100% 42px; background-repeat:no-repeat; background-position:center; mix-blend-mode:soft-light; }
.npbar .np-meta { min-width: 0; flex: 1; }
.npbar .np-meta .t { font-weight: 700; font-size: 15px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.npbar .np-meta .c { color: var(--muted); font-size: 12.5px; margin: 1px 0 0; }
.npbar .np-controls { display: flex; align-items: center; gap: 10px; }
.npbar .np-play { width: 46px; height: 46px; border-radius: 50%; border: none; background: linear-gradient(140deg, var(--accent), var(--accent-2)); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 20px -8px var(--glow); flex: none; }
.npbar .np-play:hover { filter: brightness(1.1); }
.npbar .np-close { background: transparent; border: none; color: var(--faint); font-size: 22px; padding: 6px; flex: none; }
.npbar .np-close:hover { color: var(--text); }
.npbar .np-prog { flex: 1.4; height: 5px; background: var(--surface-3); border-radius: 99px; overflow: hidden; max-width: 360px; }
.npbar .np-prog span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
@media (max-width: 680px) { .npbar .np-prog { display: none; } }

/* equalizer */
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 16px; }
.eq i { width: 3px; background: currentColor; border-radius: 2px; height: 30%; animation: eq .9s ease-in-out infinite; }
.eq i:nth-child(2){ animation-delay:.2s; height: 80%; }
.eq i:nth-child(3){ animation-delay:.4s; height: 50%; }
.eq i:nth-child(4){ animation-delay:.1s; height: 95%; }
.eq.paused i { animation-play-state: paused; }
@keyframes eq { 0%,100%{ transform: scaleY(.35);} 50%{ transform: scaleY(1);} }
@media (prefers-reduced-motion: reduce) { .eq i { animation: none; } }

/* now-playing transpose control */
.np-transpose { display: flex; align-items: center; gap: 4px; background: var(--bg-2); border: 1px solid var(--border-soft); border-radius: 99px; padding: 4px; flex: none; }
.np-transpose button { width: 30px; height: 30px; border-radius: 50%; border: none; background: var(--surface-2); color: var(--text); font-size: 17px; font-weight: 700; display: grid; place-items: center; transition: background .15s; }
.np-transpose button:hover { background: var(--accent); }
.np-key { min-width: 50px; text-align: center; font-family: var(--mono); font-weight: 700; font-size: 14px; line-height: 1; display: grid; }
.np-key small { font-size: 9px; color: var(--accent-bright); letter-spacing: .04em; min-height: 11px; }
@media (max-width: 760px) { .np-transpose { display: none; } }

/* ---- category emblems ---- */
.chip-ico { display: inline-grid; place-items: center; color: oklch(0.78 0.15 var(--hue, 300)); }
.chip.active .chip-ico { color: currentColor; }
.cat-tile .cat-ico {
  position: absolute; inset-block-start: 13px; inset-inline-end: 14px;
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center; color: #fff;
  background: rgba(255,255,255,.16); backdrop-filter: blur(4px);
}
.cat-tile small { inset-inline-start: 16px; }

/* ---- collections ---- */
.coll-strip { display: flex; gap: 18px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
.coll-strip::-webkit-scrollbar { display: none; }
.coll-tile {
  flex: 0 0 auto; width: 268px; border-radius: var(--r-lg); overflow: hidden;
  position: relative; background: var(--surface); border: 1px solid var(--border-soft);
  transition: transform .2s, border-color .2s;
}
.coll-tile:hover { transform: translateY(-5px); border-color: oklch(0.7 0.16 var(--hue) / 0.6); }
.coll-covers { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px; aspect-ratio: 16 / 11; }
.coll-covers span { position: relative; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 22px; overflow: hidden; }
.coll-covers span .staff { position: absolute; inset: 0; background-image: repeating-linear-gradient(to bottom, transparent 0 8px, rgba(255,255,255,.16) 8px 9px); background-size: 100% 40px; background-repeat: no-repeat; background-position: center; mix-blend-mode: soft-light; }
.coll-scrim { position: absolute; inset-block-start: 0; inset-inline: 0; height: 64%; pointer-events: none;
  background: linear-gradient(160deg, oklch(0.62 0.18 var(--hue) / 0.55), transparent 70%); }
.coll-info { padding: 14px 16px 16px; position: relative; }
.coll-kicker { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: oklch(0.78 0.15 var(--hue)); margin: 0 0 4px; }
.coll-title { font-weight: 800; font-size: 19px; margin: 0; letter-spacing: -0.01em; }
.coll-sub { color: var(--muted); font-size: 13px; margin: 4px 0 0; }

/* collection banner on catalog */
.coll-banner {
  display: flex; align-items: center; gap: 20px; padding: 22px;
  border-radius: var(--r-lg); margin-bottom: 24px; position: relative; overflow: hidden;
  background: linear-gradient(135deg, oklch(0.40 0.14 var(--hue, 300)), oklch(0.26 0.08 var(--hue, 300)));
  border: 1px solid oklch(0.7 0.16 var(--hue, 300) / 0.4);
}
.coll-banner .bn-covers { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px; width: 82px; height: 82px; border-radius: 12px; overflow: hidden; flex: none; }
.coll-banner .bn-covers span { display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 16px; }
.coll-banner h1 { font-size: clamp(28px, 4.5vw, 44px) !important; margin: 0 !important; }
.coll-banner .bn-sub { color: rgba(255,255,255,.82); margin: 6px 0 0; font-size: 15px; }

/* ============================================================
   Member accounts — nav control, auth modal, playlists, library
   ============================================================ */
.acct { margin-inline-start: 8px; position: relative; flex: none; }
.acct-signin { padding: 9px 18px; font-size: 14px; }
.acct-btn { background: none; border: none; padding: 0; }
.acct-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: 16px; color: #fff;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 16px -6px var(--glow);
}
.acct-menu {
  position: absolute; inset-block-start: 48px; inset-inline-end: 0; min-width: 210px; z-index: 60;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px;
  padding: 8px; box-shadow: var(--shadow-lg);
}
.acct-menu .acct-email { font-size: 12px; color: var(--faint); padding: 6px 10px 10px; border-bottom: 1px solid var(--border-soft); margin-bottom: 6px; word-break: break-all; direction: ltr; text-align: start; }
.acct-menu a, .acct-menu button { display: block; width: 100%; text-align: start; background: none; border: none; color: var(--text); font: inherit; font-size: 14px; font-weight: 600; padding: 10px 10px; border-radius: 9px; }
.acct-menu a:hover, .acct-menu button:hover { background: var(--surface-3); }
.acct-menu #acct-logout { color: oklch(0.72 0.16 25); margin-top: 4px; }
.acct-menu .acct-owner { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border-soft); }
.acct-menu .acct-owner-head { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-bright); padding: 4px 10px 2px; }
.acct-menu .acct-owner a { color: var(--accent-bright); }
.acct-menu .acct-owner a:hover { background: var(--surface-3); color: var(--text); }

/* auth modal */
.auth-overlay { position: fixed; inset: 0; z-index: 300; background: oklch(0.1 0.02 285 / 0.7); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px; }
.auth-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 28px; position: relative; box-shadow: var(--shadow-lg); }
.auth-card h2 { font-size: 24px; margin: 0 0 4px; }
.auth-sub { color: var(--muted); font-size: 13.5px; margin: 0 0 20px; }
.auth-close { position: absolute; inset-block-start: 14px; inset-inline-end: 16px; background: none; border: none; color: var(--faint); font-size: 26px; line-height: 1; }
.auth-close:hover { color: var(--text); }
.btn-google2 { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); border-radius: 99px; padding: 12px; font-weight: 700; }
.btn-google2:hover { background: var(--surface-3); }
.or-sep2 { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 12px; margin: 16px 0; }
.or-sep2::before, .or-sep2::after { content: ""; flex: 1; height: 1px; background: var(--border-soft); }
.auth-card form { display: flex; flex-direction: column; gap: 10px; }
.auth-card input { background: var(--bg-2); border: 1px solid var(--border-soft); color: var(--text); border-radius: 10px; padding: 12px 13px; font-family: inherit; font-size: 14px; }
.auth-card input:focus { outline: none; border-color: var(--accent); }
.auth-toggle { text-align: center; color: var(--muted); font-size: 13.5px; margin: 16px 0 0; }
.auth-toggle button { background: none; border: none; color: var(--accent-bright); font: inherit; font-weight: 700; }
.auth-err { color: oklch(0.72 0.18 25); font-size: 13px; margin-top: 10px; min-height: 18px; text-align: center; }

/* add-to-playlist picker (song page) */
.add-pl-btn { white-space: nowrap; }
.pl-pop { position: absolute; z-index: 300; min-width: 220px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 8px; box-shadow: var(--shadow-lg); }
.pl-pop-head { font-size: 12px; color: var(--faint); padding: 4px 10px 8px; }
.pl-pop-item { display: block; width: 100%; text-align: start; background: none; border: none; color: var(--text); font: inherit; font-size: 14px; font-weight: 600; padding: 9px 10px; border-radius: 9px; }
.pl-pop-item:hover { background: var(--surface-3); }
.pl-pop-empty { color: var(--faint); font-size: 13px; padding: 6px 10px; }
.pl-pop-new { display: flex; gap: 6px; margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--border-soft); }
.pl-pop-new input { flex: 1; background: var(--bg-2); border: 1px solid var(--border-soft); color: var(--text); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 13.5px; }
.pl-pop-new button { width: 38px; background: var(--accent); border: none; color: #fff; border-radius: 8px; font-size: 18px; font-weight: 700; }

/* library page */
.lib-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 26px; }
.lib-tab { background: var(--surface); border: 1px solid var(--border-soft); color: var(--muted); border-radius: 99px; padding: 9px 20px; font-weight: 700; font-size: 14.5px; }
.lib-tab.active { background: var(--surface-2); color: var(--text); border-color: var(--accent); }
.pl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.pl-card { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--r-lg); padding: 18px; }
.pl-card h3 { margin: 0 0 4px; font-size: 18px; font-weight: 800; }
.pl-card .pl-count { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
.pl-card .pl-actions { display: flex; gap: 8px; }
.pl-card .pl-actions button { background: var(--surface-2); border: 1px solid var(--border-soft); color: var(--text); border-radius: 8px; padding: 7px 12px; font: inherit; font-size: 13px; font-weight: 600; }
.pl-card .pl-actions .del { color: oklch(0.72 0.16 25); }
.lib-signin { text-align: center; padding: 60px 20px; color: var(--muted); }
.lib-signin .big { font-size: 44px; margin-bottom: 12px; }

/* ---------- chord fingering diagrams popover (issue #14) ---------- */
.cd-pop {
  position: absolute; z-index: 400; width: 224px;
  background: var(--surface-3); border: 1px solid var(--accent);
  border-radius: 14px; padding: 12px; box-shadow: var(--shadow-lg);
  animation: cdPop .12s ease-out;
}
@keyframes cdPop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.cd-pop .cd-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.cd-pop .cd-title { font-family: var(--mono); font-weight: 700; font-size: 18px; color: var(--accent-bright); }
.cd-pop .cd-tabs { display: flex; gap: 0; background: var(--bg-2); border: 1px solid var(--border-soft); border-radius: 99px; padding: 2px; }
.cd-pop .cd-tabs button {
  border: none; background: transparent; color: var(--muted);
  font-family: inherit; font-size: 11.5px; font-weight: 700;
  padding: 4px 10px; border-radius: 99px; cursor: pointer; transition: background .12s, color .12s;
}
.cd-pop .cd-tabs button.on { background: var(--accent); color: #fff; }
.cd-pop .cd-tabs button:not(.on):hover { color: var(--text); }
.cd-pop .cd-body { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.cd-pop .cd-notes { font-family: var(--mono); font-size: 13px; color: var(--text); letter-spacing: .03em; text-align: center; }
.cd-pop .cd-fallback { font-size: 13px; color: var(--muted); text-align: center; }

/* guitar diagram svg */
.cd-guitar { width: 150px; height: 180px; color: var(--text); }
.cd-guitar .cd-grid { stroke: var(--faint); stroke-width: 1; }
.cd-guitar .cd-dot { fill: var(--accent); }
.cd-guitar .cd-barre { fill: var(--accent); }
.cd-guitar .cd-finger { fill: #fff; font: 700 9px var(--mono); }
.cd-guitar .cd-open { fill: none; stroke: var(--text); stroke-width: 1.5; }
.cd-guitar .cd-mute { fill: var(--faint); font: 700 12px var(--mono); }
.cd-guitar .cd-fretno { fill: var(--muted); font: 700 10px var(--mono); }

/* piano diagram svg */
.cd-piano { width: 196px; height: 96px; }
.cd-piano .cd-wkey { fill: oklch(0.96 0.004 285); stroke: var(--surface); stroke-width: 1; }
.cd-piano .cd-wkey.on { fill: var(--accent-bright); }
.cd-piano .cd-wkey.on.root { fill: var(--accent); }
.cd-piano .cd-bkey { fill: oklch(0.2 0.02 288); stroke: var(--surface); stroke-width: 1; }
.cd-piano .cd-bkey.on { fill: var(--accent-bright); }
.cd-piano .cd-bkey.on.root { fill: var(--accent); }

@media (max-width: 560px) {
  .cd-pop { width: 208px; }
}

/* ============================================================
   analytics dashboard (analytics.html, owner-only)
   ============================================================ */
.an-head { padding-block: clamp(28px, 4vw, 46px) 6px; }
.an-head h1 { font-size: clamp(30px, 5vw, 48px); font-weight: 900; margin: 0; letter-spacing: -0.02em; }
.an-head .an-sub { color: var(--muted); margin: 6px 0 0; font-size: 15px; }
#an-root { padding-bottom: 64px; }
.an-loading { padding: 40px 0; }
.an-gate { text-align: center; padding: 56px 20px; }
.an-gate .big { font-size: 46px; margin-bottom: 10px; }
.an-gate p { margin: 4px 0; }
.an-empty { text-align: center; padding: 60px 20px; }
.an-empty .big { font-size: 48px; margin-bottom: 12px; }

.an-kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin: 22px 0; }
.an-kpi {
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--r);
  padding: 16px 14px; text-align: center;
}
.an-kpi-val { font-size: clamp(20px, 2.4vw, 30px); font-weight: 900; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.an-kpi-lbl { color: var(--muted); font-size: 12.5px; margin-top: 4px; }

.an-card {
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--r);
  padding: 18px 18px 20px; margin-bottom: 18px;
}
.an-card h2 { font-size: 16px; font-weight: 800; margin: 0 0 14px; }

.an-chart .an-bars {
  display: flex; align-items: flex-end; gap: 3px; height: 180px;
  padding-top: 6px; overflow-x: auto;
}
.an-bar-col { flex: 1 1 0; min-width: 12px; display: flex; flex-direction: column; align-items: center; height: 100%; }
.an-bar-track { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.an-bar-fill {
  width: 100%; min-height: 2px; border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, var(--accent-bright), var(--accent));
}
.an-bar-col:hover .an-bar-fill { background: linear-gradient(180deg, var(--accent-bright), var(--accent-2)); }
.an-bar-x { font-size: 9.5px; color: var(--faint); margin-top: 5px; font-variant-numeric: tabular-nums; white-space: nowrap; }

.an-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.an-rows { display: flex; flex-direction: column; gap: 9px; }
.an-row { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; align-items: center; gap: 10px; }
.an-row-name { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-row-name a { color: var(--text); }
.an-row-name a:hover { color: var(--accent-bright); }
.an-row-bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.an-row-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.an-row-val { font-size: 13px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 34px; text-align: start; }

.an-feed { display: flex; flex-direction: column; }
.an-feed-row {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px;
  padding: 9px 2px; border-bottom: 1px solid var(--border-soft); font-size: 13px;
}
.an-feed-row:last-child { border-bottom: none; }
.an-feed-what { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-feed-meta { color: var(--faint); font-size: 12px; }
.an-feed-time { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }

@media (max-width: 860px) {
  .an-kpis { grid-template-columns: repeat(3, 1fr); }
  .an-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .an-kpis { grid-template-columns: repeat(2, 1fr); }
  .an-feed-meta { display: none; }
}
