:root {
  color-scheme: dark;
  --bg: #0c0b09;
  --panel: #17130f;
  --panel-2: #211a14;
  --ink: #f3ead7;
  --muted: #b9aa91;
  --line: #3b2d20;
  --acid: #d9ff43;
  --red: #e6482f;
  --cyan: #48d6c5;
  --paper: #e7d7b5;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 16% 0%, rgba(230, 72, 47, 0.22), transparent 28rem),
    radial-gradient(circle at 82% 18%, rgba(72, 214, 197, 0.16), transparent 30rem),
    linear-gradient(135deg, rgba(255, 255, 255, 0.035) 25%, transparent 25%) 0 0 / 18px 18px,
    var(--bg);
  color: var(--ink);
  font: 15px/1.45 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(rgba(255,255,255,.025) 50%, transparent 50%) 0 0 / 100% 4px;
  mix-blend-mode: overlay;
  opacity: .45;
}

h1,
h2,
p {
  margin: 0;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: start;
  padding: 34px clamp(18px, 4vw, 58px) 28px;
  border-bottom: 3px solid var(--acid);
  background:
    linear-gradient(90deg, rgba(12, 11, 9, .92), rgba(12, 11, 9, .68)),
    repeating-linear-gradient(-8deg, #24160f 0 12px, #130e0b 12px 24px);
}

.eyebrow {
  color: var(--acid);
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 13px;
}

h1 {
  margin-top: 4px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(48px, 10vw, 118px);
  line-height: .82;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--paper);
  text-shadow: 4px 4px 0 var(--red);
}

.dek {
  margin-top: 18px;
  max-width: 980px;
  color: var(--paper);
  font-size: clamp(16px, 2vw, 22px);
  line-height: 1.34;
}

.dek em {
  color: white;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.pdf-link,
.links a,
button {
  border: 1px solid var(--acid);
  color: var(--acid);
  background: #111;
  border-radius: 0;
  padding: 8px 10px;
  text-decoration: none;
  font-weight: 950;
  text-transform: uppercase;
  font-size: 12px;
  white-space: nowrap;
  box-shadow: 3px 3px 0 var(--red);
}

button {
  cursor: pointer;
  font: inherit;
}

main {
  width: min(1500px, calc(100% - 24px));
  margin: 18px auto 48px;
}

.score-note {
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-left: 8px solid var(--red);
  background: rgba(23, 19, 15, .92);
  box-shadow: var(--shadow);
}

.score-note h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
  text-transform: uppercase;
  color: var(--cyan);
}

.score-note p {
  margin-top: 6px;
  color: var(--muted);
  max-width: 1120px;
}

.search-panel {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(12, 11, 9, .94);
  backdrop-filter: blur(10px);
}

.search-row {
  display: grid;
  gap: 6px;
}

label {
  color: var(--cyan);
  font-weight: 950;
  font-size: 12px;
  text-transform: uppercase;
}

input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 0 12px;
  color: var(--ink);
  background: #090807;
  font: inherit;
}

input:focus {
  outline: 3px solid rgba(217, 255, 67, .22);
  border-color: var(--acid);
}

.summary {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--paper);
  font-weight: 950;
}

.results {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: rgba(12, 11, 9, .84);
}

.tune-card {
  display: grid;
  grid-template-columns: 86px minmax(170px, 300px) minmax(260px, 1fr) 150px auto;
  gap: 12px;
  align-items: center;
  min-height: 42px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(23, 19, 15, .72);
}

.tune-card:nth-child(even) {
  background: rgba(33, 26, 20, .72);
}

.tune-card:hover {
  background: rgba(217, 255, 67, .08);
}

.number {
  color: var(--red);
  font-weight: 950;
  font-size: 12px;
  text-transform: uppercase;
  white-space: nowrap;
}

.tune-card h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.05;
  letter-spacing: 0;
  color: var(--paper);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notes {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 800;
  white-space: nowrap;
}

.blurb {
  color: var(--paper);
  font-size: 12px;
  line-height: 1.2;
  opacity: .84;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.links {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  align-items: center;
}

.links a,
.links button {
  padding: 5px 7px;
  font-size: 11px;
  box-shadow: 2px 2px 0 var(--red);
}

.player-dock {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 20;
  width: min(420px, calc(100vw - 32px));
  border: 1px solid var(--acid);
  background: #050505;
  box-shadow: 8px 8px 0 rgba(230, 72, 47, .88), var(--shadow);
}

.player-dock[hidden] {
  display: none;
}

.player-dock-bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 8px;
  border-bottom: 1px solid var(--line);
  background: #111;
}

.player-dock-bar span {
  display: block;
  color: var(--red);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.player-dock-bar strong {
  display: block;
  max-width: 270px;
  color: var(--paper);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-dock-bar button {
  box-shadow: none;
  padding: 5px 7px;
}

.player-dock iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  background: #000;
}

.empty {
  grid-column: 1 / -1;
  padding: 28px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
}

.text-hero h1 {
  font-size: clamp(44px, 8vw, 96px);
}

.text-layout {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.toc {
  position: sticky;
  top: 14px;
  max-height: calc(100vh - 28px);
  overflow: auto;
  border: 1px solid var(--line);
  background: rgba(12, 11, 9, .95);
  box-shadow: var(--shadow);
  padding: 12px;
}

.toc h2 {
  color: var(--acid);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.toc details {
  border-top: 1px solid var(--line);
  padding: 8px 0;
}

.toc summary {
  cursor: pointer;
  color: var(--cyan);
  font-weight: 950;
  text-transform: uppercase;
}

.toc ol {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 3px;
}

.toc a {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  line-height: 1.2;
  padding: 4px;
}

.toc a:hover,
.toc a:focus {
  color: var(--acid);
  background: #14110e;
}

.toc a span {
  color: var(--red);
  font-weight: 950;
}

.text-sections {
  display: grid;
  gap: 12px;
}

.text-entry {
  scroll-margin-top: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(23, 19, 15, .96), rgba(33, 26, 20, .96));
  box-shadow: var(--shadow);
}

.text-entry header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  border-bottom: 1px solid var(--line);
  padding: 12px;
}

.text-entry header p {
  color: var(--red);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.text-entry header h2 {
  margin-top: 4px;
}

.text-entry header a {
  color: var(--acid);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 950;
}

.text-entry pre {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 14px;
  color: var(--paper);
  font: 14px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (max-width: 760px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-links {
    justify-content: flex-start;
  }

  .search-panel {
    grid-template-columns: 1fr;
  }

  .tune-card {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 8px;
  }

  .tune-card .notes,
  .tune-card .blurb {
    display: none;
  }

  .tune-card .links {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .summary {
    justify-content: space-between;
  }

  .results {
    grid-template-columns: 1fr;
  }

  .text-layout {
    grid-template-columns: 1fr;
  }

  .toc {
    position: relative;
    top: 0;
    max-height: 48vh;
  }

  .links {
    flex-direction: row;
    align-items: flex-start;
    flex-wrap: wrap;
  }
}

@media (max-width: 460px) {
  main {
    width: calc(100% - 14px);
  }

  .tune-card {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .tune-card h2 {
    font-size: 17px;
  }

  .player-dock {
    right: 8px;
    bottom: 8px;
    width: calc(100vw - 16px);
  }
}

/* ---------------------------------------------------------------- bookmarks
   Saved tunes (see /account/user.js): a star on every card, plus a filter and
   the sign-in chip in the summary row. */
.mark-btn.is-marked {
  background: var(--acid);
  color: #111;
}

.marks-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  cursor: pointer;
  color: var(--paper);
}

.marks-toggle input {
  accent-color: var(--acid);
  width: 14px;
  height: 14px;
  cursor: pointer;
}

.su-chip {
  border: 1px solid var(--cyan);
  color: var(--cyan);
  background: #111;
  border-radius: 0;
  padding: 5px 8px;
  font-weight: 950;
  text-transform: uppercase;
  font-size: 11px;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--red);
}
