:root {
  --font-display: "Rufina", Georgia, serif;
  --font-body: "Work Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: "Cinzel", "Rufina", Georgia, serif;
  --font-mono: "JetBrains Mono", "SF Mono", Consolas, monospace;

  --radius: 10px;
  --border-hair: 1px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="dark"] {
  --bg: #0d0e0f;
  --bg-elevated: #17181a;
  --card-bg: #16171a;
  --card-border: #2a2b2e;
  --header-border: #232426;

  --text: #ede8e0;
  --text-muted: #8a8680;
  --text-faint: #57544f;

  --accent: #c08a3e;
  --accent-strong: #d9a352;
  --now-playing: #6f9184;
  --cover-bg: #121417;

  --shadow: 0 12px 30px -14px rgba(0, 0, 0, 0.6);
}

[data-theme="light"] {
  --bg: #f3efe6;
  --bg-elevated: #ffffff;
  --card-bg: #fbf9f4;
  --card-border: #e2dccc;
  --header-border: #e2dccc;

  --text: #201d18;
  --text-muted: #6b6558;
  --text-faint: #a49c8a;

  --accent: #a86c26;
  --accent-strong: #8f5a1d;
  --now-playing: #4c6c5e;
  --cover-bg: #fbf9f4;

  --shadow: 0 12px 24px -16px rgba(32, 29, 24, 0.18);
}

* {
  box-sizing: border-box;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  transition:
    background-color 0.35s var(--ease),
    color 0.35s var(--ease);
  min-height: 100vh;
}

a {
  color: inherit;
}

/* ---------------- Header ---------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  backdrop-filter: blur(6px);
  border-bottom: var(--border-hair) solid var(--header-border);
  transition:
    border-color 0.35s var(--ease),
    background-color 0.35s var(--ease);
}

.site-header__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 18px clamp(20px, 4vw, 48px);
}

.header-spacer {
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  min-width: 0;
}

.brand-logo {
  height: 56px;
  width: auto;
  flex-shrink: 0;
  object-fit: contain;
  transition: filter 0.35s var(--ease);
}

[data-theme="light"] .brand-logo {
  filter: invert(1);
}

.theme-toggle {
  justify-self: end;
}

.theme-toggle {
  background: none;
  border: var(--border-hair) solid var(--card-border);
  border-radius: 100px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--text-muted);
  transition:
    color 0.25s var(--ease),
    border-color 0.25s var(--ease),
    transform 0.2s var(--ease);
}

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

.theme-toggle:active {
  transform: scale(0.92);
}

@media (max-width: 640px) {
  .site-header__inner {
    padding: 14px 16px;
  }

  .brand-logo {
    height: 36px;
  }
}

.theme-toggle .icon {
  width: 18px;
  height: 18px;
}

.icon-sun {
  display: none;
}

.icon-moon {
  display: block;
}

[data-theme="light"] .icon-sun {
  display: block;
}

[data-theme="light"] .icon-moon {
  display: none;
}

/* ---------------- Layout ---------------- */

.wrap {
  max-width: 1400px;
  margin: 0 auto;
  padding: clamp(28px, 4vw, 56px) clamp(20px, 4vw, 48px) 80px;
}

.intro {
  position: relative;
  width: 100%;
  margin-bottom: clamp(28px, 3vw, 48px);
  padding: 28px 24px 24px 26px;
  background: linear-gradient(160deg, 
    color-mix(in srgb, var(--bg-elevated) 92%, white 3%) 0%, 
    var(--bg-elevated) 55%, 
    color-mix(in srgb, var(--bg-elevated) 96%, black 6%) 100%
  );
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.intro::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg,
    transparent 0%,
    var(--accent) 35%,
    color-mix(in srgb, var(--accent) 80%, white 20%) 50%,
    var(--accent) 65%,
    transparent 100%
  );
}

.intro h2 {
  margin: 0 0 16px;
  font-family: var(--font-heading);
  font-size: clamp(1.1rem, 1.5vw, 1.5rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.3;
}

.intro p {
  margin: 0 0 12px;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-muted);
}

.intro p:last-child {
  margin-bottom: 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: clamp(18px, 2.4vw, 28px);
}

@media (max-width: 480px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

.empty-state {
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
  padding: 60px 0;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 22px 24px;
  margin-top: 32px;
  background: var(--bg-elevated);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
}

.social-links p {
  margin: 0;
  font-size: 0.92rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.social-links ul {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  text-decoration: none;
  transition:
    transform 0.2s var(--ease),
    background-color 0.2s var(--ease),
    border-color 0.2s var(--ease);
  border: 1px solid transparent;
}

.social-links a:hover,
.social-links a:focus-visible {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent);
}

.social-links svg {
  width: 18px;
  height: 18px;
}

.copyright {
  margin-top: 18px;
  text-align: center;
  color: var(--text-faint);
  font-size: 0.92rem;
  letter-spacing: 0.04em;
}

.copyright p {
  margin: 0;
}

.empty-state code {
  font-family: var(--font-mono);
  background: var(--bg-elevated);
  padding: 2px 6px;
  border-radius: 4px;
}

/* ---------------- Card ---------------- */

.card {
  background: var(--card-bg);
  border: var(--border-hair) solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 430px;
  box-shadow: var(--shadow);
  transition:
    border-color 0.3s var(--ease),
    transform 0.3s var(--ease),
    background-color 0.35s var(--ease);
}

@media (hover: hover) and (pointer: fine) {
  .card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
  }
}

.card.is-playing {
  border-color: var(--now-playing);
  box-shadow:
    var(--shadow),
    0 0 0 1px color-mix(in srgb, var(--vinyl-color, var(--now-playing)) 40%, transparent),
    0 0 32px -8px color-mix(in srgb, var(--vinyl-color, var(--now-playing)) 55%, transparent);
}

.cover-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
  width: 100%;
  overflow: hidden;
  background: var(--card-bg);
  display: grid;
  place-items: center;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.cover-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 58% 46% at 50% 56%, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.28) 40%, transparent 68%);
  opacity: 0;
  transition: opacity 0.25s var(--ease);
  z-index: 1;
  pointer-events: none;
}

.card.is-playing .cover-wrap::before {
  opacity: 1;
}

.cover-wrap::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8%;
  height: 8%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #090909;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  opacity: 0;
  transition: opacity 0.25s var(--ease);
  z-index: 5;
  pointer-events: none;
}

.record {
  position: absolute;
  inset: 7%;
  border-radius: 50%;
  isolation: isolate;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2), inset 0 0 18px rgba(0, 0, 0, 0.5), 0 3px 8px -3px rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity 0.25s var(--ease);
  z-index: 2;
  pointer-events: none;
  transform-origin: center center;
}

.record::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: url('assets/images/vinyl-black-template.png') center / cover no-repeat;
}

.record::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--vinyl-color, #090909);
  mix-blend-mode: color;
}

.cover-wrap .cover-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.94);
  transition: transform 0.6s var(--ease);
  position: relative;
  z-index: 3;
}

.card:hover .cover-wrap .cover-art {
  transform: scale(1.035);
}

.card.is-playing .record {
  opacity: 1;
  /* animation: spin-record 1.8s linear infinite; */
  /*box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.26), inset 0 0 28px rgba(255, 255, 255, 0.06), 0 32px 76px -34px rgba(0, 0, 0, 0.8);*/
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.26), inset 0 0 28px rgba(255, 255, 255, 0.06), 0 3px 8px -3px rgba(0, 0, 0, 0.6);
}

.card.is-playing .cover-wrap::after {
  opacity: 1;
}

/* Lighten the area behind the spinning record so it separates from the dark cover background */
.card.is-playing .cover-wrap {
  background: var(--card-bg);
  box-shadow: none;
}

.vinyl-sheen {
  position: absolute;
  inset: 7%;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 26%, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0.05) 14%, transparent 26%);
  opacity: 0;
  transition: opacity 0.25s var(--ease);
  z-index: 4;
  pointer-events: none;
}

.card.is-playing .vinyl-sheen {
  opacity: 1;
}

/* Ensure both themes use the same solid background with no vignette */
[data-theme="dark"] .card.is-playing .cover-wrap,
[data-theme="light"] .card.is-playing .cover-wrap {
  background: var(--card-bg);
  box-shadow: none;
}

/* Subtle override for light theme: reduce highlight and shadows so artwork isn't overlit */
[data-theme="light"] .card.is-playing .cover-wrap {
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 10%, transparent 28%), var(--cover-bg);
}

.card.is-playing .cover-wrap .cover-art {
  transform: translateX(-100%);
}

.cover-label {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 36%;
  max-width: 180px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 50%;
  clip-path: circle(50% at center);
  transform: translate(-50%, -50%) scale(0.98);
  opacity: 0;
  z-index: 3;
  pointer-events: none;
  filter: saturate(1.25) contrast(1.15) brightness(1.05);
  transition: opacity 0.2s var(--ease);
}

.card.is-playing .cover-label {
  opacity: 1;
  transition: opacity 0.25s var(--ease);
  animation: spin-cover 1.8s linear infinite;
}

@keyframes spin-cover {
  from {
    transform: translate(-50%, -50%) scale(0.98) rotate(0deg);
  }

  to {
    transform: translate(-50%, -50%) scale(0.98) rotate(360deg);
  }
}

@keyframes spin-record {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.info-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 126px;
  height: 126px;
  overflow: hidden;
  justify-content: flex-start;
}

.info-static {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  flex-shrink: 0;
}

.lyrics-container {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0px 0 0;
  padding: 10px 12px;
  min-height: 50px;
  height: 50px;
  flex-shrink: 0;
  box-sizing: border-box;
  background: linear-gradient(160deg,
    color-mix(in srgb, var(--bg-elevated) 92%, white 3%) 0%,
    var(--bg-elevated) 55%,
    color-mix(in srgb, var(--bg-elevated) 96%, black 6%) 100%
  );
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: opacity 0.3s var(--ease), visibility 0.3s var(--ease), transform 0.2s var(--ease);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}


.lyrics-container.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.lyrics-container.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: none;
}

.lyrics-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  opacity: 0.95;
  flex-shrink: 0;
  animation: none;
  filter: none;
}

.card.is-playing.has-lyrics .lyrics-container {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.card.is-playing.has-lyrics .track-desc {
  opacity: 1;
  height: auto;
  margin: 0;
  overflow: visible;
}

.lyrics-content {
  display: flex;
  align-items: center;
  overflow: hidden;
  min-width: 0;
  flex: 1;
}

.lyric-line {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.35;
  color: var(--text-muted);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  opacity: 0;
  transform: translateX(6px);
  animation: reveal-lyric 0.7s var(--ease) forwards;
  animation-delay: 0.16s;
}

.lyric-line.active {
  color: var(--text);
  font-weight: 600;
  opacity: 1;
}

@keyframes reveal-lyric {
  from {
    opacity: 0;
    transform: translateX(8px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.now-playing-title {
  position: absolute;
  top: 12px;
  left: 14px;
  right: 40px;
  z-index: 6;
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: 0.03em;
  font-size: 19px;
  line-height: 1.3;
  color: #f4f1ea;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transform: translateY(-6px);
  transition:
    opacity 0.35s var(--ease),
    transform 0.35s var(--ease);
  pointer-events: none;
}

.card.is-playing .now-playing-title {
  opacity: 1;
  transform: translateY(0);
}

.playing-dot {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--now-playing);
  opacity: 0;
  transition: opacity 0.25s var(--ease);
  box-shadow: 0 0 0 0 var(--now-playing);
}

.card.is-playing .playing-dot {
  opacity: 1;
  animation: pulse 1.8s ease-out infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--now-playing) 55%, transparent);
  }

  70% {
    box-shadow: 0 0 0 8px transparent;
  }

  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

.card-body {
  padding: 18px 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.track-title {
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: 0.03em;
  font-size: 19px;
  line-height: 1.3;
  margin: 0;
}

.track-desc {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0;
  display: -webkit-box;
  line-clamp: 7;
  -webkit-line-clamp: 7;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.audio-wrap {
  margin-top: auto;
  padding-top: 6px;
}

audio {
  width: 100%;
  height: 34px;
  accent-color: var(--accent);
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.play-btn,
.volume-btn {
  background: none;
  border: none;
  padding: 0;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.play-btn {
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}

.play-btn:hover,
.volume-btn:hover {
  color: var(--accent-strong);
}

.time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  min-width: 32px;
  text-align: center;
  flex-shrink: 0;
}

.seek-bar {
  flex: 1;
  height: 20px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
}

.seek-track {
  position: relative;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: var(--card-border);
}

.seek-fill {
  position: absolute;
  inset: 0;
  width: 0%;
  border-radius: 999px;
  background: var(--vinyl-color, var(--accent));
}

.seek-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--vinyl-color, var(--accent-strong));
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 2px var(--card-bg);
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}

.seek-bar:hover .seek-thumb,
.seek-bar:focus-visible .seek-thumb {
  opacity: 1;
}

.play-btn svg,
.volume-btn svg {
  display: block;
}

.play-btn .icon-pause,
.volume-btn .icon-vol-off {
  display: none;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* Visible keyboard focus */
a:focus-visible,
button:focus-visible,
audio:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}