:root {
  --bg: #000;
  --fg: #fff;
  --line: #fff;
  --dim: #8a8a8a;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Space Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  line-height: 1.6;
}

/* ---------- animated noise overlay ---------- */
#noise {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.055;
  mix-blend-mode: screen;
}

/* ---------- layout ---------- */
.site-head,
.section,
.site-foot {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

.site-head {
  padding-top: 64px;
  padding-bottom: 8px;
}

h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: lowercase;
}

.tag { margin: 4px 0 0; color: var(--dim); font-size: 13px; }

.section {
  padding-top: 56px;
  padding-bottom: 8px;
  border-top: 1px solid var(--line);
  margin-top: 56px;
}

.section-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin: 0 0 24px;
}

.count { color: var(--dim); font-weight: 400; letter-spacing: 0; }

/* ---------- photos ---------- */
.photos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.photo { margin: 0; }

.photo img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  filter: grayscale(1) contrast(1.05);
  border: 1px solid var(--line);
}

.photo figcaption {
  margin-top: 6px;
  font-size: 12px;
  color: var(--dim);
}

@media (max-width: 640px) {
  .photos { grid-template-columns: 1fr; }
}

/* ---------- notes ---------- */
.note-form { display: flex; gap: 12px; align-items: flex-start; }

.note-form textarea {
  flex: 1;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--line);
  font: inherit;
  padding: 10px 12px;
  resize: vertical;
}

.note-form textarea:focus { outline: 2px solid var(--fg); outline-offset: 2px; }

button {
  font: inherit;
  font-size: 13px;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--line);
  padding: 10px 16px;
  cursor: pointer;
  text-transform: lowercase;
}

button:hover, button:focus-visible { background: var(--fg); color: var(--bg); }

.hint { color: var(--dim); font-size: 12px; margin: 10px 0 0; }

.note-list { list-style: none; padding: 0; margin: 24px 0 0; }

.note {
  border-top: 1px solid var(--line);
  padding: 14px 0;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.note:last-child { border-bottom: 1px solid var(--line); }

.note-body { flex: 1; white-space: pre-wrap; overflow-wrap: anywhere; }

.note-meta {
  display: block;
  color: var(--dim);
  font-size: 11px;
  margin-bottom: 6px;
}

.note-del {
  border: none;
  padding: 0 4px;
  color: var(--dim);
  font-size: 13px;
}

.note-del:hover, .note-del:focus-visible { background: transparent; color: var(--fg); text-decoration: line-through; }

/* ---------- player ---------- */
.player { border: 1px solid var(--line); padding: 14px 16px; margin-bottom: 20px; }

.player-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.player-row + .player-row { margin-top: 12px; }

#btn-play { min-width: 64px; font-weight: 700; }

.now-playing {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 120px;
}

.time { font-size: 12px; color: var(--dim); min-width: 40px; text-align: center; }

.progress {
  flex: 1;
  height: 14px;
  border: 1px solid var(--line);
  cursor: pointer;
  min-width: 120px;
}

.progress-fill { height: 100%; width: 0; background: var(--fg); }

.vol-label { font-size: 12px; color: var(--dim); display: flex; align-items: center; gap: 8px; }

input[type="range"] { accent-color: #fff; width: 120px; }

/* ---------- song list ---------- */
.filter {
  width: 100%;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--line);
  font: inherit;
  padding: 10px 12px;
  margin-bottom: 8px;
}

.filter:focus { outline: 2px solid var(--fg); outline-offset: 2px; }

.song-list { list-style: none; padding: 0; margin: 16px 0 0; }

.song {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  cursor: pointer;
}

.song:last-child { border-bottom: 1px solid var(--line); }

.song:hover .song-title, .song:focus-visible .song-title { text-decoration: underline; }

.song-num { color: var(--dim); font-size: 12px; min-width: 3.2em; }

.song-title { flex: 1; overflow-wrap: anywhere; }

.song.playing .song-title { font-weight: 700; }
.song.playing .song-num::after { content: " ▶"; }

.song-state { font-size: 11px; color: var(--dim); }

/* ---------- footer ---------- */
.site-foot {
  margin-top: 72px;
  padding-top: 24px;
  padding-bottom: 48px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 12px;
}

@media (prefers-reduced-motion: reduce) {
  #noise { display: none; }
}
