:root {
  --bg: #f7f4ef;
  --bg-alt: #efe9e0;
  --surface: #ffffff;
  --text: #2c241b;
  --muted: #6b5e4e;
  --accent: #8b5a2b;
  --accent-dark: #6b4220;
  --border: #e0d6c8;
  --radius: 12px;
  --shadow: 0 8px 24px rgba(44, 36, 27, 0.08);
  --font: 'Vazirmatn', system-ui, sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  font-size: 16px;
}

.container {
  width: min(1100px, 92%);
  margin-inline: auto;
}

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 0;
  gap: 1rem;
  flex-wrap: wrap;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-mark {
  font-size: 1.6rem;
  color: var(--accent);
}

.logo strong { display: block; font-size: 1.05rem; }
.logo small { color: var(--muted); font-size: 0.75rem; }

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
}

.main-nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.25rem 0.4rem;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--accent-dark);
  background: var(--bg-alt);
}

/* Hero */
.hero {
  background: linear-gradient(160deg, #3d2b1f 0%, #5c4030 50%, #8b5a2b 100%);
  color: #f8f1e7;
  padding: 4rem 0 4.5rem;
}

.hero-inner { max-width: 780px; }

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.35;
}

.lead {
  font-size: 1.1rem;
  opacity: 0.95;
  margin-bottom: 1.5rem;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.2rem;
  font-size: 0.88rem;
  opacity: 0.85;
  margin-bottom: 2rem;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.btn {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn.primary {
  background: #f8f1e7;
  color: #3d2b1f;
}

.btn.outline {
  border: 1.5px solid rgba(248,241,231,0.6);
  color: #f8f1e7;
}

.btn:hover { transform: translateY(-2px); }

/* Sections */
.section {
  padding: 3.5rem 0;
}

.section.alt { background: var(--bg-alt); }

.section-title {
  font-size: 1.55rem;
  margin-bottom: 1.75rem;
  color: var(--accent-dark);
  position: relative;
  padding-bottom: 0.5rem;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 48px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  box-shadow: var(--shadow);
}

.card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.6rem;
  color: var(--accent-dark);
}

.chapter-list, .feature-list {
  padding-right: 1.3rem;
}

.chapter-list li, .feature-list li {
  margin-bottom: 0.45rem;
}

.text-center { text-align: center; }
.narrow { max-width: 680px; margin-inline: auto; }
.note {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

/* Content pages */
.page-hero {
  background: var(--bg-alt);
  padding: 2.5rem 0 2rem;
  border-bottom: 1px solid var(--border);
}

.page-hero h1 {
  font-size: 1.8rem;
  color: var(--accent-dark);
  margin-bottom: 0.5rem;
}

.page-hero p { color: var(--muted); max-width: 640px; }

.content-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.8rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}

.content-block h2 {
  font-size: 1.25rem;
  color: var(--accent-dark);
  margin-bottom: 0.9rem;
}

.content-block h3 {
  font-size: 1.05rem;
  margin: 1.2rem 0 0.5rem;
}

.content-block p, .content-block li {
  margin-bottom: 0.6rem;
}

.content-block ul, .content-block ol {
  padding-right: 1.4rem;
}

.tag {
  display: inline-block;
  background: var(--bg-alt);
  color: var(--accent-dark);
  font-size: 0.8rem;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  margin-left: 0.35rem;
}

/* Footer */
.site-footer {
  background: #2c241b;
  color: #e8dfd4;
  padding: 2rem 0;
  text-align: center;
  font-size: 0.9rem;
}

.site-footer .small {
  margin-top: 0.6rem;
  opacity: 0.7;
  font-size: 0.8rem;
}

@media (max-width: 640px) {
  .hero { padding: 2.8rem 0 3.2rem; }
  .section { padding: 2.5rem 0; }
  .content-block { padding: 1.3rem 1.2rem; }
}