:root {
  --forest-950: #10261f;
  --forest-900: #173b32;
  --forest-800: #205044;
  --forest-700: #2d6657;
  --forest-100: #dfeae5;
  --gold: #d4aa63;
  --gold-soft: #f0e2c7;
  --cream: #f4f0e7;
  --paper: #fffdf9;
  --ink: #1b2924;
  --muted: #69766f;
  --line: rgba(23,59,50,.13);
  --shadow: 0 18px 50px rgba(19,46,38,.10);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 90% 3%, rgba(212,170,99,.16), transparent 27rem),
    var(--cream);
  color: var(--ink);
  font-family: "DM Sans", system-ui, sans-serif;
  line-height: 1.65;
}
a, button { -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; }
.page-shell { width: min(100% - 28px, 1120px); margin-inline: auto; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.document-hero {
  position: relative;
  min-height: 470px;
  overflow: hidden;
  display: flex;
  align-items: end;
  color: white;
  background: linear-gradient(135deg, var(--forest-950), var(--forest-800));
}
.document-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 82% 12%, rgba(212,170,99,.3), transparent 25rem);
  pointer-events: none;
}
.music-lines {
  position: absolute;
  inset: -30px -25px auto auto;
  width: min(78vw, 880px);
  height: 330px;
  opacity: .08;
  transform: rotate(-5deg);
  pointer-events: none;
}
.music-lines::before,
.music-lines::after {
  content: "";
  position: absolute;
  inset: 80px 0 auto;
  height: 66px;
  border-top: 2px solid white;
  border-bottom: 2px solid white;
  box-shadow: 0 16px 0 white, 0 32px 0 white, 0 48px 0 white;
  border-radius: 50%;
}
.music-lines span {
  position: absolute;
  z-index: 1;
  font-family: Georgia, serif;
  font-size: clamp(3rem, 9vw, 7rem);
}
.music-lines span:nth-child(1) { left: 8%; top: 38px; }
.music-lines span:nth-child(2) { left: 28%; top: 110px; }
.music-lines span:nth-child(3) { left: 48%; top: 48px; }
.music-lines span:nth-child(4) { left: 68%; top: 118px; }
.music-lines span:nth-child(5) { left: 88%; top: 52px; }

.document-hero__content { position: relative; z-index: 1; padding: 55px 0 58px; }
.back-link {
  display: inline-flex;
  margin-bottom: 44px;
  color: rgba(255,255,255,.7);
  font-size: .82rem;
  font-weight: 700;
  text-decoration: none;
}
.back-link:hover { color: white; }
.eyebrow {
  display: inline-block;
  margin-bottom: 11px;
  color: #ebcd95;
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .17em;
  text-transform: uppercase;
}
.eyebrow--dark { color: var(--forest-800); }

h1, h2, h3, h4, p { margin-top: 0; }
h1, h2 { font-family: "DM Serif Display", Georgia, serif; font-weight: 400; }
h1 {
  max-width: 820px;
  margin-bottom: 26px;
  font-size: clamp(3.2rem, 10vw, 6.3rem);
  line-height: .9;
  letter-spacing: -.035em;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.primary-action,
.secondary-action {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 10px 15px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 700;
  text-decoration: none;
}
.primary-action { background: var(--gold); color: var(--forest-950); }
.secondary-action {
  border: 1px solid rgba(255,255,255,.17);
  background: rgba(255,255,255,.08);
  color: white;
}

.main-layout { padding: 44px 0 72px; }
.catalog-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin-bottom: 22px;
}
.catalog-heading h2 {
  margin: 0;
  font-size: clamp(2.3rem, 7vw, 3.6rem);
  line-height: 1;
}
.result-count {
  flex: 0 0 auto;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,253,249,.78);
  color: var(--muted);
  font-size: .77rem;
  font-weight: 700;
}

.reading-tools {
  position: sticky;
  z-index: 20;
  top: 10px;
  display: grid;
  gap: 9px;
  margin-bottom: 15px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(244,240,231,.92);
  box-shadow: 0 12px 35px rgba(19,46,38,.08);
  backdrop-filter: blur(12px);
}
.search-box { position: relative; display: block; }
.search-box input {
  width: 100%;
  min-height: 48px;
  padding: 10px 45px 10px 43px;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  background: white;
  color: var(--ink);
}
.search-box input:focus {
  border-color: var(--forest-800);
  box-shadow: 0 0 0 3px rgba(32,80,68,.1);
}
.search-box__icon {
  position: absolute;
  z-index: 1;
  left: 15px;
  top: 50%;
  color: var(--muted);
  font-size: 1.35rem;
  transform: translateY(-54%);
}
#clear-search {
  position: absolute;
  right: 8px;
  top: 50%;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--forest-100);
  color: var(--forest-800);
  cursor: pointer;
  transform: translateY(-50%);
}

.filter-row {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 1px;
  scrollbar-width: thin;
}
.filter-chip {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--forest-800);
  font-size: .75rem;
  font-weight: 700;
  cursor: pointer;
}
.filter-chip span { opacity: .65; }
.filter-chip.is-active {
  border-color: var(--forest-900);
  background: var(--forest-900);
  color: white;
}

.classification-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 24px;
  color: var(--muted);
  font-size: .72rem;
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border-radius: 999px;
}
.legend-item strong {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  font-size: .68rem;
}
.legend-item--a { background: rgba(72,128,99,.09); }
.legend-item--a strong { background: #dcebe2; color: #285842; }
.legend-item--b { background: rgba(190,145,65,.12); }
.legend-item--b strong { background: var(--gold-soft); color: #745820; }

.song-list { display: grid; gap: 13px; }
.song-card {
  overflow: hidden;
  scroll-margin-top: 150px;
  border: 1px solid var(--line);
  border-radius: 21px;
  background: rgba(255,253,249,.94);
  box-shadow: 0 12px 35px rgba(19,46,38,.07);
}
.song-card[open] { border-color: rgba(32,80,68,.36); }
.song-card > summary {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 13px;
  align-items: center;
  min-height: 88px;
  padding: 15px;
  list-style: none;
  cursor: pointer;
}
.song-card > summary::-webkit-details-marker { display: none; }
.song-number {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 15px;
  background: var(--forest-900);
  color: white;
  font-size: .86rem;
  font-weight: 700;
  letter-spacing: .04em;
}
.song-summary { min-width: 0; }
.song-summary strong {
  display: block;
  margin-bottom: 5px;
  font-size: 1rem;
  overflow-wrap: anywhere;
}
.classification {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .045em;
  line-height: 1.25;
  text-transform: uppercase;
}
.classification--a { background: #dcebe2; color: #285842; }
.classification--b { background: var(--gold-soft); color: #745820; }
.card-arrow {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: var(--forest-100);
  color: var(--forest-800);
  transition: transform .18s ease;
}
.song-card[open] .card-arrow { transform: rotate(180deg); }

.song-content { padding: 0 18px 22px 81px; }
.song-content::before {
  content: "";
  display: block;
  height: 1px;
  margin-bottom: 19px;
  background: var(--line);
}
.song-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.youtube-action {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  border-radius: 999px;
  background: #e93232;
  color: white;
  font-size: .78rem;
  font-weight: 700;
  text-decoration: none;
}
.youtube-action span {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  font-size: .62rem;
}

.analysis-title {
  margin-bottom: 11px;
  color: var(--forest-800);
  font-size: .73rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.quick-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 9px;
  margin: 0;
}
.quick-item {
  min-width: 0;
  padding: 14px;
  border-radius: 15px;
  background: var(--forest-100);
}
.quick-item dt {
  margin-bottom: 5px;
  color: var(--forest-800);
  font-size: .67rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.quick-item dd {
  margin: 0;
  color: #34423c;
  font-size: .83rem;
  line-height: 1.58;
}
.quick-item--attention {
  background: rgba(212,170,99,.16);
}
.quick-item--opinion {
  background: rgba(72,128,99,.11);
}

.extended-analysis {
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
}
.extended-analysis > summary {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 11px 14px;
  list-style: none;
  color: var(--forest-800);
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
}
.extended-analysis > summary::-webkit-details-marker { display: none; }
.extended-analysis > summary span:last-child { transition: transform .18s ease; }
.extended-analysis[open] > summary span:last-child { transform: rotate(180deg); }

.extended-body {
  padding: 0 16px 18px;
  color: #34423c;
  font-size: .9rem;
}
.extended-body::before {
  content: "";
  display: block;
  height: 1px;
  margin-bottom: 16px;
  background: var(--line);
}
.analysis-section + .analysis-section { margin-top: 26px; }
.analysis-section h4 {
  margin: 0 0 10px;
  color: var(--forest-900);
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.analysis-section p { margin-bottom: 12px; }
.analysis-section p:last-child { margin-bottom: 0; }
.analysis-section--warning {
  padding: 15px;
  border-left: 3px solid var(--gold);
  border-radius: 0 13px 13px 0;
  background: rgba(212,170,99,.10);
}
.practical-note {
  margin-top: 20px;
  padding: 14px;
  border-radius: 13px;
  background: var(--forest-100);
}
.practical-note strong {
  display: block;
  margin-bottom: 4px;
  color: var(--forest-800);
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.practical-note p { margin: 0; }

.no-results {
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 60px 20px;
  color: var(--muted);
  text-align: center;
}
.no-results > span { font-size: 2rem; }
.no-results p { margin: 0; }

.document-footer {
  padding: 29px 0;
  background: var(--forest-950);
  color: rgba(255,255,255,.62);
}
.document-footer__content {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: .78rem;
}
.document-footer strong,
.document-footer span { display: block; }
.document-footer strong { color: white; }
.footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}
.footer-actions a {
  color: rgba(255,255,255,.7);
  text-decoration: none;
}

@media (max-width: 700px) {
  .page-shell { width: min(100% - 20px,1120px); }
  .document-hero { min-height: 440px; }
  .document-hero__content { padding: 42px 0 46px; }
  .back-link { margin-bottom: 52px; }
  .hero-actions { display: grid; }
  .primary-action,
  .secondary-action { width: 100%; }
  .catalog-heading { align-items: start; }
  .quick-grid { grid-template-columns: 1fr; }
  .song-card > summary { grid-template-columns: auto 1fr auto; padding: 12px; }
  .song-number { width: 48px; height: 48px; }
  .song-content { padding: 0 13px 18px; }
  .classification {
    max-width: 100%;
    white-space: normal;
  }
  .document-footer__content { display: grid; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
