/* Sugar Land — minimal stylesheet */

:root {
  --bg: #fafaf7;
  --fg: #1a1a1a;
  --muted: #888;
  --line: #e6e3dc;
  --hover: rgba(0, 0, 0, 0.04);
  --playing: rgba(0, 0, 0, 0.06);

  --player-bg: #1a1a1a;
  --player-fg: #fafaf7;
  --player-muted: #888;
  --player-line: #2a2a2a;

  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, 'Times New Roman', serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111;
    --fg: #ececec;
    --muted: #777;
    --line: #232323;
    --hover: rgba(255, 255, 255, 0.04);
    --playing: rgba(255, 255, 255, 0.07);
    --player-bg: #000;
    --player-fg: #ececec;
    --player-line: #1f1f1f;
  }
}

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

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.5;
  min-height: 100vh;
  padding-bottom: 120px; /* room for sticky player */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* HEADER */
header {
  max-width: 960px;
  margin: 0 auto;
  padding: clamp(48px, 10vw, 112px) 32px clamp(40px, 6vw, 64px);
  border-bottom: 1px solid var(--line);
}

h1 {
  font-size: clamp(2.5rem, 7vw, 5rem);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 0.95;
  margin: 0 0 20px;
}

.subtitle {
  font-size: 1.125rem;
  color: var(--muted);
  font-style: normal;
  margin: 0;
}

.subtitle em {
  font-style: italic;
}

.meta {
  margin: 32px 0 0;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

/* TRACKLIST */
main {
  max-width: 960px;
  margin: 0 auto;
  padding: 8px 32px 32px;
}

.tracklist {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--mono);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

.tracklist li {
  display: grid;
  grid-template-columns: 84px 1fr auto;
  gap: 24px;
  align-items: baseline;
  padding: 14px 16px;
  margin: 0 -16px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background-color 0.12s ease;
  position: relative;
}

.tracklist li:hover {
  background: var(--hover);
}

.tracklist li.playing {
  background: var(--playing);
}

.tracklist li.playing::before {
  content: '▸';
  position: absolute;
  left: -4px;
  top: 14px;
  color: var(--fg);
}

.tracklist .year {
  color: var(--muted);
  letter-spacing: 0.02em;
}

.tracklist .artist {
  color: var(--fg);
  font-family: var(--serif);
  font-size: 1rem;
}

.tracklist .location {
  color: var(--muted);
  text-align: right;
  font-size: 0.8125rem;
}

@media (max-width: 640px) {
  .tracklist li {
    grid-template-columns: 64px 1fr;
    gap: 16px;
    padding: 12px;
  }
  .tracklist .location {
    grid-column: 2;
    text-align: left;
    margin-top: 2px;
  }
  header { padding-left: 24px; padding-right: 24px; }
  main { padding-left: 24px; padding-right: 24px; }
}

/* PLAYER */
.player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--player-bg);
  color: var(--player-fg);
  padding: 16px 32px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 32px;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.8125rem;
  border-top: 1px solid var(--player-line);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
  z-index: 10;
}

.player[aria-hidden="false"] {
  transform: translateY(0);
}

.player-track {
  display: flex;
  align-items: baseline;
  gap: 16px;
  min-width: 0;
}

.player-year {
  color: var(--player-muted);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.player-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.player-artist {
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--player-fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-location {
  color: var(--player-muted);
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.player-controls button {
  background: transparent;
  border: 1px solid var(--player-line);
  color: var(--player-fg);
  font-family: var(--mono);
  font-size: 0.8125rem;
  padding: 8px 14px;
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.12s ease, border-color 0.12s ease;
  min-width: 44px;
}

.player-controls button:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
}

.player-controls button:focus-visible {
  outline: 1px solid var(--player-fg);
  outline-offset: 2px;
}

#playpause {
  min-width: 64px;
}

.player-progress {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--player-muted);
}

#progress {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  width: 100%;
  cursor: pointer;
  height: 18px;
}

#progress::-webkit-slider-runnable-track {
  height: 2px;
  background: var(--player-line);
  border-radius: 1px;
}

#progress::-moz-range-track {
  height: 2px;
  background: var(--player-line);
  border-radius: 1px;
}

#progress::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--player-fg);
  margin-top: -5px;
  border: none;
}

#progress::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--player-fg);
  border: none;
}

@media (max-width: 720px) {
  body { padding-bottom: 92px; }

  header { padding: 56px 24px 32px; }
  h1 { font-size: clamp(2.25rem, 12vw, 3.5rem); }
  .meta { margin-top: 20px; }
  main { padding: 4px 24px 24px; }

  /* Compact 2-row player: progress strip on top, info | controls below */
  .player {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    grid-template-areas:
      "progress progress"
      "info     controls";
    gap: 0;
    padding: 0;
    align-items: stretch;
  }

  .player-progress {
    grid-area: progress;
    display: block;
    height: 14px;
    padding: 0;
  }
  .player-progress .time-current,
  .player-progress .time-total { display: none; }
  #progress {
    width: 100%;
    height: 14px;
    margin: 0;
    display: block;
  }
  /* Slim 2px track centered inside the 14px input box */
  #progress::-webkit-slider-runnable-track { height: 2px; border-radius: 0; }
  #progress::-moz-range-track { height: 2px; border-radius: 0; }
  /* Hide the thumb on mobile — track + filled portion give enough feedback,
     and no thumb means no visual bleed above the player edge */
  #progress::-webkit-slider-thumb { width: 0; height: 0; opacity: 0; -webkit-appearance: none; appearance: none; }
  #progress::-moz-range-thumb { width: 0; height: 0; opacity: 0; border: 0; }

  .player-track {
    grid-area: info;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    padding: 10px 8px 12px 20px;
    min-width: 0;
  }
  .player-year { font-size: 0.7rem; opacity: 0.7; }
  .player-artist { font-size: 0.95rem; line-height: 1.25; }
  .player-location { font-size: 0.7rem; }

  .player-controls {
    grid-area: controls;
    padding: 8px 16px 10px 4px;
    gap: 6px;
    align-self: center;
  }
  .player-controls button {
    padding: 8px 10px;
    min-width: 40px;
    font-size: 0.75rem;
  }
  #playpause { min-width: 56px; }
}
