:root {
  --ink: #e8dcc4;
  --muted: #b7a78a;
  --gold: #c9a227;
  --gold-dim: #8a7018;
  --bg: #0c0a08;
  --panel: #14110c;
  --rule: rgba(201, 162, 39, 0.35);
  --paper: #f4ecd8;
  --staff-ink: #1a140c;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Noto Serif SC", "Songti SC", "STSong", serif;
  line-height: 1.85;
  letter-spacing: 0.03em;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 18% 0%, rgba(201,162,39,0.08), transparent 46%),
    radial-gradient(ellipse at 82% 100%, rgba(80,40,10,0.18), transparent 42%);
  z-index: 0;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: #e6c75a; }

.wrap {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

header.hero {
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
  overflow: hidden;
}

header.hero figure { position: absolute; inset: 0; }
header.hero img, header.hero svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
header.hero figure::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, #0c0a08 10%, rgba(12,10,8,0.55) 52%, rgba(12,10,8,0.2) 100%);
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px 64px;
  width: 100%;
}

.kicker {
  font-family: "Cormorant Garamond", serif;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--gold);
  font-size: 13px;
  margin-bottom: 18px;
}

h1 {
  font-size: clamp(34px, 6.4vw, 68px);
  font-weight: 700;
  line-height: 1.22;
  margin-bottom: 14px;
}

.subtitle {
  color: var(--muted);
  font-size: 18px;
  max-width: 42em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

button, .btn {
  font-family: inherit;
  cursor: pointer;
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold);
  padding: 10px 18px;
  letter-spacing: 0.12em;
  font-size: 13px;
  border-radius: 0;
}

button:hover, .btn:hover { background: rgba(201,162,39,0.12); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button.primary { background: var(--gold); color: #1a1408; }
button.primary:hover { background: #e6c75a; }

nav.toc {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 28px 0;
  margin: 40px 0 48px;
}

nav.toc h2 {
  font-size: 14px;
  letter-spacing: 0.32em;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 16px;
}

nav.toc ol { list-style: none; }
nav.toc li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px dotted rgba(201,162,39,0.18);
  font-size: 16px;
}
nav.toc span.dots {
  flex: 1;
  border-bottom: 1px dotted rgba(201,162,39,0.28);
  margin: 0 8px 8px;
}
nav.toc .meta { color: var(--muted); font-size: 13px; white-space: nowrap; }

.program {
  margin-bottom: 56px;
  color: var(--ink);
}
.program h2 {
  font-size: 22px;
  margin: 28px 0 12px;
  color: var(--gold);
  letter-spacing: 0.16em;
  font-weight: 600;
}
.program h2:first-child { margin-top: 0; }
.program p { margin-bottom: 1em; font-size: 17px; }
.program ul { margin: 0 0 1em 1.2em; color: var(--muted); }
.program li { margin-bottom: 0.45em; }

.orch {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px 28px;
  color: var(--muted);
  font-size: 15px;
  margin: 16px 0 28px;
}

.seat {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin: 12px 0 28px;
  font-size: 14px;
  color: var(--muted);
  font-family: "Cormorant Garamond", serif;
  letter-spacing: 0.08em;
  text-align: center;
  border: 1px solid var(--rule);
  padding: 18px 12px;
  background: var(--panel);
}
.seat .row { letter-spacing: 0.18em; }
.seat .podium { color: var(--gold); margin: 8px 0; }

.movement {
  margin-bottom: 88px;
  scroll-margin-top: 96px;
}

.canto-num {
  font-family: "Cormorant Garamond", serif;
  color: var(--gold);
  letter-spacing: 0.28em;
  font-size: 13px;
}

.movement h2 {
  font-size: 28px;
  font-weight: 700;
  margin: 8px 0 6px;
}

.epigraph {
  color: var(--muted);
  font-style: italic;
  margin-bottom: 8px;
  font-size: 15px;
}

.staff-meta {
  font-family: "Cormorant Garamond", serif;
  color: var(--gold-dim);
  letter-spacing: 0.16em;
  font-size: 13px;
  margin-bottom: 18px;
}

.note {
  font-size: 17px;
  margin-bottom: 18px;
}

.score-panel {
  background: var(--paper);
  color: var(--staff-ink);
  padding: 18px 8px 8px;
  margin: 12px 0 8px;
  overflow-x: auto;
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
}

.score-panel .abc-paper { min-width: 720px; }

.abcjs-cursor {
  stroke: #c9a227;
  stroke-width: 2;
}

.abcjs-highlight {
  fill: #c9a227;
  fill-opacity: 0.22;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 12px 0 6px;
}

.audio {
  margin: 8px 0 0;
  min-height: 52px;
}

.abcjs-inline-audio {
  background: var(--panel);
  padding: 8px;
  height: auto;
}

.abcjs-inline-audio .abcjs-btn { background: transparent; }
.abcjs-inline-audio .abcjs-btn svg {
  fill: var(--gold);
  stroke: var(--gold);
}

.abcjs-inline-audio .abcjs-midi-progress-background,
.abcjs-inline-audio .abcjs-midi-tempo-background {
  background: #2a2418;
}

.abcjs-inline-audio .abcjs-midi-progress-indicator {
  background: var(--gold);
}

.download-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

footer {
  border-top: 1px solid var(--rule);
  padding-top: 28px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.progress {
  position: fixed;
  top: 0; left: 0; height: 3px;
  background: var(--gold);
  width: 0;
  z-index: 9;
}

.sticky-player {
  position: sticky;
  top: 0;
  z-index: 8;
  background: rgba(12,10,8,0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
  padding: 10px 24px;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.sticky-player.on { display: flex; }
.sticky-player span { color: var(--muted); font-size: 13px; letter-spacing: 0.12em; }

.status {
  color: var(--gold);
  font-size: 13px;
  min-height: 1.4em;
}

.badge {
  display: inline-block;
  border: 1px solid var(--gold);
  color: var(--gold);
  letter-spacing: 0.2em;
  font-size: 11px;
  padding: 4px 10px;
  margin-bottom: 14px;
}

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

@media (max-width: 720px) {
  .orch { grid-template-columns: 1fr; }
  .movement h2 { font-size: 22px; }
  nav.toc li { font-size: 14px; flex-wrap: wrap; }
}

@media print {
  body { background: #fff; color: #111; }
  body::before, .progress, .sticky-player, header.hero, nav.toc,
  .hero-actions, .controls, .audio, .download-row, footer, .program {
    display: none !important;
  }
  .score-panel { box-shadow: none; background: #fff; }
  .movement { break-before: page; }
}
