/* Fonts ship with the page so the offline copy looks the same. */
@font-face { font-family: Raleway; font-style: normal; font-weight: 300; font-display: swap; src: url(fonts/raleway-latin-ext-300-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: Raleway; font-style: normal; font-weight: 300; font-display: swap; src: url(fonts/raleway-latin-300-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: Raleway; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/raleway-latin-ext-400-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: Raleway; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/raleway-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: Raleway; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/raleway-latin-ext-500-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: Raleway; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/raleway-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Cormorant Garamond"; font-style: italic; font-weight: 400; font-display: swap; src: url(fonts/cormorant-garamond-latin-400-italic.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

:root {
  --bg: #f6f5f2;
  --paper: #ffffff;
  --panel: #eeece7;
  --rule: #d8d5ce;
  --mute: #8a877f;
  --ink: #191918;
  --gutter: 20px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b0a;
    --paper: #121211;
    --panel: #181816;
    --rule: #2d2c29;
    --mute: #8e8b83;
    --ink: #ecebe6;
    color-scheme: dark;
  }
}
@media (min-width: 720px) { :root { --gutter: 48px; } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Raleway, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 400;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: lining-nums;
  padding-bottom: env(safe-area-inset-bottom);
}
body.locked { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }

.lab {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  line-height: 1.3;
}
.mute { color: var(--mute); }

/* ── Header ─────────────────────────────── */
.top {
  height: 64px;
  padding: 0 var(--gutter);
  padding-top: env(safe-area-inset-top);
  box-sizing: content-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--rule);
}
.name {
  font-size: 15px;
  font-weight: 300;
  letter-spacing: .14em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rev { color: var(--mute); white-space: nowrap; }

.offline {
  padding: 10px var(--gutter);
  background: var(--ink);
  color: var(--bg);
}

/* ── Title block ─────────────────────────── */
.block {
  margin: 24px var(--gutter) 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}
@media (min-width: 720px) {
  .block { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 40px; }
}
.block .cell {
  background: var(--paper);
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 86px;
}
.block .cell .lab { color: var(--mute); }
.num {
  font-size: 30px;
  font-weight: 300;
  letter-spacing: .02em;
  line-height: 1;
  font-variant-numeric: tabular-nums lining-nums;
}
.num.small { font-size: 17px; line-height: 1.25; letter-spacing: .04em; }

/* ── Search + tabs (sticky) ─────────────── */
.bar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
  padding: 20px var(--gutter) 14px;
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.bar.stuck { border-bottom-color: var(--rule); }
.search {
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--ink);
  height: 52px;
}
.search > .lab { color: var(--mute); flex-shrink: 0; }
.search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 20px;
  font-weight: 300;
  letter-spacing: .02em;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.search input::placeholder { color: var(--mute); opacity: .7; }
.search input::-webkit-search-cancel-button { display: none; }
.clear { color: var(--mute); padding: 8px 0 8px 8px; }
.tabs {
  margin-top: 14px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs.hide { display: none; }
.chip {
  flex-shrink: 0;
  height: 36px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--rule);
  white-space: nowrap;
}
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* ── Sections ───────────────────────────── */
main { padding: 0 var(--gutter) 40px; min-height: 50vh; }
.loading, .empty-note { color: var(--mute); padding: 40px 0; }
.sec { margin-top: 28px; }
.sec-head {
  height: 56px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.sec-head .idx { color: var(--mute); }
.sec-head h2 { margin: 0; font-size: 13px; }
.sec-head .count { margin-left: auto; color: var(--mute); }

.tools { display: flex; align-items: center; gap: 8px; margin-top: 22px; flex-wrap: wrap; }
.tools .lab.mute { margin-right: 6px; }
.tools .chip { height: 32px; padding: 0 12px; font-size: 9.5px; }

/* ── Cover grid (catalog cells) ─────────── */
/* Each cell draws its own hairline so a short last row leaves no grey gaps. */
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  padding: 1px;
}
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (min-width: 1300px) { .grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.card {
  background: var(--paper);
  padding: 10px 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  box-shadow: 0 0 0 1px var(--rule);
  transition: background .15s;
}
@media (min-width: 720px) { .card { padding: 14px 14px 18px; } }
@media (hover: hover) { .card:hover { background: var(--panel); } }
.card .meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.card .t {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .02em;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card .a { font-size: 12.5px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .foot-line { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; color: var(--mute); font-size: 9px; }

.art {
  position: relative;
  aspect-ratio: 1;
  width: 100%;
  background: var(--panel);
  overflow: hidden;
}
.art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity .3s; }
.art img.in { opacity: 1; }
/* Line-drawn record for albums without art */
.art.none::before, .art.none::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  border: 1px solid var(--rule);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.art.none::before { width: 62%; height: 62%; }
.art.none::after { width: 14%; height: 14%; }

/* ── Artists list ───────────────────────── */
.az {
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  margin-top: 22px;
}
.az a, .az span {
  flex: 1 0 34px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
}
.az span { color: var(--rule); }
@media (hover: hover) { .az a:hover { background: var(--panel); } }

.letter {
  margin-top: 30px;
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--ink);
  scroll-margin-top: 150px;
}
.letter h2 { margin: 0; font-size: 32px; font-weight: 300; line-height: 1; letter-spacing: .04em; }
.letter h2.word { font-size: 22px; letter-spacing: .08em; text-transform: uppercase; }
.letter .count { margin-left: auto; color: var(--mute); }

.artist { border-bottom: 1px solid var(--rule); content-visibility: auto; contain-intrinsic-size: auto 56px; }
.artist > button {
  width: 100%;
  min-height: 56px;
  padding: 10px 0;
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
}
.artist .an { font-size: 16px; font-weight: 400; letter-spacing: .01em; flex: 1; min-width: 0; }
.artist .ac { color: var(--mute); white-space: nowrap; }
.artist .pm { width: 14px; text-align: center; color: var(--mute); font-weight: 300; font-size: 18px; line-height: 1; }
.artist ol { list-style: none; margin: 0 0 16px; padding: 0; border-top: 1px solid var(--rule); }
.row {
  width: 100%;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
  text-align: left;
}
.artist ol li:last-child .row { border-bottom: 0; }
.row .art { width: 52px; }
.row .rt { font-size: 14px; line-height: 1.3; }
.row .rs { font-size: 12px; color: var(--mute); margin-top: 2px; }
.row .ry { color: var(--mute); }
@media (hover: hover) { .row:hover .rt { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; } }

.more { margin-top: 24px; width: 100%; height: 48px; border: 1px solid var(--rule); }
@media (hover: hover) { .more:hover { background: var(--panel); } }

/* ── Nothing found ──────────────────────── */
.none-found { padding: 48px 0 24px; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.none-found p.frag {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-size: 26px;
  line-height: 1.3;
}
.none-found .lab { color: var(--mute); }

/* ── Album sheet (spec sheet) ───────────── */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--ink) 40%, transparent);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet[hidden] { display: none; }
@media (min-width: 720px) { .sheet { align-items: center; padding: 40px; } }
.sheet-panel {
  background: var(--bg);
  width: 100%;
  max-width: 940px;
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--rule);
  padding-bottom: env(safe-area-inset-bottom);
  animation: rise .22s ease-out;
}
@keyframes rise { from { transform: translateY(16px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sheet-panel { animation: none; } }
.sheet-top {
  height: 56px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 1;
}
.sheet-top .lab.mute { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-body { display: grid; grid-template-columns: 1fr; }
@media (min-width: 720px) { .sheet-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.sheet-art { background: var(--paper); padding: 20px; border-bottom: 1px solid var(--rule); }
@media (min-width: 720px) { .sheet-art { border-bottom: 0; border-right: 1px solid var(--rule); padding: 32px; } }
.sheet-info { padding: 24px 20px 28px; display: flex; flex-direction: column; gap: 22px; }
@media (min-width: 720px) { .sheet-info { padding: 32px; } }
.sheet-info h1 { margin: 0; font-size: 28px; font-weight: 300; letter-spacing: .02em; line-height: 1.15; }
.sheet-info .by { margin-top: 8px; font-size: 15px; }
.spec { width: 100%; border-collapse: collapse; border: 1px solid var(--rule); font-size: 13.5px; }
.spec th {
  width: 34%;
  text-align: left;
  font-weight: 500;
  color: var(--mute);
  background: var(--panel);
  padding: 10px 12px;
  border-bottom: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
  vertical-align: top;
}
.spec td { padding: 10px 12px; border-bottom: 1px solid var(--rule); font-variant-numeric: tabular-nums lining-nums; }
.spec tr:last-child th, .spec tr:last-child td { border-bottom: 0; }
.also { border-top: 1px solid var(--rule); padding: 20px 20px 28px; }
@media (min-width: 720px) { .also { padding: 24px 32px 32px; } }
.also .lab { color: var(--mute); display: block; margin-bottom: 8px; }

.foot {
  margin: 0 var(--gutter);
  height: 64px;
  border-top: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--mute);
}
@media (max-width: 520px) { .foot { flex-direction: column; justify-content: center; align-items: flex-start; height: 84px; gap: 6px; } }
