:root {
  --bg: #ffffff;
  --text: #1a1a18;
  --line: #1a1a18;
  --muted: #999992;
  --art-size: 80px;
  --width: 400px;
}

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

html { font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Lucida Console', monospace;
  min-height: 100vh;
  padding-bottom: 120px;
}

/* ─── HEADER ─────────────────────────────────────────── */

.site-header {
  max-width: var(--width);
  margin: 0 auto;
  padding: 48px 24px 0;
  text-align: center;
}

.site-subtitle {
  font-size: 11px;
  color: var(--muted);
  margin-top: 10px;
  line-height: 1.5;
}

.site-title {
  font-size: 1.5em;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
  display: inline-block;
  background-color: #7CFC00;
  padding: 0 4px;
}

/* ─── TIMELINE ───────────────────────────────────────── */

#timeline {
  max-width: var(--width);
  margin: 0 auto;
  padding: 40px 0 0;
  position: relative;
}

/* Heights and padding-top set by JS (setLegLayout) */
.leg {}

/* ─── SONG ITEMS ─────────────────────────────────────── */

.song {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  cursor: pointer;
}

.song:hover .song-title,
.song:hover .song-artist { background-color: #7CFC00; }

.song:hover .song-art {
  outline-color: #7CFC00;
  box-shadow: 0 0 14px rgba(124, 252, 0, 0.55);
}

.leg.right .song {
  flex-direction: row-reverse;
  text-align: right;
}

.leg.left .song {
  flex-direction: row;
  text-align: left;
}

.song-art {
  width: var(--art-size);
  height: var(--art-size);
  flex-shrink: 0;
  background: #e0ddd8;
  border-radius: 10px;
  overflow: hidden;
  outline: 1.5px solid var(--line);
  transition: outline-color 0.15s, box-shadow 0.15s;
}

.song-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.song-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  width: fit-content;
  padding: 0 2px;
  transition: background-color 0.15s;
}

.song-artist {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
  width: fit-content;
  padding: 0 2px;
  transition: background-color 0.15s;
}

.leg.right .song-title,
.leg.right .song-artist { margin-left: auto; }

/* ─── NOTE SPACERS (height set by JS) ───────────────── */

.note-spacer {}

/* ─── NOTE LABELS (absolutely positioned by JS) ─────── */

.note-label {
  font-family: 'Lucida Console', monospace;
  font-size: 13px;
  color: #222222;
  line-height: 1;
  pointer-events: none;
}

/* ─── MODAL ──────────────────────────────────────────── */

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
}

.modal[aria-hidden="true"] {
  pointer-events: none;
  visibility: hidden;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 8, 0.4);
  opacity: 0;
  transition: opacity 0.28s ease;
}

.modal[aria-hidden="false"] .modal-overlay { opacity: 1; }

.modal-sheet {
  position: relative;
  width: 100%;
  max-width: var(--width);
  background: var(--bg);
  border-radius: 12px;
  padding: 36px 28px;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  max-height: 70vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal[aria-hidden="false"] .modal-sheet { opacity: 1; transform: translateY(0); }

.modal-close {
  position: absolute;
  top: 18px;
  right: 20px;
  background: #7CFC00;
  border: none;
  font-size: 14px;
  cursor: pointer;
  color: var(--text);
  padding: 4px 8px;
  line-height: 1;
  font-family: inherit;
  border-radius: 3px;
}

.modal-close:hover { opacity: 0.7; }

.modal-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.modal-art {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  background: #e0ddd8;
  border-radius: 10px;
  overflow: hidden;
  outline: 1.5px solid var(--line);
}

.modal-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 4px;
}

.modal-artist {
  font-size: 13px;
  color: var(--muted);
}

.modal-body {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
}

.modal-body p { margin-bottom: 14px; }
.modal-body p:last-child { margin-bottom: 0; }

.modal-body a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.modal-body .loading { color: var(--muted); }

/* ─── PLAYER ─────────────────────────────────────────── */

.player {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 500px;
  background: var(--bg);
  border: 1px solid rgba(26, 26, 24, 0.1);
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  z-index: 100;
}

.player-toggle {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 14px 20px;
  background: none;
  border: none;
  font-family: 'Lucida Console', monospace;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  gap: 8px;
  letter-spacing: 0.03em;
}

.player-toggle:hover { color: var(--text); }

.player-label { flex: 1; text-align: left; }

.player-icon {
  font-size: 11px;
  background-color: #7CFC00;
  color: var(--text);
  padding: 2px 7px;
  border-radius: 3px;
  transition: transform 0.2s ease;
}

.player[data-open="true"] .player-icon { transform: rotate(180deg); }

.player-embed {
  padding: 0 20px 12px;
}

/* ─── DESKTOP ────────────────────────────────────────── */

@media (min-width: 640px) {
  :root { --width: 460px; }
}

@media (min-width: 900px) {
  :root { --width: 500px; }
}
