/* ERICADE Radio — mobile-first, dark, restrained retro/demoscene theme.
   System font stack only: zero web-font requests. */

:root {
  --bg: #0b0d12;
  --bg-raised: #12151d;
  --bg-card: #171b26;
  --border: #262c3a;
  --text: #e7e9ee;
  --text-dim: #a6acbb;
  --text-faint: #8f96a8; /* meets WCAG AA (>=4.5:1) against bg, bg-raised and bg-card */
  --accent: #ff6ec7;
  --accent-2: #48e0d1;
  --accent-3: #ffd166;
  --focus: #7dd3fc;
  --radius: 10px;
  --max-width: 960px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Subtle CRT/scanline flavor — a thin repeating gradient overlay, restrained and low-cost. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.02) 0px,
    rgba(255, 255, 255, 0.02) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: overlay;
}

@media (prefers-reduced-motion: reduce) {
  body::before {
    display: none;
  }
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent-2);
}

a:hover {
  text-decoration-thickness: 2px;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent-3);
  color: #10131a;
  padding: 0.75em 1.25em;
  z-index: 2000;
  font-weight: 700;
  border-radius: 0 0 var(--radius) 0;
}

.skip-link:focus {
  left: 0;
}

header {
  padding: 2.5rem 1.25rem 2rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(ellipse at 50% -20%, rgba(255, 110, 199, 0.12), transparent 60%),
    var(--bg-raised);
}

.eyebrow {
  margin: 0 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  color: var(--accent-2);
  font-weight: 700;
}

h1 {
  margin: 0 0 0.6rem;
  font-size: clamp(1.5rem, 5vw, 2.4rem);
  letter-spacing: 0.01em;
  text-shadow: 0 0 18px rgba(255, 110, 199, 0.35);
}

.tagline {
  margin: 0 auto;
  max-width: 42rem;
  color: var(--text-dim);
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

section {
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--border);
}

section:last-of-type {
  border-bottom: none;
}

h2 {
  font-size: 1.4rem;
  margin: 0 0 1.25rem;
  letter-spacing: 0.01em;
}

/* --- #listen hero --- */

.now-playing {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.now-playing .badge.live {
  position: absolute;
  top: 1rem;
  right: 1rem;
}

#np-track-view {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.now-playing img {
  width: 96px;
  height: 96px;
  border-radius: 8px;
  background: var(--bg-raised);
  flex-shrink: 0;
}

.now-playing-info {
  flex: 1;
  min-width: 200px;
}

.now-playing-label {
  margin: 0 0 0.25rem;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: var(--text-faint);
}

.track-title {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  font-weight: 600;
}

.track-title .by {
  color: var(--text-faint);
  font-weight: 400;
  margin: 0 0.3em;
}

.track-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0 0 0.6rem;
}

.badge {
  display: inline-block;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.75rem;
  padding: 0.2em 0.6em;
  border-radius: 999px;
}

.badge.live {
  background: rgba(255, 110, 199, 0.15);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}

.rating {
  color: var(--accent-3);
  font-size: 0.85rem;
}

.track-link {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
}

.progress-track {
  height: 4px;
  background: var(--bg-raised);
  border-radius: 999px;
  overflow: hidden;
  margin: 0 0 0.6rem;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  transition: width 1s linear;
}

.next-up {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-dim);
  min-height: 1.2em;
}

.now-playing--message .preset-message {
  font-size: 1.1rem;
  margin: 0;
}

.now-playing--fallback p {
  margin: 0;
  color: var(--text-dim);
}

.player {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.btn {
  display: inline-block;
  font: inherit;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.75em 1.5em;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

.btn-primary {
  background: var(--accent);
  color: #1a0a13;
}

.btn-primary[aria-pressed="true"] {
  background: var(--accent-2);
}

.btn-secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.player-fallback {
  margin: 0;
  font-size: 0.85rem;
}

.player-status {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: var(--text-dim);
  min-height: 1.2em;
  flex-basis: 100%;
}

/* --- stats strip --- */

.stats-strip {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.stats-strip strong {
  color: var(--accent-3);
}

/* --- #recently-played --- */

.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.history-item {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
}

.history-item img {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  flex-shrink: 0;
  background: var(--bg-raised);
}

.history-item .meta {
  min-width: 0;
}

.history-item time {
  display: block;
  font-size: 0.75rem;
  color: var(--text-faint);
}

.history-item .track {
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.history-item .track a {
  color: var(--text);
  text-decoration: none;
}

.history-item .track a:hover {
  color: var(--accent-2);
}

.history-item .tracker-type {
  font-size: 0.75rem;
  color: var(--text-faint);
}

.requested-marker {
  color: var(--accent-3);
}

/* --- #about --- */

#about p {
  color: var(--text-dim);
  max-width: 68ch;
}

#about a {
  color: var(--accent-2);
}

/* --- #explore --- */

.explore-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .explore-cards {
    grid-template-columns: 1fr 1fr;
  }
}

.explore-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  background: var(--bg-raised);
}

.explore-card h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
}

.explore-card p {
  margin: 0 0 0.6rem;
  color: var(--text-faint);
  font-size: 0.9rem;
}

footer {
  padding: 2rem 1.25rem 3rem;
  text-align: center;
  color: var(--text-faint);
  font-size: 0.85rem;
}

footer a {
  color: var(--text-dim);
}

footer p {
  margin: 0.3rem 0;
}
