:root {
  color-scheme: dark;
  --bg: #15130f;
  --panel: #201d17;
  --panel-raised: #29251d;
  --line: #40382b;
  --text: #f4efe4;
  --muted: #aaa18f;
  --gold: #dfa950;
  --gold-light: #f2cc83;
  --warning: #f0b56a;
  --radius: 1rem;
  --shadow: 0 18px 55px rgba(0, 0, 0, .24);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% -5%, rgba(102, 72, 32, .35), transparent 30rem),
    var(--bg);
  color: var(--text);
}
a { color: inherit; }
img { display: block; max-width: 100%; }
button, input, textarea { font: inherit; }
.skip-link { position: fixed; top: .5rem; left: .5rem; z-index: 100; padding: .6rem .8rem; background: var(--gold); color: #211708; transform: translateY(-150%); }
.skip-link:focus { transform: none; }
:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 3px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 4rem;
  padding: .65rem max(1rem, calc((100vw - 1120px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: rgba(21, 19, 15, .9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.brand, .nav-link { text-decoration: none; }
.site-nav { display: flex; align-items: center; gap: .15rem; }
.brand { min-height: 2.7rem; display: flex; align-items: center; gap: .5rem; font-weight: 820; letter-spacing: -.02em; }
.brand span { color: var(--gold); }
.nav-link { color: var(--muted); font-size: .88rem; padding: .7rem .8rem; border-radius: .65rem; }
.nav-link:hover { color: var(--gold-light); background: var(--panel-raised); }

main { width: min(1120px, calc(100% - 2rem)); margin: 0 auto 5rem; }
footer { padding: 2.5rem 1rem; color: #716a5e; text-align: center; font-size: .78rem; }
h1, h2, h3, p { margin-top: 0; }
h1, .analysis h1, .analysis h2 { font-family: Georgia, "Times New Roman", serif; }
h1 { margin-bottom: .5rem; font-size: clamp(2.6rem, 8vw, 5.5rem); line-height: .98; letter-spacing: -.05em; }
.eyebrow { margin-bottom: .5rem; color: var(--gold); font-size: .73rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.lead { max-width: 45rem; color: #d7cebd; font-size: clamp(1.05rem, 3vw, 1.35rem); line-height: 1.55; }
.hero { padding: clamp(3rem, 10vw, 7rem) 0 2.2rem; }

.search { max-width: 48rem; margin-bottom: 3rem; }
.search label { display: block; margin-bottom: .45rem; color: var(--muted); font-size: .8rem; font-weight: 700; }
.search > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .6rem; }
.search input, .search button { min-height: 3rem; border-radius: .7rem; }
.search input { width: 100%; border: 1px solid var(--line); background: #171510; color: var(--text); padding: .75rem .9rem; }
.search button { border: 0; background: var(--gold); color: #251906; font-weight: 800; padding: .7rem 1.25rem; cursor: pointer; }
.search button:hover { background: var(--gold-light); }
.catalog-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .85rem; }
.catalog-heading h2 { margin: 0; font-size: 1.1rem; }
.catalog-heading span { color: var(--muted); font-size: .82rem; }

.album-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.album-card { min-width: 0; overflow: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); text-decoration: none; transition: transform .15s, border-color .15s; }
.album-card:hover { border-color: #806d49; transform: translateY(-3px); }
.cover, .detail-cover { display: grid; place-items: center; overflow: hidden; background: linear-gradient(145deg, #3c3223, #191711); }
.cover { aspect-ratio: 1; }
.cover img, .detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.cover span, .detail-cover span { color: #6c5738; font-size: 4rem; }
.album-copy { padding: 1rem; }
.album-copy h2 { margin-bottom: .3rem; overflow: hidden; font-size: 1.15rem; text-overflow: ellipsis; white-space: nowrap; }
.artist { margin-bottom: .2rem; overflow: hidden; color: var(--gold-light); font-size: .78rem; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.details, .genres { margin-bottom: .25rem; overflow: hidden; color: var(--muted); font-size: .77rem; text-overflow: ellipsis; white-space: nowrap; }
.genres { color: #827969; }
.empty { grid-column: 1 / -1; padding: 5rem 1rem; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); text-align: center; }
.empty > span { display: block; margin-bottom: .75rem; color: #6c5738; font-size: 3rem; }
.empty h2 { color: var(--text); }

.back-link { display: inline-flex; align-items: center; min-height: 3rem; margin-top: 1rem; color: var(--muted); text-decoration: none; }
.back-link:hover { color: var(--gold-light); }
.album-header { display: grid; grid-template-columns: 17rem minmax(0, 1fr); gap: 2rem; align-items: end; padding: 1rem 0 3rem; }
.detail-cover { width: 17rem; aspect-ratio: 1; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.album-header h1 { overflow-wrap: anywhere; font-size: clamp(2.7rem, 7vw, 5rem); }
.album-artist { margin-bottom: 1.4rem; color: var(--gold-light); font-size: 1.2rem; }
.album-artist a { color: inherit; text-decoration-color: rgba(242, 204, 131, .35); text-underline-offset: .2em; }
.album-artist a:hover { text-decoration-color: currentColor; }
.metadata { display: flex; flex-wrap: wrap; gap: .55rem 1.5rem; margin: 0 0 1.2rem; }
.metadata div { min-width: 5rem; }
.metadata dt { color: var(--muted); font-size: .68rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.metadata dd { margin: .15rem 0 0; color: #dfd7c7; font-size: .9rem; }
.library-path { margin: 0; color: #877e6e; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .72rem; overflow-wrap: anywhere; }
.library-path span { display: block; margin-bottom: .2rem; color: #6f675a; font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-weight: 750; text-transform: uppercase; }
.metadata-warning { margin-top: .8rem; color: var(--warning); font-size: .82rem; }

.analysis { max-width: 54rem; margin: 0 auto; padding: clamp(1.1rem, 4vw, 3rem); background: rgba(32, 29, 23, .82); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); font-size: 1rem; line-height: 1.72; }
.analysis h1 { margin: 0 0 1.5rem; font-size: clamp(2rem, 5vw, 3.25rem); line-height: 1.08; }
.analysis h2 { margin: 2.3rem 0 .7rem; color: var(--gold-light); font-size: 1.55rem; }
.analysis h3 { margin: 1.7rem 0 .5rem; font-size: 1.1rem; }
.analysis p, .analysis ul, .analysis ol { color: #ddd5c6; }
.analysis a { color: var(--gold-light); text-decoration-thickness: .08em; text-underline-offset: .18em; }
.analysis code { padding: .12em .3em; border-radius: .3em; background: #15130f; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; }
.analysis pre { overflow-x: auto; padding: 1rem; border: 1px solid #342e24; border-radius: .7rem; background: #15130f; }
.analysis pre code { padding: 0; background: transparent; }
.analysis blockquote { margin-left: 0; padding-left: 1rem; border-left: 3px solid var(--gold); color: var(--muted); }
.analysis img { max-height: 42rem; margin: 1.5rem auto; border-radius: .7rem; }
.analysis table { display: block; width: max-content; max-width: 100%; margin: 1.3rem 0; overflow-x: auto; border-collapse: collapse; font-size: .88rem; }
.analysis th, .analysis td { padding: .55rem .7rem; border: 1px solid var(--line); text-align: left; }
.analysis th { background: #2b271f; color: var(--gold-light); }
.analysis hr { margin: 2rem 0; border: 0; border-top: 1px solid var(--line); }
.album-analysis { max-width: none; }

.artist-hero { max-width: 54rem; }
.artist-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.artist-card { min-height: 13rem; padding: clamp(1.3rem, 4vw, 2rem); background: linear-gradient(145deg, rgba(59, 48, 31, .9), rgba(29, 26, 20, .96)); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); text-decoration: none; transition: transform .15s, border-color .15s; }
.artist-card:hover { border-color: #806d49; transform: translateY(-3px); }
.artist-card h2 { margin-bottom: .5rem; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.8rem, 5vw, 2.8rem); }
.artist-card p:not(.eyebrow) { color: var(--muted); }
.artist-card > span { color: var(--gold-light); font-size: .86rem; font-weight: 750; }
.artist-detail-header { max-width: 60rem; margin: 0 auto; padding: clamp(2rem, 7vw, 5rem) 0 2rem; }
.artist-detail-header h1 { max-width: 52rem; }
.artist-detail-header .library-path { margin-top: 1.4rem; }
.related-albums { max-width: 60rem; margin: 0 auto 1rem; padding: 1rem; display: grid; grid-template-columns: 10rem minmax(0, 1fr); gap: 1rem; align-items: center; background: rgba(41, 37, 29, .8); border: 1px solid var(--line); border-radius: var(--radius); }
.related-albums h2 { margin: 0; font-size: 1rem; }
.related-album-links { display: flex; gap: .65rem; overflow-x: auto; padding: .15rem .1rem .5rem; }
.related-album-links a { flex: 0 0 12rem; min-height: 3.5rem; display: grid; grid-template-columns: 3.5rem minmax(0, 1fr); align-items: center; gap: .65rem; padding: .45rem; background: #171510; border: 1px solid #342e24; border-radius: .65rem; text-decoration: none; }
.related-album-links img { width: 3.5rem; height: 3.5rem; object-fit: cover; border-radius: .35rem; }
.related-album-links strong, .related-album-links small { display: block; }
.related-album-links strong { overflow: hidden; color: var(--gold-light); font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }
.related-album-links small { margin-top: .15rem; color: var(--muted); font-size: .7rem; }
.artist-analysis { max-width: 60rem; }
.artist-analysis img { width: 100%; max-height: 36rem; object-fit: cover; }

.blog-hero, .published-header { max-width: 60rem; }
.published-header { padding: clamp(2rem, 7vw, 5rem) 0 2rem; }
.publication-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.publication-card { min-height: 14rem; padding: clamp(1.3rem, 4vw, 2rem); display: flex; flex-direction: column; background: linear-gradient(145deg, rgba(59, 48, 31, .9), rgba(29, 26, 20, .96)); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); text-decoration: none; transition: transform .15s, border-color .15s; }
.publication-card:hover { border-color: #806d49; transform: translateY(-3px); }
.publication-card h2 { margin-bottom: .45rem; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.7rem, 4vw, 2.5rem); }
.publication-card p:not(.eyebrow) { color: var(--muted); }
.publication-card > div { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.publication-card > div > span { margin-top: auto; color: var(--gold-light); font-weight: 750; }
.publication-card.with-cover { padding: 0; display: grid; grid-template-columns: 9rem minmax(0, 1fr); overflow: hidden; }
.publication-card.with-cover > div { min-width: 0; padding: 1.25rem; display: flex; flex-direction: column; }
.publication-card.with-cover span { margin-top: auto; color: var(--gold-light); font-weight: 750; }
.publication-cover { width: 9rem; height: 100%; object-fit: cover; }
.published-with-cover { display: grid; grid-template-columns: 14rem minmax(0, 1fr); align-items: end; gap: 2rem; }
.published-with-cover > img { width: 14rem; aspect-ratio: 1; object-fit: cover; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.editorial-note { margin-bottom: 1rem; background: rgba(54, 45, 31, .92); border-color: #6d5938; }
.section-provenance { margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: 1px solid #6d5938; }
.section-provenance h2 { margin: 0; color: var(--text); font-size: clamp(1.8rem, 5vw, 2.6rem); }
.section-provenance .byline, .public-byline { margin: .35rem 0 0; color: var(--muted); font-size: .85rem; font-weight: 700; }
.public-byline { max-width: 60rem; margin: 0 auto .75rem; }
.ai-disclosure { width: fit-content; margin: 0 0 .75rem; padding: .4rem .65rem; border: 1px solid #655839; border-radius: 999px; background: rgba(41, 37, 29, .9); color: #d7c59f; font-size: .72rem; font-weight: 800; letter-spacing: .025em; }
.ai-disclosure span { margin-right: .25rem; color: var(--gold); }
.compact-hero { max-width: 54rem; padding-bottom: 3rem; }
.button-link { display: inline-flex; min-height: 2.8rem; align-items: center; padding: .65rem 1rem; background: var(--gold); border-radius: .65rem; color: #251906; font-weight: 800; text-decoration: none; }
.workshop-section { margin-bottom: 3rem; }
.source-list { display: grid; gap: .55rem; }
.source-list > a { min-height: 4.3rem; padding: .8rem 1rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; background: var(--panel); border: 1px solid var(--line); border-radius: .75rem; text-decoration: none; }
.source-list > a:hover { border-color: #806d49; }
.source-list span, .source-list strong, .source-list em, .source-list small { display: block; }
.source-list small { margin-bottom: .15rem; color: var(--gold); font-size: .65rem; font-style: normal; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.source-list em { margin-top: .18rem; color: var(--muted); font-size: .75rem; font-style: normal; }
.source-list code, .snapshot-id { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .72rem; }
.status { flex: 0 0 auto; padding: .35rem .55rem; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .7rem; }
.status-approved { border-color: #547157; color: #a9d4a7; }
.status-changed-since-approval { border-color: #866734; color: var(--warning); }
.muted { color: var(--muted); }
.editor-form { max-width: 60rem; padding: clamp(1rem, 3vw, 2rem); display: grid; gap: .55rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.editor-form label { margin-top: .7rem; font-weight: 800; }
.editor-form label small { display: block; margin-top: .2rem; color: var(--muted); font-weight: 400; }
.editor-form input, .editor-form textarea { width: 100%; padding: .75rem; border: 1px solid var(--line); border-radius: .55rem; background: #15130f; color: var(--text); }
.editor-form textarea { resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; line-height: 1.5; }
.editor-form button, .candidate-action button, .approval-panel button { min-height: 2.8rem; padding: .65rem 1rem; border: 0; border-radius: .6rem; background: var(--gold); color: #251906; cursor: pointer; font-weight: 850; }
.editor-form button { justify-self: start; margin-top: .8rem; }
.candidate-action, .approval-panel { max-width: 60rem; margin: 1rem 0; padding: 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: var(--panel-raised); border: 1px solid var(--line); border-radius: var(--radius); }
.candidate-action p, .approval-panel p { max-width: 38rem; margin: 0; color: var(--muted); font-size: .8rem; }
.source-preview, .diff-panel { margin: 2rem 0; padding: 1rem; border: 1px solid var(--line); border-radius: .75rem; background: var(--panel); }
.source-preview summary, .diff-panel summary { cursor: pointer; color: var(--gold-light); font-weight: 750; }
.source-preview pre, .diff-panel pre { overflow-x: auto; white-space: pre-wrap; color: #cfc5b4; font-size: .78rem; line-height: 1.45; }
.danger-zone { margin: 3rem 0; padding: 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; border: 1px solid #7f493f; border-radius: var(--radius); background: rgba(80, 35, 29, .25); }
.danger-zone h2 { margin-bottom: .35rem; }
.danger-zone p { margin-bottom: 0; color: var(--muted); }
.danger-zone form { display: grid; gap: .7rem; justify-items: start; }
.danger-zone label { color: #d8c5be; font-size: .78rem; }
.danger-zone button { min-height: 2.7rem; padding: .6rem .9rem; border: 1px solid #b96759; border-radius: .6rem; background: #8d3f35; color: white; cursor: pointer; font-weight: 800; }

@media (max-width: 800px) {
  .album-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .album-header { grid-template-columns: 12rem minmax(0, 1fr); gap: 1.3rem; }
  .detail-cover { width: 12rem; }
}

@media (max-width: 560px) {
  .site-header { padding: .5rem .75rem; }
  .brand { font-size: .92rem; }
  .site-nav { max-width: 66vw; overflow-x: auto; }
  .nav-link { flex: 0 0 auto; padding: .65rem .35rem; font-size: .76rem; }
  main { width: min(100% - 1rem, 1120px); margin-bottom: 2rem; }
  .hero { padding-top: 2.6rem; }
  .search { margin-bottom: 2rem; }
  .search > div { grid-template-columns: 1fr; }
  .search button { width: 100%; }
  .album-grid { grid-template-columns: 1fr; }
  .album-card { display: grid; grid-template-columns: 7rem minmax(0, 1fr); }
  .cover { width: 7rem; height: 7rem; }
  .album-copy { align-self: center; }
  .back-link { margin-top: .35rem; }
  .album-header { display: block; padding-bottom: 1.3rem; }
  .detail-cover { width: min(72vw, 18rem); margin: 0 auto 1.5rem; }
  .album-header h1 { font-size: 2.55rem; }
  .metadata { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
  .analysis { padding: 1rem; border-radius: .8rem; }
  .analysis h1 { font-size: 2rem; }
  .artist-grid { grid-template-columns: 1fr; }
  .publication-grid { grid-template-columns: 1fr; }
  .artist-card { min-height: 10rem; }
  .artist-detail-header { padding: 2rem .5rem 1.2rem; }
  .related-albums { display: block; }
  .related-albums > div:first-child { margin-bottom: .8rem; }
  .related-album-links a { flex-basis: 10.5rem; }
  .source-list > a, .candidate-action, .approval-panel, .danger-zone { align-items: flex-start; flex-direction: column; }
  .published-with-cover { display: block; }
  .published-with-cover > img { width: min(72vw, 18rem); margin: 0 auto 1.5rem; }
}
