:root {
  --ink: #161616;
  --paper: #fffef9;
  --rule: #b8b5aa;
  --link: #0645ad;
}

* { box-sizing: border-box; }

html { background: var(--paper); }

body {
  max-width: 58rem;
  margin: 0 auto;
  padding: 1.5rem;
  color: var(--ink);
  font: 1.05rem/1.55 Georgia, "Times New Roman", serif;
}

a { color: var(--link); }
a:hover { text-decoration-thickness: 2px; }

.topline,
.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: .9rem;
}

.topline { border-bottom: 1px solid var(--rule); padding-bottom: .6rem; }

.site-title {
  margin: 1.8rem 0 .2rem;
  font-size: clamp(2.2rem, 7vw, 4.4rem);
  font-weight: normal;
  letter-spacing: -.06em;
  line-height: 1;
}

.subtitle { margin: 0 0 2rem; color: #555; }

.layout {
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) minmax(0, 2fr);
  gap: 2.5rem;
}

aside { font-size: .95rem; }
aside section + section,
main section + section { border-top: 1px solid var(--rule); margin-top: 1.7rem; padding-top: 1.2rem; }

h2 { font-size: 1.15rem; margin: 0 0 .5rem; }
h3 { font-size: 1rem; margin: 1.4rem 0 .25rem; }
p { margin: .5rem 0 1rem; }
ul { margin: .45rem 0 1rem; padding-left: 1.15rem; }
li + li { margin-top: .4rem; }

.portrait {
  display: block;
  width: min(15rem, 100%);
  height: auto;
  margin: .6rem 0 1rem;
  filter: grayscale(100%);
}

.links { display: flex; flex-wrap: wrap; gap: .4rem 1rem; }
.muted { color: #5e5e5e; font-size: .92rem; }

.badges { display: flex; flex-wrap: wrap; gap: .25rem; margin: .75rem 0; }
.badges img { width: 88px; height: 31px; }

.site-footer { border-top: 1px solid var(--rule); margin-top: 2.5rem; padding-top: .7rem; color: #555; }

@media (max-width: 42rem) {
  body { padding: 1rem; }
  .layout { grid-template-columns: 1fr; gap: 1.5rem; }
  .topline, .site-footer { flex-direction: column; gap: .2rem; }
}

/* Article pages were imported as Werc-compatible HTML. Keep their old prose,
   but override the old window-chrome with the same quiet reading surface. */
body:has(.window) {
  max-width: 52rem;
  display: block;
  background: var(--paper);
}

.wrap0 {
  display: block;
  width: auto;
}

.window {
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.window-deco {
  display: block !important;
  height: auto !important;
  padding-bottom: .75rem;
  background: transparent !important;
  color: var(--ink) !important;
  font-size: clamp(1.65rem, 5vw, 2.7rem);
  line-height: 1.1;
  text-align: left !important;
}

.window-deco p { margin: 0; }

.window-body {
  margin: 0 !important;
  overflow: visible !important;
  line-height: 1.6;
}

.window-body h1, .window-body h2, .window-body h3 {
  line-height: 1.2;
  margin-top: 2rem;
}

.window-body pre {
  overflow-x: auto;
  padding: 1rem;
  border: 1px solid var(--rule);
  background: #f5f3ed;
}

.window-body img { max-width: 100%; height: auto; }

/* Music library */
.music-page { max-width: 70rem; }
.music-page main { max-width: 70rem; }
.back-link { margin: 0 0 1.5rem; }
.music-page h1 { margin: 0; font-size: clamp(2.2rem, 7vw, 4.4rem); font-weight: normal; letter-spacing: -.06em; line-height: 1; }

.song-search { display: block; max-width: 34rem; margin: 2rem 0 1rem; font-size: .93rem; }
.song-search input { display: block; width: 100%; margin-top: .3rem; padding: .5rem .6rem; border: 1px solid var(--ink); border-radius: 0; background: transparent; font: inherit; }

.playlist-nav { display: flex; flex-wrap: wrap; gap: .35rem .9rem; margin: 1rem 0 1.5rem; font-size: .92rem; }
.playlist-nav span, .search-status { color: #5e5e5e; }

.playlist { border-top: 1px solid var(--rule); }
.playlist:last-of-type { border-bottom: 1px solid var(--rule); }
.playlist summary { display: flex; justify-content: space-between; gap: 1rem; padding: .9rem 0; cursor: pointer; font-weight: bold; }
.playlist summary::marker { color: var(--link); }

.song-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: .9rem; padding: .4rem 0 1.4rem; }
.song-card { display: grid; grid-template-columns: 3.25rem minmax(0, 1fr); gap: .7rem; align-items: center; min-width: 0; }
.song-card img, .album-placeholder { width: 3.25rem; height: 3.25rem; object-fit: cover; background: #e9e7df; }
.album-placeholder { display: grid; place-items: center; color: #777; font-size: 1.3rem; }
.song-title { font-weight: bold; }
.song-artist, .song-album { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .88rem; }
.song-album { color: #5e5e5e; font-style: italic; }
.song-card[hidden], .playlist[hidden] { display: none; }
