:root {
  color-scheme: dark;
  --bg: #0b0d10;
  --bg-glow: #18251a;
  --surface: #14181f;
  --surface-raised: #1a2028;
  --text: #f4f5ef;
  --muted: #929a91;
  --border: #2a3139;
  --accent: #c6f75f;
  --accent-ink: #151b0d;
  --accent-soft: rgba(198, 247, 95, 0.12);
  --shadow: rgba(0, 0, 0, 0.38);
  --focus: #dfff9d;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f1eb;
  --bg-glow: #dce8ce;
  --surface: #ffffff;
  --surface-raised: #f7f7f2;
  --text: #161914;
  --muted: #687064;
  --border: #d8dcd3;
  --accent: #4f7300;
  --accent-ink: #ffffff;
  --accent-soft: rgba(79, 115, 0, 0.1);
  --shadow: rgba(45, 53, 40, 0.14);
  --focus: #315500;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -10%, var(--bg-glow) 0, transparent 38rem),
    var(--bg);
  transition: background-color 180ms ease, color 180ms ease;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.site-shell {
  width: min(100% - 32px, 720px);
  min-height: 100vh;
  margin-inline: auto;
  padding: 64px 0 32px;
}

.site-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 34px;
}

.logo-frame {
  width: 104px;
  aspect-ratio: 1;
  margin-bottom: 26px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 8px 8px 0 var(--accent);
}

.logo-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

.eyebrow,
.label,
.album-meta,
.playlist-heading span,
footer p {
  margin: 0;
  color: var(--muted);
}

.eyebrow,
.label,
.playlist-heading span {
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  margin: 7px 0 8px;
  font-size: clamp(2.15rem, 8vw, 3.65rem);
  line-height: 1;
  letter-spacing: -0.055em;
}

.album-meta {
  font-size: 0.9rem;
}

.album-meta span {
  margin-inline: 0.3rem;
  color: var(--accent);
}

.player,
.playlist-section,
.credits-section {
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border: 1px solid var(--border);
  box-shadow: 0 24px 70px var(--shadow);
}

.player {
  position: relative;
  padding: clamp(22px, 5vw, 34px);
  border-radius: 22px 22px 8px 8px;
}

.js audio {
  display: none;
}

audio {
  width: 100%;
  margin-bottom: 20px;
}

.now-playing {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
}

.now-playing__number {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.now-playing__copy {
  min-width: 0;
}

.now-playing h2 {
  margin: 4px 0 0;
  overflow: hidden;
  font-size: clamp(1.3rem, 5vw, 1.75rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.now-playing__meta {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 22px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
}

.now-playing__meta a {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: 0.76rem;
  text-decoration: none;
}

.now-playing__meta a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.sound-bars {
  display: flex;
  align-items: end;
  gap: 3px;
  width: 27px;
  height: 25px;
  opacity: 0.28;
}

.sound-bars span {
  width: 4px;
  height: 25%;
  background: var(--accent);
  border-radius: 3px;
}

.sound-bars span:nth-child(2) { height: 70%; }
.sound-bars span:nth-child(3) { height: 100%; }
.sound-bars span:nth-child(4) { height: 48%; }

.is-playing .sound-bars {
  opacity: 1;
}

.is-playing .sound-bars span {
  animation: pulse-bar 650ms ease-in-out infinite alternate;
}

.is-playing .sound-bars span:nth-child(2) { animation-delay: -300ms; }
.is-playing .sound-bars span:nth-child(3) { animation-delay: -500ms; }
.is-playing .sound-bars span:nth-child(4) { animation-delay: -150ms; }

@keyframes pulse-bar {
  from { height: 20%; }
  to { height: 100%; }
}

.timeline {
  margin-top: 30px;
}

.range {
  width: 100%;
  height: 18px;
  margin: 0;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
}

.range::-webkit-slider-runnable-track {
  height: 5px;
  background: linear-gradient(to right, var(--accent) 0 var(--range-fill, 0%), var(--border) var(--range-fill, 0%) 100%);
  border-radius: 10px;
}

.range::-moz-range-track {
  height: 5px;
  background: var(--border);
  border-radius: 10px;
}

.range::-moz-range-progress {
  height: 5px;
  background: var(--accent);
  border-radius: 10px;
}

.range::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  margin-top: -5.5px;
  appearance: none;
  -webkit-appearance: none;
  background: var(--text);
  border: 3px solid var(--surface);
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--border);
}

.range::-moz-range-thumb {
  width: 11px;
  height: 11px;
  background: var(--text);
  border: 3px solid var(--surface);
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--border);
}

.time-row {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.transport {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 3vw, 18px);
  margin-top: 22px;
}

.icon-button,
.play-button,
.volume-button,
.theme-toggle {
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.icon-button {
  width: 44px;
  height: 44px;
  background: transparent;
  border-radius: 50%;
  font-size: 1rem;
}

.icon-button:hover,
.volume-button:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.icon-button[aria-pressed="true"] {
  color: var(--accent);
  background: var(--accent-soft);
}

.play-button {
  width: 64px;
  height: 64px;
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 10px 30px var(--accent-soft);
  font-size: 1.25rem;
  transition: transform 150ms ease;
}

.play-button:hover {
  transform: scale(1.06);
}

.play-button:active {
  transform: scale(0.97);
}

.repeat-control {
  position: relative;
}

.repeat-one {
  position: absolute;
  right: 7px;
  bottom: 6px;
  display: none;
  font-size: 0.56rem;
  font-weight: 900;
}

.repeat-control[data-mode="one"] .repeat-one {
  display: block;
}

.volume-control {
  display: flex;
  align-items: center;
  width: min(100%, 190px);
  gap: 8px;
  margin: 21px auto 0;
}

.volume-button {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  color: var(--muted);
  background: transparent;
  border-radius: 50%;
}

.range--volume {
  --range-fill: 80%;
}

.player-status {
  min-height: 1em;
  margin: 12px 0 -8px;
  color: #ef7979;
  font-size: 0.8rem;
  text-align: center;
}

.playlist-section {
  margin-top: 14px;
  padding: clamp(20px, 5vw, 30px);
  border-radius: 8px 8px 22px 22px;
}

.credits-section {
  margin-top: 14px;
  padding: clamp(24px, 6vw, 38px);
  border-radius: 8px 8px 22px 22px;
}

.credits-section > h2 {
  margin: 7px 0 10px;
  font-size: clamp(1.55rem, 5vw, 2.1rem);
  letter-spacing: -0.035em;
}

.credits-intro {
  max-width: 580px;
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.65;
}

.credit-callout {
  display: block;
  margin: 24px 0;
  padding: 18px 20px;
  color: inherit;
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  border-radius: 4px 12px 12px 4px;
  text-decoration: none;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.credit-callout:hover {
  background: color-mix(in srgb, var(--accent-soft) 78%, var(--surface));
  border-color: var(--accent);
}

.credit-callout p:last-child {
  margin: 7px 0 0;
  font-size: 0.92rem;
  font-weight: 650;
  line-height: 1.5;
}

.credits-links a {
  color: var(--text);
  text-decoration-color: transparent;
  text-underline-offset: 3px;
}

.credits-links a:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

.credits-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin-top: 24px;
}

.credits-links a {
  font-size: 0.78rem;
  font-weight: 750;
}

.playlist-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}

.playlist-heading h2 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.playlist {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.track-button {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  min-height: 54px;
  gap: 10px;
  padding: 7px 12px;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
}

.track-button:hover {
  background: var(--surface-raised);
}

.track-button[aria-current="true"] {
  color: var(--accent);
  background: var(--accent-soft);
}

.track-number,
.track-duration {
  color: var(--muted);
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
}

.track-button[aria-current="true"] .track-number,
.track-button[aria-current="true"] .track-duration {
  color: inherit;
}

.track-title {
  overflow: hidden;
  font-size: 0.94rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theme-toggle {
  position: fixed;
  z-index: 10;
  top: max(18px, env(safe-area-inset-top));
  right: max(18px, env(safe-area-inset-right));
  width: 44px;
  height: 44px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  box-shadow: 0 8px 30px var(--shadow);
}

.theme-toggle:hover {
  border-color: var(--accent);
}

.theme-toggle__sun,
:root[data-theme="light"] .theme-toggle__moon {
  display: none;
}

:root[data-theme="light"] .theme-toggle__sun {
  display: inline;
}

.noscript-message,
footer {
  color: var(--muted);
  text-align: center;
}

footer {
  padding-top: 28px;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 520px) {
  .site-shell {
    width: min(100% - 20px, 720px);
    padding-top: 52px;
  }

  .theme-toggle {
    position: absolute;
    width: 40px;
    height: 40px;
  }

  .logo-frame {
    width: 86px;
    margin-bottom: 23px;
    box-shadow: 6px 6px 0 var(--accent);
  }

  .site-header {
    margin-bottom: 26px;
  }

  .utility-control {
    width: 36px;
  }

  .playlist-section {
    padding-inline: 12px;
  }

}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
