:root {
  color-scheme: light;
  --paper: oklch(95.5% 0.018 82);
  --paper-raised: oklch(98.2% 0.012 84);
  --ink: oklch(24% 0.025 39);
  --ink-muted: oklch(48% 0.03 49);
  --line: oklch(83% 0.025 73);
  --accent: oklch(55% 0.18 31);
  --accent-deep: oklch(39% 0.14 28);
  --label: oklch(78% 0.13 68);
  --shadow: 0 18px 45px oklch(42% 0.05 50 / 0.12);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  min-width: 18rem;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    linear-gradient(90deg, transparent 0 49.8%, oklch(89% 0.025 75 / 0.42) 50%, transparent 50.2%) 50% 0 / 2.5rem 100%,
    var(--paper);
  font-family: "Avenir Next", Avenir, "Trebuchet MS", sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  font-kerning: normal;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

button,
input {
  font: inherit;
}

button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}

button:focus,
a:focus,
input:focus {
  outline: none;
}

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

.skip-link {
  position: fixed;
  z-index: 10;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.65rem 0.9rem;
  color: var(--paper-raised);
  background: var(--ink);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4.5rem;
  padding: 1rem clamp(1.25rem, 5vw, 4rem);
  border-bottom: 1px solid var(--line);
}

.station-mark {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  gap: 0.65rem;
  color: var(--ink);
  font-weight: 750;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.station-dot {
  display: block;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0.28rem oklch(55% 0.18 31 / 0.14);
}

.masthead p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.shell {
  width: min(100%, 78rem);
  margin-inline: auto;
}

.now-playing {
  padding: clamp(2rem, 8vw, 5.5rem) clamp(1.25rem, 6vw, 5rem) 2.5rem;
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--accent-deep);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.record-stage {
  position: relative;
  display: grid;
  width: min(74vw, 18rem);
  margin: 0 auto clamp(2rem, 7vw, 3.5rem);
  place-items: center;
}

.record {
  position: relative;
  display: grid;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 50%;
  background: oklch(25% 0.025 36);
  box-shadow: var(--shadow);
  place-items: center;
  transition: filter 300ms var(--ease-out);
}

.record::before,
.record-grooves {
  position: absolute;
  border: 1px solid oklch(60% 0.02 40 / 0.27);
  border-radius: 50%;
  content: "";
  inset: 6%;
}

.record-grooves {
  inset: 14%;
  box-shadow:
    0 0 0 0.45rem oklch(57% 0.03 40 / 0.13),
    0 0 0 0.9rem oklch(57% 0.03 40 / 0.1),
    0 0 0 1.35rem oklch(57% 0.03 40 / 0.1),
    0 0 0 1.8rem oklch(57% 0.03 40 / 0.08);
}

.record-label {
  position: relative;
  z-index: 1;
  display: grid;
  width: 34%;
  aspect-ratio: 1;
  padding: 16%;
  border-radius: 50%;
  background: var(--label);
  color: var(--accent-deep);
  font-size: clamp(0.9rem, 4vw, 1.15rem);
  font-weight: 850;
  place-content: center;
  place-items: center;
}

.record-label i {
  width: 0.34rem;
  height: 0.34rem;
  margin-block: 0.2rem;
  border-radius: 50%;
  background: var(--ink);
}

.record-label small {
  font-size: 0.54rem;
  letter-spacing: 0.12em;
}

.record.is-playing {
  animation: spin 8s linear infinite;
}

.record.is-loading {
  filter: sepia(0.45) opacity(0.75);
}

.needle {
  position: absolute;
  z-index: 2;
  top: -5%;
  right: -4%;
  width: 38%;
  height: 47%;
  border-top: 0.46rem solid var(--accent-deep);
  border-right: 0.46rem solid var(--accent-deep);
  border-radius: 0 1rem 0 0;
  transform: rotate(-17deg);
  transform-origin: 100% 0;
  transition: transform 500ms var(--ease-out);
}

.needle span {
  position: absolute;
  right: -0.7rem;
  top: -0.9rem;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--accent-deep);
}

.needle.is-playing {
  transform: rotate(0deg);
}

.track-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.track-heading h1 {
  max-width: 18ch;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.05rem, 9vw, 4.65rem);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.track-heading p {
  margin: 0.75rem 0 0;
  color: var(--ink-muted);
  font-size: 0.875rem;
}

.published-badge {
  flex: 0 0 auto;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--accent);
  border-radius: 99rem;
  color: var(--accent-deep);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.04em;
}

.style-line {
  display: -webkit-box;
  max-width: 58ch;
  margin: 1.5rem 0 2rem;
  overflow: hidden;
  color: var(--ink-muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  font-style: italic;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.timeline {
  margin-top: 1.5rem;
}

input[type="range"] {
  width: 100%;
  height: 2.75rem;
  margin: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 0.2rem;
  border-radius: 1rem;
  background: linear-gradient(to right, var(--accent) var(--progress, 0%), var(--line) var(--progress, 0%));
}

input[type="range"]::-webkit-slider-thumb {
  width: 1.1rem;
  height: 1.1rem;
  margin-top: -0.45rem;
  appearance: none;
  border: 0;
  border-radius: 50%;
  background: var(--accent-deep);
}

input[type="range"]::-moz-range-track {
  height: 0.2rem;
  border-radius: 1rem;
  background: var(--line);
}

input[type="range"]::-moz-range-progress {
  height: 0.2rem;
  border-radius: 1rem;
  background: var(--accent);
}

input[type="range"]::-moz-range-thumb {
  width: 1.1rem;
  height: 1.1rem;
  border: 0;
  border-radius: 50%;
  background: var(--accent-deep);
}

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

.transport {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1rem, 7vw, 2rem);
  margin-top: 1.25rem;
}

.icon-button,
.play-button {
  display: grid;
  min-width: 3rem;
  min-height: 3rem;
  border: 0;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  place-items: center;
  transition: transform 120ms var(--ease-out), color 120ms var(--ease-out);
}

.icon-button svg {
  width: 1.6rem;
  fill: currentColor;
}

.play-button {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  color: var(--paper-raised);
  background: var(--accent-deep);
}

.play-button svg {
  width: 1.9rem;
  fill: currentColor;
}

.play-button .play-icon {
  transform: translateX(0.12rem);
}

.icon-button:active,
.play-button:active {
  transform: scale(0.93);
}

.icon-button:disabled,
.play-button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.player-status {
  min-height: 1.5rem;
  margin: 0.75rem 0 0;
  color: var(--accent-deep);
  font-size: 0.8rem;
  text-align: center;
}

.collection {
  min-width: 0;
  border-top: 1px solid var(--line);
}

.tabs {
  display: flex;
  position: sticky;
  z-index: 3;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.tabs button {
  position: relative;
  flex: 1;
  min-height: 3.5rem;
  border: 0;
  color: var(--ink-muted);
  background: transparent;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.tabs button[aria-selected="true"] {
  color: var(--ink);
}

.tabs button[aria-selected="true"]::after {
  position: absolute;
  right: 25%;
  bottom: -1px;
  left: 25%;
  height: 0.18rem;
  background: var(--accent);
  content: "";
}

.panel {
  padding: 1.25rem;
}

.track-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.track-item {
  border-bottom: 1px solid var(--line);
}

.track-item:first-child {
  border-top: 1px solid var(--line);
}

.track-select {
  display: grid;
  width: 100%;
  min-height: 4.75rem;
  padding: 0.75rem 0;
  border: 0;
  grid-template-columns: 2.2rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.track-number {
  color: var(--ink-muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

.track-copy {
  min-width: 0;
}

.track-copy strong,
.track-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-copy strong {
  font-size: 0.95rem;
  letter-spacing: -0.015em;
}

.track-copy small {
  margin-top: 0.18rem;
  color: var(--ink-muted);
  font-size: 0.75rem;
}

.track-state {
  min-width: 2.5rem;
  color: var(--accent-deep);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-align: right;
  text-transform: uppercase;
}

.track-item.is-current .track-select {
  color: var(--accent-deep);
}

.track-item.is-current .track-number::before {
  content: "●";
}

.track-item.is-current .track-number span {
  display: none;
}

.lyrics-panel header {
  padding: 1rem 0 1.5rem;
  border-bottom: 1px solid var(--line);
}

.lyrics-panel h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 7vw, 2.8rem);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1;
}

.lyrics-panel a {
  display: inline-block;
  min-height: 2.75rem;
  margin-top: 0.75rem;
  color: var(--accent-deep);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 2.75rem;
}

.lyrics {
  display: grid;
  max-width: 38rem;
  gap: 1.5rem;
  padding: 2rem 0 4rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.02rem, 4.5vw, 1.2rem);
  line-height: 1.8;
}

.lyrics p {
  margin: 0;
  white-space: pre-line;
}

.lyrics .section-label {
  margin-bottom: -0.85rem;
  color: var(--accent-deep);
  font-family: "Avenir Next", Avenir, "Trebuchet MS", sans-serif;
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.empty-state {
  padding: 4rem 1rem;
  text-align: center;
}

.empty-state h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
}

.empty-state p {
  color: var(--ink-muted);
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem clamp(1.25rem, 5vw, 4rem);
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(1px, 1px, 1px, 1px) !important;
  white-space: nowrap !important;
}

[hidden] {
  display: none !important;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (hover: hover) {
  .icon-button:hover {
    color: var(--accent);
  }

  .play-button:hover {
    background: var(--accent);
    transform: translateY(-2px);
  }

  .track-select:hover {
    color: var(--accent-deep);
  }
}

@media (min-width: 50rem) {
  .shell {
    display: grid;
    min-height: calc(100svh - 4.5rem);
    grid-template-columns: minmax(25rem, 0.88fr) minmax(28rem, 1.12fr);
  }

  .now-playing {
    position: sticky;
    top: 0;
    align-self: start;
    min-height: calc(100svh - 4.5rem);
    padding-inline: clamp(2.5rem, 6vw, 5rem);
  }

  .record-stage {
    width: min(24vw, 16rem);
    margin-bottom: 2.75rem;
  }

  .collection {
    min-height: calc(100svh - 4.5rem);
    border-top: 0;
    border-left: 1px solid var(--line);
    background: var(--paper-raised);
  }

  .tabs {
    background: var(--paper-raised);
  }

  .panel {
    padding: 2rem clamp(2rem, 5vw, 4rem);
  }
}

@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;
  }
}
