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

:root {
  --bg: #faf8f5;
  --bg-card: #ffffff;
  --text: #5a5550;
  --heading: #1a1714;
  --accent: #846800;
  --border: #e5e0da;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
}

[data-theme="dark"] {
  --bg: #181833;
  --bg-card: #152038;
  --text: #b0bdd4;
  --heading: #e8edf5;
  --accent: #d4a500;
  --border: #1e2d4a;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  transition: background 0.3s, color 0.3s;
  min-height: 100vh;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px;
  max-width: 780px;
  margin: 0 auto;
}

.logo {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--heading);
  text-decoration: none;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  transition: border-color 0.2s, color 0.2s;
}
.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

main {
  max-width: 780px;
  margin: 0 auto;
  padding: 20px 32px 80px;
}

h1 {
  font-size: 2rem;
  color: var(--heading);
  margin-bottom: 8px;
  font-weight: 600;
}

.subtitle {
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 32px;
  line-height: 1.6;
}
.subtitle a {
  color: var(--accent);
  text-decoration: none;
}
.subtitle a:hover {
  text-decoration: underline;
}

.back {
  display: inline-block;
  font-size: 0.82rem;
  color: var(--accent);
  text-decoration: none;
  margin-bottom: 24px;
  letter-spacing: 0.02em;
}
.back:hover { text-decoration: underline; }

article h1 { font-size: 1.6rem; margin: 0 0 8px; }
article h2 { font-size: 1.2rem; margin: 28px 0 12px; color: var(--heading); font-weight: 600; }
article h3 { font-size: 1rem; margin: 20px 0 8px; color: var(--heading); }

article p { margin-bottom: 12px; font-size: 0.92rem; }

article blockquote {
  border-left: 3px solid var(--accent);
  padding: 12px 20px;
  margin: 16px 0;
  background: var(--bg-card);
  border-radius: 0 8px 8px 0;
  font-size: 0.95rem;
  font-style: italic;
  color: var(--heading);
}

article hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

article ul {
  list-style: none;
  padding: 0;
  margin-bottom: 16px;
}

article li {
  padding: 6px 0 6px 20px;
  font-size: 0.9rem;
  position: relative;
}
article li::before {
  content: '›';
  position: absolute;
  left: 4px;
  color: var(--accent);
  font-weight: 600;
}

article table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.85rem;
}
article th, article td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
article th {
  font-weight: 600;
  color: var(--heading);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

.digest-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.digest-card {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
  text-decoration: none;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.digest-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.digest-date {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--heading);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.digest-preview {
  font-size: 0.82rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty {
  font-size: 0.9rem;
  color: var(--text);
  padding: 40px 0;
  text-align: center;
}


.spotify-embed {
  margin: 16px 0;
  border-radius: 12px;
  overflow: hidden;
}

.spotify-play-btn {
  display: inline-block;
  padding: 2px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  border-radius: 999px;
  background: #1db954;
  color: #fff;
  border: none;
  cursor: pointer;
  margin-left: 8px;
  vertical-align: middle;
  transition: background 0.2s;
}
.spotify-play-btn:hover {
  background: #1ed760;
}

.spotify-mini-embed {
  display: none;
  margin: 8px 0 4px;
  border-radius: 12px;
  overflow: hidden;
}
.spotify-mini-embed.show {
  display: block;
}

@media (max-width: 600px) {
  main { padding: 16px 20px 60px; }
  h1 { font-size: 1.6rem; }
  .digest-card { flex-direction: column; gap: 4px; }
  article table { font-size: 0.78rem; }
  article th, article td { padding: 6px 8px; }
}