:root {
  --bg: #07151f;
  --bg-alt: #0d2433;
  --panel: rgba(255, 255, 255, 0.08);
  --text: #f3f5f7;
  --muted: #b7c3cc;
  --accent: #ff6a3d;
  --accent-2: #ffd166;
  --line: rgba(255, 255, 255, 0.15);
  --maxw: 1100px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  color: var(--text);
  font-family: "Manrope", sans-serif;
  background:
    radial-gradient(1200px 800px at 85% -10%, rgba(255, 106, 61, 0.3), transparent 60%),
    radial-gradient(1000px 700px at -20% 30%, rgba(255, 209, 102, 0.25), transparent 55%),
    linear-gradient(160deg, var(--bg) 0%, var(--bg-alt) 100%);
  overflow-x: hidden;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.16;
  background-image:
    linear-gradient(transparent 95%, rgba(255, 255, 255, 0.05) 96%),
    linear-gradient(90deg, transparent 95%, rgba(255, 255, 255, 0.04) 96%);
  background-size: 3px 3px, 4px 4px;
}

.site-header,
main,
.site-footer {
  position: relative;
  z-index: 1;
}

/* ─── HEADER ─── */
.site-header {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.25rem 1rem;
  padding-top: max(1.25rem, env(safe-area-inset-top));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  text-decoration: none;
  display: flex;
  align-items: center;
}

.logo-img {
  height: clamp(2.2rem, 4vw, 3rem);
  width: auto;
  display: block;
}

.nav {
  display: flex;
  gap: 1rem;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  transition: color 200ms;
}

.nav a:hover {
  color: var(--text);
}

main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

/* ─── HERO ─── */
.hero {
  padding: 3.5rem 0 2.5rem;
}

.kicker {
  display: inline-block;
  margin: 0;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-2);
}

h1,
h2,
h3 {
  margin: 0;
}

h1 {
  margin-top: 1rem;
  max-width: 14ch;
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: 0.03em;
  line-height: 0.95;
  font-size: clamp(2.8rem, 9vw, 6rem);
}

.lead {
  margin-top: 1rem;
  max-width: 60ch;
  color: var(--muted);
  line-height: 1.7;
}

.hero-actions {
  margin-top: 1.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ─── BUTTONS ─── */
.btn {
  border: none;
  border-radius: 10px;
  padding: 0.8rem 1.1rem;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  font-family: inherit;
  transition: transform 220ms ease, filter 220ms ease, background-color 220ms ease;
}

.btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
}

.btn.primary {
  background: linear-gradient(120deg, var(--accent), #ff8f66);
  color: #1b0f0a;
}

.btn.secondary {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.btn.ghost {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
}

.play-icon {
  margin-right: 0.3rem;
}

/* ─── STATUS CARD ─── */
.status-card {
  margin-top: 1.1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

.dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: #45ff8a;
  box-shadow: 0 0 12px #45ff8a;
  animation: pulse 1.4s infinite;
}

/* ─── PLAYER SECTION ─── */
.player-section {
  padding: 2rem 0;
}

.player-wrapper {
  display: flex;
  gap: 2rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.5rem;
  background: var(--panel);
  backdrop-filter: blur(10px);
}

.cover-container {
  position: relative;
  width: 220px;
  height: 220px;
  min-width: 220px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(255, 106, 61, 0.25);
}

.cover-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 400ms;
}

.vinyl-spin {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 300ms;
}

.vinyl-spin.active {
  opacity: 1;
  background: conic-gradient(
    from 0deg,
    transparent,
    rgba(255, 106, 61, 0.08) 25%,
    transparent 50%,
    rgba(255, 209, 102, 0.06) 75%,
    transparent
  );
  animation: spin 4s linear infinite;
}

.player-info {
  flex: 1;
}

.now-label {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.now-artist {
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: 0.02em;
  margin-top: 0.3rem;
  line-height: 1.1;
}

.now-title {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.2rem;
}

.play-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1.6rem;
  font-size: 1rem;
  border-radius: 50px;
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.vol-icon {
  font-size: 1.2rem;
}

#volumeSlider {
  -webkit-appearance: none;
  appearance: none;
  width: 100px;
  height: 4px;
  border-radius: 2px;
  background: var(--line);
  outline: none;
}

#volumeSlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

#volumeSlider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: none;
}

/* ─── AUDIO VISUALIZER ─── */
.audio-visualizer {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 24px;
  margin-top: 1rem;
  opacity: 0;
  transition: opacity 300ms;
}

.audio-visualizer.active {
  opacity: 1;
}

.audio-visualizer span {
  display: block;
  width: 4px;
  background: var(--accent);
  border-radius: 2px;
  height: 4px;
  transition: height 150ms;
}

.audio-visualizer.active span {
  animation: bars 600ms ease-in-out infinite alternate;
}

.audio-visualizer.active span:nth-child(1) { animation-delay: 0ms; }
.audio-visualizer.active span:nth-child(2) { animation-delay: 100ms; }
.audio-visualizer.active span:nth-child(3) { animation-delay: 200ms; }
.audio-visualizer.active span:nth-child(4) { animation-delay: 300ms; }
.audio-visualizer.active span:nth-child(5) { animation-delay: 400ms; }

/* ─── HISTORY / CRONOLOGIA ─── */
.history-section {
  padding: 2rem 0;
}

.section-desc {
  color: var(--muted);
  margin: 0 0 1rem;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  backdrop-filter: blur(6px);
  transition: border-color 200ms;
}

.history-item-cover {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.history-item-cover::after {
  content: '\1F3B5';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--accent);
  z-index: 0;
}

.history-item-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: relative;
  z-index: 1;
}

.history-item-info {
  flex: 1;
  min-width: 0;
}

.history-item-artist {
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.history-now-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: var(--accent);
  color: #1b0f0a;
  flex-shrink: 0;
}

.history-item--now {
  border-color: var(--accent);
  background: rgba(255, 106, 61, 0.08);
}

.history-item-title {
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-item-time {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  min-width: 45px;
  text-align: right;
}

.history-placeholder {
  color: var(--muted);
  padding: 2rem;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 12px;
}

/* ─── HEADINGS ─── */
h2 {
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(1.8rem, 4vw, 3rem);
  letter-spacing: 0.04em;
  margin-bottom: 0.8rem;
}

/* ─── FOOTER ─── */
.site-footer {
  max-width: var(--maxw);
  margin: 1.8rem auto 1rem;
  border-top: 1px solid var(--line);
  padding: 1.5rem 1rem 1rem;
  color: var(--muted);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.footer-logo-img {
  height: 2.4rem;
  width: auto;
  display: block;
  margin-bottom: 0.3rem;
}

.footer-brand p {
  margin: 0.3rem 0 0;
}

.footer-links p {
  margin: 0.2rem 0;
}

.site-footer a {
  color: var(--text);
}

.footer-copy {
  margin-top: 1rem;
  padding-bottom: env(safe-area-inset-bottom);
  font-size: 0.8rem;
  opacity: 0.6;
}

/* ─── ANIMATIONS ─── */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  animation: rise 700ms ease forwards;
}

.player-section.reveal {
  animation-delay: 80ms;
}

.history-section.reveal {
  animation-delay: 160ms;
}

.site-footer.reveal {
  animation-delay: 340ms;
}

@keyframes pulse {
  0% { transform: scale(0.95); }
  70% { transform: scale(1.08); }
  100% { transform: scale(0.95); }
}

@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes bars {
  0% { height: 4px; }
  100% { height: 20px; }
}

/* ─── RESPONSIVE ─── */
@media (max-width: 920px) {
  .site-header {
    flex-wrap: wrap;
  }

  .player-wrapper {
    flex-direction: column;
    text-align: center;
  }

  .cover-container {
    width: 200px;
    height: 200px;
    min-width: 200px;
  }

  .player-controls {
    justify-content: center;
  }

  .audio-visualizer {
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .nav {
    width: 100%;
    order: 3;
    justify-content: space-between;
    font-size: 0.95rem;
  }

  h1 {
    max-width: none;
  }

  .cover-container {
    width: 180px;
    height: 180px;
    min-width: 180px;
  }

  .player-wrapper {
    padding: 1rem;
  }

  .volume-control {
    display: none;
  }

  .footer-content {
    flex-direction: column;
    gap: 1rem;
  }
}
