:root {
  --night: #05080f;
  --navy: #0a1628;
  --slate: #45647c;
  --haze: #8296a4;
  --apricot: #dfa079;
  --gold: #f7d29a;
  --sun: #ffe0b0;
  --teal: #1d4a52;
  --shell: #f4ece2;
  --line: rgba(244, 236, 226, 0.14);
  --display: "Gloock", "Iowan Old Style", Palatino, Georgia, serif;
  --text: "Newsreader", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--night);
  color: var(--shell);
  font-family: var(--text);
  font-size: clamp(16px, 0.55vw + 13px, 19px);
  line-height: 1.55;
  padding-bottom: 6.5rem;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { font-family: inherit; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* ---------- atmosphere ---------- */

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/* banded rather than smooth: night, navy, blue-grey, apricot cloud, gold horizon */
.atmosphere__sky {
  position: absolute;
  inset: 0 0 15% 0;
  background-image: linear-gradient(180deg,
    #05080f 0%,
    #081426 11%,
    #0e2440 23%,
    #1b3d57 35%,
    #3a5c74 46%,
    #6b7f8e 56%,
    #9d8f8b 62%,
    #c99a7c 68%,
    #e5b48a 74%,
    #f7d29a 80%,
    #e2a97c 86%,
    #8d655a 90%,
    #2b3f4a 94%,
    #0d1d26 100%);
  background-size: 100% 150%;
  background-position: 50% 0%;
  animation: drift 110s ease-in-out infinite alternate;
}

@keyframes drift {
  from { background-position: 50% 0%; }
  to   { background-position: 50% 100%; }
}

.atmosphere__sun {
  position: absolute;
  left: 52%;
  bottom: 14%;
  width: min(78vw, 46rem);
  aspect-ratio: 1;
  transform: translate(-50%, 50%);
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(255, 224, 176, 0.95) 0%,
    rgba(240, 191, 142, 0.52) 28%,
    rgba(223, 160, 121, 0.2) 54%,
    rgba(223, 160, 121, 0) 74%);
  filter: blur(5px);
  animation: breathe 19s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { opacity: 0.74; transform: translate(-50%, 50%) scale(1); }
  50%      { opacity: 1;    transform: translate(-50%, 50%) scale(1.06); }
}

.atmosphere__ridge {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14.4%;
  width: 100%;
  height: clamp(5.5rem, 15vh, 11rem);
  display: block;
  fill: #071019;
  opacity: 0.94;
}

.atmosphere__sea {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 15%;
  background: linear-gradient(180deg,
    #2a5560 0%,
    #163844 34%,
    #0b222b 66%,
    #04090d 100%);
}

#glitter {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.atmosphere__veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(5, 8, 15, 0.72) 0%,
    rgba(5, 8, 15, 0.1) 22%,
    rgba(5, 8, 15, 0.32) 56%,
    rgba(5, 8, 15, 0.9) 100%);
}

/* ---------- hero ---------- */

main { position: relative; z-index: 1; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 31rem) minmax(0, 1fr);
  gap: clamp(1.6rem, 4vw, 3.4rem);
  align-items: end;
  max-width: 76rem;
  margin-inline: auto;
  padding: clamp(2.8rem, 8vh, 5.5rem) clamp(1.25rem, 4vw, 3rem) clamp(2.5rem, 7vh, 4.5rem);
}

.sleeve {
  margin: 0;
  position: relative;
  isolation: isolate;
}

.sleeve::after {
  content: "";
  position: absolute;
  inset: -14% -11%;
  z-index: -1;
  background: radial-gradient(58% 58% at 50% 56%, rgba(247, 210, 154, 0.22), rgba(247, 210, 154, 0) 72%);
  filter: blur(28px);
}

.sleeve img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 2px;
  transform: rotate(-1.1deg);
  box-shadow:
    0 2.4rem 5rem -1.4rem rgba(0, 0, 0, 0.9),
    0 0 0 1px rgba(244, 236, 226, 0.1);
}

.hero h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.1rem, 3.9vw, 3.2rem);
  line-height: 1;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}

.hero__lede {
  max-width: 38ch;
  margin: 1rem 0 0;
  color: rgba(244, 236, 226, 0.84);
}

.hero__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.2rem;
  margin-top: 1.7rem;
}

.start {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.8rem 1.3rem;
  border: 1px solid rgba(244, 236, 226, 0.42);
  border-radius: 2px;
  background: rgba(244, 236, 226, 0.05);
  color: var(--shell);
  font-size: 0.98rem;
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease;
}

.start:hover {
  background: rgba(244, 236, 226, 0.14);
  border-color: rgba(244, 236, 226, 0.9);
}

.start svg { width: 10px; height: 10px; fill: currentColor; }

.hero__meta {
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  color: rgba(244, 236, 226, 0.55);
}

/* ---------- tracklist ---------- */

.mixtape {
  max-width: 76rem;
  margin-inline: auto;
  padding: 0 clamp(1.25rem, 4vw, 3rem) 5rem;
}

.mixtape h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.4rem, 2.2vw, 1.9rem);
  margin: 0 0 1rem;
}

.tracks {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

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

.track__row {
  display: grid;
  grid-template-columns: 2.9rem minmax(0, 1fr) 7rem 3.4rem;
  gap: 1rem;
  align-items: baseline;
  width: 100%;
  padding: 0.95rem 0.7rem 0.95rem 0.85rem;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.track__row:hover { background: rgba(244, 236, 226, 0.045); }

.track__no {
  position: relative;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
  color: rgba(244, 236, 226, 0.42);
  transition: color 0.3s ease;
}

.track__no .num { transition: opacity 0.2s ease; }

.glyph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center start;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.glyph svg { width: 9px; height: 9px; fill: currentColor; }

.track__row:hover .num { opacity: 0; }
.track__row:hover .glyph--play { opacity: 1; }
.track.is-playing .num { opacity: 0; }
.track.is-playing .glyph--play { opacity: 0; }
.track.is-playing .glyph--pause { opacity: 1; }

.track__name {
  font-size: 1.06rem;
  line-height: 1.25;
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

.track__name em {
  display: block;
  margin-top: 0.16rem;
  font-style: normal;
  font-size: 0.86rem;
  color: rgba(244, 236, 226, 0.55);
  transition: color 0.3s ease;
}

.track__kind {
  font-size: 0.8rem;
  font-style: italic;
  color: rgba(244, 236, 226, 0.4);
  text-align: right;
}

.track__dur {
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  color: rgba(244, 236, 226, 0.6);
  text-align: right;
  transition: color 0.3s ease;
}

/* the record that is playing right now */
.track.is-playing .track__row {
  background: linear-gradient(90deg,
    rgba(247, 210, 154, 0.16) 0%,
    rgba(247, 210, 154, 0.05) 58%,
    rgba(247, 210, 154, 0) 100%);
  box-shadow: inset 2px 0 0 0 var(--gold);
}

.track.is-playing .track__name {
  color: var(--gold);
  text-shadow: 0 0 22px rgba(247, 210, 154, 0.45);
}

.track.is-playing .track__no { color: var(--gold); }
.track.is-playing .track__dur { color: rgba(247, 210, 154, 0.85); }
.track.is-playing .track__name em { color: rgba(247, 210, 154, 0.7); }

/* ---------- footer ---------- */

.foot {
  max-width: 76rem;
  margin-inline: auto;
  padding: 0 clamp(1.25rem, 4vw, 3rem) 3rem;
  border-top: 1px solid var(--line);
}

.foot p {
  max-width: 62ch;
  margin: 1.6rem 0 0;
  font-size: 0.88rem;
  line-height: 1.6;
  color: rgba(244, 236, 226, 0.5);
}

.foot code {
  font-family: var(--text);
  font-style: italic;
  color: rgba(244, 236, 226, 0.72);
}

/* ---------- player ---------- */

.player {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.9rem 1.1rem;
  padding: 0.78rem clamp(0.9rem, 3vw, 1.7rem);
  background: rgba(5, 8, 15, 0.84);
  -webkit-backdrop-filter: blur(20px) saturate(1.15);
  backdrop-filter: blur(20px) saturate(1.15);
  border-top: 1px solid rgba(244, 236, 226, 0.16);
  transform: translateY(115%);
  transition: transform 0.55s cubic-bezier(0.2, 0.75, 0.2, 1);
}

.player.is-on { transform: none; }

.player__art img {
  display: block;
  width: 3rem;
  height: 3rem;
  object-fit: cover;
  border-radius: 2px;
}

.player__now { min-width: 0; }

.player__title {
  margin: 0;
  font-size: 0.98rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player__artist {
  margin: 0.08rem 0 0;
  font-size: 0.82rem;
  color: rgba(244, 236, 226, 0.58);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player__seek {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 0.45rem;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 2px;
  border-radius: 2px;
  background: rgba(244, 236, 226, 0.22);
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 11px;
  height: 11px;
  border: 0;
  border-radius: 50%;
  background: var(--shell);
}

input[type="range"]::-moz-range-thumb {
  width: 11px;
  height: 11px;
  border: 0;
  border-radius: 50%;
  background: var(--shell);
}

.player__time {
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: rgba(244, 236, 226, 0.55);
  white-space: nowrap;
}

.player__controls {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.ctl {
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border: 0;
  border-radius: 50%;
  background: none;
  color: rgba(244, 236, 226, 0.75);
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.ctl:hover {
  color: var(--shell);
  background: rgba(244, 236, 226, 0.09);
}

.ctl svg { width: 13px; height: 13px; fill: currentColor; }

.ctl--main {
  width: 2.8rem;
  height: 2.8rem;
  border: 1px solid rgba(244, 236, 226, 0.4);
}

/* ---------- responsive ---------- */

@media (max-width: 46rem) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.8rem;
    align-items: start;
  }

  .sleeve { max-width: 16rem; }

  .hero__lede { max-width: 40ch; }

  .track__row { grid-template-columns: 2.4rem minmax(0, 1fr) 3.2rem; }

  .track__kind { display: none; }

  .player { grid-template-columns: 2.4rem minmax(0, 1fr) auto; }

  .player__art img { width: 2.4rem; height: 2.4rem; }

  .player__time { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
