:root {
  color-scheme: dark;
  font-family: "DM Sans", sans-serif;
  --parchment: #f1d6a2;
  --brick: #b83c2f;
  --ink: #123d35;
  --indigo: #315e70;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; }
body { margin: 0; min-width: 320px; background: var(--ink); color: var(--parchment); }
button, a { font: inherit; }
a { color: inherit; }

.experience {
  height: 100dvh;
  min-height: 100svh;
  max-height: 100dvh;
  isolation: isolate;
  overflow: hidden;
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: clamp(1.25rem, 2.7vw, 2.5rem);
}

.experience::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: .065;
  mix-blend-mode: soft-light;
  background: url("assets/film-grain.png") repeat;
}

.hero-art, .scrim { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-art { z-index: -2; }
.hero-art img { width: 100%; height: 100%; object-fit: cover; object-position: center; background: var(--ink); }
.scrim {
  z-index: -1;
  background: linear-gradient(180deg, rgba(8,42,37,.42), rgba(8,42,37,.02) 32%, rgba(8,42,37,.12) 68%, rgba(8,35,31,.58));
}

.topbar {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: .1rem 0;
  font-size: clamp(.8rem, 1.1vw, 1rem);
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--parchment);
  text-shadow: 0 2px 14px rgba(8,42,37,.8);
}

#clock { font-variant-numeric: tabular-nums; }
.clock-colon { display: inline-block; width: .3em; text-align: center; animation: colon-blink 1s steps(1, end) infinite; }
@keyframes colon-blink { 50% { opacity: .16; } }

.listeners { margin: 0; display: flex; align-items: center; gap: .48rem; }
.live-dot { position: relative; width: .62rem; height: .62rem; border-radius: 50%; background: #d9583e; box-shadow: 0 0 12px rgba(217,88,62,.55); }
.live-dot::after { content: ""; position: absolute; inset: -5px; border: 1px solid rgba(217,88,62,.65); border-radius: inherit; animation: live-pulse 1.8s cubic-bezier(.2,.8,.2,1) infinite; }
@keyframes live-pulse { 0% { opacity: .9; transform: scale(.55); } 75%, 100% { opacity: 0; transform: scale(1.35); } }
.listeners strong { font-weight: 700; }

nav { display: flex; justify-content: end; }
.spotify-link { display: inline-flex; gap: .42rem; align-items: center; color: var(--parchment); text-decoration: none; transition: color .25s ease, transform .25s ease; }
.spotify-link:hover { color: #fff0c8; transform: translateY(-1px); }
.spotify-logo { width: 1.35rem; height: 1.35rem; }
.spotify-logo circle { fill: currentColor; stroke: none; }
.spotify-logo path { fill: none; stroke: var(--ink); stroke-width: 1.45; stroke-linecap: round; }
.external-icon { width: .8rem; height: .8rem; }

svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.player {
  position: relative;
  z-index: 5;
  grid-row: 3;
  justify-self: center;
  width: min(48%, 720px);
  min-height: 88px;
  padding: 12px 16px 12px 12px;
  display: grid;
  grid-template-columns: 62px minmax(0, .78fr) minmax(120px, 1.22fr) auto;
  gap: clamp(10px, 1.2vw, 16px);
  align-items: center;
  color: var(--parchment);
  background: linear-gradient(100deg, rgba(10,49,43,.82), rgba(91,45,34,.74));
  border: 1px solid rgba(241,214,162,.26);
  border-radius: 999px;
  backdrop-filter: blur(24px) saturate(125%);
  -webkit-backdrop-filter: blur(24px) saturate(125%);
  box-shadow: 0 18px 50px rgba(8,35,31,.38), inset 0 1px rgba(255,240,200,.1);
}
.youtube-player {
  position: fixed;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  left: -9999px;
  top: 0;
}
.cover-disc { position: relative; width: 62px; height: 62px; border-radius: 50%; overflow: hidden; border: 2px solid rgba(241,214,162,.6); box-shadow: 0 5px 16px rgba(8,35,31,.35); animation: vinyl-spin 9s linear infinite; animation-play-state: paused; will-change: transform; }
.player.is-playing .cover-disc { animation-play-state: running; }
.cover-disc::after { content: ""; position: absolute; z-index: 1; inset: 50% auto auto 50%; width: 9px; height: 9px; border: 2px solid rgba(241,214,162,.5); border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 2px rgba(8,35,31,.23); transform: translate(-50%, -50%); }
.cover { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
@keyframes vinyl-spin { to { transform: rotate(360deg); } }
.track-info { min-width: 0; }
.track-info h2 { overflow: hidden; margin: 0; font-size: clamp(.85rem, 1vw, .98rem); line-height: 1.15; letter-spacing: -.025em; text-overflow: ellipsis; white-space: nowrap; }
.track-info > p { overflow: hidden; margin: .22rem 0 0; color: rgba(241,214,162,.78); font-size: .69rem; text-overflow: ellipsis; white-space: nowrap; }
.progress-wrap { min-width: 0; display: grid; grid-template-columns: minmax(90px, 1fr) auto; align-items: center; gap: .65rem; color: rgba(241,214,162,.82); font-size: .62rem; font-variant-numeric: tabular-nums; }
.timecode { white-space: nowrap; }
.progress { position: relative; height: 14px; display: flex; align-items: center; border-radius: 999px; }
.progress::before { content: ""; position: absolute; right: 0; left: 0; height: 2px; background: rgba(241,214,162,.28); border-radius: inherit; }
.progress i { position: absolute; left: 0; width: 0; height: 2px; pointer-events: none; background: var(--parchment); border-radius: inherit; transition: width .25s linear; }
.progress input { position: absolute; inset: 0; width: 100%; height: 14px; margin: 0; cursor: pointer; appearance: none; -webkit-appearance: none; background: transparent; }
.progress input::-webkit-slider-runnable-track { height: 14px; background: transparent; }
.progress input::-webkit-slider-thumb { width: 6px; height: 6px; margin-top: 4px; appearance: none; -webkit-appearance: none; border: 0; border-radius: 50%; background: var(--parchment); opacity: 0; transition: opacity .18s ease, transform .18s ease; }
.progress:hover input::-webkit-slider-thumb, .progress input:focus-visible::-webkit-slider-thumb { opacity: 1; }
.progress input::-moz-range-track { height: 14px; background: transparent; }
.progress input::-moz-range-thumb { width: 6px; height: 6px; border: 0; border-radius: 50%; background: var(--parchment); opacity: 0; }
.progress:hover input::-moz-range-thumb, .progress input:focus-visible::-moz-range-thumb { opacity: 1; }
.progress input:focus-visible { outline: 2px solid var(--parchment); outline-offset: 2px; border-radius: 999px; }
.controls { display: flex; align-items: center; gap: .28rem; }
.icon-button, .play-button { cursor: pointer; border: 0; color: var(--parchment); display: grid; place-items: center; transition: transform .2s ease, color .2s ease, background .2s ease; }
.icon-button { width: 28px; height: 28px; padding: 6px; background: transparent; }
.play-button { width: 46px; height: 46px; border-radius: 50%; background: var(--parchment); color: var(--ink); padding: 13px; box-shadow: 0 6px 18px rgba(8,35,31,.34); }
.player.is-loading .play-button { animation: player-loading .8s ease-in-out infinite alternate; }
@keyframes player-loading { to { opacity: .62; transform: scale(.92); } }
.icon-button:hover, .play-button:hover { transform: translateY(-2px); }
.icon-button:hover { color: #fff0c8; }
.play-button:hover { background: #fff0c8; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--parchment); outline-offset: 4px; }

@media (max-width: 760px) {
  .experience { height: 100dvh; min-height: 100svh; max-height: 100dvh; padding: 1rem; }
  .hero-art img { object-fit: cover; object-position: 48% center; }
  .topbar { grid-template-columns: 1fr auto auto; gap: .65rem; }
  .listeners { justify-self: center; }
  .spotify-link span { display: none; }
  .player { width: min(100%, 620px); grid-template-columns: 48px minmax(0, 1fr) auto; gap: 7px 10px; min-height: 72px; padding: 8px 10px 8px 8px; border-radius: 38px; }
  .cover-disc { width: 48px; height: 48px; }
  .progress-wrap { grid-column: 2 / -1; grid-row: 2; margin-top: -6px; gap: .55rem; }
  .icon-button { display: none; }
  .play-button { width: 42px; height: 42px; padding: 12px; }
}

@media (max-width: 430px) {
  .experience { padding: .8rem; }
  .topbar { font-size: .72rem; }
  .spotify-logo { width: 1.2rem; height: 1.2rem; }
  .track-info h2 { font-size: .86rem; }
  .track-info > p { font-size: .66rem; }
  .progress-wrap { font-size: .62rem; }
  .player { min-height: 68px; padding: 7px 9px 7px 7px; }
  .cover-disc { width: 44px; height: 44px; }
  .play-button { width: 39px; height: 39px; padding: 11px; }
}

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