/* Prelaud on the web, after Max' moodboard: charcoal, SF Pro, indigo to purple. */

:root {
  --bg: #111214;
  --lift: #1b1b24;
  --card: #1c1c24;
  --text: #f8f8fa;
  --text-2: rgba(248, 248, 250, 0.62);
  --text-3: rgba(248, 248, 250, 0.4);
  --surface: rgba(255, 255, 255, 0.055);
  --stroke: rgba(255, 255, 255, 0.07);
  --divider: rgba(255, 255, 255, 0.07);
  --indigo: #6b5bff;
  --purple: #8b5cf6;
  --accent: linear-gradient(90deg, var(--indigo), var(--purple));
  --danger: #ff6b61;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: radial-gradient(ellipse at 50% -10%, var(--lift), var(--bg) 60%) fixed, var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}

main {
  max-width: 520px;
  margin: 0 auto;
  padding: 32px 20px 150px;
}

.hidden { display: none !important; }

/* Logo: three bars of a level meter, then the wide-set name */
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 300;
  letter-spacing: 0.3em;
  color: var(--text);
  text-decoration: none;
}
.bars { display: inline-flex; align-items: center; gap: 2px; height: 14px; }
.bars i { display: block; width: 2px; border-radius: 1px; background: currentColor; }
.bars i:nth-child(1) { height: 7px; }
.bars i:nth-child(2) { height: 14px; }
.bars i:nth-child(3) { height: 10px; }

/* Landing page */
.landing main {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-bottom: 32px;
}
.wordmark-large { font-size: 34px; gap: 16px; }
.wordmark-large .bars { height: 30px; gap: 4px; }
.wordmark-large .bars i { width: 4px; border-radius: 2px; }
.wordmark-large .bars i:nth-child(1) { height: 15px; }
.wordmark-large .bars i:nth-child(2) { height: 30px; }
.wordmark-large .bars i:nth-child(3) { height: 21px; }
.tagline {
  margin: 28px 0 0;
  font-size: 18px;
  line-height: 1.5;
  color: var(--text-2);
  white-space: pre-line;
}
.pill {
  margin: 30px 0 0;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--stroke);
  font-size: 14px;
  font-weight: 600;
}

/* Album header */
.cover {
  position: relative;
  width: min(250px, 66vw);
  aspect-ratio: 1;
  margin: 36px auto 0;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--purple), rgba(107, 91, 255, 0.55));
  background-size: cover;
  background-position: center;
  box-shadow: 0 22px 60px rgba(107, 91, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}
.cover .note { width: 34%; fill: rgba(255, 255, 255, 0.92); }
.cover.has-image .note { display: none; }

h1 {
  font-weight: 700;
  font-size: 26px;
  text-align: center;
  margin: 24px 0 0;
}

.byline {
  text-align: center;
  margin: 6px 0 0;
  font-size: 16px;
  color: var(--text-2);
}

.meta {
  text-align: center;
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--text-3);
}

/* Buttons */
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

.primary, .ghost {
  height: 50px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.primary svg, .ghost svg { width: 18px; height: 18px; fill: currentColor; }

.primary {
  background: var(--accent);
  color: #fff;
}

.ghost {
  background: var(--surface);
  border: 1px solid var(--stroke);
}

.primary:active, .ghost:active { opacity: 0.75; transform: scale(0.98); }

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 24px;
}

/* Tracks */
ol.tracks {
  list-style: none;
  padding: 0;
  margin: 22px 0 0;
}

.track {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 54px;
  cursor: pointer;
}

.track .no { width: 22px; font-size: 15px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.track .title { flex: 1; font-size: 16px; color: var(--text); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.track.current .title, .track.current .no { color: var(--indigo); }
.track .e {
  font-size: 9px; font-weight: 700; color: var(--bg); background: var(--text-3);
  border-radius: 3px; width: 14px; height: 14px; display: inline-flex; align-items: center; justify-content: center;
}
.track .time { font-size: 14px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.track .dl { font-size: 15px; color: var(--text-2); padding: 10px 0 10px 8px; }

/* Password */
.gate {
  margin-top: 70px;
  text-align: center;
}
.lock {
  width: 64px; height: 64px; margin: 0 auto 18px;
  border-radius: 20px;
  background: rgba(107, 91, 255, 0.15);
  display: flex; align-items: center; justify-content: center;
}
.lock svg { width: 28px; height: 28px; fill: var(--indigo); }
.gate form { margin-top: 26px; text-align: left; }
.gate input {
  width: 100%;
  font: inherit;
  font-size: 17px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  height: 50px;
  padding: 0 14px;
  outline: none;
}
.gate input::placeholder { color: var(--text-3); }
.gate input:focus { border-color: var(--indigo); }
.error { color: var(--danger); font-size: 14px; min-height: 20px; margin: 8px 2px 14px; }
.status-text { color: var(--text-2); font-size: 16px; }

.notice {
  margin-top: 36px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-3);
  text-align: center;
  white-space: pre-line;
}

/* Player bar, like the app's mini player */
.player {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: max(10px, env(safe-area-inset-bottom));
  max-width: 520px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 8px 8px 8px 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.player .row { display: flex; align-items: center; gap: 12px; }
.player .thumb {
  width: 42px; height: 42px; border-radius: 8px; flex: none;
  background: linear-gradient(135deg, var(--purple), rgba(107, 91, 255, 0.55)) center / cover;
}
.player .now { flex: 1; min-width: 0; }
.player .now .t { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player .now .a { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player .toggle {
  width: 44px; height: 44px; border-radius: 22px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.player .toggle svg { width: 22px; height: 22px; fill: var(--text); }
.player .toggle .icon-pause, .player .toggle .icon-wait { display: none; }
.player .toggle.playing .icon-play { display: none; }
.player .toggle.playing .icon-pause { display: block; }
.player .toggle.waiting .icon-play { display: none; }
.player .toggle.waiting .icon-wait {
  display: block; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--text-3); border-top-color: var(--text);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.player .bar { margin: 6px 4px 0; height: 14px; display: flex; align-items: center; cursor: pointer; }
.player .bar .track-line { position: relative; width: 100%; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.12); }
.player .bar .fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 2px; background: var(--accent); }
.player .times { display: flex; justify-content: space-between; margin: 0 4px; font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
