:root {
  --bg-body: #07090e;
  --bg-surface: #0e131f;
  --bg-card: rgba(18, 24, 38, 0.75);
  --bg-card-hover: rgba(24, 32, 50, 0.9);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(56, 189, 248, 0.35);
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --cyan: #38bdf8;
  --cyan-glow: rgba(56, 189, 248, 0.15);
  --indigo: #818cf8;
  --emerald: #34d399;
  --purple: #c084fc;
  --font-vazir: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius-xl: 20px;
  --radius-lg: 14px;
  --radius-md: 10px;
}

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

body {
  font-family: var(--font-vazir);
  background-color: var(--bg-body);
  color: var(--text-main);
  direction: rtl;
  text-align: right;
  line-height: 1.8;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(56, 189, 248, 0.07) 0%, transparent 40%),
    radial-gradient(circle at 85% 30%, rgba(129, 140, 248, 0.07) 0%, transparent 45%),
    radial-gradient(circle at 50% 80%, rgba(52, 211, 153, 0.05) 0%, transparent 50%);
  background-attachment: fixed;
  min-height: 100vh;
}

a {
  color: var(--cyan);
  text-decoration: none;
  transition: all 0.2s ease;
}

a:hover {
  color: #7dd3fc;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(7, 9, 14, 0.82);
  border-bottom: 1px solid var(--border-subtle);
  padding: 16px 0;
}

.nav-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--cyan), var(--indigo));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
}

.brand span {
  background: linear-gradient(135deg, #fff 40%, var(--cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-menu {
  display: flex;
  gap: 28px;
  list-style: none;
  align-items: center;
}

.nav-link {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.nav-link:hover {
  color: #fff;
}

.btn-github {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: #fff;
  padding: 7px 16px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.25s;
}

.btn-github:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  transform: translateY(-1px);
}

/* Hero */
.hero {
  padding: 90px 0 60px;
  text-align: center;
  position: relative;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 18px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: var(--cyan);
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 24px;
}

.hero-title {
  font-size: 3.2rem;
  font-weight: 900;
  letter-spacing: -0.8px;
  line-height: 1.25;
  margin-bottom: 22px;
}

.gradient-text {
  background: linear-gradient(135deg, #38bdf8 0%, #818cf8 50%, #c084fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-lead {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 800px;
  margin: 0 auto 36px;
  line-height: 1.8;
}

.hero-cta {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 60px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 30px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 25px rgba(2, 132, 199, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0369a1 0%, #1d4ed8 100%);
  box-shadow: 0 6px 30px rgba(2, 132, 199, 0.5);
  transform: translateY(-2px);
  color: #fff;
}

.btn-outline {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: #fff;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  transform: translateY(-2px);
}

/* Stats */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 90px;
}

.stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  backdrop-filter: blur(10px);
  transition: all 0.25s;
}

.stat-box:hover {
  border-color: var(--border-highlight);
  transform: translateY(-3px);
}

.stat-num {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--cyan);
  line-height: 1.1;
  margin-bottom: 6px;
}

.stat-text {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Section Header */
.section-head {
  text-align: center;
  margin-bottom: 50px;
}

.section-badge {
  display: inline-block;
  padding: 4px 14px;
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.3);
  color: var(--emerald);
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 14px;
}

.section-title {
  font-size: 2.3rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.section-desc {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 650px;
  margin: 0 auto;
}

/* Books Grid & Card */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 32px;
  margin-bottom: 100px;
}

.book-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 34px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(12px);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.book-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-highlight);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 30px var(--cyan-glow);
}

.book-status {
  align-self: flex-start;
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(52, 211, 153, 0.15);
  border: 1px solid rgba(52, 211, 153, 0.35);
  color: var(--emerald);
  margin-bottom: 16px;
}

.book-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
  line-height: 1.35;
}

.book-orig {
  font-size: 0.9rem;
  color: var(--text-dim);
  font-style: italic;
  direction: ltr;
  text-align: right;
  margin-bottom: 18px;
}

.book-info-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.88rem;
  color: #cbd5e1;
  padding: 12px 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 18px;
}

.book-desc {
  color: var(--text-muted);
  font-size: 0.96rem;
  line-height: 1.7;
  margin-bottom: 24px;
  flex-grow: 1;
}

.book-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.tag-badge {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  padding: 4px 11px;
  border-radius: 6px;
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 500;
}

.book-btn-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: auto;
}

.btn-sm {
  padding: 10px 20px;
  font-size: 0.9rem;
}

/* Features */
.features-section {
  padding: 80px 0;
  background: rgba(14, 19, 31, 0.6);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 90px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 28px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 30px;
  transition: all 0.3s;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: rgba(129, 140, 248, 0.35);
}

.feature-icon-box {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 20px;
}

.feature-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
}

.feature-text {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* Footer */
.site-footer {
  padding: 50px 0 40px;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.footer-sub {
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--text-dim);
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 2.3rem;
  }
  .books-grid {
    grid-template-columns: 1fr;
  }
  .nav-menu {
    gap: 16px;
  }
}

/* Article & Markdown Content */
.prose-content {
  line-height: 1.9;
  font-size: 1.05rem;
  color: #e2e8f0;
}

.prose-content h2 {
  font-size: 1.7rem;
  font-weight: 800;
  color: #fff;
  margin: 36px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.prose-content h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--cyan);
  margin: 28px 0 14px;
}

.prose-content p {
  margin-bottom: 18px;
  color: var(--text-muted);
}

.prose-content ol, .prose-content ul {
  padding-right: 24px;
  margin-bottom: 24px;
}

.prose-content li {
  margin-bottom: 10px;
  color: #cbd5e1;
}

.prose-content strong {
  color: #fff;
}

/* Backward compatibility aliases */
.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: #fff;
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  transform: translateY(-2px);
}
.book-badge {
  align-self: flex-start;
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(52, 211, 153, 0.15);
  border: 1px solid rgba(52, 211, 153, 0.35);
  color: var(--emerald);
  margin-bottom: 16px;
}
.tag {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  padding: 4px 11px;
  border-radius: 6px;
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 500;
}
.book-orig-title {
  font-size: 0.9rem;
  color: var(--text-dim);
  font-style: italic;
  direction: ltr;
  text-align: right;
  margin-bottom: 18px;
}
.book-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.88rem;
  color: #cbd5e1;
  padding: 12px 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 18px;
}
.book-footer {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: auto;
}

/* Backlog & Contributor Badge */
.book-status.backlog {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

/* Books Row List Layout (One book per row) */
.books-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 50px;
}

.book-row-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(12px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.book-row-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-highlight);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.book-row-card.published {
  border-right: 4px solid var(--emerald);
}

.book-row-card.backlog {
  border-right: 4px solid #f59e0b;
}

.book-row-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 10px;
}

.book-row-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.book-row-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  margin: 0;
}

.book-row-title a {
  color: #fff;
  transition: color 0.2s;
}

.book-row-title a:hover {
  color: var(--cyan);
}

.book-row-orig {
  font-size: 0.9rem;
  color: var(--text-dim);
  font-style: italic;
  direction: ltr;
}

.book-row-desc {
  color: var(--text-muted);
  font-size: 0.96rem;
  line-height: 1.7;
  margin-bottom: 14px;
}

.book-row-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.book-row-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  font-size: 0.88rem;
  color: #cbd5e1;
}

.book-row-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Styled Section Divider */
.section-divider {
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.35), transparent);
  margin: 60px 0 70px;
}
