*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0f0f0f;
  --surface: #1a1a1a;
  --surface-hover: #222222;
  --border: #2a2a2a;
  --accent: #f59e0b;
  --accent-dim: #b37308;
  --text: #e5e5e5;
  --text-muted: #888888;
  --radius: 10px;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-dim);
  text-decoration: underline;
}

/* ── Header ── */

header {
  border-bottom: 1px solid var(--border);
  padding: 2rem 1rem;
}

.header-inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

#cover-art {
  width: 96px;
  height: 96px;
  border-radius: var(--radius);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface);
}

.header-text h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.tagline {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.header-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.rss-btn,
.apple-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}

.rss-btn {
  border: 1px solid var(--accent);
  color: var(--accent);
}

.rss-btn:hover {
  background: var(--accent);
  color: #000;
  text-decoration: none;
}

.apple-btn {
  border: 1px solid var(--accent);
  color: var(--accent);
}

.apple-btn:hover {
  background: var(--accent);
  color: #000;
  text-decoration: none;
}

/* ── Main ── */

main {
  flex: 1;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* ── Episode cards ── */

.episode-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}

.episode-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.episode-title {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
}

.episode-meta {
  font-family: monospace;
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.episode-meta span + span::before {
  content: " · ";
}

audio {
  width: 100%;
  margin: 0.85rem 0 0.75rem;
  accent-color: var(--accent);
  border-radius: 4px;
}

/* Chrome/Safari native audio tweaks */
audio::-webkit-media-controls-panel {
  background: var(--surface-hover);
}

.episode-description {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.episode-description ul {
  padding-left: 1.2rem;
  margin: 0.25rem 0 0;
}

.episode-description li {
  margin-bottom: 0.2rem;
}

/* ── Skeleton loading ── */

.skeleton {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}

.skeleton-line {
  background: var(--border);
  border-radius: 4px;
  animation: pulse 1.4s ease-in-out infinite;
}

.skeleton-line.title {
  height: 18px;
  width: 70%;
  margin-bottom: 0.75rem;
}

.skeleton-line.meta {
  height: 12px;
  width: 30%;
  margin-bottom: 1rem;
}

.skeleton-line.player {
  height: 36px;
  width: 100%;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* ── Error state ── */

#error-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

#error-state a {
  color: var(--accent);
}

/* ── Footer ── */

footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 1rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

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

footer a:hover {
  color: var(--accent);
}

/* ── Mobile ── */

@media (max-width: 480px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  #cover-art {
    width: 72px;
    height: 72px;
  }

  .header-text h1 {
    font-size: 1.25rem;
  }

  .episode-header {
    flex-direction: column;
    gap: 0.25rem;
  }

  .episode-meta {
    white-space: normal;
  }
}
