:root {
  color-scheme: dark;
  --background: #101014;
  --surface: #19191f;
  --surface-hover: #22222b;
  --text: #f5f5f7;
  --muted: #9999a5;
  --accent: #a78bfa;
  --border: #30303a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  min-height: 72px;
  padding: 16px 6%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(16, 16, 20, .9);
}

.brand {
  color: var(--text);
  text-decoration: none;
  font-size: 18px;
  font-weight: 800;
}

nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

nav button,
.primary {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 15px;
  background: var(--surface);
  color: var(--text);
}

nav button:hover {
  background: var(--surface-hover);
}

main {
  width: min(1100px, 88%);
  margin: auto;
  padding-bottom: 100px;
}

.hero {
  padding: 85px 0 55px;
  max-width: 700px;
}

.eyebrow {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
}

h1 {
  margin: 12px 0;
  font-size: clamp(38px, 7vw, 68px);
  line-height: 1.05;
  letter-spacing: -2px;
}

.hero > p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.7;
}

.search {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 480px;
  margin-top: 28px;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.search span {
  color: var(--muted);
  font-size: 22px;
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.section {
  margin: 45px 0;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 22px;
}

.section-heading h2 {
  margin: 5px 0 0;
  font-size: 28px;
}

.section-heading > span {
  color: var(--muted);
  font-size: 13px;
}

.episode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.episode-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--surface);
  transition: transform .2s, background .2s;
}

.episode-card:hover {
  transform: translateY(-3px);
  background: var(--surface-hover);
}

.episode-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #292934;
}

.episode-content {
  padding: 16px;
}

.episode-content h3 {
  margin: 0 0 9px;
  font-size: 17px;
}

.episode-content p,
.episode-date {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.episode-actions {
  display: flex;
  gap: 8px;
  margin-top: 15px;
}

.episode-actions button {
  flex: 1;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #292934;
  color: var(--text);
}

.episode-actions button:hover {
  border-color: var(--accent);
}

.account-panel {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}

footer {
  padding: 30px 6%;
  border-top: 1px solid var(--border);
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

dialog {
  width: min(420px, 90%);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
}

dialog::backdrop {
  background: rgba(0, 0, 0, .75);
  backdrop-filter: blur(5px);
}

dialog form {
  position: relative;
  display: grid;
  gap: 15px;
  padding: 28px;
}

dialog h2 {
  margin: 0;
}

dialog label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

dialog input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  background: var(--background);
  color: var(--text);
}

dialog input:focus {
  border-color: var(--accent);
}

.close {
  position: absolute;
  top: 12px;
  right: 15px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 25px;
}

.primary {
  border: 0;
  background: var(--accent);
  color: #17121f;
  font-weight: 800;
}

.error {
  color: #ff8585;
  font-size: 13px;
}

.player {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 6%;
  border-top: 1px solid var(--border);
  background: rgba(25, 25, 31, .97);
  backdrop-filter: blur(15px);
}

.player-info {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.player-info strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-info span {
  color: var(--muted);
  font-size: 12px;
}

.player audio {
  width: min(480px, 55%);
}

[hidden] {
  display: none !important;
}

@media (max-width: 600px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero {
    padding-top: 55px;
  }

  .player {
    align-items: stretch;
    flex-direction: column;
  }

  .player audio {
    width: 100%;
  }
}
