:root {
  color-scheme: dark;
  --bg: #0b0d11;
  --panel: #12161d;
  --panel-soft: #171c25;
  --line: rgba(255, 255, 255, 0.1);
  --muted: #9aa3b2;
  --text: #f5f7fb;
  --accent: #b7f36b;
  --accent-ink: #16200c;
  --max: 1120px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 78% -10%, rgba(183, 243, 107, 0.13), transparent 32rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

.page-shell {
  width: min(calc(100% - 40px), var(--max));
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar,
footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 24px 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.wordmark {
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.16em;
  white-space: nowrap;
}

.wordmark:hover {
  color: var(--accent);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.site-nav a {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 7px 11px;
  color: var(--text);
  text-decoration: none;
  transition: border-color 160ms ease, background 160ms ease;
}

.site-nav a:hover,
.site-nav a.active {
  border-color: rgba(183, 243, 107, 0.5);
  background: rgba(183, 243, 107, 0.1);
}

.status {
  text-align: right;
}

main {
  flex: 1;
}

.hero {
  padding: 88px 0 64px;
  max-width: 1040px;
}

.eyebrow {
  margin: 0 0 20px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

h1 {
  margin: 0;
  font-size: clamp(42px, 6vw, 78px);
  line-height: 0.98;
  letter-spacing: -0.055em;
  font-weight: 700;
}

.title-with {
  color: var(--text);
}

h1 em {
  color: var(--accent);
  font-style: normal;
}

.lede {
  max-width: 520px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
}

.demo-note {
  max-width: 600px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.demo-root {
  padding-bottom: 80px;
}

.sample-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 4px 0 18px;
}

.sample-tab {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.sample-tab span {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.sample-tab strong {
  color: inherit;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sample-tab small {
  margin-left: auto;
  color: var(--muted);
  font-size: 10px;
}

.sample-tab:hover,
.sample-tab.active {
  border-color: rgba(183, 243, 107, 0.62);
  background: rgba(183, 243, 107, 0.12);
  color: var(--text);
}

.sample-shell {
  display: grid;
  grid-template-columns: minmax(240px, 0.72fr) minmax(0, 1.28fr);
  gap: 18px;
}

.prompt-card,
.song-card {
  background: linear-gradient(145deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.18);
}

.prompt-card {
  padding: 28px;
  align-self: start;
  position: sticky;
  top: 20px;
}

.label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.prompt-card h2 {
  margin: 14px 0 10px;
  font-size: 32px;
  letter-spacing: -0.04em;
}

.prompt {
  margin: 0;
  color: var(--accent);
  line-height: 1.5;
  max-height: 220px;
  overflow: auto;
}

details {
  margin-top: 28px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 650;
}

.lyrics {
  max-height: 460px;
  overflow: auto;
  margin: 16px 0 0;
  color: #cbd2dd;
  white-space: pre-wrap;
  font: 13px/1.75 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.song-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.song-card {
  padding: 20px;
}

.song-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.song-meta h3 {
  flex: 0 0 auto;
  margin: 0;
  font-size: 17px;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.method-tag {
  max-width: 48%;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-align: right;
}

audio {
  width: 100%;
  height: 42px;
  accent-color: var(--accent);
}

.audio-caption {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.loading,
.error {
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--muted);
}

footer {
  border-top: 1px solid var(--line);
  line-height: 1.5;
}

.code-hero {
  max-width: 820px;
}

.code-notice,
.code-card,
.code-panel {
  background: linear-gradient(145deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.18);
}

.code-notice {
  padding: 24px 28px;
  margin-bottom: 70px;
}

.code-notice p {
  max-width: 820px;
  margin: 12px 0 0;
  color: #cbd2dd;
  line-height: 1.65;
}

.code-notice a {
  color: var(--accent);
}

.code-notice a:hover {
  color: var(--text);
}

.code-section {
  padding-bottom: 70px;
}

.section-heading {
  margin-bottom: 22px;
}

.section-heading h2,
.code-panel h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: -0.045em;
}

.code-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.code-card {
  display: block;
  padding: 22px;
  color: var(--text);
  text-decoration: none;
  transition: border-color 160ms ease, transform 160ms ease;
}

.code-card:hover {
  border-color: rgba(183, 243, 107, 0.6);
  transform: translateY(-2px);
}

.code-card-kicker {
  color: var(--accent);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.16em;
}

.code-card h3 {
  margin: 15px 0 8px;
  font-size: 20px;
  letter-spacing: -0.03em;
}

.code-card code,
.folder-list code {
  color: #dfe7f2;
  font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.code-card p {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.code-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 18px;
}

.code-panel {
  padding: 28px;
}

.code-panel h2 {
  margin-bottom: 24px;
}

.command-block {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.command-block > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.command-block pre {
  overflow-x: auto;
  margin: 12px 0 0;
  padding: 14px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
  color: #dce7d2;
  font: 12px/1.65 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.folder-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.folder-list li {
  display: grid;
  gap: 5px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.folder-list span {
  color: var(--muted);
  font-size: 13px;
}

.code-footer-link {
  padding-bottom: 70px;
}

.back-link {
  color: var(--accent);
  font-weight: 650;
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

@media (max-width: 820px) {
  .page-shell {
    width: min(calc(100% - 28px), var(--max));
  }

  .hero {
    padding-top: 58px;
  }

  .sample-shell {
    grid-template-columns: 1fr;
  }

  .sample-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .song-list {
    grid-template-columns: 1fr;
  }

  .prompt-card {
    position: static;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .code-grid,
  .code-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .sample-nav {
    grid-template-columns: 1fr;
  }
}
