:root {
  --bg:        #0e0e0e;
  --surface:   #151515;
  --border:    #2a2a2a;
  --muted:     #555;
  --subdued:   #888;
  --text:      #d4cfca;
  --accent:    #c9a96e;
  --serif:     'Lora', Georgia, serif;
}

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

html {
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(201,169,110,0.04) 0%, transparent 60%),
    var(--bg);
}

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 4rem 1.5rem 8rem;
}

/* ── Header ── */
.site-header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 4rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.site-title {
  font-family: var(--serif);
  font-size: 0.8rem;
  font-weight: 300;
  letter-spacing: 0.2em;
  text-transform: lowercase;
  color: var(--accent);
  text-decoration: none;
  opacity: 0.9;
  transition: opacity 0.2s;
}
.site-title:hover { opacity: 1; }

.site-desc {
  font-family: var(--serif);
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.05em;
}

/* ── Post List ── */
main { display: flex; flex-direction: column; gap: 0; }

.post-entry {
  display: grid;
  grid-template-columns: 7rem 1fr auto;
  align-items: baseline;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
  animation: fadeUp 0.4s ease both;
}

.post-entry:nth-child(1) { animation-delay: 0.05s; }
.post-entry:nth-child(2) { animation-delay: 0.1s; }
.post-entry:nth-child(3) { animation-delay: 0.15s; }
.post-entry:nth-child(4) { animation-delay: 0.2s; }
.post-entry:nth-child(5) { animation-delay: 0.25s; }

.post-date {
  font-family: var(--serif);
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.post-title {
  font-family: var(--serif);
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
}
.post-title:hover { color: var(--accent); }

.draft-badge {
  font-family: var(--serif);
  font-size: 0.6rem;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 0.1em 0.5em;
  border-radius: 2px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

/* ── Single Post ── */
.post {
  animation: fadeUp 0.5s ease both;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.post-heading {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 400;
  font-style: italic;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 2.5rem;
  letter-spacing: -0.01em;
}

.post-content {
  font-size: 1rem;
  line-height: 1.85;
  color: #bfbab4;
}

.post-content p { margin-bottom: 1.4em; }

.post-content p:last-child { margin-bottom: 0; }

.post-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(201,169,110,0.4);
  transition: text-decoration-color 0.2s;
}
.post-content a:hover { text-decoration-color: var(--accent); }

.post-content code {
  font-family: var(--serif);
  font-size: 0.82em;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.1em 0.4em;
  border-radius: 3px;
  color: var(--accent);
}

.post-content blockquote {
  border-left: 2px solid var(--accent);
  margin: 1.5em 0;
  padding: 0.5em 0 0.5em 1.5em;
  color: var(--subdued);
  font-style: italic;
}

.post-content h2, .post-content h3 {
  font-family: var(--serif);
  font-size: 0.8rem;
  font-weight: 300;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--subdued);
  margin: 2.5em 0 1em;
}

.post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5em 0;
}

.post-footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.back-link {
  font-family: var(--serif);
  font-size: 0.72rem;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.05em;
  transition: color 0.2s;
}
.back-link:hover { color: var(--accent); }

/* ── Animations ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Mobile ── */
@media (max-width: 500px) {
  .post-entry {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }
  .post-date { font-size: 0.65rem; }

  .hero-cards {
    grid-template-columns: 1fr;
  }

  .book-list-header {
    display: none;
  }

  .book-item {
    grid-template-columns: 20px 1fr;
    grid-template-rows: auto auto;
    gap: 0.5rem;
  }

  .book-item .book-status {
    grid-row: 1 / 2;
  }

  .book-item .book-title {
    grid-column: 2 / 3;
  }

  .book-item .book-author,
  .book-item .book-difficulty,
  .book-item .book-priority {
    grid-column: 2 / 3;
    font-size: 0.65rem;
    padding-top: 0.25rem;
  }
}

/* ── Desktop: full book table ── */
@media (min-width: 768px) {
  .container {
    max-width: 960px;
  }
  
  .book-list-header {
    display: grid;
    grid-template-columns: 20px 3fr 1.5fr 1fr 1fr;
    gap: 0.75rem;
  }
  
  .book-item {
    grid-template-columns: 20px 3fr 1.5fr 1fr 1fr;
  }
  
  .book-title,
  .book-author {
    white-space: nowrap;
  }
}

/* ── Library ── */
/* ── Hero Section ── */
.hero {
  margin-bottom: 4rem;
  animation: fadeUp 0.5s ease both;
}

.hero-content {
  text-align: center;
  padding: 2rem 0 3rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.hero-title {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-family: var(--serif);
  font-size: 0.75rem;
  color: var(--subdued);
  letter-spacing: 0.05em;
}

.hero-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.hero-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.2s;
  animation: fadeUp 0.5s ease both;
}

.hero-card:nth-child(1) { animation-delay: 0.1s; }
.hero-card:nth-child(2) { animation-delay: 0.2s; }

.hero-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.card-icon {
  font-size: 2rem;
  margin-bottom: 0.25rem;
}

.card-title {
  font-family: var(--serif);
  font-size: 0.85rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
}

.card-desc {
  font-family: var(--serif);
  font-size: 0.75rem;
  color: var(--muted);
  font-style: italic;
}

.library-card .card-icon { color: #c9a96e; }
.queue-card .card-icon { color: #4a9eff; }

/* ── Posts Section ── */
.posts-section {
  animation: fadeUp 0.5s ease both;
  animation-delay: 0.3s;
  opacity: 0;
  fill-mode: forwards;
}

.section-heading {
  font-family: var(--serif);
  font-size: 0.7rem;
  font-weight: 300;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--subdued);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* ── Library ── */
.book-count {
  font-family: var(--serif);
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 0.05em;
}

.book-list {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
}

.book-list-header {
  display: grid;
  grid-template-columns: 20px 2fr 1.5fr 1fr 1fr;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 0.5rem;
}

.book-list-header span {
  font-family: var(--serif);
  font-size: 0.65rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--subdued);
}

.book-item {
  display: grid;
  grid-template-columns: 20px 2fr 1.5fr 1fr 1fr;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  animation: fadeUp 0.3s ease both;
}

.book-item:nth-child(2) { animation-delay: 0.05s; }
.book-item:nth-child(3) { animation-delay: 0.1s; }
.book-item:nth-child(4) { animation-delay: 0.15s; }
.book-item:nth-child(5) { animation-delay: 0.2s; }
.book-item:nth-child(6) { animation-delay: 0.25s; }

.book-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.book-status.status-unread { background: #555; }
.book-status.status-reading { background: #4a9eff; }
.book-status.status-done { background: #4cd964; }
.book-status.status-dropped { background: #888; }

.book-title {
  font-family: var(--serif);
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
  overflow: hidden;
  text-overflow: ellipsis;
}
.book-title:hover { color: var(--accent); }

.book-author {
  font-family: var(--serif);
  font-size: 0.7rem;
  color: var(--subdued);
  overflow: hidden;
  text-overflow: ellipsis;
}

.book-difficulty {
  font-family: var(--serif);
  font-size: 0.6rem;
  padding: 0.1em 0.5em;
  border-radius: 2px;
  letter-spacing: 0.05em;
  white-space: nowrap;
  display: inline-block;
  text-align: center;
}
.book-difficulty.difficulty-Beginner { color: #4cd964; border: 1px solid #4cd964; }
.book-difficulty.difficulty-Intermediate { color: #4a9eff; border: 1px solid #4a9eff; }
.book-difficulty.difficulty-Advanced { color: #ff6b6b; border: 1px solid #ff6b6b; }
.book-difficulty:empty, .book-difficulty:not([class*="difficulty-"]) { 
  color: var(--muted); 
  border: none;
}

.book-priority {
  font-family: var(--serif);
  font-size: 0.65rem;
  color: var(--muted);
  white-space: nowrap;
}

.book-description {
  font-style: italic;
  color: var(--subdued);
  margin-bottom: 1.5rem;
}

/* ── Queue Page ── */
.queue-page {
  animation: fadeUp 0.5s ease both;
}

.queue-header {
  text-align: center;
  padding: 2rem 0 3rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.queue-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 1rem;
  color: var(--accent);
}

.queue-title {
  font-family: var(--serif);
  font-size: 1.8rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.queue-desc {
  font-family: var(--serif);
  font-size: 0.75rem;
  color: var(--subdued);
  letter-spacing: 0.05em;
}

.queue-nav {
  margin-bottom: 2rem;
}

.queue-back {
  font-family: var(--serif);
  font-size: 0.72rem;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.05em;
  transition: color 0.2s;
}
.queue-back:hover { color: var(--accent); }

.queue-content h2 {
  font-family: var(--serif);
  font-size: 0.8rem;
  font-weight: 300;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--subdued);
  margin: 2rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.queue-content h2:first-child {
  margin-top: 0;
}

.queue-content ul {
  list-style: none;
  padding-left: 0;
}

.queue-content li {
  font-family: var(--serif);
  font-size: 0.95rem;
  color: var(--text);
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.queue-content li::before {
  content: "•";
  color: var(--accent);
  font-size: 1.2rem;
  line-height: 1;
}

.queue-content .roadmap-section h3 {
  font-family: var(--serif);
  font-size: 0.7rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin: 1.5rem 0 0.75rem;
}

.queue-content .roadmap-section p {
  font-family: var(--serif);
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.8;
}

.queue-content .roadmap-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.queue-content .roadmap-section:last-child {
  margin-bottom: 0;
}

.site-nav {
  margin-top: 0.4rem;
}

.site-nav a {
  font-family: var(--serif);
  font-size: 0.72rem;
  color: var(--color-muted, #aaa);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.site-nav a:hover {
  color: var(--color-text, #1a1a1a);
}
