:root {
  --jazz-black: #0B0C10;
  --jazz-gold: #C8A24A;
  --jazz-ivory: #F2E6C9;
  --jazz-teal: #0F6A6A;
  --jazz-green: #1F5E3B;
  --jazz-burgundy: #6A1E2C;
  --page-bg-top: #f7ecd1;
  --page-bg-bottom: #e7d6b3;
  --card-bg: rgba(255, 249, 238, 0.93);
  --card-border: rgba(200, 162, 74, 0.42);
  --muted-text: rgba(11, 12, 16, 0.72);
  --soft-text: rgba(11, 12, 16, 0.6);
  --panel-border: rgba(11, 12, 16, 0.12);
}

body {
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  margin: 0;
  padding: 2rem;
  background:
    radial-gradient(circle at top left, rgba(200, 162, 74, 0.28), transparent 28%),
    linear-gradient(180deg, var(--page-bg-top) 0%, var(--jazz-ivory) 45%, var(--page-bg-bottom) 100%);
  color: var(--jazz-black);
}

.wrap {
  max-width: 780px;
  margin: 0 auto 4rem;
}

.hero {
  margin-bottom: 2rem;
}

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
}

.intro {
  max-width: 44rem;
  margin: 1rem 0 0;
  color: var(--muted-text);
  font-size: 1.08rem;
  line-height: 1.6;
}

.intro-secondary {
  color: var(--soft-text);
  font-size: 1rem;
}

form {
  display: grid;
  gap: 1rem;
}

.generator-card {
  padding: 1.5rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 1rem;
  box-shadow: 0 20px 50px rgba(11, 12, 16, 0.09);
}

label {
  display: grid;
  gap: 0.45rem;
  font-weight: 600;
}

.field-help {
  color: var(--muted-text);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.5;
}

.instrument-picker {
  margin: 0;
  padding: 0;
  border: 0;
}

.instrument-picker legend {
  margin-bottom: 0.7rem;
  font-weight: 600;
}

.instrument-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.instrument-option {
  position: relative;
  display: block;
  cursor: pointer;
}

.instrument-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.instrument-option span {
  display: block;
  padding: 0.95rem 1rem;
  border: 1px solid var(--card-border);
  border-radius: 0.85rem;
  background: rgba(255, 251, 244, 0.96);
  text-align: center;
  font-weight: 700;
  transition: border-color 120ms ease, transform 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

.instrument-option input:checked + span {
  border-color: var(--jazz-teal);
  background: rgba(15, 106, 106, 0.12);
  box-shadow: 0 0 0 2px rgba(15, 106, 106, 0.12);
}

.instrument-option:hover span {
  transform: translateY(-1px);
}

input,
textarea,
button {
  font: inherit;
  padding: 0.75rem;
}

input,
textarea {
  border: 1px solid var(--card-border);
  border-radius: 0.75rem;
  background: rgba(255, 251, 244, 0.96);
}

input:focus,
textarea:focus {
  outline: 2px solid var(--jazz-gold);
  outline-offset: 2px;
}

.song-help {
  margin: -0.5rem 0 0;
  color: var(--soft-text);
  font-size: 0.95rem;
}

textarea {
  min-height: 140px;
}

.example-prompts-label {
  margin: -0.1rem 0 0;
  color: var(--muted-text);
  font-size: 0.95rem;
  font-weight: 700;
}

.example-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: -0.25rem;
}

.example-prompt {
  padding: 0.7rem 1rem;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  background: rgba(255, 248, 239, 0.98);
  color: var(--muted-text);
  font-size: 0.95rem;
  font-weight: 600;
}

.example-prompt:hover {
  border-color: var(--jazz-gold);
}

button {
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--jazz-burgundy), var(--jazz-teal));
  color: #fff9f0;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.04);
}

#status,
.usage-output,
.exercise-plan,
.lilypond-output {
  margin-top: 1rem;
}

#status {
  padding: 1rem;
  background: rgba(255, 249, 238, 0.9);
  border: 1px solid var(--card-border);
  border-radius: 0.75rem;
}

.downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--jazz-burgundy), var(--jazz-teal));
  color: #fff9f0;
  font-weight: 700;
  text-decoration: none;
}

.download-button:hover {
  filter: brightness(1.04);
}

.lilypond-output {
  overflow-x: auto;
  padding: 1rem;
  background: rgba(242, 230, 201, 0.82);
  border: 1px solid rgba(200, 162, 74, 0.35);
  border-radius: 0.5rem;
}

.exercise-plan {
  overflow-x: auto;
  padding: 1rem;
  background: rgba(31, 94, 59, 0.1);
  border: 1px solid rgba(31, 94, 59, 0.24);
  border-radius: 0.5rem;
}

.usage-output {
  overflow-x: auto;
  padding: 1rem;
  background: rgba(106, 30, 44, 0.08);
  border: 1px solid rgba(106, 30, 44, 0.2);
  border-radius: 0.5rem;
}

.acknowledgements {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--panel-border);
  color: var(--muted-text);
}

.acknowledgements h2 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}

.acknowledgements p {
  margin: 0;
  line-height: 1.6;
}

.acknowledgements a {
  color: var(--jazz-teal);
  font-weight: 600;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
}

.doc-page {
  padding-top: 2rem;
}

.doc-card h1 {
  margin-bottom: 1rem;
  font-size: clamp(2rem, 4vw, 3rem);
}

.doc-card h2,
.doc-card h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.doc-card p {
  line-height: 1.7;
}

.doc-back-link {
  font-weight: 700;
}

@media (max-width: 640px) {
  body {
    padding: 1.25rem;
  }

  .generator-card {
    padding: 1.1rem;
  }

  .instrument-options {
    grid-template-columns: 1fr;
  }
}
