:root {
  --bg: #f7f1ea;
  --bg-deep: #efe4d5;
  --panel: rgba(255, 255, 255, 0.72);
  --panel-strong: #fffdfb;
  --ink: #171312;
  --muted: #52463d;
  --primary: #b7874d;
  --primary-deep: #6e4326;
  --primary-soft: #f3e5d0;
  --navy: #171c2a;
  --navy-soft: #222d3d;
  --line: rgba(110, 67, 38, 0.16);
  --shadow: 0 18px 45px rgba(23, 19, 18, 0.08);
  --radius: 26px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Vazirmatn", sans-serif;
  background:
    linear-gradient(180deg, rgba(247,241,234,1) 0%, rgba(241,233,224,1) 100%);
  color: var(--ink);
  line-height: 1.8;
  text-rendering: optimizeLegibility;
}

body.font-farsi {
  font-family: "Vazirmatn", sans-serif;
}

body.font-english {
  font-family: "Inter", sans-serif;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.container {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(23, 28, 42, 0.88);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.topbar-inner {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #f0d2a6;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #f2d7a9);
  box-shadow: 0 0 0 8px rgba(183, 135, 77, 0.14);
}

.nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.nav a {
  color: #dfe6f1;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 0.9rem;
  transition: 0.2s ease;
}

.nav a:hover,
.nav a.active {
  color: #f9d39d;
  background: rgba(183, 135, 77, 0.08);
  box-shadow: inset 0 0 0 1px rgba(183, 135, 77, 0.18);
}

.lang-toggle {
  border: 1px solid rgba(240, 210, 166, 0.55);
  background: rgba(183, 135, 77, 0.1);
  color: #f9d39d;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.mobile-menu-button {
  display: none;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.02);
  color: white;
  border-radius: 10px;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.hero {
  background:
    radial-gradient(circle at top left, rgba(183,135,77,0.22), transparent 25%),
    linear-gradient(180deg, #141b2a 0%, #1b2436 100%);
  color: white;
  padding: 84px 0 76px;
  position: relative;
  overflow: hidden;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
  pointer-events: none;
}

.hero::before {
  width: 360px;
  height: 360px;
  background: rgba(183,135,77,0.2);
  right: 10%;
  top: 0;
}

.hero::after {
  width: 350px;
  height: 350px;
  background: rgba(183,135,77,0.12);
  left: 10%;
  bottom: -40px;
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.05fr 1.5fr;
  gap: 50px;
  align-items: center;
}

.cover-wrap {
  display: flex;
  justify-content: center;
}

.cover {
  position: relative;
  width: min(100%, 420px);
  padding: 20px;
  border-radius: 30px;
  background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(183,135,77,0.18));
  box-shadow: 0 26px 56px rgba(0,0,0,0.28);
  border: 1px solid rgba(255,255,255,0.08);
}

.cover::before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(255,255,255,0.12), rgba(183,135,77,0.12));
}

.cover img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.08);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(183,135,77,0.12);
  border: 1px solid rgba(183,135,77,0.38);
  color: #f7d7aa;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 800;
}

.hero h1 {
  margin: 20px 0 12px;
  font-size: clamp(2.6rem, 4vw, 4.6rem);
  line-height: 1.08;
  letter-spacing: -0.05em;
  color: #fff7ee;
}

.subtitle {
  margin: 0;
  font-size: clamp(1.08rem, 2vw, 1.6rem);
  color: rgba(255,255,255,0.8);
}

.meta-row {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,0.14);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  color: #f4d7b0;
  font-weight: 600;
}

.hero-actions {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  padding: 15px 22px;
  font-weight: 700;
  transition: 0.2s ease;
  border: 1px solid transparent;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #d1a267 100%);
  color: #fffdfb;
  box-shadow: 0 16px 35px rgba(183, 135, 77, 0.3);
}

.btn-secondary {
  background: rgba(255,255,255,0.04);
  color: white;
  border-color: rgba(255,255,255,0.14);
}

.page-shell {
  padding: 76px 0 90px;
}

.section-header {
  margin-bottom: 28px;
}

.kicker {
  display: inline-block;
  margin-bottom: 12px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  border: 1px solid rgba(110, 67, 38, 0.14);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--primary-deep);
}

h2 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1.2;
  letter-spacing: -0.04em;
  color: var(--ink);
}

.grid-3,
.grid-2,
.grid-4 {
  display: grid;
  gap: 22px;
}

.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
  background: rgba(255,255,255,0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.info-card {
  position: relative;
  overflow: hidden;
}

.info-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 110px;
  height: 110px;
  background: linear-gradient(135deg, rgba(183,135,77,0.14), rgba(183,135,77,0));
  border-radius: 0 0 100% 0;
}

.card h3 {
  position: relative;
  z-index: 1;
  margin: 0 0 10px;
  font-size: 1.28rem;
  line-height: 1.4;
}

.card p {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--muted);
}

.book-card {
  position: relative;
  display: grid;
  gap: 18px;
  background: linear-gradient(180deg, #fffdfb 0%, #f9f2ea 100%);
}

.book-tag {
  display: inline-flex;
  width: fit-content;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(183,135,77,0.12);
  color: var(--primary-deep);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.book-card h3 {
  margin: 0;
  font-size: clamp(1.4rem, 2vw, 2.1rem);
}

.book-card p {
  margin: 0;
  color: var(--muted);
}

.book-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--primary-deep);
  font-size: 0.8rem;
  font-weight: 700;
}

.book-card .btn {
  width: fit-content;
}

.article-card {
  display: grid;
  gap: 12px;
  min-height: 100%;
}

.article-card .meta {
  display: inline-flex;
  width: fit-content;
  font-size: 0.74rem;
  color: var(--primary-deep);
  background: rgba(183,135,77,0.09);
  padding: 7px 10px;
  border-radius: 999px;
  font-weight: 700;
}

.article-card h3 {
  margin: 0;
  font-size: 1.36rem;
}

.article-card p {
  margin: 0;
  color: var(--muted);
}

.quote-box {
  background: linear-gradient(135deg, rgba(183,135,77,0.1), rgba(255,255,255,0.7));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
}

.quote-box p {
  margin: 0;
  font-size: clamp(1.3rem, 2vw, 1.8rem);
  line-height: 1.7;
  color: var(--ink);
  font-weight: 600;
}

.quote-box span {
  display: block;
  margin-top: 12px;
  color: var(--primary-deep);
  font-weight: 700;
}

.page-hero {
  background: linear-gradient(180deg, rgba(23,28,42,0.96), rgba(29,33,44,0.96));
  color: white;
  padding: 62px 0 40px;
}

.page-hero-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
}

.page-hero h1 {
  margin: 12px 0 0;
  color: white;
  font-size: clamp(2rem, 4vw, 3.3rem);
  letter-spacing: -0.04em;
}

.page-content {
  padding: 34px 0 90px;
}

.article-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.sidebox {
  position: sticky;
  top: 98px;
  background: rgba(255,255,255,0.72);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.sidebox h3 {
  margin: 0 0 12px;
  font-size: 1.2rem;
}

.sidebox ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.sidebox li {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(183,135,77,0.05);
  border: 1px solid rgba(183,135,77,0.09);
  color: var(--muted);
}

.article-menu {
  display: grid;
  gap: 10px;
}

.article-menu-item {
  width: 100%;
  appearance: none;
  border: 1px solid rgba(183, 135, 77, 0.2);
  background: rgba(183,135,77,0.05);
  color: var(--muted);
  border-radius: 12px;
  padding: 12px 14px;
  text-align: right;
  font-weight: 700;
  font-size: 0.96rem;
  line-height: 1.5;
  cursor: pointer;
  transition: 0.2s ease;
}

.article-menu-item:hover,
.article-menu-item.active {
  background: linear-gradient(135deg, rgba(183,135,77,0.14), rgba(183,135,77,0.08));
  border-color: rgba(183,135,77,0.3);
  color: var(--primary-deep);
  box-shadow: inset 0 0 0 1px rgba(183,135,77,0.12);
}

.content-card {
  background: rgba(255,255,255,0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px;
}

.article-detail {
  display: block;
}

.article-header-block {
  padding-bottom: 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(110, 67, 38, 0.12);
}

.article-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(183,135,77,0.12);
  color: var(--primary-deep);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.article-metadata {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.article-title {
  margin: 18px 0 12px;
  font-size: clamp(2rem, 2vw + 1.2rem, 3rem);
  line-height: 1.2;
  letter-spacing: -0.04em;
  color: var(--ink);
}

.article-author-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary-deep);
  font-weight: 700;
  font-size: 0.86rem;
}

.article-author-line svg {
  width: 16px;
  height: 16px;
}

.abstract-box {
  background: linear-gradient(135deg, rgba(183,135,77,0.1), rgba(255,255,255,0.7));
  border: 1px solid rgba(110, 67, 38, 0.12);
  border-radius: 22px;
  padding: 24px 26px;
  margin-bottom: 28px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}

.abstract-box h3 {
  margin: 0 0 16px;
  font-size: 1.3rem;
}

.keywords-row {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: baseline;
  color: var(--muted);
  font-size: 0.88rem;
}

.keywords-label {
  font-weight: 800;
  color: var(--primary-deep);
}

.article-body {
  display: grid;
  gap: 28px;
}

.article-body section {
  padding-top: 4px;
}

.article-body h2 {
  margin: 0 0 18px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(110,67,38,0.12);
  font-size: clamp(1.55rem, 1.6vw + 0.8rem, 2.2rem);
  letter-spacing: -0.03em;
}

.article-body h3 {
  margin: 0 0 12px;
  font-size: 1.2rem;
  color: var(--ink);
}

.article-body p,
.article-body li {
  margin: 0 0 16px;
  font-size: 1rem;
  line-height: 2;
  color: var(--muted);
}

.article-body strong {
  color: var(--ink);
}

.article-list-ordered {
  margin: 0 0 16px 0;
  padding-inline-start: 1.4rem;
  color: var(--ink);
  font-weight: 700;
  line-height: 2;
}

.article-subsection {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(110,67,38,0.12);
}

.author-bio-box {
  margin-top: 36px;
  padding: 24px 26px;
  background: rgba(23, 28, 42, 0.03);
  border: 1px solid rgba(110, 67, 38, 0.12);
  border-radius: 18px;
}

.author-bio-box h2 {
  margin: 0 0 16px;
  font-size: 1.7rem;
}

.author-bio-box p:last-child {
  margin-bottom: 0;
}

.content-card h2,
.content-card h3,
.content-card h4 {
  color: var(--ink);
}

.content-card p,
.content-card li {
  color: var(--muted);
}

.four-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 18px;
}

.four-cards .card {
  min-height: 100%;
}

blockquote {
  margin: 0;
  padding: 18px 22px;
  border-inline-start: 4px solid var(--primary);
  background: rgba(183,135,77,0.05);
  border-radius: 0 14px 14px 0;
  color: var(--ink);
  font-weight: 600;
}

footer {
  background: #0d1728;
  color: rgba(255,255,255,0.7);
  padding: 26px 0;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

@media (max-width: 980px) {
  .hero-grid,
  .article-layout,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .sidebox {
    position: static;
  }

  .four-cards,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .topbar-inner { position: relative; }

  .mobile-menu-button {
    display: inline-flex;
  }

  .nav {
    position: absolute;
    inset: 78px auto auto 0;
    width: min(100%, 420px);
    flex-direction: column;
    align-items: stretch;
    background: rgba(23, 28, 42, 0.96);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 18px;
    padding: 12px;
    display: none;
    box-shadow: 0 22px 50px rgba(0,0,0,0.2);
  }

  .nav.open { display: flex; }

  .nav a {
    display: block;
    padding: 12px 14px;
    border-radius: 10px;
  }

  .lang-toggle {
    padding-inline: 10px;
  }
}

@media (max-width: 640px) {
  .hero { padding-top: 52px; }
  .page-shell { padding-top: 52px; }
  .content-card, .card, .sidebox, .quote-box { padding: 20px; }
  .btn { width: 100%; }
  .hero-actions { display: grid; }
  .footer-inner { text-align: center; justify-content: center; }
}
