* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink: #141414;
  --muted: #8a8a8a;
  --line: #e7e7e7;
  --bg: #f2f0eb;
  --hover: #e6e4df;
  --mono: "Fira Code", ui-monospace, SFMono-Regular, Menlo, monospace;
  --serif: "IM Fell DW Pica", Georgia, serif;
}

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--mono);
  font-weight: 450;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
}

body.player-active { padding-bottom: 220px; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img { display: block; }

.site-header {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 24px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo svg { display: block; width: 64px; height: 56px; }

#search {
  font: inherit;
  color: var(--ink);
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  width: 240px;
  outline: none;
  -webkit-appearance: none;
}
#search:focus { border-color: var(--ink); }
#search::placeholder { color: var(--muted); }
#search[hidden] { display: none; }

main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 36px 24px 64px;
}

/* home grid */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 32px 24px;
}

.card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  background: var(--hover);
}

.card-title {
  margin-top: 10px;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  line-height: 1.3;
}

.card-sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.section-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 44px 0 14px;
}
.section-label:first-child { margin-top: 0; }

.empty { color: var(--muted); }

/* track hit list (search) */

.hits { border-top: 1px solid var(--line); }

.hit {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 10px 4px;
  border-bottom: 1px solid var(--line);
}
.hit:hover { background: var(--hover); }
.hit img { width: 42px; height: 42px; object-fit: cover; border-radius: 4px; }
.hit-album { font-size: 13px; color: var(--muted); }

/* album page */

.album {
  display: flex;
  gap: 48px;
  align-items: flex-start;
}

.album-art {
  width: 400px;
  max-width: 42vw;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  background: var(--hover);
}

.album-info { flex: 1; min-width: 0; padding-top: 2px; }

.album-info h1 {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 22px;
  line-height: 1.25;
}

.album-meta {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

.album-notes {
  margin-top: 16px;
  max-width: 56ch;
  white-space: pre-line;
}

.tracklist { list-style: none; margin-top: 24px; border-top: 1px solid var(--line); }

.track {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 10px 4px;
  border-bottom: 1px solid var(--line);
}
.track:hover { background: var(--hover); }

.track.playing {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0) 100%);
}

.track-no {
  width: 22px;
  flex-shrink: 0;
  font-size: 13px;
  color: var(--muted);
}

.track-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track.playing .track-title { font-weight: 600; }
.track.playing .track-no { color: var(--ink); }

.track-dur {
  font-size: 13px;
  color: var(--muted);
}

/* player */

#player {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 48px;
  width: min(880px, calc(100% - 32px));
  padding: 32px 40px 26px;
  border-radius: 32px;
  border: 1px solid rgba(20, 20, 20, 0.16);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0));
  box-shadow: 0 8px 8px rgba(0, 0, 0, 0.04);
}

.p-core {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}

.p-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

#p-art {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  background: var(--hover);
}

.p-titles { min-width: 0; }

#p-track {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#p-album {
  display: block;
  font-size: 13px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#p-album:hover { color: var(--ink); }

.p-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.p-controls button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--ink);
}
.p-controls button:hover { color: #000; }
#icon-pause { display: none; }
#p-prev, #p-next { color: #555; }

.p-time {
  justify-self: end;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 5px;
}

#seek {
  padding: 6px 0;
  margin-top: 18px;
  cursor: pointer;
  touch-action: none;
}

.seek-line {
  height: 4px;
  border-radius: 99px;
  background: var(--line);
}

#seek-fill {
  position: relative;
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: var(--ink);
}

#seek-fill::after {
  content: "";
  position: absolute;
  right: -4px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink);
}

.site-footer {
  position: fixed;
  bottom: 14px;
  left: 0;
  right: 0;
  font-size: 12px;
  text-align: center;
  pointer-events: none;
}
.site-footer a { color: var(--muted); pointer-events: auto; }
.site-footer a:hover { color: var(--ink); }

@media (max-width: 640px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 24px 16px; }
  .album { flex-direction: column; gap: 28px; }
  .album-art { width: 100%; max-width: none; }
  body.player-active { padding-bottom: 180px; }
  #player {
    bottom: 12px;
    width: calc(100% - 24px);
    padding: 16px 20px;
    border-radius: 24px;
  }
  .p-core { gap: 10px; }
  .p-left { gap: 10px; }
  #p-art { width: 40px; height: 40px; }
  #p-album { display: none; }
  .p-controls { gap: 4px; }
  .p-time .p-time-sep, .p-time #p-dur { display: none; }
  #seek { margin-top: 6px; }
  body.player-active .site-footer { display: none; }
}
