:root {
  --bg: #FAF8F5;
  --surface: #FFFFFF;
  --surface-alt: #F3EFE8;
  --text: #1C1B18;
  --muted: #5E5950;
  --accent: #7A2E3A;
  --accent-hover: #5E212B;
  --gold: #B08D57;
  --gold-text: #806039;
  --border: #E5DFD5;
  --shadow: 0 8px 28px rgba(28, 27, 24, 0.06);
  --radius: 12px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background-color: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
.serif {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 600;
  line-height: 1.18;
  margin: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.18s ease;
}

a:hover {
  color: var(--accent-hover);
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--surface);
  color: var(--accent);
  border-radius: 6px;
  transform: translateY(calc(-100% - 1rem));
}

.skip-link:focus {
  transform: translateY(0);
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

main[id] {
  scroll-margin-top: 10rem;
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(250, 248, 245, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  max-width: 1080px;
  margin: 0 auto;
}

.brand {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.brand-sub {
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--muted);
}

.nav-links a:hover {
  color: var(--text);
  background: var(--surface-alt);
}

.nav-links a.active {
  color: #FFFFFF;
  background: var(--accent);
}

/* Hero Section */
.hero {
  padding: 3.5rem 0 3rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 295px 1fr;
  gap: 3rem;
  align-items: stretch;
}

.hero-copy {
  grid-column: 2;
  grid-row: 1;
}

.cover-frame {
  grid-column: 1;
  grid-row: 1;
  position: relative;
  min-height: 0;
  background: var(--surface);
  padding: 0.65rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.cover-frame picture {
  display: block;
}

.cover-frame img {
  position: absolute;
  inset: 0.65rem;
  display: block;
  width: calc(100% - 1.3rem);
  height: calc(100% - 1.3rem);
  object-fit: cover;
  border-radius: 6px;
}

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold-text);
  margin-bottom: 0.6rem;
}

.hero h1 {
  font-size: clamp(2.2rem, 4vw, 3.1rem);
  margin-bottom: 0.75rem;
}

.hero-lead {
  font-size: 1.08rem;
  color: var(--muted);
  margin: 0 0 1.25rem;
}

.hero p {
  margin: 0 0 1rem;
}

.hero .hero-detail {
  margin: 1.5rem 0 0;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  gap: 0.45rem;
  padding: 0.7rem 1.3rem;
  border-radius: 8px;
  font-size: 0.94rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.18s ease;
}

.btn-primary {
  background: var(--accent);
  color: #FFFFFF;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #FFFFFF;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--surface-alt);
  color: var(--text);
}

.btn-sm {
  padding: 0.42rem 0.85rem;
  font-size: 0.84rem;
  border-radius: 6px;
}

/* Feature Cards */
.section {
  padding-top: 2.5rem;
  padding-bottom: 3.5rem;
}

.section-header {
  margin-bottom: 1.75rem;
}

.section-header h2 {
  font-size: 2rem;
  margin-bottom: 0.35rem;
}

.section-header p {
  color: var(--muted);
  margin: 0;
}

.cards-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 2px 10px rgba(28, 27, 24, 0.03);
}

.card h3 {
  font-size: 1.35rem;
  margin-bottom: 0.5rem;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Audio & Scores Catalog */
.controls-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.pill {
  min-height: 44px;
  min-width: 44px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pill:hover {
  background: var(--surface-alt);
  color: var(--text);
}

.pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
}

.search-input {
  min-height: 44px;
  padding: 0.48rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  background: var(--surface);
  color: var(--text);
  min-width: 220px;
}

.filter-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
}

.filter-summary p {
  margin: 0;
}

.empty-results {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.empty-results p {
  margin-bottom: 0;
}

.track-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.track-card {
  display: grid;
  grid-template-columns: 95px 1.2fr 1fr auto;
  align-items: center;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.95rem 1.25rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.track-card:hover {
  border-color: var(--gold);
  box-shadow: 0 4px 16px rgba(28, 27, 24, 0.05);
}

.track-card.playing {
  border-color: var(--accent);
  background: #FFFDFB;
}

.track-num {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}

.track-title {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: inherit;
  color: var(--text);
}

.track-name {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.2rem;
  font-style: italic;
  color: var(--muted);
}

.track-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.volume-divider {
  margin: 2.25rem 0 1rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.volume-divider h2 {
  font-size: 1.6rem;
}

.volume-divider span {
  font-size: 0.88rem;
  color: var(--muted);
}

.usage-notice {
  margin: 2rem 0 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.usage-notice a {
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

/* Other Works */
.other-works-intro {
  margin-bottom: 2rem;
}

.other-works-intro h1 {
  font-size: clamp(2.5rem, 4vw, 3.2rem);
}

.other-works-intro p {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.song-stack {
  display: grid;
  gap: 1.25rem;
}

.song-card {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 165px;
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(28, 27, 24, 0.025);
}

.song-card h2 {
  font-size: 2rem;
}

.song-card .btn {
  font-family: inherit;
}

.other-works-page:has(.player-bar.visible) {
  padding-bottom: 100px;
}

/* Sticky Bottom Audio Bar */
.player-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #1C1B18;
  color: #FAF8F5;
  border-top: 1px solid #35322C;
  padding: 0.75rem 1.5rem;
  z-index: 50;
  display: none;
  max-height: 100vh;
  max-height: 100dvh;
  overflow-y: auto;
}

.player-bar.visible {
  display: block;
}

.player-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1.4fr;
  align-items: center;
  gap: 1.25rem;
}

.player-meta {
  min-width: 0;
}

.player-title {
  font-weight: 600;
  font-size: 0.94rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-sub {
  font-size: 0.8rem;
  color: #C5BEB2;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.player-btn {
  min-height: 44px;
  min-width: 44px;
  background: #2F2D28;
  color: #FAF8F5;
  border: 1px solid #47433B;
  border-radius: 6px;
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.player-btn:hover:not(:disabled) {
  background: var(--accent);
  border-color: var(--accent);
}

.player-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.player-audio {
  width: 100%;
  height: 36px;
}

.player-error {
  grid-column: 1 / -1;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-alt);
  color: var(--text);
}

.player-error p {
  margin: 0 0 0.5rem;
}

.player-error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* PDF Modal */
.modal-dialog::backdrop {
  background: rgba(28, 27, 24, 0.72);
}

body.modal-open {
  overflow: hidden;
}

.modal-dialog {
  background: var(--surface);
  color: var(--text);
  border: 0;
  border-radius: var(--radius);
  padding: 0;
  width: calc(100% - 3rem);
  max-width: 920px;
  height: 86vh;
  max-height: calc(100% - 3rem);
  max-height: calc(100dvh - 3rem);
  margin: auto;
  display: none;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.modal-dialog[open] {
  display: flex;
}

.modal-focus-guard {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-shrink: 0;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.modal-header .btn {
  flex-shrink: 0;
}

.modal-title {
  min-width: 0;
  overflow-wrap: anywhere;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 600;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  flex-shrink: 0;
  padding: 0.65rem 1.25rem;
}

.modal-body {
  flex: 1;
  min-height: 0;
  background: #EAE6DF;
}

.modal-body iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* About Layout */
.about-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

.prose p {
  margin: 0 0 1.15rem;
  font-size: 1.02rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0 4.5rem;
  margin-top: 2rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.footer-links {
  display: flex;
  gap: 1.25rem;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  color: var(--muted);
}

.footer-links a:hover {
  color: var(--accent);
}

/* Responsive */
@media (max-width: 820px) {

  .header-inner {
    gap: 0.5rem;
    padding: 0.65rem 1rem;
  }

  .brand-title {
    font-size: 1.5rem;
  }

  .brand-sub {
    font-size: 0.7rem;
  }

  .nav-links {
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .nav-links a {
    font-size: 0.85rem;
    padding: 0.4rem 0.65rem;
  }

  .hero {
    padding-top: 1.5rem;
  }

  .hero-grid,
  .cards-3,
  .about-grid {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    gap: 1.5rem;
  }

  .hero-copy,
  .cover-frame {
    grid-column: auto;
    grid-row: auto;
  }

  .cover-frame {
    position: static;
    max-width: 200px;
  }

  .cover-frame img {
    position: static;
    width: 100%;
    height: auto;
  }

  .search-input {
    width: 100%;
    min-width: 0;
  }

  .track-card {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .track-actions {
    justify-content: flex-start;
    margin-top: 0.35rem;
  }

  .volume-divider {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .player-inner {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .song-card {
    padding: 1.5rem;
    min-height: 0;
    gap: 1.25rem;
  }

  .song-card h2 {
    font-size: 1.8rem;
  }

  .song-card .track-actions {
    width: 100%;
    margin-top: 0;
  }

  .other-works-page:has(.player-bar.visible) {
    padding-bottom: 175px;
  }

  .modal-dialog {
    width: calc(100% - 1rem);
    max-height: calc(100% - 1rem);
    max-height: calc(100dvh - 1rem);
    height: 94vh;
    height: 94dvh;
  }

  .modal-header {
    padding: 0.75rem;
    gap: 0.5rem;
  }

  .modal-actions {
    padding: 0.5rem 0.75rem;
  }
}

@media (max-width: 520px) {
  .header-inner nav {
    width: 100%;
  }

  .nav-links {
    gap: 0.15rem;
  }

  .nav-links a {
    padding: 0.4rem 0.5rem;
    font-size: 0.8rem;
  }

  .song-card {
    padding: 1.35rem;
  }

  .song-card .btn {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .footer-links {
    column-gap: 1rem;
  }
}

@media (max-width: 360px) {
  .header-inner {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .nav-links {
    gap: 0.1rem;
  }

  .nav-links a {
    padding-left: 0.2rem;
    padding-right: 0.2rem;
  }
}

.player-audio {
  color-scheme: dark;
}

.footer-links {
  flex-wrap: wrap;
  row-gap: 0.5rem;
}

html { scrollbar-gutter: stable; }