/* =========================================================
   TORORO MUSIC — Design tokens & signature waveform system
   ========================================================= */

:root {
  --ink: #141414;
  --ink-soft: #1F1F1F;
  --soil: #058F4B;
  --soil-soft: #00BF63;
  --gold: #3DDC84;
  --savanna: #046339;
  --paper: #F7F3EC;
  --paper-dim: #EAE4D6;

  --font-display: "Fraunces", ui-serif, Georgia, serif;
  --font-body: "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "Space Mono", ui-monospace, monospace;
}

body {
  font-family: var(--font-body);
  background: var(--ink);
  color: var(--paper);
}

h1, h2, h3, .font-display {
  font-family: var(--font-display);
}

.font-mono-data {
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

/* ---------------------------------------------------------
   Signature element: the waveform.
   Used as a nav underline, section divider, and reactive
   hero visual — a structural device, not decoration.
   --------------------------------------------------------- */

.waveform {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 28px;
}

.waveform span {
  display: block;
  width: 3px;
  background: currentColor;
  border-radius: 2px;
  animation: wave 1.2s ease-in-out infinite;
}

.waveform span:nth-child(1)  { height: 40%; animation-delay: 0s; }
.waveform span:nth-child(2)  { height: 70%; animation-delay: 0.1s; }
.waveform span:nth-child(3)  { height: 100%; animation-delay: 0.2s; }
.waveform span:nth-child(4)  { height: 55%; animation-delay: 0.3s; }
.waveform span:nth-child(5)  { height: 85%; animation-delay: 0.4s; }
.waveform span:nth-child(6)  { height: 35%; animation-delay: 0.5s; }
.waveform span:nth-child(7)  { height: 65%; animation-delay: 0.6s; }
.waveform span:nth-child(8)  { height: 90%; animation-delay: 0.7s; }

@keyframes wave {
  0%, 100% { transform: scaleY(0.4); }
  50%      { transform: scaleY(1); }
}

.waveform.is-paused span {
  animation-play-state: paused;
  transform: scaleY(0.3);
}

@media (prefers-reduced-motion: reduce) {
  .waveform span { animation: none; transform: scaleY(0.7); }
}

/* Waveform used flat, as a section divider rule */
.waveform-divider {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 14px;
  opacity: 0.5;
}
.waveform-divider span {
  width: 2px;
  background: currentColor;
  border-radius: 1px;
}
.waveform-divider span:nth-child(odd)  { height: 100%; }
.waveform-divider span:nth-child(even) { height: 45%; }

/* Nav link underline built from waveform bars, reveals on hover */
.nav-link { position: relative; }
.nav-link .waveform-divider {
  position: absolute;
  left: 0; right: 0; bottom: -8px;
  height: 8px;
  opacity: 0;
  transition: opacity 0.15s ease;
  color: var(--gold);
}
.nav-link:hover .waveform-divider,
.nav-link.active .waveform-divider {
  opacity: 1;
}

/* Track card cover art hover: cross-fade to a play affordance */
.track-cover-wrap { position: relative; overflow: hidden; }
.track-cover-wrap::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(20,18,26,0.85), transparent 60%);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.track-cover-wrap:hover::after { opacity: 1; }

/* Focus visibility (accessibility floor, not skipped) */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Genre chip */
.genre-chip {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(247,243,236,0.15);
}

/* ---------------------------------------------------------
   Player "flame" — a flickering warm glow around the play
   button while a track is playing. Kept in brand green/gold
   (not literal orange fire) so it stays on-identity.
   --------------------------------------------------------- */
.player-flame {
  position: relative;
  isolation: isolate;
}
.player-flame::before,
.player-flame::after {
  content: '';
  position: absolute;
  inset: -7px;
  border-radius: 9999px;
  background: radial-gradient(circle, var(--gold) 0%, var(--soil-soft) 45%, transparent 72%);
  filter: blur(7px);
  opacity: 0;
  z-index: -1;
  pointer-events: none;
}
.player-flame.is-playing::before {
  opacity: 0.55;
  animation: flame-flicker-a 1.3s ease-in-out infinite;
}
.player-flame.is-playing::after {
  opacity: 0.35;
  animation: flame-flicker-b 0.85s ease-in-out infinite;
}
@keyframes flame-flicker-a {
  0%, 100% { transform: scale(1) translateY(0); opacity: 0.45; }
  22%      { transform: scale(1.18) translateY(-1.5px); opacity: 0.7; }
  48%      { transform: scale(0.92) translateY(1px); opacity: 0.35; }
  74%      { transform: scale(1.1) translateY(-1px); opacity: 0.6; }
}
@keyframes flame-flicker-b {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.25; }
  30%      { transform: scale(1.22) rotate(4deg); opacity: 0.5; }
  62%      { transform: scale(0.88) rotate(-3deg); opacity: 0.2; }
}
@media (prefers-reduced-motion: reduce) {
  .player-flame.is-playing::before,
  .player-flame.is-playing::after {
    animation: none;
    opacity: 0.4;
  }
}
